diff options
Diffstat (limited to 'arch/arm/mm/proc-v7.S')
-rw-r--r-- | arch/arm/mm/proc-v7.S | 59 |
1 files changed, 48 insertions, 11 deletions
diff --git a/arch/arm/mm/proc-v7.S b/arch/arm/mm/proc-v7.S index 3397f1e64d76..4f8486475a79 100644 --- a/arch/arm/mm/proc-v7.S +++ b/arch/arm/mm/proc-v7.S | |||
@@ -19,17 +19,23 @@ | |||
19 | 19 | ||
20 | #include "proc-macros.S" | 20 | #include "proc-macros.S" |
21 | 21 | ||
22 | #define TTB_C (1 << 0) | ||
23 | #define TTB_S (1 << 1) | 22 | #define TTB_S (1 << 1) |
24 | #define TTB_RGN_NC (0 << 3) | 23 | #define TTB_RGN_NC (0 << 3) |
25 | #define TTB_RGN_OC_WBWA (1 << 3) | 24 | #define TTB_RGN_OC_WBWA (1 << 3) |
26 | #define TTB_RGN_OC_WT (2 << 3) | 25 | #define TTB_RGN_OC_WT (2 << 3) |
27 | #define TTB_RGN_OC_WB (3 << 3) | 26 | #define TTB_RGN_OC_WB (3 << 3) |
27 | #define TTB_NOS (1 << 5) | ||
28 | #define TTB_IRGN_NC ((0 << 0) | (0 << 6)) | ||
29 | #define TTB_IRGN_WBWA ((0 << 0) | (1 << 6)) | ||
30 | #define TTB_IRGN_WT ((1 << 0) | (0 << 6)) | ||
31 | #define TTB_IRGN_WB ((1 << 0) | (1 << 6)) | ||
28 | 32 | ||
29 | #ifndef CONFIG_SMP | 33 | #ifndef CONFIG_SMP |
30 | #define TTB_FLAGS TTB_C|TTB_RGN_OC_WB @ mark PTWs cacheable, outer WB | 34 | /* PTWs cacheable, inner WB not shareable, outer WB not shareable */ |
35 | #define TTB_FLAGS TTB_IRGN_WB|TTB_RGN_OC_WB | ||
31 | #else | 36 | #else |
32 | #define TTB_FLAGS TTB_C|TTB_S|TTB_RGN_OC_WBWA @ mark PTWs cacheable and shared, outer WBWA | 37 | /* PTWs cacheable, inner WBWA shareable, outer WBWA not shareable */ |
38 | #define TTB_FLAGS TTB_IRGN_WBWA|TTB_S|TTB_NOS|TTB_RGN_OC_WBWA | ||
33 | #endif | 39 | #endif |
34 | 40 | ||
35 | ENTRY(cpu_v7_proc_init) | 41 | ENTRY(cpu_v7_proc_init) |
@@ -176,8 +182,8 @@ cpu_v7_name: | |||
176 | */ | 182 | */ |
177 | __v7_setup: | 183 | __v7_setup: |
178 | #ifdef CONFIG_SMP | 184 | #ifdef CONFIG_SMP |
179 | mrc p15, 0, r0, c1, c0, 1 @ Enable SMP/nAMP mode | 185 | mrc p15, 0, r0, c1, c0, 1 @ Enable SMP/nAMP mode and |
180 | orr r0, r0, #(0x1 << 6) | 186 | orr r0, r0, #(1 << 6) | (1 << 0) @ TLB ops broadcasting |
181 | mcr p15, 0, r0, c1, c0, 1 | 187 | mcr p15, 0, r0, c1, c0, 1 |
182 | #endif | 188 | #endif |
183 | adr r12, __v7_setup_stack @ the local stack | 189 | adr r12, __v7_setup_stack @ the local stack |
@@ -213,12 +219,43 @@ __v7_setup: | |||
213 | mov r10, #0x1f @ domains 0, 1 = manager | 219 | mov r10, #0x1f @ domains 0, 1 = manager |
214 | mcr p15, 0, r10, c3, c0, 0 @ load domain access register | 220 | mcr p15, 0, r10, c3, c0, 0 @ load domain access register |
215 | #endif | 221 | #endif |
216 | ldr r5, =0xff0aa1a8 | 222 | /* |
217 | ldr r6, =0x40e040e0 | 223 | * Memory region attributes with SCTLR.TRE=1 |
224 | * | ||
225 | * n = TEX[0],C,B | ||
226 | * TR = PRRR[2n+1:2n] - memory type | ||
227 | * IR = NMRR[2n+1:2n] - inner cacheable property | ||
228 | * OR = NMRR[2n+17:2n+16] - outer cacheable property | ||
229 | * | ||
230 | * n TR IR OR | ||
231 | * UNCACHED 000 00 | ||
232 | * BUFFERABLE 001 10 00 00 | ||
233 | * WRITETHROUGH 010 10 10 10 | ||
234 | * WRITEBACK 011 10 11 11 | ||
235 | * reserved 110 | ||
236 | * WRITEALLOC 111 10 01 01 | ||
237 | * DEV_SHARED 100 01 | ||
238 | * DEV_NONSHARED 100 01 | ||
239 | * DEV_WC 001 10 | ||
240 | * DEV_CACHED 011 10 | ||
241 | * | ||
242 | * Other attributes: | ||
243 | * | ||
244 | * DS0 = PRRR[16] = 0 - device shareable property | ||
245 | * DS1 = PRRR[17] = 1 - device shareable property | ||
246 | * NS0 = PRRR[18] = 0 - normal shareable property | ||
247 | * NS1 = PRRR[19] = 1 - normal shareable property | ||
248 | * NOS = PRRR[24+n] = 1 - not outer shareable | ||
249 | */ | ||
250 | ldr r5, =0xff0a81a8 @ PRRR | ||
251 | ldr r6, =0x40e040e0 @ NMRR | ||
218 | mcr p15, 0, r5, c10, c2, 0 @ write PRRR | 252 | mcr p15, 0, r5, c10, c2, 0 @ write PRRR |
219 | mcr p15, 0, r6, c10, c2, 1 @ write NMRR | 253 | mcr p15, 0, r6, c10, c2, 1 @ write NMRR |
220 | adr r5, v7_crval | 254 | adr r5, v7_crval |
221 | ldmia r5, {r5, r6} | 255 | ldmia r5, {r5, r6} |
256 | #ifdef CONFIG_CPU_ENDIAN_BE8 | ||
257 | orr r6, r6, #1 << 25 @ big-endian page tables | ||
258 | #endif | ||
222 | mrc p15, 0, r0, c1, c0, 0 @ read control register | 259 | mrc p15, 0, r0, c1, c0, 0 @ read control register |
223 | bic r0, r0, r5 @ clear bits them | 260 | bic r0, r0, r5 @ clear bits them |
224 | orr r0, r0, r6 @ set them | 261 | orr r0, r0, r6 @ set them |
@@ -226,14 +263,14 @@ __v7_setup: | |||
226 | ENDPROC(__v7_setup) | 263 | ENDPROC(__v7_setup) |
227 | 264 | ||
228 | /* AT | 265 | /* AT |
229 | * TFR EV X F I D LR | 266 | * TFR EV X F I D LR S |
230 | * .EEE ..EE PUI. .T.T 4RVI ZFRS BLDP WCAM | 267 | * .EEE ..EE PUI. .T.T 4RVI ZWRS BLDP WCAM |
231 | * rxxx rrxx xxx0 0101 xxxx xxxx x111 xxxx < forced | 268 | * rxxx rrxx xxx0 0101 xxxx xxxx x111 xxxx < forced |
232 | * 1 0 110 0011 1.00 .111 1101 < we want | 269 | * 1 0 110 0011 1100 .111 1101 < we want |
233 | */ | 270 | */ |
234 | .type v7_crval, #object | 271 | .type v7_crval, #object |
235 | v7_crval: | 272 | v7_crval: |
236 | crval clear=0x0120c302, mmuset=0x10c0387d, ucset=0x00c0187c | 273 | crval clear=0x0120c302, mmuset=0x10c03c7d, ucset=0x00c01c7c |
237 | 274 | ||
238 | __v7_setup_stack: | 275 | __v7_setup_stack: |
239 | .space 4 * 11 @ 11 registers | 276 | .space 4 * 11 @ 11 registers |