aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/Kconfig17
-rw-r--r--arch/arm/Makefile2
-rw-r--r--arch/arm/configs/at91rm9200dk_defconfig1
-rw-r--r--arch/arm/configs/at91rm9200ek_defconfig1
-rw-r--r--arch/arm/configs/ateb9200_defconfig1
-rw-r--r--arch/arm/configs/carmeva_defconfig1
-rw-r--r--arch/arm/configs/csb337_defconfig1
-rw-r--r--arch/arm/configs/csb637_defconfig1
-rw-r--r--arch/arm/configs/kafa_defconfig1
-rw-r--r--arch/arm/configs/kb9202_defconfig1
-rw-r--r--arch/arm/configs/onearm_defconfig1
-rw-r--r--arch/arm/kernel/Makefile3
-rw-r--r--arch/arm/kernel/armksyms.c13
-rw-r--r--arch/arm/kernel/asm-offsets.c3
-rw-r--r--arch/arm/kernel/crunch-bits.S305
-rw-r--r--arch/arm/kernel/crunch.c83
-rw-r--r--arch/arm/kernel/entry-armv.S6
-rw-r--r--arch/arm/kernel/ptrace.c36
-rw-r--r--arch/arm/kernel/setup.c6
-rw-r--r--arch/arm/kernel/signal.c39
-rw-r--r--arch/arm/kernel/vmlinux.lds.S8
-rw-r--r--arch/arm/lib/Makefile13
-rw-r--r--arch/arm/lib/backtrace.S5
-rw-r--r--arch/arm/lib/clear_user.S4
-rw-r--r--arch/arm/lib/copy_from_user.S4
-rw-r--r--arch/arm/lib/copy_to_user.S4
-rw-r--r--arch/arm/lib/strncpy_from_user.S2
-rw-r--r--arch/arm/lib/strnlen_user.S4
-rw-r--r--arch/arm/lib/uaccess.S8
-rw-r--r--arch/arm/mach-at91rm9200/Kconfig82
-rw-r--r--arch/arm/mach-at91rm9200/Makefile13
-rw-r--r--arch/arm/mach-at91rm9200/at91rm9200.c (renamed from arch/arm/mach-at91rm9200/common.c)2
-rw-r--r--arch/arm/mach-at91rm9200/at91rm9200_time.c (renamed from arch/arm/mach-at91rm9200/time.c)2
-rw-r--r--arch/arm/mach-ep93xx/Kconfig17
-rw-r--r--arch/arm/mach-ep93xx/Makefile2
-rw-r--r--arch/arm/mach-ep93xx/edb9302.c62
-rw-r--r--arch/arm/mach-ep93xx/edb9315.c62
-rw-r--r--arch/arm/mach-ep93xx/gesbc9312.c2
-rw-r--r--arch/arm/mach-ep93xx/ts72xx.c2
-rw-r--r--arch/arm/mach-ixp23xx/espresso.c2
-rw-r--r--arch/arm/mach-ixp23xx/ixdp2351.c2
-rw-r--r--arch/arm/mach-ixp23xx/roadrunner.c2
-rw-r--r--arch/arm/mach-pxa/irq.c4
-rw-r--r--arch/arm/mach-pxa/lpd270.c126
-rw-r--r--arch/arm/mach-s3c2410/s3c244x.c1
-rw-r--r--arch/arm/mm/Kconfig71
-rw-r--r--arch/arm/mm/Makefile10
-rw-r--r--arch/arm/mm/init.c2
-rw-r--r--arch/arm/mm/iomap.c55
-rw-r--r--arch/arm/mm/ioremap.c47
-rw-r--r--arch/arm/mm/nommu.c39
-rw-r--r--arch/arm/mm/proc-arm1020.S9
-rw-r--r--arch/arm/mm/proc-arm1020e.S29
-rw-r--r--arch/arm/mm/proc-arm1022.S29
-rw-r--r--arch/arm/mm/proc-arm1026.S29
-rw-r--r--arch/arm/mm/proc-arm6_7.S15
-rw-r--r--arch/arm/mm/proc-arm720.S12
-rw-r--r--arch/arm/mm/proc-arm920.S23
-rw-r--r--arch/arm/mm/proc-arm922.S23
-rw-r--r--arch/arm/mm/proc-arm925.S27
-rw-r--r--arch/arm/mm/proc-arm926.S26
-rw-r--r--arch/arm/mm/proc-sa110.S11
-rw-r--r--arch/arm/mm/proc-sa1100.S11
-rw-r--r--arch/arm/mm/proc-v6.S7
64 files changed, 1143 insertions, 289 deletions
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 30dede5a38b9..d28d2571f080 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -121,11 +121,11 @@ config ARCH_VERSATILE
121 help 121 help
122 This enables support for ARM Ltd Versatile board. 122 This enables support for ARM Ltd Versatile board.
123 123
124config ARCH_AT91RM9200 124config ARCH_AT91
125 bool "Atmel AT91RM9200" 125 bool "Atmel AT91"
126 help 126 help
127 Say Y here if you intend to run this kernel on an Atmel 127 This enables support for systems based on the Atmel AT91RM9200
128 AT91RM9200-based board. 128 and AT91SAM9xxx processors.
129 129
130config ARCH_CLPS7500 130config ARCH_CLPS7500
131 bool "Cirrus CL-PS7500FE" 131 bool "Cirrus CL-PS7500FE"
@@ -188,23 +188,27 @@ config ARCH_IMX
188 188
189config ARCH_IOP3XX 189config 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
195config ARCH_IXP4XX 196config 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
200config ARCH_IXP2000 202config 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
206config ARCH_IXP23XX 209config 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
230config ARCH_PXA 234config 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
347if !MMU
348source "arch/arm/Kconfig-nommu"
349endif
350
342endmenu 351endmenu
343 352
344source "arch/arm/common/Kconfig" 353source "arch/arm/common/Kconfig"
diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index a3bbaaf480b9..3345c6d0fd1e 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -114,7 +114,7 @@ endif
114 machine-$(CONFIG_ARCH_H720X) := h720x 114 machine-$(CONFIG_ARCH_H720X) := h720x
115 machine-$(CONFIG_ARCH_AAEC2000) := aaec2000 115 machine-$(CONFIG_ARCH_AAEC2000) := aaec2000
116 machine-$(CONFIG_ARCH_REALVIEW) := realview 116 machine-$(CONFIG_ARCH_REALVIEW) := realview
117 machine-$(CONFIG_ARCH_AT91RM9200) := at91rm9200 117 machine-$(CONFIG_ARCH_AT91) := at91rm9200
118 machine-$(CONFIG_ARCH_EP93XX) := ep93xx 118 machine-$(CONFIG_ARCH_EP93XX) := ep93xx
119 machine-$(CONFIG_ARCH_PNX4008) := pnx4008 119 machine-$(CONFIG_ARCH_PNX4008) := pnx4008
120 machine-$(CONFIG_ARCH_NETX) := netx 120 machine-$(CONFIG_ARCH_NETX) := netx
diff --git a/arch/arm/configs/at91rm9200dk_defconfig b/arch/arm/configs/at91rm9200dk_defconfig
index 9e1c1cceb735..4f3d8d37741e 100644
--- a/arch/arm/configs/at91rm9200dk_defconfig
+++ b/arch/arm/configs/at91rm9200dk_defconfig
@@ -103,6 +103,7 @@ CONFIG_DEFAULT_IOSCHED="anticipatory"
103# CONFIG_ARCH_IMX is not set 103# CONFIG_ARCH_IMX is not set
104# CONFIG_ARCH_H720X is not set 104# CONFIG_ARCH_H720X is not set
105# CONFIG_ARCH_AAEC2000 is not set 105# CONFIG_ARCH_AAEC2000 is not set
106CONFIG_ARCH_AT91=y
106CONFIG_ARCH_AT91RM9200=y 107CONFIG_ARCH_AT91RM9200=y
107 108
108# 109#
diff --git a/arch/arm/configs/at91rm9200ek_defconfig b/arch/arm/configs/at91rm9200ek_defconfig
index 6e0805a971d7..08b5dc38876f 100644
--- a/arch/arm/configs/at91rm9200ek_defconfig
+++ b/arch/arm/configs/at91rm9200ek_defconfig
@@ -103,6 +103,7 @@ CONFIG_DEFAULT_IOSCHED="anticipatory"
103# CONFIG_ARCH_IMX is not set 103# CONFIG_ARCH_IMX is not set
104# CONFIG_ARCH_H720X is not set 104# CONFIG_ARCH_H720X is not set
105# CONFIG_ARCH_AAEC2000 is not set 105# CONFIG_ARCH_AAEC2000 is not set
106CONFIG_ARCH_AT91=y
106CONFIG_ARCH_AT91RM9200=y 107CONFIG_ARCH_AT91RM9200=y
107 108
108# 109#
diff --git a/arch/arm/configs/ateb9200_defconfig b/arch/arm/configs/ateb9200_defconfig
index 69c39e098743..bee7813d040e 100644
--- a/arch/arm/configs/ateb9200_defconfig
+++ b/arch/arm/configs/ateb9200_defconfig
@@ -105,6 +105,7 @@ CONFIG_DEFAULT_IOSCHED="anticipatory"
105# CONFIG_ARCH_IMX is not set 105# CONFIG_ARCH_IMX is not set
106# CONFIG_ARCH_H720X is not set 106# CONFIG_ARCH_H720X is not set
107# CONFIG_ARCH_AAEC2000 is not set 107# CONFIG_ARCH_AAEC2000 is not set
108CONFIG_ARCH_AT91=y
108CONFIG_ARCH_AT91RM9200=y 109CONFIG_ARCH_AT91RM9200=y
109 110
110# 111#
diff --git a/arch/arm/configs/carmeva_defconfig b/arch/arm/configs/carmeva_defconfig
index 5ccd29a7c1fb..8a075c8ecc63 100644
--- a/arch/arm/configs/carmeva_defconfig
+++ b/arch/arm/configs/carmeva_defconfig
@@ -82,6 +82,7 @@ CONFIG_OBSOLETE_MODPARM=y
82# CONFIG_ARCH_VERSATILE is not set 82# CONFIG_ARCH_VERSATILE is not set
83# CONFIG_ARCH_IMX is not set 83# CONFIG_ARCH_IMX is not set
84# CONFIG_ARCH_H720X is not set 84# CONFIG_ARCH_H720X is not set
85CONFIG_ARCH_AT91=y
85CONFIG_ARCH_AT91RM9200=y 86CONFIG_ARCH_AT91RM9200=y
86 87
87# 88#
diff --git a/arch/arm/configs/csb337_defconfig b/arch/arm/configs/csb337_defconfig
index 94bd9932a402..3594155a8137 100644
--- a/arch/arm/configs/csb337_defconfig
+++ b/arch/arm/configs/csb337_defconfig
@@ -103,6 +103,7 @@ CONFIG_DEFAULT_IOSCHED="anticipatory"
103# CONFIG_ARCH_IMX is not set 103# CONFIG_ARCH_IMX is not set
104# CONFIG_ARCH_H720X is not set 104# CONFIG_ARCH_H720X is not set
105# CONFIG_ARCH_AAEC2000 is not set 105# CONFIG_ARCH_AAEC2000 is not set
106CONFIG_ARCH_AT91=y
106CONFIG_ARCH_AT91RM9200=y 107CONFIG_ARCH_AT91RM9200=y
107 108
108# 109#
diff --git a/arch/arm/configs/csb637_defconfig b/arch/arm/configs/csb637_defconfig
index 1519124c5501..640d70c1f066 100644
--- a/arch/arm/configs/csb637_defconfig
+++ b/arch/arm/configs/csb637_defconfig
@@ -103,6 +103,7 @@ CONFIG_DEFAULT_IOSCHED="anticipatory"
103# CONFIG_ARCH_IMX is not set 103# CONFIG_ARCH_IMX is not set
104# CONFIG_ARCH_H720X is not set 104# CONFIG_ARCH_H720X is not set
105# CONFIG_ARCH_AAEC2000 is not set 105# CONFIG_ARCH_AAEC2000 is not set
106CONFIG_ARCH_AT91=y
106CONFIG_ARCH_AT91RM9200=y 107CONFIG_ARCH_AT91RM9200=y
107 108
108# 109#
diff --git a/arch/arm/configs/kafa_defconfig b/arch/arm/configs/kafa_defconfig
index 51ded20e3f64..1db633e2c940 100644
--- a/arch/arm/configs/kafa_defconfig
+++ b/arch/arm/configs/kafa_defconfig
@@ -105,6 +105,7 @@ CONFIG_DEFAULT_IOSCHED="deadline"
105# CONFIG_ARCH_IMX is not set 105# CONFIG_ARCH_IMX is not set
106# CONFIG_ARCH_H720X is not set 106# CONFIG_ARCH_H720X is not set
107# CONFIG_ARCH_AAEC2000 is not set 107# CONFIG_ARCH_AAEC2000 is not set
108CONFIG_ARCH_AT91=y
108CONFIG_ARCH_AT91RM9200=y 109CONFIG_ARCH_AT91RM9200=y
109 110
110# 111#
diff --git a/arch/arm/configs/kb9202_defconfig b/arch/arm/configs/kb9202_defconfig
index fee4f566452e..45396e087196 100644
--- a/arch/arm/configs/kb9202_defconfig
+++ b/arch/arm/configs/kb9202_defconfig
@@ -80,6 +80,7 @@ CONFIG_KMOD=y
80# CONFIG_ARCH_IMX is not set 80# CONFIG_ARCH_IMX is not set
81# CONFIG_ARCH_H720X is not set 81# CONFIG_ARCH_H720X is not set
82# CONFIG_ARCH_AAEC2000 is not set 82# CONFIG_ARCH_AAEC2000 is not set
83CONFIG_ARCH_AT91=y
83CONFIG_ARCH_AT91RM9200=y 84CONFIG_ARCH_AT91RM9200=y
84 85
85# 86#
diff --git a/arch/arm/configs/onearm_defconfig b/arch/arm/configs/onearm_defconfig
index 5401c01caefe..2b4a63be03f7 100644
--- a/arch/arm/configs/onearm_defconfig
+++ b/arch/arm/configs/onearm_defconfig
@@ -85,6 +85,7 @@ CONFIG_DEFAULT_IOSCHED="anticipatory"
85# CONFIG_ARCH_INTEGRATOR is not set 85# CONFIG_ARCH_INTEGRATOR is not set
86# CONFIG_ARCH_REALVIEW is not set 86# CONFIG_ARCH_REALVIEW is not set
87# CONFIG_ARCH_VERSATILE is not set 87# CONFIG_ARCH_VERSATILE is not set
88CONFIG_ARCH_AT91=y
88CONFIG_ARCH_AT91RM9200=y 89CONFIG_ARCH_AT91RM9200=y
89# CONFIG_ARCH_CLPS7500 is not set 90# CONFIG_ARCH_CLPS7500 is not set
90# CONFIG_ARCH_CLPS711X is not set 91# CONFIG_ARCH_CLPS711X is not set
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
22obj-$(CONFIG_SMP) += smp.o 22obj-$(CONFIG_SMP) += smp.o
23obj-$(CONFIG_OABI_COMPAT) += sys_oabi-compat.o 23obj-$(CONFIG_OABI_COMPAT) += sys_oabi-compat.o
24 24
25obj-$(CONFIG_CRUNCH) += crunch.o crunch-bits.o
26AFLAGS_crunch-bits.o := -Wa,-mcpu=ep9312
27
25obj-$(CONFIG_IWMMXT) += iwmmxt.o 28obj-$(CONFIG_IWMMXT) += iwmmxt.o
26AFLAGS_iwmmxt.o := -Wa,-mcpu=iwmmxt 29AFLAGS_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);
109EXPORT_SYMBOL(__memzero); 109EXPORT_SYMBOL(__memzero);
110 110
111 /* user mem (segment) */ 111 /* user mem (segment) */
112EXPORT_SYMBOL(__arch_copy_from_user); 112EXPORT_SYMBOL(__strnlen_user);
113EXPORT_SYMBOL(__arch_copy_to_user); 113EXPORT_SYMBOL(__strncpy_from_user);
114EXPORT_SYMBOL(__arch_clear_user); 114
115EXPORT_SYMBOL(__arch_strnlen_user); 115#ifdef CONFIG_MMU
116EXPORT_SYMBOL(__arch_strncpy_from_user); 116EXPORT_SYMBOL(__copy_from_user);
117EXPORT_SYMBOL(__copy_to_user);
118EXPORT_SYMBOL(__clear_user);
117 119
118EXPORT_SYMBOL(__get_user_1); 120EXPORT_SYMBOL(__get_user_1);
119EXPORT_SYMBOL(__get_user_2); 121EXPORT_SYMBOL(__get_user_2);
@@ -123,6 +125,7 @@ EXPORT_SYMBOL(__put_user_1);
123EXPORT_SYMBOL(__put_user_2); 125EXPORT_SYMBOL(__put_user_2);
124EXPORT_SYMBOL(__put_user_4); 126EXPORT_SYMBOL(__put_user_4);
125EXPORT_SYMBOL(__put_user_8); 127EXPORT_SYMBOL(__put_user_8);
128#endif
126 129
127 /* crypto hash */ 130 /* crypto hash */
128EXPORT_SYMBOL(sha_transform); 131EXPORT_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 */
67ENTRY(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
93crunch_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
147crunch_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 */
201ENTRY(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
2381: 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 */
249ENTRY(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
2671: @ 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 */
282ENTRY(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
2991: @ 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
23struct crunch_state *crunch_owner;
24
25void 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
33static int crunch_enabled(u32 devcfg)
34{
35 return !!(devcfg & EP93XX_SYSCON_DEVICE_CONFIG_CRUNCH_ENABLE);
36}
37
38static 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
72static struct notifier_block crunch_notifier_block = {
73 .notifier_call = crunch_do,
74};
75
76static int __init crunch_init(void)
77{
78 thread_register_notifier(&crunch_notifier_block);
79
80 return 0;
81}
82
83late_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 */
641static 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 */
653static 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
637long arch_ptrace(struct task_struct *child, long request, long addr, long data) 663long 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/setup.c b/arch/arm/kernel/setup.c
index 9fc9af88c60c..7d02f96eeb9d 100644
--- a/arch/arm/kernel/setup.c
+++ b/arch/arm/kernel/setup.c
@@ -315,9 +315,9 @@ static void __init setup_processor(void)
315 cpu_cache = *list->cache; 315 cpu_cache = *list->cache;
316#endif 316#endif
317 317
318 printk("CPU: %s [%08x] revision %d (ARMv%s)\n", 318 printk("CPU: %s [%08x] revision %d (ARMv%s), cr=%08x\n",
319 cpu_name, processor_id, (int)processor_id & 15, 319 cpu_name, processor_id, (int)processor_id & 15,
320 proc_arch[cpu_architecture()]); 320 proc_arch[cpu_architecture()], cr_alignment);
321 321
322 sprintf(system_utsname.machine, "%s%c", list->arch_name, ENDIANNESS); 322 sprintf(system_utsname.machine, "%s%c", list->arch_name, ENDIANNESS);
323 sprintf(elf_platform, "%s%c", list->elf_name, ENDIANNESS); 323 sprintf(elf_platform, "%s%c", list->elf_name, ENDIANNESS);
@@ -808,7 +808,7 @@ static int __init topology_init(void)
808 int cpu; 808 int cpu;
809 809
810 for_each_possible_cpu(cpu) 810 for_each_possible_cpu(cpu)
811 register_cpu(&per_cpu(cpu_data, cpu).cpu, cpu, NULL); 811 register_cpu(&per_cpu(cpu_data, cpu).cpu, cpu);
812 812
813 return 0; 813 return 0;
814} 814}
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
136static 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
149static 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
137static int preserve_iwmmxt_context(struct iwmmxt_sigframe *frame) 168static 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
7lib-y := backtrace.o changebit.o csumipv6.o csumpartial.o \ 7lib-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
18mmu-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
21ifeq ($(CONFIG_PREEMPT),y) 22ifeq ($(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
23else 24else
24ifneq ($(CONFIG_CPU_32v3),y) 25ifneq ($(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
26else 27else
27 lib-y += uaccess.o 28 mmu-y += uaccess.o
28endif 29endif
29endif 30endif
30 31
32lib-$(CONFIG_MMU) += $(mmu-y)
33
31ifeq ($(CONFIG_CPU_32v3),y) 34ifeq ($(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
33else 36else
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
1041007: ldr r0, =.Lbad 1021007: 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 */
21ENTRY(__arch_clear_user) 21ENTRY(__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
86ENTRY(__arch_copy_from_user) 86ENTRY(__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
89ENTRY(__arch_copy_to_user) 89ENTRY(__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 */
23ENTRY(__arch_strncpy_from_user) 23ENTRY(__strncpy_from_user)
24 mov ip, r1 24 mov ip, r1
251: subs r2, r2, #1 251: subs r2, r2, #1
26USER( ldrplbt r3, [r1], #1) 26USER( 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 */
23ENTRY(__arch_strnlen_user) 23ENTRY(__strnlen_user)
24 mov r2, r0 24 mov r2, r0
251: 251:
26USER( ldrbt r3, [r0], #1) 26USER( 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
42ENTRY(__arch_copy_to_user) 42ENTRY(__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
2839001: ldmfd sp!, {r0, r4 - r7, pc} 2839001: 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
305ENTRY(__arch_copy_from_user) 305ENTRY(__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-at91rm9200/Kconfig b/arch/arm/mach-at91rm9200/Kconfig
index 70d402f76ce5..2f85e8693b1b 100644
--- a/arch/arm/mach-at91rm9200/Kconfig
+++ b/arch/arm/mach-at91rm9200/Kconfig
@@ -1,6 +1,21 @@
1if ARCH_AT91RM9200 1if ARCH_AT91
2
3menu "Atmel AT91 System-on-Chip"
4
5comment "Atmel AT91 Processors"
6
7config ARCH_AT91RM9200
8 bool "AT91RM9200"
2 9
3menu "AT91RM9200 Implementations" 10config ARCH_AT91SAM9260
11 bool "AT91SAM9260"
12
13config ARCH_AT91SAM9261
14 bool "AT91SAM9261"
15
16# ----------------------------------------------------------
17
18if ARCH_AT91RM9200
4 19
5comment "AT91RM9200 Board Type" 20comment "AT91RM9200 Board Type"
6 21
@@ -8,58 +23,87 @@ config MACH_ONEARM
8 bool "Ajeco 1ARM Single Board Computer" 23 bool "Ajeco 1ARM Single Board Computer"
9 depends on ARCH_AT91RM9200 24 depends on ARCH_AT91RM9200
10 help 25 help
11 Select this if you are using Ajeco's 1ARM Single Board Computer 26 Select this if you are using Ajeco's 1ARM Single Board Computer.
27 <http://www.ajeco.fi/products.htm>
12 28
13config ARCH_AT91RM9200DK 29config ARCH_AT91RM9200DK
14 bool "Atmel AT91RM9200-DK Development board" 30 bool "Atmel AT91RM9200-DK Development board"
15 depends on ARCH_AT91RM9200 31 depends on ARCH_AT91RM9200
16 help 32 help
17 Select this if you are using Atmel's AT91RM9200-DK Development board 33 Select this if you are using Atmel's AT91RM9200-DK Development board.
34 (Discontinued)
35
18 36
19config MACH_AT91RM9200EK 37config MACH_AT91RM9200EK
20 bool "Atmel AT91RM9200-EK Evaluation Kit" 38 bool "Atmel AT91RM9200-EK Evaluation Kit"
21 depends on ARCH_AT91RM9200 39 depends on ARCH_AT91RM9200
22 help 40 help
23 Select this if you are using Atmel's AT91RM9200-EK Evaluation Kit 41 Select this if you are using Atmel's AT91RM9200-EK Evaluation Kit.
42 <http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3507>
24 43
25config MACH_CSB337 44config MACH_CSB337
26 bool "Cogent CSB337 board" 45 bool "Cogent CSB337"
27 depends on ARCH_AT91RM9200 46 depends on ARCH_AT91RM9200
28 help 47 help
29 Select this if you are using Cogent's CSB337 board 48 Select this if you are using Cogent's CSB337 board.
49 <http://www.cogcomp.com/csb_csb337.htm>
30 50
31config MACH_CSB637 51config MACH_CSB637
32 bool "Cogent CSB637 board" 52 bool "Cogent CSB637"
33 depends on ARCH_AT91RM9200 53 depends on ARCH_AT91RM9200
34 help 54 help
35 Select this if you are using Cogent's CSB637 board 55 Select this if you are using Cogent's CSB637 board.
56 <http://www.cogcomp.com/csb_csb637.htm>
36 57
37config MACH_CARMEVA 58config MACH_CARMEVA
38 bool "Conitec's ARM&EVA" 59 bool "Conitec ARM&EVA"
39 depends on ARCH_AT91RM9200 60 depends on ARCH_AT91RM9200
40 help 61 help
41 Select this if you are using Conitec's AT91RM9200-MCU-Module 62 Select this if you are using Conitec's AT91RM9200-MCU-Module.
63 <http://www.conitec.net/english/linuxboard.htm>
42 64
43config MACH_KB9200 65config MACH_ATEB9200
44 bool "KwikByte's KB920x" 66 bool "Embest ATEB9200"
45 depends on ARCH_AT91RM9200 67 depends on ARCH_AT91RM9200
46 help 68 help
47 Select this if you are using KwikByte's KB920x board 69 Select this if you are using Embest's ATEB9200 board.
70 <http://www.embedinfo.com/english/product/ATEB9200.asp>
48 71
49config MACH_ATEB9200 72config MACH_KB9200
50 bool "Embest's ATEB9200" 73 bool "KwikByte KB920x"
51 depends on ARCH_AT91RM9200 74 depends on ARCH_AT91RM9200
52 help 75 help
53 Select this if you are using Embest's ATEB9200 board 76 Select this if you are using KwikByte's KB920x board.
77 <http://kwikbyte.com/KB9202_description_new.htm>
54 78
55config MACH_KAFA 79config MACH_KAFA
56 bool "Sperry-Sun KAFA board" 80 bool "Sperry-Sun KAFA board"
57 depends on ARCH_AT91RM9200 81 depends on ARCH_AT91RM9200
58 help 82 help
59 Select this if you are using Sperry-Sun's KAFA board 83 Select this if you are using Sperry-Sun's KAFA board.
84
85endif
86
87# ----------------------------------------------------------
88
89if ARCH_AT91SAM9260
90
91comment "AT91SAM9260 Board Type"
92
93endif
94
95# ----------------------------------------------------------
96
97if ARCH_AT91SAM9261
98
99comment "AT91SAM9261 Board Type"
100
101endif
102
60 103
104# ----------------------------------------------------------
61 105
62comment "AT91RM9200 Feature Selections" 106comment "AT91 Feature Selections"
63 107
64config AT91_PROGRAMMABLE_CLOCKS 108config AT91_PROGRAMMABLE_CLOCKS
65 bool "Programmable Clocks" 109 bool "Programmable Clocks"
diff --git a/arch/arm/mach-at91rm9200/Makefile b/arch/arm/mach-at91rm9200/Makefile
index 82db957322df..c174805c24e5 100644
--- a/arch/arm/mach-at91rm9200/Makefile
+++ b/arch/arm/mach-at91rm9200/Makefile
@@ -2,14 +2,19 @@
2# Makefile for the linux kernel. 2# Makefile for the linux kernel.
3# 3#
4 4
5obj-y := clock.o irq.o time.o gpio.o common.o devices.o 5obj-y := clock.o irq.o gpio.o devices.o
6obj-m := 6obj-m :=
7obj-n := 7obj-n :=
8obj- := 8obj- :=
9 9
10obj-$(CONFIG_PM) += pm.o 10obj-$(CONFIG_PM) += pm.o
11 11
12# Board-specific support 12# CPU-specific support
13obj-$(CONFIG_ARCH_AT91RM9200) += at91rm9200.o at91rm9200_time.o
14obj-$(CONFIG_ARCH_AT91SAM9260) +=
15obj-$(CONFIG_ARCH_AT91SAM9261) +=
16
17# AT91RM9200 Board-specific support
13obj-$(CONFIG_MACH_ONEARM) += board-1arm.o 18obj-$(CONFIG_MACH_ONEARM) += board-1arm.o
14obj-$(CONFIG_ARCH_AT91RM9200DK) += board-dk.o 19obj-$(CONFIG_ARCH_AT91RM9200DK) += board-dk.o
15obj-$(CONFIG_MACH_AT91RM9200EK) += board-ek.o 20obj-$(CONFIG_MACH_AT91RM9200EK) += board-ek.o
@@ -20,6 +25,10 @@ obj-$(CONFIG_MACH_KB9200) += board-kb9202.o
20obj-$(CONFIG_MACH_ATEB9200) += board-eb9200.o 25obj-$(CONFIG_MACH_ATEB9200) += board-eb9200.o
21obj-$(CONFIG_MACH_KAFA) += board-kafa.o 26obj-$(CONFIG_MACH_KAFA) += board-kafa.o
22 27
28# AT91SAM9260 board-specific support
29
30# AT91SAM9261 board-specific support
31
23# LEDs support 32# LEDs support
24led-$(CONFIG_ARCH_AT91RM9200DK) += leds.o 33led-$(CONFIG_ARCH_AT91RM9200DK) += leds.o
25led-$(CONFIG_MACH_AT91RM9200EK) += leds.o 34led-$(CONFIG_MACH_AT91RM9200EK) += leds.o
diff --git a/arch/arm/mach-at91rm9200/common.c b/arch/arm/mach-at91rm9200/at91rm9200.c
index e836f8537a1d..90f08d383889 100644
--- a/arch/arm/mach-at91rm9200/common.c
+++ b/arch/arm/mach-at91rm9200/at91rm9200.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * arch/arm/mach-at91rm9200/common.c 2 * arch/arm/mach-at91rm9200/at91rm9200.c
3 * 3 *
4 * Copyright (C) 2005 SAN People 4 * Copyright (C) 2005 SAN People
5 * 5 *
diff --git a/arch/arm/mach-at91rm9200/time.c b/arch/arm/mach-at91rm9200/at91rm9200_time.c
index fc2d7d5e4637..1077fb85c411 100644
--- a/arch/arm/mach-at91rm9200/time.c
+++ b/arch/arm/mach-at91rm9200/at91rm9200_time.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * linux/arch/arm/mach-at91rm9200/time.c 2 * linux/arch/arm/mach-at91rm9200/at91rm9200_time.c
3 * 3 *
4 * Copyright (C) 2003 SAN People 4 * Copyright (C) 2003 SAN People
5 * Copyright (C) 2003 ATMEL 5 * Copyright (C) 2003 ATMEL
diff --git a/arch/arm/mach-ep93xx/Kconfig b/arch/arm/mach-ep93xx/Kconfig
index cec5a21ca4e3..c7c11f429d54 100644
--- a/arch/arm/mach-ep93xx/Kconfig
+++ b/arch/arm/mach-ep93xx/Kconfig
@@ -2,8 +2,25 @@ if ARCH_EP93XX
2 2
3menu "Cirrus EP93xx Implementation Options" 3menu "Cirrus EP93xx Implementation Options"
4 4
5config CRUNCH
6 bool "Support for MaverickCrunch"
7 help
8 Enable kernel support for MaverickCrunch.
9
5comment "EP93xx Platforms" 10comment "EP93xx Platforms"
6 11
12config MACH_EDB9302
13 bool "Support Cirrus Logic EDB9302"
14 help
15 Say 'Y' here if you want your kernel to support the Cirrus
16 Logic EDB9302 Evaluation Board.
17
18config MACH_EDB9315
19 bool "Support Cirrus Logic EDB9315"
20 help
21 Say 'Y' here if you want your kernel to support the Cirrus
22 Logic EDB9315 Evaluation Board.
23
7config MACH_GESBC9312 24config MACH_GESBC9312
8 bool "Support Glomation GESBC-9312-sx" 25 bool "Support Glomation GESBC-9312-sx"
9 help 26 help
diff --git a/arch/arm/mach-ep93xx/Makefile b/arch/arm/mach-ep93xx/Makefile
index 05a48a21038e..feda783c03da 100644
--- a/arch/arm/mach-ep93xx/Makefile
+++ b/arch/arm/mach-ep93xx/Makefile
@@ -6,5 +6,7 @@ obj-m :=
6obj-n := 6obj-n :=
7obj- := 7obj- :=
8 8
9obj-$(CONFIG_MACH_EDB9302) += edb9302.o
10obj-$(CONFIG_MACH_EDB9315) += edb9315.o
9obj-$(CONFIG_MACH_GESBC9312) += gesbc9312.o 11obj-$(CONFIG_MACH_GESBC9312) += gesbc9312.o
10obj-$(CONFIG_MACH_TS72XX) += ts72xx.o 12obj-$(CONFIG_MACH_TS72XX) += ts72xx.o
diff --git a/arch/arm/mach-ep93xx/edb9302.c b/arch/arm/mach-ep93xx/edb9302.c
new file mode 100644
index 000000000000..62a8efd23256
--- /dev/null
+++ b/arch/arm/mach-ep93xx/edb9302.c
@@ -0,0 +1,62 @@
1/*
2 * arch/arm/mach-ep93xx/edb9302.c
3 * Cirrus Logic EDB9302 support.
4 *
5 * Copyright (C) 2006 George Kashperko <george@chas.com.ua>
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
27static struct physmap_flash_data edb9302_flash_data = {
28 .width = 2,
29};
30
31static struct resource edb9302_flash_resource = {
32 .start = 0x60000000,
33 .end = 0x60ffffff,
34 .flags = IORESOURCE_MEM,
35};
36
37static struct platform_device edb9302_flash = {
38 .name = "physmap-flash",
39 .id = 0,
40 .dev = {
41 .platform_data = &edb9302_flash_data,
42 },
43 .num_resources = 1,
44 .resource = &edb9302_flash_resource,
45};
46
47static void __init edb9302_init_machine(void)
48{
49 ep93xx_init_devices();
50 platform_device_register(&edb9302_flash);
51}
52
53MACHINE_START(EDB9302, "Cirrus Logic EDB9302 Evaluation Board")
54 /* Maintainer: George Kashperko <george@chas.com.ua> */
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 = edb9302_init_machine,
62MACHINE_END
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
27static struct physmap_flash_data edb9315_flash_data = {
28 .width = 4,
29};
30
31static struct resource edb9315_flash_resource = {
32 .start = 0x60000000,
33 .end = 0x61ffffff,
34 .flags = IORESOURCE_MEM,
35};
36
37static 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
47static void __init edb9315_init_machine(void)
48{
49 ep93xx_init_devices();
50 platform_device_register(&edb9315_flash);
51}
52
53MACHINE_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,
62MACHINE_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
31static struct resource gesbc9312_flash_resource = { 31static 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
119static struct resource ts72xx_flash_resource = { 119static 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
60static struct resource espresso_flash_resource = { 60static 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
305static struct resource ixdp2351_flash_resource = { 305static 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
144static struct resource roadrunner_flash_resource = { 144static 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-pxa/lpd270.c b/arch/arm/mach-pxa/lpd270.c
index ec0f43a102c7..1a5f5c21481e 100644
--- a/arch/arm/mach-pxa/lpd270.c
+++ b/arch/arm/mach-pxa/lpd270.c
@@ -248,58 +248,137 @@ static void lpd270_backlight_power(int on)
248 248
249/* 5.7" TFT QVGA (LoLo display number 1) */ 249/* 5.7" TFT QVGA (LoLo display number 1) */
250static struct pxafb_mach_info sharp_lq057q3dc02 __initdata = { 250static struct pxafb_mach_info sharp_lq057q3dc02 __initdata = {
251 .pixclock = 100000, 251 .pixclock = 150000,
252 .xres = 240, 252 .xres = 320,
253 .yres = 320, 253 .yres = 240,
254 .bpp = 16, 254 .bpp = 16,
255 .hsync_len = 64, 255 .hsync_len = 0x14,
256 .left_margin = 0x27, 256 .left_margin = 0x28,
257 .right_margin = 0x09, 257 .right_margin = 0x0a,
258 .vsync_len = 0x04, 258 .vsync_len = 0x02,
259 .upper_margin = 0x08, 259 .upper_margin = 0x08,
260 .lower_margin = 0x14, 260 .lower_margin = 0x14,
261 .sync = 0, 261 .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
262 .lccr0 = 0x07800080, 262 .lccr0 = 0x07800080,
263 .lccr3 = 0x04400007, 263 .lccr3 = 0x00400000,
264 .pxafb_backlight_power = lpd270_backlight_power,
265};
266
267/* 12.1" TFT SVGA (LoLo display number 2) */
268static struct pxafb_mach_info sharp_lq121s1dg31 __initdata = {
269 .pixclock = 50000,
270 .xres = 800,
271 .yres = 600,
272 .bpp = 16,
273 .hsync_len = 0x05,
274 .left_margin = 0x52,
275 .right_margin = 0x05,
276 .vsync_len = 0x04,
277 .upper_margin = 0x14,
278 .lower_margin = 0x0a,
279 .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
280 .lccr0 = 0x07800080,
281 .lccr3 = 0x00400000,
282 .pxafb_backlight_power = lpd270_backlight_power,
283};
284
285/* 3.6" TFT QVGA (LoLo display number 3) */
286static struct pxafb_mach_info sharp_lq036q1da01 __initdata = {
287 .pixclock = 150000,
288 .xres = 320,
289 .yres = 240,
290 .bpp = 16,
291 .hsync_len = 0x0e,
292 .left_margin = 0x04,
293 .right_margin = 0x0a,
294 .vsync_len = 0x03,
295 .upper_margin = 0x03,
296 .lower_margin = 0x03,
297 .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
298 .lccr0 = 0x07800080,
299 .lccr3 = 0x00400000,
264 .pxafb_backlight_power = lpd270_backlight_power, 300 .pxafb_backlight_power = lpd270_backlight_power,
265}; 301};
266 302
267/* 6.4" TFT VGA (LoLo display number 5) */ 303/* 6.4" TFT VGA (LoLo display number 5) */
268static struct pxafb_mach_info sharp_lq64d343 __initdata = { 304static struct pxafb_mach_info sharp_lq64d343 __initdata = {
269 .pixclock = 20000, 305 .pixclock = 25000,
270 .xres = 640, 306 .xres = 640,
271 .yres = 480, 307 .yres = 480,
272 .bpp = 16, 308 .bpp = 16,
273 .hsync_len = 49, 309 .hsync_len = 0x31,
274 .left_margin = 0x89, 310 .left_margin = 0x89,
275 .right_margin = 0x19, 311 .right_margin = 0x19,
276 .vsync_len = 18, 312 .vsync_len = 0x12,
277 .upper_margin = 0x22, 313 .upper_margin = 0x22,
278 .lower_margin = 0, 314 .lower_margin = 0x00,
279 .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, 315 .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
280 .lccr0 = 0x07800080, 316 .lccr0 = 0x07800080,
281 .lccr3 = 0x04400001, 317 .lccr3 = 0x00400000,
318 .pxafb_backlight_power = lpd270_backlight_power,
319};
320
321/* 10.4" TFT VGA (LoLo display number 7) */
322static struct pxafb_mach_info sharp_lq10d368 __initdata = {
323 .pixclock = 25000,
324 .xres = 640,
325 .yres = 480,
326 .bpp = 16,
327 .hsync_len = 0x31,
328 .left_margin = 0x89,
329 .right_margin = 0x19,
330 .vsync_len = 0x12,
331 .upper_margin = 0x22,
332 .lower_margin = 0x00,
333 .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
334 .lccr0 = 0x07800080,
335 .lccr3 = 0x00400000,
282 .pxafb_backlight_power = lpd270_backlight_power, 336 .pxafb_backlight_power = lpd270_backlight_power,
283}; 337};
284 338
285/* 3.5" TFT QVGA (LoLo display number 8) */ 339/* 3.5" TFT QVGA (LoLo display number 8) */
286static struct pxafb_mach_info sharp_lq035q7db02_20 __initdata = { 340static struct pxafb_mach_info sharp_lq035q7db02_20 __initdata = {
287 .pixclock = 100000, 341 .pixclock = 150000,
288 .xres = 240, 342 .xres = 240,
289 .yres = 320, 343 .yres = 320,
290 .bpp = 16, 344 .bpp = 16,
291 .hsync_len = 0x34, 345 .hsync_len = 0x0e,
292 .left_margin = 0x09, 346 .left_margin = 0x0a,
293 .right_margin = 0x09, 347 .right_margin = 0x0a,
294 .vsync_len = 0x08, 348 .vsync_len = 0x03,
295 .upper_margin = 0x05, 349 .upper_margin = 0x05,
296 .lower_margin = 0x14, 350 .lower_margin = 0x14,
297 .sync = 0, 351 .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
298 .lccr0 = 0x07800080, 352 .lccr0 = 0x07800080,
299 .lccr3 = 0x04400007, 353 .lccr3 = 0x00400000,
300 .pxafb_backlight_power = lpd270_backlight_power, 354 .pxafb_backlight_power = lpd270_backlight_power,
301}; 355};
302 356
357static struct pxafb_mach_info *lpd270_lcd_to_use;
358
359static int __init lpd270_set_lcd(char *str)
360{
361 if (!strnicmp(str, "lq057q3dc02", 11)) {
362 lpd270_lcd_to_use = &sharp_lq057q3dc02;
363 } else if (!strnicmp(str, "lq121s1dg31", 11)) {
364 lpd270_lcd_to_use = &sharp_lq121s1dg31;
365 } else if (!strnicmp(str, "lq036q1da01", 11)) {
366 lpd270_lcd_to_use = &sharp_lq036q1da01;
367 } else if (!strnicmp(str, "lq64d343", 8)) {
368 lpd270_lcd_to_use = &sharp_lq64d343;
369 } else if (!strnicmp(str, "lq10d368", 8)) {
370 lpd270_lcd_to_use = &sharp_lq10d368;
371 } else if (!strnicmp(str, "lq035q7db02-20", 14)) {
372 lpd270_lcd_to_use = &sharp_lq035q7db02_20;
373 } else {
374 printk(KERN_INFO "lpd270: unknown lcd panel [%s]\n", str);
375 }
376
377 return 1;
378}
379
380__setup("lcd=", lpd270_set_lcd);
381
303static struct platform_device *platform_devices[] __initdata = { 382static struct platform_device *platform_devices[] __initdata = {
304 &smc91x_device, 383 &smc91x_device,
305 &lpd270_audio_device, 384 &lpd270_audio_device,
@@ -345,9 +424,8 @@ static void __init lpd270_init(void)
345 424
346 platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices)); 425 platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices));
347 426
348 // set_pxa_fb_info(&sharp_lq057q3dc02); 427 if (lpd270_lcd_to_use != NULL)
349 set_pxa_fb_info(&sharp_lq64d343); 428 set_pxa_fb_info(lpd270_lcd_to_use);
350 // set_pxa_fb_info(&sharp_lq035q7db02_20);
351 429
352 pxa_set_ohci_info(&lpd270_ohci_platform_data); 430 pxa_set_ohci_info(&lpd270_ohci_platform_data);
353} 431}
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
74void __init s3c244x_init_clocks(int xtal) 75void __init s3c244x_init_clocks(int xtal)
diff --git a/arch/arm/mm/Kconfig b/arch/arm/mm/Kconfig
index ecf5e232a6fc..5f80f184cd32 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
@@ -121,13 +121,13 @@ config CPU_ARM925T
121# ARM926T 121# ARM926T
122config CPU_ARM926T 122config CPU_ARM926T
123 bool "Support ARM926T processor" 123 bool "Support ARM926T processor"
124 depends on ARCH_INTEGRATOR || ARCH_VERSATILE_PB || MACH_VERSATILE_AB || ARCH_OMAP730 || ARCH_OMAP16XX || MACH_REALVIEW_EB || ARCH_PNX4008 || ARCH_NETX || CPU_S3C2412 124 depends on ARCH_INTEGRATOR || ARCH_VERSATILE_PB || MACH_VERSATILE_AB || ARCH_OMAP730 || ARCH_OMAP16XX || MACH_REALVIEW_EB || ARCH_PNX4008 || ARCH_NETX || CPU_S3C2412 || ARCH_AT91SAM9260 || ARCH_AT91SAM9261
125 default y if ARCH_VERSATILE_PB || MACH_VERSATILE_AB || ARCH_OMAP730 || ARCH_OMAP16XX || ARCH_PNX4008 || ARCH_NETX || CPU_S3C2412 125 default y if ARCH_VERSATILE_PB || MACH_VERSATILE_AB || ARCH_OMAP730 || ARCH_OMAP16XX || ARCH_PNX4008 || ARCH_NETX || CPU_S3C2412 || ARCH_AT91SAM9260 || ARCH_AT91SAM9261
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
233config CPU_XSCALE 233config 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
243config CPU_XSC3 243config 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
265config CPU_32v6K 265config 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.
278config CPU_32v3 278config 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
283config CPU_32v4 283config 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
288config CPU_32v5 288config 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
293config CPU_32v6 293config CPU_32v6
@@ -334,6 +334,7 @@ config CPU_CACHE_VIVT
334config CPU_CACHE_VIPT 334config CPU_CACHE_VIPT
335 bool 335 bool
336 336
337if MMU
337# The copy-page model 338# The copy-page model
338config CPU_COPY_V3 339config CPU_COPY_V3
339 bool 340 bool
@@ -372,6 +373,8 @@ config CPU_TLB_V4WBI
372config CPU_TLB_V6 373config CPU_TLB_V6
373 bool 374 bool
374 375
376endif
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
5obj-y := consistent.o extable.o fault-armv.o \ 5obj-y := consistent.o extable.o fault.o init.o \
6 fault.o flush.o init.o ioremap.o mmap.o \ 6 iomap.o
7
8obj-$(CONFIG_MMU) += fault-armv.o flush.o ioremap.o mmap.o \
7 mm-armv.o 9 mm-armv.o
8 10
11ifneq ($(CONFIG_MMU),y)
12obj-y += nommu.o
13endif
14
9obj-$(CONFIG_MODULES) += proc-syms.o 15obj-$(CONFIG_MODULES) += proc-syms.o
10 16
11obj-$(CONFIG_ALIGNMENT_TRAP) += alignment.o 17obj-$(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
31DEFINE_PER_CPU(struct mmu_gather, mmu_gathers); 29DEFINE_PER_CPU(struct mmu_gather, mmu_gathers);
32 30
33extern pgd_t swapper_pg_dir[PTRS_PER_PGD]; 31extern 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
14void __iomem *ioport_map(unsigned long port, unsigned int nr)
15{
16 return __io(port);
17}
18EXPORT_SYMBOL(ioport_map);
19
20void ioport_unmap(void __iomem *addr)
21{
22}
23EXPORT_SYMBOL(ioport_unmap);
24#endif
25
26#ifdef CONFIG_PCI
27void __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}
46EXPORT_SYMBOL(pci_iomap);
47
48void 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}
54EXPORT_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}
178EXPORT_SYMBOL(__iounmap); 178EXPORT_SYMBOL(__iounmap);
179
180#ifdef __io
181void __iomem *ioport_map(unsigned long port, unsigned int nr)
182{
183 return __io(port);
184}
185EXPORT_SYMBOL(ioport_map);
186
187void ioport_unmap(void __iomem *addr)
188{
189}
190EXPORT_SYMBOL(ioport_unmap);
191#endif
192
193#ifdef CONFIG_PCI
194#include <linux/pci.h>
195#include <linux/ioport.h>
196
197void __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}
216EXPORT_SYMBOL(pci_iomap);
217
218void 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}
224EXPORT_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
14void flush_dcache_page(struct page *page)
15{
16 __cpuc_flush_dcache_page(page_address(page));
17}
18EXPORT_SYMBOL(flush_dcache_page);
19
20void __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}
27EXPORT_SYMBOL(__ioremap_pfn);
28
29void __iomem *__ioremap(unsigned long phys_addr, size_t size,
30 unsigned long flags)
31{
32 return (void __iomem *)phys_addr;
33}
34EXPORT_SYMBOL(__ioremap);
35
36void __iounmap(void __iomem *addr)
37{
38}
39EXPORT_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
361ENTRY(cpu_arm1020_switch_mm) 364ENTRY(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
394ENTRY(cpu_arm1020_set_pte) 399ENTRY(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..8c7e25f4b7e7 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
346ENTRY(cpu_arm1020e_switch_mm) 349ENTRY(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
378ENTRY(cpu_arm1020e_set_pte) 383ENTRY(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
@@ -468,25 +477,7 @@ cpu_elf_name:
468 477
469 .type cpu_arm1020e_name, #object 478 .type cpu_arm1020e_name, #object
470cpu_arm1020e_name: 479cpu_arm1020e_name:
471 .ascii "ARM1020E" 480 .asciz "ARM1020E"
472#ifndef CONFIG_CPU_ICACHE_DISABLE
473 .ascii "i"
474#endif
475#ifndef CONFIG_CPU_DCACHE_DISABLE
476 .ascii "d"
477#ifdef CONFIG_CPU_DCACHE_WRITETHROUGH
478 .ascii "(wt)"
479#else
480 .ascii "(wb)"
481#endif
482#endif
483#ifndef CONFIG_CPU_BPREDICT_DISABLE
484 .ascii "B"
485#endif
486#ifdef CONFIG_CPU_CACHE_ROUND_ROBIN
487 .ascii "RR"
488#endif
489 .ascii "\0"
490 .size cpu_arm1020e_name, . - cpu_arm1020e_name 481 .size cpu_arm1020e_name, . - cpu_arm1020e_name
491 482
492 .align 483 .align
diff --git a/arch/arm/mm/proc-arm1022.S b/arch/arm/mm/proc-arm1022.S
index f778545d57a2..92218e6b3906 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
335ENTRY(cpu_arm1022_switch_mm) 338ENTRY(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
3381: orr r3, r1, #(CACHE_DENTRIES - 1) << 26 @ 64 entries 3421: 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
360ENTRY(cpu_arm1022_set_pte) 365ENTRY(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
@@ -451,25 +460,7 @@ cpu_elf_name:
451 460
452 .type cpu_arm1022_name, #object 461 .type cpu_arm1022_name, #object
453cpu_arm1022_name: 462cpu_arm1022_name:
454 .ascii "arm1022" 463 .asciz "ARM1022"
455#ifndef CONFIG_CPU_ICACHE_DISABLE
456 .ascii "i"
457#endif
458#ifndef CONFIG_CPU_DCACHE_DISABLE
459 .ascii "d"
460#ifdef CONFIG_CPU_DCACHE_WRITETHROUGH
461 .ascii "(wt)"
462#else
463 .ascii "(wb)"
464#endif
465#endif
466#ifndef CONFIG_CPU_BPREDICT_DISABLE
467 .ascii "B"
468#endif
469#ifdef CONFIG_CPU_CACHE_ROUND_ROBIN
470 .ascii "RR"
471#endif
472 .ascii "\0"
473 .size cpu_arm1022_name, . - cpu_arm1022_name 464 .size cpu_arm1022_name, . - cpu_arm1022_name
474 465
475 .align 466 .align
diff --git a/arch/arm/mm/proc-arm1026.S b/arch/arm/mm/proc-arm1026.S
index 148c111fde73..2796c8e0ddf3 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
329ENTRY(cpu_arm1026_switch_mm) 332ENTRY(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
3321: mrc p15, 0, r15, c7, c14, 3 @ test, clean, invalidate 3361: 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
349ENTRY(cpu_arm1026_set_pte) 354ENTRY(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
@@ -447,25 +456,7 @@ cpu_elf_name:
447 456
448 .type cpu_arm1026_name, #object 457 .type cpu_arm1026_name, #object
449cpu_arm1026_name: 458cpu_arm1026_name:
450 .ascii "ARM1026EJ-S" 459 .asciz "ARM1026EJ-S"
451#ifndef CONFIG_CPU_ICACHE_DISABLE
452 .ascii "i"
453#endif
454#ifndef CONFIG_CPU_DCACHE_DISABLE
455 .ascii "d"
456#ifdef CONFIG_CPU_DCACHE_WRITETHROUGH
457 .ascii "(wt)"
458#else
459 .ascii "(wb)"
460#endif
461#endif
462#ifndef CONFIG_CPU_BPREDICT_DISABLE
463 .ascii "B"
464#endif
465#ifdef CONFIG_CPU_CACHE_ROUND_ROBIN
466 .ascii "RR"
467#endif
468 .ascii "\0"
469 .size cpu_arm1026_name, . - cpu_arm1026_name 460 .size cpu_arm1026_name, . - cpu_arm1026_name
470 461
471 .align 462 .align
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 */
200ENTRY(cpu_arm6_switch_mm) 201ENTRY(cpu_arm6_switch_mm)
201ENTRY(cpu_arm7_switch_mm) 202ENTRY(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
215ENTRY(cpu_arm6_set_pte) 218ENTRY(cpu_arm6_set_pte)
216ENTRY(cpu_arm7_set_pte) 219ENTRY(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)
243ENTRY(cpu_arm7_reset) 248ENTRY(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 */
77ENTRY(cpu_arm720_switch_mm) 79ENTRY(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
91ENTRY(cpu_arm720_set_pte) 95ENTRY(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)
117ENTRY(cpu_arm720_reset) 123ENTRY(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..02af3e2a8247 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
319ENTRY(cpu_arm920_switch_mm) 322ENTRY(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
348ENTRY(cpu_arm920_set_pte) 353ENTRY(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
@@ -435,19 +444,7 @@ cpu_elf_name:
435 444
436 .type cpu_arm920_name, #object 445 .type cpu_arm920_name, #object
437cpu_arm920_name: 446cpu_arm920_name:
438 .ascii "ARM920T" 447 .asciz "ARM920T"
439#ifndef CONFIG_CPU_ICACHE_DISABLE
440 .ascii "i"
441#endif
442#ifndef CONFIG_CPU_DCACHE_DISABLE
443 .ascii "d"
444#ifdef CONFIG_CPU_DCACHE_WRITETHROUGH
445 .ascii "(wt)"
446#else
447 .ascii "(wb)"
448#endif
449#endif
450 .ascii "\0"
451 .size cpu_arm920_name, . - cpu_arm920_name 448 .size cpu_arm920_name, . - cpu_arm920_name
452 449
453 .align 450 .align
diff --git a/arch/arm/mm/proc-arm922.S b/arch/arm/mm/proc-arm922.S
index bbde4a024a48..33dae4929f09 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
323ENTRY(cpu_arm922_switch_mm) 326ENTRY(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
352ENTRY(cpu_arm922_set_pte) 357ENTRY(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
@@ -439,19 +448,7 @@ cpu_elf_name:
439 448
440 .type cpu_arm922_name, #object 449 .type cpu_arm922_name, #object
441cpu_arm922_name: 450cpu_arm922_name:
442 .ascii "ARM922T" 451 .asciz "ARM922T"
443#ifndef CONFIG_CPU_ICACHE_DISABLE
444 .ascii "i"
445#endif
446#ifndef CONFIG_CPU_DCACHE_DISABLE
447 .ascii "d"
448#ifdef CONFIG_CPU_DCACHE_WRITETHROUGH
449 .ascii "(wt)"
450#else
451 .ascii "(wb)"
452#endif
453#endif
454 .ascii "\0"
455 .size cpu_arm922_name, . - cpu_arm922_name 452 .size cpu_arm922_name, . - cpu_arm922_name
456 453
457 .align 454 .align
diff --git a/arch/arm/mm/proc-arm925.S b/arch/arm/mm/proc-arm925.S
index 224ce226a01b..aaa9f985b246 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
371ENTRY(cpu_arm925_switch_mm) 375ENTRY(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
394ENTRY(cpu_arm925_set_pte) 400ENTRY(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
@@ -501,22 +511,7 @@ cpu_elf_name:
501 511
502 .type cpu_arm925_name, #object 512 .type cpu_arm925_name, #object
503cpu_arm925_name: 513cpu_arm925_name:
504 .ascii "ARM925T" 514 .asciz "ARM925T"
505#ifndef CONFIG_CPU_ICACHE_DISABLE
506 .ascii "i"
507#endif
508#ifndef CONFIG_CPU_DCACHE_DISABLE
509 .ascii "d"
510#ifdef CONFIG_CPU_DCACHE_WRITETHROUGH
511 .ascii "(wt)"
512#else
513 .ascii "(wb)"
514#endif
515#ifdef CONFIG_CPU_CACHE_ROUND_ROBIN
516 .ascii "RR"
517#endif
518#endif
519 .ascii "\0"
520 .size cpu_arm925_name, . - cpu_arm925_name 515 .size cpu_arm925_name, . - cpu_arm925_name
521 516
522 .align 517 .align
diff --git a/arch/arm/mm/proc-arm926.S b/arch/arm/mm/proc-arm926.S
index 4e2a087cf388..ce246dd7b407 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
331ENTRY(cpu_arm926_switch_mm) 334ENTRY(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
352ENTRY(cpu_arm926_set_pte) 357ENTRY(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
@@ -451,22 +460,7 @@ cpu_elf_name:
451 460
452 .type cpu_arm926_name, #object 461 .type cpu_arm926_name, #object
453cpu_arm926_name: 462cpu_arm926_name:
454 .ascii "ARM926EJ-S" 463 .asciz "ARM926EJ-S"
455#ifndef CONFIG_CPU_ICACHE_DISABLE
456 .ascii "i"
457#endif
458#ifndef CONFIG_CPU_DCACHE_DISABLE
459 .ascii "d"
460#ifdef CONFIG_CPU_DCACHE_WRITETHROUGH
461 .ascii "(wt)"
462#else
463 .ascii "(wb)"
464#endif
465#ifdef CONFIG_CPU_CACHE_ROUND_ROBIN
466 .ascii "RR"
467#endif
468#endif
469 .ascii "\0"
470 .size cpu_arm926_name, . - cpu_arm926_name 464 .size cpu_arm926_name, . - cpu_arm926_name
471 465
472 .align 466 .align
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
132ENTRY(cpu_sa110_switch_mm) 135ENTRY(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
145ENTRY(cpu_sa110_set_pte) 152ENTRY(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
144ENTRY(cpu_sa1100_switch_mm) 147ENTRY(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
158ENTRY(cpu_sa1100_set_pte) 165ENTRY(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 */
90ENTRY(cpu_v6_switch_mm) 91ENTRY(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 */
121ENTRY(cpu_v6_set_pte) 124ENTRY(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)