[coreboot-gerrit] New patch to review for coreboot: 9f0f0a6 CBMEM: Fix S3 resume path without EARLY_CBMEM_INIT

Kyösti Mälkki (kyosti.malkki@gmail.com) gerrit at coreboot.org
Tue May 26 01:23:45 CEST 2015


Kyösti Mälkki (kyosti.malkki at gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/10299

-gerrit

commit 9f0f0a6ab0662764c1ae88f0a550e8192e4779cd
Author: Kyösti Mälkki <kyosti.malkki at gmail.com>
Date:   Tue May 26 00:30:10 2015 +0300

    CBMEM: Fix S3 resume path without EARLY_CBMEM_INIT
    
    Implementation for cbmem_find() did not work for boards without
    EARLY_CBMEM_INIT in romstage.
    
    This is required for S3 resume to work on AGESA plaforms.
    
    First broken with commit 0dff57d
       cbmem: switch over to imd-based cbmem
    
    Change-Id: I9c1a4f6839f5d90f825787baad2a3824a04b5bdc
    Signed-off-by: Kyösti Mälkki <kyosti.malkki at gmail.com>
---
 src/arch/x86/boot/cbmem.c | 1 -
 src/lib/imd_cbmem.c       | 7 ++++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/arch/x86/boot/cbmem.c b/src/arch/x86/boot/cbmem.c
index 9ee5db4..30206b7 100644
--- a/src/arch/x86/boot/cbmem.c
+++ b/src/arch/x86/boot/cbmem.c
@@ -43,7 +43,6 @@ void set_top_of_ram(uint64_t ramtop)
 
 unsigned long __attribute__((weak)) get_top_of_ram(void)
 {
-	printk(BIOS_WARNING, "WARNING: you need to define get_top_of_ram() for your chipset\n");
 	return 0;
 }
 
diff --git a/src/lib/imd_cbmem.c b/src/lib/imd_cbmem.c
index fc12c25..8e6a99a 100644
--- a/src/lib/imd_cbmem.c
+++ b/src/lib/imd_cbmem.c
@@ -97,8 +97,9 @@ static struct imd *imd_init_backing_with_recover(struct imd *backing)
 	imd = imd_init_backing(backing);
 	if (!ENV_RAMSTAGE) {
 		/* Early cbmem init platforms need to always use cbmem_top(). */
-		if (IS_ENABLED(CONFIG_EARLY_CBMEM_INIT))
+		if (cbmem_top() != NULL)
 			imd_handle_init(imd, cbmem_top());
+
 		/* Need to partially recover all the time outside of ramstage
 		 * because there's object storage outside of the stack. */
 		imd_handle_init_partial_recovery(imd);
@@ -120,7 +121,7 @@ void cbmem_initialize_empty_id_size(u32 id, u64 size)
 	imd = imd_init_backing(&imd_backing);
 
 	/* Early cbmem init platforms need to always use cbmem_top(). */
-	if (IS_ENABLED(CONFIG_EARLY_CBMEM_INIT))
+	if (cbmem_top() != NULL)
 		imd_handle_init(imd, cbmem_top());
 
 	printk(BIOS_DEBUG, "CBMEM:\n");
@@ -159,7 +160,7 @@ int cbmem_initialize_id_size(u32 id, u64 size)
 	imd = imd_init_backing(&imd_backing);
 
 	/* Early cbmem init platforms need to always use cbmem_top(). */
-	if (IS_ENABLED(CONFIG_EARLY_CBMEM_INIT))
+	if (cbmem_top() != NULL)
 		imd_handle_init(imd, cbmem_top());
 
 	if (imd_recover(imd))



More information about the coreboot-gerrit mailing list