From 71b214553c952e790219864767ba7882c9aaae1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ky=C3=B6sti=20M=C3=A4lkki?= Date: Fri, 28 Nov 2014 10:13:03 +0200 Subject: CBMEM console: Fix boards with BROKEN_CAR_MIGRATE MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit There is no need to call cbmemc_reinit() exclusively in romstage, that is done as part of the CAR migration of cbmem_recovery(). CBMEM console for romstage remains disabled for boards flagged with BROKEN_CAR_MIGRATE, but with this change it is possible to have it for ramstage. Change-Id: I48c4afcd847d0d5f8864d23c0786935341e3f752 Signed-off-by: Kyösti Mälkki Reviewed-on: http://review.coreboot.org/7592 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel Reviewed-by: Martin Roth --- src/lib/cbmem.c | 2 -- src/lib/cbmem_console.c | 5 +++++ src/lib/dynamic_cbmem.c | 2 -- 3 files changed, 5 insertions(+), 4 deletions(-) (limited to 'src/lib') diff --git a/src/lib/cbmem.c b/src/lib/cbmem.c index b0e73e2f31..0b24ad2af9 100644 --- a/src/lib/cbmem.c +++ b/src/lib/cbmem.c @@ -256,9 +256,7 @@ static void init_cbmem_post_device(void *unused) #else cbmem_recovery(0); #endif -#if CONFIG_CONSOLE_CBMEM cbmemc_reinit(); -#endif } BOOT_STATE_INIT_ENTRIES(cbmem_bscb) = { diff --git a/src/lib/cbmem_console.c b/src/lib/cbmem_console.c index b5b75f3ee6..997bb7d9b2 100644 --- a/src/lib/cbmem_console.c +++ b/src/lib/cbmem_console.c @@ -188,6 +188,11 @@ void cbmemc_reinit(void) { struct cbmem_console *cbm_cons_p = NULL; +#ifdef __PRE_RAM__ + if (IS_ENABLED(CONFIG_BROKEN_CAR_MIGRATE)) + return; +#endif + #ifndef __PRE_RAM__ cbm_cons_p = cbmem_find(CBMEM_ID_CONSOLE); #endif diff --git a/src/lib/dynamic_cbmem.c b/src/lib/dynamic_cbmem.c index 3dc50770a7..5eddbcaf18 100644 --- a/src/lib/dynamic_cbmem.c +++ b/src/lib/dynamic_cbmem.c @@ -426,9 +426,7 @@ void *cbmem_entry_start(const struct cbmem_entry *entry) static void init_cbmem_pre_device(void *unused) { cbmem_initialize(); -#if CONFIG_CONSOLE_CBMEM cbmemc_reinit(); -#endif /* CONFIG_CONSOLE_CBMEM */ } BOOT_STATE_INIT_ENTRIES(cbmem_bscb) = { -- cgit v1.2.3