[coreboot-gerrit] New patch to review for coreboot: ACPI S3: Remove HIGH_MEMORY_SAVE (WIP)

Kyösti Mälkki (kyosti.malkki@gmail.com) gerrit at coreboot.org
Sat Jun 18 17:34:34 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/15255

-gerrit

commit 69f0ec1a1b232301109d2438d915fa725c0e18ee
Author: Kyösti Mälkki <kyosti.malkki at gmail.com>
Date:   Sat Jun 18 16:28:42 2016 +0300

    ACPI S3: Remove HIGH_MEMORY_SAVE (WIP)
    
    Calculation will be replaced with actual requirements
    of the ramstage.
    
    Change-Id: Ide7ce013f3727c2928cdb00fbcc7e7e84e859ff1
    Signed-off-by: Kyösti Mälkki <kyosti.malkki at gmail.com>
---
 src/arch/x86/acpi_s3.c           | 15 +++++++++------
 src/arch/x86/include/arch/acpi.h |  8 +-------
 2 files changed, 10 insertions(+), 13 deletions(-)

diff --git a/src/arch/x86/acpi_s3.c b/src/arch/x86/acpi_s3.c
index dadce84..d95bfd5 100644
--- a/src/arch/x86/acpi_s3.c
+++ b/src/arch/x86/acpi_s3.c
@@ -110,6 +110,11 @@ void acpi_prepare_resume_backup(void) { };
 
 #else
 
+size_t acpi_resume_backup_size(void)
+{
+	return (CONFIG_RAMTOP - CONFIG_RAMBASE);
+}
+
 #if ENV_ROMSTAGE
 void acpi_prepare_for_resume(void)
 {
@@ -117,7 +122,7 @@ void acpi_prepare_for_resume(void)
 	void *src = (void *)CONFIG_RAMBASE;
 	void *dest = cbmem_find(CBMEM_ID_RESUME);
 	if (dest != NULL)
-		memcpy(dest, src, HIGH_MEMORY_SAVE);
+		memcpy(dest, src, acpi_resume_backup_size());
 }
 #elif ENV_RAMSTAGE
 void acpi_prepare_resume_backup(void)
@@ -129,9 +134,7 @@ void acpi_prepare_resume_backup(void)
 	 * it being there during reboot time. We don't need the pointer, nor
 	 * the result right now. If it fails, ACPI resume will be disabled.
 	 */
-
-	if (HIGH_MEMORY_SAVE)
-		cbmem_add(CBMEM_ID_RESUME, HIGH_MEMORY_SAVE);
+	cbmem_add(CBMEM_ID_RESUME, acpi_resume_backup_size());
 }
 #endif
 
@@ -171,7 +174,7 @@ void acpi_jump_to_wakeup(void *vector)
 {
 	uintptr_t acpi_backup_memory = 0;
 
-	if (HIGH_MEMORY_SAVE && acpi_s3_resume_allowed()) {
+	if (acpi_s3_resume_allowed()) {
 		acpi_backup_memory = (uintptr_t)cbmem_find(CBMEM_ID_RESUME);
 
 		if (!acpi_backup_memory) {
@@ -181,7 +184,7 @@ void acpi_jump_to_wakeup(void *vector)
 		}
 	}
 	__acpi_jump_to_wakeup((uintptr_t)vector, acpi_backup_memory, CONFIG_RAMBASE,
-		       HIGH_MEMORY_SAVE);
+		       acpi_resume_backup_size());
 }
 #endif
 
diff --git a/src/arch/x86/include/arch/acpi.h b/src/arch/x86/include/arch/acpi.h
index ff0672e..05e0294 100644
--- a/src/arch/x86/include/arch/acpi.h
+++ b/src/arch/x86/include/arch/acpi.h
@@ -24,13 +24,6 @@
 #ifndef __ASM_ACPI_H
 #define __ASM_ACPI_H
 
-#if IS_ENABLED(CONFIG_HAVE_ACPI_RESUME) && \
-	! IS_ENABLED(CONFIG_RELOCATABLE_RAMSTAGE)
-#define HIGH_MEMORY_SAVE	(CONFIG_RAMTOP - CONFIG_RAMBASE)
-#else
-#define HIGH_MEMORY_SAVE	0
-#endif
-
 #ifndef __ASSEMBLER__
 #include <stdint.h>
 #include <rules.h>
@@ -638,6 +631,7 @@ int acpi_is_wakeup_s3(void);
 int acpi_is_wakeup_s4(void);
 #endif
 void acpi_prepare_for_resume(void);
+size_t acpi_resume_backup_size(void);
 
 #else
 #define acpi_slp_type 0



More information about the coreboot-gerrit mailing list