aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mm/proc-v6.S
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mm/proc-v6.S')
-rw-r--r--arch/arm/mm/proc-v6.S41
1 files changed, 19 insertions, 22 deletions
diff --git a/arch/arm/mm/proc-v6.S b/arch/arm/mm/proc-v6.S
index 6f72549f8843..7b1843befb9c 100644
--- a/arch/arm/mm/proc-v6.S
+++ b/arch/arm/mm/proc-v6.S
@@ -13,8 +13,8 @@
13#include <linux/linkage.h> 13#include <linux/linkage.h>
14#include <asm/assembler.h> 14#include <asm/assembler.h>
15#include <asm/asm-offsets.h> 15#include <asm/asm-offsets.h>
16#include <asm/elf.h>
16#include <asm/hardware/arm_scu.h> 17#include <asm/hardware/arm_scu.h>
17#include <asm/procinfo.h>
18#include <asm/pgtable-hwdef.h> 18#include <asm/pgtable-hwdef.h>
19#include <asm/pgtable.h> 19#include <asm/pgtable.h>
20 20
@@ -103,13 +103,14 @@ ENTRY(cpu_v6_switch_mm)
103 mov pc, lr 103 mov pc, lr
104 104
105/* 105/*
106 * cpu_v6_set_pte(ptep, pte) 106 * cpu_v6_set_pte_ext(ptep, pte, ext)
107 * 107 *
108 * Set a level 2 translation table entry. 108 * Set a level 2 translation table entry.
109 * 109 *
110 * - ptep - pointer to level 2 translation table entry 110 * - ptep - pointer to level 2 translation table entry
111 * (hardware version is stored at -1024 bytes) 111 * (hardware version is stored at -1024 bytes)
112 * - pte - PTE value to store 112 * - pte - PTE value to store
113 * - ext - value for extended PTE bits
113 * 114 *
114 * Permissions: 115 * Permissions:
115 * YUWD APX AP1 AP0 SVC User 116 * YUWD APX AP1 AP0 SVC User
@@ -121,33 +122,34 @@ ENTRY(cpu_v6_switch_mm)
121 * 11x0 0 1 0 r/w r/o 122 * 11x0 0 1 0 r/w r/o
122 * 1111 0 1 1 r/w r/w 123 * 1111 0 1 1 r/w r/w
123 */ 124 */
124ENTRY(cpu_v6_set_pte) 125ENTRY(cpu_v6_set_pte_ext)
125#ifdef CONFIG_MMU 126#ifdef CONFIG_MMU
126 str r1, [r0], #-2048 @ linux version 127 str r1, [r0], #-2048 @ linux version
127 128
128 bic r2, r1, #0x000003f0 129 bic r3, r1, #0x000003f0
129 bic r2, r2, #0x00000003 130 bic r3, r3, #0x00000003
130 orr r2, r2, #PTE_EXT_AP0 | 2 131 orr r3, r3, r2
132 orr r3, r3, #PTE_EXT_AP0 | 2
131 133
132 tst r1, #L_PTE_WRITE 134 tst r1, #L_PTE_WRITE
133 tstne r1, #L_PTE_DIRTY 135 tstne r1, #L_PTE_DIRTY
134 orreq r2, r2, #PTE_EXT_APX 136 orreq r3, r3, #PTE_EXT_APX
135 137
136 tst r1, #L_PTE_USER 138 tst r1, #L_PTE_USER
137 orrne r2, r2, #PTE_EXT_AP1 139 orrne r3, r3, #PTE_EXT_AP1
138 tstne r2, #PTE_EXT_APX 140 tstne r3, #PTE_EXT_APX
139 bicne r2, r2, #PTE_EXT_APX | PTE_EXT_AP0 141 bicne r3, r3, #PTE_EXT_APX | PTE_EXT_AP0
140 142
141 tst r1, #L_PTE_YOUNG 143 tst r1, #L_PTE_YOUNG
142 biceq r2, r2, #PTE_EXT_APX | PTE_EXT_AP_MASK 144 biceq r3, r3, #PTE_EXT_APX | PTE_EXT_AP_MASK
143 145
144 tst r1, #L_PTE_EXEC 146 tst r1, #L_PTE_EXEC
145 orreq r2, r2, #PTE_EXT_XN 147 orreq r3, r3, #PTE_EXT_XN
146 148
147 tst r1, #L_PTE_PRESENT 149 tst r1, #L_PTE_PRESENT
148 moveq r2, #0 150 moveq r3, #0
149 151
150 str r2, [r0] 152 str r3, [r0]
151 mcr p15, 0, r0, c7, c10, 1 @ flush_pte 153 mcr p15, 0, r0, c7, c10, 1 @ flush_pte
152#endif 154#endif
153 mov pc, lr 155 mov pc, lr
@@ -156,7 +158,7 @@ ENTRY(cpu_v6_set_pte)
156 158
157 159
158cpu_v6_name: 160cpu_v6_name:
159 .asciz "Some Random V6 Processor" 161 .asciz "ARMv6-compatible processor"
160 .align 162 .align
161 163
162 .section ".text.init", #alloc, #execinstr 164 .section ".text.init", #alloc, #execinstr
@@ -207,11 +209,6 @@ __v6_setup:
207#endif 209#endif
208 mcr p15, 0, r4, c2, c0, 1 @ load TTB1 210 mcr p15, 0, r4, c2, c0, 1 @ load TTB1
209#endif /* CONFIG_MMU */ 211#endif /* CONFIG_MMU */
210#ifdef CONFIG_VFP
211 mrc p15, 0, r0, c1, c0, 2
212 orr r0, r0, #(0xf << 20)
213 mcr p15, 0, r0, c1, c0, 2 @ Enable full access to VFP
214#endif
215 adr r5, v6_crval 212 adr r5, v6_crval
216 ldmia r5, {r5, r6} 213 ldmia r5, {r5, r6}
217 mrc p15, 0, r0, c1, c0, 0 @ read control register 214 mrc p15, 0, r0, c1, c0, 0 @ read control register
@@ -238,7 +235,7 @@ ENTRY(v6_processor_functions)
238 .word cpu_v6_do_idle 235 .word cpu_v6_do_idle
239 .word cpu_v6_dcache_clean_area 236 .word cpu_v6_dcache_clean_area
240 .word cpu_v6_switch_mm 237 .word cpu_v6_switch_mm
241 .word cpu_v6_set_pte 238 .word cpu_v6_set_pte_ext
242 .size v6_processor_functions, . - v6_processor_functions 239 .size v6_processor_functions, . - v6_processor_functions
243 240
244 .type cpu_arch_name, #object 241 .type cpu_arch_name, #object
@@ -273,7 +270,7 @@ __v6_proc_info:
273 b __v6_setup 270 b __v6_setup
274 .long cpu_arch_name 271 .long cpu_arch_name
275 .long cpu_elf_name 272 .long cpu_elf_name
276 .long HWCAP_SWP|HWCAP_HALF|HWCAP_THUMB|HWCAP_FAST_MULT|HWCAP_VFP|HWCAP_EDSP|HWCAP_JAVA 273 .long HWCAP_SWP|HWCAP_HALF|HWCAP_THUMB|HWCAP_FAST_MULT|HWCAP_EDSP|HWCAP_JAVA
277 .long cpu_v6_name 274 .long cpu_v6_name
278 .long v6_processor_functions 275 .long v6_processor_functions
279 .long v6wbi_tlb_fns 276 .long v6wbi_tlb_fns