summaryrefslogtreecommitdiff
path: root/src/soc/intel/common
diff options
context:
space:
mode:
authorSridhar Siricilla <sridhar.siricilla@intel.com>2022-03-04 09:24:48 +0530
committerFelix Held <felix-coreboot@felixheld.de>2022-03-16 16:56:50 +0000
commit073da0cbae869389a2fd07a18feaea0c6c7d42e1 (patch)
tree2dbc2e10cb24d2c81b6eefe24a3f8606a028f8af /src/soc/intel/common
parent92bd71ff741f61787fbd05155c03c56e5ffaca10 (diff)
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>
Diffstat (limited to 'src/soc/intel/common')
-rw-r--r--src/soc/intel/common/block/cse/cse_eop.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/soc/intel/common/block/cse/cse_eop.c b/src/soc/intel/common/block/cse/cse_eop.c
index c6b527778f..a8c8bbdfcf 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 enum cse_cmd_result decode_heci_send_receive_error(enum cse_tx_rx_status
}
}
-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 @@ static bool cse_disable_mei_bus(void)
} __packed reply = {};
size_t reply_sz = sizeof(reply);
+ enum cse_tx_rx_status ret;
+
+ printk(BIOS_DEBUG, "HECI, Sending MEI BIOS DISABLE command\n");
+ ret = heci_send_receive(&msg, sizeof(msg), &reply, &reply_sz, HECI_MEI_ADDR);
- if (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 enum cse_cmd_result cse_send_cmd_retries(enum cse_cmd_result (*cse_send_c
*/
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");