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/cache-v6.S | 33 | ||||
-rw-r--r-- | arch/arm/mm/flush.c | 23 | ||||
-rw-r--r-- | arch/arm/mm/ioremap.c | 6 | ||||
-rw-r--r-- | arch/arm/mm/mmu.c | 1 | ||||
-rw-r--r-- | arch/arm/mm/proc-v6.S | 6 | ||||
-rw-r--r-- | arch/arm/mm/proc-v7.S | 81 | ||||
-rw-r--r-- | arch/arm/mm/tlb-v6.S | 3 | ||||
-rw-r--r-- | arch/arm/mm/tlb-v7.S | 20 |
10 files changed, 170 insertions, 29 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/cache-v6.S b/arch/arm/mm/cache-v6.S index 2c6c2a7c05a0..8f5c13f4c936 100644 --- a/arch/arm/mm/cache-v6.S +++ b/arch/arm/mm/cache-v6.S | |||
@@ -20,6 +20,31 @@ | |||
20 | #define D_CACHE_LINE_SIZE 32 | 20 | #define D_CACHE_LINE_SIZE 32 |
21 | #define BTB_FLUSH_SIZE 8 | 21 | #define BTB_FLUSH_SIZE 8 |
22 | 22 | ||
23 | #ifdef CONFIG_ARM_ERRATA_411920 | ||
24 | /* | ||
25 | * Invalidate the entire I cache (this code is a workaround for the ARM1136 | ||
26 | * erratum 411920 - Invalidate Instruction Cache operation can fail. This | ||
27 | * erratum is present in 1136, 1156 and 1176. It does not affect the MPCore. | ||
28 | * | ||
29 | * Registers: | ||
30 | * r0 - set to 0 | ||
31 | * r1 - corrupted | ||
32 | */ | ||
33 | ENTRY(v6_icache_inval_all) | ||
34 | mov r0, #0 | ||
35 | mrs r1, cpsr | ||
36 | cpsid ifa @ disable interrupts | ||
37 | mcr p15, 0, r0, c7, c5, 0 @ invalidate entire I-cache | ||
38 | mcr p15, 0, r0, c7, c5, 0 @ invalidate entire I-cache | ||
39 | mcr p15, 0, r0, c7, c5, 0 @ invalidate entire I-cache | ||
40 | mcr p15, 0, r0, c7, c5, 0 @ invalidate entire I-cache | ||
41 | msr cpsr_cx, r1 @ restore interrupts | ||
42 | .rept 11 @ ARM Ltd recommends at least | ||
43 | nop @ 11 NOPs | ||
44 | .endr | ||
45 | mov pc, lr | ||
46 | #endif | ||
47 | |||
23 | /* | 48 | /* |
24 | * v6_flush_cache_all() | 49 | * v6_flush_cache_all() |
25 | * | 50 | * |
@@ -31,8 +56,12 @@ ENTRY(v6_flush_kern_cache_all) | |||
31 | mov r0, #0 | 56 | mov r0, #0 |
32 | #ifdef HARVARD_CACHE | 57 | #ifdef HARVARD_CACHE |
33 | mcr p15, 0, r0, c7, c14, 0 @ D cache clean+invalidate | 58 | mcr p15, 0, r0, c7, c14, 0 @ D cache clean+invalidate |
59 | #ifndef CONFIG_ARM_ERRATA_411920 | ||
34 | mcr p15, 0, r0, c7, c5, 0 @ I+BTB cache invalidate | 60 | mcr p15, 0, r0, c7, c5, 0 @ I+BTB cache invalidate |
35 | #else | 61 | #else |
62 | b v6_icache_inval_all | ||
63 | #endif | ||
64 | #else | ||
36 | mcr p15, 0, r0, c7, c15, 0 @ Cache clean+invalidate | 65 | mcr p15, 0, r0, c7, c15, 0 @ Cache clean+invalidate |
37 | #endif | 66 | #endif |
38 | mov pc, lr | 67 | mov pc, lr |
@@ -103,8 +132,12 @@ ENTRY(v6_coherent_user_range) | |||
103 | mov r0, #0 | 132 | mov r0, #0 |
104 | #ifdef HARVARD_CACHE | 133 | #ifdef HARVARD_CACHE |
105 | mcr p15, 0, r0, c7, c10, 4 @ drain write buffer | 134 | mcr p15, 0, r0, c7, c10, 4 @ drain write buffer |
135 | #ifndef CONFIG_ARM_ERRATA_411920 | ||
106 | mcr p15, 0, r0, c7, c5, 0 @ I+BTB cache invalidate | 136 | mcr p15, 0, r0, c7, c5, 0 @ I+BTB cache invalidate |
107 | #else | 137 | #else |
138 | b v6_icache_inval_all | ||
139 | #endif | ||
140 | #else | ||
108 | mcr p15, 0, r0, c7, c5, 6 @ invalidate BTB | 141 | mcr p15, 0, r0, c7, c5, 6 @ invalidate BTB |
109 | #endif | 142 | #endif |
110 | mov pc, lr | 143 | mov pc, lr |
diff --git a/arch/arm/mm/flush.c b/arch/arm/mm/flush.c index 4e283481cee1..c07222eb5ce0 100644 --- a/arch/arm/mm/flush.c +++ b/arch/arm/mm/flush.c | |||
@@ -18,6 +18,10 @@ | |||
18 | 18 | ||
19 | #include "mm.h" | 19 | #include "mm.h" |
20 | 20 | ||
21 | #ifdef CONFIG_ARM_ERRATA_411920 | ||
22 | extern void v6_icache_inval_all(void); | ||
23 | #endif | ||
24 | |||
21 | #ifdef CONFIG_CPU_CACHE_VIPT | 25 | #ifdef CONFIG_CPU_CACHE_VIPT |
22 | 26 | ||
23 | #define ALIAS_FLUSH_START 0xffff4000 | 27 | #define ALIAS_FLUSH_START 0xffff4000 |
@@ -32,10 +36,15 @@ static void flush_pfn_alias(unsigned long pfn, unsigned long vaddr) | |||
32 | 36 | ||
33 | asm( "mcrr p15, 0, %1, %0, c14\n" | 37 | asm( "mcrr p15, 0, %1, %0, c14\n" |
34 | " mcr p15, 0, %2, c7, c10, 4\n" | 38 | " mcr p15, 0, %2, c7, c10, 4\n" |
39 | #ifndef CONFIG_ARM_ERRATA_411920 | ||
35 | " mcr p15, 0, %2, c7, c5, 0\n" | 40 | " mcr p15, 0, %2, c7, c5, 0\n" |
41 | #endif | ||
36 | : | 42 | : |
37 | : "r" (to), "r" (to + PAGE_SIZE - L1_CACHE_BYTES), "r" (zero) | 43 | : "r" (to), "r" (to + PAGE_SIZE - L1_CACHE_BYTES), "r" (zero) |
38 | : "cc"); | 44 | : "cc"); |
45 | #ifdef CONFIG_ARM_ERRATA_411920 | ||
46 | v6_icache_inval_all(); | ||
47 | #endif | ||
39 | } | 48 | } |
40 | 49 | ||
41 | void flush_cache_mm(struct mm_struct *mm) | 50 | void flush_cache_mm(struct mm_struct *mm) |
@@ -48,11 +57,16 @@ void flush_cache_mm(struct mm_struct *mm) | |||
48 | 57 | ||
49 | if (cache_is_vipt_aliasing()) { | 58 | if (cache_is_vipt_aliasing()) { |
50 | asm( "mcr p15, 0, %0, c7, c14, 0\n" | 59 | asm( "mcr p15, 0, %0, c7, c14, 0\n" |
60 | " mcr p15, 0, %0, c7, c10, 4\n" | ||
61 | #ifndef CONFIG_ARM_ERRATA_411920 | ||
51 | " mcr p15, 0, %0, c7, c5, 0\n" | 62 | " mcr p15, 0, %0, c7, c5, 0\n" |
52 | " mcr p15, 0, %0, c7, c10, 4" | 63 | #endif |
53 | : | 64 | : |
54 | : "r" (0) | 65 | : "r" (0) |
55 | : "cc"); | 66 | : "cc"); |
67 | #ifdef CONFIG_ARM_ERRATA_411920 | ||
68 | v6_icache_inval_all(); | ||
69 | #endif | ||
56 | } | 70 | } |
57 | } | 71 | } |
58 | 72 | ||
@@ -67,11 +81,16 @@ void flush_cache_range(struct vm_area_struct *vma, unsigned long start, unsigned | |||
67 | 81 | ||
68 | if (cache_is_vipt_aliasing()) { | 82 | if (cache_is_vipt_aliasing()) { |
69 | asm( "mcr p15, 0, %0, c7, c14, 0\n" | 83 | asm( "mcr p15, 0, %0, c7, c14, 0\n" |
84 | " mcr p15, 0, %0, c7, c10, 4\n" | ||
85 | #ifndef CONFIG_ARM_ERRATA_411920 | ||
70 | " mcr p15, 0, %0, c7, c5, 0\n" | 86 | " mcr p15, 0, %0, c7, c5, 0\n" |
71 | " mcr p15, 0, %0, c7, c10, 4" | 87 | #endif |
72 | : | 88 | : |
73 | : "r" (0) | 89 | : "r" (0) |
74 | : "cc"); | 90 | : "cc"); |
91 | #ifdef CONFIG_ARM_ERRATA_411920 | ||
92 | v6_icache_inval_all(); | ||
93 | #endif | ||
75 | } | 94 | } |
76 | } | 95 | } |
77 | 96 | ||
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..70974d75a075 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. |
diff --git a/arch/arm/mm/proc-v6.S b/arch/arm/mm/proc-v6.S index f0cc599facb7..524ddae92595 100644 --- a/arch/arm/mm/proc-v6.S +++ b/arch/arm/mm/proc-v6.S | |||
@@ -10,6 +10,7 @@ | |||
10 | * | 10 | * |
11 | * This is the "shell" of the ARMv6 processor support. | 11 | * This is the "shell" of the ARMv6 processor support. |
12 | */ | 12 | */ |
13 | #include <linux/init.h> | ||
13 | #include <linux/linkage.h> | 14 | #include <linux/linkage.h> |
14 | #include <asm/assembler.h> | 15 | #include <asm/assembler.h> |
15 | #include <asm/asm-offsets.h> | 16 | #include <asm/asm-offsets.h> |
@@ -132,7 +133,7 @@ cpu_v6_name: | |||
132 | .asciz "ARMv6-compatible processor" | 133 | .asciz "ARMv6-compatible processor" |
133 | .align | 134 | .align |
134 | 135 | ||
135 | .section ".text.init", #alloc, #execinstr | 136 | __INIT |
136 | 137 | ||
137 | /* | 138 | /* |
138 | * __v6_setup | 139 | * __v6_setup |
@@ -169,6 +170,9 @@ __v6_setup: | |||
169 | #endif /* CONFIG_MMU */ | 170 | #endif /* CONFIG_MMU */ |
170 | adr r5, v6_crval | 171 | adr r5, v6_crval |
171 | 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 | ||
172 | mrc p15, 0, r0, c1, c0, 0 @ read control register | 176 | mrc p15, 0, r0, c1, c0, 0 @ read control register |
173 | bic r0, r0, r5 @ clear bits them | 177 | bic r0, r0, r5 @ clear bits them |
174 | 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 d1ebec42521d..4f8486475a79 100644 --- a/arch/arm/mm/proc-v7.S +++ b/arch/arm/mm/proc-v7.S | |||
@@ -9,6 +9,7 @@ | |||
9 | * | 9 | * |
10 | * This is the "shell" of the ARMv7 processor support. | 10 | * This is the "shell" of the ARMv7 processor support. |
11 | */ | 11 | */ |
12 | #include <linux/init.h> | ||
12 | #include <linux/linkage.h> | 13 | #include <linux/linkage.h> |
13 | #include <asm/assembler.h> | 14 | #include <asm/assembler.h> |
14 | #include <asm/asm-offsets.h> | 15 | #include <asm/asm-offsets.h> |
@@ -18,17 +19,23 @@ | |||
18 | 19 | ||
19 | #include "proc-macros.S" | 20 | #include "proc-macros.S" |
20 | 21 | ||
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) | 23 | #define TTB_RGN_NC (0 << 3) |
24 | #define TTB_RGN_OC_WBWA (1 << 3) | 24 | #define TTB_RGN_OC_WBWA (1 << 3) |
25 | #define TTB_RGN_OC_WT (2 << 3) | 25 | #define TTB_RGN_OC_WT (2 << 3) |
26 | #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)) | ||
27 | 32 | ||
28 | #ifndef CONFIG_SMP | 33 | #ifndef CONFIG_SMP |
29 | #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 | ||
30 | #else | 36 | #else |
31 | #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 | ||
32 | #endif | 39 | #endif |
33 | 40 | ||
34 | ENTRY(cpu_v7_proc_init) | 41 | ENTRY(cpu_v7_proc_init) |
@@ -95,6 +102,9 @@ ENTRY(cpu_v7_switch_mm) | |||
95 | mov r2, #0 | 102 | mov r2, #0 |
96 | ldr r1, [r1, #MM_CONTEXT_ID] @ get mm->context.id | 103 | ldr r1, [r1, #MM_CONTEXT_ID] @ get mm->context.id |
97 | orr r0, r0, #TTB_FLAGS | 104 | orr r0, r0, #TTB_FLAGS |
105 | #ifdef CONFIG_ARM_ERRATA_430973 | ||
106 | mcr p15, 0, r2, c7, c5, 6 @ flush BTAC/BTB | ||
107 | #endif | ||
98 | mcr p15, 0, r2, c13, c0, 1 @ set reserved context ID | 108 | mcr p15, 0, r2, c13, c0, 1 @ set reserved context ID |
99 | isb | 109 | isb |
100 | 1: mcr p15, 0, r0, c2, c0, 0 @ set TTB 0 | 110 | 1: mcr p15, 0, r0, c2, c0, 0 @ set TTB 0 |
@@ -153,7 +163,7 @@ cpu_v7_name: | |||
153 | .ascii "ARMv7 Processor" | 163 | .ascii "ARMv7 Processor" |
154 | .align | 164 | .align |
155 | 165 | ||
156 | .section ".text.init", #alloc, #execinstr | 166 | __INIT |
157 | 167 | ||
158 | /* | 168 | /* |
159 | * __v7_setup | 169 | * __v7_setup |
@@ -172,14 +182,30 @@ cpu_v7_name: | |||
172 | */ | 182 | */ |
173 | __v7_setup: | 183 | __v7_setup: |
174 | #ifdef CONFIG_SMP | 184 | #ifdef CONFIG_SMP |
175 | mrc p15, 0, r0, c1, c0, 1 @ Enable SMP/nAMP mode | 185 | mrc p15, 0, r0, c1, c0, 1 @ Enable SMP/nAMP mode and |
176 | orr r0, r0, #(0x1 << 6) | 186 | orr r0, r0, #(1 << 6) | (1 << 0) @ TLB ops broadcasting |
177 | mcr p15, 0, r0, c1, c0, 1 | 187 | mcr p15, 0, r0, c1, c0, 1 |
178 | #endif | 188 | #endif |
179 | adr r12, __v7_setup_stack @ the local stack | 189 | adr r12, __v7_setup_stack @ the local stack |
180 | stmia r12, {r0-r5, r7, r9, r11, lr} | 190 | stmia r12, {r0-r5, r7, r9, r11, lr} |
181 | bl v7_flush_dcache_all | 191 | bl v7_flush_dcache_all |
182 | ldmia r12, {r0-r5, r7, r9, r11, lr} | 192 | ldmia r12, {r0-r5, r7, r9, r11, lr} |
193 | #ifdef CONFIG_ARM_ERRATA_430973 | ||
194 | mrc p15, 0, r10, c1, c0, 1 @ read aux control register | ||
195 | orr r10, r10, #(1 << 6) @ set IBE to 1 | ||
196 | mcr p15, 0, r10, c1, c0, 1 @ write aux control register | ||
197 | #endif | ||
198 | #ifdef CONFIG_ARM_ERRATA_458693 | ||
199 | mrc p15, 0, r10, c1, c0, 1 @ read aux control register | ||
200 | orr r10, r10, #(1 << 5) @ set L1NEON to 1 | ||
201 | orr r10, r10, #(1 << 9) @ set PLDNOP to 1 | ||
202 | mcr p15, 0, r10, c1, c0, 1 @ write aux control register | ||
203 | #endif | ||
204 | #ifdef CONFIG_ARM_ERRATA_460075 | ||
205 | mrc p15, 1, r10, c9, c0, 2 @ read L2 cache aux ctrl register | ||
206 | orr r10, r10, #(1 << 22) @ set the Write Allocate disable bit | ||
207 | mcr p15, 1, r10, c9, c0, 2 @ write the L2 cache aux ctrl register | ||
208 | #endif | ||
183 | mov r10, #0 | 209 | mov r10, #0 |
184 | #ifdef HARVARD_CACHE | 210 | #ifdef HARVARD_CACHE |
185 | mcr p15, 0, r10, c7, c5, 0 @ I+BTB cache invalidate | 211 | mcr p15, 0, r10, c7, c5, 0 @ I+BTB cache invalidate |
@@ -193,12 +219,43 @@ __v7_setup: | |||
193 | mov r10, #0x1f @ domains 0, 1 = manager | 219 | mov r10, #0x1f @ domains 0, 1 = manager |
194 | mcr p15, 0, r10, c3, c0, 0 @ load domain access register | 220 | mcr p15, 0, r10, c3, c0, 0 @ load domain access register |
195 | #endif | 221 | #endif |
196 | ldr r5, =0xff0aa1a8 | 222 | /* |
197 | 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 | ||
198 | mcr p15, 0, r5, c10, c2, 0 @ write PRRR | 252 | mcr p15, 0, r5, c10, c2, 0 @ write PRRR |
199 | mcr p15, 0, r6, c10, c2, 1 @ write NMRR | 253 | mcr p15, 0, r6, c10, c2, 1 @ write NMRR |
200 | adr r5, v7_crval | 254 | adr r5, v7_crval |
201 | 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 | ||
202 | mrc p15, 0, r0, c1, c0, 0 @ read control register | 259 | mrc p15, 0, r0, c1, c0, 0 @ read control register |
203 | bic r0, r0, r5 @ clear bits them | 260 | bic r0, r0, r5 @ clear bits them |
204 | orr r0, r0, r6 @ set them | 261 | orr r0, r0, r6 @ set them |
@@ -206,14 +263,14 @@ __v7_setup: | |||
206 | ENDPROC(__v7_setup) | 263 | ENDPROC(__v7_setup) |
207 | 264 | ||
208 | /* AT | 265 | /* AT |
209 | * TFR EV X F I D LR | 266 | * TFR EV X F I D LR S |
210 | * .EEE ..EE PUI. .T.T 4RVI ZFRS BLDP WCAM | 267 | * .EEE ..EE PUI. .T.T 4RVI ZWRS BLDP WCAM |
211 | * rxxx rrxx xxx0 0101 xxxx xxxx x111 xxxx < forced | 268 | * rxxx rrxx xxx0 0101 xxxx xxxx x111 xxxx < forced |
212 | * 1 0 110 0011 1.00 .111 1101 < we want | 269 | * 1 0 110 0011 1100 .111 1101 < we want |
213 | */ | 270 | */ |
214 | .type v7_crval, #object | 271 | .type v7_crval, #object |
215 | v7_crval: | 272 | v7_crval: |
216 | crval clear=0x0120c302, mmuset=0x10c0387d, ucset=0x00c0187c | 273 | crval clear=0x0120c302, mmuset=0x10c03c7d, ucset=0x00c01c7c |
217 | 274 | ||
218 | __v7_setup_stack: | 275 | __v7_setup_stack: |
219 | .space 4 * 11 @ 11 registers | 276 | .space 4 * 11 @ 11 registers |
diff --git a/arch/arm/mm/tlb-v6.S b/arch/arm/mm/tlb-v6.S index 20f84bbaa9bb..73d7d89b04c4 100644 --- a/arch/arm/mm/tlb-v6.S +++ b/arch/arm/mm/tlb-v6.S | |||
@@ -10,6 +10,7 @@ | |||
10 | * ARM architecture version 6 TLB handling functions. | 10 | * ARM architecture version 6 TLB handling functions. |
11 | * These assume a split I/D TLB. | 11 | * These assume a split I/D TLB. |
12 | */ | 12 | */ |
13 | #include <linux/init.h> | ||
13 | #include <linux/linkage.h> | 14 | #include <linux/linkage.h> |
14 | #include <asm/asm-offsets.h> | 15 | #include <asm/asm-offsets.h> |
15 | #include <asm/page.h> | 16 | #include <asm/page.h> |
@@ -87,7 +88,7 @@ ENTRY(v6wbi_flush_kern_tlb_range) | |||
87 | mcr p15, 0, r2, c7, c5, 4 @ prefetch flush | 88 | mcr p15, 0, r2, c7, c5, 4 @ prefetch flush |
88 | mov pc, lr | 89 | mov pc, lr |
89 | 90 | ||
90 | .section ".text.init", #alloc, #execinstr | 91 | __INIT |
91 | 92 | ||
92 | .type v6wbi_tlb_fns, #object | 93 | .type v6wbi_tlb_fns, #object |
93 | ENTRY(v6wbi_tlb_fns) | 94 | ENTRY(v6wbi_tlb_fns) |
diff --git a/arch/arm/mm/tlb-v7.S b/arch/arm/mm/tlb-v7.S index 24ba5109f2e7..a26a605b73bd 100644 --- a/arch/arm/mm/tlb-v7.S +++ b/arch/arm/mm/tlb-v7.S | |||
@@ -11,6 +11,7 @@ | |||
11 | * ARM architecture version 6 TLB handling functions. | 11 | * ARM architecture version 6 TLB handling functions. |
12 | * These assume a split I/D TLB. | 12 | * These assume a split I/D TLB. |
13 | */ | 13 | */ |
14 | #include <linux/init.h> | ||
14 | #include <linux/linkage.h> | 15 | #include <linux/linkage.h> |
15 | #include <asm/asm-offsets.h> | 16 | #include <asm/asm-offsets.h> |
16 | #include <asm/page.h> | 17 | #include <asm/page.h> |
@@ -41,9 +42,11 @@ ENTRY(v7wbi_flush_user_tlb_range) | |||
41 | mov r1, r1, lsl #PAGE_SHIFT | 42 | mov r1, r1, lsl #PAGE_SHIFT |
42 | vma_vm_flags r2, r2 @ get vma->vm_flags | 43 | vma_vm_flags r2, r2 @ get vma->vm_flags |
43 | 1: | 44 | 1: |
44 | mcr p15, 0, r0, c8, c6, 1 @ TLB invalidate D MVA (was 1) | 45 | #ifdef CONFIG_SMP |
45 | tst r2, #VM_EXEC @ Executable area ? | 46 | mcr p15, 0, r0, c8, c3, 1 @ TLB invalidate U MVA (shareable) |
46 | 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 | ||
47 | add r0, r0, #PAGE_SZ | 50 | add r0, r0, #PAGE_SZ |
48 | cmp r0, r1 | 51 | cmp r0, r1 |
49 | blo 1b | 52 | blo 1b |
@@ -68,8 +71,11 @@ ENTRY(v7wbi_flush_kern_tlb_range) | |||
68 | mov r0, r0, lsl #PAGE_SHIFT | 71 | mov r0, r0, lsl #PAGE_SHIFT |
69 | mov r1, r1, lsl #PAGE_SHIFT | 72 | mov r1, r1, lsl #PAGE_SHIFT |
70 | 1: | 73 | 1: |
71 | mcr p15, 0, r0, c8, c6, 1 @ TLB invalidate D MVA | 74 | #ifdef CONFIG_SMP |
72 | 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 | ||
73 | add r0, r0, #PAGE_SZ | 79 | add r0, r0, #PAGE_SZ |
74 | cmp r0, r1 | 80 | cmp r0, r1 |
75 | blo 1b | 81 | blo 1b |
@@ -80,11 +86,11 @@ ENTRY(v7wbi_flush_kern_tlb_range) | |||
80 | mov pc, lr | 86 | mov pc, lr |
81 | ENDPROC(v7wbi_flush_kern_tlb_range) | 87 | ENDPROC(v7wbi_flush_kern_tlb_range) |
82 | 88 | ||
83 | .section ".text.init", #alloc, #execinstr | 89 | __INIT |
84 | 90 | ||
85 | .type v7wbi_tlb_fns, #object | 91 | .type v7wbi_tlb_fns, #object |
86 | ENTRY(v7wbi_tlb_fns) | 92 | ENTRY(v7wbi_tlb_fns) |
87 | .long v7wbi_flush_user_tlb_range | 93 | .long v7wbi_flush_user_tlb_range |
88 | .long v7wbi_flush_kern_tlb_range | 94 | .long v7wbi_flush_kern_tlb_range |
89 | .long v6wbi_tlb_flags | 95 | .long v7wbi_tlb_flags |
90 | .size v7wbi_tlb_fns, . - v7wbi_tlb_fns | 96 | .size v7wbi_tlb_fns, . - v7wbi_tlb_fns |