diff options
Diffstat (limited to 'arch')
64 files changed, 1028 insertions, 225 deletions
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 3d1a3fb7d5fc..f123c7c9fc98 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig | |||
@@ -188,23 +188,27 @@ config ARCH_IMX | |||
188 | 188 | ||
189 | config ARCH_IOP3XX | 189 | config ARCH_IOP3XX |
190 | bool "IOP3xx-based" | 190 | bool "IOP3xx-based" |
191 | depends on MMU | ||
191 | select PCI | 192 | select PCI |
192 | help | 193 | help |
193 | Support for Intel's IOP3XX (XScale) family of processors. | 194 | Support for Intel's IOP3XX (XScale) family of processors. |
194 | 195 | ||
195 | config ARCH_IXP4XX | 196 | config ARCH_IXP4XX |
196 | bool "IXP4xx-based" | 197 | bool "IXP4xx-based" |
198 | depends on MMU | ||
197 | help | 199 | help |
198 | Support for Intel's IXP4XX (XScale) family of processors. | 200 | Support for Intel's IXP4XX (XScale) family of processors. |
199 | 201 | ||
200 | config ARCH_IXP2000 | 202 | config ARCH_IXP2000 |
201 | bool "IXP2400/2800-based" | 203 | bool "IXP2400/2800-based" |
204 | depends on MMU | ||
202 | select PCI | 205 | select PCI |
203 | help | 206 | help |
204 | Support for Intel's IXP2400/2800 (XScale) family of processors. | 207 | Support for Intel's IXP2400/2800 (XScale) family of processors. |
205 | 208 | ||
206 | config ARCH_IXP23XX | 209 | config ARCH_IXP23XX |
207 | bool "IXP23XX-based" | 210 | bool "IXP23XX-based" |
211 | depends on MMU | ||
208 | select PCI | 212 | select PCI |
209 | help | 213 | help |
210 | Support for Intel's IXP23xx (XScale) family of processors. | 214 | Support for Intel's IXP23xx (XScale) family of processors. |
@@ -229,6 +233,7 @@ config ARCH_PNX4008 | |||
229 | 233 | ||
230 | config ARCH_PXA | 234 | config ARCH_PXA |
231 | bool "PXA2xx-based" | 235 | bool "PXA2xx-based" |
236 | depends on MMU | ||
232 | select ARCH_MTD_XIP | 237 | select ARCH_MTD_XIP |
233 | help | 238 | help |
234 | Support for Intel's PXA2XX processor line. | 239 | Support for Intel's PXA2XX processor line. |
@@ -339,6 +344,10 @@ config XSCALE_PMU | |||
339 | depends on CPU_XSCALE && !XSCALE_PMU_TIMER | 344 | depends on CPU_XSCALE && !XSCALE_PMU_TIMER |
340 | default y | 345 | default y |
341 | 346 | ||
347 | if !MMU | ||
348 | source "arch/arm/Kconfig-nommu" | ||
349 | endif | ||
350 | |||
342 | endmenu | 351 | endmenu |
343 | 352 | ||
344 | source "arch/arm/common/Kconfig" | 353 | source "arch/arm/common/Kconfig" |
diff --git a/arch/arm/kernel/Makefile b/arch/arm/kernel/Makefile index a601b8b55f35..7cffbaef064b 100644 --- a/arch/arm/kernel/Makefile +++ b/arch/arm/kernel/Makefile | |||
@@ -22,6 +22,9 @@ obj-$(CONFIG_PCI) += bios32.o | |||
22 | obj-$(CONFIG_SMP) += smp.o | 22 | obj-$(CONFIG_SMP) += smp.o |
23 | obj-$(CONFIG_OABI_COMPAT) += sys_oabi-compat.o | 23 | obj-$(CONFIG_OABI_COMPAT) += sys_oabi-compat.o |
24 | 24 | ||
25 | obj-$(CONFIG_CRUNCH) += crunch.o crunch-bits.o | ||
26 | AFLAGS_crunch-bits.o := -Wa,-mcpu=ep9312 | ||
27 | |||
25 | obj-$(CONFIG_IWMMXT) += iwmmxt.o | 28 | obj-$(CONFIG_IWMMXT) += iwmmxt.o |
26 | AFLAGS_iwmmxt.o := -Wa,-mcpu=iwmmxt | 29 | AFLAGS_iwmmxt.o := -Wa,-mcpu=iwmmxt |
27 | 30 | ||
diff --git a/arch/arm/kernel/armksyms.c b/arch/arm/kernel/armksyms.c index c49b5d4d7fca..da69e660574b 100644 --- a/arch/arm/kernel/armksyms.c +++ b/arch/arm/kernel/armksyms.c | |||
@@ -109,11 +109,13 @@ EXPORT_SYMBOL(memchr); | |||
109 | EXPORT_SYMBOL(__memzero); | 109 | EXPORT_SYMBOL(__memzero); |
110 | 110 | ||
111 | /* user mem (segment) */ | 111 | /* user mem (segment) */ |
112 | EXPORT_SYMBOL(__arch_copy_from_user); | 112 | EXPORT_SYMBOL(__strnlen_user); |
113 | EXPORT_SYMBOL(__arch_copy_to_user); | 113 | EXPORT_SYMBOL(__strncpy_from_user); |
114 | EXPORT_SYMBOL(__arch_clear_user); | 114 | |
115 | EXPORT_SYMBOL(__arch_strnlen_user); | 115 | #ifdef CONFIG_MMU |
116 | EXPORT_SYMBOL(__arch_strncpy_from_user); | 116 | EXPORT_SYMBOL(__copy_from_user); |
117 | EXPORT_SYMBOL(__copy_to_user); | ||
118 | EXPORT_SYMBOL(__clear_user); | ||
117 | 119 | ||
118 | EXPORT_SYMBOL(__get_user_1); | 120 | EXPORT_SYMBOL(__get_user_1); |
119 | EXPORT_SYMBOL(__get_user_2); | 121 | EXPORT_SYMBOL(__get_user_2); |
@@ -123,6 +125,7 @@ EXPORT_SYMBOL(__put_user_1); | |||
123 | EXPORT_SYMBOL(__put_user_2); | 125 | EXPORT_SYMBOL(__put_user_2); |
124 | EXPORT_SYMBOL(__put_user_4); | 126 | EXPORT_SYMBOL(__put_user_4); |
125 | EXPORT_SYMBOL(__put_user_8); | 127 | EXPORT_SYMBOL(__put_user_8); |
128 | #endif | ||
126 | 129 | ||
127 | /* crypto hash */ | 130 | /* crypto hash */ |
128 | EXPORT_SYMBOL(sha_transform); | 131 | EXPORT_SYMBOL(sha_transform); |
diff --git a/arch/arm/kernel/asm-offsets.c b/arch/arm/kernel/asm-offsets.c index 396efba9bacd..447ede5143a8 100644 --- a/arch/arm/kernel/asm-offsets.c +++ b/arch/arm/kernel/asm-offsets.c | |||
@@ -60,6 +60,9 @@ int main(void) | |||
60 | #ifdef CONFIG_IWMMXT | 60 | #ifdef CONFIG_IWMMXT |
61 | DEFINE(TI_IWMMXT_STATE, offsetof(struct thread_info, fpstate.iwmmxt)); | 61 | DEFINE(TI_IWMMXT_STATE, offsetof(struct thread_info, fpstate.iwmmxt)); |
62 | #endif | 62 | #endif |
63 | #ifdef CONFIG_CRUNCH | ||
64 | DEFINE(TI_CRUNCH_STATE, offsetof(struct thread_info, crunchstate)); | ||
65 | #endif | ||
63 | BLANK(); | 66 | BLANK(); |
64 | DEFINE(S_R0, offsetof(struct pt_regs, ARM_r0)); | 67 | DEFINE(S_R0, offsetof(struct pt_regs, ARM_r0)); |
65 | DEFINE(S_R1, offsetof(struct pt_regs, ARM_r1)); | 68 | DEFINE(S_R1, offsetof(struct pt_regs, ARM_r1)); |
diff --git a/arch/arm/kernel/crunch-bits.S b/arch/arm/kernel/crunch-bits.S new file mode 100644 index 000000000000..a26886758c67 --- /dev/null +++ b/arch/arm/kernel/crunch-bits.S | |||
@@ -0,0 +1,305 @@ | |||
1 | /* | ||
2 | * arch/arm/kernel/crunch-bits.S | ||
3 | * Cirrus MaverickCrunch context switching and handling | ||
4 | * | ||
5 | * Copyright (C) 2006 Lennert Buytenhek <buytenh@wantstofly.org> | ||
6 | * | ||
7 | * Shamelessly stolen from the iWMMXt code by Nicolas Pitre, which is | ||
8 | * Copyright (c) 2003-2004, MontaVista Software, Inc. | ||
9 | * | ||
10 | * This program is free software; you can redistribute it and/or modify | ||
11 | * it under the terms of the GNU General Public License version 2 as | ||
12 | * published by the Free Software Foundation. | ||
13 | */ | ||
14 | |||
15 | #include <linux/linkage.h> | ||
16 | #include <asm/ptrace.h> | ||
17 | #include <asm/thread_info.h> | ||
18 | #include <asm/asm-offsets.h> | ||
19 | #include <asm/arch/ep93xx-regs.h> | ||
20 | |||
21 | /* | ||
22 | * We can't use hex constants here due to a bug in gas. | ||
23 | */ | ||
24 | #define CRUNCH_MVDX0 0 | ||
25 | #define CRUNCH_MVDX1 8 | ||
26 | #define CRUNCH_MVDX2 16 | ||
27 | #define CRUNCH_MVDX3 24 | ||
28 | #define CRUNCH_MVDX4 32 | ||
29 | #define CRUNCH_MVDX5 40 | ||
30 | #define CRUNCH_MVDX6 48 | ||
31 | #define CRUNCH_MVDX7 56 | ||
32 | #define CRUNCH_MVDX8 64 | ||
33 | #define CRUNCH_MVDX9 72 | ||
34 | #define CRUNCH_MVDX10 80 | ||
35 | #define CRUNCH_MVDX11 88 | ||
36 | #define CRUNCH_MVDX12 96 | ||
37 | #define CRUNCH_MVDX13 104 | ||
38 | #define CRUNCH_MVDX14 112 | ||
39 | #define CRUNCH_MVDX15 120 | ||
40 | #define CRUNCH_MVAX0L 128 | ||
41 | #define CRUNCH_MVAX0M 132 | ||
42 | #define CRUNCH_MVAX0H 136 | ||
43 | #define CRUNCH_MVAX1L 140 | ||
44 | #define CRUNCH_MVAX1M 144 | ||
45 | #define CRUNCH_MVAX1H 148 | ||
46 | #define CRUNCH_MVAX2L 152 | ||
47 | #define CRUNCH_MVAX2M 156 | ||
48 | #define CRUNCH_MVAX2H 160 | ||
49 | #define CRUNCH_MVAX3L 164 | ||
50 | #define CRUNCH_MVAX3M 168 | ||
51 | #define CRUNCH_MVAX3H 172 | ||
52 | #define CRUNCH_DSPSC 176 | ||
53 | |||
54 | #define CRUNCH_SIZE 184 | ||
55 | |||
56 | .text | ||
57 | |||
58 | /* | ||
59 | * Lazy switching of crunch coprocessor context | ||
60 | * | ||
61 | * r10 = struct thread_info pointer | ||
62 | * r9 = ret_from_exception | ||
63 | * lr = undefined instr exit | ||
64 | * | ||
65 | * called from prefetch exception handler with interrupts disabled | ||
66 | */ | ||
67 | ENTRY(crunch_task_enable) | ||
68 | ldr r8, =(EP93XX_APB_VIRT_BASE + 0x00130000) @ syscon addr | ||
69 | |||
70 | ldr r1, [r8, #0x80] | ||
71 | tst r1, #0x00800000 @ access to crunch enabled? | ||
72 | movne pc, lr @ if so no business here | ||
73 | mov r3, #0xaa @ unlock syscon swlock | ||
74 | str r3, [r8, #0xc0] | ||
75 | orr r1, r1, #0x00800000 @ enable access to crunch | ||
76 | str r1, [r8, #0x80] | ||
77 | |||
78 | ldr r3, =crunch_owner | ||
79 | add r0, r10, #TI_CRUNCH_STATE @ get task crunch save area | ||
80 | ldr r2, [sp, #60] @ current task pc value | ||
81 | ldr r1, [r3] @ get current crunch owner | ||
82 | str r0, [r3] @ this task now owns crunch | ||
83 | sub r2, r2, #4 @ adjust pc back | ||
84 | str r2, [sp, #60] | ||
85 | |||
86 | ldr r2, [r8, #0x80] | ||
87 | mov r2, r2 @ flush out enable (@@@) | ||
88 | |||
89 | teq r1, #0 @ test for last ownership | ||
90 | mov lr, r9 @ normal exit from exception | ||
91 | beq crunch_load @ no owner, skip save | ||
92 | |||
93 | crunch_save: | ||
94 | cfstr64 mvdx0, [r1, #CRUNCH_MVDX0] @ save 64b registers | ||
95 | cfstr64 mvdx1, [r1, #CRUNCH_MVDX1] | ||
96 | cfstr64 mvdx2, [r1, #CRUNCH_MVDX2] | ||
97 | cfstr64 mvdx3, [r1, #CRUNCH_MVDX3] | ||
98 | cfstr64 mvdx4, [r1, #CRUNCH_MVDX4] | ||
99 | cfstr64 mvdx5, [r1, #CRUNCH_MVDX5] | ||
100 | cfstr64 mvdx6, [r1, #CRUNCH_MVDX6] | ||
101 | cfstr64 mvdx7, [r1, #CRUNCH_MVDX7] | ||
102 | cfstr64 mvdx8, [r1, #CRUNCH_MVDX8] | ||
103 | cfstr64 mvdx9, [r1, #CRUNCH_MVDX9] | ||
104 | cfstr64 mvdx10, [r1, #CRUNCH_MVDX10] | ||
105 | cfstr64 mvdx11, [r1, #CRUNCH_MVDX11] | ||
106 | cfstr64 mvdx12, [r1, #CRUNCH_MVDX12] | ||
107 | cfstr64 mvdx13, [r1, #CRUNCH_MVDX13] | ||
108 | cfstr64 mvdx14, [r1, #CRUNCH_MVDX14] | ||
109 | cfstr64 mvdx15, [r1, #CRUNCH_MVDX15] | ||
110 | |||
111 | #ifdef __ARMEB__ | ||
112 | #error fix me for ARMEB | ||
113 | #endif | ||
114 | |||
115 | cfmv32al mvfx0, mvax0 @ save 72b accumulators | ||
116 | cfstr32 mvfx0, [r1, #CRUNCH_MVAX0L] | ||
117 | cfmv32am mvfx0, mvax0 | ||
118 | cfstr32 mvfx0, [r1, #CRUNCH_MVAX0M] | ||
119 | cfmv32ah mvfx0, mvax0 | ||
120 | cfstr32 mvfx0, [r1, #CRUNCH_MVAX0H] | ||
121 | cfmv32al mvfx0, mvax1 | ||
122 | cfstr32 mvfx0, [r1, #CRUNCH_MVAX1L] | ||
123 | cfmv32am mvfx0, mvax1 | ||
124 | cfstr32 mvfx0, [r1, #CRUNCH_MVAX1M] | ||
125 | cfmv32ah mvfx0, mvax1 | ||
126 | cfstr32 mvfx0, [r1, #CRUNCH_MVAX1H] | ||
127 | cfmv32al mvfx0, mvax2 | ||
128 | cfstr32 mvfx0, [r1, #CRUNCH_MVAX2L] | ||
129 | cfmv32am mvfx0, mvax2 | ||
130 | cfstr32 mvfx0, [r1, #CRUNCH_MVAX2M] | ||
131 | cfmv32ah mvfx0, mvax2 | ||
132 | cfstr32 mvfx0, [r1, #CRUNCH_MVAX2H] | ||
133 | cfmv32al mvfx0, mvax3 | ||
134 | cfstr32 mvfx0, [r1, #CRUNCH_MVAX3L] | ||
135 | cfmv32am mvfx0, mvax3 | ||
136 | cfstr32 mvfx0, [r1, #CRUNCH_MVAX3M] | ||
137 | cfmv32ah mvfx0, mvax3 | ||
138 | cfstr32 mvfx0, [r1, #CRUNCH_MVAX3H] | ||
139 | |||
140 | cfmv32sc mvdx0, dspsc @ save status word | ||
141 | cfstr64 mvdx0, [r1, #CRUNCH_DSPSC] | ||
142 | |||
143 | teq r0, #0 @ anything to load? | ||
144 | cfldr64eq mvdx0, [r1, #CRUNCH_MVDX0] @ mvdx0 was clobbered | ||
145 | moveq pc, lr | ||
146 | |||
147 | crunch_load: | ||
148 | cfldr64 mvdx0, [r0, #CRUNCH_DSPSC] @ load status word | ||
149 | cfmvsc32 dspsc, mvdx0 | ||
150 | |||
151 | cfldr32 mvfx0, [r0, #CRUNCH_MVAX0L] @ load 72b accumulators | ||
152 | cfmval32 mvax0, mvfx0 | ||
153 | cfldr32 mvfx0, [r0, #CRUNCH_MVAX0M] | ||
154 | cfmvam32 mvax0, mvfx0 | ||
155 | cfldr32 mvfx0, [r0, #CRUNCH_MVAX0H] | ||
156 | cfmvah32 mvax0, mvfx0 | ||
157 | cfldr32 mvfx0, [r0, #CRUNCH_MVAX1L] | ||
158 | cfmval32 mvax1, mvfx0 | ||
159 | cfldr32 mvfx0, [r0, #CRUNCH_MVAX1M] | ||
160 | cfmvam32 mvax1, mvfx0 | ||
161 | cfldr32 mvfx0, [r0, #CRUNCH_MVAX1H] | ||
162 | cfmvah32 mvax1, mvfx0 | ||
163 | cfldr32 mvfx0, [r0, #CRUNCH_MVAX2L] | ||
164 | cfmval32 mvax2, mvfx0 | ||
165 | cfldr32 mvfx0, [r0, #CRUNCH_MVAX2M] | ||
166 | cfmvam32 mvax2, mvfx0 | ||
167 | cfldr32 mvfx0, [r0, #CRUNCH_MVAX2H] | ||
168 | cfmvah32 mvax2, mvfx0 | ||
169 | cfldr32 mvfx0, [r0, #CRUNCH_MVAX3L] | ||
170 | cfmval32 mvax3, mvfx0 | ||
171 | cfldr32 mvfx0, [r0, #CRUNCH_MVAX3M] | ||
172 | cfmvam32 mvax3, mvfx0 | ||
173 | cfldr32 mvfx0, [r0, #CRUNCH_MVAX3H] | ||
174 | cfmvah32 mvax3, mvfx0 | ||
175 | |||
176 | cfldr64 mvdx0, [r0, #CRUNCH_MVDX0] @ load 64b registers | ||
177 | cfldr64 mvdx1, [r0, #CRUNCH_MVDX1] | ||
178 | cfldr64 mvdx2, [r0, #CRUNCH_MVDX2] | ||
179 | cfldr64 mvdx3, [r0, #CRUNCH_MVDX3] | ||
180 | cfldr64 mvdx4, [r0, #CRUNCH_MVDX4] | ||
181 | cfldr64 mvdx5, [r0, #CRUNCH_MVDX5] | ||
182 | cfldr64 mvdx6, [r0, #CRUNCH_MVDX6] | ||
183 | cfldr64 mvdx7, [r0, #CRUNCH_MVDX7] | ||
184 | cfldr64 mvdx8, [r0, #CRUNCH_MVDX8] | ||
185 | cfldr64 mvdx9, [r0, #CRUNCH_MVDX9] | ||
186 | cfldr64 mvdx10, [r0, #CRUNCH_MVDX10] | ||
187 | cfldr64 mvdx11, [r0, #CRUNCH_MVDX11] | ||
188 | cfldr64 mvdx12, [r0, #CRUNCH_MVDX12] | ||
189 | cfldr64 mvdx13, [r0, #CRUNCH_MVDX13] | ||
190 | cfldr64 mvdx14, [r0, #CRUNCH_MVDX14] | ||
191 | cfldr64 mvdx15, [r0, #CRUNCH_MVDX15] | ||
192 | |||
193 | mov pc, lr | ||
194 | |||
195 | /* | ||
196 | * Back up crunch regs to save area and disable access to them | ||
197 | * (mainly for gdb or sleep mode usage) | ||
198 | * | ||
199 | * r0 = struct thread_info pointer of target task or NULL for any | ||
200 | */ | ||
201 | ENTRY(crunch_task_disable) | ||
202 | stmfd sp!, {r4, r5, lr} | ||
203 | |||
204 | mrs ip, cpsr | ||
205 | orr r2, ip, #PSR_I_BIT @ disable interrupts | ||
206 | msr cpsr_c, r2 | ||
207 | |||
208 | ldr r4, =(EP93XX_APB_VIRT_BASE + 0x00130000) @ syscon addr | ||
209 | |||
210 | ldr r3, =crunch_owner | ||
211 | add r2, r0, #TI_CRUNCH_STATE @ get task crunch save area | ||
212 | ldr r1, [r3] @ get current crunch owner | ||
213 | teq r1, #0 @ any current owner? | ||
214 | beq 1f @ no: quit | ||
215 | teq r0, #0 @ any owner? | ||
216 | teqne r1, r2 @ or specified one? | ||
217 | bne 1f @ no: quit | ||
218 | |||
219 | ldr r5, [r4, #0x80] @ enable access to crunch | ||
220 | mov r2, #0xaa | ||
221 | str r2, [r4, #0xc0] | ||
222 | orr r5, r5, #0x00800000 | ||
223 | str r5, [r4, #0x80] | ||
224 | |||
225 | mov r0, #0 @ nothing to load | ||
226 | str r0, [r3] @ no more current owner | ||
227 | ldr r2, [r4, #0x80] @ flush out enable (@@@) | ||
228 | mov r2, r2 | ||
229 | bl crunch_save | ||
230 | |||
231 | mov r2, #0xaa @ disable access to crunch | ||
232 | str r2, [r4, #0xc0] | ||
233 | bic r5, r5, #0x00800000 | ||
234 | str r5, [r4, #0x80] | ||
235 | ldr r5, [r4, #0x80] @ flush out enable (@@@) | ||
236 | mov r5, r5 | ||
237 | |||
238 | 1: msr cpsr_c, ip @ restore interrupt mode | ||
239 | ldmfd sp!, {r4, r5, pc} | ||
240 | |||
241 | /* | ||
242 | * Copy crunch state to given memory address | ||
243 | * | ||
244 | * r0 = struct thread_info pointer of target task | ||
245 | * r1 = memory address where to store crunch state | ||
246 | * | ||
247 | * this is called mainly in the creation of signal stack frames | ||
248 | */ | ||
249 | ENTRY(crunch_task_copy) | ||
250 | mrs ip, cpsr | ||
251 | orr r2, ip, #PSR_I_BIT @ disable interrupts | ||
252 | msr cpsr_c, r2 | ||
253 | |||
254 | ldr r3, =crunch_owner | ||
255 | add r2, r0, #TI_CRUNCH_STATE @ get task crunch save area | ||
256 | ldr r3, [r3] @ get current crunch owner | ||
257 | teq r2, r3 @ does this task own it... | ||
258 | beq 1f | ||
259 | |||
260 | @ current crunch values are in the task save area | ||
261 | msr cpsr_c, ip @ restore interrupt mode | ||
262 | mov r0, r1 | ||
263 | mov r1, r2 | ||
264 | mov r2, #CRUNCH_SIZE | ||
265 | b memcpy | ||
266 | |||
267 | 1: @ this task owns crunch regs -- grab a copy from there | ||
268 | mov r0, #0 @ nothing to load | ||
269 | mov r3, lr @ preserve return address | ||
270 | bl crunch_save | ||
271 | msr cpsr_c, ip @ restore interrupt mode | ||
272 | mov pc, r3 | ||
273 | |||
274 | /* | ||
275 | * Restore crunch state from given memory address | ||
276 | * | ||
277 | * r0 = struct thread_info pointer of target task | ||
278 | * r1 = memory address where to get crunch state from | ||
279 | * | ||
280 | * this is used to restore crunch state when unwinding a signal stack frame | ||
281 | */ | ||
282 | ENTRY(crunch_task_restore) | ||
283 | mrs ip, cpsr | ||
284 | orr r2, ip, #PSR_I_BIT @ disable interrupts | ||
285 | msr cpsr_c, r2 | ||
286 | |||
287 | ldr r3, =crunch_owner | ||
288 | add r2, r0, #TI_CRUNCH_STATE @ get task crunch save area | ||
289 | ldr r3, [r3] @ get current crunch owner | ||
290 | teq r2, r3 @ does this task own it... | ||
291 | beq 1f | ||
292 | |||
293 | @ this task doesn't own crunch regs -- use its save area | ||
294 | msr cpsr_c, ip @ restore interrupt mode | ||
295 | mov r0, r2 | ||
296 | mov r2, #CRUNCH_SIZE | ||
297 | b memcpy | ||
298 | |||
299 | 1: @ this task owns crunch regs -- load them directly | ||
300 | mov r0, r1 | ||
301 | mov r1, #0 @ nothing to save | ||
302 | mov r3, lr @ preserve return address | ||
303 | bl crunch_load | ||
304 | msr cpsr_c, ip @ restore interrupt mode | ||
305 | mov pc, r3 | ||
diff --git a/arch/arm/kernel/crunch.c b/arch/arm/kernel/crunch.c new file mode 100644 index 000000000000..748175921f9b --- /dev/null +++ b/arch/arm/kernel/crunch.c | |||
@@ -0,0 +1,83 @@ | |||
1 | /* | ||
2 | * arch/arm/kernel/crunch.c | ||
3 | * Cirrus MaverickCrunch context switching and handling | ||
4 | * | ||
5 | * Copyright (C) 2006 Lennert Buytenhek <buytenh@wantstofly.org> | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License version 2 as | ||
9 | * published by the Free Software Foundation. | ||
10 | */ | ||
11 | |||
12 | #include <linux/module.h> | ||
13 | #include <linux/config.h> | ||
14 | #include <linux/types.h> | ||
15 | #include <linux/kernel.h> | ||
16 | #include <linux/signal.h> | ||
17 | #include <linux/sched.h> | ||
18 | #include <linux/init.h> | ||
19 | #include <asm/arch/ep93xx-regs.h> | ||
20 | #include <asm/thread_notify.h> | ||
21 | #include <asm/io.h> | ||
22 | |||
23 | struct crunch_state *crunch_owner; | ||
24 | |||
25 | void crunch_task_release(struct thread_info *thread) | ||
26 | { | ||
27 | local_irq_disable(); | ||
28 | if (crunch_owner == &thread->crunchstate) | ||
29 | crunch_owner = NULL; | ||
30 | local_irq_enable(); | ||
31 | } | ||
32 | |||
33 | static int crunch_enabled(u32 devcfg) | ||
34 | { | ||
35 | return !!(devcfg & EP93XX_SYSCON_DEVICE_CONFIG_CRUNCH_ENABLE); | ||
36 | } | ||
37 | |||
38 | static int crunch_do(struct notifier_block *self, unsigned long cmd, void *t) | ||
39 | { | ||
40 | struct thread_info *thread = (struct thread_info *)t; | ||
41 | struct crunch_state *crunch_state; | ||
42 | u32 devcfg; | ||
43 | |||
44 | crunch_state = &thread->crunchstate; | ||
45 | |||
46 | switch (cmd) { | ||
47 | case THREAD_NOTIFY_FLUSH: | ||
48 | memset(crunch_state, 0, sizeof(*crunch_state)); | ||
49 | |||
50 | /* | ||
51 | * FALLTHROUGH: Ensure we don't try to overwrite our newly | ||
52 | * initialised state information on the first fault. | ||
53 | */ | ||
54 | |||
55 | case THREAD_NOTIFY_RELEASE: | ||
56 | crunch_task_release(thread); | ||
57 | break; | ||
58 | |||
59 | case THREAD_NOTIFY_SWITCH: | ||
60 | devcfg = __raw_readl(EP93XX_SYSCON_DEVICE_CONFIG); | ||
61 | if (crunch_enabled(devcfg) || crunch_owner == crunch_state) { | ||
62 | devcfg ^= EP93XX_SYSCON_DEVICE_CONFIG_CRUNCH_ENABLE; | ||
63 | __raw_writel(0xaa, EP93XX_SYSCON_SWLOCK); | ||
64 | __raw_writel(devcfg, EP93XX_SYSCON_DEVICE_CONFIG); | ||
65 | } | ||
66 | break; | ||
67 | } | ||
68 | |||
69 | return NOTIFY_DONE; | ||
70 | } | ||
71 | |||
72 | static struct notifier_block crunch_notifier_block = { | ||
73 | .notifier_call = crunch_do, | ||
74 | }; | ||
75 | |||
76 | static int __init crunch_init(void) | ||
77 | { | ||
78 | thread_register_notifier(&crunch_notifier_block); | ||
79 | |||
80 | return 0; | ||
81 | } | ||
82 | |||
83 | late_initcall(crunch_init); | ||
diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S index 86c92523a346..6423a38839b8 100644 --- a/arch/arm/kernel/entry-armv.S +++ b/arch/arm/kernel/entry-armv.S | |||
@@ -492,9 +492,15 @@ call_fpe: | |||
492 | b do_fpe @ CP#1 (FPE) | 492 | b do_fpe @ CP#1 (FPE) |
493 | b do_fpe @ CP#2 (FPE) | 493 | b do_fpe @ CP#2 (FPE) |
494 | mov pc, lr @ CP#3 | 494 | mov pc, lr @ CP#3 |
495 | #ifdef CONFIG_CRUNCH | ||
496 | b crunch_task_enable @ CP#4 (MaverickCrunch) | ||
497 | b crunch_task_enable @ CP#5 (MaverickCrunch) | ||
498 | b crunch_task_enable @ CP#6 (MaverickCrunch) | ||
499 | #else | ||
495 | mov pc, lr @ CP#4 | 500 | mov pc, lr @ CP#4 |
496 | mov pc, lr @ CP#5 | 501 | mov pc, lr @ CP#5 |
497 | mov pc, lr @ CP#6 | 502 | mov pc, lr @ CP#6 |
503 | #endif | ||
498 | mov pc, lr @ CP#7 | 504 | mov pc, lr @ CP#7 |
499 | mov pc, lr @ CP#8 | 505 | mov pc, lr @ CP#8 |
500 | mov pc, lr @ CP#9 | 506 | mov pc, lr @ CP#9 |
diff --git a/arch/arm/kernel/ptrace.c b/arch/arm/kernel/ptrace.c index a1d1b2906e8d..c40bdc770054 100644 --- a/arch/arm/kernel/ptrace.c +++ b/arch/arm/kernel/ptrace.c | |||
@@ -634,6 +634,32 @@ static int ptrace_setwmmxregs(struct task_struct *tsk, void __user *ufp) | |||
634 | 634 | ||
635 | #endif | 635 | #endif |
636 | 636 | ||
637 | #ifdef CONFIG_CRUNCH | ||
638 | /* | ||
639 | * Get the child Crunch state. | ||
640 | */ | ||
641 | static int ptrace_getcrunchregs(struct task_struct *tsk, void __user *ufp) | ||
642 | { | ||
643 | struct thread_info *thread = task_thread_info(tsk); | ||
644 | |||
645 | crunch_task_disable(thread); /* force it to ram */ | ||
646 | return copy_to_user(ufp, &thread->crunchstate, CRUNCH_SIZE) | ||
647 | ? -EFAULT : 0; | ||
648 | } | ||
649 | |||
650 | /* | ||
651 | * Set the child Crunch state. | ||
652 | */ | ||
653 | static int ptrace_setcrunchregs(struct task_struct *tsk, void __user *ufp) | ||
654 | { | ||
655 | struct thread_info *thread = task_thread_info(tsk); | ||
656 | |||
657 | crunch_task_release(thread); /* force a reload */ | ||
658 | return copy_from_user(&thread->crunchstate, ufp, CRUNCH_SIZE) | ||
659 | ? -EFAULT : 0; | ||
660 | } | ||
661 | #endif | ||
662 | |||
637 | long arch_ptrace(struct task_struct *child, long request, long addr, long data) | 663 | long arch_ptrace(struct task_struct *child, long request, long addr, long data) |
638 | { | 664 | { |
639 | unsigned long tmp; | 665 | unsigned long tmp; |
@@ -765,6 +791,16 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data) | |||
765 | child->ptrace_message = data; | 791 | child->ptrace_message = data; |
766 | break; | 792 | break; |
767 | 793 | ||
794 | #ifdef CONFIG_CRUNCH | ||
795 | case PTRACE_GETCRUNCHREGS: | ||
796 | ret = ptrace_getcrunchregs(child, (void __user *)data); | ||
797 | break; | ||
798 | |||
799 | case PTRACE_SETCRUNCHREGS: | ||
800 | ret = ptrace_setcrunchregs(child, (void __user *)data); | ||
801 | break; | ||
802 | #endif | ||
803 | |||
768 | default: | 804 | default: |
769 | ret = ptrace_request(child, request, addr, data); | 805 | ret = ptrace_request(child, request, addr, data); |
770 | break; | 806 | break; |
diff --git a/arch/arm/kernel/signal.c b/arch/arm/kernel/signal.c index 1ce05ec086c6..83a8d3c95eb3 100644 --- a/arch/arm/kernel/signal.c +++ b/arch/arm/kernel/signal.c | |||
@@ -132,6 +132,37 @@ sys_sigaction(int sig, const struct old_sigaction __user *act, | |||
132 | return ret; | 132 | return ret; |
133 | } | 133 | } |
134 | 134 | ||
135 | #ifdef CONFIG_CRUNCH | ||
136 | static int preserve_crunch_context(struct crunch_sigframe *frame) | ||
137 | { | ||
138 | char kbuf[sizeof(*frame) + 8]; | ||
139 | struct crunch_sigframe *kframe; | ||
140 | |||
141 | /* the crunch context must be 64 bit aligned */ | ||
142 | kframe = (struct crunch_sigframe *)((unsigned long)(kbuf + 8) & ~7); | ||
143 | kframe->magic = CRUNCH_MAGIC; | ||
144 | kframe->size = CRUNCH_STORAGE_SIZE; | ||
145 | crunch_task_copy(current_thread_info(), &kframe->storage); | ||
146 | return __copy_to_user(frame, kframe, sizeof(*frame)); | ||
147 | } | ||
148 | |||
149 | static int restore_crunch_context(struct crunch_sigframe *frame) | ||
150 | { | ||
151 | char kbuf[sizeof(*frame) + 8]; | ||
152 | struct crunch_sigframe *kframe; | ||
153 | |||
154 | /* the crunch context must be 64 bit aligned */ | ||
155 | kframe = (struct crunch_sigframe *)((unsigned long)(kbuf + 8) & ~7); | ||
156 | if (__copy_from_user(kframe, frame, sizeof(*frame))) | ||
157 | return -1; | ||
158 | if (kframe->magic != CRUNCH_MAGIC || | ||
159 | kframe->size != CRUNCH_STORAGE_SIZE) | ||
160 | return -1; | ||
161 | crunch_task_restore(current_thread_info(), &kframe->storage); | ||
162 | return 0; | ||
163 | } | ||
164 | #endif | ||
165 | |||
135 | #ifdef CONFIG_IWMMXT | 166 | #ifdef CONFIG_IWMMXT |
136 | 167 | ||
137 | static int preserve_iwmmxt_context(struct iwmmxt_sigframe *frame) | 168 | static int preserve_iwmmxt_context(struct iwmmxt_sigframe *frame) |
@@ -214,6 +245,10 @@ static int restore_sigframe(struct pt_regs *regs, struct sigframe __user *sf) | |||
214 | err |= !valid_user_regs(regs); | 245 | err |= !valid_user_regs(regs); |
215 | 246 | ||
216 | aux = (struct aux_sigframe __user *) sf->uc.uc_regspace; | 247 | aux = (struct aux_sigframe __user *) sf->uc.uc_regspace; |
248 | #ifdef CONFIG_CRUNCH | ||
249 | if (err == 0) | ||
250 | err |= restore_crunch_context(&aux->crunch); | ||
251 | #endif | ||
217 | #ifdef CONFIG_IWMMXT | 252 | #ifdef CONFIG_IWMMXT |
218 | if (err == 0 && test_thread_flag(TIF_USING_IWMMXT)) | 253 | if (err == 0 && test_thread_flag(TIF_USING_IWMMXT)) |
219 | err |= restore_iwmmxt_context(&aux->iwmmxt); | 254 | err |= restore_iwmmxt_context(&aux->iwmmxt); |
@@ -333,6 +368,10 @@ setup_sigframe(struct sigframe __user *sf, struct pt_regs *regs, sigset_t *set) | |||
333 | err |= __copy_to_user(&sf->uc.uc_sigmask, set, sizeof(*set)); | 368 | err |= __copy_to_user(&sf->uc.uc_sigmask, set, sizeof(*set)); |
334 | 369 | ||
335 | aux = (struct aux_sigframe __user *) sf->uc.uc_regspace; | 370 | aux = (struct aux_sigframe __user *) sf->uc.uc_regspace; |
371 | #ifdef CONFIG_CRUNCH | ||
372 | if (err == 0) | ||
373 | err |= preserve_crunch_context(&aux->crunch); | ||
374 | #endif | ||
336 | #ifdef CONFIG_IWMMXT | 375 | #ifdef CONFIG_IWMMXT |
337 | if (err == 0 && test_thread_flag(TIF_USING_IWMMXT)) | 376 | if (err == 0 && test_thread_flag(TIF_USING_IWMMXT)) |
338 | err |= preserve_iwmmxt_context(&aux->iwmmxt); | 377 | err |= preserve_iwmmxt_context(&aux->iwmmxt); |
diff --git a/arch/arm/kernel/vmlinux.lds.S b/arch/arm/kernel/vmlinux.lds.S index 2b254e88595c..2df9688a7028 100644 --- a/arch/arm/kernel/vmlinux.lds.S +++ b/arch/arm/kernel/vmlinux.lds.S | |||
@@ -80,6 +80,10 @@ SECTIONS | |||
80 | *(.exit.text) | 80 | *(.exit.text) |
81 | *(.exit.data) | 81 | *(.exit.data) |
82 | *(.exitcall.exit) | 82 | *(.exitcall.exit) |
83 | #ifndef CONFIG_MMU | ||
84 | *(.fixup) | ||
85 | *(__ex_table) | ||
86 | #endif | ||
83 | } | 87 | } |
84 | 88 | ||
85 | .text : { /* Real text segment */ | 89 | .text : { /* Real text segment */ |
@@ -87,7 +91,9 @@ SECTIONS | |||
87 | *(.text) | 91 | *(.text) |
88 | SCHED_TEXT | 92 | SCHED_TEXT |
89 | LOCK_TEXT | 93 | LOCK_TEXT |
94 | #ifdef CONFIG_MMU | ||
90 | *(.fixup) | 95 | *(.fixup) |
96 | #endif | ||
91 | *(.gnu.warning) | 97 | *(.gnu.warning) |
92 | *(.rodata) | 98 | *(.rodata) |
93 | *(.rodata.*) | 99 | *(.rodata.*) |
@@ -142,7 +148,9 @@ SECTIONS | |||
142 | */ | 148 | */ |
143 | . = ALIGN(32); | 149 | . = ALIGN(32); |
144 | __start___ex_table = .; | 150 | __start___ex_table = .; |
151 | #ifdef CONFIG_MMU | ||
145 | *(__ex_table) | 152 | *(__ex_table) |
153 | #endif | ||
146 | __stop___ex_table = .; | 154 | __stop___ex_table = .; |
147 | 155 | ||
148 | /* | 156 | /* |
diff --git a/arch/arm/lib/Makefile b/arch/arm/lib/Makefile index 7b726b627ea5..30351cd4560d 100644 --- a/arch/arm/lib/Makefile +++ b/arch/arm/lib/Makefile | |||
@@ -6,28 +6,31 @@ | |||
6 | 6 | ||
7 | lib-y := backtrace.o changebit.o csumipv6.o csumpartial.o \ | 7 | lib-y := backtrace.o changebit.o csumipv6.o csumpartial.o \ |
8 | csumpartialcopy.o csumpartialcopyuser.o clearbit.o \ | 8 | csumpartialcopy.o csumpartialcopyuser.o clearbit.o \ |
9 | copy_page.o delay.o findbit.o memchr.o memcpy.o \ | 9 | delay.o findbit.o memchr.o memcpy.o \ |
10 | memmove.o memset.o memzero.o setbit.o \ | 10 | memmove.o memset.o memzero.o setbit.o \ |
11 | strncpy_from_user.o strnlen_user.o \ | 11 | strncpy_from_user.o strnlen_user.o \ |
12 | strchr.o strrchr.o \ | 12 | strchr.o strrchr.o \ |
13 | testchangebit.o testclearbit.o testsetbit.o \ | 13 | testchangebit.o testclearbit.o testsetbit.o \ |
14 | getuser.o putuser.o clear_user.o \ | ||
15 | ashldi3.o ashrdi3.o lshrdi3.o muldi3.o \ | 14 | ashldi3.o ashrdi3.o lshrdi3.o muldi3.o \ |
16 | ucmpdi2.o lib1funcs.o div64.o sha1.o \ | 15 | ucmpdi2.o lib1funcs.o div64.o sha1.o \ |
17 | io-readsb.o io-writesb.o io-readsl.o io-writesl.o | 16 | io-readsb.o io-writesb.o io-readsl.o io-writesl.o |
18 | 17 | ||
18 | mmu-y := clear_user.o copy_page.o getuser.o putuser.o | ||
19 | |||
19 | # the code in uaccess.S is not preemption safe and | 20 | # the code in uaccess.S is not preemption safe and |
20 | # probably faster on ARMv3 only | 21 | # probably faster on ARMv3 only |
21 | ifeq ($(CONFIG_PREEMPT),y) | 22 | ifeq ($(CONFIG_PREEMPT),y) |
22 | lib-y += copy_from_user.o copy_to_user.o | 23 | mmu-y += copy_from_user.o copy_to_user.o |
23 | else | 24 | else |
24 | ifneq ($(CONFIG_CPU_32v3),y) | 25 | ifneq ($(CONFIG_CPU_32v3),y) |
25 | lib-y += copy_from_user.o copy_to_user.o | 26 | mmu-y += copy_from_user.o copy_to_user.o |
26 | else | 27 | else |
27 | lib-y += uaccess.o | 28 | mmu-y += uaccess.o |
28 | endif | 29 | endif |
29 | endif | 30 | endif |
30 | 31 | ||
32 | lib-$(CONFIG_MMU) += $(mmu-y) | ||
33 | |||
31 | ifeq ($(CONFIG_CPU_32v3),y) | 34 | ifeq ($(CONFIG_CPU_32v3),y) |
32 | lib-y += io-readsw-armv3.o io-writesw-armv3.o | 35 | lib-y += io-readsw-armv3.o io-writesw-armv3.o |
33 | else | 36 | else |
diff --git a/arch/arm/lib/backtrace.S b/arch/arm/lib/backtrace.S index 058b80d72aa1..91f993f2e9db 100644 --- a/arch/arm/lib/backtrace.S +++ b/arch/arm/lib/backtrace.S | |||
@@ -97,16 +97,13 @@ ENTRY(c_backtrace) | |||
97 | b 1007f | 97 | b 1007f |
98 | 98 | ||
99 | /* | 99 | /* |
100 | * Fixup for LDMDB | 100 | * Fixup for LDMDB. Note that this must not be in the fixup section. |
101 | */ | 101 | */ |
102 | .section .fixup,"ax" | ||
103 | .align 0 | ||
104 | 1007: ldr r0, =.Lbad | 102 | 1007: ldr r0, =.Lbad |
105 | mov r1, frame | 103 | mov r1, frame |
106 | bl printk | 104 | bl printk |
107 | ldmfd sp!, {r4 - r8, pc} | 105 | ldmfd sp!, {r4 - r8, pc} |
108 | .ltorg | 106 | .ltorg |
109 | .previous | ||
110 | 107 | ||
111 | .section __ex_table,"a" | 108 | .section __ex_table,"a" |
112 | .align 3 | 109 | .align 3 |
diff --git a/arch/arm/lib/clear_user.S b/arch/arm/lib/clear_user.S index ea435ae2e4a5..ecb28dcdaf7b 100644 --- a/arch/arm/lib/clear_user.S +++ b/arch/arm/lib/clear_user.S | |||
@@ -12,13 +12,13 @@ | |||
12 | 12 | ||
13 | .text | 13 | .text |
14 | 14 | ||
15 | /* Prototype: int __arch_clear_user(void *addr, size_t sz) | 15 | /* Prototype: int __clear_user(void *addr, size_t sz) |
16 | * Purpose : clear some user memory | 16 | * Purpose : clear some user memory |
17 | * Params : addr - user memory address to clear | 17 | * Params : addr - user memory address to clear |
18 | * : sz - number of bytes to clear | 18 | * : sz - number of bytes to clear |
19 | * Returns : number of bytes NOT cleared | 19 | * Returns : number of bytes NOT cleared |
20 | */ | 20 | */ |
21 | ENTRY(__arch_clear_user) | 21 | ENTRY(__clear_user) |
22 | stmfd sp!, {r1, lr} | 22 | stmfd sp!, {r1, lr} |
23 | mov r2, #0 | 23 | mov r2, #0 |
24 | cmp r1, #4 | 24 | cmp r1, #4 |
diff --git a/arch/arm/lib/copy_from_user.S b/arch/arm/lib/copy_from_user.S index 7497393a0e81..6b7363ce749c 100644 --- a/arch/arm/lib/copy_from_user.S +++ b/arch/arm/lib/copy_from_user.S | |||
@@ -16,7 +16,7 @@ | |||
16 | /* | 16 | /* |
17 | * Prototype: | 17 | * Prototype: |
18 | * | 18 | * |
19 | * size_t __arch_copy_from_user(void *to, const void *from, size_t n) | 19 | * size_t __copy_from_user(void *to, const void *from, size_t n) |
20 | * | 20 | * |
21 | * Purpose: | 21 | * Purpose: |
22 | * | 22 | * |
@@ -83,7 +83,7 @@ | |||
83 | 83 | ||
84 | .text | 84 | .text |
85 | 85 | ||
86 | ENTRY(__arch_copy_from_user) | 86 | ENTRY(__copy_from_user) |
87 | 87 | ||
88 | #include "copy_template.S" | 88 | #include "copy_template.S" |
89 | 89 | ||
diff --git a/arch/arm/lib/copy_to_user.S b/arch/arm/lib/copy_to_user.S index 4a6d8ea14022..5224d94688d9 100644 --- a/arch/arm/lib/copy_to_user.S +++ b/arch/arm/lib/copy_to_user.S | |||
@@ -16,7 +16,7 @@ | |||
16 | /* | 16 | /* |
17 | * Prototype: | 17 | * Prototype: |
18 | * | 18 | * |
19 | * size_t __arch_copy_to_user(void *to, const void *from, size_t n) | 19 | * size_t __copy_to_user(void *to, const void *from, size_t n) |
20 | * | 20 | * |
21 | * Purpose: | 21 | * Purpose: |
22 | * | 22 | * |
@@ -86,7 +86,7 @@ | |||
86 | 86 | ||
87 | .text | 87 | .text |
88 | 88 | ||
89 | ENTRY(__arch_copy_to_user) | 89 | ENTRY(__copy_to_user) |
90 | 90 | ||
91 | #include "copy_template.S" | 91 | #include "copy_template.S" |
92 | 92 | ||
diff --git a/arch/arm/lib/strncpy_from_user.S b/arch/arm/lib/strncpy_from_user.S index 35649f04fcac..36e3741a3772 100644 --- a/arch/arm/lib/strncpy_from_user.S +++ b/arch/arm/lib/strncpy_from_user.S | |||
@@ -20,7 +20,7 @@ | |||
20 | * returns the number of characters copied (strlen of copied string), | 20 | * returns the number of characters copied (strlen of copied string), |
21 | * -EFAULT on exception, or "len" if we fill the whole buffer | 21 | * -EFAULT on exception, or "len" if we fill the whole buffer |
22 | */ | 22 | */ |
23 | ENTRY(__arch_strncpy_from_user) | 23 | ENTRY(__strncpy_from_user) |
24 | mov ip, r1 | 24 | mov ip, r1 |
25 | 1: subs r2, r2, #1 | 25 | 1: subs r2, r2, #1 |
26 | USER( ldrplbt r3, [r1], #1) | 26 | USER( ldrplbt r3, [r1], #1) |
diff --git a/arch/arm/lib/strnlen_user.S b/arch/arm/lib/strnlen_user.S index 3668a15991ef..18d8fa4f925a 100644 --- a/arch/arm/lib/strnlen_user.S +++ b/arch/arm/lib/strnlen_user.S | |||
@@ -14,13 +14,13 @@ | |||
14 | .text | 14 | .text |
15 | .align 5 | 15 | .align 5 |
16 | 16 | ||
17 | /* Prototype: unsigned long __arch_strnlen_user(const char *str, long n) | 17 | /* Prototype: unsigned long __strnlen_user(const char *str, long n) |
18 | * Purpose : get length of a string in user memory | 18 | * Purpose : get length of a string in user memory |
19 | * Params : str - address of string in user memory | 19 | * Params : str - address of string in user memory |
20 | * Returns : length of string *including terminator* | 20 | * Returns : length of string *including terminator* |
21 | * or zero on exception, or n + 1 if too long | 21 | * or zero on exception, or n + 1 if too long |
22 | */ | 22 | */ |
23 | ENTRY(__arch_strnlen_user) | 23 | ENTRY(__strnlen_user) |
24 | mov r2, r0 | 24 | mov r2, r0 |
25 | 1: | 25 | 1: |
26 | USER( ldrbt r3, [r0], #1) | 26 | USER( ldrbt r3, [r0], #1) |
diff --git a/arch/arm/lib/uaccess.S b/arch/arm/lib/uaccess.S index 1f1545d737be..b48bd6d5fd83 100644 --- a/arch/arm/lib/uaccess.S +++ b/arch/arm/lib/uaccess.S | |||
@@ -19,7 +19,7 @@ | |||
19 | 19 | ||
20 | #define PAGE_SHIFT 12 | 20 | #define PAGE_SHIFT 12 |
21 | 21 | ||
22 | /* Prototype: int __arch_copy_to_user(void *to, const char *from, size_t n) | 22 | /* Prototype: int __copy_to_user(void *to, const char *from, size_t n) |
23 | * Purpose : copy a block to user memory from kernel memory | 23 | * Purpose : copy a block to user memory from kernel memory |
24 | * Params : to - user memory | 24 | * Params : to - user memory |
25 | * : from - kernel memory | 25 | * : from - kernel memory |
@@ -39,7 +39,7 @@ USER( strgtbt r3, [r0], #1) @ May fault | |||
39 | sub r2, r2, ip | 39 | sub r2, r2, ip |
40 | b .Lc2u_dest_aligned | 40 | b .Lc2u_dest_aligned |
41 | 41 | ||
42 | ENTRY(__arch_copy_to_user) | 42 | ENTRY(__copy_to_user) |
43 | stmfd sp!, {r2, r4 - r7, lr} | 43 | stmfd sp!, {r2, r4 - r7, lr} |
44 | cmp r2, #4 | 44 | cmp r2, #4 |
45 | blt .Lc2u_not_enough | 45 | blt .Lc2u_not_enough |
@@ -283,7 +283,7 @@ USER( strgtbt r3, [r0], #1) @ May fault | |||
283 | 9001: ldmfd sp!, {r0, r4 - r7, pc} | 283 | 9001: ldmfd sp!, {r0, r4 - r7, pc} |
284 | .previous | 284 | .previous |
285 | 285 | ||
286 | /* Prototype: unsigned long __arch_copy_from_user(void *to,const void *from,unsigned long n); | 286 | /* Prototype: unsigned long __copy_from_user(void *to,const void *from,unsigned long n); |
287 | * Purpose : copy a block from user memory to kernel memory | 287 | * Purpose : copy a block from user memory to kernel memory |
288 | * Params : to - kernel memory | 288 | * Params : to - kernel memory |
289 | * : from - user memory | 289 | * : from - user memory |
@@ -302,7 +302,7 @@ USER( ldrgtbt r3, [r1], #1) @ May fault | |||
302 | sub r2, r2, ip | 302 | sub r2, r2, ip |
303 | b .Lcfu_dest_aligned | 303 | b .Lcfu_dest_aligned |
304 | 304 | ||
305 | ENTRY(__arch_copy_from_user) | 305 | ENTRY(__copy_from_user) |
306 | stmfd sp!, {r0, r2, r4 - r7, lr} | 306 | stmfd sp!, {r0, r2, r4 - r7, lr} |
307 | cmp r2, #4 | 307 | cmp r2, #4 |
308 | blt .Lcfu_not_enough | 308 | blt .Lcfu_not_enough |
diff --git a/arch/arm/mach-ep93xx/Kconfig b/arch/arm/mach-ep93xx/Kconfig index cec5a21ca4e3..e15e4c54a253 100644 --- a/arch/arm/mach-ep93xx/Kconfig +++ b/arch/arm/mach-ep93xx/Kconfig | |||
@@ -2,8 +2,19 @@ if ARCH_EP93XX | |||
2 | 2 | ||
3 | menu "Cirrus EP93xx Implementation Options" | 3 | menu "Cirrus EP93xx Implementation Options" |
4 | 4 | ||
5 | config CRUNCH | ||
6 | bool "Support for MaverickCrunch" | ||
7 | help | ||
8 | Enable kernel support for MaverickCrunch. | ||
9 | |||
5 | comment "EP93xx Platforms" | 10 | comment "EP93xx Platforms" |
6 | 11 | ||
12 | config MACH_EDB9315 | ||
13 | bool "Support Cirrus Logic EDB9315" | ||
14 | help | ||
15 | Say 'Y' here if you want your kernel to support the Cirrus | ||
16 | Logic EDB9315 Evaluation Board. | ||
17 | |||
7 | config MACH_GESBC9312 | 18 | config MACH_GESBC9312 |
8 | bool "Support Glomation GESBC-9312-sx" | 19 | bool "Support Glomation GESBC-9312-sx" |
9 | help | 20 | help |
diff --git a/arch/arm/mach-ep93xx/Makefile b/arch/arm/mach-ep93xx/Makefile index 05a48a21038e..dfa7e2e8a18b 100644 --- a/arch/arm/mach-ep93xx/Makefile +++ b/arch/arm/mach-ep93xx/Makefile | |||
@@ -6,5 +6,6 @@ obj-m := | |||
6 | obj-n := | 6 | obj-n := |
7 | obj- := | 7 | obj- := |
8 | 8 | ||
9 | obj-$(CONFIG_MACH_EDB9315) += edb9315.o | ||
9 | obj-$(CONFIG_MACH_GESBC9312) += gesbc9312.o | 10 | obj-$(CONFIG_MACH_GESBC9312) += gesbc9312.o |
10 | obj-$(CONFIG_MACH_TS72XX) += ts72xx.o | 11 | obj-$(CONFIG_MACH_TS72XX) += ts72xx.o |
diff --git a/arch/arm/mach-ep93xx/edb9315.c b/arch/arm/mach-ep93xx/edb9315.c new file mode 100644 index 000000000000..ef7482faad81 --- /dev/null +++ b/arch/arm/mach-ep93xx/edb9315.c | |||
@@ -0,0 +1,62 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-ep93xx/edb9315.c | ||
3 | * Cirrus Logic EDB9315 support. | ||
4 | * | ||
5 | * Copyright (C) 2006 Lennert Buytenhek <buytenh@wantstofly.org> | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License as published by | ||
9 | * the Free Software Foundation; either version 2 of the License, or (at | ||
10 | * your option) any later version. | ||
11 | */ | ||
12 | |||
13 | #include <linux/config.h> | ||
14 | #include <linux/kernel.h> | ||
15 | #include <linux/init.h> | ||
16 | #include <linux/mm.h> | ||
17 | #include <linux/sched.h> | ||
18 | #include <linux/interrupt.h> | ||
19 | #include <linux/ioport.h> | ||
20 | #include <linux/mtd/physmap.h> | ||
21 | #include <linux/platform_device.h> | ||
22 | #include <asm/io.h> | ||
23 | #include <asm/hardware.h> | ||
24 | #include <asm/mach-types.h> | ||
25 | #include <asm/mach/arch.h> | ||
26 | |||
27 | static struct physmap_flash_data edb9315_flash_data = { | ||
28 | .width = 4, | ||
29 | }; | ||
30 | |||
31 | static struct resource edb9315_flash_resource = { | ||
32 | .start = 0x60000000, | ||
33 | .end = 0x61ffffff, | ||
34 | .flags = IORESOURCE_MEM, | ||
35 | }; | ||
36 | |||
37 | static struct platform_device edb9315_flash = { | ||
38 | .name = "physmap-flash", | ||
39 | .id = 0, | ||
40 | .dev = { | ||
41 | .platform_data = &edb9315_flash_data, | ||
42 | }, | ||
43 | .num_resources = 1, | ||
44 | .resource = &edb9315_flash_resource, | ||
45 | }; | ||
46 | |||
47 | static void __init edb9315_init_machine(void) | ||
48 | { | ||
49 | ep93xx_init_devices(); | ||
50 | platform_device_register(&edb9315_flash); | ||
51 | } | ||
52 | |||
53 | MACHINE_START(EDB9315, "Cirrus Logic EDB9315 Evaluation Board") | ||
54 | /* Maintainer: Lennert Buytenhek <buytenh@wantstofly.org> */ | ||
55 | .phys_io = EP93XX_APB_PHYS_BASE, | ||
56 | .io_pg_offst = ((EP93XX_APB_VIRT_BASE) >> 18) & 0xfffc, | ||
57 | .boot_params = 0x00000100, | ||
58 | .map_io = ep93xx_map_io, | ||
59 | .init_irq = ep93xx_init_irq, | ||
60 | .timer = &ep93xx_timer, | ||
61 | .init_machine = edb9315_init_machine, | ||
62 | MACHINE_END | ||
diff --git a/arch/arm/mach-ep93xx/gesbc9312.c b/arch/arm/mach-ep93xx/gesbc9312.c index 47cc6c8b7c79..2c28d66d260e 100644 --- a/arch/arm/mach-ep93xx/gesbc9312.c +++ b/arch/arm/mach-ep93xx/gesbc9312.c | |||
@@ -30,7 +30,7 @@ static struct physmap_flash_data gesbc9312_flash_data = { | |||
30 | 30 | ||
31 | static struct resource gesbc9312_flash_resource = { | 31 | static struct resource gesbc9312_flash_resource = { |
32 | .start = 0x60000000, | 32 | .start = 0x60000000, |
33 | .end = 0x60800000, | 33 | .end = 0x607fffff, |
34 | .flags = IORESOURCE_MEM, | 34 | .flags = IORESOURCE_MEM, |
35 | }; | 35 | }; |
36 | 36 | ||
diff --git a/arch/arm/mach-ep93xx/ts72xx.c b/arch/arm/mach-ep93xx/ts72xx.c index 6e5a56cd5ae8..0b3b875b1875 100644 --- a/arch/arm/mach-ep93xx/ts72xx.c +++ b/arch/arm/mach-ep93xx/ts72xx.c | |||
@@ -118,7 +118,7 @@ static struct physmap_flash_data ts72xx_flash_data = { | |||
118 | 118 | ||
119 | static struct resource ts72xx_flash_resource = { | 119 | static struct resource ts72xx_flash_resource = { |
120 | .start = TS72XX_NOR_PHYS_BASE, | 120 | .start = TS72XX_NOR_PHYS_BASE, |
121 | .end = TS72XX_NOR_PHYS_BASE + 0x01000000, | 121 | .end = TS72XX_NOR_PHYS_BASE + 0x00ffffff, |
122 | .flags = IORESOURCE_MEM, | 122 | .flags = IORESOURCE_MEM, |
123 | }; | 123 | }; |
124 | 124 | ||
diff --git a/arch/arm/mach-ixp23xx/espresso.c b/arch/arm/mach-ixp23xx/espresso.c index dc5e489c70bc..357351fbb1e2 100644 --- a/arch/arm/mach-ixp23xx/espresso.c +++ b/arch/arm/mach-ixp23xx/espresso.c | |||
@@ -59,7 +59,7 @@ static struct physmap_flash_data espresso_flash_data = { | |||
59 | 59 | ||
60 | static struct resource espresso_flash_resource = { | 60 | static struct resource espresso_flash_resource = { |
61 | .start = 0x90000000, | 61 | .start = 0x90000000, |
62 | .end = 0x92000000, | 62 | .end = 0x91ffffff, |
63 | .flags = IORESOURCE_MEM, | 63 | .flags = IORESOURCE_MEM, |
64 | }; | 64 | }; |
65 | 65 | ||
diff --git a/arch/arm/mach-ixp23xx/ixdp2351.c b/arch/arm/mach-ixp23xx/ixdp2351.c index 535b334ee045..e0886871cc77 100644 --- a/arch/arm/mach-ixp23xx/ixdp2351.c +++ b/arch/arm/mach-ixp23xx/ixdp2351.c | |||
@@ -304,7 +304,7 @@ static struct physmap_flash_data ixdp2351_flash_data = { | |||
304 | 304 | ||
305 | static struct resource ixdp2351_flash_resource = { | 305 | static struct resource ixdp2351_flash_resource = { |
306 | .start = 0x90000000, | 306 | .start = 0x90000000, |
307 | .end = 0x94000000, | 307 | .end = 0x93ffffff, |
308 | .flags = IORESOURCE_MEM, | 308 | .flags = IORESOURCE_MEM, |
309 | }; | 309 | }; |
310 | 310 | ||
diff --git a/arch/arm/mach-ixp23xx/roadrunner.c b/arch/arm/mach-ixp23xx/roadrunner.c index b9f5d13fcfe1..92ad18f41251 100644 --- a/arch/arm/mach-ixp23xx/roadrunner.c +++ b/arch/arm/mach-ixp23xx/roadrunner.c | |||
@@ -143,7 +143,7 @@ static struct physmap_flash_data roadrunner_flash_data = { | |||
143 | 143 | ||
144 | static struct resource roadrunner_flash_resource = { | 144 | static struct resource roadrunner_flash_resource = { |
145 | .start = 0x90000000, | 145 | .start = 0x90000000, |
146 | .end = 0x94000000, | 146 | .end = 0x93ffffff, |
147 | .flags = IORESOURCE_MEM, | 147 | .flags = IORESOURCE_MEM, |
148 | }; | 148 | }; |
149 | 149 | ||
diff --git a/arch/arm/mach-pxa/irq.c b/arch/arm/mach-pxa/irq.c index 539b596005fc..d9635ff4b10c 100644 --- a/arch/arm/mach-pxa/irq.c +++ b/arch/arm/mach-pxa/irq.c | |||
@@ -88,8 +88,8 @@ static int pxa_gpio_irq_type(unsigned int irq, unsigned int type) | |||
88 | 88 | ||
89 | if (type == IRQT_PROBE) { | 89 | if (type == IRQT_PROBE) { |
90 | /* Don't mess with enabled GPIOs using preconfigured edges or | 90 | /* Don't mess with enabled GPIOs using preconfigured edges or |
91 | GPIOs set to alternate function during probe */ | 91 | GPIOs set to alternate function or to output during probe */ |
92 | if ((GPIO_IRQ_rising_edge[idx] | GPIO_IRQ_falling_edge[idx]) & | 92 | if ((GPIO_IRQ_rising_edge[idx] | GPIO_IRQ_falling_edge[idx] | GPDR(gpio)) & |
93 | GPIO_bit(gpio)) | 93 | GPIO_bit(gpio)) |
94 | return 0; | 94 | return 0; |
95 | if (GAFR(gpio) & (0x3 << (((gpio) & 0xf)*2))) | 95 | if (GAFR(gpio) & (0x3 << (((gpio) & 0xf)*2))) |
diff --git a/arch/arm/mach-s3c2410/s3c244x.c b/arch/arm/mach-s3c2410/s3c244x.c index 838bc525e836..9a2258270de9 100644 --- a/arch/arm/mach-s3c2410/s3c244x.c +++ b/arch/arm/mach-s3c2410/s3c244x.c | |||
@@ -69,6 +69,7 @@ void __init s3c244x_map_io(struct map_desc *mach_desc, int size) | |||
69 | 69 | ||
70 | s3c_device_i2c.name = "s3c2440-i2c"; | 70 | s3c_device_i2c.name = "s3c2440-i2c"; |
71 | s3c_device_nand.name = "s3c2440-nand"; | 71 | s3c_device_nand.name = "s3c2440-nand"; |
72 | s3c_device_usbgadget.name = "s3c2440-usbgadget"; | ||
72 | } | 73 | } |
73 | 74 | ||
74 | void __init s3c244x_init_clocks(int xtal) | 75 | void __init s3c244x_init_clocks(int xtal) |
diff --git a/arch/arm/mm/Kconfig b/arch/arm/mm/Kconfig index ecf5e232a6fc..c4bca753165b 100644 --- a/arch/arm/mm/Kconfig +++ b/arch/arm/mm/Kconfig | |||
@@ -15,8 +15,8 @@ config CPU_ARM610 | |||
15 | select CPU_32v3 | 15 | select CPU_32v3 |
16 | select CPU_CACHE_V3 | 16 | select CPU_CACHE_V3 |
17 | select CPU_CACHE_VIVT | 17 | select CPU_CACHE_VIVT |
18 | select CPU_COPY_V3 | 18 | select CPU_COPY_V3 if MMU |
19 | select CPU_TLB_V3 | 19 | select CPU_TLB_V3 if MMU |
20 | help | 20 | help |
21 | The ARM610 is the successor to the ARM3 processor | 21 | The ARM610 is the successor to the ARM3 processor |
22 | and was produced by VLSI Technology Inc. | 22 | and was produced by VLSI Technology Inc. |
@@ -31,8 +31,8 @@ config CPU_ARM710 | |||
31 | select CPU_32v3 | 31 | select CPU_32v3 |
32 | select CPU_CACHE_V3 | 32 | select CPU_CACHE_V3 |
33 | select CPU_CACHE_VIVT | 33 | select CPU_CACHE_VIVT |
34 | select CPU_COPY_V3 | 34 | select CPU_COPY_V3 if MMU |
35 | select CPU_TLB_V3 | 35 | select CPU_TLB_V3 if MMU |
36 | help | 36 | help |
37 | A 32-bit RISC microprocessor based on the ARM7 processor core | 37 | A 32-bit RISC microprocessor based on the ARM7 processor core |
38 | designed by Advanced RISC Machines Ltd. The ARM710 is the | 38 | designed by Advanced RISC Machines Ltd. The ARM710 is the |
@@ -50,8 +50,8 @@ config CPU_ARM720T | |||
50 | select CPU_ABRT_LV4T | 50 | select CPU_ABRT_LV4T |
51 | select CPU_CACHE_V4 | 51 | select CPU_CACHE_V4 |
52 | select CPU_CACHE_VIVT | 52 | select CPU_CACHE_VIVT |
53 | select CPU_COPY_V4WT | 53 | select CPU_COPY_V4WT if MMU |
54 | select CPU_TLB_V4WT | 54 | select CPU_TLB_V4WT if MMU |
55 | help | 55 | help |
56 | A 32-bit RISC processor with 8kByte Cache, Write Buffer and | 56 | A 32-bit RISC processor with 8kByte Cache, Write Buffer and |
57 | MMU built around an ARM7TDMI core. | 57 | MMU built around an ARM7TDMI core. |
@@ -68,8 +68,8 @@ config CPU_ARM920T | |||
68 | select CPU_ABRT_EV4T | 68 | select CPU_ABRT_EV4T |
69 | select CPU_CACHE_V4WT | 69 | select CPU_CACHE_V4WT |
70 | select CPU_CACHE_VIVT | 70 | select CPU_CACHE_VIVT |
71 | select CPU_COPY_V4WB | 71 | select CPU_COPY_V4WB if MMU |
72 | select CPU_TLB_V4WBI | 72 | select CPU_TLB_V4WBI if MMU |
73 | help | 73 | help |
74 | The ARM920T is licensed to be produced by numerous vendors, | 74 | The ARM920T is licensed to be produced by numerous vendors, |
75 | and is used in the Maverick EP9312 and the Samsung S3C2410. | 75 | and is used in the Maverick EP9312 and the Samsung S3C2410. |
@@ -89,8 +89,8 @@ config CPU_ARM922T | |||
89 | select CPU_ABRT_EV4T | 89 | select CPU_ABRT_EV4T |
90 | select CPU_CACHE_V4WT | 90 | select CPU_CACHE_V4WT |
91 | select CPU_CACHE_VIVT | 91 | select CPU_CACHE_VIVT |
92 | select CPU_COPY_V4WB | 92 | select CPU_COPY_V4WB if MMU |
93 | select CPU_TLB_V4WBI | 93 | select CPU_TLB_V4WBI if MMU |
94 | help | 94 | help |
95 | The ARM922T is a version of the ARM920T, but with smaller | 95 | The ARM922T is a version of the ARM920T, but with smaller |
96 | instruction and data caches. It is used in Altera's | 96 | instruction and data caches. It is used in Altera's |
@@ -108,8 +108,8 @@ config CPU_ARM925T | |||
108 | select CPU_ABRT_EV4T | 108 | select CPU_ABRT_EV4T |
109 | select CPU_CACHE_V4WT | 109 | select CPU_CACHE_V4WT |
110 | select CPU_CACHE_VIVT | 110 | select CPU_CACHE_VIVT |
111 | select CPU_COPY_V4WB | 111 | select CPU_COPY_V4WB if MMU |
112 | select CPU_TLB_V4WBI | 112 | select CPU_TLB_V4WBI if MMU |
113 | help | 113 | help |
114 | The ARM925T is a mix between the ARM920T and ARM926T, but with | 114 | The ARM925T is a mix between the ARM920T and ARM926T, but with |
115 | different instruction and data caches. It is used in TI's OMAP | 115 | different instruction and data caches. It is used in TI's OMAP |
@@ -126,8 +126,8 @@ config CPU_ARM926T | |||
126 | select CPU_32v5 | 126 | select CPU_32v5 |
127 | select CPU_ABRT_EV5TJ | 127 | select CPU_ABRT_EV5TJ |
128 | select CPU_CACHE_VIVT | 128 | select CPU_CACHE_VIVT |
129 | select CPU_COPY_V4WB | 129 | select CPU_COPY_V4WB if MMU |
130 | select CPU_TLB_V4WBI | 130 | select CPU_TLB_V4WBI if MMU |
131 | help | 131 | help |
132 | This is a variant of the ARM920. It has slightly different | 132 | This is a variant of the ARM920. It has slightly different |
133 | instruction sequences for cache and TLB operations. Curiously, | 133 | instruction sequences for cache and TLB operations. Curiously, |
@@ -144,8 +144,8 @@ config CPU_ARM1020 | |||
144 | select CPU_ABRT_EV4T | 144 | select CPU_ABRT_EV4T |
145 | select CPU_CACHE_V4WT | 145 | select CPU_CACHE_V4WT |
146 | select CPU_CACHE_VIVT | 146 | select CPU_CACHE_VIVT |
147 | select CPU_COPY_V4WB | 147 | select CPU_COPY_V4WB if MMU |
148 | select CPU_TLB_V4WBI | 148 | select CPU_TLB_V4WBI if MMU |
149 | help | 149 | help |
150 | The ARM1020 is the 32K cached version of the ARM10 processor, | 150 | The ARM1020 is the 32K cached version of the ARM10 processor, |
151 | with an addition of a floating-point unit. | 151 | with an addition of a floating-point unit. |
@@ -161,8 +161,8 @@ config CPU_ARM1020E | |||
161 | select CPU_ABRT_EV4T | 161 | select CPU_ABRT_EV4T |
162 | select CPU_CACHE_V4WT | 162 | select CPU_CACHE_V4WT |
163 | select CPU_CACHE_VIVT | 163 | select CPU_CACHE_VIVT |
164 | select CPU_COPY_V4WB | 164 | select CPU_COPY_V4WB if MMU |
165 | select CPU_TLB_V4WBI | 165 | select CPU_TLB_V4WBI if MMU |
166 | depends on n | 166 | depends on n |
167 | 167 | ||
168 | # ARM1022E | 168 | # ARM1022E |
@@ -172,8 +172,8 @@ config CPU_ARM1022 | |||
172 | select CPU_32v5 | 172 | select CPU_32v5 |
173 | select CPU_ABRT_EV4T | 173 | select CPU_ABRT_EV4T |
174 | select CPU_CACHE_VIVT | 174 | select CPU_CACHE_VIVT |
175 | select CPU_COPY_V4WB # can probably do better | 175 | select CPU_COPY_V4WB if MMU # can probably do better |
176 | select CPU_TLB_V4WBI | 176 | select CPU_TLB_V4WBI if MMU |
177 | help | 177 | help |
178 | The ARM1022E is an implementation of the ARMv5TE architecture | 178 | The ARM1022E is an implementation of the ARMv5TE architecture |
179 | based upon the ARM10 integer core with a 16KiB L1 Harvard cache, | 179 | based upon the ARM10 integer core with a 16KiB L1 Harvard cache, |
@@ -189,8 +189,8 @@ config CPU_ARM1026 | |||
189 | select CPU_32v5 | 189 | select CPU_32v5 |
190 | select CPU_ABRT_EV5T # But need Jazelle, but EV5TJ ignores bit 10 | 190 | select CPU_ABRT_EV5T # But need Jazelle, but EV5TJ ignores bit 10 |
191 | select CPU_CACHE_VIVT | 191 | select CPU_CACHE_VIVT |
192 | select CPU_COPY_V4WB # can probably do better | 192 | select CPU_COPY_V4WB if MMU # can probably do better |
193 | select CPU_TLB_V4WBI | 193 | select CPU_TLB_V4WBI if MMU |
194 | help | 194 | help |
195 | The ARM1026EJ-S is an implementation of the ARMv5TEJ architecture | 195 | The ARM1026EJ-S is an implementation of the ARMv5TEJ architecture |
196 | based upon the ARM10 integer core. | 196 | based upon the ARM10 integer core. |
@@ -207,8 +207,8 @@ config CPU_SA110 | |||
207 | select CPU_ABRT_EV4 | 207 | select CPU_ABRT_EV4 |
208 | select CPU_CACHE_V4WB | 208 | select CPU_CACHE_V4WB |
209 | select CPU_CACHE_VIVT | 209 | select CPU_CACHE_VIVT |
210 | select CPU_COPY_V4WB | 210 | select CPU_COPY_V4WB if MMU |
211 | select CPU_TLB_V4WB | 211 | select CPU_TLB_V4WB if MMU |
212 | help | 212 | help |
213 | The Intel StrongARM(R) SA-110 is a 32-bit microprocessor and | 213 | The Intel StrongARM(R) SA-110 is a 32-bit microprocessor and |
214 | is available at five speeds ranging from 100 MHz to 233 MHz. | 214 | is available at five speeds ranging from 100 MHz to 233 MHz. |
@@ -227,7 +227,7 @@ config CPU_SA1100 | |||
227 | select CPU_ABRT_EV4 | 227 | select CPU_ABRT_EV4 |
228 | select CPU_CACHE_V4WB | 228 | select CPU_CACHE_V4WB |
229 | select CPU_CACHE_VIVT | 229 | select CPU_CACHE_VIVT |
230 | select CPU_TLB_V4WB | 230 | select CPU_TLB_V4WB if MMU |
231 | 231 | ||
232 | # XScale | 232 | # XScale |
233 | config CPU_XSCALE | 233 | config CPU_XSCALE |
@@ -237,7 +237,7 @@ config CPU_XSCALE | |||
237 | select CPU_32v5 | 237 | select CPU_32v5 |
238 | select CPU_ABRT_EV5T | 238 | select CPU_ABRT_EV5T |
239 | select CPU_CACHE_VIVT | 239 | select CPU_CACHE_VIVT |
240 | select CPU_TLB_V4WBI | 240 | select CPU_TLB_V4WBI if MMU |
241 | 241 | ||
242 | # XScale Core Version 3 | 242 | # XScale Core Version 3 |
243 | config CPU_XSC3 | 243 | config CPU_XSC3 |
@@ -247,7 +247,7 @@ config CPU_XSC3 | |||
247 | select CPU_32v5 | 247 | select CPU_32v5 |
248 | select CPU_ABRT_EV5T | 248 | select CPU_ABRT_EV5T |
249 | select CPU_CACHE_VIVT | 249 | select CPU_CACHE_VIVT |
250 | select CPU_TLB_V4WBI | 250 | select CPU_TLB_V4WBI if MMU |
251 | select IO_36 | 251 | select IO_36 |
252 | 252 | ||
253 | # ARMv6 | 253 | # ARMv6 |
@@ -258,8 +258,8 @@ config CPU_V6 | |||
258 | select CPU_ABRT_EV6 | 258 | select CPU_ABRT_EV6 |
259 | select CPU_CACHE_V6 | 259 | select CPU_CACHE_V6 |
260 | select CPU_CACHE_VIPT | 260 | select CPU_CACHE_VIPT |
261 | select CPU_COPY_V6 | 261 | select CPU_COPY_V6 if MMU |
262 | select CPU_TLB_V6 | 262 | select CPU_TLB_V6 if MMU |
263 | 263 | ||
264 | # ARMv6k | 264 | # ARMv6k |
265 | config CPU_32v6K | 265 | config CPU_32v6K |
@@ -277,17 +277,17 @@ config CPU_32v6K | |||
277 | # This defines the compiler instruction set which depends on the machine type. | 277 | # This defines the compiler instruction set which depends on the machine type. |
278 | config CPU_32v3 | 278 | config CPU_32v3 |
279 | bool | 279 | bool |
280 | select TLS_REG_EMUL if SMP | 280 | select TLS_REG_EMUL if SMP || !MMU |
281 | select NEEDS_SYSCALL_FOR_CMPXCHG if SMP | 281 | select NEEDS_SYSCALL_FOR_CMPXCHG if SMP |
282 | 282 | ||
283 | config CPU_32v4 | 283 | config CPU_32v4 |
284 | bool | 284 | bool |
285 | select TLS_REG_EMUL if SMP | 285 | select TLS_REG_EMUL if SMP || !MMU |
286 | select NEEDS_SYSCALL_FOR_CMPXCHG if SMP | 286 | select NEEDS_SYSCALL_FOR_CMPXCHG if SMP |
287 | 287 | ||
288 | config CPU_32v5 | 288 | config CPU_32v5 |
289 | bool | 289 | bool |
290 | select TLS_REG_EMUL if SMP | 290 | select TLS_REG_EMUL if SMP || !MMU |
291 | select NEEDS_SYSCALL_FOR_CMPXCHG if SMP | 291 | select NEEDS_SYSCALL_FOR_CMPXCHG if SMP |
292 | 292 | ||
293 | config CPU_32v6 | 293 | config CPU_32v6 |
@@ -334,6 +334,7 @@ config CPU_CACHE_VIVT | |||
334 | config CPU_CACHE_VIPT | 334 | config CPU_CACHE_VIPT |
335 | bool | 335 | bool |
336 | 336 | ||
337 | if MMU | ||
337 | # The copy-page model | 338 | # The copy-page model |
338 | config CPU_COPY_V3 | 339 | config CPU_COPY_V3 |
339 | bool | 340 | bool |
@@ -372,6 +373,8 @@ config CPU_TLB_V4WBI | |||
372 | config CPU_TLB_V6 | 373 | config CPU_TLB_V6 |
373 | bool | 374 | bool |
374 | 375 | ||
376 | endif | ||
377 | |||
375 | # | 378 | # |
376 | # CPU supports 36-bit I/O | 379 | # CPU supports 36-bit I/O |
377 | # | 380 | # |
diff --git a/arch/arm/mm/Makefile b/arch/arm/mm/Makefile index 07a538505784..21a2770226ee 100644 --- a/arch/arm/mm/Makefile +++ b/arch/arm/mm/Makefile | |||
@@ -2,10 +2,16 @@ | |||
2 | # Makefile for the linux arm-specific parts of the memory manager. | 2 | # Makefile for the linux arm-specific parts of the memory manager. |
3 | # | 3 | # |
4 | 4 | ||
5 | obj-y := consistent.o extable.o fault-armv.o \ | 5 | obj-y := consistent.o extable.o fault.o init.o \ |
6 | fault.o flush.o init.o ioremap.o mmap.o \ | 6 | iomap.o |
7 | |||
8 | obj-$(CONFIG_MMU) += fault-armv.o flush.o ioremap.o mmap.o \ | ||
7 | mm-armv.o | 9 | mm-armv.o |
8 | 10 | ||
11 | ifneq ($(CONFIG_MMU),y) | ||
12 | obj-y += nommu.o | ||
13 | endif | ||
14 | |||
9 | obj-$(CONFIG_MODULES) += proc-syms.o | 15 | obj-$(CONFIG_MODULES) += proc-syms.o |
10 | 16 | ||
11 | obj-$(CONFIG_ALIGNMENT_TRAP) += alignment.o | 17 | obj-$(CONFIG_ALIGNMENT_TRAP) += alignment.o |
diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c index 9ea1f87a7079..989fd681c822 100644 --- a/arch/arm/mm/init.c +++ b/arch/arm/mm/init.c | |||
@@ -26,8 +26,6 @@ | |||
26 | #include <asm/mach/arch.h> | 26 | #include <asm/mach/arch.h> |
27 | #include <asm/mach/map.h> | 27 | #include <asm/mach/map.h> |
28 | 28 | ||
29 | #define TABLE_SIZE (2 * PTRS_PER_PTE * sizeof(pte_t)) | ||
30 | |||
31 | DEFINE_PER_CPU(struct mmu_gather, mmu_gathers); | 29 | DEFINE_PER_CPU(struct mmu_gather, mmu_gathers); |
32 | 30 | ||
33 | extern pgd_t swapper_pg_dir[PTRS_PER_PGD]; | 31 | extern pgd_t swapper_pg_dir[PTRS_PER_PGD]; |
diff --git a/arch/arm/mm/iomap.c b/arch/arm/mm/iomap.c new file mode 100644 index 000000000000..62066f3020c8 --- /dev/null +++ b/arch/arm/mm/iomap.c | |||
@@ -0,0 +1,55 @@ | |||
1 | /* | ||
2 | * linux/arch/arm/mm/iomap.c | ||
3 | * | ||
4 | * Map IO port and PCI memory spaces so that {read,write}[bwl] can | ||
5 | * be used to access this memory. | ||
6 | */ | ||
7 | #include <linux/module.h> | ||
8 | #include <linux/pci.h> | ||
9 | #include <linux/ioport.h> | ||
10 | |||
11 | #include <asm/io.h> | ||
12 | |||
13 | #ifdef __io | ||
14 | void __iomem *ioport_map(unsigned long port, unsigned int nr) | ||
15 | { | ||
16 | return __io(port); | ||
17 | } | ||
18 | EXPORT_SYMBOL(ioport_map); | ||
19 | |||
20 | void ioport_unmap(void __iomem *addr) | ||
21 | { | ||
22 | } | ||
23 | EXPORT_SYMBOL(ioport_unmap); | ||
24 | #endif | ||
25 | |||
26 | #ifdef CONFIG_PCI | ||
27 | void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen) | ||
28 | { | ||
29 | unsigned long start = pci_resource_start(dev, bar); | ||
30 | unsigned long len = pci_resource_len(dev, bar); | ||
31 | unsigned long flags = pci_resource_flags(dev, bar); | ||
32 | |||
33 | if (!len || !start) | ||
34 | return NULL; | ||
35 | if (maxlen && len > maxlen) | ||
36 | len = maxlen; | ||
37 | if (flags & IORESOURCE_IO) | ||
38 | return ioport_map(start, len); | ||
39 | if (flags & IORESOURCE_MEM) { | ||
40 | if (flags & IORESOURCE_CACHEABLE) | ||
41 | return ioremap(start, len); | ||
42 | return ioremap_nocache(start, len); | ||
43 | } | ||
44 | return NULL; | ||
45 | } | ||
46 | EXPORT_SYMBOL(pci_iomap); | ||
47 | |||
48 | void pci_iounmap(struct pci_dev *dev, void __iomem *addr) | ||
49 | { | ||
50 | if ((unsigned long)addr >= VMALLOC_START && | ||
51 | (unsigned long)addr < VMALLOC_END) | ||
52 | iounmap(addr); | ||
53 | } | ||
54 | EXPORT_SYMBOL(pci_iounmap); | ||
55 | #endif | ||
diff --git a/arch/arm/mm/ioremap.c b/arch/arm/mm/ioremap.c index c1f7180c7bed..7691cfdba567 100644 --- a/arch/arm/mm/ioremap.c +++ b/arch/arm/mm/ioremap.c | |||
@@ -176,50 +176,3 @@ void __iounmap(void __iomem *addr) | |||
176 | vunmap((void *)(PAGE_MASK & (unsigned long)addr)); | 176 | vunmap((void *)(PAGE_MASK & (unsigned long)addr)); |
177 | } | 177 | } |
178 | EXPORT_SYMBOL(__iounmap); | 178 | EXPORT_SYMBOL(__iounmap); |
179 | |||
180 | #ifdef __io | ||
181 | void __iomem *ioport_map(unsigned long port, unsigned int nr) | ||
182 | { | ||
183 | return __io(port); | ||
184 | } | ||
185 | EXPORT_SYMBOL(ioport_map); | ||
186 | |||
187 | void ioport_unmap(void __iomem *addr) | ||
188 | { | ||
189 | } | ||
190 | EXPORT_SYMBOL(ioport_unmap); | ||
191 | #endif | ||
192 | |||
193 | #ifdef CONFIG_PCI | ||
194 | #include <linux/pci.h> | ||
195 | #include <linux/ioport.h> | ||
196 | |||
197 | void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen) | ||
198 | { | ||
199 | unsigned long start = pci_resource_start(dev, bar); | ||
200 | unsigned long len = pci_resource_len(dev, bar); | ||
201 | unsigned long flags = pci_resource_flags(dev, bar); | ||
202 | |||
203 | if (!len || !start) | ||
204 | return NULL; | ||
205 | if (maxlen && len > maxlen) | ||
206 | len = maxlen; | ||
207 | if (flags & IORESOURCE_IO) | ||
208 | return ioport_map(start, len); | ||
209 | if (flags & IORESOURCE_MEM) { | ||
210 | if (flags & IORESOURCE_CACHEABLE) | ||
211 | return ioremap(start, len); | ||
212 | return ioremap_nocache(start, len); | ||
213 | } | ||
214 | return NULL; | ||
215 | } | ||
216 | EXPORT_SYMBOL(pci_iomap); | ||
217 | |||
218 | void pci_iounmap(struct pci_dev *dev, void __iomem *addr) | ||
219 | { | ||
220 | if ((unsigned long)addr >= VMALLOC_START && | ||
221 | (unsigned long)addr < VMALLOC_END) | ||
222 | iounmap(addr); | ||
223 | } | ||
224 | EXPORT_SYMBOL(pci_iounmap); | ||
225 | #endif | ||
diff --git a/arch/arm/mm/nommu.c b/arch/arm/mm/nommu.c new file mode 100644 index 000000000000..1464ed817b5d --- /dev/null +++ b/arch/arm/mm/nommu.c | |||
@@ -0,0 +1,39 @@ | |||
1 | /* | ||
2 | * linux/arch/arm/mm/nommu.c | ||
3 | * | ||
4 | * ARM uCLinux supporting functions. | ||
5 | */ | ||
6 | #include <linux/module.h> | ||
7 | #include <linux/mm.h> | ||
8 | #include <linux/pagemap.h> | ||
9 | |||
10 | #include <asm/cacheflush.h> | ||
11 | #include <asm/io.h> | ||
12 | #include <asm/page.h> | ||
13 | |||
14 | void flush_dcache_page(struct page *page) | ||
15 | { | ||
16 | __cpuc_flush_dcache_page(page_address(page)); | ||
17 | } | ||
18 | EXPORT_SYMBOL(flush_dcache_page); | ||
19 | |||
20 | void __iomem *__ioremap_pfn(unsigned long pfn, unsigned long offset, | ||
21 | size_t size, unsigned long flags) | ||
22 | { | ||
23 | if (pfn >= (0x100000000ULL >> PAGE_SHIFT)) | ||
24 | return NULL; | ||
25 | return (void __iomem *) (offset + (pfn << PAGE_SHIFT)); | ||
26 | } | ||
27 | EXPORT_SYMBOL(__ioremap_pfn); | ||
28 | |||
29 | void __iomem *__ioremap(unsigned long phys_addr, size_t size, | ||
30 | unsigned long flags) | ||
31 | { | ||
32 | return (void __iomem *)phys_addr; | ||
33 | } | ||
34 | EXPORT_SYMBOL(__ioremap); | ||
35 | |||
36 | void __iounmap(void __iomem *addr) | ||
37 | { | ||
38 | } | ||
39 | EXPORT_SYMBOL(__iounmap); | ||
diff --git a/arch/arm/mm/proc-arm1020.S b/arch/arm/mm/proc-arm1020.S index 959588884fa5..b9abbafca812 100644 --- a/arch/arm/mm/proc-arm1020.S +++ b/arch/arm/mm/proc-arm1020.S | |||
@@ -3,6 +3,7 @@ | |||
3 | * | 3 | * |
4 | * Copyright (C) 2000 ARM Limited | 4 | * Copyright (C) 2000 ARM Limited |
5 | * Copyright (C) 2000 Deep Blue Solutions Ltd. | 5 | * Copyright (C) 2000 Deep Blue Solutions Ltd. |
6 | * hacked for non-paged-MM by Hyok S. Choi, 2003. | ||
6 | * | 7 | * |
7 | * This program is free software; you can redistribute it and/or modify | 8 | * This program is free software; you can redistribute it and/or modify |
8 | * it under the terms of the GNU General Public License as published by | 9 | * it under the terms of the GNU General Public License as published by |
@@ -101,7 +102,9 @@ ENTRY(cpu_arm1020_reset) | |||
101 | mov ip, #0 | 102 | mov ip, #0 |
102 | mcr p15, 0, ip, c7, c7, 0 @ invalidate I,D caches | 103 | mcr p15, 0, ip, c7, c7, 0 @ invalidate I,D caches |
103 | mcr p15, 0, ip, c7, c10, 4 @ drain WB | 104 | mcr p15, 0, ip, c7, c10, 4 @ drain WB |
105 | #ifdef CONFIG_MMU | ||
104 | mcr p15, 0, ip, c8, c7, 0 @ invalidate I & D TLBs | 106 | mcr p15, 0, ip, c8, c7, 0 @ invalidate I & D TLBs |
107 | #endif | ||
105 | mrc p15, 0, ip, c1, c0, 0 @ ctrl register | 108 | mrc p15, 0, ip, c1, c0, 0 @ ctrl register |
106 | bic ip, ip, #0x000f @ ............wcam | 109 | bic ip, ip, #0x000f @ ............wcam |
107 | bic ip, ip, #0x1100 @ ...i...s........ | 110 | bic ip, ip, #0x1100 @ ...i...s........ |
@@ -359,6 +362,7 @@ ENTRY(cpu_arm1020_dcache_clean_area) | |||
359 | */ | 362 | */ |
360 | .align 5 | 363 | .align 5 |
361 | ENTRY(cpu_arm1020_switch_mm) | 364 | ENTRY(cpu_arm1020_switch_mm) |
365 | #ifdef CONFIG_MMU | ||
362 | #ifndef CONFIG_CPU_DCACHE_DISABLE | 366 | #ifndef CONFIG_CPU_DCACHE_DISABLE |
363 | mcr p15, 0, r3, c7, c10, 4 | 367 | mcr p15, 0, r3, c7, c10, 4 |
364 | mov r1, #0xF @ 16 segments | 368 | mov r1, #0xF @ 16 segments |
@@ -383,6 +387,7 @@ ENTRY(cpu_arm1020_switch_mm) | |||
383 | mcr p15, 0, r1, c7, c10, 4 @ drain WB | 387 | mcr p15, 0, r1, c7, c10, 4 @ drain WB |
384 | mcr p15, 0, r0, c2, c0, 0 @ load page table pointer | 388 | mcr p15, 0, r0, c2, c0, 0 @ load page table pointer |
385 | mcr p15, 0, r1, c8, c7, 0 @ invalidate I & D TLBs | 389 | mcr p15, 0, r1, c8, c7, 0 @ invalidate I & D TLBs |
390 | #endif /* CONFIG_MMU */ | ||
386 | mov pc, lr | 391 | mov pc, lr |
387 | 392 | ||
388 | /* | 393 | /* |
@@ -392,6 +397,7 @@ ENTRY(cpu_arm1020_switch_mm) | |||
392 | */ | 397 | */ |
393 | .align 5 | 398 | .align 5 |
394 | ENTRY(cpu_arm1020_set_pte) | 399 | ENTRY(cpu_arm1020_set_pte) |
400 | #ifdef CONFIG_MMU | ||
395 | str r1, [r0], #-2048 @ linux version | 401 | str r1, [r0], #-2048 @ linux version |
396 | 402 | ||
397 | eor r1, r1, #L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_WRITE | L_PTE_DIRTY | 403 | eor r1, r1, #L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_WRITE | L_PTE_DIRTY |
@@ -421,6 +427,7 @@ ENTRY(cpu_arm1020_set_pte) | |||
421 | mcr p15, 0, r0, c7, c10, 1 @ clean D entry | 427 | mcr p15, 0, r0, c7, c10, 1 @ clean D entry |
422 | #endif | 428 | #endif |
423 | mcr p15, 0, r0, c7, c10, 4 @ drain WB | 429 | mcr p15, 0, r0, c7, c10, 4 @ drain WB |
430 | #endif /* CONFIG_MMU */ | ||
424 | mov pc, lr | 431 | mov pc, lr |
425 | 432 | ||
426 | __INIT | 433 | __INIT |
@@ -430,7 +437,9 @@ __arm1020_setup: | |||
430 | mov r0, #0 | 437 | mov r0, #0 |
431 | mcr p15, 0, r0, c7, c7 @ invalidate I,D caches on v4 | 438 | mcr p15, 0, r0, c7, c7 @ invalidate I,D caches on v4 |
432 | mcr p15, 0, r0, c7, c10, 4 @ drain write buffer on v4 | 439 | mcr p15, 0, r0, c7, c10, 4 @ drain write buffer on v4 |
440 | #ifdef CONFIG_MMU | ||
433 | mcr p15, 0, r0, c8, c7 @ invalidate I,D TLBs on v4 | 441 | mcr p15, 0, r0, c8, c7 @ invalidate I,D TLBs on v4 |
442 | #endif | ||
434 | mrc p15, 0, r0, c1, c0 @ get control register v4 | 443 | mrc p15, 0, r0, c1, c0 @ get control register v4 |
435 | ldr r5, arm1020_cr1_clear | 444 | ldr r5, arm1020_cr1_clear |
436 | bic r0, r0, r5 | 445 | bic r0, r0, r5 |
diff --git a/arch/arm/mm/proc-arm1020e.S b/arch/arm/mm/proc-arm1020e.S index be6d081ff2b7..bcd5ee022e00 100644 --- a/arch/arm/mm/proc-arm1020e.S +++ b/arch/arm/mm/proc-arm1020e.S | |||
@@ -3,6 +3,7 @@ | |||
3 | * | 3 | * |
4 | * Copyright (C) 2000 ARM Limited | 4 | * Copyright (C) 2000 ARM Limited |
5 | * Copyright (C) 2000 Deep Blue Solutions Ltd. | 5 | * Copyright (C) 2000 Deep Blue Solutions Ltd. |
6 | * hacked for non-paged-MM by Hyok S. Choi, 2003. | ||
6 | * | 7 | * |
7 | * This program is free software; you can redistribute it and/or modify | 8 | * This program is free software; you can redistribute it and/or modify |
8 | * it under the terms of the GNU General Public License as published by | 9 | * it under the terms of the GNU General Public License as published by |
@@ -101,7 +102,9 @@ ENTRY(cpu_arm1020e_reset) | |||
101 | mov ip, #0 | 102 | mov ip, #0 |
102 | mcr p15, 0, ip, c7, c7, 0 @ invalidate I,D caches | 103 | mcr p15, 0, ip, c7, c7, 0 @ invalidate I,D caches |
103 | mcr p15, 0, ip, c7, c10, 4 @ drain WB | 104 | mcr p15, 0, ip, c7, c10, 4 @ drain WB |
105 | #ifdef CONFIG_MMU | ||
104 | mcr p15, 0, ip, c8, c7, 0 @ invalidate I & D TLBs | 106 | mcr p15, 0, ip, c8, c7, 0 @ invalidate I & D TLBs |
107 | #endif | ||
105 | mrc p15, 0, ip, c1, c0, 0 @ ctrl register | 108 | mrc p15, 0, ip, c1, c0, 0 @ ctrl register |
106 | bic ip, ip, #0x000f @ ............wcam | 109 | bic ip, ip, #0x000f @ ............wcam |
107 | bic ip, ip, #0x1100 @ ...i...s........ | 110 | bic ip, ip, #0x1100 @ ...i...s........ |
@@ -344,6 +347,7 @@ ENTRY(cpu_arm1020e_dcache_clean_area) | |||
344 | */ | 347 | */ |
345 | .align 5 | 348 | .align 5 |
346 | ENTRY(cpu_arm1020e_switch_mm) | 349 | ENTRY(cpu_arm1020e_switch_mm) |
350 | #ifdef CONFIG_MMU | ||
347 | #ifndef CONFIG_CPU_DCACHE_DISABLE | 351 | #ifndef CONFIG_CPU_DCACHE_DISABLE |
348 | mcr p15, 0, r3, c7, c10, 4 | 352 | mcr p15, 0, r3, c7, c10, 4 |
349 | mov r1, #0xF @ 16 segments | 353 | mov r1, #0xF @ 16 segments |
@@ -367,6 +371,7 @@ ENTRY(cpu_arm1020e_switch_mm) | |||
367 | mcr p15, 0, r1, c7, c10, 4 @ drain WB | 371 | mcr p15, 0, r1, c7, c10, 4 @ drain WB |
368 | mcr p15, 0, r0, c2, c0, 0 @ load page table pointer | 372 | mcr p15, 0, r0, c2, c0, 0 @ load page table pointer |
369 | mcr p15, 0, r1, c8, c7, 0 @ invalidate I & D TLBs | 373 | mcr p15, 0, r1, c8, c7, 0 @ invalidate I & D TLBs |
374 | #endif | ||
370 | mov pc, lr | 375 | mov pc, lr |
371 | 376 | ||
372 | /* | 377 | /* |
@@ -376,6 +381,7 @@ ENTRY(cpu_arm1020e_switch_mm) | |||
376 | */ | 381 | */ |
377 | .align 5 | 382 | .align 5 |
378 | ENTRY(cpu_arm1020e_set_pte) | 383 | ENTRY(cpu_arm1020e_set_pte) |
384 | #ifdef CONFIG_MMU | ||
379 | str r1, [r0], #-2048 @ linux version | 385 | str r1, [r0], #-2048 @ linux version |
380 | 386 | ||
381 | eor r1, r1, #L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_WRITE | L_PTE_DIRTY | 387 | eor r1, r1, #L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_WRITE | L_PTE_DIRTY |
@@ -403,6 +409,7 @@ ENTRY(cpu_arm1020e_set_pte) | |||
403 | #ifndef CONFIG_CPU_DCACHE_DISABLE | 409 | #ifndef CONFIG_CPU_DCACHE_DISABLE |
404 | mcr p15, 0, r0, c7, c10, 1 @ clean D entry | 410 | mcr p15, 0, r0, c7, c10, 1 @ clean D entry |
405 | #endif | 411 | #endif |
412 | #endif /* CONFIG_MMU */ | ||
406 | mov pc, lr | 413 | mov pc, lr |
407 | 414 | ||
408 | __INIT | 415 | __INIT |
@@ -412,7 +419,9 @@ __arm1020e_setup: | |||
412 | mov r0, #0 | 419 | mov r0, #0 |
413 | mcr p15, 0, r0, c7, c7 @ invalidate I,D caches on v4 | 420 | mcr p15, 0, r0, c7, c7 @ invalidate I,D caches on v4 |
414 | mcr p15, 0, r0, c7, c10, 4 @ drain write buffer on v4 | 421 | mcr p15, 0, r0, c7, c10, 4 @ drain write buffer on v4 |
422 | #ifdef CONFIG_MMU | ||
415 | mcr p15, 0, r0, c8, c7 @ invalidate I,D TLBs on v4 | 423 | mcr p15, 0, r0, c8, c7 @ invalidate I,D TLBs on v4 |
424 | #endif | ||
416 | mrc p15, 0, r0, c1, c0 @ get control register v4 | 425 | mrc p15, 0, r0, c1, c0 @ get control register v4 |
417 | ldr r5, arm1020e_cr1_clear | 426 | ldr r5, arm1020e_cr1_clear |
418 | bic r0, r0, r5 | 427 | bic r0, r0, r5 |
diff --git a/arch/arm/mm/proc-arm1022.S b/arch/arm/mm/proc-arm1022.S index f778545d57a2..b0ccff4fadd2 100644 --- a/arch/arm/mm/proc-arm1022.S +++ b/arch/arm/mm/proc-arm1022.S | |||
@@ -3,6 +3,7 @@ | |||
3 | * | 3 | * |
4 | * Copyright (C) 2000 ARM Limited | 4 | * Copyright (C) 2000 ARM Limited |
5 | * Copyright (C) 2000 Deep Blue Solutions Ltd. | 5 | * Copyright (C) 2000 Deep Blue Solutions Ltd. |
6 | * hacked for non-paged-MM by Hyok S. Choi, 2003. | ||
6 | * | 7 | * |
7 | * This program is free software; you can redistribute it and/or modify | 8 | * This program is free software; you can redistribute it and/or modify |
8 | * it under the terms of the GNU General Public License as published by | 9 | * it under the terms of the GNU General Public License as published by |
@@ -90,7 +91,9 @@ ENTRY(cpu_arm1022_reset) | |||
90 | mov ip, #0 | 91 | mov ip, #0 |
91 | mcr p15, 0, ip, c7, c7, 0 @ invalidate I,D caches | 92 | mcr p15, 0, ip, c7, c7, 0 @ invalidate I,D caches |
92 | mcr p15, 0, ip, c7, c10, 4 @ drain WB | 93 | mcr p15, 0, ip, c7, c10, 4 @ drain WB |
94 | #ifdef CONFIG_MMU | ||
93 | mcr p15, 0, ip, c8, c7, 0 @ invalidate I & D TLBs | 95 | mcr p15, 0, ip, c8, c7, 0 @ invalidate I & D TLBs |
96 | #endif | ||
94 | mrc p15, 0, ip, c1, c0, 0 @ ctrl register | 97 | mrc p15, 0, ip, c1, c0, 0 @ ctrl register |
95 | bic ip, ip, #0x000f @ ............wcam | 98 | bic ip, ip, #0x000f @ ............wcam |
96 | bic ip, ip, #0x1100 @ ...i...s........ | 99 | bic ip, ip, #0x1100 @ ...i...s........ |
@@ -333,6 +336,7 @@ ENTRY(cpu_arm1022_dcache_clean_area) | |||
333 | */ | 336 | */ |
334 | .align 5 | 337 | .align 5 |
335 | ENTRY(cpu_arm1022_switch_mm) | 338 | ENTRY(cpu_arm1022_switch_mm) |
339 | #ifdef CONFIG_MMU | ||
336 | #ifndef CONFIG_CPU_DCACHE_DISABLE | 340 | #ifndef CONFIG_CPU_DCACHE_DISABLE |
337 | mov r1, #(CACHE_DSEGMENTS - 1) << 5 @ 16 segments | 341 | mov r1, #(CACHE_DSEGMENTS - 1) << 5 @ 16 segments |
338 | 1: orr r3, r1, #(CACHE_DENTRIES - 1) << 26 @ 64 entries | 342 | 1: orr r3, r1, #(CACHE_DENTRIES - 1) << 26 @ 64 entries |
@@ -349,6 +353,7 @@ ENTRY(cpu_arm1022_switch_mm) | |||
349 | mcr p15, 0, r1, c7, c10, 4 @ drain WB | 353 | mcr p15, 0, r1, c7, c10, 4 @ drain WB |
350 | mcr p15, 0, r0, c2, c0, 0 @ load page table pointer | 354 | mcr p15, 0, r0, c2, c0, 0 @ load page table pointer |
351 | mcr p15, 0, r1, c8, c7, 0 @ invalidate I & D TLBs | 355 | mcr p15, 0, r1, c8, c7, 0 @ invalidate I & D TLBs |
356 | #endif | ||
352 | mov pc, lr | 357 | mov pc, lr |
353 | 358 | ||
354 | /* | 359 | /* |
@@ -358,6 +363,7 @@ ENTRY(cpu_arm1022_switch_mm) | |||
358 | */ | 363 | */ |
359 | .align 5 | 364 | .align 5 |
360 | ENTRY(cpu_arm1022_set_pte) | 365 | ENTRY(cpu_arm1022_set_pte) |
366 | #ifdef CONFIG_MMU | ||
361 | str r1, [r0], #-2048 @ linux version | 367 | str r1, [r0], #-2048 @ linux version |
362 | 368 | ||
363 | eor r1, r1, #L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_WRITE | L_PTE_DIRTY | 369 | eor r1, r1, #L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_WRITE | L_PTE_DIRTY |
@@ -385,6 +391,7 @@ ENTRY(cpu_arm1022_set_pte) | |||
385 | #ifndef CONFIG_CPU_DCACHE_DISABLE | 391 | #ifndef CONFIG_CPU_DCACHE_DISABLE |
386 | mcr p15, 0, r0, c7, c10, 1 @ clean D entry | 392 | mcr p15, 0, r0, c7, c10, 1 @ clean D entry |
387 | #endif | 393 | #endif |
394 | #endif /* CONFIG_MMU */ | ||
388 | mov pc, lr | 395 | mov pc, lr |
389 | 396 | ||
390 | __INIT | 397 | __INIT |
@@ -394,7 +401,9 @@ __arm1022_setup: | |||
394 | mov r0, #0 | 401 | mov r0, #0 |
395 | mcr p15, 0, r0, c7, c7 @ invalidate I,D caches on v4 | 402 | mcr p15, 0, r0, c7, c7 @ invalidate I,D caches on v4 |
396 | mcr p15, 0, r0, c7, c10, 4 @ drain write buffer on v4 | 403 | mcr p15, 0, r0, c7, c10, 4 @ drain write buffer on v4 |
404 | #ifdef CONFIG_MMU | ||
397 | mcr p15, 0, r0, c8, c7 @ invalidate I,D TLBs on v4 | 405 | mcr p15, 0, r0, c8, c7 @ invalidate I,D TLBs on v4 |
406 | #endif | ||
398 | mrc p15, 0, r0, c1, c0 @ get control register v4 | 407 | mrc p15, 0, r0, c1, c0 @ get control register v4 |
399 | ldr r5, arm1022_cr1_clear | 408 | ldr r5, arm1022_cr1_clear |
400 | bic r0, r0, r5 | 409 | bic r0, r0, r5 |
diff --git a/arch/arm/mm/proc-arm1026.S b/arch/arm/mm/proc-arm1026.S index 148c111fde73..abe850c9a641 100644 --- a/arch/arm/mm/proc-arm1026.S +++ b/arch/arm/mm/proc-arm1026.S | |||
@@ -3,6 +3,7 @@ | |||
3 | * | 3 | * |
4 | * Copyright (C) 2000 ARM Limited | 4 | * Copyright (C) 2000 ARM Limited |
5 | * Copyright (C) 2000 Deep Blue Solutions Ltd. | 5 | * Copyright (C) 2000 Deep Blue Solutions Ltd. |
6 | * hacked for non-paged-MM by Hyok S. Choi, 2003. | ||
6 | * | 7 | * |
7 | * This program is free software; you can redistribute it and/or modify | 8 | * This program is free software; you can redistribute it and/or modify |
8 | * it under the terms of the GNU General Public License as published by | 9 | * it under the terms of the GNU General Public License as published by |
@@ -90,7 +91,9 @@ ENTRY(cpu_arm1026_reset) | |||
90 | mov ip, #0 | 91 | mov ip, #0 |
91 | mcr p15, 0, ip, c7, c7, 0 @ invalidate I,D caches | 92 | mcr p15, 0, ip, c7, c7, 0 @ invalidate I,D caches |
92 | mcr p15, 0, ip, c7, c10, 4 @ drain WB | 93 | mcr p15, 0, ip, c7, c10, 4 @ drain WB |
94 | #ifdef CONFIG_MMU | ||
93 | mcr p15, 0, ip, c8, c7, 0 @ invalidate I & D TLBs | 95 | mcr p15, 0, ip, c8, c7, 0 @ invalidate I & D TLBs |
96 | #endif | ||
94 | mrc p15, 0, ip, c1, c0, 0 @ ctrl register | 97 | mrc p15, 0, ip, c1, c0, 0 @ ctrl register |
95 | bic ip, ip, #0x000f @ ............wcam | 98 | bic ip, ip, #0x000f @ ............wcam |
96 | bic ip, ip, #0x1100 @ ...i...s........ | 99 | bic ip, ip, #0x1100 @ ...i...s........ |
@@ -327,6 +330,7 @@ ENTRY(cpu_arm1026_dcache_clean_area) | |||
327 | */ | 330 | */ |
328 | .align 5 | 331 | .align 5 |
329 | ENTRY(cpu_arm1026_switch_mm) | 332 | ENTRY(cpu_arm1026_switch_mm) |
333 | #ifdef CONFIG_MMU | ||
330 | mov r1, #0 | 334 | mov r1, #0 |
331 | #ifndef CONFIG_CPU_DCACHE_DISABLE | 335 | #ifndef CONFIG_CPU_DCACHE_DISABLE |
332 | 1: mrc p15, 0, r15, c7, c14, 3 @ test, clean, invalidate | 336 | 1: mrc p15, 0, r15, c7, c14, 3 @ test, clean, invalidate |
@@ -338,6 +342,7 @@ ENTRY(cpu_arm1026_switch_mm) | |||
338 | mcr p15, 0, r1, c7, c10, 4 @ drain WB | 342 | mcr p15, 0, r1, c7, c10, 4 @ drain WB |
339 | mcr p15, 0, r0, c2, c0, 0 @ load page table pointer | 343 | mcr p15, 0, r0, c2, c0, 0 @ load page table pointer |
340 | mcr p15, 0, r1, c8, c7, 0 @ invalidate I & D TLBs | 344 | mcr p15, 0, r1, c8, c7, 0 @ invalidate I & D TLBs |
345 | #endif | ||
341 | mov pc, lr | 346 | mov pc, lr |
342 | 347 | ||
343 | /* | 348 | /* |
@@ -347,6 +352,7 @@ ENTRY(cpu_arm1026_switch_mm) | |||
347 | */ | 352 | */ |
348 | .align 5 | 353 | .align 5 |
349 | ENTRY(cpu_arm1026_set_pte) | 354 | ENTRY(cpu_arm1026_set_pte) |
355 | #ifdef CONFIG_MMU | ||
350 | str r1, [r0], #-2048 @ linux version | 356 | str r1, [r0], #-2048 @ linux version |
351 | 357 | ||
352 | eor r1, r1, #L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_WRITE | L_PTE_DIRTY | 358 | eor r1, r1, #L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_WRITE | L_PTE_DIRTY |
@@ -374,6 +380,7 @@ ENTRY(cpu_arm1026_set_pte) | |||
374 | #ifndef CONFIG_CPU_DCACHE_DISABLE | 380 | #ifndef CONFIG_CPU_DCACHE_DISABLE |
375 | mcr p15, 0, r0, c7, c10, 1 @ clean D entry | 381 | mcr p15, 0, r0, c7, c10, 1 @ clean D entry |
376 | #endif | 382 | #endif |
383 | #endif /* CONFIG_MMU */ | ||
377 | mov pc, lr | 384 | mov pc, lr |
378 | 385 | ||
379 | 386 | ||
@@ -384,8 +391,10 @@ __arm1026_setup: | |||
384 | mov r0, #0 | 391 | mov r0, #0 |
385 | mcr p15, 0, r0, c7, c7 @ invalidate I,D caches on v4 | 392 | mcr p15, 0, r0, c7, c7 @ invalidate I,D caches on v4 |
386 | mcr p15, 0, r0, c7, c10, 4 @ drain write buffer on v4 | 393 | mcr p15, 0, r0, c7, c10, 4 @ drain write buffer on v4 |
394 | #ifdef CONFIG_MMU | ||
387 | mcr p15, 0, r0, c8, c7 @ invalidate I,D TLBs on v4 | 395 | mcr p15, 0, r0, c8, c7 @ invalidate I,D TLBs on v4 |
388 | mcr p15, 0, r4, c2, c0 @ load page table pointer | 396 | mcr p15, 0, r4, c2, c0 @ load page table pointer |
397 | #endif | ||
389 | #ifdef CONFIG_CPU_DCACHE_WRITETHROUGH | 398 | #ifdef CONFIG_CPU_DCACHE_WRITETHROUGH |
390 | mov r0, #4 @ explicitly disable writeback | 399 | mov r0, #4 @ explicitly disable writeback |
391 | mcr p15, 7, r0, c15, c0, 0 | 400 | mcr p15, 7, r0, c15, c0, 0 |
diff --git a/arch/arm/mm/proc-arm6_7.S b/arch/arm/mm/proc-arm6_7.S index 540359b475d0..7a705edfa4b2 100644 --- a/arch/arm/mm/proc-arm6_7.S +++ b/arch/arm/mm/proc-arm6_7.S | |||
@@ -2,6 +2,7 @@ | |||
2 | * linux/arch/arm/mm/proc-arm6,7.S | 2 | * linux/arch/arm/mm/proc-arm6,7.S |
3 | * | 3 | * |
4 | * Copyright (C) 1997-2000 Russell King | 4 | * Copyright (C) 1997-2000 Russell King |
5 | * hacked for non-paged-MM by Hyok S. Choi, 2003. | ||
5 | * | 6 | * |
6 | * This program is free software; you can redistribute it and/or modify | 7 | * This program is free software; you can redistribute it and/or modify |
7 | * it under the terms of the GNU General Public License version 2 as | 8 | * it under the terms of the GNU General Public License version 2 as |
@@ -199,10 +200,12 @@ ENTRY(cpu_arm7_do_idle) | |||
199 | */ | 200 | */ |
200 | ENTRY(cpu_arm6_switch_mm) | 201 | ENTRY(cpu_arm6_switch_mm) |
201 | ENTRY(cpu_arm7_switch_mm) | 202 | ENTRY(cpu_arm7_switch_mm) |
203 | #ifdef CONFIG_MMU | ||
202 | mov r1, #0 | 204 | mov r1, #0 |
203 | mcr p15, 0, r1, c7, c0, 0 @ flush cache | 205 | mcr p15, 0, r1, c7, c0, 0 @ flush cache |
204 | mcr p15, 0, r0, c2, c0, 0 @ update page table ptr | 206 | mcr p15, 0, r0, c2, c0, 0 @ update page table ptr |
205 | mcr p15, 0, r1, c5, c0, 0 @ flush TLBs | 207 | mcr p15, 0, r1, c5, c0, 0 @ flush TLBs |
208 | #endif | ||
206 | mov pc, lr | 209 | mov pc, lr |
207 | 210 | ||
208 | /* | 211 | /* |
@@ -214,6 +217,7 @@ ENTRY(cpu_arm7_switch_mm) | |||
214 | .align 5 | 217 | .align 5 |
215 | ENTRY(cpu_arm6_set_pte) | 218 | ENTRY(cpu_arm6_set_pte) |
216 | ENTRY(cpu_arm7_set_pte) | 219 | ENTRY(cpu_arm7_set_pte) |
220 | #ifdef CONFIG_MMU | ||
217 | str r1, [r0], #-2048 @ linux version | 221 | str r1, [r0], #-2048 @ linux version |
218 | 222 | ||
219 | eor r1, r1, #L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_WRITE | L_PTE_DIRTY | 223 | eor r1, r1, #L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_WRITE | L_PTE_DIRTY |
@@ -232,6 +236,7 @@ ENTRY(cpu_arm7_set_pte) | |||
232 | movne r2, #0 | 236 | movne r2, #0 |
233 | 237 | ||
234 | str r2, [r0] @ hardware version | 238 | str r2, [r0] @ hardware version |
239 | #endif /* CONFIG_MMU */ | ||
235 | mov pc, lr | 240 | mov pc, lr |
236 | 241 | ||
237 | /* | 242 | /* |
@@ -243,7 +248,9 @@ ENTRY(cpu_arm6_reset) | |||
243 | ENTRY(cpu_arm7_reset) | 248 | ENTRY(cpu_arm7_reset) |
244 | mov r1, #0 | 249 | mov r1, #0 |
245 | mcr p15, 0, r1, c7, c0, 0 @ flush cache | 250 | mcr p15, 0, r1, c7, c0, 0 @ flush cache |
251 | #ifdef CONFIG_MMU | ||
246 | mcr p15, 0, r1, c5, c0, 0 @ flush TLB | 252 | mcr p15, 0, r1, c5, c0, 0 @ flush TLB |
253 | #endif | ||
247 | mov r1, #0x30 | 254 | mov r1, #0x30 |
248 | mcr p15, 0, r1, c1, c0, 0 @ turn off MMU etc | 255 | mcr p15, 0, r1, c1, c0, 0 @ turn off MMU etc |
249 | mov pc, r0 | 256 | mov pc, r0 |
@@ -253,19 +260,27 @@ ENTRY(cpu_arm7_reset) | |||
253 | .type __arm6_setup, #function | 260 | .type __arm6_setup, #function |
254 | __arm6_setup: mov r0, #0 | 261 | __arm6_setup: mov r0, #0 |
255 | mcr p15, 0, r0, c7, c0 @ flush caches on v3 | 262 | mcr p15, 0, r0, c7, c0 @ flush caches on v3 |
263 | #ifdef CONFIG_MMU | ||
256 | mcr p15, 0, r0, c5, c0 @ flush TLBs on v3 | 264 | mcr p15, 0, r0, c5, c0 @ flush TLBs on v3 |
257 | mov r0, #0x3d @ . ..RS BLDP WCAM | 265 | mov r0, #0x3d @ . ..RS BLDP WCAM |
258 | orr r0, r0, #0x100 @ . ..01 0011 1101 | 266 | orr r0, r0, #0x100 @ . ..01 0011 1101 |
267 | #else | ||
268 | mov r0, #0x3c @ . ..RS BLDP WCA. | ||
269 | #endif | ||
259 | mov pc, lr | 270 | mov pc, lr |
260 | .size __arm6_setup, . - __arm6_setup | 271 | .size __arm6_setup, . - __arm6_setup |
261 | 272 | ||
262 | .type __arm7_setup, #function | 273 | .type __arm7_setup, #function |
263 | __arm7_setup: mov r0, #0 | 274 | __arm7_setup: mov r0, #0 |
264 | mcr p15, 0, r0, c7, c0 @ flush caches on v3 | 275 | mcr p15, 0, r0, c7, c0 @ flush caches on v3 |
276 | #ifdef CONFIG_MMU | ||
265 | mcr p15, 0, r0, c5, c0 @ flush TLBs on v3 | 277 | mcr p15, 0, r0, c5, c0 @ flush TLBs on v3 |
266 | mcr p15, 0, r0, c3, c0 @ load domain access register | 278 | mcr p15, 0, r0, c3, c0 @ load domain access register |
267 | mov r0, #0x7d @ . ..RS BLDP WCAM | 279 | mov r0, #0x7d @ . ..RS BLDP WCAM |
268 | orr r0, r0, #0x100 @ . ..01 0111 1101 | 280 | orr r0, r0, #0x100 @ . ..01 0111 1101 |
281 | #else | ||
282 | mov r0, #0x7c @ . ..RS BLDP WCA. | ||
283 | #endif | ||
269 | mov pc, lr | 284 | mov pc, lr |
270 | .size __arm7_setup, . - __arm7_setup | 285 | .size __arm7_setup, . - __arm7_setup |
271 | 286 | ||
diff --git a/arch/arm/mm/proc-arm720.S b/arch/arm/mm/proc-arm720.S index 26f00ee2ad9a..86102467d37f 100644 --- a/arch/arm/mm/proc-arm720.S +++ b/arch/arm/mm/proc-arm720.S | |||
@@ -4,6 +4,7 @@ | |||
4 | * Copyright (C) 2000 Steve Hill (sjhill@cotw.com) | 4 | * Copyright (C) 2000 Steve Hill (sjhill@cotw.com) |
5 | * Rob Scott (rscott@mtrob.fdns.net) | 5 | * Rob Scott (rscott@mtrob.fdns.net) |
6 | * Copyright (C) 2000 ARM Limited, Deep Blue Solutions Ltd. | 6 | * Copyright (C) 2000 ARM Limited, Deep Blue Solutions Ltd. |
7 | * hacked for non-paged-MM by Hyok S. Choi, 2004. | ||
7 | * | 8 | * |
8 | * This program is free software; you can redistribute it and/or modify | 9 | * This program is free software; you can redistribute it and/or modify |
9 | * it under the terms of the GNU General Public License as published by | 10 | * it under the terms of the GNU General Public License as published by |
@@ -29,6 +30,7 @@ | |||
29 | * out of 'proc-arm6,7.S' per RMK discussion | 30 | * out of 'proc-arm6,7.S' per RMK discussion |
30 | * 07-25-2000 SJH Added idle function. | 31 | * 07-25-2000 SJH Added idle function. |
31 | * 08-25-2000 DBS Updated for integration of ARM Ltd version. | 32 | * 08-25-2000 DBS Updated for integration of ARM Ltd version. |
33 | * 04-20-2004 HSC modified for non-paged memory management mode. | ||
32 | */ | 34 | */ |
33 | #include <linux/linkage.h> | 35 | #include <linux/linkage.h> |
34 | #include <linux/init.h> | 36 | #include <linux/init.h> |
@@ -75,10 +77,12 @@ ENTRY(cpu_arm720_do_idle) | |||
75 | * the new. | 77 | * the new. |
76 | */ | 78 | */ |
77 | ENTRY(cpu_arm720_switch_mm) | 79 | ENTRY(cpu_arm720_switch_mm) |
80 | #ifdef CONFIG_MMU | ||
78 | mov r1, #0 | 81 | mov r1, #0 |
79 | mcr p15, 0, r1, c7, c7, 0 @ invalidate cache | 82 | mcr p15, 0, r1, c7, c7, 0 @ invalidate cache |
80 | mcr p15, 0, r0, c2, c0, 0 @ update page table ptr | 83 | mcr p15, 0, r0, c2, c0, 0 @ update page table ptr |
81 | mcr p15, 0, r1, c8, c7, 0 @ flush TLB (v4) | 84 | mcr p15, 0, r1, c8, c7, 0 @ flush TLB (v4) |
85 | #endif | ||
82 | mov pc, lr | 86 | mov pc, lr |
83 | 87 | ||
84 | /* | 88 | /* |
@@ -89,6 +93,7 @@ ENTRY(cpu_arm720_switch_mm) | |||
89 | */ | 93 | */ |
90 | .align 5 | 94 | .align 5 |
91 | ENTRY(cpu_arm720_set_pte) | 95 | ENTRY(cpu_arm720_set_pte) |
96 | #ifdef CONFIG_MMU | ||
92 | str r1, [r0], #-2048 @ linux version | 97 | str r1, [r0], #-2048 @ linux version |
93 | 98 | ||
94 | eor r1, r1, #L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_WRITE | L_PTE_DIRTY | 99 | eor r1, r1, #L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_WRITE | L_PTE_DIRTY |
@@ -107,6 +112,7 @@ ENTRY(cpu_arm720_set_pte) | |||
107 | movne r2, #0 | 112 | movne r2, #0 |
108 | 113 | ||
109 | str r2, [r0] @ hardware version | 114 | str r2, [r0] @ hardware version |
115 | #endif | ||
110 | mov pc, lr | 116 | mov pc, lr |
111 | 117 | ||
112 | /* | 118 | /* |
@@ -117,7 +123,9 @@ ENTRY(cpu_arm720_set_pte) | |||
117 | ENTRY(cpu_arm720_reset) | 123 | ENTRY(cpu_arm720_reset) |
118 | mov ip, #0 | 124 | mov ip, #0 |
119 | mcr p15, 0, ip, c7, c7, 0 @ invalidate cache | 125 | mcr p15, 0, ip, c7, c7, 0 @ invalidate cache |
126 | #ifdef CONFIG_MMU | ||
120 | mcr p15, 0, ip, c8, c7, 0 @ flush TLB (v4) | 127 | mcr p15, 0, ip, c8, c7, 0 @ flush TLB (v4) |
128 | #endif | ||
121 | mrc p15, 0, ip, c1, c0, 0 @ get ctrl register | 129 | mrc p15, 0, ip, c1, c0, 0 @ get ctrl register |
122 | bic ip, ip, #0x000f @ ............wcam | 130 | bic ip, ip, #0x000f @ ............wcam |
123 | bic ip, ip, #0x2100 @ ..v....s........ | 131 | bic ip, ip, #0x2100 @ ..v....s........ |
@@ -130,7 +138,9 @@ ENTRY(cpu_arm720_reset) | |||
130 | __arm710_setup: | 138 | __arm710_setup: |
131 | mov r0, #0 | 139 | mov r0, #0 |
132 | mcr p15, 0, r0, c7, c7, 0 @ invalidate caches | 140 | mcr p15, 0, r0, c7, c7, 0 @ invalidate caches |
141 | #ifdef CONFIG_MMU | ||
133 | mcr p15, 0, r0, c8, c7, 0 @ flush TLB (v4) | 142 | mcr p15, 0, r0, c8, c7, 0 @ flush TLB (v4) |
143 | #endif | ||
134 | mrc p15, 0, r0, c1, c0 @ get control register | 144 | mrc p15, 0, r0, c1, c0 @ get control register |
135 | ldr r5, arm710_cr1_clear | 145 | ldr r5, arm710_cr1_clear |
136 | bic r0, r0, r5 | 146 | bic r0, r0, r5 |
@@ -156,7 +166,9 @@ arm710_cr1_set: | |||
156 | __arm720_setup: | 166 | __arm720_setup: |
157 | mov r0, #0 | 167 | mov r0, #0 |
158 | mcr p15, 0, r0, c7, c7, 0 @ invalidate caches | 168 | mcr p15, 0, r0, c7, c7, 0 @ invalidate caches |
169 | #ifdef CONFIG_MMU | ||
159 | mcr p15, 0, r0, c8, c7, 0 @ flush TLB (v4) | 170 | mcr p15, 0, r0, c8, c7, 0 @ flush TLB (v4) |
171 | #endif | ||
160 | mrc p15, 0, r0, c1, c0 @ get control register | 172 | mrc p15, 0, r0, c1, c0 @ get control register |
161 | ldr r5, arm720_cr1_clear | 173 | ldr r5, arm720_cr1_clear |
162 | bic r0, r0, r5 | 174 | bic r0, r0, r5 |
diff --git a/arch/arm/mm/proc-arm920.S b/arch/arm/mm/proc-arm920.S index a17f79e0199c..31dc839ba07c 100644 --- a/arch/arm/mm/proc-arm920.S +++ b/arch/arm/mm/proc-arm920.S | |||
@@ -3,6 +3,7 @@ | |||
3 | * | 3 | * |
4 | * Copyright (C) 1999,2000 ARM Limited | 4 | * Copyright (C) 1999,2000 ARM Limited |
5 | * Copyright (C) 2000 Deep Blue Solutions Ltd. | 5 | * Copyright (C) 2000 Deep Blue Solutions Ltd. |
6 | * hacked for non-paged-MM by Hyok S. Choi, 2003. | ||
6 | * | 7 | * |
7 | * This program is free software; you can redistribute it and/or modify | 8 | * This program is free software; you can redistribute it and/or modify |
8 | * it under the terms of the GNU General Public License as published by | 9 | * it under the terms of the GNU General Public License as published by |
@@ -97,7 +98,9 @@ ENTRY(cpu_arm920_reset) | |||
97 | mov ip, #0 | 98 | mov ip, #0 |
98 | mcr p15, 0, ip, c7, c7, 0 @ invalidate I,D caches | 99 | mcr p15, 0, ip, c7, c7, 0 @ invalidate I,D caches |
99 | mcr p15, 0, ip, c7, c10, 4 @ drain WB | 100 | mcr p15, 0, ip, c7, c10, 4 @ drain WB |
101 | #ifdef CONFIG_MMU | ||
100 | mcr p15, 0, ip, c8, c7, 0 @ invalidate I & D TLBs | 102 | mcr p15, 0, ip, c8, c7, 0 @ invalidate I & D TLBs |
103 | #endif | ||
101 | mrc p15, 0, ip, c1, c0, 0 @ ctrl register | 104 | mrc p15, 0, ip, c1, c0, 0 @ ctrl register |
102 | bic ip, ip, #0x000f @ ............wcam | 105 | bic ip, ip, #0x000f @ ............wcam |
103 | bic ip, ip, #0x1100 @ ...i...s........ | 106 | bic ip, ip, #0x1100 @ ...i...s........ |
@@ -317,6 +320,7 @@ ENTRY(cpu_arm920_dcache_clean_area) | |||
317 | */ | 320 | */ |
318 | .align 5 | 321 | .align 5 |
319 | ENTRY(cpu_arm920_switch_mm) | 322 | ENTRY(cpu_arm920_switch_mm) |
323 | #ifdef CONFIG_MMU | ||
320 | mov ip, #0 | 324 | mov ip, #0 |
321 | #ifdef CONFIG_CPU_DCACHE_WRITETHROUGH | 325 | #ifdef CONFIG_CPU_DCACHE_WRITETHROUGH |
322 | mcr p15, 0, ip, c7, c6, 0 @ invalidate D cache | 326 | mcr p15, 0, ip, c7, c6, 0 @ invalidate D cache |
@@ -337,6 +341,7 @@ ENTRY(cpu_arm920_switch_mm) | |||
337 | mcr p15, 0, ip, c7, c10, 4 @ drain WB | 341 | mcr p15, 0, ip, c7, c10, 4 @ drain WB |
338 | mcr p15, 0, r0, c2, c0, 0 @ load page table pointer | 342 | mcr p15, 0, r0, c2, c0, 0 @ load page table pointer |
339 | mcr p15, 0, ip, c8, c7, 0 @ invalidate I & D TLBs | 343 | mcr p15, 0, ip, c8, c7, 0 @ invalidate I & D TLBs |
344 | #endif | ||
340 | mov pc, lr | 345 | mov pc, lr |
341 | 346 | ||
342 | /* | 347 | /* |
@@ -346,6 +351,7 @@ ENTRY(cpu_arm920_switch_mm) | |||
346 | */ | 351 | */ |
347 | .align 5 | 352 | .align 5 |
348 | ENTRY(cpu_arm920_set_pte) | 353 | ENTRY(cpu_arm920_set_pte) |
354 | #ifdef CONFIG_MMU | ||
349 | str r1, [r0], #-2048 @ linux version | 355 | str r1, [r0], #-2048 @ linux version |
350 | 356 | ||
351 | eor r1, r1, #L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_WRITE | L_PTE_DIRTY | 357 | eor r1, r1, #L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_WRITE | L_PTE_DIRTY |
@@ -372,6 +378,7 @@ ENTRY(cpu_arm920_set_pte) | |||
372 | mov r0, r0 | 378 | mov r0, r0 |
373 | mcr p15, 0, r0, c7, c10, 1 @ clean D entry | 379 | mcr p15, 0, r0, c7, c10, 1 @ clean D entry |
374 | mcr p15, 0, r0, c7, c10, 4 @ drain WB | 380 | mcr p15, 0, r0, c7, c10, 4 @ drain WB |
381 | #endif /* CONFIG_MMU */ | ||
375 | mov pc, lr | 382 | mov pc, lr |
376 | 383 | ||
377 | __INIT | 384 | __INIT |
@@ -381,7 +388,9 @@ __arm920_setup: | |||
381 | mov r0, #0 | 388 | mov r0, #0 |
382 | mcr p15, 0, r0, c7, c7 @ invalidate I,D caches on v4 | 389 | mcr p15, 0, r0, c7, c7 @ invalidate I,D caches on v4 |
383 | mcr p15, 0, r0, c7, c10, 4 @ drain write buffer on v4 | 390 | mcr p15, 0, r0, c7, c10, 4 @ drain write buffer on v4 |
391 | #ifdef CONFIG_MMU | ||
384 | mcr p15, 0, r0, c8, c7 @ invalidate I,D TLBs on v4 | 392 | mcr p15, 0, r0, c8, c7 @ invalidate I,D TLBs on v4 |
393 | #endif | ||
385 | mrc p15, 0, r0, c1, c0 @ get control register v4 | 394 | mrc p15, 0, r0, c1, c0 @ get control register v4 |
386 | ldr r5, arm920_cr1_clear | 395 | ldr r5, arm920_cr1_clear |
387 | bic r0, r0, r5 | 396 | bic r0, r0, r5 |
diff --git a/arch/arm/mm/proc-arm922.S b/arch/arm/mm/proc-arm922.S index bbde4a024a48..9e57c34f5c09 100644 --- a/arch/arm/mm/proc-arm922.S +++ b/arch/arm/mm/proc-arm922.S | |||
@@ -4,6 +4,7 @@ | |||
4 | * Copyright (C) 1999,2000 ARM Limited | 4 | * Copyright (C) 1999,2000 ARM Limited |
5 | * Copyright (C) 2000 Deep Blue Solutions Ltd. | 5 | * Copyright (C) 2000 Deep Blue Solutions Ltd. |
6 | * Copyright (C) 2001 Altera Corporation | 6 | * Copyright (C) 2001 Altera Corporation |
7 | * hacked for non-paged-MM by Hyok S. Choi, 2003. | ||
7 | * | 8 | * |
8 | * This program is free software; you can redistribute it and/or modify | 9 | * This program is free software; you can redistribute it and/or modify |
9 | * it under the terms of the GNU General Public License as published by | 10 | * it under the terms of the GNU General Public License as published by |
@@ -99,7 +100,9 @@ ENTRY(cpu_arm922_reset) | |||
99 | mov ip, #0 | 100 | mov ip, #0 |
100 | mcr p15, 0, ip, c7, c7, 0 @ invalidate I,D caches | 101 | mcr p15, 0, ip, c7, c7, 0 @ invalidate I,D caches |
101 | mcr p15, 0, ip, c7, c10, 4 @ drain WB | 102 | mcr p15, 0, ip, c7, c10, 4 @ drain WB |
103 | #ifdef CONFIG_MMU | ||
102 | mcr p15, 0, ip, c8, c7, 0 @ invalidate I & D TLBs | 104 | mcr p15, 0, ip, c8, c7, 0 @ invalidate I & D TLBs |
105 | #endif | ||
103 | mrc p15, 0, ip, c1, c0, 0 @ ctrl register | 106 | mrc p15, 0, ip, c1, c0, 0 @ ctrl register |
104 | bic ip, ip, #0x000f @ ............wcam | 107 | bic ip, ip, #0x000f @ ............wcam |
105 | bic ip, ip, #0x1100 @ ...i...s........ | 108 | bic ip, ip, #0x1100 @ ...i...s........ |
@@ -321,6 +324,7 @@ ENTRY(cpu_arm922_dcache_clean_area) | |||
321 | */ | 324 | */ |
322 | .align 5 | 325 | .align 5 |
323 | ENTRY(cpu_arm922_switch_mm) | 326 | ENTRY(cpu_arm922_switch_mm) |
327 | #ifdef CONFIG_MMU | ||
324 | mov ip, #0 | 328 | mov ip, #0 |
325 | #ifdef CONFIG_CPU_DCACHE_WRITETHROUGH | 329 | #ifdef CONFIG_CPU_DCACHE_WRITETHROUGH |
326 | mcr p15, 0, ip, c7, c6, 0 @ invalidate D cache | 330 | mcr p15, 0, ip, c7, c6, 0 @ invalidate D cache |
@@ -341,6 +345,7 @@ ENTRY(cpu_arm922_switch_mm) | |||
341 | mcr p15, 0, ip, c7, c10, 4 @ drain WB | 345 | mcr p15, 0, ip, c7, c10, 4 @ drain WB |
342 | mcr p15, 0, r0, c2, c0, 0 @ load page table pointer | 346 | mcr p15, 0, r0, c2, c0, 0 @ load page table pointer |
343 | mcr p15, 0, ip, c8, c7, 0 @ invalidate I & D TLBs | 347 | mcr p15, 0, ip, c8, c7, 0 @ invalidate I & D TLBs |
348 | #endif | ||
344 | mov pc, lr | 349 | mov pc, lr |
345 | 350 | ||
346 | /* | 351 | /* |
@@ -350,6 +355,7 @@ ENTRY(cpu_arm922_switch_mm) | |||
350 | */ | 355 | */ |
351 | .align 5 | 356 | .align 5 |
352 | ENTRY(cpu_arm922_set_pte) | 357 | ENTRY(cpu_arm922_set_pte) |
358 | #ifdef CONFIG_MMU | ||
353 | str r1, [r0], #-2048 @ linux version | 359 | str r1, [r0], #-2048 @ linux version |
354 | 360 | ||
355 | eor r1, r1, #L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_WRITE | L_PTE_DIRTY | 361 | eor r1, r1, #L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_WRITE | L_PTE_DIRTY |
@@ -376,6 +382,7 @@ ENTRY(cpu_arm922_set_pte) | |||
376 | mov r0, r0 | 382 | mov r0, r0 |
377 | mcr p15, 0, r0, c7, c10, 1 @ clean D entry | 383 | mcr p15, 0, r0, c7, c10, 1 @ clean D entry |
378 | mcr p15, 0, r0, c7, c10, 4 @ drain WB | 384 | mcr p15, 0, r0, c7, c10, 4 @ drain WB |
385 | #endif /* CONFIG_MMU */ | ||
379 | mov pc, lr | 386 | mov pc, lr |
380 | 387 | ||
381 | __INIT | 388 | __INIT |
@@ -385,7 +392,9 @@ __arm922_setup: | |||
385 | mov r0, #0 | 392 | mov r0, #0 |
386 | mcr p15, 0, r0, c7, c7 @ invalidate I,D caches on v4 | 393 | mcr p15, 0, r0, c7, c7 @ invalidate I,D caches on v4 |
387 | mcr p15, 0, r0, c7, c10, 4 @ drain write buffer on v4 | 394 | mcr p15, 0, r0, c7, c10, 4 @ drain write buffer on v4 |
395 | #ifdef CONFIG_MMU | ||
388 | mcr p15, 0, r0, c8, c7 @ invalidate I,D TLBs on v4 | 396 | mcr p15, 0, r0, c8, c7 @ invalidate I,D TLBs on v4 |
397 | #endif | ||
389 | mrc p15, 0, r0, c1, c0 @ get control register v4 | 398 | mrc p15, 0, r0, c1, c0 @ get control register v4 |
390 | ldr r5, arm922_cr1_clear | 399 | ldr r5, arm922_cr1_clear |
391 | bic r0, r0, r5 | 400 | bic r0, r0, r5 |
diff --git a/arch/arm/mm/proc-arm925.S b/arch/arm/mm/proc-arm925.S index 224ce226a01b..8d47c9f3f931 100644 --- a/arch/arm/mm/proc-arm925.S +++ b/arch/arm/mm/proc-arm925.S | |||
@@ -9,6 +9,8 @@ | |||
9 | * Update for Linux-2.6 and cache flush improvements | 9 | * Update for Linux-2.6 and cache flush improvements |
10 | * Copyright (C) 2004 Nokia Corporation by Tony Lindgren <tony@atomide.com> | 10 | * Copyright (C) 2004 Nokia Corporation by Tony Lindgren <tony@atomide.com> |
11 | * | 11 | * |
12 | * hacked for non-paged-MM by Hyok S. Choi, 2004. | ||
13 | * | ||
12 | * This program is free software; you can redistribute it and/or modify | 14 | * This program is free software; you can redistribute it and/or modify |
13 | * it under the terms of the GNU General Public License as published by | 15 | * it under the terms of the GNU General Public License as published by |
14 | * the Free Software Foundation; either version 2 of the License, or | 16 | * the Free Software Foundation; either version 2 of the License, or |
@@ -122,7 +124,9 @@ ENTRY(cpu_arm925_reset) | |||
122 | mov ip, #0 | 124 | mov ip, #0 |
123 | mcr p15, 0, ip, c7, c7, 0 @ invalidate I,D caches | 125 | mcr p15, 0, ip, c7, c7, 0 @ invalidate I,D caches |
124 | mcr p15, 0, ip, c7, c10, 4 @ drain WB | 126 | mcr p15, 0, ip, c7, c10, 4 @ drain WB |
127 | #ifdef CONFIG_MMU | ||
125 | mcr p15, 0, ip, c8, c7, 0 @ invalidate I & D TLBs | 128 | mcr p15, 0, ip, c8, c7, 0 @ invalidate I & D TLBs |
129 | #endif | ||
126 | mrc p15, 0, ip, c1, c0, 0 @ ctrl register | 130 | mrc p15, 0, ip, c1, c0, 0 @ ctrl register |
127 | bic ip, ip, #0x000f @ ............wcam | 131 | bic ip, ip, #0x000f @ ............wcam |
128 | bic ip, ip, #0x1100 @ ...i...s........ | 132 | bic ip, ip, #0x1100 @ ...i...s........ |
@@ -369,6 +373,7 @@ ENTRY(cpu_arm925_dcache_clean_area) | |||
369 | */ | 373 | */ |
370 | .align 5 | 374 | .align 5 |
371 | ENTRY(cpu_arm925_switch_mm) | 375 | ENTRY(cpu_arm925_switch_mm) |
376 | #ifdef CONFIG_MMU | ||
372 | mov ip, #0 | 377 | mov ip, #0 |
373 | #ifdef CONFIG_CPU_DCACHE_WRITETHROUGH | 378 | #ifdef CONFIG_CPU_DCACHE_WRITETHROUGH |
374 | mcr p15, 0, ip, c7, c6, 0 @ invalidate D cache | 379 | mcr p15, 0, ip, c7, c6, 0 @ invalidate D cache |
@@ -383,6 +388,7 @@ ENTRY(cpu_arm925_switch_mm) | |||
383 | mcr p15, 0, ip, c7, c10, 4 @ drain WB | 388 | mcr p15, 0, ip, c7, c10, 4 @ drain WB |
384 | mcr p15, 0, r0, c2, c0, 0 @ load page table pointer | 389 | mcr p15, 0, r0, c2, c0, 0 @ load page table pointer |
385 | mcr p15, 0, ip, c8, c7, 0 @ invalidate I & D TLBs | 390 | mcr p15, 0, ip, c8, c7, 0 @ invalidate I & D TLBs |
391 | #endif | ||
386 | mov pc, lr | 392 | mov pc, lr |
387 | 393 | ||
388 | /* | 394 | /* |
@@ -392,6 +398,7 @@ ENTRY(cpu_arm925_switch_mm) | |||
392 | */ | 398 | */ |
393 | .align 5 | 399 | .align 5 |
394 | ENTRY(cpu_arm925_set_pte) | 400 | ENTRY(cpu_arm925_set_pte) |
401 | #ifdef CONFIG_MMU | ||
395 | str r1, [r0], #-2048 @ linux version | 402 | str r1, [r0], #-2048 @ linux version |
396 | 403 | ||
397 | eor r1, r1, #L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_WRITE | L_PTE_DIRTY | 404 | eor r1, r1, #L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_WRITE | L_PTE_DIRTY |
@@ -420,6 +427,7 @@ ENTRY(cpu_arm925_set_pte) | |||
420 | mcr p15, 0, r0, c7, c10, 1 @ clean D entry | 427 | mcr p15, 0, r0, c7, c10, 1 @ clean D entry |
421 | #endif | 428 | #endif |
422 | mcr p15, 0, r0, c7, c10, 4 @ drain WB | 429 | mcr p15, 0, r0, c7, c10, 4 @ drain WB |
430 | #endif /* CONFIG_MMU */ | ||
423 | mov pc, lr | 431 | mov pc, lr |
424 | 432 | ||
425 | __INIT | 433 | __INIT |
@@ -438,7 +446,9 @@ __arm925_setup: | |||
438 | mov r0, #0 | 446 | mov r0, #0 |
439 | mcr p15, 0, r0, c7, c7 @ invalidate I,D caches on v4 | 447 | mcr p15, 0, r0, c7, c7 @ invalidate I,D caches on v4 |
440 | mcr p15, 0, r0, c7, c10, 4 @ drain write buffer on v4 | 448 | mcr p15, 0, r0, c7, c10, 4 @ drain write buffer on v4 |
449 | #ifdef CONFIG_MMU | ||
441 | mcr p15, 0, r0, c8, c7 @ invalidate I,D TLBs on v4 | 450 | mcr p15, 0, r0, c8, c7 @ invalidate I,D TLBs on v4 |
451 | #endif | ||
442 | 452 | ||
443 | #ifdef CONFIG_CPU_DCACHE_WRITETHROUGH | 453 | #ifdef CONFIG_CPU_DCACHE_WRITETHROUGH |
444 | mov r0, #4 @ disable write-back on caches explicitly | 454 | mov r0, #4 @ disable write-back on caches explicitly |
diff --git a/arch/arm/mm/proc-arm926.S b/arch/arm/mm/proc-arm926.S index 4e2a087cf388..cb4d8f33d2a3 100644 --- a/arch/arm/mm/proc-arm926.S +++ b/arch/arm/mm/proc-arm926.S | |||
@@ -3,6 +3,7 @@ | |||
3 | * | 3 | * |
4 | * Copyright (C) 1999-2001 ARM Limited | 4 | * Copyright (C) 1999-2001 ARM Limited |
5 | * Copyright (C) 2000 Deep Blue Solutions Ltd. | 5 | * Copyright (C) 2000 Deep Blue Solutions Ltd. |
6 | * hacked for non-paged-MM by Hyok S. Choi, 2003. | ||
6 | * | 7 | * |
7 | * This program is free software; you can redistribute it and/or modify | 8 | * This program is free software; you can redistribute it and/or modify |
8 | * it under the terms of the GNU General Public License as published by | 9 | * it under the terms of the GNU General Public License as published by |
@@ -85,7 +86,9 @@ ENTRY(cpu_arm926_reset) | |||
85 | mov ip, #0 | 86 | mov ip, #0 |
86 | mcr p15, 0, ip, c7, c7, 0 @ invalidate I,D caches | 87 | mcr p15, 0, ip, c7, c7, 0 @ invalidate I,D caches |
87 | mcr p15, 0, ip, c7, c10, 4 @ drain WB | 88 | mcr p15, 0, ip, c7, c10, 4 @ drain WB |
89 | #ifdef CONFIG_MMU | ||
88 | mcr p15, 0, ip, c8, c7, 0 @ invalidate I & D TLBs | 90 | mcr p15, 0, ip, c8, c7, 0 @ invalidate I & D TLBs |
91 | #endif | ||
89 | mrc p15, 0, ip, c1, c0, 0 @ ctrl register | 92 | mrc p15, 0, ip, c1, c0, 0 @ ctrl register |
90 | bic ip, ip, #0x000f @ ............wcam | 93 | bic ip, ip, #0x000f @ ............wcam |
91 | bic ip, ip, #0x1100 @ ...i...s........ | 94 | bic ip, ip, #0x1100 @ ...i...s........ |
@@ -329,6 +332,7 @@ ENTRY(cpu_arm926_dcache_clean_area) | |||
329 | */ | 332 | */ |
330 | .align 5 | 333 | .align 5 |
331 | ENTRY(cpu_arm926_switch_mm) | 334 | ENTRY(cpu_arm926_switch_mm) |
335 | #ifdef CONFIG_MMU | ||
332 | mov ip, #0 | 336 | mov ip, #0 |
333 | #ifdef CONFIG_CPU_DCACHE_WRITETHROUGH | 337 | #ifdef CONFIG_CPU_DCACHE_WRITETHROUGH |
334 | mcr p15, 0, ip, c7, c6, 0 @ invalidate D cache | 338 | mcr p15, 0, ip, c7, c6, 0 @ invalidate D cache |
@@ -341,6 +345,7 @@ ENTRY(cpu_arm926_switch_mm) | |||
341 | mcr p15, 0, ip, c7, c10, 4 @ drain WB | 345 | mcr p15, 0, ip, c7, c10, 4 @ drain WB |
342 | mcr p15, 0, r0, c2, c0, 0 @ load page table pointer | 346 | mcr p15, 0, r0, c2, c0, 0 @ load page table pointer |
343 | mcr p15, 0, ip, c8, c7, 0 @ invalidate I & D TLBs | 347 | mcr p15, 0, ip, c8, c7, 0 @ invalidate I & D TLBs |
348 | #endif | ||
344 | mov pc, lr | 349 | mov pc, lr |
345 | 350 | ||
346 | /* | 351 | /* |
@@ -350,6 +355,7 @@ ENTRY(cpu_arm926_switch_mm) | |||
350 | */ | 355 | */ |
351 | .align 5 | 356 | .align 5 |
352 | ENTRY(cpu_arm926_set_pte) | 357 | ENTRY(cpu_arm926_set_pte) |
358 | #ifdef CONFIG_MMU | ||
353 | str r1, [r0], #-2048 @ linux version | 359 | str r1, [r0], #-2048 @ linux version |
354 | 360 | ||
355 | eor r1, r1, #L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_WRITE | L_PTE_DIRTY | 361 | eor r1, r1, #L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_WRITE | L_PTE_DIRTY |
@@ -378,6 +384,7 @@ ENTRY(cpu_arm926_set_pte) | |||
378 | mcr p15, 0, r0, c7, c10, 1 @ clean D entry | 384 | mcr p15, 0, r0, c7, c10, 1 @ clean D entry |
379 | #endif | 385 | #endif |
380 | mcr p15, 0, r0, c7, c10, 4 @ drain WB | 386 | mcr p15, 0, r0, c7, c10, 4 @ drain WB |
387 | #endif | ||
381 | mov pc, lr | 388 | mov pc, lr |
382 | 389 | ||
383 | __INIT | 390 | __INIT |
@@ -387,7 +394,9 @@ __arm926_setup: | |||
387 | mov r0, #0 | 394 | mov r0, #0 |
388 | mcr p15, 0, r0, c7, c7 @ invalidate I,D caches on v4 | 395 | mcr p15, 0, r0, c7, c7 @ invalidate I,D caches on v4 |
389 | mcr p15, 0, r0, c7, c10, 4 @ drain write buffer on v4 | 396 | mcr p15, 0, r0, c7, c10, 4 @ drain write buffer on v4 |
397 | #ifdef CONFIG_MMU | ||
390 | mcr p15, 0, r0, c8, c7 @ invalidate I,D TLBs on v4 | 398 | mcr p15, 0, r0, c8, c7 @ invalidate I,D TLBs on v4 |
399 | #endif | ||
391 | 400 | ||
392 | 401 | ||
393 | #ifdef CONFIG_CPU_DCACHE_WRITETHROUGH | 402 | #ifdef CONFIG_CPU_DCACHE_WRITETHROUGH |
diff --git a/arch/arm/mm/proc-sa110.S b/arch/arm/mm/proc-sa110.S index a2dd5ae1077d..5a760a2c629c 100644 --- a/arch/arm/mm/proc-sa110.S +++ b/arch/arm/mm/proc-sa110.S | |||
@@ -2,6 +2,7 @@ | |||
2 | * linux/arch/arm/mm/proc-sa110.S | 2 | * linux/arch/arm/mm/proc-sa110.S |
3 | * | 3 | * |
4 | * Copyright (C) 1997-2002 Russell King | 4 | * Copyright (C) 1997-2002 Russell King |
5 | * hacked for non-paged-MM by Hyok S. Choi, 2003. | ||
5 | * | 6 | * |
6 | * This program is free software; you can redistribute it and/or modify | 7 | * This program is free software; you can redistribute it and/or modify |
7 | * it under the terms of the GNU General Public License version 2 as | 8 | * it under the terms of the GNU General Public License version 2 as |
@@ -67,7 +68,9 @@ ENTRY(cpu_sa110_reset) | |||
67 | mov ip, #0 | 68 | mov ip, #0 |
68 | mcr p15, 0, ip, c7, c7, 0 @ invalidate I,D caches | 69 | mcr p15, 0, ip, c7, c7, 0 @ invalidate I,D caches |
69 | mcr p15, 0, ip, c7, c10, 4 @ drain WB | 70 | mcr p15, 0, ip, c7, c10, 4 @ drain WB |
71 | #ifdef CONFIG_MMU | ||
70 | mcr p15, 0, ip, c8, c7, 0 @ invalidate I & D TLBs | 72 | mcr p15, 0, ip, c8, c7, 0 @ invalidate I & D TLBs |
73 | #endif | ||
71 | mrc p15, 0, ip, c1, c0, 0 @ ctrl register | 74 | mrc p15, 0, ip, c1, c0, 0 @ ctrl register |
72 | bic ip, ip, #0x000f @ ............wcam | 75 | bic ip, ip, #0x000f @ ............wcam |
73 | bic ip, ip, #0x1100 @ ...i...s........ | 76 | bic ip, ip, #0x1100 @ ...i...s........ |
@@ -130,11 +133,15 @@ ENTRY(cpu_sa110_dcache_clean_area) | |||
130 | */ | 133 | */ |
131 | .align 5 | 134 | .align 5 |
132 | ENTRY(cpu_sa110_switch_mm) | 135 | ENTRY(cpu_sa110_switch_mm) |
136 | #ifdef CONFIG_MMU | ||
133 | str lr, [sp, #-4]! | 137 | str lr, [sp, #-4]! |
134 | bl v4wb_flush_kern_cache_all @ clears IP | 138 | bl v4wb_flush_kern_cache_all @ clears IP |
135 | mcr p15, 0, r0, c2, c0, 0 @ load page table pointer | 139 | mcr p15, 0, r0, c2, c0, 0 @ load page table pointer |
136 | mcr p15, 0, ip, c8, c7, 0 @ invalidate I & D TLBs | 140 | mcr p15, 0, ip, c8, c7, 0 @ invalidate I & D TLBs |
137 | ldr pc, [sp], #4 | 141 | ldr pc, [sp], #4 |
142 | #else | ||
143 | mov pc, lr | ||
144 | #endif | ||
138 | 145 | ||
139 | /* | 146 | /* |
140 | * cpu_sa110_set_pte(ptep, pte) | 147 | * cpu_sa110_set_pte(ptep, pte) |
@@ -143,6 +150,7 @@ ENTRY(cpu_sa110_switch_mm) | |||
143 | */ | 150 | */ |
144 | .align 5 | 151 | .align 5 |
145 | ENTRY(cpu_sa110_set_pte) | 152 | ENTRY(cpu_sa110_set_pte) |
153 | #ifdef CONFIG_MMU | ||
146 | str r1, [r0], #-2048 @ linux version | 154 | str r1, [r0], #-2048 @ linux version |
147 | 155 | ||
148 | eor r1, r1, #L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_WRITE | L_PTE_DIRTY | 156 | eor r1, r1, #L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_WRITE | L_PTE_DIRTY |
@@ -164,6 +172,7 @@ ENTRY(cpu_sa110_set_pte) | |||
164 | mov r0, r0 | 172 | mov r0, r0 |
165 | mcr p15, 0, r0, c7, c10, 1 @ clean D entry | 173 | mcr p15, 0, r0, c7, c10, 1 @ clean D entry |
166 | mcr p15, 0, r0, c7, c10, 4 @ drain WB | 174 | mcr p15, 0, r0, c7, c10, 4 @ drain WB |
175 | #endif | ||
167 | mov pc, lr | 176 | mov pc, lr |
168 | 177 | ||
169 | __INIT | 178 | __INIT |
@@ -173,7 +182,9 @@ __sa110_setup: | |||
173 | mov r10, #0 | 182 | mov r10, #0 |
174 | mcr p15, 0, r10, c7, c7 @ invalidate I,D caches on v4 | 183 | mcr p15, 0, r10, c7, c7 @ invalidate I,D caches on v4 |
175 | mcr p15, 0, r10, c7, c10, 4 @ drain write buffer on v4 | 184 | mcr p15, 0, r10, c7, c10, 4 @ drain write buffer on v4 |
185 | #ifdef CONFIG_MMU | ||
176 | mcr p15, 0, r10, c8, c7 @ invalidate I,D TLBs on v4 | 186 | mcr p15, 0, r10, c8, c7 @ invalidate I,D TLBs on v4 |
187 | #endif | ||
177 | mrc p15, 0, r0, c1, c0 @ get control register v4 | 188 | mrc p15, 0, r0, c1, c0 @ get control register v4 |
178 | ldr r5, sa110_cr1_clear | 189 | ldr r5, sa110_cr1_clear |
179 | bic r0, r0, r5 | 190 | bic r0, r0, r5 |
diff --git a/arch/arm/mm/proc-sa1100.S b/arch/arm/mm/proc-sa1100.S index 777ad99c1439..0a2107ad4c32 100644 --- a/arch/arm/mm/proc-sa1100.S +++ b/arch/arm/mm/proc-sa1100.S | |||
@@ -2,6 +2,7 @@ | |||
2 | * linux/arch/arm/mm/proc-sa1100.S | 2 | * linux/arch/arm/mm/proc-sa1100.S |
3 | * | 3 | * |
4 | * Copyright (C) 1997-2002 Russell King | 4 | * Copyright (C) 1997-2002 Russell King |
5 | * hacked for non-paged-MM by Hyok S. Choi, 2003. | ||
5 | * | 6 | * |
6 | * This program is free software; you can redistribute it and/or modify | 7 | * This program is free software; you can redistribute it and/or modify |
7 | * it under the terms of the GNU General Public License version 2 as | 8 | * it under the terms of the GNU General Public License version 2 as |
@@ -77,7 +78,9 @@ ENTRY(cpu_sa1100_reset) | |||
77 | mov ip, #0 | 78 | mov ip, #0 |
78 | mcr p15, 0, ip, c7, c7, 0 @ invalidate I,D caches | 79 | mcr p15, 0, ip, c7, c7, 0 @ invalidate I,D caches |
79 | mcr p15, 0, ip, c7, c10, 4 @ drain WB | 80 | mcr p15, 0, ip, c7, c10, 4 @ drain WB |
81 | #ifdef CONFIG_MMU | ||
80 | mcr p15, 0, ip, c8, c7, 0 @ invalidate I & D TLBs | 82 | mcr p15, 0, ip, c8, c7, 0 @ invalidate I & D TLBs |
83 | #endif | ||
81 | mrc p15, 0, ip, c1, c0, 0 @ ctrl register | 84 | mrc p15, 0, ip, c1, c0, 0 @ ctrl register |
82 | bic ip, ip, #0x000f @ ............wcam | 85 | bic ip, ip, #0x000f @ ............wcam |
83 | bic ip, ip, #0x1100 @ ...i...s........ | 86 | bic ip, ip, #0x1100 @ ...i...s........ |
@@ -142,12 +145,16 @@ ENTRY(cpu_sa1100_dcache_clean_area) | |||
142 | */ | 145 | */ |
143 | .align 5 | 146 | .align 5 |
144 | ENTRY(cpu_sa1100_switch_mm) | 147 | ENTRY(cpu_sa1100_switch_mm) |
148 | #ifdef CONFIG_MMU | ||
145 | str lr, [sp, #-4]! | 149 | str lr, [sp, #-4]! |
146 | bl v4wb_flush_kern_cache_all @ clears IP | 150 | bl v4wb_flush_kern_cache_all @ clears IP |
147 | mcr p15, 0, ip, c9, c0, 0 @ invalidate RB | 151 | mcr p15, 0, ip, c9, c0, 0 @ invalidate RB |
148 | mcr p15, 0, r0, c2, c0, 0 @ load page table pointer | 152 | mcr p15, 0, r0, c2, c0, 0 @ load page table pointer |
149 | mcr p15, 0, ip, c8, c7, 0 @ invalidate I & D TLBs | 153 | mcr p15, 0, ip, c8, c7, 0 @ invalidate I & D TLBs |
150 | ldr pc, [sp], #4 | 154 | ldr pc, [sp], #4 |
155 | #else | ||
156 | mov pc, lr | ||
157 | #endif | ||
151 | 158 | ||
152 | /* | 159 | /* |
153 | * cpu_sa1100_set_pte(ptep, pte) | 160 | * cpu_sa1100_set_pte(ptep, pte) |
@@ -156,6 +163,7 @@ ENTRY(cpu_sa1100_switch_mm) | |||
156 | */ | 163 | */ |
157 | .align 5 | 164 | .align 5 |
158 | ENTRY(cpu_sa1100_set_pte) | 165 | ENTRY(cpu_sa1100_set_pte) |
166 | #ifdef CONFIG_MMU | ||
159 | str r1, [r0], #-2048 @ linux version | 167 | str r1, [r0], #-2048 @ linux version |
160 | 168 | ||
161 | eor r1, r1, #L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_WRITE | L_PTE_DIRTY | 169 | eor r1, r1, #L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_WRITE | L_PTE_DIRTY |
@@ -177,6 +185,7 @@ ENTRY(cpu_sa1100_set_pte) | |||
177 | mov r0, r0 | 185 | mov r0, r0 |
178 | mcr p15, 0, r0, c7, c10, 1 @ clean D entry | 186 | mcr p15, 0, r0, c7, c10, 1 @ clean D entry |
179 | mcr p15, 0, r0, c7, c10, 4 @ drain WB | 187 | mcr p15, 0, r0, c7, c10, 4 @ drain WB |
188 | #endif | ||
180 | mov pc, lr | 189 | mov pc, lr |
181 | 190 | ||
182 | __INIT | 191 | __INIT |
@@ -186,7 +195,9 @@ __sa1100_setup: | |||
186 | mov r0, #0 | 195 | mov r0, #0 |
187 | mcr p15, 0, r0, c7, c7 @ invalidate I,D caches on v4 | 196 | mcr p15, 0, r0, c7, c7 @ invalidate I,D caches on v4 |
188 | mcr p15, 0, r0, c7, c10, 4 @ drain write buffer on v4 | 197 | mcr p15, 0, r0, c7, c10, 4 @ drain write buffer on v4 |
198 | #ifdef CONFIG_MMU | ||
189 | mcr p15, 0, r0, c8, c7 @ invalidate I,D TLBs on v4 | 199 | mcr p15, 0, r0, c8, c7 @ invalidate I,D TLBs on v4 |
200 | #endif | ||
190 | mrc p15, 0, r0, c1, c0 @ get control register v4 | 201 | mrc p15, 0, r0, c1, c0 @ get control register v4 |
191 | ldr r5, sa1100_cr1_clear | 202 | ldr r5, sa1100_cr1_clear |
192 | bic r0, r0, r5 | 203 | bic r0, r0, r5 |
diff --git a/arch/arm/mm/proc-v6.S b/arch/arm/mm/proc-v6.S index 09b1a41a6de8..ca13d4d05f65 100644 --- a/arch/arm/mm/proc-v6.S +++ b/arch/arm/mm/proc-v6.S | |||
@@ -2,6 +2,7 @@ | |||
2 | * linux/arch/arm/mm/proc-v6.S | 2 | * linux/arch/arm/mm/proc-v6.S |
3 | * | 3 | * |
4 | * Copyright (C) 2001 Deep Blue Solutions Ltd. | 4 | * Copyright (C) 2001 Deep Blue Solutions Ltd. |
5 | * Modified by Catalin Marinas for noMMU support | ||
5 | * | 6 | * |
6 | * This program is free software; you can redistribute it and/or modify | 7 | * This program is free software; you can redistribute it and/or modify |
7 | * it under the terms of the GNU General Public License version 2 as | 8 | * it under the terms of the GNU General Public License version 2 as |
@@ -88,6 +89,7 @@ ENTRY(cpu_v6_dcache_clean_area) | |||
88 | * - we are not using split page tables | 89 | * - we are not using split page tables |
89 | */ | 90 | */ |
90 | ENTRY(cpu_v6_switch_mm) | 91 | ENTRY(cpu_v6_switch_mm) |
92 | #ifdef CONFIG_MMU | ||
91 | mov r2, #0 | 93 | mov r2, #0 |
92 | ldr r1, [r1, #MM_CONTEXT_ID] @ get mm->context.id | 94 | ldr r1, [r1, #MM_CONTEXT_ID] @ get mm->context.id |
93 | #ifdef CONFIG_SMP | 95 | #ifdef CONFIG_SMP |
@@ -97,6 +99,7 @@ ENTRY(cpu_v6_switch_mm) | |||
97 | mcr p15, 0, r2, c7, c10, 4 @ drain write buffer | 99 | mcr p15, 0, r2, c7, c10, 4 @ drain write buffer |
98 | mcr p15, 0, r0, c2, c0, 0 @ set TTB 0 | 100 | mcr p15, 0, r0, c2, c0, 0 @ set TTB 0 |
99 | mcr p15, 0, r1, c13, c0, 1 @ set context ID | 101 | mcr p15, 0, r1, c13, c0, 1 @ set context ID |
102 | #endif | ||
100 | mov pc, lr | 103 | mov pc, lr |
101 | 104 | ||
102 | /* | 105 | /* |
@@ -119,6 +122,7 @@ ENTRY(cpu_v6_switch_mm) | |||
119 | * 1111 0 1 1 r/w r/w | 122 | * 1111 0 1 1 r/w r/w |
120 | */ | 123 | */ |
121 | ENTRY(cpu_v6_set_pte) | 124 | ENTRY(cpu_v6_set_pte) |
125 | #ifdef CONFIG_MMU | ||
122 | str r1, [r0], #-2048 @ linux version | 126 | str r1, [r0], #-2048 @ linux version |
123 | 127 | ||
124 | bic r2, r1, #0x000003f0 | 128 | bic r2, r1, #0x000003f0 |
@@ -145,6 +149,7 @@ ENTRY(cpu_v6_set_pte) | |||
145 | 149 | ||
146 | str r2, [r0] | 150 | str r2, [r0] |
147 | mcr p15, 0, r0, c7, c10, 1 @ flush_pte | 151 | mcr p15, 0, r0, c7, c10, 1 @ flush_pte |
152 | #endif | ||
148 | mov pc, lr | 153 | mov pc, lr |
149 | 154 | ||
150 | 155 | ||
@@ -194,12 +199,14 @@ __v6_setup: | |||
194 | mcr p15, 0, r0, c7, c5, 0 @ invalidate I cache | 199 | mcr p15, 0, r0, c7, c5, 0 @ invalidate I cache |
195 | mcr p15, 0, r0, c7, c15, 0 @ clean+invalidate cache | 200 | mcr p15, 0, r0, c7, c15, 0 @ clean+invalidate cache |
196 | mcr p15, 0, r0, c7, c10, 4 @ drain write buffer | 201 | mcr p15, 0, r0, c7, c10, 4 @ drain write buffer |
202 | #ifdef CONFIG_MMU | ||
197 | mcr p15, 0, r0, c8, c7, 0 @ invalidate I + D TLBs | 203 | mcr p15, 0, r0, c8, c7, 0 @ invalidate I + D TLBs |
198 | mcr p15, 0, r0, c2, c0, 2 @ TTB control register | 204 | mcr p15, 0, r0, c2, c0, 2 @ TTB control register |
199 | #ifdef CONFIG_SMP | 205 | #ifdef CONFIG_SMP |
200 | orr r4, r4, #TTB_RGN_WBWA|TTB_S @ mark PTWs shared, outer cacheable | 206 | orr r4, r4, #TTB_RGN_WBWA|TTB_S @ mark PTWs shared, outer cacheable |
201 | #endif | 207 | #endif |
202 | mcr p15, 0, r4, c2, c0, 1 @ load TTB1 | 208 | mcr p15, 0, r4, c2, c0, 1 @ load TTB1 |
209 | #endif /* CONFIG_MMU */ | ||
203 | #ifdef CONFIG_VFP | 210 | #ifdef CONFIG_VFP |
204 | mrc p15, 0, r0, c1, c0, 2 | 211 | mrc p15, 0, r0, c1, c0, 2 |
205 | orr r0, r0, #(0xf << 20) | 212 | orr r0, r0, #(0xf << 20) |
diff --git a/arch/i386/kernel/irq.c b/arch/i386/kernel/irq.c index c703bc7b0880..9eec9435318e 100644 --- a/arch/i386/kernel/irq.c +++ b/arch/i386/kernel/irq.c | |||
@@ -60,6 +60,12 @@ fastcall unsigned int do_IRQ(struct pt_regs *regs) | |||
60 | u32 *isp; | 60 | u32 *isp; |
61 | #endif | 61 | #endif |
62 | 62 | ||
63 | if (unlikely((unsigned)irq >= NR_IRQS)) { | ||
64 | printk(KERN_EMERG "%s: cannot handle IRQ %d\n", | ||
65 | __FUNCTION__, irq); | ||
66 | BUG(); | ||
67 | } | ||
68 | |||
63 | irq_enter(); | 69 | irq_enter(); |
64 | #ifdef CONFIG_DEBUG_STACKOVERFLOW | 70 | #ifdef CONFIG_DEBUG_STACKOVERFLOW |
65 | /* Debugging check for stack overflow: is there less than 1KB free? */ | 71 | /* Debugging check for stack overflow: is there less than 1KB free? */ |
diff --git a/arch/ia64/configs/tiger_defconfig b/arch/ia64/configs/tiger_defconfig index 766bf4955432..9d1cffb57cde 100644 --- a/arch/ia64/configs/tiger_defconfig +++ b/arch/ia64/configs/tiger_defconfig | |||
@@ -114,7 +114,7 @@ CONFIG_IA64_CYCLONE=y | |||
114 | CONFIG_IOSAPIC=y | 114 | CONFIG_IOSAPIC=y |
115 | CONFIG_FORCE_MAX_ZONEORDER=17 | 115 | CONFIG_FORCE_MAX_ZONEORDER=17 |
116 | CONFIG_SMP=y | 116 | CONFIG_SMP=y |
117 | CONFIG_NR_CPUS=4 | 117 | CONFIG_NR_CPUS=16 |
118 | CONFIG_HOTPLUG_CPU=y | 118 | CONFIG_HOTPLUG_CPU=y |
119 | CONFIG_PERMIT_BSP_REMOVE=y | 119 | CONFIG_PERMIT_BSP_REMOVE=y |
120 | CONFIG_FORCE_CPEI_RETARGET=y | 120 | CONFIG_FORCE_CPEI_RETARGET=y |
diff --git a/arch/ia64/kernel/palinfo.c b/arch/ia64/kernel/palinfo.c index 303a9afcf2a1..8a1208419138 100644 --- a/arch/ia64/kernel/palinfo.c +++ b/arch/ia64/kernel/palinfo.c | |||
@@ -998,7 +998,7 @@ palinfo_init(void) | |||
998 | } | 998 | } |
999 | 999 | ||
1000 | /* Register for future delivery via notify registration */ | 1000 | /* Register for future delivery via notify registration */ |
1001 | register_cpu_notifier(&palinfo_cpu_notifier); | 1001 | register_hotcpu_notifier(&palinfo_cpu_notifier); |
1002 | 1002 | ||
1003 | return 0; | 1003 | return 0; |
1004 | } | 1004 | } |
diff --git a/arch/ia64/sn/kernel/setup.c b/arch/ia64/sn/kernel/setup.c index 93577abae36d..3bfccf354343 100644 --- a/arch/ia64/sn/kernel/setup.c +++ b/arch/ia64/sn/kernel/setup.c | |||
@@ -458,7 +458,7 @@ void __init sn_setup(char **cmdline_p) | |||
458 | * support here so we don't have to listen to failed keyboard probe | 458 | * support here so we don't have to listen to failed keyboard probe |
459 | * messages. | 459 | * messages. |
460 | */ | 460 | */ |
461 | if (version <= 0x0209 && acpi_kbd_controller_present) { | 461 | if (is_shub1() && version <= 0x0209 && acpi_kbd_controller_present) { |
462 | printk(KERN_INFO "Disabling legacy keyboard support as prom " | 462 | printk(KERN_INFO "Disabling legacy keyboard support as prom " |
463 | "is too old and doesn't provide FADT\n"); | 463 | "is too old and doesn't provide FADT\n"); |
464 | acpi_kbd_controller_present = 0; | 464 | acpi_kbd_controller_present = 0; |
@@ -577,7 +577,8 @@ void __init sn_cpu_init(void) | |||
577 | int i; | 577 | int i; |
578 | static int wars_have_been_checked; | 578 | static int wars_have_been_checked; |
579 | 579 | ||
580 | if (smp_processor_id() == 0 && IS_MEDUSA()) { | 580 | cpuid = smp_processor_id(); |
581 | if (cpuid == 0 && IS_MEDUSA()) { | ||
581 | if (ia64_sn_is_fake_prom()) | 582 | if (ia64_sn_is_fake_prom()) |
582 | sn_prom_type = 2; | 583 | sn_prom_type = 2; |
583 | else | 584 | else |
@@ -597,6 +598,12 @@ void __init sn_cpu_init(void) | |||
597 | sn_hub_info->as_shift = sn_hub_info->nasid_shift - 2; | 598 | sn_hub_info->as_shift = sn_hub_info->nasid_shift - 2; |
598 | 599 | ||
599 | /* | 600 | /* |
601 | * Don't check status. The SAL call is not supported on all PROMs | ||
602 | * but a failure is harmless. | ||
603 | */ | ||
604 | (void) ia64_sn_set_cpu_number(cpuid); | ||
605 | |||
606 | /* | ||
600 | * The boot cpu makes this call again after platform initialization is | 607 | * The boot cpu makes this call again after platform initialization is |
601 | * complete. | 608 | * complete. |
602 | */ | 609 | */ |
@@ -607,7 +614,6 @@ void __init sn_cpu_init(void) | |||
607 | if (ia64_sn_get_prom_feature_set(i, &sn_prom_features[i]) != 0) | 614 | if (ia64_sn_get_prom_feature_set(i, &sn_prom_features[i]) != 0) |
608 | break; | 615 | break; |
609 | 616 | ||
610 | cpuid = smp_processor_id(); | ||
611 | cpuphyid = get_sapicid(); | 617 | cpuphyid = get_sapicid(); |
612 | 618 | ||
613 | if (ia64_sn_get_sapic_info(cpuphyid, &nasid, &subnode, &slice)) | 619 | if (ia64_sn_get_sapic_info(cpuphyid, &nasid, &subnode, &slice)) |
diff --git a/arch/ia64/sn/pci/tioca_provider.c b/arch/ia64/sn/pci/tioca_provider.c index 20de72791b97..e4aa839d0189 100644 --- a/arch/ia64/sn/pci/tioca_provider.c +++ b/arch/ia64/sn/pci/tioca_provider.c | |||
@@ -595,7 +595,7 @@ tioca_bus_fixup(struct pcibus_bussoft *prom_bussoft, struct pci_controller *cont | |||
595 | 595 | ||
596 | /* sanity check prom rev */ | 596 | /* sanity check prom rev */ |
597 | 597 | ||
598 | if (sn_sal_rev() < 0x0406) { | 598 | if (is_shub1() && sn_sal_rev() < 0x0406) { |
599 | printk | 599 | printk |
600 | (KERN_ERR "%s: SGI prom rev 4.06 or greater required " | 600 | (KERN_ERR "%s: SGI prom rev 4.06 or greater required " |
601 | "for tioca support\n", __FUNCTION__); | 601 | "for tioca support\n", __FUNCTION__); |
diff --git a/arch/m68knommu/Kconfig b/arch/m68knommu/Kconfig index 8b6e723eb82b..e767f2ddae72 100644 --- a/arch/m68knommu/Kconfig +++ b/arch/m68knommu/Kconfig | |||
@@ -540,6 +540,59 @@ config RAM32BIT | |||
540 | 540 | ||
541 | endchoice | 541 | endchoice |
542 | 542 | ||
543 | comment "ROM configuration" | ||
544 | |||
545 | config ROM | ||
546 | bool "Specify ROM linker regions" | ||
547 | default n | ||
548 | help | ||
549 | Define a ROM region for the linker script. This creates a kernel | ||
550 | that can be stored in flash, with possibly the text, and data | ||
551 | regions being copied out to RAM at startup. | ||
552 | |||
553 | config ROMBASE | ||
554 | hex "Address of the base of ROM device" | ||
555 | default "0" | ||
556 | depends on ROM | ||
557 | help | ||
558 | Define the address that the ROM region starts at. Some platforms | ||
559 | use this to set their chip select region accordingly for the boot | ||
560 | device. | ||
561 | |||
562 | config ROMVEC | ||
563 | hex "Address of the base of the ROM vectors" | ||
564 | default "0" | ||
565 | depends on ROM | ||
566 | help | ||
567 | This is almost always the same as the base of the ROM. Since on all | ||
568 | 68000 type varients the vectors are at the base of the boot device | ||
569 | on system startup. | ||
570 | |||
571 | config ROMVECSIZE | ||
572 | hex "Size of ROM vector region (in bytes)" | ||
573 | default "0x400" | ||
574 | depends on ROM | ||
575 | help | ||
576 | Define the size of the vector region in ROM. For most 68000 | ||
577 | varients this would be 0x400 bytes in size. Set to 0 if you do | ||
578 | not want a vector region at the start of the ROM. | ||
579 | |||
580 | config ROMSTART | ||
581 | hex "Address of the base of system image in ROM" | ||
582 | default "0x400" | ||
583 | depends on ROM | ||
584 | help | ||
585 | Define the start address of the system image in ROM. Commonly this | ||
586 | is strait after the ROM vectors. | ||
587 | |||
588 | config ROMSIZE | ||
589 | hex "Size of the ROM device" | ||
590 | default "0x100000" | ||
591 | depends on ROM | ||
592 | help | ||
593 | Size of the ROM device. On some platforms this is used to setup | ||
594 | the chip select that controls the boot ROM device. | ||
595 | |||
543 | choice | 596 | choice |
544 | prompt "Kernel executes from" | 597 | prompt "Kernel executes from" |
545 | ---help--- | 598 | ---help--- |
diff --git a/arch/m68knommu/kernel/vmlinux.lds.S b/arch/m68knommu/kernel/vmlinux.lds.S index 6a2f0c693254..59ced831b792 100644 --- a/arch/m68knommu/kernel/vmlinux.lds.S +++ b/arch/m68knommu/kernel/vmlinux.lds.S | |||
@@ -3,63 +3,13 @@ | |||
3 | * | 3 | * |
4 | * (C) Copyright 2002-2006, Greg Ungerer <gerg@snapgear.com> | 4 | * (C) Copyright 2002-2006, Greg Ungerer <gerg@snapgear.com> |
5 | * | 5 | * |
6 | * This ends up looking compilcated, because of the number of | 6 | * This linker script is equiped to build either ROM loaded or RAM |
7 | * address variations for ram and rom/flash layouts. The real | 7 | * run kernels. |
8 | * work of the linker script is all at the end, and reasonably | ||
9 | * strait forward. | ||
10 | */ | 8 | */ |
11 | 9 | ||
12 | #include <linux/config.h> | 10 | #include <linux/config.h> |
13 | #include <asm-generic/vmlinux.lds.h> | 11 | #include <asm-generic/vmlinux.lds.h> |
14 | 12 | ||
15 | /* | ||
16 | * Original Palm pilot (same for Xcopilot). | ||
17 | * There is really only a rom target for this. | ||
18 | */ | ||
19 | #ifdef CONFIG_PILOT3 | ||
20 | #define ROMVEC_START 0x10c00000 | ||
21 | #define ROMVEC_LENGTH 0x10400 | ||
22 | #define ROM_START 0x10c10400 | ||
23 | #define ROM_LENGTH 0xfec00 | ||
24 | #define ROM_END 0x10d00000 | ||
25 | #define DATA_ADDR CONFIG_KERNELBASE | ||
26 | #endif | ||
27 | |||
28 | /* | ||
29 | * Same setup on both the uCsimm and uCdimm. | ||
30 | */ | ||
31 | #if defined(CONFIG_UCSIMM) || defined(CONFIG_UCDIMM) | ||
32 | #ifdef CONFIG_RAMKERNEL | ||
33 | #define ROMVEC_START 0x10c10000 | ||
34 | #define ROMVEC_LENGTH 0x400 | ||
35 | #define ROM_START 0x10c10400 | ||
36 | #define ROM_LENGTH 0x1efc00 | ||
37 | #define ROM_END 0x10e00000 | ||
38 | #endif | ||
39 | #ifdef CONFIG_ROMKERNEL | ||
40 | #define ROMVEC_START 0x10c10000 | ||
41 | #define ROMVEC_LENGTH 0x400 | ||
42 | #define ROM_START 0x10c10400 | ||
43 | #define ROM_LENGTH 0x1efc00 | ||
44 | #define ROM_END 0x10e00000 | ||
45 | #endif | ||
46 | #ifdef CONFIG_HIMEMKERNEL | ||
47 | #define ROMVEC_START 0x00600000 | ||
48 | #define ROMVEC_LENGTH 0x400 | ||
49 | #define ROM_START 0x00600400 | ||
50 | #define ROM_LENGTH 0x1efc00 | ||
51 | #define ROM_END 0x007f0000 | ||
52 | #endif | ||
53 | #endif | ||
54 | |||
55 | #ifdef CONFIG_UCQUICC | ||
56 | #define ROMVEC_START 0x00000000 | ||
57 | #define ROMVEC_LENGTH 0x404 | ||
58 | #define ROM_START 0x00000404 | ||
59 | #define ROM_LENGTH 0x1ff6fc | ||
60 | #define ROM_END 0x00200000 | ||
61 | #endif | ||
62 | |||
63 | #if defined(CONFIG_RAMKERNEL) | 13 | #if defined(CONFIG_RAMKERNEL) |
64 | #define RAM_START CONFIG_KERNELBASE | 14 | #define RAM_START CONFIG_KERNELBASE |
65 | #define RAM_LENGTH (CONFIG_RAMBASE + CONFIG_RAMSIZE - CONFIG_KERNELBASE) | 15 | #define RAM_LENGTH (CONFIG_RAMBASE + CONFIG_RAMSIZE - CONFIG_KERNELBASE) |
@@ -71,6 +21,10 @@ | |||
71 | #if defined(CONFIG_ROMKERNEL) || defined(CONFIG_HIMEMKERNEL) | 21 | #if defined(CONFIG_ROMKERNEL) || defined(CONFIG_HIMEMKERNEL) |
72 | #define RAM_START CONFIG_RAMBASE | 22 | #define RAM_START CONFIG_RAMBASE |
73 | #define RAM_LENGTH CONFIG_RAMSIZE | 23 | #define RAM_LENGTH CONFIG_RAMSIZE |
24 | #define ROMVEC_START CONFIG_ROMVEC | ||
25 | #define ROMVEC_LENGTH CONFIG_ROMVECSIZE | ||
26 | #define ROM_START CONFIG_ROMSTART | ||
27 | #define ROM_LENGTH CONFIG_ROMSIZE | ||
74 | #define TEXT rom | 28 | #define TEXT rom |
75 | #define DATA ram | 29 | #define DATA ram |
76 | #define INIT ram | 30 | #define INIT ram |
@@ -90,7 +44,6 @@ MEMORY { | |||
90 | #ifdef ROM_START | 44 | #ifdef ROM_START |
91 | romvec : ORIGIN = ROMVEC_START, LENGTH = ROMVEC_LENGTH | 45 | romvec : ORIGIN = ROMVEC_START, LENGTH = ROMVEC_LENGTH |
92 | rom : ORIGIN = ROM_START, LENGTH = ROM_LENGTH | 46 | rom : ORIGIN = ROM_START, LENGTH = ROM_LENGTH |
93 | erom : ORIGIN = ROM_END, LENGTH = 0 | ||
94 | #endif | 47 | #endif |
95 | } | 48 | } |
96 | 49 | ||
@@ -167,13 +120,6 @@ SECTIONS { | |||
167 | _etext = . ; | 120 | _etext = . ; |
168 | } > TEXT | 121 | } > TEXT |
169 | 122 | ||
170 | #ifdef ROM_END | ||
171 | . = ROM_END ; | ||
172 | .erom : { | ||
173 | __rom_end = . ; | ||
174 | } > erom | ||
175 | #endif | ||
176 | |||
177 | .data DATA_ADDR : { | 123 | .data DATA_ADDR : { |
178 | . = ALIGN(4); | 124 | . = ALIGN(4); |
179 | _sdata = . ; | 125 | _sdata = . ; |
diff --git a/arch/m68knommu/platform/68328/Makefile b/arch/m68knommu/platform/68328/Makefile index 1b3b719e4479..5e5435552d56 100644 --- a/arch/m68knommu/platform/68328/Makefile +++ b/arch/m68knommu/platform/68328/Makefile | |||
@@ -8,6 +8,7 @@ head-$(CONFIG_DRAGEN2) = head-de2.o | |||
8 | 8 | ||
9 | obj-y += entry.o ints.o timers.o | 9 | obj-y += entry.o ints.o timers.o |
10 | obj-$(CONFIG_M68328) += config.o | 10 | obj-$(CONFIG_M68328) += config.o |
11 | obj-$(CONFIG_ROM) += romvec.o | ||
11 | 12 | ||
12 | extra-y := head.o | 13 | extra-y := head.o |
13 | extra-$(CONFIG_M68328) += bootlogo.rh head.o | 14 | extra-$(CONFIG_M68328) += bootlogo.rh head.o |
diff --git a/arch/m68knommu/platform/68328/ints.c b/arch/m68knommu/platform/68328/ints.c index 7437217813d2..2dda7339aae5 100644 --- a/arch/m68knommu/platform/68328/ints.c +++ b/arch/m68knommu/platform/68328/ints.c | |||
@@ -18,6 +18,7 @@ | |||
18 | 18 | ||
19 | #include <asm/system.h> | 19 | #include <asm/system.h> |
20 | #include <asm/irq.h> | 20 | #include <asm/irq.h> |
21 | #include <asm/irqnode.h> | ||
21 | #include <asm/traps.h> | 22 | #include <asm/traps.h> |
22 | #include <asm/io.h> | 23 | #include <asm/io.h> |
23 | #include <asm/machdep.h> | 24 | #include <asm/machdep.h> |
@@ -82,25 +83,6 @@ unsigned int local_irq_count[NR_CPUS]; | |||
82 | /* irq node variables for the 32 (potential) on chip sources */ | 83 | /* irq node variables for the 32 (potential) on chip sources */ |
83 | static irq_node_t int_irq_list[NR_IRQS]; | 84 | static irq_node_t int_irq_list[NR_IRQS]; |
84 | 85 | ||
85 | #if !defined(CONFIG_DRAGEN2) | ||
86 | asm (".global _start, __ramend/n/t" | ||
87 | ".section .romvec/n" | ||
88 | "e_vectors:\n\t" | ||
89 | ".long __ramend-4, _start, buserr, trap, trap, trap, trap, trap\n\t" | ||
90 | ".long trap, trap, trap, trap, trap, trap, trap, trap\n\t" | ||
91 | ".long trap, trap, trap, trap, trap, trap, trap, trap\n\t" | ||
92 | ".long trap, trap, trap, trap\n\t" | ||
93 | ".long trap, trap, trap, trap\n\t" | ||
94 | /*.long inthandler, inthandler, inthandler, inthandler | ||
95 | .long inthandler4, inthandler, inthandler, inthandler */ | ||
96 | /* TRAP #0-15 */ | ||
97 | ".long system_call, trap, trap, trap, trap, trap, trap, trap\n\t" | ||
98 | ".long trap, trap, trap, trap, trap, trap, trap, trap\n\t" | ||
99 | ".long 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\n\t" | ||
100 | ".text\n" | ||
101 | "ignore: rte"); | ||
102 | #endif | ||
103 | |||
104 | /* | 86 | /* |
105 | * This function should be called during kernel startup to initialize | 87 | * This function should be called during kernel startup to initialize |
106 | * the IRQ handling routines. | 88 | * the IRQ handling routines. |
diff --git a/arch/m68knommu/platform/68328/romvec.S b/arch/m68knommu/platform/68328/romvec.S new file mode 100644 index 000000000000..3e7fe1e14913 --- /dev/null +++ b/arch/m68knommu/platform/68328/romvec.S | |||
@@ -0,0 +1,37 @@ | |||
1 | /* | ||
2 | * linux/arch/m68knommu/platform/68328/romvec.S | ||
3 | * | ||
4 | * This file is subject to the terms and conditions of the GNU General Public | ||
5 | * License. See the file COPYING in the main directory of this archive | ||
6 | * for more details. | ||
7 | * | ||
8 | * Copyright 1996 Roman Zippel | ||
9 | * Copyright 1999 D. Jeff Dionne <jeff@rt-control.com> | ||
10 | * Copyright 2006 Greg Ungerer <gerg@snapgear.com> | ||
11 | */ | ||
12 | |||
13 | #include <linux/config.h> | ||
14 | |||
15 | .global _start | ||
16 | .global _buserr | ||
17 | .global trap | ||
18 | .global system_call | ||
19 | |||
20 | .section .romvec | ||
21 | |||
22 | e_vectors: | ||
23 | .long CONFIG_RAMBASE+CONFIG_RAMSIZE-4, _start, buserr, trap | ||
24 | .long trap, trap, trap, trap | ||
25 | .long trap, trap, trap, trap | ||
26 | .long trap, trap, trap, trap | ||
27 | .long trap, trap, trap, trap | ||
28 | .long trap, trap, trap, trap | ||
29 | .long trap, trap, trap, trap | ||
30 | .long trap, trap, trap, trap | ||
31 | /* TRAP #0-15 */ | ||
32 | .long system_call, trap, trap, trap | ||
33 | .long trap, trap, trap, trap | ||
34 | .long trap, trap, trap, trap | ||
35 | .long trap, trap, trap, trap | ||
36 | .long 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 | ||
37 | |||
diff --git a/arch/m68knommu/platform/68360/config.c b/arch/m68knommu/platform/68360/config.c index 3db244625f0f..69c670dfd62b 100644 --- a/arch/m68knommu/platform/68360/config.c +++ b/arch/m68knommu/platform/68360/config.c | |||
@@ -141,13 +141,13 @@ int BSP_set_clock_mmss (unsigned long nowtime) | |||
141 | void BSP_reset (void) | 141 | void BSP_reset (void) |
142 | { | 142 | { |
143 | local_irq_disable(); | 143 | local_irq_disable(); |
144 | asm volatile (" | 144 | asm volatile ( |
145 | moveal #_start, %a0; | 145 | "moveal #_start, %a0;\n" |
146 | moveb #0, 0xFFFFF300; | 146 | "moveb #0, 0xFFFFF300;\n" |
147 | moveal 0(%a0), %sp; | 147 | "moveal 0(%a0), %sp;\n" |
148 | moveal 4(%a0), %a0; | 148 | "moveal 4(%a0), %a0;\n" |
149 | jmp (%a0); | 149 | "jmp (%a0);\n" |
150 | "); | 150 | ); |
151 | } | 151 | } |
152 | 152 | ||
153 | unsigned char *scc1_hwaddr; | 153 | unsigned char *scc1_hwaddr; |
diff --git a/arch/m68knommu/platform/68360/ints.c b/arch/m68knommu/platform/68360/ints.c index ba184db1651b..0245fc4a4781 100644 --- a/arch/m68knommu/platform/68360/ints.c +++ b/arch/m68knommu/platform/68360/ints.c | |||
@@ -20,6 +20,7 @@ | |||
20 | 20 | ||
21 | #include <asm/system.h> | 21 | #include <asm/system.h> |
22 | #include <asm/irq.h> | 22 | #include <asm/irq.h> |
23 | #include <asm/irqnode.h> | ||
23 | #include <asm/traps.h> | 24 | #include <asm/traps.h> |
24 | #include <asm/io.h> | 25 | #include <asm/io.h> |
25 | #include <asm/machdep.h> | 26 | #include <asm/machdep.h> |
diff --git a/arch/m68knommu/platform/68EZ328/config.c b/arch/m68knommu/platform/68EZ328/config.c index d8d56e5de310..15a14a67c2bf 100644 --- a/arch/m68knommu/platform/68EZ328/config.c +++ b/arch/m68knommu/platform/68EZ328/config.c | |||
@@ -42,13 +42,13 @@ void m68328_timer_gettod(int *year, int *mon, int *day, int *hour, int *min, int | |||
42 | void m68ez328_reset(void) | 42 | void m68ez328_reset(void) |
43 | { | 43 | { |
44 | local_irq_disable(); | 44 | local_irq_disable(); |
45 | asm volatile (" | 45 | asm volatile ( |
46 | moveal #0x10c00000, %a0; | 46 | "moveal #0x10c00000, %a0;\n" |
47 | moveb #0, 0xFFFFF300; | 47 | "moveb #0, 0xFFFFF300;\n" |
48 | moveal 0(%a0), %sp; | 48 | "moveal 0(%a0), %sp;\n" |
49 | moveal 4(%a0), %a0; | 49 | "moveal 4(%a0), %a0;\n" |
50 | jmp (%a0); | 50 | "jmp (%a0);\n" |
51 | "); | 51 | ); |
52 | } | 52 | } |
53 | 53 | ||
54 | /***************************************************************************/ | 54 | /***************************************************************************/ |
diff --git a/arch/m68knommu/platform/68VZ328/config.c b/arch/m68knommu/platform/68VZ328/config.c index d926524cdf82..4058de5c8fa2 100644 --- a/arch/m68knommu/platform/68VZ328/config.c +++ b/arch/m68knommu/platform/68VZ328/config.c | |||
@@ -141,13 +141,13 @@ static void init_hardware(char *command, int size) | |||
141 | static void m68vz328_reset(void) | 141 | static void m68vz328_reset(void) |
142 | { | 142 | { |
143 | local_irq_disable(); | 143 | local_irq_disable(); |
144 | asm volatile (" | 144 | asm volatile ( |
145 | moveal #0x10c00000, %a0; | 145 | "moveal #0x10c00000, %a0;\n\t" |
146 | moveb #0, 0xFFFFF300; | 146 | "moveb #0, 0xFFFFF300;\n\t" |
147 | moveal 0(%a0), %sp; | 147 | "moveal 0(%a0), %sp;\n\t" |
148 | moveal 4(%a0), %a0; | 148 | "moveal 4(%a0), %a0;\n\t" |
149 | jmp (%a0); | 149 | "jmp (%a0);\n" |
150 | "); | 150 | ); |
151 | } | 151 | } |
152 | 152 | ||
153 | unsigned char *cs8900a_hwaddr; | 153 | unsigned char *cs8900a_hwaddr; |
diff --git a/arch/powerpc/platforms/powermac/backlight.c b/arch/powerpc/platforms/powermac/backlight.c index 498b042e1837..c7a27eddca6d 100644 --- a/arch/powerpc/platforms/powermac/backlight.c +++ b/arch/powerpc/platforms/powermac/backlight.c | |||
@@ -119,7 +119,14 @@ int pmac_backlight_set_legacy_brightness(int brightness) | |||
119 | down(&pmac_backlight->sem); | 119 | down(&pmac_backlight->sem); |
120 | props = pmac_backlight->props; | 120 | props = pmac_backlight->props; |
121 | props->brightness = brightness * | 121 | props->brightness = brightness * |
122 | props->max_brightness / OLD_BACKLIGHT_MAX; | 122 | (props->max_brightness + 1) / |
123 | (OLD_BACKLIGHT_MAX + 1); | ||
124 | |||
125 | if (props->brightness > props->max_brightness) | ||
126 | props->brightness = props->max_brightness; | ||
127 | else if (props->brightness < 0) | ||
128 | props->brightness = 0; | ||
129 | |||
123 | props->update_status(pmac_backlight); | 130 | props->update_status(pmac_backlight); |
124 | up(&pmac_backlight->sem); | 131 | up(&pmac_backlight->sem); |
125 | 132 | ||
@@ -140,8 +147,11 @@ int pmac_backlight_get_legacy_brightness() | |||
140 | 147 | ||
141 | down(&pmac_backlight->sem); | 148 | down(&pmac_backlight->sem); |
142 | props = pmac_backlight->props; | 149 | props = pmac_backlight->props; |
150 | |||
143 | result = props->brightness * | 151 | result = props->brightness * |
144 | OLD_BACKLIGHT_MAX / props->max_brightness; | 152 | (OLD_BACKLIGHT_MAX + 1) / |
153 | (props->max_brightness + 1); | ||
154 | |||
145 | up(&pmac_backlight->sem); | 155 | up(&pmac_backlight->sem); |
146 | } | 156 | } |
147 | mutex_unlock(&pmac_backlight_mutex); | 157 | mutex_unlock(&pmac_backlight_mutex); |
diff --git a/arch/x86_64/kernel/irq.c b/arch/x86_64/kernel/irq.c index 3be0a7e4bf08..bfa82f52a5cc 100644 --- a/arch/x86_64/kernel/irq.c +++ b/arch/x86_64/kernel/irq.c | |||
@@ -118,6 +118,12 @@ asmlinkage unsigned int do_IRQ(struct pt_regs *regs) | |||
118 | /* high bit used in ret_from_ code */ | 118 | /* high bit used in ret_from_ code */ |
119 | unsigned irq = ~regs->orig_rax; | 119 | unsigned irq = ~regs->orig_rax; |
120 | 120 | ||
121 | if (unlikely(irq >= NR_IRQS)) { | ||
122 | printk(KERN_EMERG "%s: cannot handle IRQ %d\n", | ||
123 | __FUNCTION__, irq); | ||
124 | BUG(); | ||
125 | } | ||
126 | |||
121 | exit_idle(); | 127 | exit_idle(); |
122 | irq_enter(); | 128 | irq_enter(); |
123 | #ifdef CONFIG_DEBUG_STACKOVERFLOW | 129 | #ifdef CONFIG_DEBUG_STACKOVERFLOW |
diff --git a/arch/x86_64/kernel/nmi.c b/arch/x86_64/kernel/nmi.c index 399489c93132..0ef9cf2bc45e 100644 --- a/arch/x86_64/kernel/nmi.c +++ b/arch/x86_64/kernel/nmi.c | |||
@@ -607,11 +607,13 @@ void set_nmi_callback(nmi_callback_t callback) | |||
607 | vmalloc_sync_all(); | 607 | vmalloc_sync_all(); |
608 | rcu_assign_pointer(nmi_callback, callback); | 608 | rcu_assign_pointer(nmi_callback, callback); |
609 | } | 609 | } |
610 | EXPORT_SYMBOL_GPL(set_nmi_callback); | ||
610 | 611 | ||
611 | void unset_nmi_callback(void) | 612 | void unset_nmi_callback(void) |
612 | { | 613 | { |
613 | nmi_callback = dummy_nmi_callback; | 614 | nmi_callback = dummy_nmi_callback; |
614 | } | 615 | } |
616 | EXPORT_SYMBOL_GPL(unset_nmi_callback); | ||
615 | 617 | ||
616 | #ifdef CONFIG_SYSCTL | 618 | #ifdef CONFIG_SYSCTL |
617 | 619 | ||