Here's my scenario....
- bootloader based on uboot for NOR flash
- Wanting to configure the L2 first thing in bootloader and boot into our custom OS with only the OS switching in a new MMU mapping table.
- On GPMC CS0 - NOR flash (executing bootloader from this false, sets up cache, mmu, etc)
- On GPMC CSx - deviceX has slower access times then the NOR flash and is synchronous with use of the wait signals on read/writes (wait lines can delay any where from 1us - 2ms for a single word read/write access)
- GPMC is configured with no timeout and the L3 timeout is setup for max. So this allows the wait lines on CSx to stall the processor until data is ready. (blocking GPMC and Initiator target access from ARM core to GPMC (through L3))
- MMU configured with NOR flash as normal write through caching, DDR and SRAM as normal write through cached, and the deviceX as strong ordered non cached.
So every thing will function OK in this configuration if I don't turn on L2 (L1 caching only). I believe the reason is based on the fact the L2 module manages all memory accesses when cache is enabled (cached and not cached). In this configuration, is it possible that the L2 can't handle the stalls that the CSx is causing?
ISSUE:
After doing only 2-6 accesses to CSx while running out of flash on CS0, I start to get a few different failure states if I keep power cycling.
The first is random memory corruption in DDR. I'm loading a image from flash into DDR, doing a CRC that passes right after the load. Then I do an access to CSx (while instructions are executing out of CS0) and some words in the image's DDR location change. Thus my CRC check I added after the CSx call fails.
The second is a GPMC Err type/address registers being populated with a invalid address (memory not GPMC addr). The address isn't valid for any place on the system and it looks like it must have been a failure of a GPMC access attempted by the L2 controller to GPMC CS0 while I had a CSx access stalling.
If I setup the MMU entry for NOR flash to be strong ordered and not cached the issue doesn't occur, but that drastically slows down my system when running from flash. We're not sure if this is the correct way to resolve the issue (as it could just be we slow down execution enough it works).... If that is the correct configuration, we were planning to move more of our boot code to DDR to speed it up and should be able to make it work.
So I guess the simple question is how long of a GPMC wait signal stall can the L2 controller handle when it's managing the non cached memory access to that device? Since if I disable L2 this all works and has worked for months....