From 364f9de1491cc48d8a03085a5748e81dcaea4a63 Mon Sep 17 00:00:00 2001 From: Julius Werner Date: Mon, 7 Dec 2020 14:57:01 -0800 Subject: [PATCH] cbmem: Make cbmem_online() accurate on stages after romstage cbmem_online() always returns 1 in stages after romstage. However, CBMEM isn't actually immediately available in those stages -- instead, it will only become available when cbmem_initialize() is called. That usually happens very early in the stage, but there are still small amounts of code running beforehand, so it is useful to reflect this distinction. Signed-off-by: Julius Werner Change-Id: I623c0606a4f49ea98c4c7559436bf32ebb83b456 Reviewed-on: https://review.coreboot.org/c/coreboot/+/48428 Tested-by: build bot (Jenkins) Reviewed-by: Furquan Shaikh Reviewed-by: Arthur Heymans --- src/include/cbmem.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/include/cbmem.h b/src/include/cbmem.h index 7e1da17b98..9e12afe4a3 100644 --- a/src/include/cbmem.h +++ b/src/include/cbmem.h @@ -163,10 +163,7 @@ static inline int cbmem_online(void) if (!cbmem_possibly_online()) return 0; - if (ENV_ROMSTAGE) - return cbmem_initialized; - - return 1; + return cbmem_initialized; } #endif /* _CBMEM_H_ */