diff options
Diffstat (limited to 'arch/arm/mm/proc-v7.S')
-rw-r--r-- | arch/arm/mm/proc-v7.S | 122 |
1 files changed, 92 insertions, 30 deletions
diff --git a/arch/arm/mm/proc-v7.S b/arch/arm/mm/proc-v7.S index 8e3356239136..262fa88a7439 100644 --- a/arch/arm/mm/proc-v7.S +++ b/arch/arm/mm/proc-v7.S | |||
@@ -108,10 +108,16 @@ ENTRY(cpu_v7_switch_mm) | |||
108 | #ifdef CONFIG_ARM_ERRATA_430973 | 108 | #ifdef CONFIG_ARM_ERRATA_430973 |
109 | mcr p15, 0, r2, c7, c5, 6 @ flush BTAC/BTB | 109 | mcr p15, 0, r2, c7, c5, 6 @ flush BTAC/BTB |
110 | #endif | 110 | #endif |
111 | #ifdef CONFIG_ARM_ERRATA_754322 | ||
112 | dsb | ||
113 | #endif | ||
111 | mcr p15, 0, r2, c13, c0, 1 @ set reserved context ID | 114 | mcr p15, 0, r2, c13, c0, 1 @ set reserved context ID |
112 | isb | 115 | isb |
113 | 1: mcr p15, 0, r0, c2, c0, 0 @ set TTB 0 | 116 | 1: mcr p15, 0, r0, c2, c0, 0 @ set TTB 0 |
114 | isb | 117 | isb |
118 | #ifdef CONFIG_ARM_ERRATA_754322 | ||
119 | dsb | ||
120 | #endif | ||
115 | mcr p15, 0, r1, c13, c0, 1 @ set context ID | 121 | mcr p15, 0, r1, c13, c0, 1 @ set context ID |
116 | isb | 122 | isb |
117 | #endif | 123 | #endif |
@@ -171,6 +177,87 @@ cpu_v7_name: | |||
171 | .ascii "ARMv7 Processor" | 177 | .ascii "ARMv7 Processor" |
172 | .align | 178 | .align |
173 | 179 | ||
180 | /* | ||
181 | * Memory region attributes with SCTLR.TRE=1 | ||
182 | * | ||
183 | * n = TEX[0],C,B | ||
184 | * TR = PRRR[2n+1:2n] - memory type | ||
185 | * IR = NMRR[2n+1:2n] - inner cacheable property | ||
186 | * OR = NMRR[2n+17:2n+16] - outer cacheable property | ||
187 | * | ||
188 | * n TR IR OR | ||
189 | * UNCACHED 000 00 | ||
190 | * BUFFERABLE 001 10 00 00 | ||
191 | * WRITETHROUGH 010 10 10 10 | ||
192 | * WRITEBACK 011 10 11 11 | ||
193 | * reserved 110 | ||
194 | * WRITEALLOC 111 10 01 01 | ||
195 | * DEV_SHARED 100 01 | ||
196 | * DEV_NONSHARED 100 01 | ||
197 | * DEV_WC 001 10 | ||
198 | * DEV_CACHED 011 10 | ||
199 | * | ||
200 | * Other attributes: | ||
201 | * | ||
202 | * DS0 = PRRR[16] = 0 - device shareable property | ||
203 | * DS1 = PRRR[17] = 1 - device shareable property | ||
204 | * NS0 = PRRR[18] = 0 - normal shareable property | ||
205 | * NS1 = PRRR[19] = 1 - normal shareable property | ||
206 | * NOS = PRRR[24+n] = 1 - not outer shareable | ||
207 | */ | ||
208 | .equ PRRR, 0xff0a81a8 | ||
209 | .equ NMRR, 0x40e040e0 | ||
210 | |||
211 | /* Suspend/resume support: derived from arch/arm/mach-s5pv210/sleep.S */ | ||
212 | .globl cpu_v7_suspend_size | ||
213 | .equ cpu_v7_suspend_size, 4 * 8 | ||
214 | #ifdef CONFIG_PM | ||
215 | ENTRY(cpu_v7_do_suspend) | ||
216 | stmfd sp!, {r4 - r11, lr} | ||
217 | mrc p15, 0, r4, c13, c0, 0 @ FCSE/PID | ||
218 | mrc p15, 0, r5, c13, c0, 1 @ Context ID | ||
219 | mrc p15, 0, r6, c3, c0, 0 @ Domain ID | ||
220 | mrc p15, 0, r7, c2, c0, 0 @ TTB 0 | ||
221 | mrc p15, 0, r8, c2, c0, 1 @ TTB 1 | ||
222 | mrc p15, 0, r9, c1, c0, 0 @ Control register | ||
223 | mrc p15, 0, r10, c1, c0, 1 @ Auxiliary control register | ||
224 | mrc p15, 0, r11, c1, c0, 2 @ Co-processor access control | ||
225 | stmia r0, {r4 - r11} | ||
226 | ldmfd sp!, {r4 - r11, pc} | ||
227 | ENDPROC(cpu_v7_do_suspend) | ||
228 | |||
229 | ENTRY(cpu_v7_do_resume) | ||
230 | mov ip, #0 | ||
231 | mcr p15, 0, ip, c8, c7, 0 @ invalidate TLBs | ||
232 | mcr p15, 0, ip, c7, c5, 0 @ invalidate I cache | ||
233 | ldmia r0, {r4 - r11} | ||
234 | mcr p15, 0, r4, c13, c0, 0 @ FCSE/PID | ||
235 | mcr p15, 0, r5, c13, c0, 1 @ Context ID | ||
236 | mcr p15, 0, r6, c3, c0, 0 @ Domain ID | ||
237 | mcr p15, 0, r7, c2, c0, 0 @ TTB 0 | ||
238 | mcr p15, 0, r8, c2, c0, 1 @ TTB 1 | ||
239 | mcr p15, 0, ip, c2, c0, 2 @ TTB control register | ||
240 | mcr p15, 0, r10, c1, c0, 1 @ Auxillary control register | ||
241 | mcr p15, 0, r11, c1, c0, 2 @ Co-processor access control | ||
242 | ldr r4, =PRRR @ PRRR | ||
243 | ldr r5, =NMRR @ NMRR | ||
244 | mcr p15, 0, r4, c10, c2, 0 @ write PRRR | ||
245 | mcr p15, 0, r5, c10, c2, 1 @ write NMRR | ||
246 | isb | ||
247 | mov r0, r9 @ control register | ||
248 | mov r2, r7, lsr #14 @ get TTB0 base | ||
249 | mov r2, r2, lsl #14 | ||
250 | ldr r3, cpu_resume_l1_flags | ||
251 | b cpu_resume_mmu | ||
252 | ENDPROC(cpu_v7_do_resume) | ||
253 | cpu_resume_l1_flags: | ||
254 | ALT_SMP(.long PMD_TYPE_SECT | PMD_SECT_AP_WRITE | PMD_FLAGS_SMP) | ||
255 | ALT_UP(.long PMD_TYPE_SECT | PMD_SECT_AP_WRITE | PMD_FLAGS_UP) | ||
256 | #else | ||
257 | #define cpu_v7_do_suspend 0 | ||
258 | #define cpu_v7_do_resume 0 | ||
259 | #endif | ||
260 | |||
174 | __CPUINIT | 261 | __CPUINIT |
175 | 262 | ||
176 | /* | 263 | /* |
@@ -282,36 +369,8 @@ __v7_setup: | |||
282 | ALT_SMP(orr r4, r4, #TTB_FLAGS_SMP) | 369 | ALT_SMP(orr r4, r4, #TTB_FLAGS_SMP) |
283 | ALT_UP(orr r4, r4, #TTB_FLAGS_UP) | 370 | ALT_UP(orr r4, r4, #TTB_FLAGS_UP) |
284 | mcr p15, 0, r4, c2, c0, 1 @ load TTB1 | 371 | mcr p15, 0, r4, c2, c0, 1 @ load TTB1 |
285 | /* | 372 | ldr r5, =PRRR @ PRRR |
286 | * Memory region attributes with SCTLR.TRE=1 | 373 | ldr r6, =NMRR @ NMRR |
287 | * | ||
288 | * n = TEX[0],C,B | ||
289 | * TR = PRRR[2n+1:2n] - memory type | ||
290 | * IR = NMRR[2n+1:2n] - inner cacheable property | ||
291 | * OR = NMRR[2n+17:2n+16] - outer cacheable property | ||
292 | * | ||
293 | * n TR IR OR | ||
294 | * UNCACHED 000 00 | ||
295 | * BUFFERABLE 001 10 00 00 | ||
296 | * WRITETHROUGH 010 10 10 10 | ||
297 | * WRITEBACK 011 10 11 11 | ||
298 | * reserved 110 | ||
299 | * WRITEALLOC 111 10 01 01 | ||
300 | * DEV_SHARED 100 01 | ||
301 | * DEV_NONSHARED 100 01 | ||
302 | * DEV_WC 001 10 | ||
303 | * DEV_CACHED 011 10 | ||
304 | * | ||
305 | * Other attributes: | ||
306 | * | ||
307 | * DS0 = PRRR[16] = 0 - device shareable property | ||
308 | * DS1 = PRRR[17] = 1 - device shareable property | ||
309 | * NS0 = PRRR[18] = 0 - normal shareable property | ||
310 | * NS1 = PRRR[19] = 1 - normal shareable property | ||
311 | * NOS = PRRR[24+n] = 1 - not outer shareable | ||
312 | */ | ||
313 | ldr r5, =0xff0a81a8 @ PRRR | ||
314 | ldr r6, =0x40e040e0 @ NMRR | ||
315 | mcr p15, 0, r5, c10, c2, 0 @ write PRRR | 374 | mcr p15, 0, r5, c10, c2, 0 @ write PRRR |
316 | mcr p15, 0, r6, c10, c2, 1 @ write NMRR | 375 | mcr p15, 0, r6, c10, c2, 1 @ write NMRR |
317 | #endif | 376 | #endif |
@@ -357,6 +416,9 @@ ENTRY(v7_processor_functions) | |||
357 | .word cpu_v7_dcache_clean_area | 416 | .word cpu_v7_dcache_clean_area |
358 | .word cpu_v7_switch_mm | 417 | .word cpu_v7_switch_mm |
359 | .word cpu_v7_set_pte_ext | 418 | .word cpu_v7_set_pte_ext |
419 | .word 0 | ||
420 | .word 0 | ||
421 | .word 0 | ||
360 | .size v7_processor_functions, . - v7_processor_functions | 422 | .size v7_processor_functions, . - v7_processor_functions |
361 | 423 | ||
362 | .section ".rodata" | 424 | .section ".rodata" |