From e30a0e63b5285bb84ce7cdce5d0c9aabba32c536 Mon Sep 17 00:00:00 2001 From: Sridhar Siricilla Date: Sat, 31 Aug 2019 16:12:21 +0530 Subject: src/soc/intel/common/block/cse: Add hmrfpo related functions to cse lib Below new functions are added: * send_hmrfpo_enable_msg() - Sends HMRFPO Enable command to CSE. This API sets ME in SEC_OVERRIDE mode. The mode prevents CSE to execute SPI I/O cycles to CSE region, and unlocks the CSE region to perfom updates to it. * send_hmrfpo_get_status_msg() - Sends HMRFPO Get Status command to CSE TEST=Verified sending HMRFPO_ENABLE & HMRFPO_GET_STATUS HECI commands on CML RVP & hatch board Change-Id: I559bc4641e12df7ed39b1c97097bf068f9a232db Signed-off-by: Rizwan Qureshi Signed-off-by: Sridhar Siricilla Reviewed-on: https://review.coreboot.org/c/coreboot/+/35229 Tested-by: build bot (Jenkins) Reviewed-by: V Sowmya --- src/soc/intel/common/block/include/intelblocks/cse.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'src/soc/intel/common/block/include/intelblocks') diff --git a/src/soc/intel/common/block/include/intelblocks/cse.h b/src/soc/intel/common/block/include/intelblocks/cse.h index 1b08b4d4ea..378f41713c 100644 --- a/src/soc/intel/common/block/include/intelblocks/cse.h +++ b/src/soc/intel/common/block/include/intelblocks/cse.h @@ -113,6 +113,20 @@ uint8_t wait_cse_sec_override_mode(void); */ int send_heci_reset_req_message(uint8_t rst_type); +/* + * Send HMRFPO_ENABLE command. + * returns 0 on failure and 1 on success. + */ +int send_hmrfpo_enable_msg(void); + +/* + * Send HMRFPO_GET_STATUS command. + * returns -1 on failure and 0 (DISABLED)/ 1 (LOCKED)/ 2 (ENABLED) + * on success. + */ +int send_hmrfpo_get_status_msg(void); + + #define BIOS_HOST_ADDR 0x00 #define HECI_MKHI_ADDR 0x07 @@ -121,4 +135,9 @@ int send_heci_reset_req_message(uint8_t rst_type); #define HOST_RESET_ONLY 2 #define CSE_RESET_ONLY 3 +/*HMRFPO Status types */ +#define MKHI_HMRFPO_DISABLED 0 +#define MKHI_HMRFPO_LOCKED 1 +#define MKHI_HMRFPO_ENABLED 2 + #endif // SOC_INTEL_COMMON_MSR_H -- cgit v1.2.3