[coreboot-gerrit] Patch set updated for coreboot: AMD k8 fam10: Use common ACPI S3 recovery

Kyösti Mälkki (kyosti.malkki@gmail.com) gerrit at coreboot.org
Fri Jul 8 20:58:05 CEST 2016


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

-gerrit

commit 3780a04524422ffb21e547221faf86c4ccab2f8b
Author: Kyösti Mälkki <kyosti.malkki at gmail.com>
Date:   Mon Jun 27 12:53:00 2016 +0300

    AMD k8 fam10: Use common ACPI S3 recovery
    
    Change-Id: I62bbba8cfe515b3cae413582ff8d062a20e6741b
    Signed-off-by: Kyösti Mälkki <kyosti.malkki at 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       | 26 ++------------------------
 src/cpu/amd/family_10h-family_15h/Kconfig |  1 -
 src/cpu/amd/model_fxx/Kconfig             |  1 -
 5 files changed, 2 insertions(+), 49 deletions(-)

diff --git a/src/arch/x86/acpi_s3.c b/src/arch/x86/acpi_s3.c
index eb56b43..0d0254e 100644
--- a/src/arch/x86/acpi_s3.c
+++ b/src/arch/x86/acpi_s3.c
@@ -126,22 +126,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 489edac..babb50b 100644
--- a/src/arch/x86/include/arch/acpi.h
+++ b/src/arch/x86/include/arch/acpi.h
@@ -618,13 +618,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)
 extern int acpi_slp_type;
 
diff --git a/src/cpu/amd/car/post_cache_as_ram.c b/src/cpu/amd/car/post_cache_as_ram.c
index 4991b24..56532d1 100644
--- a/src/cpu/amd/car/post_cache_as_ram.c
+++ b/src/cpu/amd/car/post_cache_as_ram.c
@@ -45,12 +45,6 @@ static void memcpy_(void *d, const void *s, size_t len)
 	memcpy(d, s, len);
 }
 
-static void memset_(void *d, int val, size_t len)
-{
-	print_car_debug(" Fill [%08x-%08x] ...", (uint32_t) d, (uint32_t) (d + len - 1));
-	memset(d, val, len);
-}
-
 static int memcmp_(void *d, const void *s, size_t len)
 {
 	print_car_debug(" Compare [%08x-%08x] with [%08x - %08x] ...",
@@ -58,23 +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);
-		memset_((void*) CONFIG_RAMBASE, 0, HIGH_MEMORY_SAVE);
-	} else {
-		memset_((void*)0, 0, CONFIG_RAMTOP);
-	}
-
-	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
  */
@@ -158,7 +135,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
 
diff --git a/src/cpu/amd/family_10h-family_15h/Kconfig b/src/cpu/amd/family_10h-family_15h/Kconfig
index 30c7dee..fda7fc8 100644
--- a/src/cpu/amd/family_10h-family_15h/Kconfig
+++ b/src/cpu/amd/family_10h-family_15h/Kconfig
@@ -10,7 +10,6 @@ config CPU_AMD_MODEL_10XXX
 	select TSC_SYNC_LFENCE
 	select UDELAY_LAPIC
 	select HAVE_MONOTONIC_TIMER
-	select ACPI_HUGE_LOWMEM_BACKUP
 	select SUPPORT_CPU_UCODE_IN_CBFS
 	select CPU_MICROCODE_MULTIPLE_FILES if !CPU_MICROCODE_CBFS_NONE
 
diff --git a/src/cpu/amd/model_fxx/Kconfig b/src/cpu/amd/model_fxx/Kconfig
index 3eb5b94..c8bae33 100644
--- a/src/cpu/amd/model_fxx/Kconfig
+++ b/src/cpu/amd/model_fxx/Kconfig
@@ -9,7 +9,6 @@ config CPU_AMD_MODEL_FXX
 	select SSE2
 	select TSC_SYNC_LFENCE
 	select UDELAY_LAPIC
-	select ACPI_HUGE_LOWMEM_BACKUP
 	select SUPPORT_CPU_UCODE_IN_CBFS
 
 if CPU_AMD_MODEL_FXX



More information about the coreboot-gerrit mailing list