diff options
Diffstat (limited to 'arch/arm/mm/proc-v7.S')
-rw-r--r-- | arch/arm/mm/proc-v7.S | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/arch/arm/mm/proc-v7.S b/arch/arm/mm/proc-v7.S index 4d3c0a73e7fb..d1ebec42521d 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 | |||
26 | ENTRY(cpu_v7_proc_init) | 34 | ENTRY(cpu_v7_proc_init) |
27 | mov pc, lr | 35 | mov pc, lr |
28 | ENDPROC(cpu_v7_proc_init) | 36 | ENDPROC(cpu_v7_proc_init) |
@@ -55,6 +63,7 @@ ENDPROC(cpu_v7_reset) | |||
55 | * IRQs are already disabled. | 63 | * IRQs are already disabled. |
56 | */ | 64 | */ |
57 | ENTRY(cpu_v7_do_idle) | 65 | ENTRY(cpu_v7_do_idle) |
66 | dsb @ WFI may enter a low-power mode | ||
58 | wfi | 67 | wfi |
59 | mov pc, lr | 68 | mov pc, lr |
60 | ENDPROC(cpu_v7_do_idle) | 69 | ENDPROC(cpu_v7_do_idle) |
@@ -85,7 +94,7 @@ ENTRY(cpu_v7_switch_mm) | |||
85 | #ifdef CONFIG_MMU | 94 | #ifdef CONFIG_MMU |
86 | mov r2, #0 | 95 | mov r2, #0 |
87 | ldr r1, [r1, #MM_CONTEXT_ID] @ get mm->context.id | 96 | ldr r1, [r1, #MM_CONTEXT_ID] @ get mm->context.id |
88 | orr r0, r0, #TTB_RGN_OC_WB @ mark PTWs outer cacheable, WB | 97 | orr r0, r0, #TTB_FLAGS |
89 | mcr p15, 0, r2, c13, c0, 1 @ set reserved context ID | 98 | mcr p15, 0, r2, c13, c0, 1 @ set reserved context ID |
90 | isb | 99 | isb |
91 | 1: mcr p15, 0, r0, c2, c0, 0 @ set TTB 0 | 100 | 1: mcr p15, 0, r0, c2, c0, 0 @ set TTB 0 |
@@ -162,6 +171,11 @@ cpu_v7_name: | |||
162 | * - cache type register is implemented | 171 | * - cache type register is implemented |
163 | */ | 172 | */ |
164 | __v7_setup: | 173 | __v7_setup: |
174 | #ifdef CONFIG_SMP | ||
175 | mrc p15, 0, r0, c1, c0, 1 @ Enable SMP/nAMP mode | ||
176 | orr r0, r0, #(0x1 << 6) | ||
177 | mcr p15, 0, r0, c1, c0, 1 | ||
178 | #endif | ||
165 | adr r12, __v7_setup_stack @ the local stack | 179 | adr r12, __v7_setup_stack @ the local stack |
166 | stmia r12, {r0-r5, r7, r9, r11, lr} | 180 | stmia r12, {r0-r5, r7, r9, r11, lr} |
167 | bl v7_flush_dcache_all | 181 | bl v7_flush_dcache_all |
@@ -174,8 +188,7 @@ __v7_setup: | |||
174 | #ifdef CONFIG_MMU | 188 | #ifdef CONFIG_MMU |
175 | mcr p15, 0, r10, c8, c7, 0 @ invalidate I + D TLBs | 189 | mcr p15, 0, r10, c8, c7, 0 @ invalidate I + D TLBs |
176 | mcr p15, 0, r10, c2, c0, 2 @ TTB control register | 190 | mcr p15, 0, r10, c2, c0, 2 @ TTB control register |
177 | orr r4, r4, #TTB_RGN_OC_WB @ mark PTWs outer cacheable, WB | 191 | orr r4, r4, #TTB_FLAGS |
178 | mcr p15, 0, r4, c2, c0, 0 @ load TTB0 | ||
179 | mcr p15, 0, r4, c2, c0, 1 @ load TTB1 | 192 | mcr p15, 0, r4, c2, c0, 1 @ load TTB1 |
180 | mov r10, #0x1f @ domains 0, 1 = manager | 193 | mov r10, #0x1f @ domains 0, 1 = manager |
181 | mcr p15, 0, r10, c3, c0, 0 @ load domain access register | 194 | mcr p15, 0, r10, c3, c0, 0 @ load domain access register |