Hello everyone, my 1st question to the ARM community; please excuse my ignorance. Fairly recently, I shared OCM (on-chip-memory) on Xilinx Zynq processor (which is dual ARM Cortex A9). To pass message between the 2 cores, I followed the Xilinx example and turned off L1 and L2 cache for this OCM. But at first, I actually tried to keep L1 turned on the OCM by relying on DMB to do the job, which did NOT work. I realized that I did NOT understand cache after all. Scanning the web, this is what I gathered:
But beyond the basics, I have a few questions:
Thank you very much for considering my questions. Perhaps these are such basic questions, and I should have learned this in school, but I could not find a clear discussion online.
Hello,
SCU is the hardware to maintain the cache coherency between CPU0 and CPU1. The operation is performed by cache line.
MPCore configuration includes SCU.
If the shared cache line of one CPU is modified, the corresponding cache line of another CPU is invalidated.
The situation which the whole L1 cache is flushed will not happen unless you force it by the cache operation instructions.
By the way, from ARMv7, the cache operation for the whole data cache had been omitted.
Best regards,
Yasuhiko Koumoto.
I think I understand. IF the OCM was configured for sharing, SCU would have done the heavy lifting for me, and I would not have to worry about the L1 cache operation. The root of the problem is that the Xilinx OCM driver used device memory model (NOT a normal, cached model)--using the devm_ioremap_resource() call--as I found out in my blog entry. Therefore, the other CPU had to turn off the cache too.
Thanks for the explanation Koumoto san.