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/+/56361 )
Change subject: soc/amd/common/pm: Introduce pm_fill_chipset_state ......................................................................
soc/amd/common/pm: Introduce pm_fill_chipset_state
This function fills the buffer provided by the caller with the chipset power state information. This function will be used from the SMI handler to capture and log the wake source information.
BUG=None TEST=Build and boot to OS in Guybrush.
Change-Id: I8434ab2ec708c5061d45805cddd01e88a212a916 Signed-off-by: Karthikeyan Ramasubramanian kramasub@google.com --- M src/soc/amd/common/block/include/amdblocks/pmlib.h M src/soc/amd/common/block/pm/Makefile.inc M src/soc/amd/common/block/pm/chipset_state.c 3 files changed, 15 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/61/56361/1
diff --git a/src/soc/amd/common/block/include/amdblocks/pmlib.h b/src/soc/amd/common/block/include/amdblocks/pmlib.h index fae48cb..cc0156c 100644 --- a/src/soc/amd/common/block/include/amdblocks/pmlib.h +++ b/src/soc/amd/common/block/include/amdblocks/pmlib.h @@ -3,6 +3,8 @@ #ifndef SOC_AMD_COMMON_BLOCK_PMLIB_H #define SOC_AMD_COMMON_BLOCK_PMLIB_H
+#include <amdblocks/acpi.h> + enum { MAINBOARD_POWER_STATE_OFF, MAINBOARD_POWER_STATE_ON, @@ -20,4 +22,7 @@ /* stash ACPI PM/GPE and GPIO wake state before FSP-M call */ void pm_cache_chipset_state(void);
+/* Fill and return the chipset power state */ +void pm_fill_chipset_state(struct chipset_power_state *ps); + #endif /* SOC_AMD_COMMON_BLOCK_PMLIB_H */ diff --git a/src/soc/amd/common/block/pm/Makefile.inc b/src/soc/amd/common/block/pm/Makefile.inc index f016a9d..0baa114 100644 --- a/src/soc/amd/common/block/pm/Makefile.inc +++ b/src/soc/amd/common/block/pm/Makefile.inc @@ -1,3 +1,4 @@ bootblock-$(CONFIG_SOC_AMD_COMMON_BLOCK_PM) += pmlib.c
romstage-$(CONFIG_SOC_AMD_COMMON_BLOCK_PM_CHIPSET_STATE_SAVE) += chipset_state.c +smm-$(CONFIG_SOC_AMD_COMMON_BLOCK_PM_CHIPSET_STATE_SAVE) += chipset_state.c diff --git a/src/soc/amd/common/block/pm/chipset_state.c b/src/soc/amd/common/block/pm/chipset_state.c index abe64d7..6348942 100644 --- a/src/soc/amd/common/block/pm/chipset_state.c +++ b/src/soc/amd/common/block/pm/chipset_state.c @@ -14,6 +14,15 @@ gpio_fill_wake_state(&chipset_state.gpio_state); }
+void pm_fill_chipset_state(struct chipset_power_state *ps) +{ + if (!ps) + return; + + acpi_fill_pm_gpe_state(&ps->gpe_state); + gpio_fill_wake_state(&ps->gpio_state); +} + static void add_chipset_state_cbmem(int unused) { struct chipset_power_state *state;