Felix Held has submitted this change. ( https://review.coreboot.org/c/coreboot/+/62560 )
Change subject: soc/intel/common: Retry MEI CSE DISABLE command ......................................................................
soc/intel/common: Retry MEI CSE DISABLE command
As per ME BWG, the patch retries MEI CSE DISABLE command if CSE doesn't respond or sends the garbled response. It retries the command additionally 2 more times.
TEST=build and boot the Brya board Signed-off-by: Sridhar Siricilla sridhar.siricilla@intel.com Change-Id: Id38a172d670a0cd44643744f27b85ca7e368ccdb Reviewed-on: https://review.coreboot.org/c/coreboot/+/62560 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Tim Wawrzynczak twawrzynczak@chromium.org --- M src/soc/intel/common/block/cse/cse_eop.c 1 file changed, 10 insertions(+), 6 deletions(-)
Approvals: build bot (Jenkins): Verified Tim Wawrzynczak: Looks good to me, approved
diff --git a/src/soc/intel/common/block/cse/cse_eop.c b/src/soc/intel/common/block/cse/cse_eop.c index c6b5277..a8c8bbd 100644 --- a/src/soc/intel/common/block/cse/cse_eop.c +++ b/src/soc/intel/common/block/cse/cse_eop.c @@ -34,7 +34,7 @@ } }
-static bool cse_disable_mei_bus(void) +static enum cse_cmd_result cse_disable_mei_bus(void) { struct bus_disable_message { uint8_t command; @@ -49,18 +49,22 @@ } __packed reply = {};
size_t reply_sz = sizeof(reply); + enum cse_tx_rx_status ret;
- if (heci_send_receive(&msg, sizeof(msg), &reply, &reply_sz, HECI_MEI_ADDR)) { + printk(BIOS_DEBUG, "HECI, Sending MEI BIOS DISABLE command\n"); + ret = heci_send_receive(&msg, sizeof(msg), &reply, &reply_sz, HECI_MEI_ADDR); + + if (ret) { printk(BIOS_ERR, "HECI: Failed to Disable MEI bus\n"); - return false; + return decode_heci_send_receive_error(ret); }
if (reply.status) { printk(BIOS_ERR, "HECI: MEI_Bus_Disable Failed (status: %d)\n", reply.status); - return false; + return CSE_CMD_RESULT_ERROR; }
- return true; + return CSE_CMD_RESULT_SUCCESS; }
static enum cse_cmd_result cse_send_eop(void) @@ -158,7 +162,7 @@ */ static void cse_handle_eop_error(void) { - if (!cse_disable_mei_bus()) + if (cse_send_cmd_retries(cse_disable_mei_bus)) die("Failed to disable MEI bus while recovering from EOP error\n" "Preventing system from booting into an insecure state.\n");