Attention is currently required from: Intel coreboot Reviewers.
Karthik Ramasubramanian has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/86169?usp=email )
Change subject: soc/intel/common/block/cse: Add API to match current PM event ......................................................................
soc/intel/common/block/cse: Add API to match current PM event
Introduce an API to read the CSME host firmware status register for current Power Management event and match it against an input event.
BUG=b:391449110 TEST=Build Brox BIOS image and boot to OS.
Change-Id: Ie9a49382ee2c1a8f59da6233e510cf2e38ac32ad Signed-off-by: Karthikeyan Ramasubramanian kramasub@google.com --- M src/soc/intel/common/block/cse/cse.c M src/soc/intel/common/block/include/intelblocks/cse.h 2 files changed, 25 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/69/86169/1
diff --git a/src/soc/intel/common/block/cse/cse.c b/src/soc/intel/common/block/cse/cse.c index 6389044..61913b7 100644 --- a/src/soc/intel/common/block/cse/cse.c +++ b/src/soc/intel/common/block/cse/cse.c @@ -298,6 +298,21 @@ return !hfs1.fields.mfg_mode; }
+#define ME_HFSTS2_CUR_PM_EVENT_SHIFT 24 +#define ME_HFSTS2_CUR_PM_EVENT_MASK (0xF << ME_HFSTS2_CUR_PM_EVENT_SHIFT) +static uint8_t cse_get_hfs2_current_pm_event(void) +{ + union me_hfsts2 hfs2; + hfs2.data = me_read_config32(PCI_ME_HFSTS2); + return (uint8_t)((hfs2.data & ME_HFSTS2_CUR_PM_EVENT_MASK) >> + ME_HFSTS2_CUR_PM_EVENT_SHIFT); +} + +bool cse_match_current_pm_event(uint8_t event) +{ + return cse_get_hfs2_current_pm_event() == event; +} + bool cse_is_hfs3_fw_sku_lite(void) { union me_hfsts3 hfs3; diff --git a/src/soc/intel/common/block/include/intelblocks/cse.h b/src/soc/intel/common/block/include/intelblocks/cse.h index c97e4ec..cc7a458 100644 --- a/src/soc/intel/common/block/include/intelblocks/cse.h +++ b/src/soc/intel/common/block/include/intelblocks/cse.h @@ -383,6 +383,10 @@ CSE_RESET_ONLY = 3, };
+enum cse_fw_sts_current_pm_event { + PWR_CYCLE_RESET_CMOFF = 0xB, +}; + /* * Sends GLOBAL_RESET_REQ cmd to CSE with reset type GLOBAL_RESET. * Returns 0 on failure and 1 on success. @@ -618,4 +622,10 @@ */ bool is_cse_boot_to_rw(void);
+/* + * Check if the CSE FW Status Current Power Management Event matches with input. + * Returns true if the current pm event matches, false otherwise. + */ +bool cse_match_current_pm_event(uint8_t event); + #endif // SOC_INTEL_COMMON_CSE_H