From bf131b26165125d452b694ef83926c2c32bf99d0 Mon Sep 17 00:00:00 2001 From: Marshall Dawson Date: Tue, 7 Nov 2017 12:37:12 -0700 Subject: amd/stoneyridge: Implement vboot_platform_is_resuming Change-Id: I23882ad8cd93fbc25acd8a07eca6a78b6bafc191 Signed-off-by: Marshall Dawson Reviewed-on: https://review.coreboot.org/22414 Tested-by: build bot (Jenkins) Reviewed-by: Marc Jones Reviewed-by: Aaron Durbin --- src/soc/amd/stoneyridge/Makefile.inc | 1 + src/soc/amd/stoneyridge/pmutil.c | 11 +++++++++++ 2 files changed, 12 insertions(+) (limited to 'src/soc/amd') diff --git a/src/soc/amd/stoneyridge/Makefile.inc b/src/soc/amd/stoneyridge/Makefile.inc index 921691f432..197145aee4 100644 --- a/src/soc/amd/stoneyridge/Makefile.inc +++ b/src/soc/amd/stoneyridge/Makefile.inc @@ -58,6 +58,7 @@ romstage-y += ramtop.c romstage-$(CONFIG_STONEYRIDGE_UART) += uart.c romstage-y += tsc_freq.c +verstage-y += sb_util.c verstage-y += pmutil.c verstage-y += reset.c verstage-$(CONFIG_STONEYRIDGE_UART) += uart.c diff --git a/src/soc/amd/stoneyridge/pmutil.c b/src/soc/amd/stoneyridge/pmutil.c index 89d3640801..25c9ec15c1 100644 --- a/src/soc/amd/stoneyridge/pmutil.c +++ b/src/soc/amd/stoneyridge/pmutil.c @@ -13,6 +13,9 @@ * GNU General Public License for more details. */ +#include +#include +#include #include int vbnv_cmos_failed(void) @@ -20,3 +23,11 @@ int vbnv_cmos_failed(void) /* FIXME: RTC failure checking not supported. */ return 0; } + +int vboot_platform_is_resuming(void) +{ + if (!(inw(pm_acpi_pm_evt_blk()) & WAK_STS)) + return 0; + + return acpi_sleep_from_pm1(inw(pm_acpi_pm_cnt_blk())) == ACPI_S3; +} -- cgit v1.2.3