Skip to content

Commit dbece45

Browse files
wildea01Russell King
authored and
Russell King
committed
ARM: 7501/1: decompressor: reset ttbcr for VMSA ARMv7 cores
When enabling the MMU for ARMv7 CPUs, the decompressor does not touch the ttbcr register, assuming that it will be zeroed (N == 0, EAE == 0). Given that only EAE is defined as 0 for non-secure copies of the register (and a bootloader such as kexec may leave it set to 1 anyway), we should ensure that we reset the register ourselves before turning on the MMU. This patch zeroes TTBCR.EAE and TTBCR.N prior to enabling the MMU for ARMv7 cores in the decompressor, configuring us exclusively for 32-bit translation tables via TTBR0. Cc: <[email protected]> Acked-by: Nicolas Pitre <[email protected]> Signed-off-by: Matthew Leach <[email protected]> Signed-off-by: Will Deacon <[email protected]> Signed-off-by: Russell King <[email protected]>
1 parent d968d2b commit dbece45

File tree

1 file changed

+4
-0
lines changed
  • arch/arm/boot/compressed

1 file changed

+4
-0
lines changed

arch/arm/boot/compressed/head.S

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -659,10 +659,14 @@ __armv7_mmu_cache_on:
659659
#ifdef CONFIG_CPU_ENDIAN_BE8
660660
orr r0, r0, #1 << 25 @ big-endian page tables
661661
#endif
662+
mrcne p15, 0, r6, c2, c0, 2 @ read ttb control reg
662663
orrne r0, r0, #1 @ MMU enabled
663664
movne r1, #0xfffffffd @ domain 0 = client
665+
bic r6, r6, #1 << 31 @ 32-bit translation system
666+
bic r6, r6, #3 << 0 @ use only ttbr0
664667
mcrne p15, 0, r3, c2, c0, 0 @ load page table pointer
665668
mcrne p15, 0, r1, c3, c0, 0 @ load domain access control
669+
mcrne p15, 0, r6, c2, c0, 2 @ load ttb control
666670
#endif
667671
mcr p15, 0, r0, c7, c5, 4 @ ISB
668672
mcr p15, 0, r0, c1, c0, 0 @ load control register

0 commit comments

Comments
 (0)