Rizwan Qureshi has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/70013 )
Change subject: intel/common/block/cse: Update input and return type for hmrfpo status API ......................................................................
intel/common/block/cse: Update input and return type for hmrfpo status API
Update return type for hmrfpo status API to align with the rest of the APIs in the file. Also add an input variable to return the status
TEST=Build and boot on nirwen
Signed-off-by: Rizwan Qureshi rizwan.qureshi@intel.com Change-Id: Id4bcec44430ab8e6efbd54fd69f582fc93a69e5d --- M src/soc/intel/common/block/cse/cse.c M src/soc/intel/common/block/include/intelblocks/cse.h 2 files changed, 32 insertions(+), 9 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/13/70013/1
diff --git a/src/soc/intel/common/block/cse/cse.c b/src/soc/intel/common/block/cse/cse.c index c2d4484..4ab8eca 100644 --- a/src/soc/intel/common/block/cse/cse.c +++ b/src/soc/intel/common/block/cse/cse.c @@ -820,7 +820,7 @@ * Sends HMRFPO Get Status command to CSE to get the HMRFPO status. * The status can be DISABLED/LOCKED/ENABLED */ -int cse_hmrfpo_get_status(void) +int cse_hmrfpo_get_status(uint8_t *hmrfpo_status) { struct hmrfpo_get_status_msg { struct mkhi_hdr hdr; @@ -841,26 +841,28 @@ struct hmrfpo_get_status_resp resp; size_t resp_size = sizeof(struct hmrfpo_get_status_resp);
- printk(BIOS_INFO, "HECI: Sending Get HMRFPO Status Command\n"); + printk(BIOS_INFO, "HECI: Send HMRFPO Status Command\n");
if (!cse_is_hfs1_cws_normal()) { printk(BIOS_ERR, "HECI: CSE's current working state is not Normal\n"); - return -1; + return 0; }
if (heci_send_receive(&msg, sizeof(struct hmrfpo_get_status_msg), &resp, &resp_size, HECI_MKHI_ADDR)) { printk(BIOS_ERR, "HECI: HMRFPO send/receive fail\n"); - return -1; + return 0; }
if (resp.hdr.result) { printk(BIOS_ERR, "HECI: HMRFPO Resp Failed:%d\n", resp.hdr.result); - return -1; + return 0; }
- return resp.status; + *hmrfpo_status = resp.status; + + return 1; }
void print_me_fw_version(void *unused) diff --git a/src/soc/intel/common/block/include/intelblocks/cse.h b/src/soc/intel/common/block/include/intelblocks/cse.h index f7aae1c..02141fb 100644 --- a/src/soc/intel/common/block/include/intelblocks/cse.h +++ b/src/soc/intel/common/block/include/intelblocks/cse.h @@ -27,6 +27,11 @@ #define MKHI_HMRFPO_ENABLE 0x1 #define MKHI_HMRFPO_GET_STATUS 0x3
+#define HMRFPO_STATUS_DISABLED 0x0 +#define HMRFPO_STATUS_LOCKED 0x1 +#define HMRFPO_STATUS_ENABLED 0x2 + + /* Get Firmware Version Command Id */ #define MKHI_GEN_GET_FW_VERSION 0x2
@@ -409,10 +414,11 @@
/* * Send HMRFPO_GET_STATUS command. - * returns -1 on failure and 0 (DISABLED)/ 1 (LOCKED)/ 2 (ENABLED) - * on success. + * returns 0 on failure and 1 on success. + * hmrfpo_status is updated with 0 (DISABLED)/ 1 (LOCKED)/ 2 (ENABLED) + * */ -int cse_hmrfpo_get_status(void); +int cse_hmrfpo_get_status(uint8_t *hmrfpo_status);
/* Fixed Address MEI Header's Host Address field value */ #define BIOS_HOST_ADDR 0x00