aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mm
diff options
context:
space:
mode:
authorRussell King <rmk@dyn-67.arm.linux.org.uk>2009-06-11 10:35:00 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2009-06-11 10:35:00 -0400
commit42578c82e0f1810a07ebe29cb05e874893243d8c (patch)
treee2a3811677d3594e891fc82c940438f6b6abc3e0 /arch/arm/mm
parent2631182bf93919577730e6a6c4345308db590057 (diff)
parent85d6943af50537d3aec58b967ffbd3fec88453e9 (diff)
Merge branch 'for-rmk' of git://linux-arm.org/linux-2.6 into devel
Conflicts: arch/arm/Kconfig arch/arm/kernel/smp.c arch/arm/mach-realview/Makefile arch/arm/mach-realview/platsmp.c
Diffstat (limited to 'arch/arm/mm')
-rw-r--r--arch/arm/mm/Kconfig20
-rw-r--r--arch/arm/mm/abort-ev6.S3
-rw-r--r--arch/arm/mm/proc-v6.S3
-rw-r--r--arch/arm/mm/proc-v7.S59
-rw-r--r--arch/arm/mm/tlb-v7.S17
5 files changed, 82 insertions, 20 deletions
diff --git a/arch/arm/mm/Kconfig b/arch/arm/mm/Kconfig
index b9bd481a0ecc..83c025e72ceb 100644
--- a/arch/arm/mm/Kconfig
+++ b/arch/arm/mm/Kconfig
@@ -391,7 +391,7 @@ config CPU_FEROCEON_OLD_ID
391 391
392# ARMv6 392# ARMv6
393config CPU_V6 393config CPU_V6
394 bool "Support ARM V6 processor" if ARCH_INTEGRATOR || MACH_REALVIEW_EB 394 bool "Support ARM V6 processor" if ARCH_INTEGRATOR || MACH_REALVIEW_EB || MACH_REALVIEW_PBX
395 select CPU_32v6 395 select CPU_32v6
396 select CPU_ABRT_EV6 396 select CPU_ABRT_EV6
397 select CPU_PABRT_NOIFAR 397 select CPU_PABRT_NOIFAR
@@ -416,7 +416,7 @@ config CPU_32v6K
416 416
417# ARMv7 417# ARMv7
418config CPU_V7 418config CPU_V7
419 bool "Support ARM V7 processor" if ARCH_INTEGRATOR || MACH_REALVIEW_EB 419 bool "Support ARM V7 processor" if ARCH_INTEGRATOR || MACH_REALVIEW_EB || MACH_REALVIEW_PBX
420 select CPU_32v6K 420 select CPU_32v6K
421 select CPU_32v7 421 select CPU_32v7
422 select CPU_ABRT_EV7 422 select CPU_ABRT_EV7
@@ -639,6 +639,20 @@ config CPU_BIG_ENDIAN
639 port must properly enable any big-endian related features 639 port must properly enable any big-endian related features
640 of your chipset/board/processor. 640 of your chipset/board/processor.
641 641
642config CPU_ENDIAN_BE8
643 bool
644 depends on CPU_BIG_ENDIAN
645 default CPU_V6 || CPU_V7
646 help
647 Support for the BE-8 (big-endian) mode on ARMv6 and ARMv7 processors.
648
649config CPU_ENDIAN_BE32
650 bool
651 depends on CPU_BIG_ENDIAN
652 default !CPU_ENDIAN_BE8
653 help
654 Support for the BE-32 (big-endian) mode on pre-ARMv6 processors.
655
642config CPU_HIGH_VECTOR 656config CPU_HIGH_VECTOR
643 depends on !MMU && CPU_CP15 && !CPU_ARM740T 657 depends on !MMU && CPU_CP15 && !CPU_ARM740T
644 bool "Select the High exception vector" 658 bool "Select the High exception vector"
@@ -744,7 +758,7 @@ config CACHE_FEROCEON_L2_WRITETHROUGH
744config CACHE_L2X0 758config CACHE_L2X0
745 bool "Enable the L2x0 outer cache controller" 759 bool "Enable the L2x0 outer cache controller"
746 depends on REALVIEW_EB_ARM11MP || MACH_REALVIEW_PB11MP || MACH_REALVIEW_PB1176 || \ 760 depends on REALVIEW_EB_ARM11MP || MACH_REALVIEW_PB11MP || MACH_REALVIEW_PB1176 || \
747 REALVIEW_EB_A9MP || ARCH_MX35 || ARCH_MX31 761 REALVIEW_EB_A9MP || ARCH_MX35 || ARCH_MX31 || MACH_REALVIEW_PBX
748 default y 762 default y
749 select OUTER_CACHE 763 select OUTER_CACHE
750 help 764 help
diff --git a/arch/arm/mm/abort-ev6.S b/arch/arm/mm/abort-ev6.S
index 6f7e70907e44..f332df7f0d37 100644
--- a/arch/arm/mm/abort-ev6.S
+++ b/arch/arm/mm/abort-ev6.S
@@ -37,6 +37,9 @@ ENTRY(v6_early_abort)
37 movne pc, lr 37 movne pc, lr
38 do_thumb_abort 38 do_thumb_abort
39 ldreq r3, [r2] @ read aborted ARM instruction 39 ldreq r3, [r2] @ read aborted ARM instruction
40#ifdef CONFIG_CPU_ENDIAN_BE8
41 reveq r3, r3
42#endif
40 do_ldrd_abort 43 do_ldrd_abort
41 tst r3, #1 << 20 @ L = 0 -> write 44 tst r3, #1 << 20 @ L = 0 -> write
42 orreq r1, r1, #1 << 11 @ yes. 45 orreq r1, r1, #1 << 11 @ yes.
diff --git a/arch/arm/mm/proc-v6.S b/arch/arm/mm/proc-v6.S
index 087e239704df..524ddae92595 100644
--- a/arch/arm/mm/proc-v6.S
+++ b/arch/arm/mm/proc-v6.S
@@ -170,6 +170,9 @@ __v6_setup:
170#endif /* CONFIG_MMU */ 170#endif /* CONFIG_MMU */
171 adr r5, v6_crval 171 adr r5, v6_crval
172 ldmia r5, {r5, r6} 172 ldmia r5, {r5, r6}
173#ifdef CONFIG_CPU_ENDIAN_BE8
174 orr r6, r6, #1 << 25 @ big-endian page tables
175#endif
173 mrc p15, 0, r0, c1, c0, 0 @ read control register 176 mrc p15, 0, r0, c1, c0, 0 @ read control register
174 bic r0, r0, r5 @ clear bits them 177 bic r0, r0, r5 @ clear bits them
175 orr r0, r0, r6 @ set them 178 orr r0, r0, r6 @ set them
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
35ENTRY(cpu_v7_proc_init) 41ENTRY(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:
226ENDPROC(__v7_setup) 263ENDPROC(__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
235v7_crval: 272v7_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
diff --git a/arch/arm/mm/tlb-v7.S b/arch/arm/mm/tlb-v7.S
index b637e7380ab7..a26a605b73bd 100644
--- a/arch/arm/mm/tlb-v7.S
+++ b/arch/arm/mm/tlb-v7.S
@@ -42,9 +42,11 @@ ENTRY(v7wbi_flush_user_tlb_range)
42 mov r1, r1, lsl #PAGE_SHIFT 42 mov r1, r1, lsl #PAGE_SHIFT
43 vma_vm_flags r2, r2 @ get vma->vm_flags 43 vma_vm_flags r2, r2 @ get vma->vm_flags
441: 441:
45 mcr p15, 0, r0, c8, c6, 1 @ TLB invalidate D MVA (was 1) 45#ifdef CONFIG_SMP
46 tst r2, #VM_EXEC @ Executable area ? 46 mcr p15, 0, r0, c8, c3, 1 @ TLB invalidate U MVA (shareable)
47 mcrne p15, 0, r0, c8, c5, 1 @ TLB invalidate I MVA (was 1) 47#else
48 mcr p15, 0, r0, c8, c7, 1 @ TLB invalidate U MVA
49#endif
48 add r0, r0, #PAGE_SZ 50 add r0, r0, #PAGE_SZ
49 cmp r0, r1 51 cmp r0, r1
50 blo 1b 52 blo 1b
@@ -69,8 +71,11 @@ ENTRY(v7wbi_flush_kern_tlb_range)
69 mov r0, r0, lsl #PAGE_SHIFT 71 mov r0, r0, lsl #PAGE_SHIFT
70 mov r1, r1, lsl #PAGE_SHIFT 72 mov r1, r1, lsl #PAGE_SHIFT
711: 731:
72 mcr p15, 0, r0, c8, c6, 1 @ TLB invalidate D MVA 74#ifdef CONFIG_SMP
73 mcr p15, 0, r0, c8, c5, 1 @ TLB invalidate I MVA 75 mcr p15, 0, r0, c8, c3, 1 @ TLB invalidate U MVA (shareable)
76#else
77 mcr p15, 0, r0, c8, c7, 1 @ TLB invalidate U MVA
78#endif
74 add r0, r0, #PAGE_SZ 79 add r0, r0, #PAGE_SZ
75 cmp r0, r1 80 cmp r0, r1
76 blo 1b 81 blo 1b
@@ -87,5 +92,5 @@ ENDPROC(v7wbi_flush_kern_tlb_range)
87ENTRY(v7wbi_tlb_fns) 92ENTRY(v7wbi_tlb_fns)
88 .long v7wbi_flush_user_tlb_range 93 .long v7wbi_flush_user_tlb_range
89 .long v7wbi_flush_kern_tlb_range 94 .long v7wbi_flush_kern_tlb_range
90 .long v6wbi_tlb_flags 95 .long v7wbi_tlb_flags
91 .size v7wbi_tlb_fns, . - v7wbi_tlb_fns 96 .size v7wbi_tlb_fns, . - v7wbi_tlb_fns