> Is there anything wrong with my cache configuration?
Only everything. What about the other 24 bits in ACR0 you haven't set? They consist of 7 fields:
- ADMSK is set to zero, which might be what you want, but you should check. How big is the MBAR region?
- E is set to zero so the register is completely DISABLED.
- S is set to zero which means it only works for "USER" code, you need "Both".
- AMM is set to zero which means 16M regions. Probably OK, but check this.
- CM is set to zero which ENABLES the cache for this region, the opposite of what you intended.
- SP is set to zero, which is OK.
- W is set to zero, which is OK.
If you get that right, Ethernet, USB and anything using DMA won't work at all because these devices are on the OTHER side of the cache, so they will read and write different data to what the CPU gets out of its caches. Some CPUs have "cache snooping" to fix this problem, but these ones don't:
7.7 Cache Overview
The cache module does not implement bus snooping; cache coherency with other possible bus masters
must be maintained in software.
You either have to put all of the Data and Control structures into uncached memory, or you have to rewrite all drivers to flush and invalidate the buffer regions whenever the CPU writes them or goes to read them. This is a huge amount of complicated and bug-ridden work if it hasn't been handled already by whoever wrote your OS and drivers.
If you can, you should use and/or buy a working OS for the chip that has already got all of this working.
Tom