Hello Jacky,
On 07.09.23 07:30, Jacky Bai wrote:
On 07.09.23 04:03, Jacky Bai wrote:
Subject: Cache Maintenance For SiP buffers
- How did it work so far? barebox does explicit flushing before HAB SiP, invalidation after. U-Boot doesn't do cache maintenance. Both apparently work...
You can refer to the docs/plat/imx8m.rst HAB section. ^_^.
I had checked the docs and while there is a note about why RAM is mapped MT-RW, there is no info about how cache coherency is maintained, hence my question.
RAM is the OCRAM, it is not used in the HAB SiP call for write data buffer.
TF-A RAM is OCRAM, but I care about the write data buffers used by BL33. Those are in DRAM, which is mapped cachable both in secure and non-secure world and may require explicit cache maintenance.
The DRAM is mapped as MT_NS in secure world. Should no cache coherence issue.
AFAICS, TF-A has a cacheable mapping of DRAM. If there's no explicit flushing in TF-A, that means that:
- There may be dirty lines in cache on exit to non-secure world - barebox invalidates cache on return from SMC - dirty lines are discarded, RAM is fetched, result is lost
The HAB code is working though, which makes me suspicious, whether I am not missing something.
Cheers, Ahmad
BR
Thanks, Ahmad
BR
Thanks, Ahmad
Pengutronix e.K. | |