[coreboot-gerrit] Patch set updated for coreboot: bbcdbc7 ACPI: Recover type of wakeup in acpi_is_wakeup()

Kyösti Mälkki (kyosti.malkki@gmail.com) gerrit at coreboot.org
Fri Jun 27 15:17:20 CEST 2014


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/6142

-gerrit

commit bbcdbc70425f54e1a40f8509444d41196d884502
Author: Kyösti Mälkki <kyosti.malkki at gmail.com>
Date:   Thu Jun 19 23:29:07 2014 +0300

    ACPI: Recover type of wakeup in acpi_is_wakeup()
    
    Update acpi_slp_type early in ramstage.
    
    Change-Id: I30ec2680d28b880171217e896f48606f8691b099
    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 |  2 +-
 src/lib/hardwaremain.c           |  5 +++++
 3 files changed, 18 insertions(+), 1 deletion(-)

diff --git a/src/arch/x86/boot/acpi.c b/src/arch/x86/boot/acpi.c
index 012c101..d76882a 100644
--- a/src/arch/x86/boot/acpi.c
+++ b/src/arch/x86/boot/acpi.c
@@ -645,14 +645,26 @@ void acpi_resume(void *wake_vec)
 /* This is to be filled by SB code - startup value what was found. */
 u8 acpi_slp_type = 0;
 
+static void acpi_handoff_wakeup(void)
+{
+	static int once = 0;
+	if (once)
+		return;
+	if (acpi_get_sleep_type)
+		acpi_slp_type = acpi_get_sleep_type();
+	once = 1;
+}
+
 int acpi_is_wakeup(void)
 {
+	acpi_handoff_wakeup();
 	/* Both resume from S2 and resume from S3 restart at CPU reset */
 	return (acpi_slp_type == 3 || acpi_slp_type == 2);
 }
 
 int acpi_is_wakeup_s3(void)
 {
+	acpi_handoff_wakeup();
 	return (acpi_slp_type == 3);
 }
 
diff --git a/src/arch/x86/include/arch/acpi.h b/src/arch/x86/include/arch/acpi.h
index 226957d..9039a90 100644
--- a/src/arch/x86/include/arch/acpi.h
+++ b/src/arch/x86/include/arch/acpi.h
@@ -569,7 +569,7 @@ void *acpi_find_wakeup_vector(void);
 void *acpi_get_wakeup_rsdp(void);
 void acpi_jump_to_wakeup(void *wakeup_addr);
 
-int acpi_get_sleep_type(void);
+int __attribute__((weak)) acpi_get_sleep_type(void);
 #endif	/* IS_ENABLED(CONFIG_HAVE_ACPI_RESUME) */
 
 /* northbridge/amd/amdfam10/amdfam10_acpi.c */
diff --git a/src/lib/hardwaremain.c b/src/lib/hardwaremain.c
index d90e0f6..277d9b7 100644
--- a/src/lib/hardwaremain.c
+++ b/src/lib/hardwaremain.c
@@ -464,6 +464,11 @@ void main(void)
 
 	post_code(POST_CONSOLE_BOOT_MSG);
 
+	/* Handoff sleep type from romstage. */
+#if CONFIG_HAVE_ACPI_RESUME
+	acpi_is_wakeup();
+#endif
+
 	threads_initialize();
 
 	/* Schedule the static boot state entries. */



More information about the coreboot-gerrit mailing list