aboutsummaryrefslogtreecommitdiff
path: root/plat/ti/k3/common/drivers/sec_proxy/sec_proxy.c
diff options
context:
space:
mode:
authorNishanth Menon <nm@ti.com>2020-12-10 17:37:04 -0600
committerNishanth Menon <nm@ti.com>2020-12-23 06:33:39 -0600
commitf577388a3292c60d6b4483c7cda267375de77f52 (patch)
treee55cddbc9e1a06206feeb06e8b95331fbae4e040 /plat/ti/k3/common/drivers/sec_proxy/sec_proxy.c
parent6a22d9ea3c7fa28d053d3ba264b49b7396a86f9e (diff)
downloadtrusted-firmware-a-f577388a3292c60d6b4483c7cda267375de77f52.tar.gz
ti: k3: common: sec_proxy: Fill non-message data fields with 0x0
Sec proxy data buffer is 60 bytes with the last of the registers indicating transmission completion. This however poses a bit of a challenge. The backing memory for sec_proxy is regular memory, and all sec proxy does is to trigger a burst of all 60 bytes of data over to the target thread backing ring accelerator. It doesn't do a memory scrub when it moves data out in the burst. When we transmit multiple messages, remnants of previous message is also transmitted which results in some random data being set in TISCI fields of messages that have been expanded forward. The entire concept of backward compatibility hinges on the fact that the unused message fields remain 0x0 allowing for 0x0 value to be specially considered when backward compatibility of message extension is done. So, instead of just writing the completion register, we continue to fill the message buffer up with 0x0 (note: for partial message involving completion, we already do this). This allows us to scale and introduce ABI changes back into TF-A only as needed. Signed-off-by: Nishanth Menon <nm@ti.com> Change-Id: Ie22cb2a319f4aa80aef23ffc7e059207e5d4c640
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.c9
1 files changed, 7 insertions, 2 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 ee1eecf789..cbe5fdab93 100644
--- a/plat/ti/k3/common/drivers/sec_proxy/sec_proxy.c
+++ b/plat/ti/k3/common/drivers/sec_proxy/sec_proxy.c
@@ -261,9 +261,14 @@ int k3_sec_proxy_send(enum k3_sec_proxy_chan_id id, const struct k3_sec_proxy_ms
/*
* 'data_reg' indicates next register to write. If we did not already
* write on tx complete reg(last reg), we must do so for transmit
+ * In addition, we also need to make sure all intermediate data
+ * registers(if any required), are reset to 0 for TISCI backward
+ * compatibility to be maintained.
*/
- if (data_reg <= spm.desc.data_end_offset)
- mmio_write_32(spt->data + spm.desc.data_end_offset, 0);
+ while (data_reg <= spm.desc.data_end_offset) {
+ mmio_write_32(spt->data + data_reg, 0);
+ data_reg += sizeof(uint32_t);
+ }
VERBOSE("Message successfully sent on thread %s\n", spt->name);