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>
Reviewed-on: http://review.coreboot.org/11373
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Tested-by: build bot (Jenkins)
This commit is contained in:
zbao 2015-11-05 20:25:59 +08:00 committed by Zheng Bao
parent aeb2103ab5
commit 1897c2c350
3 changed files with 14 additions and 0 deletions

View File

@ -1005,6 +1005,12 @@ int acpi_is_wakeup_s3(void)
return (acpi_slp_type == 3); return (acpi_slp_type == 3);
} }
int acpi_is_wakeup_s4(void)
{
acpi_handoff_wakeup();
return (acpi_slp_type == 4);
}
void acpi_fail_wakeup(void) void acpi_fail_wakeup(void)
{ {
if (acpi_slp_type == 3 || acpi_slp_type == 2) if (acpi_slp_type == 3 || acpi_slp_type == 2)

View File

@ -596,12 +596,14 @@ static inline int acpi_is_wakeup_s3(void)
#else #else
int acpi_is_wakeup(void); int acpi_is_wakeup(void);
int acpi_is_wakeup_s3(void); int acpi_is_wakeup_s3(void);
int acpi_is_wakeup_s4(void);
#endif #endif
#else #else
#define acpi_slp_type 0 #define acpi_slp_type 0
static inline int acpi_is_wakeup(void) { return 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_s3(void) { return 0; }
static inline int acpi_is_wakeup_s4(void) { return 0; }
#endif #endif
#endif /* __ASM_ACPI_H */ #endif /* __ASM_ACPI_H */

View File

@ -15,6 +15,7 @@
#include <console/console.h> #include <console/console.h>
#include <arch/acpi.h> #include <arch/acpi.h>
#include <arch/io.h>
#include <arch/stages.h> #include <arch/stages.h>
#include <cpu/x86/lapic.h> #include <cpu/x86/lapic.h>
#include <cpu/x86/bist.h> #include <cpu/x86/bist.h>
@ -78,6 +79,11 @@ void cache_as_ram_main(unsigned long bist, unsigned long cpu_init_detectedx)
prepare_for_resume(); prepare_for_resume();
} }
if (s3resume || acpi_is_wakeup_s4()) {
outb(0xEE, PM_INDEX);
outb(0x8, PM_DATA);
}
post_code(0x50); post_code(0x50);
copy_and_run(); copy_and_run();