summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAaron Durbin <adurbin@chromium.org>2020-08-14 17:12:34 -0600
committerAaron Durbin <adurbin@chromium.org>2020-08-17 17:41:22 +0000
commit6dbec2d81b2d6fcfacfb94ca7e2c319366597a5c (patch)
tree8b553386c345ac944f78c505ef88f93337129712 /src
parentc30981c952ba35f20c280b651f5a61616993af26 (diff)
soc/amd/common: add GPE event logs
GPE events were not be recorded in the eventlog. Add those to the eventlog when the status register indicates those events. BUG=b:159947207 Signed-off-by: Aaron Durbin <adurbin@chromium.org> Change-Id: Ifb3167fd24f2171b2baf1a65eb81a318eb3e7a86 Reviewed-on: https://review.coreboot.org/c/coreboot/+/44489 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Furquan Shaikh <furquan@google.com>
Diffstat (limited to 'src')
-rw-r--r--src/soc/amd/common/block/acpi/acpi.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/soc/amd/common/block/acpi/acpi.c b/src/soc/amd/common/block/acpi/acpi.c
index 17c0ed16c7..2d75ec0e94 100644
--- a/src/soc/amd/common/block/acpi/acpi.c
+++ b/src/soc/amd/common/block/acpi/acpi.c
@@ -83,6 +83,17 @@ static void log_pm1_status(uint16_t pm1_sts)
elog_add_event_wake(ELOG_WAKE_SOURCE_PCIE, 0);
}
+static void log_gpe_events(const struct acpi_pm_gpe_state *state)
+{
+ int i;
+ uint32_t valid_gpe = state->gpe0_sts & state->gpe0_en;
+
+ for (i = 0; i <= 31; i++) {
+ if (valid_gpe & (1U << i))
+ elog_add_event_wake(ELOG_WAKE_SOURCE_GPIO, i);
+ }
+}
+
void acpi_fill_pm_gpe_state(struct acpi_pm_gpe_state *state)
{
state->pm1_sts = acpi_read16(MMIO_ACPI_PM1_STS);
@@ -97,6 +108,7 @@ void acpi_pm_gpe_add_events_print_events(const struct acpi_pm_gpe_state *state)
{
log_pm1_status(state->pm1_sts);
print_pm1_status(state->pm1_sts);
+ log_gpe_events(state);
}
void acpi_clear_pm_gpe_status(void)