soc/intel/cmn/cse: Make heci_(send|receive) public functions

Having these two functions public allow "asynchronous"
HECI command implementation.

Typically, these function can be use to implement an asynchronous
End-Of-Post.

BUG=b:268546941
BRANCH=firmware-brya-14505.B
TEST=Successful compilation for brya0

Change-Id: I7d029bb9af4b53f219018e459d17df9c1bd33fc1
Signed-off-by: Jeremy Compostella <jeremy.compostella@intel.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/73710
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Tarun Tuli <taruntuli@google.com>
Reviewed-by: Nick Vaccaro <nvaccaro@google.com>
This commit is contained in:
Jeremy Compostella 2023-03-13 13:41:43 -07:00 committed by Felix Held
parent e32565cd2d
commit 0e1be046ac
2 changed files with 20 additions and 15 deletions

View File

@ -422,12 +422,7 @@ send_one_message(uint32_t hdr, const void *buff)
return pend_len; return pend_len;
} }
/* enum cse_tx_rx_status
* Send message msg of size len to host from host_addr to cse_addr.
* Returns CSE_TX_RX_SUCCESS on success and other enum values on failure scenarios.
* Also, in case of errors, heci_reset() is triggered.
*/
static enum cse_tx_rx_status
heci_send(const void *msg, size_t len, uint8_t host_addr, uint8_t client_addr) heci_send(const void *msg, size_t len, uint8_t host_addr, uint8_t client_addr)
{ {
uint8_t retry; uint8_t retry;
@ -532,15 +527,7 @@ recv_one_message(uint32_t *hdr, void *buff, size_t maxlen, size_t *recv_len)
return CSE_TX_RX_SUCCESS; return CSE_TX_RX_SUCCESS;
} }
/* enum cse_tx_rx_status 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 CSE_TX_RX_SUCCESS on success and other enum values on failure scenarios.
* Also, in case of errors, heci_reset() is triggered.
*/
static enum cse_tx_rx_status heci_receive(void *buff, size_t *maxlen)
{ {
uint8_t retry; uint8_t retry;
size_t left, received; size_t left, received;

View File

@ -344,6 +344,24 @@ void cse_init(uintptr_t bar);
/* Initialize the HECI devices. */ /* Initialize the HECI devices. */
void heci_init(void); void heci_init(void);
/*
* Send message msg of size len to host from host_addr to cse_addr.
* Returns CSE_TX_RX_SUCCESS on success and other enum values on failure scenarios.
* Also, in case of errors, heci_reset() is triggered.
*/
enum cse_tx_rx_status heci_send(const void *msg, size_t len, uint8_t host_addr,
uint8_t client_addr);
/*
* 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 CSE_TX_RX_SUCCESS on success and other enum values on failure scenarios.
* Also, in case of errors, heci_reset() is triggered.
*/
enum cse_tx_rx_status heci_receive(void *buff, size_t *maxlen);
/* /*
* Send message from BIOS_HOST_ADDR to cse_addr. * Send message from BIOS_HOST_ADDR to cse_addr.
* Sends snd_msg of size snd_sz, and reads message into buffer pointed by * Sends snd_msg of size snd_sz, and reads message into buffer pointed by