aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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