From a2c51158fe1d838e51f65603682d75791c003ab6 Mon Sep 17 00:00:00 2001 From: Arthur Heymans Date: Wed, 5 May 2021 10:42:24 +0200 Subject: sb/intel/common: Fix platform_is_resuming() platform_is_resuming() was using the wrong register (PM1_STS) to figure out if the platform was resuming (PM1_CNT). Change-Id: I1f69dca1da158aae15c6da6d4c898c71d9cdb51f Signed-off-by: Arthur Heymans Reviewed-on: https://review.coreboot.org/c/coreboot/+/52930 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Rudolph --- src/southbridge/intel/common/pmbase.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/southbridge') diff --git a/src/southbridge/intel/common/pmbase.c b/src/southbridge/intel/common/pmbase.c index bbd2c25599..d5578fc27e 100644 --- a/src/southbridge/intel/common/pmbase.c +++ b/src/southbridge/intel/common/pmbase.c @@ -80,6 +80,10 @@ int acpi_get_sleep_type(void) return acpi_sleep_from_pm1(read_pmbase32(PM1_CNT)); } +/* + * Note that southbridge_detect_s3_resume clears the sleep state, + * so this may not be used reliable throughout romstage. + */ int platform_is_resuming(void) { u16 reg16 = read_pmbase16(PM1_STS); @@ -87,5 +91,5 @@ int platform_is_resuming(void) if (!(reg16 & WAK_STS)) return 0; - return acpi_sleep_from_pm1(reg16) == ACPI_S3; + return acpi_get_sleep_type() == ACPI_S3; } -- cgit v1.2.3