[coreboot-gerrit] Patch set updated for coreboot: 8037c9b ACPI: Prepare for HAVE_ACPI_RESUME changes

Kyösti Mälkki (kyosti.malkki@gmail.com) gerrit at coreboot.org
Sat Jan 10 08:57:49 CET 2015


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

-gerrit

commit 8037c9b8fffa46e9298debe45cf0b74c26d72a51
Author: Kyösti Mälkki <kyosti.malkki at gmail.com>
Date:   Fri Jan 9 23:55:09 2015 +0200

    ACPI: Prepare for HAVE_ACPI_RESUME changes
    
    Change-Id: I71d522b135dff8b3c287699cc649caece9e4342c
    Signed-off-by: Kyösti Mälkki <kyosti.malkki at gmail.com>
---
 src/arch/x86/boot/acpi.c         | 12 ++++--------
 src/arch/x86/include/arch/acpi.h | 22 ++++++++++------------
 2 files changed, 14 insertions(+), 20 deletions(-)

diff --git a/src/arch/x86/boot/acpi.c b/src/arch/x86/boot/acpi.c
index 61f0954..621df2f 100644
--- a/src/arch/x86/boot/acpi.c
+++ b/src/arch/x86/boot/acpi.c
@@ -854,8 +854,8 @@ void acpi_resume(void *wake_vec)
 	acpi_jump_to_wakeup(wake_vec);
 }
 
-/* This is to be filled by SB code - startup value what was found. */
-u8 acpi_slp_type = 0;
+/* This is filled with acpi_is_wakeup() call early in ramstage. */
+int acpi_slp_type = -1;
 
 int __attribute__((weak)) acpi_get_sleep_type(void)
 {
@@ -864,12 +864,8 @@ int __attribute__((weak)) acpi_get_sleep_type(void)
 
 static void acpi_handoff_wakeup(void)
 {
-	static int once = 0;
-	if (once)
-		return;
-
-	acpi_slp_type = acpi_get_sleep_type();
-	once = 1;
+	if (acpi_slp_type < 0)
+		acpi_slp_type = acpi_get_sleep_type();
 }
 
 int acpi_is_wakeup(void)
diff --git a/src/arch/x86/include/arch/acpi.h b/src/arch/x86/include/arch/acpi.h
index 502c826..c497082 100644
--- a/src/arch/x86/include/arch/acpi.h
+++ b/src/arch/x86/include/arch/acpi.h
@@ -559,14 +559,10 @@ unsigned long acpi_fill_hest(acpi_hest_t *hest);
 
 void acpi_save_gnvs(u32 gnvs_address);
 
-#if IS_ENABLED(CONFIG_HAVE_ACPI_RESUME)
-/* 0 = S0, 1 = S1 ...*/
-extern u8 acpi_slp_type;
-
-int acpi_is_wakeup(void);
-int acpi_is_wakeup_s3(void);
-int acpi_is_wakeup_early(void);
+/* cpu/intel/speedstep/acpi.c */
+void generate_cpu_entries(void);
 
+/* For ACPI S3 support. */
 void acpi_fail_wakeup(void);
 void acpi_resume(void *wake_vec);
 void acpi_prepare_resume_backup(void);
@@ -575,18 +571,20 @@ void *acpi_find_wakeup_vector(void);
 void *acpi_get_wakeup_rsdp(void);
 void acpi_jump_to_wakeup(void *wakeup_addr);
 
+/* Returns 0 = S0, 1 = S1 ... */
 int acpi_get_sleep_type(void);
-#endif	/* IS_ENABLED(CONFIG_HAVE_ACPI_RESUME) */
-
-/* cpu/intel/speedstep/acpi.c */
-void generate_cpu_entries(void);
 
 static inline int acpi_s3_resume_allowed(void)
 {
 	return IS_ENABLED(CONFIG_HAVE_ACPI_RESUME);
 }
 
-#if !IS_ENABLED(CONFIG_HAVE_ACPI_RESUME)
+#if IS_ENABLED(CONFIG_HAVE_ACPI_RESUME)
+extern int acpi_slp_type;
+int acpi_is_wakeup(void);
+int acpi_is_wakeup_s3(void);
+int acpi_is_wakeup_early(void);
+#else
 #define acpi_slp_type 0
 static inline int acpi_is_wakeup(void) { return 0; }
 static inline int acpi_is_wakeup_s3(void) { return 0; }



More information about the coreboot-gerrit mailing list