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@gmail.com>
Reviewed-on: http://review.coreboot.org/10299
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Tested-by: build bot (Jenkins)
This commit is contained in:
Kyösti Mälkki 2015-05-26 00:30:10 +03:00 committed by Aaron Durbin
parent 28d5ec9a7d
commit e1fb052ed7
2 changed files with 4 additions and 12 deletions

View File

@ -56,7 +56,6 @@ static inline void *saved_ramtop(void)
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;
}

View File

@ -96,9 +96,8 @@ 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))
imd_handle_init(imd, cbmem_top());
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);
@ -118,10 +117,7 @@ void cbmem_initialize_empty_id_size(u32 id, u64 size)
struct imd imd_backing;
imd = imd_init_backing(&imd_backing);
/* Early cbmem init platforms need to always use cbmem_top(). */
if (IS_ENABLED(CONFIG_EARLY_CBMEM_INIT))
imd_handle_init(imd, cbmem_top());
imd_handle_init(imd, cbmem_top());
printk(BIOS_DEBUG, "CBMEM:\n");
@ -157,10 +153,7 @@ int cbmem_initialize_id_size(u32 id, u64 size)
struct imd imd_backing;
imd = imd_init_backing(&imd_backing);
/* Early cbmem init platforms need to always use cbmem_top(). */
if (IS_ENABLED(CONFIG_EARLY_CBMEM_INIT))
imd_handle_init(imd, cbmem_top());
imd_handle_init(imd, cbmem_top());
if (imd_recover(imd))
return 1;