ACPI S3: Replace acpi_is_wakeup()

It was supposed to return true for both S2 and S3, but
level S2 was never stored in acpi_slp_type or otherwise
implemented.

Change-Id: Ida0165e647545069c0d42d38b9f45a95e78dacbe
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/47693
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
This commit is contained in:
Kyösti Mälkki 2020-11-17 16:41:38 +02:00 committed by Felix Held
parent 67a2507c78
commit b8c7ea0f69
8 changed files with 7 additions and 16 deletions

View file

@ -1541,7 +1541,7 @@ void *acpi_find_wakeup_vector(void)
void *wake_vec; void *wake_vec;
int i; int i;
if (!acpi_is_wakeup()) if (!acpi_is_wakeup_s3())
return NULL; return NULL;
printk(BIOS_DEBUG, "Trying to find the wakeup vector...\n"); printk(BIOS_DEBUG, "Trying to find the wakeup vector...\n");

View file

@ -12,7 +12,7 @@
#if ENV_RAMSTAGE || ENV_POSTCAR #if ENV_RAMSTAGE || ENV_POSTCAR
/* This is filled with acpi_is_wakeup() call early in ramstage. */ /* This is filled with acpi_is_wakeup_s3() call early in ramstage. */
static int acpi_slp_type = -1; static int acpi_slp_type = -1;
static void acpi_handoff_wakeup(void) static void acpi_handoff_wakeup(void)
@ -28,13 +28,6 @@ static void acpi_handoff_wakeup(void)
} }
} }
int acpi_is_wakeup(void)
{
acpi_handoff_wakeup();
/* Both resume from S2 and resume from S3 restart at CPU reset */
return (acpi_slp_type == ACPI_S3 || acpi_slp_type == ACPI_S2);
}
int acpi_is_wakeup_s3(void) int acpi_is_wakeup_s3(void)
{ {
acpi_handoff_wakeup(); acpi_handoff_wakeup();

View file

@ -52,7 +52,7 @@ static void model_14_init(struct device *dev)
msr.lo |= SYSCFG_MSR_MtrrFixDramEn; msr.lo |= SYSCFG_MSR_MtrrFixDramEn;
wrmsr(SYSCFG_MSR, msr); wrmsr(SYSCFG_MSR, msr);
if (acpi_is_wakeup()) if (acpi_is_wakeup_s3())
restore_mtrr(); restore_mtrr();
x86_mtrr_check(); x86_mtrr_check();

View file

@ -51,7 +51,7 @@ static void model_15_init(struct device *dev)
msr.lo |= SYSCFG_MSR_MtrrFixDramEn; msr.lo |= SYSCFG_MSR_MtrrFixDramEn;
wrmsr(SYSCFG_MSR, msr); wrmsr(SYSCFG_MSR, msr);
if (acpi_is_wakeup()) if (acpi_is_wakeup_s3())
restore_mtrr(); restore_mtrr();
x86_mtrr_check(); x86_mtrr_check();

View file

@ -49,7 +49,7 @@ static void model_16_init(struct device *dev)
msr.lo |= SYSCFG_MSR_MtrrFixDramEn; msr.lo |= SYSCFG_MSR_MtrrFixDramEn;
wrmsr(SYSCFG_MSR, msr); wrmsr(SYSCFG_MSR, msr);
if (acpi_is_wakeup()) if (acpi_is_wakeup_s3())
restore_mtrr(); restore_mtrr();
x86_mtrr_check(); x86_mtrr_check();

View file

@ -1070,12 +1070,10 @@ static inline int acpi_is_wakeup_s3(void)
return (acpi_get_sleep_type() == ACPI_S3); return (acpi_get_sleep_type() == ACPI_S3);
} }
#else #else
int acpi_is_wakeup(void);
int acpi_is_wakeup_s3(void); int acpi_is_wakeup_s3(void);
#endif #endif
#else #else
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; }
#endif #endif

View file

@ -444,7 +444,7 @@ void main(void)
post_code(POST_ENTRY_RAMSTAGE); post_code(POST_ENTRY_RAMSTAGE);
/* Handoff sleep type from romstage. */ /* Handoff sleep type from romstage. */
acpi_is_wakeup(); acpi_is_wakeup_s3();
threads_initialize(); threads_initialize();
/* Schedule the static boot state entries. */ /* Schedule the static boot state entries. */

View file

@ -19,7 +19,7 @@ static void elog_add_boot_reason(void *unused)
} }
/* Skip logging developer mode in ACPI resume path */ /* Skip logging developer mode in ACPI resume path */
if (dev && !acpi_is_wakeup()) { if (dev && !acpi_is_wakeup_s3()) {
elog_add_event(ELOG_TYPE_CROS_DEVELOPER_MODE); elog_add_event(ELOG_TYPE_CROS_DEVELOPER_MODE);
printk(BIOS_DEBUG, "%s: Logged dev mode boot\n", __func__); printk(BIOS_DEBUG, "%s: Logged dev mode boot\n", __func__);