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 <arthur@aheymans.xyz>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/52930
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Patrick Rudolph <siro@das-labor.org>
This commit is contained in:
Arthur Heymans 2021-05-05 10:42:24 +02:00 committed by Patrick Georgi
parent 89c5553d41
commit a2c51158fe
1 changed files with 5 additions and 1 deletions

View File

@ -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;
}