Hello,
I'm trying to enable Instructions and Data Caches on an OMAPL137 evaluation board.
I have success fully enabled the instruction cache without the Memory Management Unit but to enable the Data Cache I have to enable the MMU so I did it but then when I enable the Instruction Cache and the code just to a function inside a cacheable or bufferable section.
To enable Instructions and Data Caches and MMU I used the following assembly code :
LDR R3, c_IDcaches_MMU_bits
MRC p15, #0, R4, c3, c0, #0; read Domain Access Control Register
MRC p15, #0, R7, c2, c0, #0; read TTBR
LDR R4, c_accessDomain
LDR R8, c_translationTableAddr
MCR p15, #0, R4, c3, c0, #0; write Domain Access Control Register
MCR p15, #0, R8, c2, c0, #0; write Domain Access Control Register
MRC p15, #0, R7, c3, c0, #0; read Domain Access Control Register
MRC p15, #0, R1, c1, c0, #0; read Control register c1
ORR R2, R1, R3
MCR p15, #0, R2, c1, c0, #0; write Control register c1
And I have defined the following constant :
c_IDcaches_MMU_bits .long 0x00001005
c_accessDomain .long 0xFFFFFFFF
c_translationTableAddr .long 0x80000000
At he address 0x80000000 I have placed the Translation table :
with 4096 entry of the section type.
Possible formats of an entry of the Translation table (I used only Section entry)
- Section base address I started at 0 and then incremented by 1 on each new entry so the Virtual Address equal the Physical Address
- AP : set to 11 so Read and Write are always allowed
- Domain : set to 0 and all domain has been set to read and write allowed
- C and B : set to 00 on each entry except on the line corresponding to the memory where I have placed the code and the data of the function I want to speed up (set to 11 on this line)
But When the software jump to the function inside this buffered area the application crash and all assembly instructions seems to be 0x00000000 ANDEQ R0, R0, R0
Does anyone have an idea of what I forgot to do ? or did wrong ?
Thank in advance of any help you can give me.
Arthur