refactor(ti): rename the sec_proxy functions
Since the underneath transport layer may or may not always be sec_proxy
it doesn't make sense to keep following the k3_sec_proxy_* convention
for the TI SCI message transports.
Rename them to something more generic like ti_sci_transport_*.
Change-Id: I17a85b302e2a6c4cab71697110c48cbc09838ca6
Signed-off-by: Dhruva Gole <d-gole@ti.com>
diff --git a/drivers/ti/ipc/sec_proxy.c b/drivers/ti/ipc/sec_proxy.c
index 30c7ced..11491dc 100644
--- a/drivers/ti/ipc/sec_proxy.c
+++ b/drivers/ti/ipc/sec_proxy.c
@@ -170,13 +170,13 @@
}
/**
- * k3_sec_proxy_clear_rx_thread() - Clear Secure Proxy thread
+ * ti_sci_transport_clear_rx_thread() - Clear Secure Proxy thread
*
* @id: Channel Identifier
*
* Return: 0 if all goes well, else appropriate error message
*/
-int k3_sec_proxy_clear_rx_thread(enum k3_sec_proxy_chan_id id)
+int ti_sci_transport_clear_rx_thread(enum k3_sec_proxy_chan_id id)
{
struct k3_sec_proxy_thread *spt = &spm.threads[id];
@@ -208,13 +208,13 @@
}
/**
- * k3_sec_proxy_send() - Send data over a Secure Proxy thread
+ * ti_sci_transport_send() - Send data over a Secure Proxy thread
* @id: Channel Identifier
- * @msg: Pointer to k3_sec_proxy_msg
+ * @msg: Pointer to ti_sci_msg
*
* Return: 0 if all goes well, else appropriate error message
*/
-int k3_sec_proxy_send(enum k3_sec_proxy_chan_id id, const struct k3_sec_proxy_msg *msg)
+int ti_sci_transport_send(enum k3_sec_proxy_chan_id id, const struct ti_sci_msg *msg)
{
struct k3_sec_proxy_thread *spt = &spm.threads[id];
union sec_msg_hdr secure_header;
@@ -281,13 +281,13 @@
}
/**
- * k3_sec_proxy_recv() - Receive data from a Secure Proxy thread
+ * ti_sci_transport_recv() - Receive data from a Secure Proxy thread
* @id: Channel Identifier
- * @msg: Pointer to k3_sec_proxy_msg
+ * @msg: Pointer to ti_sci_msg
*
* Return: 0 if all goes well, else appropriate error message
*/
-int k3_sec_proxy_recv(enum k3_sec_proxy_chan_id id, struct k3_sec_proxy_msg *msg)
+int ti_sci_transport_recv(enum k3_sec_proxy_chan_id id, struct ti_sci_msg *msg)
{
struct k3_sec_proxy_thread *spt = &spm.threads[id];
union sec_msg_hdr secure_header;
diff --git a/drivers/ti/ti_sci/ti_sci.c b/drivers/ti/ti_sci/ti_sci.c
index 06c8ff3..889349b 100644
--- a/drivers/ti/ti_sci/ti_sci.c
+++ b/drivers/ti/ti_sci/ti_sci.c
@@ -2,7 +2,7 @@
* Texas Instruments System Control Interface Driver
* Based on Linux and U-Boot implementation
*
- * Copyright (C) 2018-2024 Texas Instruments Incorporated - https://www.ti.com/
+ * Copyright (C) 2018-2025 Texas Instruments Incorporated - https://www.ti.com/
*
* SPDX-License-Identifier: BSD-3-Clause
*/
@@ -34,8 +34,8 @@
* @rx_message: Receive message
*/
struct ti_sci_xfer {
- struct k3_sec_proxy_msg tx_message;
- struct k3_sec_proxy_msg rx_message;
+ struct ti_sci_msg tx_message;
+ struct ti_sci_msg rx_message;
};
/**
@@ -95,7 +95,7 @@
*
* Return: 0 if all goes well, else appropriate error message
*/
-static int ti_sci_get_response(struct k3_sec_proxy_msg *msg,
+static int ti_sci_get_response(struct ti_sci_msg *msg,
enum k3_sec_proxy_chan_id chan)
{
struct ti_sci_msg_hdr *hdr;
@@ -104,7 +104,7 @@
for (; retry > 0; retry--) {
/* Receive the response */
- ret = k3_sec_proxy_recv(chan, msg);
+ ret = ti_sci_transport_recv(chan, msg);
if (ret) {
ERROR("Message receive failed (%d)\n", ret);
return ret;
@@ -145,21 +145,21 @@
*/
static int ti_sci_do_xfer(struct ti_sci_xfer *xfer)
{
- struct k3_sec_proxy_msg *tx_msg = &xfer->tx_message;
- struct k3_sec_proxy_msg *rx_msg = &xfer->rx_message;
+ struct ti_sci_msg *tx_msg = &xfer->tx_message;
+ struct ti_sci_msg *rx_msg = &xfer->rx_message;
int ret;
bakery_lock_get(&ti_sci_xfer_lock);
/* Clear any spurious messages in receive queue */
- ret = k3_sec_proxy_clear_rx_thread(SP_RESPONSE);
+ ret = ti_sci_transport_clear_rx_thread(SP_RESPONSE);
if (ret) {
ERROR("Could not clear response queue (%d)\n", ret);
goto unlock;
}
/* Send the message */
- ret = k3_sec_proxy_send(SP_HIGH_PRIORITY, tx_msg);
+ ret = ti_sci_transport_send(SP_HIGH_PRIORITY, tx_msg);
if (ret) {
ERROR("Message sending failed (%d)\n", ret);
goto unlock;
diff --git a/drivers/ti/ti_sci/ti_sci_transport.h b/drivers/ti/ti_sci/ti_sci_transport.h
index 0c47275..30d96a7 100644
--- a/drivers/ti/ti_sci/ti_sci_transport.h
+++ b/drivers/ti/ti_sci/ti_sci_transport.h
@@ -40,42 +40,42 @@
};
/**
- * struct k3_sec_proxy_msg - Secure proxy message structure
+ * struct ti_sci_msg - Secure proxy message structure
* @len: Length of data in the Buffer
* @buf: Buffer pointer
*
- * This is the structure for data used in k3_sec_proxy_{send,recv}()
+ * This is the structure for data used in ti_sci_transport_{send,recv}()
*/
-struct k3_sec_proxy_msg {
+struct ti_sci_msg {
size_t len;
uint8_t *buf;
};
/**
- * k3_sec_proxy_clear_rx_thread() - Clear a receive Secure Proxy thread
+ * ti_sci_transport_clear_rx_thread() - Clear a receive Secure Proxy thread
* @id: Channel Identifier
- * @msg: Pointer to k3_sec_proxy_msg
+ * @msg: Pointer to ti_sci_msg
*
* Return: 0 if all goes well, else appropriate error message
*/
-int k3_sec_proxy_clear_rx_thread(enum k3_sec_proxy_chan_id id);
+int ti_sci_transport_clear_rx_thread(enum k3_sec_proxy_chan_id id);
/**
- * k3_sec_proxy_send() - Send data over a Secure Proxy thread
+ * ti_sci_transport_send() - Send data over mailbox/ Secure Proxy thread
* @id: Channel Identifier
- * @msg: Pointer to k3_sec_proxy_msg
+ * @msg: Pointer to ti_sci_msg
*
* Return: 0 if all goes well, else appropriate error message
*/
-int k3_sec_proxy_send(enum k3_sec_proxy_chan_id id, const struct k3_sec_proxy_msg *msg);
+int ti_sci_transport_send(enum k3_sec_proxy_chan_id id, const struct ti_sci_msg *msg);
/**
- * k3_sec_proxy_recv() - Receive data from a Secure Proxy thread
+ * ti_sci_transport_recv() - Receive data from a Secure Proxy thread/ mailbox
* @id: Channel Identifier
- * @msg: Pointer to k3_sec_proxy_msg
+ * @msg: Pointer to ti_sci_msg
*
* Return: 0 if all goes well, else appropriate error message
*/
-int k3_sec_proxy_recv(enum k3_sec_proxy_chan_id id, struct k3_sec_proxy_msg *msg);
+int ti_sci_transport_recv(enum k3_sec_proxy_chan_id id, struct ti_sci_msg *msg);
#endif /* TI_SCI_TRANSPORT_H */