Coprocessor 15
2-16
Table 2–7. CP15 Control Register (Continued)
Bit
Function
Value
Name
0
M
Memory management unit (MMU) enable/disable
0
MMU disabled
1
MMU enabled
The MMU must be enabled before or at the same time as the data cache
(C) and write buffer (W). The instruction cache can be enabled
independently. When the MMU is disabled and no address translation
occurs, the D-cache and write buffer are forced OFF.
Note:
Care must be taken if the translated address differs from the non-translated
address, because the instructions following the enabling of the MMU are
fetched using no address translation. Enabling the MMU may be considered
as an instruction with delayed execution. A similar situation occurs when the
MMU is disabled.
The following code segment example shows correct MMU enabling which
takes into account the latency to transition to virtual addressing:
ldr r0, =bVirtualStart; Load r0 with virtual jump
location; Enable the MMU.
mrc p15, 0, r1, c1, c0, 0; Read the control register.
orr r1, r1, #BIT0; Set the M bit to enable MMU.
nop
mcr p15, 0, r1, c1, c0, 0; Write the control register.
mov pc, r0; Jump to the virtual address.
nop
bVirtualStart
nop
nop
The MMU, I-cache, and D-cache can be enabled or disabled independently.
If the data cache or write buffer are enabled when the MMU is not
enabled, the data cache and the write buffer stay off, preventing invalid com-
binations.
The functions MMU, D-cache, I-cache, and WB can be enabled simultaneous-
ly with a single write to the control register.