aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mm
diff options
context:
space:
mode:
authorJon Callan <Jon.Callan@arm.com>2008-11-06 08:23:09 -0500
committerCatalin Marinas <catalin.marinas@arm.com>2008-11-06 08:23:09 -0500
commit73b63efaac7352c9e2bf1570fac98fd44a99f8f9 (patch)
tree9bdb18703567d643f57bc7e068f1f47df487fd88 /arch/arm/mm
parent6b07d7fea0496374ff7754dc3d1dca03b2911828 (diff)
ARMv7: Add SMP initialisation to proc-v7.S
This patch adds the SMP/nAMP mode setting to __v7_setup and also sets TTBR to shared page table walks if SMP is enabled. The PTWs are also marked inner cacheable for both SMP and UP modes (setting this is fine even if the CPU doesn't support the feature). Signed-off-by: Jon Callan <Jon.Callan@arm.com> Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Diffstat (limited to 'arch/arm/mm')
-rw-r--r--arch/arm/mm/proc-v7.S17
1 files changed, 15 insertions, 2 deletions
diff --git a/arch/arm/mm/proc-v7.S b/arch/arm/mm/proc-v7.S
index 41772960fd10..721b7d53bfd8 100644
--- a/arch/arm/mm/proc-v7.S
+++ b/arch/arm/mm/proc-v7.S
@@ -20,9 +20,17 @@
20 20
21#define TTB_C (1 << 0) 21#define TTB_C (1 << 0)
22#define TTB_S (1 << 1) 22#define TTB_S (1 << 1)
23#define TTB_RGN_NC (0 << 3)
24#define TTB_RGN_OC_WBWA (1 << 3)
23#define TTB_RGN_OC_WT (2 << 3) 25#define TTB_RGN_OC_WT (2 << 3)
24#define TTB_RGN_OC_WB (3 << 3) 26#define TTB_RGN_OC_WB (3 << 3)
25 27
28#ifndef CONFIG_SMP
29#define TTB_FLAGS TTB_C|TTB_RGN_OC_WB @ mark PTWs cacheable, outer WB
30#else
31#define TTB_FLAGS TTB_C|TTB_S|TTB_RGN_OC_WBWA @ mark PTWs cacheable and shared, outer WBWA
32#endif
33
26ENTRY(cpu_v7_proc_init) 34ENTRY(cpu_v7_proc_init)
27 mov pc, lr 35 mov pc, lr
28ENDPROC(cpu_v7_proc_init) 36ENDPROC(cpu_v7_proc_init)
@@ -85,7 +93,7 @@ ENTRY(cpu_v7_switch_mm)
85#ifdef CONFIG_MMU 93#ifdef CONFIG_MMU
86 mov r2, #0 94 mov r2, #0
87 ldr r1, [r1, #MM_CONTEXT_ID] @ get mm->context.id 95 ldr r1, [r1, #MM_CONTEXT_ID] @ get mm->context.id
88 orr r0, r0, #TTB_RGN_OC_WB @ mark PTWs outer cacheable, WB 96 orr r0, r0, #TTB_FLAGS
89 mcr p15, 0, r2, c13, c0, 1 @ set reserved context ID 97 mcr p15, 0, r2, c13, c0, 1 @ set reserved context ID
90 isb 98 isb
911: mcr p15, 0, r0, c2, c0, 0 @ set TTB 0 991: mcr p15, 0, r0, c2, c0, 0 @ set TTB 0
@@ -162,6 +170,11 @@ cpu_v7_name:
162 * - cache type register is implemented 170 * - cache type register is implemented
163 */ 171 */
164__v7_setup: 172__v7_setup:
173#ifdef CONFIG_SMP
174 mrc p15, 0, r0, c1, c0, 1 @ Enable SMP/nAMP mode
175 orr r0, r0, #(0x1 << 6)
176 mcr p15, 0, r0, c1, c0, 1
177#endif
165 adr r12, __v7_setup_stack @ the local stack 178 adr r12, __v7_setup_stack @ the local stack
166 stmia r12, {r0-r5, r7, r9, r11, lr} 179 stmia r12, {r0-r5, r7, r9, r11, lr}
167 bl v7_flush_dcache_all 180 bl v7_flush_dcache_all
@@ -174,7 +187,7 @@ __v7_setup:
174#ifdef CONFIG_MMU 187#ifdef CONFIG_MMU
175 mcr p15, 0, r10, c8, c7, 0 @ invalidate I + D TLBs 188 mcr p15, 0, r10, c8, c7, 0 @ invalidate I + D TLBs
176 mcr p15, 0, r10, c2, c0, 2 @ TTB control register 189 mcr p15, 0, r10, c2, c0, 2 @ TTB control register
177 orr r4, r4, #TTB_RGN_OC_WB @ mark PTWs outer cacheable, WB 190 orr r4, r4, #TTB_FLAGS
178 mcr p15, 0, r4, c2, c0, 1 @ load TTB1 191 mcr p15, 0, r4, c2, c0, 1 @ load TTB1
179 mov r10, #0x1f @ domains 0, 1 = manager 192 mov r10, #0x1f @ domains 0, 1 = manager
180 mcr p15, 0, r10, c3, c0, 0 @ load domain access register 193 mcr p15, 0, r10, c3, c0, 0 @ load domain access register