Rizwan Qureshi has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/57295 )
Change subject: soc/intel/common/cse: Add argument to send message to appropriate fixed client ......................................................................
soc/intel/common/cse: Add argument to send message to appropriate fixed client
There are multiple HECI clents in the CSE. Currently coreboot is sending HECI messages to only the MKHI client. Add an argument to heci_send_receive() funtion to provide flexibility to the caller to select the client for which the message is intended for.
In the follow-up patches there will be messages sent to one other client.
BUG=None BRANCH=None TEST=Build and boot brya. HECI message send and receive to MKHI client is working.
Signed-off-by: Rizwan Qureshi rizwan.qureshi@intel.com Change-Id: Icde6d0155b62472b6a7caadc5fc8ea2e2ba6eb0c --- M src/soc/intel/common/block/cse/cse.c M src/soc/intel/common/block/cse/cse_eop.c M src/soc/intel/common/block/cse/cse_lite.c M src/soc/intel/common/block/include/intelblocks/cse.h 4 files changed, 17 insertions(+), 11 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/95/57295/1
diff --git a/src/soc/intel/common/block/cse/cse.c b/src/soc/intel/common/block/cse/cse.c index 7708c1b..f4a1ead 100644 --- a/src/soc/intel/common/block/cse/cse.c +++ b/src/soc/intel/common/block/cse/cse.c @@ -533,9 +533,10 @@ return 0; }
-int heci_send_receive(const void *snd_msg, size_t snd_sz, void *rcv_msg, size_t *rcv_sz) +int heci_send_receive(const void *snd_msg, size_t snd_sz, void *rcv_msg, size_t *rcv_sz, + uint8_t client) { - if (!heci_send(snd_msg, snd_sz, BIOS_HOST_ADDR, HECI_MKHI_ADDR)) { + if (!heci_send(snd_msg, snd_sz, BIOS_HOST_ADDR, client)) { printk(BIOS_ERR, "HECI: send Failed\n"); return 0; } @@ -663,7 +664,8 @@ if (rst_type == CSE_RESET_ONLY) status = heci_send(&msg, sizeof(msg), BIOS_HOST_ADDR, HECI_MKHI_ADDR); else - status = heci_send_receive(&msg, sizeof(msg), &reply, &reply_size); + status = heci_send_receive(&msg, sizeof(msg), &reply, &reply_size, + HECI_MKHI_ADDR);
printk(BIOS_DEBUG, "HECI: Global Reset %s!\n", status ? "success" : "failure"); return status; @@ -733,7 +735,7 @@ }
if (!heci_send_receive(&msg, sizeof(struct hmrfpo_enable_msg), - &resp, &resp_size)) + &resp, &resp_size, HECI_MKHI_ADDR)) return 0;
if (resp.hdr.result) { @@ -782,7 +784,7 @@ }
if (!heci_send_receive(&msg, sizeof(struct hmrfpo_get_status_msg), - &resp, &resp_size)) { + &resp, &resp_size, HECI_MKHI_ADDR)) { printk(BIOS_ERR, "HECI: HMRFPO send/receive fail\n"); return -1; } @@ -847,7 +849,8 @@
heci_reset();
- if (!heci_send_receive(&fw_ver_msg, sizeof(fw_ver_msg), &resp, &resp_size)) + if (!heci_send_receive(&fw_ver_msg, sizeof(fw_ver_msg), &resp, &resp_size, + HECI_MKHI_ADDR)) goto fail;
if (resp.hdr.result) diff --git a/src/soc/intel/common/block/cse/cse_eop.c b/src/soc/intel/common/block/cse/cse_eop.c index 6e57439..aac8c06 100644 --- a/src/soc/intel/common/block/cse/cse_eop.c +++ b/src/soc/intel/common/block/cse/cse_eop.c @@ -112,7 +112,7 @@
printk(BIOS_INFO, "HECI: Sending End-of-Post\n");
- if (!heci_send_receive(&msg, sizeof(msg), &resp, &resp_size)) { + if (!heci_send_receive(&msg, sizeof(msg), &resp, &resp_size, HECI_MKHI_ADDR)) { printk(BIOS_ERR, "HECI: EOP send/receive fail\n"); return CSE_EOP_RESULT_ERROR; } diff --git a/src/soc/intel/common/block/cse/cse_lite.c b/src/soc/intel/common/block/cse/cse_lite.c index 15d585d..762de2a 100644 --- a/src/soc/intel/common/block/cse/cse_lite.c +++ b/src/soc/intel/common/block/cse/cse_lite.c @@ -202,7 +202,8 @@
size_t resp_size = sizeof(struct get_bp_info_rsp);
- if (!heci_send_receive(&info_req, sizeof(info_req), bp_info_rsp, &resp_size)) { + if (!heci_send_receive(&info_req, sizeof(info_req), bp_info_rsp, &resp_size, + HECI_MKHI_ADDR)) { printk(BIOS_ERR, "cse_lite: Could not get partition info\n"); return false; } @@ -254,7 +255,8 @@ struct mkhi_hdr switch_resp; size_t sw_resp_sz = sizeof(struct mkhi_hdr);
- if (!heci_send_receive(&switch_req, sizeof(switch_req), &switch_resp, &sw_resp_sz)) + if (!heci_send_receive(&switch_req, sizeof(switch_req), &switch_resp, &sw_resp_sz, + HECI_MKHI_ADDR)) return false;
if (switch_resp.result) { @@ -291,7 +293,7 @@ size_t data_clr_rsp_sz = sizeof(data_clr_rsp);
if (!heci_send_receive(&data_clr_rq, sizeof(data_clr_rq), &data_clr_rsp, - &data_clr_rsp_sz)) { + &data_clr_rsp_sz, HECI_MKHI_ADDR)) { return false; }
diff --git a/src/soc/intel/common/block/include/intelblocks/cse.h b/src/soc/intel/common/block/include/intelblocks/cse.h index 153cb22..ff2d6f2 100644 --- a/src/soc/intel/common/block/include/intelblocks/cse.h +++ b/src/soc/intel/common/block/include/intelblocks/cse.h @@ -152,7 +152,8 @@ * rcv_msg of size rcv_sz * Returns 0 on failure and 1 on success. */ -int heci_send_receive(const void *snd_msg, size_t snd_sz, void *rcv_msg, size_t *rcv_sz); +int heci_send_receive(const void *snd_msg, size_t snd_sz, void *rcv_msg, size_t *rcv_sz, + uint8_t client);
/* * Attempt device reset. This is useful and perhaps only thing left to do when