summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJulius Werner <jwerner@chromium.org>2020-12-07 14:57:01 -0800
committerJulius Werner <jwerner@chromium.org>2020-12-08 21:38:51 +0000
commit364f9de1491cc48d8a03085a5748e81dcaea4a63 (patch)
tree0bba9e60ff82bd6df3bb7d09adf045d6ef3788f0 /src
parente38482610c1b51dfb347959def00bb2bba91a4a5 (diff)
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 <jwerner@chromium.org> Change-Id: I623c0606a4f49ea98c4c7559436bf32ebb83b456 Reviewed-on: https://review.coreboot.org/c/coreboot/+/48428 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Furquan Shaikh <furquan@google.com> Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Diffstat (limited to 'src')
-rw-r--r--src/include/cbmem.h5
1 files changed, 1 insertions, 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_ */