I am using LINUXEZSDK-AM335X v07.00 with a custom board that uses a DRA608BIZCZ (equivalent to AM3352, correct?) and have some questions about L2 cache.
I've instrumented u-boot's startup code and determined that L2 cache is enabled prior to u-boot's reset vector.
Reading the auxiliary control register at the start of board_init_f shows that the L2EN bit is set.
When I clear L2EN in cpu_init_cp15, it stays cleared. i.e. printf of aux control reg prior to main_loop() shows L2EN bit is set.
It appears that the ROM code is enabling L2 cache prior to public boot.
Q1. Is that expected?
I understand from the AM335x TRM that the ROM code L1 cache is disabled, but there's no mention of L2.
The L2 cache section in ARM's Cortex A8 TRM has this note
http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0344k/Babigfeh.html
Note
To keep memory coherent when using cache maintenance operations, you must follow the L2 cache disabling sequence. Cache maintenance operations have an effect on the L1 and L2 caches when they are disabled. A cache maintenance operation can evict a cache line from the L1 data cache. If the L2EN bit is set to 1, the evicted cache line can be allocated to the L2 cache. If the L2EN bit is not set to 1, then evictions from the L1 data cache are sent directly to external memory using the AXI interface.
Q2. Is this a concern?
Q3. Where is the kernel code that controls L2EN ?
I've looked at the kernel code and could not find any place where it is toggling the L2EN bit in the AM355x configuration.