Sridhar Siricilla has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/37283 )
Change subject: soc/intel/common/block/cse: Modify handling of HMRFPO_ENABLE command ......................................................................
soc/intel/common/block/cse: Modify handling of HMRFPO_ENABLE command
Below changes have been done in the send_hmrfpo_enable_msg(): 1. Allow execution of HMRFPO_ENABLE command only when CSE's operation mode is Temp Disable Mode. 2. Add check for response status. 3. Add description for the send_hmrfpo_enable_msg()
The HMRFPO (Host ME Region Flash Protection Override) mode prevents CSE to execute SPI I/O cycles to CSE region, and unlocks the CSE region to perfom updates to it.This command is only valid before EOP.
When MRP feature is enabled, procedure to place CSE in HMRFPO mode: 1. Ensure CSE to boot from BP1. When CSE boots from BP1, it will have opmode: Temp Disable Mode. 2. Send HMRFPO_ENABLE command to CSE. Then, CSE enters HMRFPO mode.
The MRP feature enables CSE FW to support redundant boot partitions, and allow CSE to operate with 'Temporary Disable Mode'. The feature is enabled through FIT settings during build phase. Also, CSE can boot from either BP1 or BP2.
CSE Image Layout with MRP enabled: = [RO] + [RW + DATA PART] = [BP1] + [BP2 + BP3 + DATA PART]
Here, BP1 is replica of BP2, and the BP1 will be CSE's RO partition and [BP2 + BP3 + DATA PART] together will represent CSE's RW partition.
Existing CSE Image Layout without MRP feature: = BP2 + BP3 + DATA PART
Change-Id: I7c87998fa105947e5ba4638a8e68625e46703448 Signed-off-by: Sridhar Siricilla sridhar.siricilla@intel.com --- M src/soc/intel/common/block/cse/cse.c M src/soc/intel/common/block/include/intelblocks/cse.h 2 files changed, 24 insertions(+), 8 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/83/37283/1
diff --git a/src/soc/intel/common/block/cse/cse.c b/src/soc/intel/common/block/cse/cse.c index 46ad8ce..b60d888 100644 --- a/src/soc/intel/common/block/cse/cse.c +++ b/src/soc/intel/common/block/cse/cse.c @@ -659,15 +659,13 @@
printk(BIOS_DEBUG, "HECI: Send HMRFPO Enable Command\n"); hfs1.data = me_read_config32(PCI_ME_HFSTS1); + /* * This command can be run only if: - * - Working state is normal and - * - Operation mode is normal or temporary disable mode. + * - Operation mode is temporary disable mode. */ - if (hfs1.fields.working_state != ME_HFS_CWS_NORMAL || - (hfs1.fields.operation_mode != ME_HFS_MODE_NORMAL && - hfs1.fields.operation_mode != ME_HFS_MODE_TEMP_DISABLE)) { - printk(BIOS_ERR, "HECI: ME not in required Mode\n"); + if (hfs1.fields.operation_mode != ME_HFS_MODE_TEMP_DISABLE) { + printk(BIOS_ERR, "HECI: ME is not in expected mode/state(0x%x)\n", hfs1.data); goto failed; }
@@ -679,6 +677,12 @@ printk(BIOS_ERR, "HECI: Resp Failed:%d\n", resp.hdr.result); goto failed; } + + if (resp.status) { + printk(BIOS_ERR, "HECI: Enable Failed, resp status:%d\n", resp.status); + goto failed; + } + return 1;
failed: diff --git a/src/soc/intel/common/block/include/intelblocks/cse.h b/src/soc/intel/common/block/include/intelblocks/cse.h index 3c00b87..53f5493 100644 --- a/src/soc/intel/common/block/include/intelblocks/cse.h +++ b/src/soc/intel/common/block/include/intelblocks/cse.h @@ -128,8 +128,20 @@ int send_heci_reset_req_message(uint8_t rst_type);
/* - * Send HMRFPO_ENABLE command. - * returns 0 on failure and 1 on success. + * Sends HMRFPO_ENABLE command. + * HMRFPO - Host ME Region Flash Protection Override. + * When MRP feature is enabled, procedure to place CSE in HMRFPO (SECOVER_MEI_MSG) mode: + * 1. Ensure CSE boots from BP1(RO). + * - Send set_next_boot_partition(BP1) + * - Issue CSE Only Reset + * 2. Send HMRFPO_ENABLE command to CSE. Further, no reset is required. + * + * The HMRFPO mode prevents CSE to execute SPI I/O cycles to CSE region, and unlocks + * the CSE region to perfom updates to it. + * This command is only valid before EOP. + * + * Returns 0 on failure to send heci command and to enable hmrfpo mode, and 1 on success. + * */ int send_hmrfpo_enable_msg(void);