From 1de648e272a7da523f05ca9d19226a308c1af852 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ky=C3=B6sti=20M=C3=A4lkki?= Date: Tue, 26 May 2015 06:46:41 +0300 Subject: CBMEM console: Fix buffer without EARLY_CBMEM_INIT MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On S3 resume, CBMEM_ID_CONSOLE from previous boot is found in ramstage, even when romstage did not create it. So buffer did not get cleared on S3 resume path. Also do not allocate for preram_cbmem_console in CAR when there are no means to back it up to ram. Change-Id: I175cebbb938adf2a7414703fefffb8da796e9fa9 Signed-off-by: Kyösti Mälkki Reviewed-on: http://review.coreboot.org/10301 Reviewed-by: Aaron Durbin Tested-by: build bot (Jenkins) --- src/lib/cbmem_console.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'src/lib') diff --git a/src/lib/cbmem_console.c b/src/lib/cbmem_console.c index 30bf439511..e9607f3a35 100644 --- a/src/lib/cbmem_console.c +++ b/src/lib/cbmem_console.c @@ -225,11 +225,8 @@ void cbmemc_reinit(void) /* Need to reset the newly added cbmem console in ramstage * when there was no console in preram environment. */ - if (ENV_RAMSTAGE) { - cbm_cons_p = cbmem_find(CBMEM_ID_CONSOLE); - if (cbm_cons_p == NULL) - flags |= CBMEMC_RESET; - } + if (ENV_RAMSTAGE && IS_ENABLED(CONFIG_LATE_CBMEM_INIT)) + flags |= CBMEMC_RESET; /* If CBMEM entry already existed, old contents is not altered. */ cbm_cons_p = cbmem_add(CBMEM_ID_CONSOLE, size); -- cgit v1.2.3