soc/intel/common/cse: Add argument for CSE fixed client addr

There are multiple HECI clients in the CSE. heci_send_receive() is
sending HECI messages to only the MKHI client. Add an argument to
heci_send_receive() function to provide flexibility to the caller to
select the client for which the message is intended.
With the above change heci_send() and heci_receive() functions are
no longer required to be exposed.

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. Also, MEI BUS message to disable bus is working.

Signed-off-by: Rizwan Qureshi <rizwan.qureshi@intel.com>
Change-Id: Icde6d0155b62472b6a7caadc5fc8ea2e2ba6eb0c
Reviewed-on: https://review.coreboot.org/c/coreboot/+/57295
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
diff --git a/src/soc/intel/common/block/cse/cse.c b/src/soc/intel/common/block/cse/cse.c
index 7708c1b..1cea7d9 100644
--- a/src/soc/intel/common/block/cse/cse.c
+++ b/src/soc/intel/common/block/cse/cse.c
@@ -384,7 +384,12 @@
 	return pend_len;
 }
 
-int
+/*
+ * Send message msg of size len to host from host_addr to cse_addr.
+ * Returns 1 on success and 0 otherwise.
+ * In case of error heci_reset() may be required.
+ */
+static int
 heci_send(const void *msg, size_t len, uint8_t host_addr, uint8_t client_addr)
 {
 	uint8_t retry;
@@ -487,7 +492,15 @@
 	return recv_len;
 }
 
-int heci_receive(void *buff, size_t *maxlen)
+/*
+ * Receive message into buff not exceeding maxlen. Message is considered
+ * successfully received if a 'complete' indication is read from ME side
+ * and there was enough space in the buffer to fit that message. maxlen
+ * is updated with size of message that was received. Returns 0 on failure
+ * and 1 on success.
+ * In case of error heci_reset() may be required.
+ */
+static int heci_receive(void *buff, size_t *maxlen)
 {
 	uint8_t retry;
 	size_t left, received;
@@ -533,9 +546,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 cse_addr)
 {
-	if (!heci_send(snd_msg, snd_sz, BIOS_HOST_ADDR, HECI_MKHI_ADDR)) {
+	if (!heci_send(snd_msg, snd_sz, BIOS_HOST_ADDR, cse_addr)) {
 		printk(BIOS_ERR, "HECI: send Failed\n");
 		return 0;
 	}
@@ -663,7 +677,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 +748,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 +797,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 +862,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)