aboutsummaryrefslogtreecommitdiff
path: root/plat/ti/k3/common/drivers/sec_proxy/sec_proxy.c
diff options
context:
space:
mode:
authorAndrew F. Davis <afd@ti.com>2019-04-10 11:45:19 -0400
committerAndrew F. Davis <afd@ti.com>2019-04-23 11:09:13 -0400
commitfb98ca5a81aaf010a352e1353ae915c6e4ebfd9b (patch)
tree16cdbd747ccf08d51bc570563f5cb74912fe5c6a /plat/ti/k3/common/drivers/sec_proxy/sec_proxy.c
parent6c30baee93d97c0fd2d41be51fca2e681f8dc9ab (diff)
downloadtrusted-firmware-a-fb98ca5a81aaf010a352e1353ae915c6e4ebfd9b.tar.gz
ti: k3: drivers: sec_proxy: Use direction definitions
The direction of a thread should be explicitly compared to avoid confusion. Also fixup message wording based on this direction. Signed-off-by: Andrew F. Davis <afd@ti.com> Change-Id: Ia3cf9413cd23af476bb5d2e6d70bee15234cbd11
Diffstat (limited to 'plat/ti/k3/common/drivers/sec_proxy/sec_proxy.c')
-rw-r--r--plat/ti/k3/common/drivers/sec_proxy/sec_proxy.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/plat/ti/k3/common/drivers/sec_proxy/sec_proxy.c b/plat/ti/k3/common/drivers/sec_proxy/sec_proxy.c
index 0cf296b579..ee1eecf789 100644
--- a/plat/ti/k3/common/drivers/sec_proxy/sec_proxy.c
+++ b/plat/ti/k3/common/drivers/sec_proxy/sec_proxy.c
@@ -138,7 +138,7 @@ static inline int k3_sec_proxy_verify_thread(struct k3_sec_proxy_thread *spt,
/* Make sure thread is configured for right direction */
if ((mmio_read_32(spt->scfg + SCFG_THREAD_CTRL) & SCFG_THREAD_CTRL_DIR_MASK)
!= (dir << SCFG_THREAD_CTRL_DIR_SHIFT)) {
- if (dir)
+ if (dir == THREAD_IS_TX)
ERROR("Trying to send data on RX Thread %s\n",
spt->name);
else
@@ -151,10 +151,12 @@ static inline int k3_sec_proxy_verify_thread(struct k3_sec_proxy_thread *spt,
uint32_t tick_start = (uint32_t)read_cntpct_el0();
uint32_t ticks_per_us = SYS_COUNTER_FREQ_IN_TICKS / 1000000;
while (!(mmio_read_32(spt->rt + RT_THREAD_STATUS) & RT_THREAD_STATUS_CUR_CNT_MASK)) {
- VERBOSE("Waiting for thread %s to clear\n", spt->name);
+ VERBOSE("Waiting for thread %s to %s\n",
+ spt->name, (dir == THREAD_IS_TX) ? "empty" : "fill");
if (((uint32_t)read_cntpct_el0() - tick_start) >
(spm.desc.timeout_us * ticks_per_us)) {
- ERROR("Timeout waiting for thread %s to clear\n", spt->name);
+ ERROR("Timeout waiting for thread %s to %s\n",
+ spt->name, (dir == THREAD_IS_TX) ? "empty" : "fill");
return -ETIMEDOUT;
}
}