I am doing an experiment with ARM trusted firmware (ATF) and a minimal barebone OS booted by ATF. The board that I am using is a Hikey 620 board and I cloned ATF from here: github.com/.../arm-trusted-firmware -b v2.5.
As a part of my experiment I have implemented a SMC from the OS into ATF to flush data caches. However, flushing does not work and I cannot remove entries from the dcache. I have tried "flush_dcache_range" and "dcsw_op_all(DCCISW)" and I also wrote my own code to flush the cache but none of them seem to have any effect. I wonder if you can help me with this and let me know if I am missing something or I need to do something specific before invoking the cache flushing procedures?
When you run in EL3-Secure, then cache operations will affect only EL3-Secure tagged cache lines. You need to switch to non-secure mode (in EL3) then flush.
Many thanks for the reply! I tried to check the suggested solution before replying but I could not find the right way of switching the execution mode in el3. Do you know, by any chance, how this can be done in ATF?
I do this:
// Invalidate for NS EL2 and EL1
msr SCR_EL3, x1
Maybe it helps.