diff options
author | Cyril Chemparathy <cyril@ti.com> | 2012-07-21 15:55:04 -0400 |
---|---|---|
committer | Will Deacon <will.deacon@arm.com> | 2013-05-30 11:02:15 -0400 |
commit | 4756dcbfd37819a8359d3c69a22be2ee41666d0f (patch) | |
tree | a9c172f6940e607b9c0c9a3bd7393bf0cc03e940 /arch/arm/mm/proc-v7-3level.S | |
parent | a7fbc0d62a4d46e642af889e7288fede5078bc46 (diff) |
ARM: LPAE: accomodate >32-bit addresses for page table base
This patch redefines the early boot time use of the R4 register to steal a few
low order bits (ARCH_PGD_SHIFT bits) on LPAE systems. This allows for up to
38-bit physical addresses.
Signed-off-by: Cyril Chemparathy <cyril@ti.com>
Signed-off-by: Vitaly Andrianov <vitalya@ti.com>
Acked-by: Nicolas Pitre <nico@linaro.org>
Tested-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Tested-by: Subash Patel <subash.rp@samsung.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Diffstat (limited to 'arch/arm/mm/proc-v7-3level.S')
-rw-r--r-- | arch/arm/mm/proc-v7-3level.S | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/arch/arm/mm/proc-v7-3level.S b/arch/arm/mm/proc-v7-3level.S index 58ab7477bb61..5ffe1956c6d9 100644 --- a/arch/arm/mm/proc-v7-3level.S +++ b/arch/arm/mm/proc-v7-3level.S | |||
@@ -114,6 +114,7 @@ ENDPROC(cpu_v7_set_pte_ext) | |||
114 | */ | 114 | */ |
115 | .macro v7_ttb_setup, zero, ttbr0, ttbr1, tmp | 115 | .macro v7_ttb_setup, zero, ttbr0, ttbr1, tmp |
116 | ldr \tmp, =swapper_pg_dir @ swapper_pg_dir virtual address | 116 | ldr \tmp, =swapper_pg_dir @ swapper_pg_dir virtual address |
117 | mov \tmp, \tmp, lsr #ARCH_PGD_SHIFT | ||
117 | cmp \ttbr1, \tmp @ PHYS_OFFSET > PAGE_OFFSET? | 118 | cmp \ttbr1, \tmp @ PHYS_OFFSET > PAGE_OFFSET? |
118 | mrc p15, 0, \tmp, c2, c0, 2 @ TTB control register | 119 | mrc p15, 0, \tmp, c2, c0, 2 @ TTB control register |
119 | orr \tmp, \tmp, #TTB_EAE | 120 | orr \tmp, \tmp, #TTB_EAE |
@@ -128,8 +129,15 @@ ENDPROC(cpu_v7_set_pte_ext) | |||
128 | */ | 129 | */ |
129 | orrls \tmp, \tmp, #TTBR1_SIZE @ TTBCR.T1SZ | 130 | orrls \tmp, \tmp, #TTBR1_SIZE @ TTBCR.T1SZ |
130 | mcr p15, 0, \tmp, c2, c0, 2 @ TTBCR | 131 | mcr p15, 0, \tmp, c2, c0, 2 @ TTBCR |
132 | mov \tmp, \ttbr1, lsr #(32 - ARCH_PGD_SHIFT) @ upper bits | ||
133 | mov \ttbr1, \ttbr1, lsl #ARCH_PGD_SHIFT @ lower bits | ||
131 | addls \ttbr1, \ttbr1, #TTBR1_OFFSET | 134 | addls \ttbr1, \ttbr1, #TTBR1_OFFSET |
132 | mcrr p15, 1, \ttbr1, \zero, c2 @ load TTBR1 | 135 | mcrr p15, 1, \ttbr1, \zero, c2 @ load TTBR1 |
136 | mov \tmp, \ttbr0, lsr #(32 - ARCH_PGD_SHIFT) @ upper bits | ||
137 | mov \ttbr0, \ttbr0, lsl #ARCH_PGD_SHIFT @ lower bits | ||
138 | mcrr p15, 0, \ttbr0, \zero, c2 @ load TTBR0 | ||
139 | mcrr p15, 1, \ttbr1, \zero, c2 @ load TTBR1 | ||
140 | mcrr p15, 0, \ttbr0, \zero, c2 @ load TTBR0 | ||
133 | .endm | 141 | .endm |
134 | 142 | ||
135 | __CPUINIT | 143 | __CPUINIT |