Kyösti Mälkki (kyosti.malkki@gmail.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/15474
-gerrit
commit 0eefdd3d4c6c43ca487479d2047690f24a8daf78 Author: Kyösti Mälkki kyosti.malkki@gmail.com Date: Tue Nov 8 01:08:11 2016 +0200
AMD k8 fam10: Use common ACPI S3 recovery
Change-Id: I62bbba8cfe515b3cae413582ff8d062a20e6741b Signed-off-by: Kyösti Mälkki kyosti.malkki@gmail.com --- src/arch/x86/acpi_s3.c | 16 ---------------- src/arch/x86/include/arch/acpi.h | 7 ------- src/cpu/amd/car/post_cache_as_ram.c | 17 ++--------------- 3 files changed, 2 insertions(+), 38 deletions(-)
diff --git a/src/arch/x86/acpi_s3.c b/src/arch/x86/acpi_s3.c index 0fc1914..1892731 100644 --- a/src/arch/x86/acpi_s3.c +++ b/src/arch/x86/acpi_s3.c @@ -119,22 +119,6 @@ static int backup_create_or_update(struct resume_backup *backup_mem, return 0; }
-void *acpi_backup_container(uintptr_t base, size_t size) -{ - struct resume_backup *backup_mem = cbmem_find(CBMEM_ID_RESUME); - if (!backup_mem) - return NULL; - - if (!IS_ALIGNED(base, BACKUP_PAGE_SZ) || !IS_ALIGNED(size, BACKUP_PAGE_SZ)) - return NULL; - - if (backup_create_or_update(backup_mem, base, size) < 0) - return NULL; - - backup_mem->valid = 1; - return (void*)(uintptr_t)backup_mem->cbmem; -} - void backup_ramstage_section(uintptr_t base, size_t size) { struct resume_backup *backup_mem = cbmem_find(CBMEM_ID_RESUME); diff --git a/src/arch/x86/include/arch/acpi.h b/src/arch/x86/include/arch/acpi.h index 6854573..0b04f56 100644 --- a/src/arch/x86/include/arch/acpi.h +++ b/src/arch/x86/include/arch/acpi.h @@ -683,13 +683,6 @@ static inline int acpi_s3_resume_allowed(void) return IS_ENABLED(CONFIG_HAVE_ACPI_RESUME); }
-/* Return address in reserved memory where to backup low memory - * while platform resumes from S3 suspend. Caller is responsible of - * making a complete copy of the region base..base+size, with - * parameteres base and size that meet page alignment requirement. - */ -void *acpi_backup_container(uintptr_t base, size_t size); - #if IS_ENABLED(CONFIG_HAVE_ACPI_RESUME)
#ifdef __PRE_RAM__ diff --git a/src/cpu/amd/car/post_cache_as_ram.c b/src/cpu/amd/car/post_cache_as_ram.c index 076249f..611bc0c 100644 --- a/src/cpu/amd/car/post_cache_as_ram.c +++ b/src/cpu/amd/car/post_cache_as_ram.c @@ -52,20 +52,6 @@ static int memcmp_(void *d, const void *s, size_t len) return memcmp(d, s, len); }
-static void prepare_ramstage_region(int s3resume) -{ - print_car_debug("Prepare ramstage memory region..."); - - if (s3resume) { - void *resume_backup_memory = acpi_backup_container(CONFIG_RAMBASE, HIGH_MEMORY_SAVE); - if (resume_backup_memory) - memcpy_(resume_backup_memory, (void *) CONFIG_RAMBASE, - HIGH_MEMORY_SAVE); - } - - print_car_debug(" Done\n"); -} - /* Disable Erratum 343 Workaround, see RevGuide for Fam10h, Pub#41322 Rev 3.33 * and RevGuide for Fam12h, Pub#44739 Rev 3.10 */ @@ -144,7 +130,8 @@ void cache_as_ram_new_stack (void) set_var_mtrr(0, 0x00000000, CACHE_TMP_RAMTOP, MTRR_TYPE_WRBACK); enable_cache();
- prepare_ramstage_region(acpi_is_wakeup_s3()); + if (acpi_is_wakeup_s3()) + acpi_prepare_for_resume();
set_sysinfo_in_ram(1); // So other core0 could start to train mem