summaryrefslogtreecommitdiff
path: root/src/arch/x86/postcar.c
diff options
context:
space:
mode:
authorFrans Hendriks <fhendriks@eltan.com>2021-01-18 14:42:00 +0100
committerPatrick Georgi <pgeorgi@google.com>2021-01-21 11:03:04 +0000
commit6f468a58c1c66200138cd8a957ab699e66ca7457 (patch)
tree61adca09c11bf40516f3702ad4025ae5fbb28177 /src/arch/x86/postcar.c
parent162d704b5720bcc22bdd5a17bd20ec29427430ef (diff)
ach/x86/postcar.c: Avoid double CBMEM initialization
On FSP1.1 platform cbmem_initiailze() is called in chipset_teardown_car_main(). This causes double call op cbmem_initialize(). Add call to cbmem_online() to avoid double CBMEM init. BUG = N/A TEST = Build and boot on Facebook FBG1701 Change-Id: I449ddfc94f1099d7c0e9005e6a5cf509e1433bb1 Signed-off-by: Frans Hendriks <fhendriks@eltan.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/49646 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Arthur Heymans <arthur@aheymans.xyz> Reviewed-by: Wim Vervoorn <wvervoorn@eltan.com>
Diffstat (limited to 'src/arch/x86/postcar.c')
-rw-r--r--src/arch/x86/postcar.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/arch/x86/postcar.c b/src/arch/x86/postcar.c
index dcacc70445..1df8c44366 100644
--- a/src/arch/x86/postcar.c
+++ b/src/arch/x86/postcar.c
@@ -23,8 +23,12 @@ void main(void)
/*
* CBMEM needs to be recovered because timestamps rely on
* the cbmem infrastructure being around. Explicitly recover it.
+ *
+ * On some platforms CBMEM needs to be initialized earlier.
+ * Use cbmem_online() to avoid init CBMEM twice.
*/
- cbmem_initialize();
+ if (!cbmem_online())
+ cbmem_initialize();
timestamp_add_now(TS_START_POSTCAR);