Attention is currently required from: Jason Glenesk, Raul Rangel, Marshall Dawson, Felix Held. Karthik Ramasubramanian has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/56362 )
Change subject: soc/amd/common/elog: Update elog_pm1_status function signature ......................................................................
soc/amd/common/elog: Update elog_pm1_status function signature
The common event log library is used from both Romstage and SMM stage. Previous Sleep state is logged as part of logging PM1_STS. But it uses acpi_is_wakeup_s3 which is supported only in Romstage. Previous sleep state is already read from the PM1_CNT register and is stored as part of acpi_pm_gpe_state structure. Use the previous state from that structure and update the elog_pm1_status function signature accordingly.
BUG=None TEST=Build and boot to OS in Guybrush.
Change-Id: I492d2928fa94e5245101a463341d1f170efb5254 Signed-off-by: Karthikeyan Ramasubramanian kramasub@google.com --- M src/soc/amd/common/block/acpi/acpi.c M src/soc/amd/common/block/elog/elog.c M src/soc/amd/common/block/include/amdblocks/elog.h 3 files changed, 6 insertions(+), 5 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/62/56362/1
diff --git a/src/soc/amd/common/block/acpi/acpi.c b/src/soc/amd/common/block/acpi/acpi.c index d9807eb..2ce9ed6 100644 --- a/src/soc/amd/common/block/acpi/acpi.c +++ b/src/soc/amd/common/block/acpi/acpi.c @@ -84,7 +84,7 @@ return;
state = &ps->gpe_state; - elog_pm1_status(state->pm1_sts); + elog_pm1_status(state); print_pm1_status(state->pm1_sts); elog_gpe_events(state); } diff --git a/src/soc/amd/common/block/elog/elog.c b/src/soc/amd/common/block/elog/elog.c index a8c2e44..79e9825 100644 --- a/src/soc/amd/common/block/elog/elog.c +++ b/src/soc/amd/common/block/elog/elog.c @@ -4,14 +4,15 @@ #include <elog.h> #include <soc/southbridge.h>
-void elog_pm1_status(uint16_t pm1_sts) +void elog_pm1_status(const struct acpi_pm_gpe_state *state) { + uint16_t pm1_sts = state->pm1_sts; + if (!CONFIG(ELOG)) return;
if (pm1_sts & WAK_STS) - elog_add_event_byte(ELOG_TYPE_ACPI_WAKE, - acpi_is_wakeup_s3() ? ACPI_S3 : ACPI_S5); + elog_add_event_byte(ELOG_TYPE_ACPI_WAKE, state->previous_sx_state);
if (pm1_sts & PWRBTN_STS) elog_add_event_wake(ELOG_WAKE_SOURCE_PWRBTN, 0); diff --git a/src/soc/amd/common/block/include/amdblocks/elog.h b/src/soc/amd/common/block/include/amdblocks/elog.h index 8b1e8fa..d75a6f0 100644 --- a/src/soc/amd/common/block/include/amdblocks/elog.h +++ b/src/soc/amd/common/block/include/amdblocks/elog.h @@ -5,7 +5,7 @@
#include <amdblocks/acpi.h>
-void elog_pm1_status(uint16_t pm1_sts); +void elog_pm1_status(const struct acpi_pm_gpe_state *state);
void elog_gpe_events(const struct acpi_pm_gpe_state *state);