aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mm/proc-v7.S
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mm/proc-v7.S')
-rw-r--r--arch/arm/mm/proc-v7.S29
1 files changed, 12 insertions, 17 deletions
diff --git a/arch/arm/mm/proc-v7.S b/arch/arm/mm/proc-v7.S
index a67e26f3dce2..34e424041927 100644
--- a/arch/arm/mm/proc-v7.S
+++ b/arch/arm/mm/proc-v7.S
@@ -12,7 +12,7 @@
12#include <linux/linkage.h> 12#include <linux/linkage.h>
13#include <asm/assembler.h> 13#include <asm/assembler.h>
14#include <asm/asm-offsets.h> 14#include <asm/asm-offsets.h>
15#include <asm/elf.h> 15#include <asm/hwcap.h>
16#include <asm/pgtable-hwdef.h> 16#include <asm/pgtable-hwdef.h>
17#include <asm/pgtable.h> 17#include <asm/pgtable.h>
18 18
@@ -105,26 +105,19 @@ ENDPROC(cpu_v7_switch_mm)
105 * (hardware version is stored at -1024 bytes) 105 * (hardware version is stored at -1024 bytes)
106 * - pte - PTE value to store 106 * - pte - PTE value to store
107 * - ext - value for extended PTE bits 107 * - ext - value for extended PTE bits
108 *
109 * Permissions:
110 * YUWD APX AP1 AP0 SVC User
111 * 0xxx 0 0 0 no acc no acc
112 * 100x 1 0 1 r/o no acc
113 * 10x0 1 0 1 r/o no acc
114 * 1011 0 0 1 r/w no acc
115 * 110x 0 1 0 r/w r/o
116 * 11x0 0 1 0 r/w r/o
117 * 1111 0 1 1 r/w r/w
118 */ 108 */
119ENTRY(cpu_v7_set_pte_ext) 109ENTRY(cpu_v7_set_pte_ext)
120#ifdef CONFIG_MMU 110#ifdef CONFIG_MMU
121 str r1, [r0], #-2048 @ linux version 111 str r1, [r0], #-2048 @ linux version
122 112
123 bic r3, r1, #0x000003f0 113 bic r3, r1, #0x000003f0
124 bic r3, r3, #0x00000003 114 bic r3, r3, #PTE_TYPE_MASK
125 orr r3, r3, r2 115 orr r3, r3, r2
126 orr r3, r3, #PTE_EXT_AP0 | 2 116 orr r3, r3, #PTE_EXT_AP0 | 2
127 117
118 tst r2, #1 << 4
119 orrne r3, r3, #PTE_EXT_TEX(1)
120
128 tst r1, #L_PTE_WRITE 121 tst r1, #L_PTE_WRITE
129 tstne r1, #L_PTE_DIRTY 122 tstne r1, #L_PTE_DIRTY
130 orreq r3, r3, #PTE_EXT_APX 123 orreq r3, r3, #PTE_EXT_APX
@@ -134,13 +127,11 @@ ENTRY(cpu_v7_set_pte_ext)
134 tstne r3, #PTE_EXT_APX 127 tstne r3, #PTE_EXT_APX
135 bicne r3, r3, #PTE_EXT_APX | PTE_EXT_AP0 128 bicne r3, r3, #PTE_EXT_APX | PTE_EXT_AP0
136 129
137 tst r1, #L_PTE_YOUNG
138 biceq r3, r3, #PTE_EXT_APX | PTE_EXT_AP_MASK
139
140 tst r1, #L_PTE_EXEC 130 tst r1, #L_PTE_EXEC
141 orreq r3, r3, #PTE_EXT_XN 131 orreq r3, r3, #PTE_EXT_XN
142 132
143 tst r1, #L_PTE_PRESENT 133 tst r1, #L_PTE_YOUNG
134 tstne r1, #L_PTE_PRESENT
144 moveq r3, #0 135 moveq r3, #0
145 136
146 str r3, [r0] 137 str r3, [r0]
@@ -189,6 +180,10 @@ __v7_setup:
189 mov r10, #0x1f @ domains 0, 1 = manager 180 mov r10, #0x1f @ domains 0, 1 = manager
190 mcr p15, 0, r10, c3, c0, 0 @ load domain access register 181 mcr p15, 0, r10, c3, c0, 0 @ load domain access register
191#endif 182#endif
183 ldr r5, =0x40e040e0
184 ldr r6, =0xff0aa1a8
185 mcr p15, 0, r5, c10, c2, 0 @ write PRRR
186 mcr p15, 0, r6, c10, c2, 1 @ write NMRR
192 adr r5, v7_crval 187 adr r5, v7_crval
193 ldmia r5, {r5, r6} 188 ldmia r5, {r5, r6}
194 mrc p15, 0, r0, c1, c0, 0 @ read control register 189 mrc p15, 0, r0, c1, c0, 0 @ read control register
@@ -205,7 +200,7 @@ ENDPROC(__v7_setup)
205 */ 200 */
206 .type v7_crval, #object 201 .type v7_crval, #object
207v7_crval: 202v7_crval:
208 crval clear=0x0120c302, mmuset=0x00c0387d, ucset=0x00c0187c 203 crval clear=0x0120c302, mmuset=0x10c0387d, ucset=0x00c0187c
209 204
210__v7_setup_stack: 205__v7_setup_stack:
211 .space 4 * 11 @ 11 registers 206 .space 4 * 11 @ 11 registers