diff options
Diffstat (limited to 'arch/arm/mm')
-rw-r--r-- | arch/arm/mm/Kconfig | 23 | ||||
-rw-r--r-- | arch/arm/mm/abort-ev6.S | 3 | ||||
-rw-r--r-- | arch/arm/mm/ioremap.c | 6 | ||||
-rw-r--r-- | arch/arm/mm/mmu.c | 15 | ||||
-rw-r--r-- | arch/arm/mm/proc-v6.S | 3 | ||||
-rw-r--r-- | arch/arm/mm/proc-v7.S | 59 | ||||
-rw-r--r-- | arch/arm/mm/tlb-v7.S | 17 |
7 files changed, 103 insertions, 23 deletions
diff --git a/arch/arm/mm/Kconfig b/arch/arm/mm/Kconfig index 20979564e7ee..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 |
393 | config CPU_V6 | 393 | config 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 |
418 | config CPU_V7 | 418 | config 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,10 +639,23 @@ 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 | ||
642 | config 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 | |||
649 | config 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 | |||
642 | config CPU_HIGH_VECTOR | 656 | config 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" |
645 | default n | ||
646 | help | 659 | help |
647 | Say Y here to select high exception vector(0xFFFF0000~). | 660 | Say Y here to select high exception vector(0xFFFF0000~). |
648 | The exception vector can be vary depending on the platform | 661 | The exception vector can be vary depending on the platform |
@@ -726,7 +739,6 @@ config NEEDS_SYSCALL_FOR_CMPXCHG | |||
726 | 739 | ||
727 | config OUTER_CACHE | 740 | config OUTER_CACHE |
728 | bool | 741 | bool |
729 | default n | ||
730 | 742 | ||
731 | config CACHE_FEROCEON_L2 | 743 | config CACHE_FEROCEON_L2 |
732 | bool "Enable the Feroceon L2 cache controller" | 744 | bool "Enable the Feroceon L2 cache controller" |
@@ -739,7 +751,6 @@ config CACHE_FEROCEON_L2 | |||
739 | config CACHE_FEROCEON_L2_WRITETHROUGH | 751 | config CACHE_FEROCEON_L2_WRITETHROUGH |
740 | bool "Force Feroceon L2 cache write through" | 752 | bool "Force Feroceon L2 cache write through" |
741 | depends on CACHE_FEROCEON_L2 | 753 | depends on CACHE_FEROCEON_L2 |
742 | default n | ||
743 | help | 754 | help |
744 | Say Y here to use the Feroceon L2 cache in writethrough mode. | 755 | Say Y here to use the Feroceon L2 cache in writethrough mode. |
745 | Unless you specifically require this, say N for writeback mode. | 756 | Unless you specifically require this, say N for writeback mode. |
@@ -747,7 +758,7 @@ config CACHE_FEROCEON_L2_WRITETHROUGH | |||
747 | config CACHE_L2X0 | 758 | config CACHE_L2X0 |
748 | bool "Enable the L2x0 outer cache controller" | 759 | bool "Enable the L2x0 outer cache controller" |
749 | depends on REALVIEW_EB_ARM11MP || MACH_REALVIEW_PB11MP || MACH_REALVIEW_PB1176 || \ | 760 | depends on REALVIEW_EB_ARM11MP || MACH_REALVIEW_PB11MP || MACH_REALVIEW_PB1176 || \ |
750 | REALVIEW_EB_A9MP || ARCH_MX35 || ARCH_MX31 | 761 | REALVIEW_EB_A9MP || ARCH_MX35 || ARCH_MX31 || MACH_REALVIEW_PBX |
751 | default y | 762 | default y |
752 | select OUTER_CACHE | 763 | select OUTER_CACHE |
753 | 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/ioremap.c b/arch/arm/mm/ioremap.c index 9f88dd3be601..0ab75c60f7cf 100644 --- a/arch/arm/mm/ioremap.c +++ b/arch/arm/mm/ioremap.c | |||
@@ -110,6 +110,12 @@ static int remap_area_pages(unsigned long start, unsigned long pfn, | |||
110 | return err; | 110 | return err; |
111 | } | 111 | } |
112 | 112 | ||
113 | int ioremap_page(unsigned long virt, unsigned long phys, | ||
114 | const struct mem_type *mtype) | ||
115 | { | ||
116 | return remap_area_pages(virt, __phys_to_pfn(phys), PAGE_SIZE, mtype); | ||
117 | } | ||
118 | EXPORT_SYMBOL(ioremap_page); | ||
113 | 119 | ||
114 | void __check_kvm_seq(struct mm_struct *mm) | 120 | void __check_kvm_seq(struct mm_struct *mm) |
115 | { | 121 | { |
diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c index e6344ece00ce..fdaa9bb87c16 100644 --- a/arch/arm/mm/mmu.c +++ b/arch/arm/mm/mmu.c | |||
@@ -255,6 +255,7 @@ const struct mem_type *get_mem_type(unsigned int type) | |||
255 | { | 255 | { |
256 | return type < ARRAY_SIZE(mem_types) ? &mem_types[type] : NULL; | 256 | return type < ARRAY_SIZE(mem_types) ? &mem_types[type] : NULL; |
257 | } | 257 | } |
258 | EXPORT_SYMBOL(get_mem_type); | ||
258 | 259 | ||
259 | /* | 260 | /* |
260 | * Adjust the PMD section entries according to the CPU in use. | 261 | * Adjust the PMD section entries according to the CPU in use. |
@@ -839,6 +840,20 @@ void __init reserve_node_zero(pg_data_t *pgdat) | |||
839 | reserve_bootmem_node(pgdat, 0xa0200000, 0x1000, | 840 | reserve_bootmem_node(pgdat, 0xa0200000, 0x1000, |
840 | BOOTMEM_EXCLUSIVE); | 841 | BOOTMEM_EXCLUSIVE); |
841 | 842 | ||
843 | /* | ||
844 | * U300 - This platform family can share physical memory | ||
845 | * between two ARM cpus, one running Linux and the other | ||
846 | * running another OS. | ||
847 | */ | ||
848 | if (machine_is_u300()) { | ||
849 | #ifdef CONFIG_MACH_U300_SINGLE_RAM | ||
850 | #if ((CONFIG_MACH_U300_ACCESS_MEM_SIZE & 1) == 1) && \ | ||
851 | CONFIG_MACH_U300_2MB_ALIGNMENT_FIX | ||
852 | res_size = 0x00100000; | ||
853 | #endif | ||
854 | #endif | ||
855 | } | ||
856 | |||
842 | #ifdef CONFIG_SA1111 | 857 | #ifdef CONFIG_SA1111 |
843 | /* | 858 | /* |
844 | * Because of the SA1111 DMA bug, we want to preserve our | 859 | * Because of the SA1111 DMA bug, we want to preserve our |
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 a08d9d2380d3..180a08d03a03 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 |
@@ -227,12 +233,43 @@ __v7_setup: | |||
227 | mov r10, #0x1f @ domains 0, 1 = manager | 233 | mov r10, #0x1f @ domains 0, 1 = manager |
228 | mcr p15, 0, r10, c3, c0, 0 @ load domain access register | 234 | mcr p15, 0, r10, c3, c0, 0 @ load domain access register |
229 | #endif | 235 | #endif |
230 | ldr r5, =0xff0aa1a8 | 236 | /* |
231 | ldr r6, =0x40e040e0 | 237 | * Memory region attributes with SCTLR.TRE=1 |
238 | * | ||
239 | * n = TEX[0],C,B | ||
240 | * TR = PRRR[2n+1:2n] - memory type | ||
241 | * IR = NMRR[2n+1:2n] - inner cacheable property | ||
242 | * OR = NMRR[2n+17:2n+16] - outer cacheable property | ||
243 | * | ||
244 | * n TR IR OR | ||
245 | * UNCACHED 000 00 | ||
246 | * BUFFERABLE 001 10 00 00 | ||
247 | * WRITETHROUGH 010 10 10 10 | ||
248 | * WRITEBACK 011 10 11 11 | ||
249 | * reserved 110 | ||
250 | * WRITEALLOC 111 10 01 01 | ||
251 | * DEV_SHARED 100 01 | ||
252 | * DEV_NONSHARED 100 01 | ||
253 | * DEV_WC 001 10 | ||
254 | * DEV_CACHED 011 10 | ||
255 | * | ||
256 | * Other attributes: | ||
257 | * | ||
258 | * DS0 = PRRR[16] = 0 - device shareable property | ||
259 | * DS1 = PRRR[17] = 1 - device shareable property | ||
260 | * NS0 = PRRR[18] = 0 - normal shareable property | ||
261 | * NS1 = PRRR[19] = 1 - normal shareable property | ||
262 | * NOS = PRRR[24+n] = 1 - not outer shareable | ||
263 | */ | ||
264 | ldr r5, =0xff0a81a8 @ PRRR | ||
265 | ldr r6, =0x40e040e0 @ NMRR | ||
232 | mcr p15, 0, r5, c10, c2, 0 @ write PRRR | 266 | mcr p15, 0, r5, c10, c2, 0 @ write PRRR |
233 | mcr p15, 0, r6, c10, c2, 1 @ write NMRR | 267 | mcr p15, 0, r6, c10, c2, 1 @ write NMRR |
234 | adr r5, v7_crval | 268 | adr r5, v7_crval |
235 | ldmia r5, {r5, r6} | 269 | ldmia r5, {r5, r6} |
270 | #ifdef CONFIG_CPU_ENDIAN_BE8 | ||
271 | orr r6, r6, #1 << 25 @ big-endian page tables | ||
272 | #endif | ||
236 | mrc p15, 0, r0, c1, c0, 0 @ read control register | 273 | mrc p15, 0, r0, c1, c0, 0 @ read control register |
237 | bic r0, r0, r5 @ clear bits them | 274 | bic r0, r0, r5 @ clear bits them |
238 | orr r0, r0, r6 @ set them | 275 | orr r0, r0, r6 @ set them |
@@ -240,14 +277,14 @@ __v7_setup: | |||
240 | ENDPROC(__v7_setup) | 277 | ENDPROC(__v7_setup) |
241 | 278 | ||
242 | /* AT | 279 | /* AT |
243 | * TFR EV X F I D LR | 280 | * TFR EV X F I D LR S |
244 | * .EEE ..EE PUI. .T.T 4RVI ZFRS BLDP WCAM | 281 | * .EEE ..EE PUI. .T.T 4RVI ZWRS BLDP WCAM |
245 | * rxxx rrxx xxx0 0101 xxxx xxxx x111 xxxx < forced | 282 | * rxxx rrxx xxx0 0101 xxxx xxxx x111 xxxx < forced |
246 | * 1 0 110 0011 1.00 .111 1101 < we want | 283 | * 1 0 110 0011 1100 .111 1101 < we want |
247 | */ | 284 | */ |
248 | .type v7_crval, #object | 285 | .type v7_crval, #object |
249 | v7_crval: | 286 | v7_crval: |
250 | crval clear=0x0120c302, mmuset=0x10c0387d, ucset=0x00c0187c | 287 | crval clear=0x0120c302, mmuset=0x10c03c7d, ucset=0x00c01c7c |
251 | 288 | ||
252 | __v7_setup_stack: | 289 | __v7_setup_stack: |
253 | .space 4 * 11 @ 11 registers | 290 | .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 |
44 | 1: | 44 | 1: |
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 |
71 | 1: | 73 | 1: |
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) | |||
87 | ENTRY(v7wbi_tlb_fns) | 92 | ENTRY(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 |