refactor(ti): rename the k3_sec_proxy_chan_id
As part of further abstracting the transport layer, let's be more
consistent with the naming conventions. So, let's get rid of the
k3_sec_proxy_chan_id names with something more generic like
ti_sci_transport_chan_id and RX/TX_SECURE_TRANSPORT_CHANNEL_ID
for the enums
Change-Id: Iadf9255b5fbeffa2e5b3d9e6d85ba68fe5010c5b
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 11491dc..74db8b6 100644
--- a/drivers/ti/ipc/sec_proxy.c
+++ b/drivers/ti/ipc/sec_proxy.c
@@ -97,16 +97,8 @@
.data_end_offset = 0x3C,
},
.threads = {
-#if !K3_SEC_PROXY_LITE
- SP_THREAD(SP_NOTIFY),
- SP_THREAD(SP_RESPONSE),
- SP_THREAD(SP_HIGH_PRIORITY),
- SP_THREAD(SP_LOW_PRIORITY),
- SP_THREAD(SP_NOTIFY_RESP),
-#else
- SP_THREAD(SP_RESPONSE),
- SP_THREAD(SP_HIGH_PRIORITY),
-#endif /* K3_SEC_PROXY_LITE */
+ SP_THREAD(RX_SECURE_TRANSPORT_CHANNEL_ID),
+ SP_THREAD(TX_SECURE_TRANSPORT_CHANNEL_ID),
},
};
@@ -176,7 +168,7 @@
*
* Return: 0 if all goes well, else appropriate error message
*/
-int ti_sci_transport_clear_rx_thread(enum k3_sec_proxy_chan_id id)
+int ti_sci_transport_clear_rx_thread(enum ti_sci_transport_chan_id id)
{
struct k3_sec_proxy_thread *spt = &spm.threads[id];
@@ -214,7 +206,7 @@
*
* Return: 0 if all goes well, else appropriate error message
*/
-int ti_sci_transport_send(enum k3_sec_proxy_chan_id id, const struct ti_sci_msg *msg)
+int ti_sci_transport_send(enum ti_sci_transport_chan_id id, const struct ti_sci_msg *msg)
{
struct k3_sec_proxy_thread *spt = &spm.threads[id];
union sec_msg_hdr secure_header;
@@ -287,7 +279,7 @@
*
* Return: 0 if all goes well, else appropriate error message
*/
-int ti_sci_transport_recv(enum k3_sec_proxy_chan_id id, struct ti_sci_msg *msg)
+int ti_sci_transport_recv(enum ti_sci_transport_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 889349b..7d1b470 100644
--- a/drivers/ti/ti_sci/ti_sci.c
+++ b/drivers/ti/ti_sci/ti_sci.c
@@ -96,7 +96,7 @@
* Return: 0 if all goes well, else appropriate error message
*/
static int ti_sci_get_response(struct ti_sci_msg *msg,
- enum k3_sec_proxy_chan_id chan)
+ enum ti_sci_transport_chan_id chan)
{
struct ti_sci_msg_hdr *hdr;
unsigned int retry = 5;
@@ -152,14 +152,14 @@
bakery_lock_get(&ti_sci_xfer_lock);
/* Clear any spurious messages in receive queue */
- ret = ti_sci_transport_clear_rx_thread(SP_RESPONSE);
+ ret = ti_sci_transport_clear_rx_thread(RX_SECURE_TRANSPORT_CHANNEL_ID);
if (ret) {
ERROR("Could not clear response queue (%d)\n", ret);
goto unlock;
}
/* Send the message */
- ret = ti_sci_transport_send(SP_HIGH_PRIORITY, tx_msg);
+ ret = ti_sci_transport_send(TX_SECURE_TRANSPORT_CHANNEL_ID, tx_msg);
if (ret) {
ERROR("Message sending failed (%d)\n", ret);
goto unlock;
@@ -167,7 +167,7 @@
/* Get the response if requested */
if (rx_msg->len != 0U) {
- ret = ti_sci_get_response(rx_msg, SP_RESPONSE);
+ ret = ti_sci_get_response(rx_msg, RX_SECURE_TRANSPORT_CHANNEL_ID);
if (ret != 0U) {
ERROR("Failed to get response (%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 30d96a7..13d0fb5 100644
--- a/drivers/ti/ti_sci/ti_sci_transport.h
+++ b/drivers/ti/ti_sci/ti_sci_transport.h
@@ -12,30 +12,23 @@
#include <stdint.h>
/**
- * enum k3_sec_proxy_chan_id - Secure Proxy thread IDs
+ * enum ti_sci_transport_chan_id - Secure Proxy thread IDs
*
- * These the available IDs used in k3_sec_proxy_{send,recv}()
- * There are two schemes we use:
- * * if K3_SEC_PROXY_LITE = 1, we just have two threads to talk
- * * if K3_SEC_PROXY_LITE = 0, we have the full fledged
- * communication scheme available.
+ * These are the available IDs used in ti_sci_transport_{send,recv}()
*/
-enum k3_sec_proxy_chan_id {
+enum ti_sci_transport_chan_id {
#if !K3_SEC_PROXY_LITE
- SP_NOTIFY = 0,
- SP_RESPONSE,
- SP_HIGH_PRIORITY,
- SP_LOW_PRIORITY,
- SP_NOTIFY_RESP,
+ RX_SECURE_TRANSPORT_CHANNEL_ID = 1,
+ TX_SECURE_TRANSPORT_CHANNEL_ID,
#else
- SP_RESPONSE = 8,
+ RX_SECURE_TRANSPORT_CHANNEL_ID = 8,
/*
* Note: TISCI documentation indicates "low priority", but in reality
* with a single thread, there is no low or high priority.. This usage
* is more appropriate for TF-A since we can reduce the churn as a
* result.
*/
- SP_HIGH_PRIORITY,
+ TX_SECURE_TRANSPORT_CHANNEL_ID,
#endif /* K3_SEC_PROXY_LITE */
};
@@ -58,7 +51,7 @@
*
* Return: 0 if all goes well, else appropriate error message
*/
-int ti_sci_transport_clear_rx_thread(enum k3_sec_proxy_chan_id id);
+int ti_sci_transport_clear_rx_thread(enum ti_sci_transport_chan_id id);
/**
* ti_sci_transport_send() - Send data over mailbox/ Secure Proxy thread
@@ -67,7 +60,7 @@
*
* Return: 0 if all goes well, else appropriate error message
*/
-int ti_sci_transport_send(enum k3_sec_proxy_chan_id id, const struct ti_sci_msg *msg);
+int ti_sci_transport_send(enum ti_sci_transport_chan_id id, const struct ti_sci_msg *msg);
/**
* ti_sci_transport_recv() - Receive data from a Secure Proxy thread/ mailbox
@@ -76,6 +69,6 @@
*
* Return: 0 if all goes well, else appropriate error message
*/
-int ti_sci_transport_recv(enum k3_sec_proxy_chan_id id, struct ti_sci_msg *msg);
+int ti_sci_transport_recv(enum ti_sci_transport_chan_id id, struct ti_sci_msg *msg);
#endif /* TI_SCI_TRANSPORT_H */