From 6f468a58c1c66200138cd8a957ab699e66ca7457 Mon Sep 17 00:00:00 2001 From: Frans Hendriks Date: Mon, 18 Jan 2021 14:42:00 +0100 Subject: 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 Reviewed-on: https://review.coreboot.org/c/coreboot/+/49646 Tested-by: build bot (Jenkins) Reviewed-by: Arthur Heymans Reviewed-by: Wim Vervoorn --- src/arch/x86/postcar.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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); -- cgit v1.2.3