diff options
author | Kyösti Mälkki <kyosti.malkki@gmail.com> | 2015-05-26 10:12:45 +0300 |
---|---|---|
committer | Kyösti Mälkki <kyosti.malkki@gmail.com> | 2015-05-27 12:50:53 +0200 |
commit | f7284089e3657c66efeeb180a1f101a60d832901 (patch) | |
tree | cb16884784c2623d06b85d91bb14dbf5b0899153 /src/cpu/amd/agesa/s3_resume.c | |
parent | 49d30668b628cb68c61a7b2512628263752360c3 (diff) | |
download | coreboot-f7284089e3657c66efeeb180a1f101a60d832901.tar.xz |
AGESA: Split S3 backup in CBMEM
Use separate CBMEM allocations for stack and heap on S3 resume path.
The allocation of HIGH_SCRATCH_MEMORY is specific to AGESA and is moved
out of globals and ACPI. This region is a replacement for BIOS_HEAP_SIZE
used on non-resume paths.
Change-Id: I6658ce1c06964de5cf13b4e3c84d571f46ce76f3
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: http://review.coreboot.org/10316
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Diffstat (limited to 'src/cpu/amd/agesa/s3_resume.c')
-rw-r--r-- | src/cpu/amd/agesa/s3_resume.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/cpu/amd/agesa/s3_resume.c b/src/cpu/amd/agesa/s3_resume.c index d882bdf252..5e07d7a405 100644 --- a/src/cpu/amd/agesa/s3_resume.c +++ b/src/cpu/amd/agesa/s3_resume.c @@ -25,7 +25,6 @@ #include <cpu/x86/cache.h> #include <cbmem.h> #include <string.h> -#include <northbridge/amd/agesa/BiosCallOuts.h> #include <halt.h> #include "s3_resume.h" @@ -51,12 +50,12 @@ static void *backup_resume(void) static void move_stack_high_mem(void) { - void *high_stack; + void *high_stack = cbmem_find(CBMEM_ID_ROMSTAGE_RAM_STACK); - high_stack = cbmem_find(CBMEM_ID_RESUME_SCRATCH); - memcpy(high_stack, (void *)BSP_STACK_BASE_ADDR, - (CONFIG_HIGH_SCRATCH_MEMORY_SIZE - BIOS_HEAP_SIZE)); + /* TODO: Make the switch with empty stack instead. */ + memcpy(high_stack, (void *)BSP_STACK_BASE_ADDR, HIGH_ROMSTAGE_STACK_SIZE); + /* TODO: We only switch stack on BSP. */ __asm__ volatile ("add %0, %%esp; add %0, %%ebp; invd"::"g" (high_stack - BSP_STACK_BASE_ADDR) @@ -95,7 +94,6 @@ void prepare_for_resume(void) post_code(0x62); printk(BIOS_DEBUG, "Move CAR stack.\n"); move_stack_high_mem(); - printk(BIOS_DEBUG, "stack moved to: 0x%x\n", (u32) (resume_backup_memory + HIGH_MEMORY_SAVE)); post_code(0x63); disable_cache_as_ram(); |