Zheng Bao (zheng.bao@amd.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/904
-gerrit
commit c076afd137fda12ace65ada0b3dd95c14ea88a1e Author: zbao fishbaozi@gmail.com Date: Wed Apr 18 12:56:09 2012 +0800
s3: Use old heap during normal boot
During normal boot, the cbmem is uninitialized. So it is illegal to find the heap in cbmem.
Change-Id: I8b5e1dbf1124819ed91693a86a6dbe41aea109e5 Signed-off-by: Zheng Bao zheng.bao@amd.com Signed-off-by: zbao fishbaozi@gmail.com --- src/mainboard/amd/persimmon/BiosCallOuts.h | 1 + src/mainboard/amd/persimmon/agesawrapper.c | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/src/mainboard/amd/persimmon/BiosCallOuts.h b/src/mainboard/amd/persimmon/BiosCallOuts.h index 071c73c..cd23110 100644 --- a/src/mainboard/amd/persimmon/BiosCallOuts.h +++ b/src/mainboard/amd/persimmon/BiosCallOuts.h @@ -23,6 +23,7 @@ #include "Porting.h" #include "AGESA.h"
+#define BIOS_HEAP_START_ADDRESS 0x10000 /* HEAP during cold boot */ #define BIOS_HEAP_SIZE 0x20000 #define BSP_STACK_BASE_ADDR 0x30000
diff --git a/src/mainboard/amd/persimmon/agesawrapper.c b/src/mainboard/amd/persimmon/agesawrapper.c index 6bba7ca..4a53d6c 100644 --- a/src/mainboard/amd/persimmon/agesawrapper.c +++ b/src/mainboard/amd/persimmon/agesawrapper.c @@ -40,6 +40,7 @@ #include <arch/io.h> #include <cpu/amd/agesa/s3_resume.h> #include <cbmem.h> +#include <arch/acpi.h>
#define FILECODE UNASSIGNED_FILE_FILECODE
@@ -252,7 +253,11 @@ UINT32 GetHeapBase( { UINT32 high_heap;
- high_heap = (UINT32)cbmem_find(CBMEM_ID_RESUME_SCRATCH) + (CONFIG_HIGH_SCRATCH_MEMORY_SIZE - BIOS_HEAP_SIZE); /* base + high_stack_size */ + /* Both romstage and ramstage has this S3 detect. */ + if (acpi_get_sleep_type() == 3) + high_heap = (UINT32)cbmem_find(CBMEM_ID_RESUME_SCRATCH) + (CONFIG_HIGH_SCRATCH_MEMORY_SIZE - BIOS_HEAP_SIZE); /* base + high_stack_size */ + else + high_heap = BIOS_HEAP_START_ADDRESS;
return high_heap; }