Sridhar Siricilla has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/38800 )
Change subject: soc/intel/common: Check prerequisites for GLOBAL_RESET command ......................................................................
soc/intel/common: Check prerequisites for GLOBAL_RESET command
Check prerequisites before sending GLOBAL RESET command to CSE.
TEST=Verified on hatch.
Change-Id: Ia583e4033f15ec20e942202fa78e7884cf370ce4 Signed-off-by: Sridhar Siricilla sridhar.siricilla@intel.com --- M src/soc/intel/common/block/cse/cse.c 1 file changed, 17 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/00/38800/1
diff --git a/src/soc/intel/common/block/cse/cse.c b/src/soc/intel/common/block/cse/cse.c index 072dd05..735c0e1 100644 --- a/src/soc/intel/common/block/cse/cse.c +++ b/src/soc/intel/common/block/cse/cse.c @@ -607,6 +607,17 @@ return pci_read_config32(PCH_DEV_CSE, offset); }
+static int cse_check_global_reset_prerequisites(void) +{ + if (cse_is_hfs1_cws_normal() && cse_is_hfs1_com_normal()) + return 1; + else if (cse_is_hfs3_fw_sku_custom() && cse_is_hfs1_cws_normal() + && (cse_is_hfs1_com_soft_temp_disable() || cse_is_hfs1_com_secover_mei_msg())) + return 1; + + return 0; +} + /* * Sends GLOBAL_RESET_REQ cmd to CSE.The reset type can be GLOBAL_RESET/ * HOST_RESET_ONLY/CSE_RESET_ONLY. @@ -631,12 +642,18 @@ size_t reply_size;
printk(BIOS_DEBUG, "HECI: Global Reset(Type:%d) Command\n", rst_type); + if (!((rst_type == GLOBAL_RESET) || (rst_type == HOST_RESET_ONLY) || (rst_type == CSE_RESET_ONLY))) { printk(BIOS_ERR, "HECI: Unsupported reset type is requested\n"); return 0; }
+ if (!cse_check_global_reset_prerequisites()) { + printk(BIOS_ERR, "HECI: CSE is not meeting required prerequisites\n"); + return 0; + } + heci_reset();
reply_size = sizeof(reply);