Zheng Bao (zheng.bao@amd.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/11373
-gerrit
commit e5ec7cede024d60667e73bd996611e6d8181095f Author: zbao fishbaozi@gmail.com Date: Wed Jul 8 17:44:18 2015 -0400
AMD Bettong: Enable S4 feature for Windows 7
PMIOxEE is for setting USB3 power rail. Set it to S0, otherwise going into hibernation can not be wake up.
Change-Id: I692497bad24d745738d670897e725a568c1db114 Signed-off-by: Zheng Bao zheng.bao@amd.com Signed-off-by: Zheng Bao fishbaozi@gmail.com --- src/arch/x86/acpi.c | 6 ++++++ src/arch/x86/include/arch/acpi.h | 2 ++ src/mainboard/amd/bettong/romstage.c | 5 +++++ 3 files changed, 13 insertions(+)
diff --git a/src/arch/x86/acpi.c b/src/arch/x86/acpi.c index 417a322..66ece6d 100644 --- a/src/arch/x86/acpi.c +++ b/src/arch/x86/acpi.c @@ -980,6 +980,12 @@ int acpi_is_wakeup_s3(void) return (acpi_slp_type == 3); }
+int acpi_is_wakeup_s4(void) +{ + acpi_handoff_wakeup(); + return (acpi_slp_type == 4); +} + void acpi_fail_wakeup(void) { if (acpi_slp_type == 3 || acpi_slp_type == 2) diff --git a/src/arch/x86/include/arch/acpi.h b/src/arch/x86/include/arch/acpi.h index 28f650c..ace7bef 100644 --- a/src/arch/x86/include/arch/acpi.h +++ b/src/arch/x86/include/arch/acpi.h @@ -589,12 +589,14 @@ static inline int acpi_is_wakeup_s3(void) #else int acpi_is_wakeup(void); int acpi_is_wakeup_s3(void); +int acpi_is_wakeup_s4(void); #endif
#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; } +static inline int acpi_is_wakeup_s4(void) { return 0; } #endif
#endif /* __ASM_ACPI_H */ diff --git a/src/mainboard/amd/bettong/romstage.c b/src/mainboard/amd/bettong/romstage.c index a8a2777..25f1614 100644 --- a/src/mainboard/amd/bettong/romstage.c +++ b/src/mainboard/amd/bettong/romstage.c @@ -19,6 +19,7 @@
#include <console/console.h> #include <arch/acpi.h> +#include <arch/io.h> #include <arch/stages.h> #include <cpu/x86/lapic.h> #include <cpu/x86/bist.h> @@ -81,6 +82,10 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx) post_code(0x61); prepare_for_resume(); } + if (s3resume || acpi_is_wakeup_s4()) { + outb(0xEE, 0xCD6); + outb(0x8, 0xCD7); + }
post_code(0x50); copy_and_run();