aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/Kconfig21
-rw-r--r--arch/arm/Makefile5
-rw-r--r--arch/arm/boot/compressed/head-at91rm9200.S6
-rw-r--r--arch/arm/boot/compressed/misc.c2
-rw-r--r--arch/arm/common/sharpsl_pm.c2
-rw-r--r--arch/arm/configs/ixp4xx_defconfig2
-rw-r--r--arch/arm/configs/picotux200_defconfig1386
-rw-r--r--arch/arm/kernel/Makefile4
-rw-r--r--arch/arm/kernel/ecard.c31
-rw-r--r--arch/arm/kernel/ecard.h56
-rw-r--r--arch/arm/kernel/head-nommu.S2
-rw-r--r--arch/arm/kernel/head.S8
-rw-r--r--arch/arm/kernel/init_task.c2
-rw-r--r--arch/arm/kernel/module.c4
-rw-r--r--arch/arm/kernel/process.c3
-rw-r--r--arch/arm/kernel/ptrace.c6
-rw-r--r--arch/arm/kernel/smp.c4
-rw-r--r--arch/arm/kernel/stacktrace.c73
-rw-r--r--arch/arm/kernel/stacktrace.h9
-rw-r--r--arch/arm/kernel/time.c4
-rw-r--r--arch/arm/kernel/traps.c5
-rw-r--r--arch/arm/kernel/vmlinux.lds.S14
-rw-r--r--arch/arm/mach-at91/Kconfig7
-rw-r--r--arch/arm/mach-at91/Makefile1
-rw-r--r--arch/arm/mach-at91/at91rm9200.c19
-rw-r--r--arch/arm/mach-at91/at91sam9260.c7
-rw-r--r--arch/arm/mach-at91/at91sam9261.c19
-rw-r--r--arch/arm/mach-at91/at91sam9261_devices.c10
-rw-r--r--arch/arm/mach-at91/at91sam9263.c48
-rw-r--r--arch/arm/mach-at91/at91sam9263_devices.c124
-rw-r--r--arch/arm/mach-at91/board-picotux200.c166
-rw-r--r--arch/arm/mach-at91/board-sam9260ek.c10
-rw-r--r--arch/arm/mach-at91/board-sam9261ek.c52
-rw-r--r--arch/arm/mach-at91/board-sam9263ek.c70
-rw-r--r--arch/arm/mach-at91/pm.c1
-rw-r--r--arch/arm/mach-ep93xx/clock.c5
-rw-r--r--arch/arm/mach-iop13xx/Makefile1
-rw-r--r--arch/arm/mach-iop13xx/io.c10
-rw-r--r--arch/arm/mach-iop13xx/iq81340mc.c5
-rw-r--r--arch/arm/mach-iop13xx/iq81340sc.c5
-rw-r--r--arch/arm/mach-iop13xx/pci.c16
-rw-r--r--arch/arm/mach-iop13xx/setup.c6
-rw-r--r--arch/arm/mach-iop13xx/tpmi.c234
-rw-r--r--arch/arm/mach-iop32x/Kconfig8
-rw-r--r--arch/arm/mach-iop32x/iq31244.c11
-rw-r--r--arch/arm/mach-iop32x/iq80321.c3
-rw-r--r--arch/arm/mach-iop33x/Kconfig8
-rw-r--r--arch/arm/mach-iop33x/iq80331.c3
-rw-r--r--arch/arm/mach-iop33x/iq80332.c3
-rw-r--r--arch/arm/mach-ixp2000/core.c22
-rw-r--r--arch/arm/mach-ixp2000/enp2611.c6
-rw-r--r--arch/arm/mach-ixp4xx/Kconfig22
-rw-r--r--arch/arm/mach-ixp4xx/Makefile2
-rw-r--r--arch/arm/mach-ixp4xx/common-pci.c4
-rw-r--r--arch/arm/mach-ixp4xx/common.c122
-rw-r--r--arch/arm/mach-ixp4xx/dsmg600-pci.c74
-rw-r--r--arch/arm/mach-ixp4xx/dsmg600-power.c125
-rw-r--r--arch/arm/mach-ixp4xx/dsmg600-setup.c175
-rw-r--r--arch/arm/mach-ixp4xx/ixdp425-pci.c2
-rw-r--r--arch/arm/mach-ixp4xx/ixdp425-setup.c18
-rw-r--r--arch/arm/mach-ns9xxx/Kconfig15
-rw-r--r--arch/arm/mach-ns9xxx/Makefile1
-rw-r--r--arch/arm/mach-ns9xxx/board-jscc9p9360.c17
-rw-r--r--arch/arm/mach-ns9xxx/board-jscc9p9360.h13
-rw-r--r--arch/arm/mach-ns9xxx/mach-cc9p9360js.c29
-rw-r--r--arch/arm/mach-omap1/pm.c8
-rw-r--r--arch/arm/mach-omap1/time.c206
-rw-r--r--arch/arm/mach-omap2/pm.c2
-rw-r--r--arch/arm/mach-pnx4008/pm.c39
-rw-r--r--arch/arm/mach-pxa/generic.c4
-rw-r--r--arch/arm/mach-pxa/irq.c72
-rw-r--r--arch/arm/mach-pxa/lpd270.c4
-rw-r--r--arch/arm/mach-pxa/lubbock.c2
-rw-r--r--arch/arm/mach-pxa/mainstone.c4
-rw-r--r--arch/arm/mach-pxa/pm.c5
-rw-r--r--arch/arm/mach-pxa/pxa27x.c4
-rw-r--r--arch/arm/mach-pxa/ssp.c12
-rw-r--r--arch/arm/mach-rpc/riscpc.c35
-rw-r--r--arch/arm/mach-s3c2410/mach-amlm5900.c7
-rw-r--r--arch/arm/mach-s3c2410/mach-bast.c12
-rw-r--r--arch/arm/mach-s3c2410/mach-h1940.c9
-rw-r--r--arch/arm/mach-s3c2410/mach-n30.c8
-rw-r--r--arch/arm/mach-s3c2410/mach-otom.c12
-rw-r--r--arch/arm/mach-s3c2410/mach-qt2410.c8
-rw-r--r--arch/arm/mach-s3c2410/mach-smdk2410.c14
-rw-r--r--arch/arm/mach-s3c2410/mach-vr1000.c16
-rw-r--r--arch/arm/mach-s3c2412/Kconfig9
-rw-r--r--arch/arm/mach-s3c2412/mach-smdk2413.c7
-rw-r--r--arch/arm/mach-s3c2412/mach-vstms.c12
-rw-r--r--arch/arm/mach-s3c2440/mach-anubis.c17
-rw-r--r--arch/arm/mach-s3c2440/mach-nexcoder.c13
-rw-r--r--arch/arm/mach-s3c2440/mach-osiris.c16
-rw-r--r--arch/arm/mach-s3c2440/mach-rx3715.c8
-rw-r--r--arch/arm/mach-s3c2440/mach-smdk2440.c7
-rw-r--r--arch/arm/mach-s3c2443/mach-smdk2443.c7
-rw-r--r--arch/arm/mach-sa1100/clock.c24
-rw-r--r--arch/arm/mach-sa1100/pm.c8
-rw-r--r--arch/arm/mach-versatile/core.c129
-rw-r--r--arch/arm/mm/Kconfig32
-rw-r--r--arch/arm/mm/Makefile3
-rw-r--r--arch/arm/mm/abort-ev7.S32
-rw-r--r--arch/arm/mm/cache-v7.S253
-rw-r--r--arch/arm/mm/context.c17
-rw-r--r--arch/arm/mm/ioremap.c80
-rw-r--r--arch/arm/mm/mm.h10
-rw-r--r--arch/arm/mm/mmap.c3
-rw-r--r--arch/arm/mm/mmu.c349
-rw-r--r--arch/arm/mm/nommu.c12
-rw-r--r--arch/arm/mm/proc-macros.S12
-rw-r--r--arch/arm/mm/proc-v7.S262
-rw-r--r--arch/arm/mm/proc-xscale.S28
-rw-r--r--arch/arm/oprofile/backtrace.c69
-rw-r--r--arch/arm/plat-iop/io.c4
-rw-r--r--arch/arm/plat-iop/pci.c140
-rw-r--r--arch/arm/plat-iop/time.c8
-rw-r--r--arch/arm/plat-omap/Kconfig1
-rw-r--r--arch/arm/plat-omap/common.c50
-rw-r--r--arch/arm/plat-omap/timer32k.c139
-rw-r--r--arch/arm/plat-s3c24xx/clock.c12
-rw-r--r--arch/arm/plat-s3c24xx/cpu.c38
-rw-r--r--arch/arm/plat-s3c24xx/dma.c13
-rw-r--r--arch/arm/plat-s3c24xx/pm.c28
-rw-r--r--arch/arm/vfp/vfpdouble.c1
-rw-r--r--arch/arm/vfp/vfpsingle.c1
124 files changed, 4581 insertions, 904 deletions
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 346f62aedbd4..d7c0984d4a86 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -29,6 +29,10 @@ config GENERIC_TIME
29 bool 29 bool
30 default n 30 default n
31 31
32config GENERIC_CLOCKEVENTS
33 bool
34 default n
35
32config MMU 36config MMU
33 bool 37 bool
34 default y 38 default y
@@ -67,6 +71,14 @@ config GENERIC_HARDIRQS
67 bool 71 bool
68 default y 72 default y
69 73
74config STACKTRACE_SUPPORT
75 bool
76 default y
77
78config LOCKDEP_SUPPORT
79 bool
80 default y
81
70config TRACE_IRQFLAGS_SUPPORT 82config TRACE_IRQFLAGS_SUPPORT
71 bool 83 bool
72 default y 84 default y
@@ -162,6 +174,8 @@ config ARCH_VERSATILE
162 select ARM_AMBA 174 select ARM_AMBA
163 select ARM_VIC 175 select ARM_VIC
164 select ICST307 176 select ICST307
177 select GENERIC_TIME
178 select GENERIC_CLOCKEVENTS
165 help 179 help
166 This enables support for ARM Ltd Versatile board. 180 This enables support for ARM Ltd Versatile board.
167 181
@@ -255,6 +269,7 @@ config ARCH_IOP13XX
255 depends on MMU 269 depends on MMU
256 select PLAT_IOP 270 select PLAT_IOP
257 select PCI 271 select PCI
272 select ARCH_SUPPORTS_MSI
258 help 273 help
259 Support for Intel's IOP13XX (XScale) family of processors. 274 Support for Intel's IOP13XX (XScale) family of processors.
260 275
@@ -262,6 +277,7 @@ config ARCH_IXP4XX
262 bool "IXP4xx-based" 277 bool "IXP4xx-based"
263 depends on MMU 278 depends on MMU
264 select GENERIC_TIME 279 select GENERIC_TIME
280 select GENERIC_CLOCKEVENTS
265 help 281 help
266 Support for Intel's IXP4XX (XScale) family of processors. 282 Support for Intel's IXP4XX (XScale) family of processors.
267 283
@@ -364,6 +380,7 @@ config ARCH_LH7A40X
364config ARCH_OMAP 380config ARCH_OMAP
365 bool "TI OMAP" 381 bool "TI OMAP"
366 select GENERIC_GPIO 382 select GENERIC_GPIO
383 select GENERIC_TIME
367 help 384 help
368 Support for TI's OMAP platform (OMAP1 and OMAP2). 385 Support for TI's OMAP platform (OMAP1 and OMAP2).
369 386
@@ -514,6 +531,8 @@ endmenu
514 531
515menu "Kernel Features" 532menu "Kernel Features"
516 533
534source "kernel/time/Kconfig"
535
517config SMP 536config SMP
518 bool "Symmetric Multi-Processing (EXPERIMENTAL)" 537 bool "Symmetric Multi-Processing (EXPERIMENTAL)"
519 depends on EXPERIMENTAL && REALVIEW_MPCORE 538 depends on EXPERIMENTAL && REALVIEW_MPCORE
@@ -573,6 +592,7 @@ config PREEMPT
573 592
574config NO_IDLE_HZ 593config NO_IDLE_HZ
575 bool "Dynamic tick timer" 594 bool "Dynamic tick timer"
595 depends on !GENERIC_CLOCKEVENTS
576 help 596 help
577 Select this option if you want to disable continuous timer ticks 597 Select this option if you want to disable continuous timer ticks
578 and have them programmed to occur as required. This option saves 598 and have them programmed to occur as required. This option saves
@@ -670,6 +690,7 @@ config LEDS_TIMER
670 bool "Timer LED" if (!ARCH_CDB89712 && !ARCH_OMAP) || \ 690 bool "Timer LED" if (!ARCH_CDB89712 && !ARCH_OMAP) || \
671 MACH_OMAP_H2 || MACH_OMAP_PERSEUS2 691 MACH_OMAP_H2 || MACH_OMAP_PERSEUS2
672 depends on LEDS 692 depends on LEDS
693 depends on !GENERIC_CLOCKEVENTS
673 default y if ARCH_EBSA110 694 default y if ARCH_EBSA110
674 help 695 help
675 If you say Y here, one of the system LEDs (the green one on the 696 If you say Y here, one of the system LEDs (the green one on the
diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index ab9f2d4bd04e..00ea4305ad5d 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -47,8 +47,13 @@ comma = ,
47# Note that GCC does not numerically define an architecture version 47# Note that GCC does not numerically define an architecture version
48# macro, but instead defines a whole series of macros which makes 48# macro, but instead defines a whole series of macros which makes
49# testing for a specific architecture or later rather impossible. 49# testing for a specific architecture or later rather impossible.
50arch-$(CONFIG_CPU_32v7) :=-D__LINUX_ARM_ARCH__=7 $(call cc-option,-march=armv7a,-march=armv5t -Wa$(comma)-march=armv7a)
50arch-$(CONFIG_CPU_32v6) :=-D__LINUX_ARM_ARCH__=6 $(call cc-option,-march=armv6,-march=armv5t -Wa$(comma)-march=armv6) 51arch-$(CONFIG_CPU_32v6) :=-D__LINUX_ARM_ARCH__=6 $(call cc-option,-march=armv6,-march=armv5t -Wa$(comma)-march=armv6)
52# Only override the compiler option if ARMv6. The ARMv6K extensions are
53# always available in ARMv7
54ifeq ($(CONFIG_CPU_32v6),y)
51arch-$(CONFIG_CPU_32v6K) :=-D__LINUX_ARM_ARCH__=6 $(call cc-option,-march=armv6k,-march=armv5t -Wa$(comma)-march=armv6k) 55arch-$(CONFIG_CPU_32v6K) :=-D__LINUX_ARM_ARCH__=6 $(call cc-option,-march=armv6k,-march=armv5t -Wa$(comma)-march=armv6k)
56endif
52arch-$(CONFIG_CPU_32v5) :=-D__LINUX_ARM_ARCH__=5 $(call cc-option,-march=armv5te,-march=armv4t) 57arch-$(CONFIG_CPU_32v5) :=-D__LINUX_ARM_ARCH__=5 $(call cc-option,-march=armv5te,-march=armv4t)
53arch-$(CONFIG_CPU_32v4T) :=-D__LINUX_ARM_ARCH__=4 -march=armv4t 58arch-$(CONFIG_CPU_32v4T) :=-D__LINUX_ARM_ARCH__=4 -march=armv4t
54arch-$(CONFIG_CPU_32v4) :=-D__LINUX_ARM_ARCH__=4 -march=armv4 59arch-$(CONFIG_CPU_32v4) :=-D__LINUX_ARM_ARCH__=4 -march=armv4
diff --git a/arch/arm/boot/compressed/head-at91rm9200.S b/arch/arm/boot/compressed/head-at91rm9200.S
index d68b9acd826e..11782ccd93a1 100644
--- a/arch/arm/boot/compressed/head-at91rm9200.S
+++ b/arch/arm/boot/compressed/head-at91rm9200.S
@@ -61,6 +61,12 @@
61 cmp r7, r3 61 cmp r7, r3
62 beq 99f 62 beq 99f
63 63
64 @ picotux 200 : 963
65 mov r3, #(MACH_TYPE_PICOTUX2XX & 0xff)
66 orr r3, r3, #(MACH_TYPE_PICOTUX2XX & 0xff00)
67 cmp r7, r3
68 beq 99f
69
64 @ Ajeco 1ARM : 1075 70 @ Ajeco 1ARM : 1075
65 mov r3, #(MACH_TYPE_ONEARM & 0xff) 71 mov r3, #(MACH_TYPE_ONEARM & 0xff)
66 orr r3, r3, #(MACH_TYPE_ONEARM & 0xff00) 72 orr r3, r3, #(MACH_TYPE_ONEARM & 0xff00)
diff --git a/arch/arm/boot/compressed/misc.c b/arch/arm/boot/compressed/misc.c
index 283891c736c4..9b444022cb9b 100644
--- a/arch/arm/boot/compressed/misc.c
+++ b/arch/arm/boot/compressed/misc.c
@@ -239,7 +239,7 @@ extern int end;
239static ulg free_mem_ptr; 239static ulg free_mem_ptr;
240static ulg free_mem_ptr_end; 240static ulg free_mem_ptr_end;
241 241
242#define HEAP_SIZE 0x2000 242#define HEAP_SIZE 0x3000
243 243
244#include "../../../../lib/inflate.c" 244#include "../../../../lib/inflate.c"
245 245
diff --git a/arch/arm/common/sharpsl_pm.c b/arch/arm/common/sharpsl_pm.c
index a9bc5b52218f..5972df2b9af4 100644
--- a/arch/arm/common/sharpsl_pm.c
+++ b/arch/arm/common/sharpsl_pm.c
@@ -766,10 +766,10 @@ static void sharpsl_apm_get_power_status(struct apm_power_info *info)
766} 766}
767 767
768static struct pm_ops sharpsl_pm_ops = { 768static struct pm_ops sharpsl_pm_ops = {
769 .pm_disk_mode = PM_DISK_FIRMWARE,
770 .prepare = pxa_pm_prepare, 769 .prepare = pxa_pm_prepare,
771 .enter = corgi_pxa_pm_enter, 770 .enter = corgi_pxa_pm_enter,
772 .finish = pxa_pm_finish, 771 .finish = pxa_pm_finish,
772 .valid = pm_valid_only_mem,
773}; 773};
774 774
775static int __init sharpsl_pm_probe(struct platform_device *pdev) 775static int __init sharpsl_pm_probe(struct platform_device *pdev)
diff --git a/arch/arm/configs/ixp4xx_defconfig b/arch/arm/configs/ixp4xx_defconfig
index fabf74c51a88..db850a5689eb 100644
--- a/arch/arm/configs/ixp4xx_defconfig
+++ b/arch/arm/configs/ixp4xx_defconfig
@@ -117,11 +117,13 @@ CONFIG_ARCH_ADI_COYOTE=y
117CONFIG_ARCH_IXDP425=y 117CONFIG_ARCH_IXDP425=y
118CONFIG_MACH_IXDPG425=y 118CONFIG_MACH_IXDPG425=y
119CONFIG_MACH_IXDP465=y 119CONFIG_MACH_IXDP465=y
120CONFIG_MACH_KIXRP435=y
120CONFIG_ARCH_IXCDP1100=y 121CONFIG_ARCH_IXCDP1100=y
121CONFIG_ARCH_PRPMC1100=y 122CONFIG_ARCH_PRPMC1100=y
122CONFIG_MACH_NAS100D=y 123CONFIG_MACH_NAS100D=y
123CONFIG_ARCH_IXDP4XX=y 124CONFIG_ARCH_IXDP4XX=y
124CONFIG_CPU_IXP46X=y 125CONFIG_CPU_IXP46X=y
126CONFIG_CPU_IXP43X=y
125# CONFIG_MACH_GTWX5715 is not set 127# CONFIG_MACH_GTWX5715 is not set
126 128
127# 129#
diff --git a/arch/arm/configs/picotux200_defconfig b/arch/arm/configs/picotux200_defconfig
new file mode 100644
index 000000000000..339c48953a62
--- /dev/null
+++ b/arch/arm/configs/picotux200_defconfig
@@ -0,0 +1,1386 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.21-rc4
4# Wed Mar 28 16:19:50 2007
5#
6CONFIG_ARM=y
7CONFIG_SYS_SUPPORTS_APM_EMULATION=y
8CONFIG_GENERIC_GPIO=y
9# CONFIG_GENERIC_TIME is not set
10CONFIG_MMU=y
11# CONFIG_NO_IOPORT is not set
12CONFIG_GENERIC_HARDIRQS=y
13CONFIG_TRACE_IRQFLAGS_SUPPORT=y
14CONFIG_HARDIRQS_SW_RESEND=y
15CONFIG_GENERIC_IRQ_PROBE=y
16CONFIG_RWSEM_GENERIC_SPINLOCK=y
17# CONFIG_ARCH_HAS_ILOG2_U32 is not set
18# CONFIG_ARCH_HAS_ILOG2_U64 is not set
19CONFIG_GENERIC_HWEIGHT=y
20CONFIG_GENERIC_CALIBRATE_DELAY=y
21CONFIG_ZONE_DMA=y
22CONFIG_VECTORS_BASE=0xffff0000
23CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
24
25#
26# Code maturity level options
27#
28CONFIG_EXPERIMENTAL=y
29CONFIG_BROKEN_ON_SMP=y
30CONFIG_INIT_ENV_ARG_LIMIT=32
31
32#
33# General setup
34#
35CONFIG_LOCALVERSION=""
36CONFIG_LOCALVERSION_AUTO=y
37CONFIG_SWAP=y
38CONFIG_SYSVIPC=y
39# CONFIG_IPC_NS is not set
40CONFIG_SYSVIPC_SYSCTL=y
41# CONFIG_POSIX_MQUEUE is not set
42# CONFIG_BSD_PROCESS_ACCT is not set
43# CONFIG_TASKSTATS is not set
44# CONFIG_UTS_NS is not set
45# CONFIG_AUDIT is not set
46CONFIG_IKCONFIG=m
47CONFIG_IKCONFIG_PROC=y
48# CONFIG_SYSFS_DEPRECATED is not set
49# CONFIG_RELAY is not set
50# CONFIG_BLK_DEV_INITRD is not set
51CONFIG_CC_OPTIMIZE_FOR_SIZE=y
52CONFIG_SYSCTL=y
53CONFIG_EMBEDDED=y
54CONFIG_UID16=y
55CONFIG_SYSCTL_SYSCALL=y
56# CONFIG_KALLSYMS is not set
57CONFIG_HOTPLUG=y
58CONFIG_PRINTK=y
59CONFIG_BUG=y
60CONFIG_ELF_CORE=y
61CONFIG_BASE_FULL=y
62CONFIG_FUTEX=y
63CONFIG_EPOLL=y
64CONFIG_SHMEM=y
65CONFIG_SLAB=y
66CONFIG_VM_EVENT_COUNTERS=y
67CONFIG_RT_MUTEXES=y
68# CONFIG_TINY_SHMEM is not set
69CONFIG_BASE_SMALL=0
70# CONFIG_SLOB is not set
71
72#
73# Loadable module support
74#
75CONFIG_MODULES=y
76CONFIG_MODULE_UNLOAD=y
77# CONFIG_MODULE_FORCE_UNLOAD is not set
78# CONFIG_MODVERSIONS is not set
79# CONFIG_MODULE_SRCVERSION_ALL is not set
80CONFIG_KMOD=y
81
82#
83# Block layer
84#
85CONFIG_BLOCK=y
86# CONFIG_LBD is not set
87# CONFIG_BLK_DEV_IO_TRACE is not set
88# CONFIG_LSF is not set
89
90#
91# IO Schedulers
92#
93CONFIG_IOSCHED_NOOP=y
94# CONFIG_IOSCHED_AS is not set
95# CONFIG_IOSCHED_DEADLINE is not set
96# CONFIG_IOSCHED_CFQ is not set
97# CONFIG_DEFAULT_AS is not set
98# CONFIG_DEFAULT_DEADLINE is not set
99# CONFIG_DEFAULT_CFQ is not set
100CONFIG_DEFAULT_NOOP=y
101CONFIG_DEFAULT_IOSCHED="noop"
102
103#
104# System Type
105#
106# CONFIG_ARCH_AAEC2000 is not set
107# CONFIG_ARCH_INTEGRATOR is not set
108# CONFIG_ARCH_REALVIEW is not set
109# CONFIG_ARCH_VERSATILE is not set
110CONFIG_ARCH_AT91=y
111# CONFIG_ARCH_CLPS7500 is not set
112# CONFIG_ARCH_CLPS711X is not set
113# CONFIG_ARCH_CO285 is not set
114# CONFIG_ARCH_EBSA110 is not set
115# CONFIG_ARCH_EP93XX is not set
116# CONFIG_ARCH_FOOTBRIDGE is not set
117# CONFIG_ARCH_NETX is not set
118# CONFIG_ARCH_H720X is not set
119# CONFIG_ARCH_IMX is not set
120# CONFIG_ARCH_IOP32X is not set
121# CONFIG_ARCH_IOP33X is not set
122# CONFIG_ARCH_IOP13XX is not set
123# CONFIG_ARCH_IXP4XX is not set
124# CONFIG_ARCH_IXP2000 is not set
125# CONFIG_ARCH_IXP23XX is not set
126# CONFIG_ARCH_L7200 is not set
127# CONFIG_ARCH_NS9XXX is not set
128# CONFIG_ARCH_PNX4008 is not set
129# CONFIG_ARCH_PXA is not set
130# CONFIG_ARCH_RPC is not set
131# CONFIG_ARCH_SA1100 is not set
132# CONFIG_ARCH_S3C2410 is not set
133# CONFIG_ARCH_SHARK is not set
134# CONFIG_ARCH_LH7A40X is not set
135# CONFIG_ARCH_OMAP is not set
136
137#
138# Atmel AT91 System-on-Chip
139#
140CONFIG_ARCH_AT91RM9200=y
141# CONFIG_ARCH_AT91SAM9260 is not set
142# CONFIG_ARCH_AT91SAM9261 is not set
143# CONFIG_ARCH_AT91SAM9263 is not set
144
145#
146# AT91RM9200 Board Type
147#
148# CONFIG_MACH_ONEARM is not set
149# CONFIG_ARCH_AT91RM9200DK is not set
150# CONFIG_MACH_AT91RM9200EK is not set
151# CONFIG_MACH_CSB337 is not set
152# CONFIG_MACH_CSB637 is not set
153# CONFIG_MACH_CARMEVA is not set
154# CONFIG_MACH_ATEB9200 is not set
155# CONFIG_MACH_KB9200 is not set
156CONFIG_MACH_PICOTUX2XX=y
157# CONFIG_MACH_KAFA is not set
158
159#
160# AT91 Board Options
161#
162
163#
164# AT91 Feature Selections
165#
166CONFIG_AT91_PROGRAMMABLE_CLOCKS=y
167
168#
169# Processor Type
170#
171CONFIG_CPU_32=y
172CONFIG_CPU_ARM920T=y
173CONFIG_CPU_32v4T=y
174CONFIG_CPU_ABRT_EV4T=y
175CONFIG_CPU_CACHE_V4WT=y
176CONFIG_CPU_CACHE_VIVT=y
177CONFIG_CPU_COPY_V4WB=y
178CONFIG_CPU_TLB_V4WBI=y
179CONFIG_CPU_CP15=y
180CONFIG_CPU_CP15_MMU=y
181
182#
183# Processor Features
184#
185CONFIG_ARM_THUMB=y
186# CONFIG_CPU_ICACHE_DISABLE is not set
187# CONFIG_CPU_DCACHE_DISABLE is not set
188# CONFIG_CPU_DCACHE_WRITETHROUGH is not set
189# CONFIG_OUTER_CACHE is not set
190
191#
192# Bus support
193#
194
195#
196# PCCARD (PCMCIA/CardBus) support
197#
198# CONFIG_PCCARD is not set
199
200#
201# Kernel Features
202#
203# CONFIG_PREEMPT is not set
204CONFIG_NO_IDLE_HZ=y
205CONFIG_HZ=100
206CONFIG_AEABI=y
207CONFIG_OABI_COMPAT=y
208# CONFIG_ARCH_DISCONTIGMEM_ENABLE is not set
209CONFIG_SELECT_MEMORY_MODEL=y
210CONFIG_FLATMEM_MANUAL=y
211# CONFIG_DISCONTIGMEM_MANUAL is not set
212# CONFIG_SPARSEMEM_MANUAL is not set
213CONFIG_FLATMEM=y
214CONFIG_FLAT_NODE_MEM_MAP=y
215# CONFIG_SPARSEMEM_STATIC is not set
216CONFIG_SPLIT_PTLOCK_CPUS=4096
217# CONFIG_RESOURCES_64BIT is not set
218CONFIG_ZONE_DMA_FLAG=1
219# CONFIG_LEDS is not set
220CONFIG_ALIGNMENT_TRAP=y
221
222#
223# Boot options
224#
225CONFIG_ZBOOT_ROM_TEXT=0x0
226CONFIG_ZBOOT_ROM_BSS=0x0
227CONFIG_CMDLINE=""
228# CONFIG_XIP_KERNEL is not set
229CONFIG_KEXEC=y
230
231#
232# Floating point emulation
233#
234
235#
236# At least one emulation must be selected
237#
238CONFIG_FPE_NWFPE=y
239# CONFIG_FPE_NWFPE_XP is not set
240# CONFIG_FPE_FASTFPE is not set
241
242#
243# Userspace binary formats
244#
245CONFIG_BINFMT_ELF=y
246# CONFIG_BINFMT_AOUT is not set
247CONFIG_BINFMT_MISC=m
248
249#
250# Power management options
251#
252# CONFIG_PM is not set
253
254#
255# Networking
256#
257CONFIG_NET=y
258
259#
260# Networking options
261#
262# CONFIG_NETDEBUG is not set
263CONFIG_PACKET=m
264CONFIG_PACKET_MMAP=y
265CONFIG_UNIX=y
266CONFIG_XFRM=y
267CONFIG_XFRM_USER=m
268# CONFIG_XFRM_SUB_POLICY is not set
269# CONFIG_XFRM_MIGRATE is not set
270# CONFIG_NET_KEY is not set
271CONFIG_INET=y
272# CONFIG_IP_MULTICAST is not set
273# CONFIG_IP_ADVANCED_ROUTER is not set
274CONFIG_IP_FIB_HASH=y
275CONFIG_IP_PNP=y
276# CONFIG_IP_PNP_DHCP is not set
277CONFIG_IP_PNP_BOOTP=y
278# CONFIG_IP_PNP_RARP is not set
279CONFIG_NET_IPIP=m
280CONFIG_NET_IPGRE=m
281# CONFIG_ARPD is not set
282# CONFIG_SYN_COOKIES is not set
283CONFIG_INET_AH=m
284CONFIG_INET_ESP=m
285CONFIG_INET_IPCOMP=m
286CONFIG_INET_XFRM_TUNNEL=m
287CONFIG_INET_TUNNEL=m
288CONFIG_INET_XFRM_MODE_TRANSPORT=m
289CONFIG_INET_XFRM_MODE_TUNNEL=m
290CONFIG_INET_XFRM_MODE_BEET=m
291CONFIG_INET_DIAG=m
292CONFIG_INET_TCP_DIAG=m
293# CONFIG_TCP_CONG_ADVANCED is not set
294CONFIG_TCP_CONG_CUBIC=y
295CONFIG_DEFAULT_TCP_CONG="cubic"
296# CONFIG_TCP_MD5SIG is not set
297CONFIG_IPV6=m
298CONFIG_IPV6_PRIVACY=y
299CONFIG_IPV6_ROUTER_PREF=y
300CONFIG_IPV6_ROUTE_INFO=y
301CONFIG_INET6_AH=m
302CONFIG_INET6_ESP=m
303CONFIG_INET6_IPCOMP=m
304CONFIG_IPV6_MIP6=y
305CONFIG_INET6_XFRM_TUNNEL=m
306CONFIG_INET6_TUNNEL=m
307CONFIG_INET6_XFRM_MODE_TRANSPORT=m
308CONFIG_INET6_XFRM_MODE_TUNNEL=m
309CONFIG_INET6_XFRM_MODE_BEET=m
310CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION=m
311CONFIG_IPV6_SIT=m
312CONFIG_IPV6_TUNNEL=m
313# CONFIG_IPV6_MULTIPLE_TABLES is not set
314# CONFIG_NETWORK_SECMARK is not set
315# CONFIG_NETFILTER is not set
316
317#
318# DCCP Configuration (EXPERIMENTAL)
319#
320# CONFIG_IP_DCCP is not set
321
322#
323# SCTP Configuration (EXPERIMENTAL)
324#
325# CONFIG_IP_SCTP is not set
326
327#
328# TIPC Configuration (EXPERIMENTAL)
329#
330# CONFIG_TIPC is not set
331# CONFIG_ATM is not set
332CONFIG_BRIDGE=m
333CONFIG_VLAN_8021Q=m
334# CONFIG_DECNET is not set
335CONFIG_LLC=m
336# CONFIG_LLC2 is not set
337# CONFIG_IPX is not set
338# CONFIG_ATALK is not set
339# CONFIG_X25 is not set
340# CONFIG_LAPB is not set
341# CONFIG_ECONET is not set
342# CONFIG_WAN_ROUTER is not set
343
344#
345# QoS and/or fair queueing
346#
347# CONFIG_NET_SCHED is not set
348
349#
350# Network testing
351#
352# CONFIG_NET_PKTGEN is not set
353# CONFIG_HAMRADIO is not set
354# CONFIG_IRDA is not set
355CONFIG_BT=m
356CONFIG_BT_L2CAP=m
357CONFIG_BT_SCO=m
358CONFIG_BT_RFCOMM=m
359CONFIG_BT_RFCOMM_TTY=y
360CONFIG_BT_BNEP=m
361CONFIG_BT_BNEP_MC_FILTER=y
362CONFIG_BT_BNEP_PROTO_FILTER=y
363CONFIG_BT_HIDP=m
364
365#
366# Bluetooth device drivers
367#
368CONFIG_BT_HCIUSB=m
369CONFIG_BT_HCIUSB_SCO=y
370# CONFIG_BT_HCIUART is not set
371# CONFIG_BT_HCIBCM203X is not set
372# CONFIG_BT_HCIBPA10X is not set
373# CONFIG_BT_HCIBFUSB is not set
374# CONFIG_BT_HCIVHCI is not set
375# CONFIG_IEEE80211 is not set
376
377#
378# Device Drivers
379#
380
381#
382# Generic Driver Options
383#
384CONFIG_STANDALONE=y
385CONFIG_PREVENT_FIRMWARE_BUILD=y
386CONFIG_FW_LOADER=m
387# CONFIG_DEBUG_DRIVER is not set
388# CONFIG_DEBUG_DEVRES is not set
389# CONFIG_SYS_HYPERVISOR is not set
390
391#
392# Connector - unified userspace <-> kernelspace linker
393#
394# CONFIG_CONNECTOR is not set
395
396#
397# Memory Technology Devices (MTD)
398#
399CONFIG_MTD=y
400# CONFIG_MTD_DEBUG is not set
401# CONFIG_MTD_CONCAT is not set
402CONFIG_MTD_PARTITIONS=y
403# CONFIG_MTD_REDBOOT_PARTS is not set
404CONFIG_MTD_CMDLINE_PARTS=y
405# CONFIG_MTD_AFS_PARTS is not set
406
407#
408# User Modules And Translation Layers
409#
410CONFIG_MTD_CHAR=y
411CONFIG_MTD_BLKDEVS=y
412CONFIG_MTD_BLOCK=y
413# CONFIG_FTL is not set
414# CONFIG_NFTL is not set
415# CONFIG_INFTL is not set
416# CONFIG_RFD_FTL is not set
417# CONFIG_SSFDC is not set
418
419#
420# RAM/ROM/Flash chip drivers
421#
422CONFIG_MTD_CFI=y
423# CONFIG_MTD_JEDECPROBE is not set
424CONFIG_MTD_GEN_PROBE=y
425# CONFIG_MTD_CFI_ADV_OPTIONS is not set
426CONFIG_MTD_MAP_BANK_WIDTH_1=y
427CONFIG_MTD_MAP_BANK_WIDTH_2=y
428CONFIG_MTD_MAP_BANK_WIDTH_4=y
429# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
430# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
431# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
432CONFIG_MTD_CFI_I1=y
433CONFIG_MTD_CFI_I2=y
434# CONFIG_MTD_CFI_I4 is not set
435# CONFIG_MTD_CFI_I8 is not set
436# CONFIG_MTD_CFI_INTELEXT is not set
437CONFIG_MTD_CFI_AMDSTD=y
438# CONFIG_MTD_CFI_STAA is not set
439CONFIG_MTD_CFI_UTIL=y
440# CONFIG_MTD_RAM is not set
441# CONFIG_MTD_ROM is not set
442# CONFIG_MTD_ABSENT is not set
443# CONFIG_MTD_OBSOLETE_CHIPS is not set
444
445#
446# Mapping drivers for chip access
447#
448# CONFIG_MTD_COMPLEX_MAPPINGS is not set
449CONFIG_MTD_PHYSMAP=y
450CONFIG_MTD_PHYSMAP_START=0x8000000
451CONFIG_MTD_PHYSMAP_LEN=0x0
452CONFIG_MTD_PHYSMAP_BANKWIDTH=2
453# CONFIG_MTD_ARM_INTEGRATOR is not set
454# CONFIG_MTD_PLATRAM is not set
455
456#
457# Self-contained MTD device drivers
458#
459# CONFIG_MTD_SLRAM is not set
460# CONFIG_MTD_PHRAM is not set
461# CONFIG_MTD_MTDRAM is not set
462# CONFIG_MTD_BLOCK2MTD is not set
463
464#
465# Disk-On-Chip Device Drivers
466#
467# CONFIG_MTD_DOC2000 is not set
468# CONFIG_MTD_DOC2001 is not set
469# CONFIG_MTD_DOC2001PLUS is not set
470
471#
472# NAND Flash Device Drivers
473#
474# CONFIG_MTD_NAND is not set
475
476#
477# OneNAND Flash Device Drivers
478#
479# CONFIG_MTD_ONENAND is not set
480
481#
482# Parallel port support
483#
484# CONFIG_PARPORT is not set
485
486#
487# Plug and Play support
488#
489# CONFIG_PNPACPI is not set
490
491#
492# Block devices
493#
494# CONFIG_BLK_DEV_COW_COMMON is not set
495CONFIG_BLK_DEV_LOOP=m
496# CONFIG_BLK_DEV_CRYPTOLOOP is not set
497# CONFIG_BLK_DEV_NBD is not set
498# CONFIG_BLK_DEV_UB is not set
499# CONFIG_BLK_DEV_RAM is not set
500# CONFIG_CDROM_PKTCDVD is not set
501# CONFIG_ATA_OVER_ETH is not set
502
503#
504# SCSI device support
505#
506# CONFIG_RAID_ATTRS is not set
507CONFIG_SCSI=m
508# CONFIG_SCSI_TGT is not set
509# CONFIG_SCSI_NETLINK is not set
510CONFIG_SCSI_PROC_FS=y
511
512#
513# SCSI support type (disk, tape, CD-ROM)
514#
515CONFIG_BLK_DEV_SD=m
516# CONFIG_CHR_DEV_ST is not set
517# CONFIG_CHR_DEV_OSST is not set
518CONFIG_BLK_DEV_SR=m
519CONFIG_BLK_DEV_SR_VENDOR=y
520CONFIG_CHR_DEV_SG=m
521# CONFIG_CHR_DEV_SCH is not set
522
523#
524# Some SCSI devices (e.g. CD jukebox) support multiple LUNs
525#
526# CONFIG_SCSI_MULTI_LUN is not set
527# CONFIG_SCSI_CONSTANTS is not set
528# CONFIG_SCSI_LOGGING is not set
529# CONFIG_SCSI_SCAN_ASYNC is not set
530
531#
532# SCSI Transports
533#
534# CONFIG_SCSI_SPI_ATTRS is not set
535# CONFIG_SCSI_FC_ATTRS is not set
536# CONFIG_SCSI_ISCSI_ATTRS is not set
537# CONFIG_SCSI_SAS_ATTRS is not set
538# CONFIG_SCSI_SAS_LIBSAS is not set
539
540#
541# SCSI low-level drivers
542#
543# CONFIG_ISCSI_TCP is not set
544# CONFIG_SCSI_DEBUG is not set
545
546#
547# Serial ATA (prod) and Parallel ATA (experimental) drivers
548#
549# CONFIG_ATA is not set
550
551#
552# Multi-device support (RAID and LVM)
553#
554# CONFIG_MD is not set
555
556#
557# Fusion MPT device support
558#
559# CONFIG_FUSION is not set
560
561#
562# IEEE 1394 (FireWire) support
563#
564
565#
566# I2O device support
567#
568
569#
570# Network device support
571#
572CONFIG_NETDEVICES=y
573# CONFIG_DUMMY is not set
574# CONFIG_BONDING is not set
575# CONFIG_EQUALIZER is not set
576CONFIG_TUN=m
577
578#
579# PHY device support
580#
581# CONFIG_PHYLIB is not set
582
583#
584# Ethernet (10 or 100Mbit)
585#
586CONFIG_NET_ETHERNET=y
587CONFIG_MII=y
588CONFIG_ARM_AT91_ETHER=y
589# CONFIG_SMC91X is not set
590# CONFIG_DM9000 is not set
591
592#
593# Ethernet (1000 Mbit)
594#
595
596#
597# Ethernet (10000 Mbit)
598#
599
600#
601# Token Ring devices
602#
603
604#
605# Wireless LAN (non-hamradio)
606#
607# CONFIG_NET_RADIO is not set
608
609#
610# Wan interfaces
611#
612# CONFIG_WAN is not set
613CONFIG_PPP=m
614# CONFIG_PPP_MULTILINK is not set
615CONFIG_PPP_FILTER=y
616CONFIG_PPP_ASYNC=m
617# CONFIG_PPP_SYNC_TTY is not set
618CONFIG_PPP_DEFLATE=m
619CONFIG_PPP_BSDCOMP=m
620CONFIG_PPP_MPPE=m
621CONFIG_PPPOE=m
622CONFIG_SLIP=m
623CONFIG_SLIP_COMPRESSED=y
624CONFIG_SLHC=m
625CONFIG_SLIP_SMART=y
626CONFIG_SLIP_MODE_SLIP6=y
627# CONFIG_SHAPER is not set
628# CONFIG_NETCONSOLE is not set
629# CONFIG_NETPOLL is not set
630# CONFIG_NET_POLL_CONTROLLER is not set
631
632#
633# ISDN subsystem
634#
635# CONFIG_ISDN is not set
636
637#
638# Input device support
639#
640CONFIG_INPUT=y
641# CONFIG_INPUT_FF_MEMLESS is not set
642
643#
644# Userland interfaces
645#
646# CONFIG_INPUT_MOUSEDEV is not set
647# CONFIG_INPUT_JOYDEV is not set
648# CONFIG_INPUT_TSDEV is not set
649# CONFIG_INPUT_EVDEV is not set
650# CONFIG_INPUT_EVBUG is not set
651
652#
653# Input Device Drivers
654#
655# CONFIG_INPUT_KEYBOARD is not set
656# CONFIG_INPUT_MOUSE is not set
657# CONFIG_INPUT_JOYSTICK is not set
658# CONFIG_INPUT_TOUCHSCREEN is not set
659# CONFIG_INPUT_MISC is not set
660
661#
662# Hardware I/O ports
663#
664# CONFIG_SERIO is not set
665# CONFIG_GAMEPORT is not set
666
667#
668# Character devices
669#
670# CONFIG_VT is not set
671# CONFIG_SERIAL_NONSTANDARD is not set
672
673#
674# Serial drivers
675#
676# CONFIG_SERIAL_8250 is not set
677
678#
679# Non-8250 serial port support
680#
681CONFIG_SERIAL_ATMEL=y
682CONFIG_SERIAL_ATMEL_CONSOLE=y
683# CONFIG_SERIAL_ATMEL_TTYAT is not set
684CONFIG_SERIAL_CORE=y
685CONFIG_SERIAL_CORE_CONSOLE=y
686CONFIG_UNIX98_PTYS=y
687# CONFIG_LEGACY_PTYS is not set
688
689#
690# IPMI
691#
692# CONFIG_IPMI_HANDLER is not set
693
694#
695# Watchdog Cards
696#
697CONFIG_WATCHDOG=y
698CONFIG_WATCHDOG_NOWAYOUT=y
699
700#
701# Watchdog Device Drivers
702#
703# CONFIG_SOFT_WATCHDOG is not set
704CONFIG_AT91RM9200_WATCHDOG=m
705
706#
707# USB-based Watchdog Cards
708#
709# CONFIG_USBPCWATCHDOG is not set
710CONFIG_HW_RANDOM=m
711# CONFIG_NVRAM is not set
712# CONFIG_DTLK is not set
713# CONFIG_R3964 is not set
714# CONFIG_RAW_DRIVER is not set
715
716#
717# TPM devices
718#
719# CONFIG_TCG_TPM is not set
720
721#
722# I2C support
723#
724CONFIG_I2C=m
725CONFIG_I2C_CHARDEV=m
726
727#
728# I2C Algorithms
729#
730# CONFIG_I2C_ALGOBIT is not set
731# CONFIG_I2C_ALGOPCF is not set
732# CONFIG_I2C_ALGOPCA is not set
733
734#
735# I2C Hardware Bus support
736#
737CONFIG_I2C_AT91=m
738CONFIG_I2C_ISA=m
739# CONFIG_I2C_OCORES is not set
740# CONFIG_I2C_PARPORT_LIGHT is not set
741# CONFIG_I2C_STUB is not set
742# CONFIG_I2C_PCA_ISA is not set
743
744#
745# Miscellaneous I2C Chip support
746#
747CONFIG_SENSORS_DS1337=m
748CONFIG_SENSORS_DS1374=m
749CONFIG_SENSORS_EEPROM=m
750CONFIG_SENSORS_PCF8574=m
751CONFIG_SENSORS_PCA9539=m
752CONFIG_SENSORS_PCF8591=m
753# CONFIG_SENSORS_MAX6875 is not set
754# CONFIG_I2C_DEBUG_CORE is not set
755# CONFIG_I2C_DEBUG_ALGO is not set
756# CONFIG_I2C_DEBUG_BUS is not set
757# CONFIG_I2C_DEBUG_CHIP is not set
758
759#
760# SPI support
761#
762# CONFIG_SPI is not set
763# CONFIG_SPI_MASTER is not set
764
765#
766# Dallas's 1-wire bus
767#
768# CONFIG_W1 is not set
769
770#
771# Hardware Monitoring support
772#
773CONFIG_HWMON=m
774CONFIG_HWMON_VID=m
775# CONFIG_SENSORS_ABITUGURU is not set
776CONFIG_SENSORS_ADM1021=m
777CONFIG_SENSORS_ADM1025=m
778CONFIG_SENSORS_ADM1026=m
779CONFIG_SENSORS_ADM1029=m
780CONFIG_SENSORS_ADM1031=m
781CONFIG_SENSORS_ADM9240=m
782# CONFIG_SENSORS_ASB100 is not set
783# CONFIG_SENSORS_ATXP1 is not set
784CONFIG_SENSORS_DS1621=m
785# CONFIG_SENSORS_F71805F is not set
786# CONFIG_SENSORS_FSCHER is not set
787# CONFIG_SENSORS_FSCPOS is not set
788CONFIG_SENSORS_GL518SM=m
789CONFIG_SENSORS_GL520SM=m
790CONFIG_SENSORS_IT87=m
791CONFIG_SENSORS_LM63=m
792CONFIG_SENSORS_LM75=m
793CONFIG_SENSORS_LM77=m
794CONFIG_SENSORS_LM78=m
795CONFIG_SENSORS_LM80=m
796CONFIG_SENSORS_LM83=m
797CONFIG_SENSORS_LM85=m
798CONFIG_SENSORS_LM87=m
799CONFIG_SENSORS_LM90=m
800CONFIG_SENSORS_LM92=m
801CONFIG_SENSORS_MAX1619=m
802# CONFIG_SENSORS_PC87360 is not set
803# CONFIG_SENSORS_PC87427 is not set
804# CONFIG_SENSORS_SMSC47M1 is not set
805# CONFIG_SENSORS_SMSC47M192 is not set
806CONFIG_SENSORS_SMSC47B397=m
807# CONFIG_SENSORS_VT1211 is not set
808CONFIG_SENSORS_W83781D=m
809CONFIG_SENSORS_W83791D=m
810CONFIG_SENSORS_W83792D=m
811CONFIG_SENSORS_W83793=m
812CONFIG_SENSORS_W83L785TS=m
813# CONFIG_SENSORS_W83627HF is not set
814# CONFIG_SENSORS_W83627EHF is not set
815# CONFIG_HWMON_DEBUG_CHIP is not set
816
817#
818# Misc devices
819#
820
821#
822# Multifunction device drivers
823#
824# CONFIG_MFD_SM501 is not set
825
826#
827# LED devices
828#
829# CONFIG_NEW_LEDS is not set
830
831#
832# LED drivers
833#
834
835#
836# LED Triggers
837#
838
839#
840# Multimedia devices
841#
842# CONFIG_VIDEO_DEV is not set
843
844#
845# Digital Video Broadcasting Devices
846#
847# CONFIG_DVB is not set
848# CONFIG_USB_DABUSB is not set
849
850#
851# Graphics support
852#
853# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
854# CONFIG_FB is not set
855
856#
857# Sound
858#
859# CONFIG_SOUND is not set
860
861#
862# HID Devices
863#
864CONFIG_HID=m
865# CONFIG_HID_DEBUG is not set
866
867#
868# USB support
869#
870CONFIG_USB_ARCH_HAS_HCD=y
871CONFIG_USB_ARCH_HAS_OHCI=y
872# CONFIG_USB_ARCH_HAS_EHCI is not set
873CONFIG_USB=m
874# CONFIG_USB_DEBUG is not set
875
876#
877# Miscellaneous USB options
878#
879CONFIG_USB_DEVICEFS=y
880# CONFIG_USB_DYNAMIC_MINORS is not set
881# CONFIG_USB_OTG is not set
882
883#
884# USB Host Controller Drivers
885#
886# CONFIG_USB_ISP116X_HCD is not set
887CONFIG_USB_OHCI_HCD=m
888# CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set
889# CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set
890CONFIG_USB_OHCI_LITTLE_ENDIAN=y
891# CONFIG_USB_SL811_HCD is not set
892
893#
894# USB Device Class drivers
895#
896CONFIG_USB_ACM=m
897CONFIG_USB_PRINTER=m
898
899#
900# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
901#
902
903#
904# may also be needed; see USB_STORAGE Help for more information
905#
906CONFIG_USB_STORAGE=m
907# CONFIG_USB_STORAGE_DEBUG is not set
908# CONFIG_USB_STORAGE_DATAFAB is not set
909# CONFIG_USB_STORAGE_FREECOM is not set
910# CONFIG_USB_STORAGE_DPCM is not set
911# CONFIG_USB_STORAGE_USBAT is not set
912# CONFIG_USB_STORAGE_SDDR09 is not set
913# CONFIG_USB_STORAGE_SDDR55 is not set
914# CONFIG_USB_STORAGE_JUMPSHOT is not set
915# CONFIG_USB_STORAGE_ALAUDA is not set
916# CONFIG_USB_STORAGE_KARMA is not set
917# CONFIG_USB_LIBUSUAL is not set
918
919#
920# USB Input Devices
921#
922CONFIG_USB_HID=m
923# CONFIG_USB_HIDINPUT_POWERBOOK is not set
924# CONFIG_HID_FF is not set
925# CONFIG_USB_HIDDEV is not set
926
927#
928# USB HID Boot Protocol drivers
929#
930# CONFIG_USB_KBD is not set
931# CONFIG_USB_MOUSE is not set
932# CONFIG_USB_AIPTEK is not set
933# CONFIG_USB_WACOM is not set
934# CONFIG_USB_ACECAD is not set
935# CONFIG_USB_KBTAB is not set
936# CONFIG_USB_POWERMATE is not set
937# CONFIG_USB_TOUCHSCREEN is not set
938# CONFIG_USB_YEALINK is not set
939# CONFIG_USB_XPAD is not set
940# CONFIG_USB_ATI_REMOTE is not set
941# CONFIG_USB_ATI_REMOTE2 is not set
942# CONFIG_USB_KEYSPAN_REMOTE is not set
943# CONFIG_USB_APPLETOUCH is not set
944# CONFIG_USB_GTCO is not set
945
946#
947# USB Imaging devices
948#
949# CONFIG_USB_MDC800 is not set
950# CONFIG_USB_MICROTEK is not set
951
952#
953# USB Network Adapters
954#
955CONFIG_USB_CATC=m
956CONFIG_USB_KAWETH=m
957CONFIG_USB_PEGASUS=m
958CONFIG_USB_RTL8150=m
959CONFIG_USB_USBNET_MII=m
960CONFIG_USB_USBNET=m
961CONFIG_USB_NET_AX8817X=m
962CONFIG_USB_NET_CDCETHER=m
963CONFIG_USB_NET_DM9601=m
964CONFIG_USB_NET_GL620A=m
965CONFIG_USB_NET_NET1080=m
966CONFIG_USB_NET_PLUSB=m
967CONFIG_USB_NET_MCS7830=m
968CONFIG_USB_NET_RNDIS_HOST=m
969CONFIG_USB_NET_CDC_SUBSET=m
970CONFIG_USB_ALI_M5632=y
971CONFIG_USB_AN2720=y
972CONFIG_USB_BELKIN=y
973CONFIG_USB_ARMLINUX=y
974CONFIG_USB_EPSON2888=y
975CONFIG_USB_KC2190=y
976CONFIG_USB_NET_ZAURUS=m
977# CONFIG_USB_MON is not set
978
979#
980# USB port drivers
981#
982
983#
984# USB Serial Converter support
985#
986CONFIG_USB_SERIAL=m
987CONFIG_USB_SERIAL_GENERIC=y
988# CONFIG_USB_SERIAL_AIRCABLE is not set
989# CONFIG_USB_SERIAL_AIRPRIME is not set
990# CONFIG_USB_SERIAL_ARK3116 is not set
991# CONFIG_USB_SERIAL_BELKIN is not set
992# CONFIG_USB_SERIAL_WHITEHEAT is not set
993# CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set
994# CONFIG_USB_SERIAL_CP2101 is not set
995# CONFIG_USB_SERIAL_CYPRESS_M8 is not set
996# CONFIG_USB_SERIAL_EMPEG is not set
997# CONFIG_USB_SERIAL_FTDI_SIO is not set
998# CONFIG_USB_SERIAL_FUNSOFT is not set
999# CONFIG_USB_SERIAL_VISOR is not set
1000# CONFIG_USB_SERIAL_IPAQ is not set
1001# CONFIG_USB_SERIAL_IR is not set
1002# CONFIG_USB_SERIAL_EDGEPORT is not set
1003# CONFIG_USB_SERIAL_EDGEPORT_TI is not set
1004# CONFIG_USB_SERIAL_GARMIN is not set
1005# CONFIG_USB_SERIAL_IPW is not set
1006# CONFIG_USB_SERIAL_KEYSPAN_PDA is not set
1007# CONFIG_USB_SERIAL_KEYSPAN is not set
1008# CONFIG_USB_SERIAL_KLSI is not set
1009# CONFIG_USB_SERIAL_KOBIL_SCT is not set
1010# CONFIG_USB_SERIAL_MCT_U232 is not set
1011# CONFIG_USB_SERIAL_MOS7720 is not set
1012# CONFIG_USB_SERIAL_MOS7840 is not set
1013# CONFIG_USB_SERIAL_NAVMAN is not set
1014CONFIG_USB_SERIAL_PL2303=m
1015# CONFIG_USB_SERIAL_HP4X is not set
1016# CONFIG_USB_SERIAL_SAFE is not set
1017# CONFIG_USB_SERIAL_SIERRAWIRELESS is not set
1018# CONFIG_USB_SERIAL_TI is not set
1019# CONFIG_USB_SERIAL_CYBERJACK is not set
1020# CONFIG_USB_SERIAL_XIRCOM is not set
1021# CONFIG_USB_SERIAL_OPTION is not set
1022# CONFIG_USB_SERIAL_OMNINET is not set
1023# CONFIG_USB_SERIAL_DEBUG is not set
1024
1025#
1026# USB Miscellaneous drivers
1027#
1028# CONFIG_USB_EMI62 is not set
1029# CONFIG_USB_EMI26 is not set
1030# CONFIG_USB_ADUTUX is not set
1031# CONFIG_USB_AUERSWALD is not set
1032# CONFIG_USB_RIO500 is not set
1033# CONFIG_USB_LEGOTOWER is not set
1034# CONFIG_USB_LCD is not set
1035# CONFIG_USB_BERRY_CHARGE is not set
1036# CONFIG_USB_LED is not set
1037# CONFIG_USB_CYPRESS_CY7C63 is not set
1038# CONFIG_USB_CYTHERM is not set
1039# CONFIG_USB_PHIDGET is not set
1040# CONFIG_USB_IDMOUSE is not set
1041# CONFIG_USB_FTDI_ELAN is not set
1042# CONFIG_USB_APPLEDISPLAY is not set
1043# CONFIG_USB_LD is not set
1044# CONFIG_USB_TRANCEVIBRATOR is not set
1045# CONFIG_USB_IOWARRIOR is not set
1046# CONFIG_USB_TEST is not set
1047
1048#
1049# USB DSL modem support
1050#
1051
1052#
1053# USB Gadget Support
1054#
1055# CONFIG_USB_GADGET is not set
1056
1057#
1058# MMC/SD Card support
1059#
1060CONFIG_MMC=m
1061# CONFIG_MMC_DEBUG is not set
1062CONFIG_MMC_BLOCK=m
1063CONFIG_MMC_AT91=m
1064
1065#
1066# Real Time Clock
1067#
1068CONFIG_RTC_LIB=y
1069CONFIG_RTC_CLASS=m
1070
1071#
1072# RTC interfaces
1073#
1074CONFIG_RTC_INTF_SYSFS=m
1075CONFIG_RTC_INTF_PROC=m
1076CONFIG_RTC_INTF_DEV=m
1077# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
1078
1079#
1080# RTC drivers
1081#
1082# CONFIG_RTC_DRV_CMOS is not set
1083# CONFIG_RTC_DRV_X1205 is not set
1084# CONFIG_RTC_DRV_DS1307 is not set
1085# CONFIG_RTC_DRV_DS1553 is not set
1086# CONFIG_RTC_DRV_ISL1208 is not set
1087# CONFIG_RTC_DRV_DS1672 is not set
1088# CONFIG_RTC_DRV_DS1742 is not set
1089# CONFIG_RTC_DRV_PCF8563 is not set
1090# CONFIG_RTC_DRV_RS5C372 is not set
1091# CONFIG_RTC_DRV_M48T86 is not set
1092CONFIG_RTC_DRV_AT91RM9200=m
1093# CONFIG_RTC_DRV_TEST is not set
1094# CONFIG_RTC_DRV_V3020 is not set
1095
1096#
1097# File systems
1098#
1099CONFIG_EXT2_FS=m
1100# CONFIG_EXT2_FS_XATTR is not set
1101# CONFIG_EXT2_FS_XIP is not set
1102CONFIG_EXT3_FS=m
1103# CONFIG_EXT3_FS_XATTR is not set
1104# CONFIG_EXT4DEV_FS is not set
1105CONFIG_JBD=m
1106# CONFIG_JBD_DEBUG is not set
1107# CONFIG_REISERFS_FS is not set
1108# CONFIG_JFS_FS is not set
1109# CONFIG_FS_POSIX_ACL is not set
1110# CONFIG_XFS_FS is not set
1111# CONFIG_GFS2_FS is not set
1112# CONFIG_OCFS2_FS is not set
1113# CONFIG_MINIX_FS is not set
1114# CONFIG_ROMFS_FS is not set
1115CONFIG_INOTIFY=y
1116CONFIG_INOTIFY_USER=y
1117# CONFIG_QUOTA is not set
1118CONFIG_DNOTIFY=y
1119# CONFIG_AUTOFS_FS is not set
1120# CONFIG_AUTOFS4_FS is not set
1121# CONFIG_FUSE_FS is not set
1122
1123#
1124# CD-ROM/DVD Filesystems
1125#
1126CONFIG_ISO9660_FS=m
1127CONFIG_JOLIET=y
1128# CONFIG_ZISOFS is not set
1129CONFIG_UDF_FS=m
1130CONFIG_UDF_NLS=y
1131
1132#
1133# DOS/FAT/NT Filesystems
1134#
1135CONFIG_FAT_FS=m
1136CONFIG_MSDOS_FS=m
1137CONFIG_VFAT_FS=m
1138CONFIG_FAT_DEFAULT_CODEPAGE=437
1139CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
1140CONFIG_NTFS_FS=m
1141# CONFIG_NTFS_DEBUG is not set
1142# CONFIG_NTFS_RW is not set
1143
1144#
1145# Pseudo filesystems
1146#
1147CONFIG_PROC_FS=y
1148CONFIG_PROC_SYSCTL=y
1149CONFIG_SYSFS=y
1150CONFIG_TMPFS=y
1151# CONFIG_TMPFS_POSIX_ACL is not set
1152# CONFIG_HUGETLB_PAGE is not set
1153CONFIG_RAMFS=y
1154# CONFIG_CONFIGFS_FS is not set
1155
1156#
1157# Miscellaneous filesystems
1158#
1159# CONFIG_ADFS_FS is not set
1160# CONFIG_AFFS_FS is not set
1161# CONFIG_HFS_FS is not set
1162# CONFIG_HFSPLUS_FS is not set
1163# CONFIG_BEFS_FS is not set
1164# CONFIG_BFS_FS is not set
1165# CONFIG_EFS_FS is not set
1166CONFIG_JFFS2_FS=y
1167CONFIG_JFFS2_FS_DEBUG=0
1168CONFIG_JFFS2_FS_WRITEBUFFER=y
1169CONFIG_JFFS2_SUMMARY=y
1170# CONFIG_JFFS2_FS_XATTR is not set
1171CONFIG_JFFS2_COMPRESSION_OPTIONS=y
1172CONFIG_JFFS2_ZLIB=y
1173CONFIG_JFFS2_RTIME=y
1174# CONFIG_JFFS2_RUBIN is not set
1175# CONFIG_JFFS2_CMODE_NONE is not set
1176CONFIG_JFFS2_CMODE_PRIORITY=y
1177# CONFIG_JFFS2_CMODE_SIZE is not set
1178# CONFIG_CRAMFS is not set
1179# CONFIG_VXFS_FS is not set
1180# CONFIG_HPFS_FS is not set
1181# CONFIG_QNX4FS_FS is not set
1182# CONFIG_SYSV_FS is not set
1183# CONFIG_UFS_FS is not set
1184
1185#
1186# Network File Systems
1187#
1188CONFIG_NFS_FS=m
1189# CONFIG_NFS_V3 is not set
1190# CONFIG_NFS_V4 is not set
1191# CONFIG_NFS_DIRECTIO is not set
1192# CONFIG_NFSD is not set
1193CONFIG_LOCKD=m
1194CONFIG_NFS_COMMON=y
1195CONFIG_SUNRPC=m
1196# CONFIG_RPCSEC_GSS_KRB5 is not set
1197# CONFIG_RPCSEC_GSS_SPKM3 is not set
1198CONFIG_SMB_FS=m
1199# CONFIG_SMB_NLS_DEFAULT is not set
1200CONFIG_CIFS=m
1201# CONFIG_CIFS_STATS is not set
1202# CONFIG_CIFS_WEAK_PW_HASH is not set
1203# CONFIG_CIFS_XATTR is not set
1204# CONFIG_CIFS_DEBUG2 is not set
1205# CONFIG_CIFS_EXPERIMENTAL is not set
1206# CONFIG_NCP_FS is not set
1207# CONFIG_CODA_FS is not set
1208# CONFIG_AFS_FS is not set
1209# CONFIG_9P_FS is not set
1210
1211#
1212# Partition Types
1213#
1214CONFIG_PARTITION_ADVANCED=y
1215# CONFIG_ACORN_PARTITION is not set
1216# CONFIG_OSF_PARTITION is not set
1217CONFIG_AMIGA_PARTITION=y
1218# CONFIG_ATARI_PARTITION is not set
1219# CONFIG_MAC_PARTITION is not set
1220CONFIG_MSDOS_PARTITION=y
1221# CONFIG_BSD_DISKLABEL is not set
1222# CONFIG_MINIX_SUBPARTITION is not set
1223# CONFIG_SOLARIS_X86_PARTITION is not set
1224# CONFIG_UNIXWARE_DISKLABEL is not set
1225# CONFIG_LDM_PARTITION is not set
1226# CONFIG_SGI_PARTITION is not set
1227# CONFIG_ULTRIX_PARTITION is not set
1228# CONFIG_SUN_PARTITION is not set
1229# CONFIG_KARMA_PARTITION is not set
1230# CONFIG_EFI_PARTITION is not set
1231
1232#
1233# Native Language Support
1234#
1235CONFIG_NLS=m
1236CONFIG_NLS_DEFAULT="utf-8"
1237CONFIG_NLS_CODEPAGE_437=m
1238CONFIG_NLS_CODEPAGE_737=m
1239CONFIG_NLS_CODEPAGE_775=m
1240CONFIG_NLS_CODEPAGE_850=m
1241CONFIG_NLS_CODEPAGE_852=m
1242CONFIG_NLS_CODEPAGE_855=m
1243CONFIG_NLS_CODEPAGE_857=m
1244CONFIG_NLS_CODEPAGE_860=m
1245CONFIG_NLS_CODEPAGE_861=m
1246CONFIG_NLS_CODEPAGE_862=m
1247CONFIG_NLS_CODEPAGE_863=m
1248CONFIG_NLS_CODEPAGE_864=m
1249CONFIG_NLS_CODEPAGE_865=m
1250CONFIG_NLS_CODEPAGE_866=m
1251CONFIG_NLS_CODEPAGE_869=m
1252CONFIG_NLS_CODEPAGE_936=m
1253CONFIG_NLS_CODEPAGE_950=m
1254CONFIG_NLS_CODEPAGE_932=m
1255CONFIG_NLS_CODEPAGE_949=m
1256CONFIG_NLS_CODEPAGE_874=m
1257CONFIG_NLS_ISO8859_8=m
1258CONFIG_NLS_CODEPAGE_1250=m
1259CONFIG_NLS_CODEPAGE_1251=m
1260CONFIG_NLS_ASCII=m
1261CONFIG_NLS_ISO8859_1=m
1262CONFIG_NLS_ISO8859_2=m
1263CONFIG_NLS_ISO8859_3=m
1264CONFIG_NLS_ISO8859_4=m
1265CONFIG_NLS_ISO8859_5=m
1266CONFIG_NLS_ISO8859_6=m
1267CONFIG_NLS_ISO8859_7=m
1268CONFIG_NLS_ISO8859_9=m
1269CONFIG_NLS_ISO8859_13=m
1270CONFIG_NLS_ISO8859_14=m
1271CONFIG_NLS_ISO8859_15=m
1272CONFIG_NLS_KOI8_R=m
1273CONFIG_NLS_KOI8_U=m
1274CONFIG_NLS_UTF8=m
1275
1276#
1277# Distributed Lock Manager
1278#
1279# CONFIG_DLM is not set
1280
1281#
1282# Profiling support
1283#
1284# CONFIG_PROFILING is not set
1285
1286#
1287# Kernel hacking
1288#
1289# CONFIG_PRINTK_TIME is not set
1290CONFIG_ENABLE_MUST_CHECK=y
1291# CONFIG_MAGIC_SYSRQ is not set
1292# CONFIG_UNUSED_SYMBOLS is not set
1293# CONFIG_DEBUG_FS is not set
1294# CONFIG_HEADERS_CHECK is not set
1295CONFIG_DEBUG_KERNEL=y
1296# CONFIG_DEBUG_SHIRQ is not set
1297CONFIG_LOG_BUF_SHIFT=14
1298CONFIG_DETECT_SOFTLOCKUP=y
1299# CONFIG_SCHEDSTATS is not set
1300# CONFIG_TIMER_STATS is not set
1301# CONFIG_DEBUG_SLAB is not set
1302# CONFIG_DEBUG_RT_MUTEXES is not set
1303# CONFIG_RT_MUTEX_TESTER is not set
1304# CONFIG_DEBUG_SPINLOCK is not set
1305# CONFIG_DEBUG_MUTEXES is not set
1306# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
1307# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
1308# CONFIG_DEBUG_KOBJECT is not set
1309# CONFIG_DEBUG_BUGVERBOSE is not set
1310# CONFIG_DEBUG_INFO is not set
1311# CONFIG_DEBUG_VM is not set
1312# CONFIG_DEBUG_LIST is not set
1313CONFIG_FRAME_POINTER=y
1314# CONFIG_FORCED_INLINING is not set
1315# CONFIG_RCU_TORTURE_TEST is not set
1316# CONFIG_FAULT_INJECTION is not set
1317# CONFIG_DEBUG_USER is not set
1318# CONFIG_DEBUG_ERRORS is not set
1319CONFIG_DEBUG_LL=y
1320# CONFIG_DEBUG_ICEDCC is not set
1321
1322#
1323# Security options
1324#
1325# CONFIG_KEYS is not set
1326# CONFIG_SECURITY is not set
1327
1328#
1329# Cryptographic options
1330#
1331CONFIG_CRYPTO=y
1332CONFIG_CRYPTO_ALGAPI=m
1333CONFIG_CRYPTO_BLKCIPHER=m
1334CONFIG_CRYPTO_HASH=m
1335CONFIG_CRYPTO_MANAGER=m
1336CONFIG_CRYPTO_HMAC=m
1337CONFIG_CRYPTO_XCBC=m
1338CONFIG_CRYPTO_NULL=m
1339CONFIG_CRYPTO_MD4=m
1340CONFIG_CRYPTO_MD5=m
1341CONFIG_CRYPTO_SHA1=m
1342CONFIG_CRYPTO_SHA256=m
1343CONFIG_CRYPTO_SHA512=m
1344CONFIG_CRYPTO_WP512=m
1345CONFIG_CRYPTO_TGR192=m
1346CONFIG_CRYPTO_GF128MUL=m
1347CONFIG_CRYPTO_ECB=m
1348CONFIG_CRYPTO_CBC=m
1349CONFIG_CRYPTO_PCBC=m
1350CONFIG_CRYPTO_LRW=m
1351CONFIG_CRYPTO_DES=m
1352CONFIG_CRYPTO_FCRYPT=m
1353CONFIG_CRYPTO_BLOWFISH=m
1354CONFIG_CRYPTO_TWOFISH=m
1355CONFIG_CRYPTO_TWOFISH_COMMON=m
1356CONFIG_CRYPTO_SERPENT=m
1357CONFIG_CRYPTO_AES=m
1358CONFIG_CRYPTO_CAST5=m
1359CONFIG_CRYPTO_CAST6=m
1360CONFIG_CRYPTO_TEA=m
1361CONFIG_CRYPTO_ARC4=m
1362CONFIG_CRYPTO_KHAZAD=m
1363CONFIG_CRYPTO_ANUBIS=m
1364CONFIG_CRYPTO_DEFLATE=m
1365CONFIG_CRYPTO_MICHAEL_MIC=m
1366CONFIG_CRYPTO_CRC32C=m
1367CONFIG_CRYPTO_CAMELLIA=m
1368CONFIG_CRYPTO_TEST=m
1369
1370#
1371# Hardware crypto devices
1372#
1373
1374#
1375# Library routines
1376#
1377CONFIG_BITREVERSE=y
1378CONFIG_CRC_CCITT=m
1379CONFIG_CRC16=m
1380CONFIG_CRC32=y
1381CONFIG_LIBCRC32C=m
1382CONFIG_ZLIB_INFLATE=y
1383CONFIG_ZLIB_DEFLATE=y
1384CONFIG_PLIST=y
1385CONFIG_HAS_IOMEM=y
1386CONFIG_HAS_IOPORT=y
diff --git a/arch/arm/kernel/Makefile b/arch/arm/kernel/Makefile
index bb28087bf818..593b56509f4f 100644
--- a/arch/arm/kernel/Makefile
+++ b/arch/arm/kernel/Makefile
@@ -7,8 +7,8 @@ AFLAGS_head.o := -DTEXT_OFFSET=$(TEXT_OFFSET)
7# Object file lists. 7# Object file lists.
8 8
9obj-y := compat.o entry-armv.o entry-common.o irq.o \ 9obj-y := compat.o entry-armv.o entry-common.o irq.o \
10 process.o ptrace.o semaphore.o setup.o signal.o sys_arm.o \ 10 process.o ptrace.o semaphore.o setup.o signal.o \
11 time.o traps.o 11 sys_arm.o stacktrace.o time.o traps.o
12 12
13obj-$(CONFIG_ISA_DMA_API) += dma.o 13obj-$(CONFIG_ISA_DMA_API) += dma.o
14obj-$(CONFIG_ARCH_ACORN) += ecard.o 14obj-$(CONFIG_ARCH_ACORN) += ecard.o
diff --git a/arch/arm/kernel/ecard.c b/arch/arm/kernel/ecard.c
index f1c0fb974177..bdbd7da99286 100644
--- a/arch/arm/kernel/ecard.c
+++ b/arch/arm/kernel/ecard.c
@@ -40,6 +40,7 @@
40#include <linux/device.h> 40#include <linux/device.h>
41#include <linux/init.h> 41#include <linux/init.h>
42#include <linux/mutex.h> 42#include <linux/mutex.h>
43#include <linux/kthread.h>
43 44
44#include <asm/dma.h> 45#include <asm/dma.h>
45#include <asm/ecard.h> 46#include <asm/ecard.h>
@@ -50,6 +51,8 @@
50#include <asm/mach/irq.h> 51#include <asm/mach/irq.h>
51#include <asm/tlbflush.h> 52#include <asm/tlbflush.h>
52 53
54#include "ecard.h"
55
53#ifndef CONFIG_ARCH_RPC 56#ifndef CONFIG_ARCH_RPC
54#define HAVE_EXPMASK 57#define HAVE_EXPMASK
55#endif 58#endif
@@ -123,7 +126,7 @@ static void ecard_task_reset(struct ecard_request *req)
123 126
124 res = ec->slot_no == 8 127 res = ec->slot_no == 8
125 ? &ec->resource[ECARD_RES_MEMC] 128 ? &ec->resource[ECARD_RES_MEMC]
126 : ec->type == ECARD_EASI 129 : ec->easi
127 ? &ec->resource[ECARD_RES_EASI] 130 ? &ec->resource[ECARD_RES_EASI]
128 : &ec->resource[ECARD_RES_IOCSYNC]; 131 : &ec->resource[ECARD_RES_IOCSYNC];
129 132
@@ -178,7 +181,7 @@ static void ecard_task_readbytes(struct ecard_request *req)
178 index += 1; 181 index += 1;
179 } 182 }
180 } else { 183 } else {
181 unsigned long base = (ec->type == ECARD_EASI 184 unsigned long base = (ec->easi
182 ? &ec->resource[ECARD_RES_EASI] 185 ? &ec->resource[ECARD_RES_EASI]
183 : &ec->resource[ECARD_RES_IOCSYNC])->start; 186 : &ec->resource[ECARD_RES_IOCSYNC])->start;
184 void __iomem *pbase = (void __iomem *)base; 187 void __iomem *pbase = (void __iomem *)base;
@@ -263,8 +266,6 @@ static int ecard_init_mm(void)
263static int 266static int
264ecard_task(void * unused) 267ecard_task(void * unused)
265{ 268{
266 daemonize("kecardd");
267
268 /* 269 /*
269 * Allocate a mm. We're not a lazy-TLB kernel task since we need 270 * Allocate a mm. We're not a lazy-TLB kernel task since we need
270 * to set page table entries where the user space would be. Note 271 * to set page table entries where the user space would be. Note
@@ -727,7 +728,7 @@ static int ecard_prints(char *buffer, ecard_t *ec)
727 char *start = buffer; 728 char *start = buffer;
728 729
729 buffer += sprintf(buffer, " %d: %s ", ec->slot_no, 730 buffer += sprintf(buffer, " %d: %s ", ec->slot_no,
730 ec->type == ECARD_EASI ? "EASI" : " "); 731 ec->easi ? "EASI" : " ");
731 732
732 if (ec->cid.id == 0) { 733 if (ec->cid.id == 0) {
733 struct in_chunk_dir incd; 734 struct in_chunk_dir incd;
@@ -814,7 +815,7 @@ static struct expansion_card *__init ecard_alloc_card(int type, int slot)
814 } 815 }
815 816
816 ec->slot_no = slot; 817 ec->slot_no = slot;
817 ec->type = type; 818 ec->easi = type == ECARD_EASI;
818 ec->irq = NO_IRQ; 819 ec->irq = NO_IRQ;
819 ec->fiq = NO_IRQ; 820 ec->fiq = NO_IRQ;
820 ec->dma = NO_DMA; 821 ec->dma = NO_DMA;
@@ -825,6 +826,7 @@ static struct expansion_card *__init ecard_alloc_card(int type, int slot)
825 ec->dev.bus = &ecard_bus_type; 826 ec->dev.bus = &ecard_bus_type;
826 ec->dev.dma_mask = &ec->dma_mask; 827 ec->dev.dma_mask = &ec->dma_mask;
827 ec->dma_mask = (u64)0xffffffff; 828 ec->dma_mask = (u64)0xffffffff;
829 ec->dev.coherent_dma_mask = ec->dma_mask;
828 830
829 if (slot < 4) { 831 if (slot < 4) {
830 ec_set_resource(ec, ECARD_RES_MEMC, 832 ec_set_resource(ec, ECARD_RES_MEMC,
@@ -907,7 +909,7 @@ static ssize_t ecard_show_device(struct device *dev, struct device_attribute *at
907static ssize_t ecard_show_type(struct device *dev, struct device_attribute *attr, char *buf) 909static ssize_t ecard_show_type(struct device *dev, struct device_attribute *attr, char *buf)
908{ 910{
909 struct expansion_card *ec = ECARD_DEV(dev); 911 struct expansion_card *ec = ECARD_DEV(dev);
910 return sprintf(buf, "%s\n", ec->type == ECARD_EASI ? "EASI" : "IOC"); 912 return sprintf(buf, "%s\n", ec->easi ? "EASI" : "IOC");
911} 913}
912 914
913static struct device_attribute ecard_dev_attrs[] = { 915static struct device_attribute ecard_dev_attrs[] = {
@@ -1058,13 +1060,14 @@ ecard_probe(int slot, card_type_t type)
1058 */ 1060 */
1059static int __init ecard_init(void) 1061static int __init ecard_init(void)
1060{ 1062{
1061 int slot, irqhw, ret; 1063 struct task_struct *task;
1062 1064 int slot, irqhw;
1063 ret = kernel_thread(ecard_task, NULL, CLONE_KERNEL); 1065
1064 if (ret < 0) { 1066 task = kthread_run(ecard_task, NULL, "kecardd");
1065 printk(KERN_ERR "Ecard: unable to create kernel thread: %d\n", 1067 if (IS_ERR(task)) {
1066 ret); 1068 printk(KERN_ERR "Ecard: unable to create kernel thread: %ld\n",
1067 return ret; 1069 PTR_ERR(task));
1070 return PTR_ERR(task);
1068 } 1071 }
1069 1072
1070 printk("Probing expansion cards\n"); 1073 printk("Probing expansion cards\n");
diff --git a/arch/arm/kernel/ecard.h b/arch/arm/kernel/ecard.h
new file mode 100644
index 000000000000..d7c2dacf935d
--- /dev/null
+++ b/arch/arm/kernel/ecard.h
@@ -0,0 +1,56 @@
1/*
2 * ecard.h
3 *
4 * Copyright 2007 Russell King
5 *
6 * 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 * published by the Free Software Foundation.
9 */
10
11/* Definitions internal to ecard.c - for it's use only!!
12 *
13 * External expansion card header as read from the card
14 */
15struct ex_ecid {
16 unsigned char r_irq:1;
17 unsigned char r_zero:1;
18 unsigned char r_fiq:1;
19 unsigned char r_id:4;
20 unsigned char r_a:1;
21
22 unsigned char r_cd:1;
23 unsigned char r_is:1;
24 unsigned char r_w:2;
25 unsigned char r_r1:4;
26
27 unsigned char r_r2:8;
28
29 unsigned char r_prod[2];
30
31 unsigned char r_manu[2];
32
33 unsigned char r_country;
34
35 unsigned char r_fiqmask;
36 unsigned char r_fiqoff[3];
37
38 unsigned char r_irqmask;
39 unsigned char r_irqoff[3];
40};
41
42/*
43 * Chunk directory entry as read from the card
44 */
45struct ex_chunk_dir {
46 unsigned char r_id;
47 unsigned char r_len[3];
48 unsigned long r_start;
49 union {
50 char string[256];
51 char data[1];
52 } d;
53#define c_id(x) ((x)->r_id)
54#define c_len(x) ((x)->r_len[0]|((x)->r_len[1]<<8)|((x)->r_len[2]<<16))
55#define c_start(x) ((x)->r_start)
56};
diff --git a/arch/arm/kernel/head-nommu.S b/arch/arm/kernel/head-nommu.S
index 0119c0d5f978..5d78ffb8a9a7 100644
--- a/arch/arm/kernel/head-nommu.S
+++ b/arch/arm/kernel/head-nommu.S
@@ -33,7 +33,7 @@
33 * numbers for r1. 33 * numbers for r1.
34 * 34 *
35 */ 35 */
36 __INIT 36 .section ".text.head", "ax"
37 .type stext, %function 37 .type stext, %function
38ENTRY(stext) 38ENTRY(stext)
39 msr cpsr_c, #PSR_F_BIT | PSR_I_BIT | SVC_MODE @ ensure svc mode 39 msr cpsr_c, #PSR_F_BIT | PSR_I_BIT | SVC_MODE @ ensure svc mode
diff --git a/arch/arm/kernel/head.S b/arch/arm/kernel/head.S
index 66db0a9bf0bc..41f98b4ba2ee 100644
--- a/arch/arm/kernel/head.S
+++ b/arch/arm/kernel/head.S
@@ -73,7 +73,7 @@
73 * crap here - that's what the boot loader (or in extreme, well justified 73 * crap here - that's what the boot loader (or in extreme, well justified
74 * circumstances, zImage) is for. 74 * circumstances, zImage) is for.
75 */ 75 */
76 __INIT 76 .section ".text.head", "ax"
77 .type stext, %function 77 .type stext, %function
78ENTRY(stext) 78ENTRY(stext)
79 msr cpsr_c, #PSR_F_BIT | PSR_I_BIT | SVC_MODE @ ensure svc mode 79 msr cpsr_c, #PSR_F_BIT | PSR_I_BIT | SVC_MODE @ ensure svc mode
@@ -257,7 +257,9 @@ __create_page_tables:
257 * Map some ram to cover our .data and .bss areas. 257 * Map some ram to cover our .data and .bss areas.
258 */ 258 */
259 orr r3, r7, #(KERNEL_RAM_PADDR & 0xff000000) 259 orr r3, r7, #(KERNEL_RAM_PADDR & 0xff000000)
260 .if (KERNEL_RAM_PADDR & 0x00f00000)
260 orr r3, r3, #(KERNEL_RAM_PADDR & 0x00f00000) 261 orr r3, r3, #(KERNEL_RAM_PADDR & 0x00f00000)
262 .endif
261 add r0, r4, #(KERNEL_RAM_VADDR & 0xff000000) >> 18 263 add r0, r4, #(KERNEL_RAM_VADDR & 0xff000000) >> 18
262 str r3, [r0, #(KERNEL_RAM_VADDR & 0x00f00000) >> 18]! 264 str r3, [r0, #(KERNEL_RAM_VADDR & 0x00f00000) >> 18]!
263 ldr r6, =(_end - 1) 265 ldr r6, =(_end - 1)
@@ -274,7 +276,9 @@ __create_page_tables:
274 */ 276 */
275 add r0, r4, #PAGE_OFFSET >> 18 277 add r0, r4, #PAGE_OFFSET >> 18
276 orr r6, r7, #(PHYS_OFFSET & 0xff000000) 278 orr r6, r7, #(PHYS_OFFSET & 0xff000000)
277 orr r6, r6, #(PHYS_OFFSET & 0x00e00000) 279 .if (PHYS_OFFSET & 0x00f00000)
280 orr r6, r6, #(PHYS_OFFSET & 0x00f00000)
281 .endif
278 str r6, [r0] 282 str r6, [r0]
279 283
280#ifdef CONFIG_DEBUG_LL 284#ifdef CONFIG_DEBUG_LL
diff --git a/arch/arm/kernel/init_task.c b/arch/arm/kernel/init_task.c
index a00cca0000bd..bd4ef53bc6b9 100644
--- a/arch/arm/kernel/init_task.c
+++ b/arch/arm/kernel/init_task.c
@@ -31,7 +31,7 @@ EXPORT_SYMBOL(init_mm);
31 * The things we do for performance.. 31 * The things we do for performance..
32 */ 32 */
33union thread_union init_thread_union 33union thread_union init_thread_union
34 __attribute__((__section__(".init.task"))) = 34 __attribute__((__section__(".data.init_task"))) =
35 { INIT_THREAD_INFO(init_task) }; 35 { INIT_THREAD_INFO(init_task) };
36 36
37/* 37/*
diff --git a/arch/arm/kernel/module.c b/arch/arm/kernel/module.c
index 1b061583408e..79b7e5cf5416 100644
--- a/arch/arm/kernel/module.c
+++ b/arch/arm/kernel/module.c
@@ -116,8 +116,8 @@ apply_relocate(Elf32_Shdr *sechdrs, const char *strtab, unsigned int symindex,
116 116
117 offset += sym->st_value - loc; 117 offset += sym->st_value - loc;
118 if (offset & 3 || 118 if (offset & 3 ||
119 offset <= (s32)0xfc000000 || 119 offset <= (s32)0xfe000000 ||
120 offset >= (s32)0x04000000) { 120 offset >= (s32)0x02000000) {
121 printk(KERN_ERR 121 printk(KERN_ERR
122 "%s: relocation out of range, section " 122 "%s: relocation out of range, section "
123 "%d reloc %d sym '%s'\n", module->name, 123 "%d reloc %d sym '%s'\n", module->name,
diff --git a/arch/arm/kernel/process.c b/arch/arm/kernel/process.c
index 8afd83d0cbdd..5d6e6523598b 100644
--- a/arch/arm/kernel/process.c
+++ b/arch/arm/kernel/process.c
@@ -27,6 +27,7 @@
27#include <linux/cpu.h> 27#include <linux/cpu.h>
28#include <linux/elfcore.h> 28#include <linux/elfcore.h>
29#include <linux/pm.h> 29#include <linux/pm.h>
30#include <linux/tick.h>
30 31
31#include <asm/leds.h> 32#include <asm/leds.h>
32#include <asm/processor.h> 33#include <asm/processor.h>
@@ -159,9 +160,11 @@ void cpu_idle(void)
159 if (!idle) 160 if (!idle)
160 idle = default_idle; 161 idle = default_idle;
161 leds_event(led_idle_start); 162 leds_event(led_idle_start);
163 tick_nohz_stop_sched_tick();
162 while (!need_resched()) 164 while (!need_resched())
163 idle(); 165 idle();
164 leds_event(led_idle_end); 166 leds_event(led_idle_end);
167 tick_nohz_restart_sched_tick();
165 preempt_enable_no_resched(); 168 preempt_enable_no_resched();
166 schedule(); 169 schedule();
167 preempt_disable(); 170 preempt_disable();
diff --git a/arch/arm/kernel/ptrace.c b/arch/arm/kernel/ptrace.c
index e594b84cca83..13af4006a40f 100644
--- a/arch/arm/kernel/ptrace.c
+++ b/arch/arm/kernel/ptrace.c
@@ -779,8 +779,8 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
779 break; 779 break;
780 780
781 case PTRACE_SET_SYSCALL: 781 case PTRACE_SET_SYSCALL:
782 task_thread_info(child)->syscall = data;
782 ret = 0; 783 ret = 0;
783 child->ptrace_message = data;
784 break; 784 break;
785 785
786#ifdef CONFIG_CRUNCH 786#ifdef CONFIG_CRUNCH
@@ -817,7 +817,7 @@ asmlinkage int syscall_trace(int why, struct pt_regs *regs, int scno)
817 ip = regs->ARM_ip; 817 ip = regs->ARM_ip;
818 regs->ARM_ip = why; 818 regs->ARM_ip = why;
819 819
820 current->ptrace_message = scno; 820 current_thread_info()->syscall = scno;
821 821
822 /* the 0x80 provides a way for the tracing parent to distinguish 822 /* the 0x80 provides a way for the tracing parent to distinguish
823 between a syscall stop and SIGTRAP delivery */ 823 between a syscall stop and SIGTRAP delivery */
@@ -834,5 +834,5 @@ asmlinkage int syscall_trace(int why, struct pt_regs *regs, int scno)
834 } 834 }
835 regs->ARM_ip = ip; 835 regs->ARM_ip = ip;
836 836
837 return current->ptrace_message; 837 return current_thread_info()->syscall;
838} 838}
diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c
index 070bcb7a6306..1b76d87fa335 100644
--- a/arch/arm/kernel/smp.c
+++ b/arch/arm/kernel/smp.c
@@ -486,7 +486,7 @@ static void ipi_timer(void)
486} 486}
487 487
488#ifdef CONFIG_LOCAL_TIMERS 488#ifdef CONFIG_LOCAL_TIMERS
489asmlinkage void do_local_timer(struct pt_regs *regs) 489asmlinkage void __exception do_local_timer(struct pt_regs *regs)
490{ 490{
491 struct pt_regs *old_regs = set_irq_regs(regs); 491 struct pt_regs *old_regs = set_irq_regs(regs);
492 int cpu = smp_processor_id(); 492 int cpu = smp_processor_id();
@@ -551,7 +551,7 @@ static void ipi_cpu_stop(unsigned int cpu)
551 * 551 *
552 * Bit 0 - Inter-processor function call 552 * Bit 0 - Inter-processor function call
553 */ 553 */
554asmlinkage void do_IPI(struct pt_regs *regs) 554asmlinkage void __exception do_IPI(struct pt_regs *regs)
555{ 555{
556 unsigned int cpu = smp_processor_id(); 556 unsigned int cpu = smp_processor_id();
557 struct ipi_data *ipi = &per_cpu(ipi_data, cpu); 557 struct ipi_data *ipi = &per_cpu(ipi_data, cpu);
diff --git a/arch/arm/kernel/stacktrace.c b/arch/arm/kernel/stacktrace.c
new file mode 100644
index 000000000000..77ef35efaa8d
--- /dev/null
+++ b/arch/arm/kernel/stacktrace.c
@@ -0,0 +1,73 @@
1#include <linux/sched.h>
2#include <linux/stacktrace.h>
3
4#include "stacktrace.h"
5
6int walk_stackframe(unsigned long fp, unsigned long low, unsigned long high,
7 int (*fn)(struct stackframe *, void *), void *data)
8{
9 struct stackframe *frame;
10
11 do {
12 /*
13 * Check current frame pointer is within bounds
14 */
15 if ((fp - 12) < low || fp + 4 >= high)
16 break;
17
18 frame = (struct stackframe *)(fp - 12);
19
20 if (fn(frame, data))
21 break;
22
23 /*
24 * Update the low bound - the next frame must always
25 * be at a higher address than the current frame.
26 */
27 low = fp + 4;
28 fp = frame->fp;
29 } while (fp);
30
31 return 0;
32}
33
34#ifdef CONFIG_STACKTRACE
35struct stack_trace_data {
36 struct stack_trace *trace;
37 unsigned int skip;
38};
39
40static int save_trace(struct stackframe *frame, void *d)
41{
42 struct stack_trace_data *data = d;
43 struct stack_trace *trace = data->trace;
44
45 if (data->skip) {
46 data->skip--;
47 return 0;
48 }
49
50 trace->entries[trace->nr_entries++] = frame->lr;
51
52 return trace->nr_entries >= trace->max_entries;
53}
54
55void save_stack_trace(struct stack_trace *trace, struct task_struct *task)
56{
57 struct stack_trace_data data;
58 unsigned long fp, base;
59
60 data.trace = trace;
61 data.skip = trace->skip;
62
63 if (task) {
64 base = (unsigned long)task_stack_page(task);
65 fp = 0; /* FIXME */
66 } else {
67 base = (unsigned long)task_stack_page(current);
68 asm("mov %0, fp" : "=r" (fp));
69 }
70
71 walk_stackframe(fp, base, base + THREAD_SIZE, save_trace, &data);
72}
73#endif
diff --git a/arch/arm/kernel/stacktrace.h b/arch/arm/kernel/stacktrace.h
new file mode 100644
index 000000000000..e9fd20cb5662
--- /dev/null
+++ b/arch/arm/kernel/stacktrace.h
@@ -0,0 +1,9 @@
1struct stackframe {
2 unsigned long fp;
3 unsigned long sp;
4 unsigned long lr;
5 unsigned long pc;
6};
7
8int walk_stackframe(unsigned long fp, unsigned long low, unsigned long high,
9 int (*fn)(struct stackframe *, void *), void *data);
diff --git a/arch/arm/kernel/time.c b/arch/arm/kernel/time.c
index f61decb89ba2..d0540e4eaf5b 100644
--- a/arch/arm/kernel/time.c
+++ b/arch/arm/kernel/time.c
@@ -327,6 +327,7 @@ void restore_time_delta(struct timespec *delta, struct timespec *rtc)
327} 327}
328EXPORT_SYMBOL(restore_time_delta); 328EXPORT_SYMBOL(restore_time_delta);
329 329
330#ifndef CONFIG_GENERIC_CLOCKEVENTS
330/* 331/*
331 * Kernel system timer support. 332 * Kernel system timer support.
332 */ 333 */
@@ -340,8 +341,9 @@ void timer_tick(void)
340 update_process_times(user_mode(get_irq_regs())); 341 update_process_times(user_mode(get_irq_regs()));
341#endif 342#endif
342} 343}
344#endif
343 345
344#ifdef CONFIG_PM 346#if defined(CONFIG_PM) && !defined(CONFIG_GENERIC_CLOCKEVENTS)
345static int timer_suspend(struct sys_device *dev, pm_message_t state) 347static int timer_suspend(struct sys_device *dev, pm_message_t state)
346{ 348{
347 struct sys_timer *timer = container_of(dev, struct sys_timer, dev); 349 struct sys_timer *timer = container_of(dev, struct sys_timer, dev);
diff --git a/arch/arm/kernel/traps.c b/arch/arm/kernel/traps.c
index 6055ab4b58d9..f05e66b0f868 100644
--- a/arch/arm/kernel/traps.c
+++ b/arch/arm/kernel/traps.c
@@ -286,6 +286,7 @@ asmlinkage void __exception do_undefinstr(struct pt_regs *regs)
286 struct undef_hook *hook; 286 struct undef_hook *hook;
287 siginfo_t info; 287 siginfo_t info;
288 void __user *pc; 288 void __user *pc;
289 unsigned long flags;
289 290
290 /* 291 /*
291 * According to the ARM ARM, PC is 2 or 4 bytes ahead, 292 * According to the ARM ARM, PC is 2 or 4 bytes ahead,
@@ -304,7 +305,7 @@ asmlinkage void __exception do_undefinstr(struct pt_regs *regs)
304 get_user(instr, (u32 __user *)pc); 305 get_user(instr, (u32 __user *)pc);
305 } 306 }
306 307
307 spin_lock_irq(&undef_lock); 308 spin_lock_irqsave(&undef_lock, flags);
308 list_for_each_entry(hook, &undef_hook, node) { 309 list_for_each_entry(hook, &undef_hook, node) {
309 if ((instr & hook->instr_mask) == hook->instr_val && 310 if ((instr & hook->instr_mask) == hook->instr_val &&
310 (regs->ARM_cpsr & hook->cpsr_mask) == hook->cpsr_val) { 311 (regs->ARM_cpsr & hook->cpsr_mask) == hook->cpsr_val) {
@@ -314,7 +315,7 @@ asmlinkage void __exception do_undefinstr(struct pt_regs *regs)
314 } 315 }
315 } 316 }
316 } 317 }
317 spin_unlock_irq(&undef_lock); 318 spin_unlock_irqrestore(&undef_lock, flags);
318 319
319#ifdef CONFIG_DEBUG_USER 320#ifdef CONFIG_DEBUG_USER
320 if (user_debug & UDBG_UNDEFINED) { 321 if (user_debug & UDBG_UNDEFINED) {
diff --git a/arch/arm/kernel/vmlinux.lds.S b/arch/arm/kernel/vmlinux.lds.S
index b295f6a85cf1..e4156e7868ce 100644
--- a/arch/arm/kernel/vmlinux.lds.S
+++ b/arch/arm/kernel/vmlinux.lds.S
@@ -23,11 +23,15 @@ SECTIONS
23#else 23#else
24 . = PAGE_OFFSET + TEXT_OFFSET; 24 . = PAGE_OFFSET + TEXT_OFFSET;
25#endif 25#endif
26 .init : { /* Init code and data */ 26 .text.head : {
27 _stext = .; 27 _stext = .;
28 _sinittext = .; 28 _sinittext = .;
29 *(.text.head)
30 }
31
32 .init : { /* Init code and data */
29 *(.init.text) 33 *(.init.text)
30 _einittext = .; 34 _einittext = .;
31 __proc_info_begin = .; 35 __proc_info_begin = .;
32 *(.proc.info.init) 36 *(.proc.info.init)
33 __proc_info_end = .; 37 __proc_info_end = .;
@@ -59,7 +63,7 @@ SECTIONS
59 usr/built-in.o(.init.ramfs) 63 usr/built-in.o(.init.ramfs)
60 __initramfs_end = .; 64 __initramfs_end = .;
61#endif 65#endif
62 . = ALIGN(64); 66 . = ALIGN(4096);
63 __per_cpu_start = .; 67 __per_cpu_start = .;
64 *(.data.percpu) 68 *(.data.percpu)
65 __per_cpu_end = .; 69 __per_cpu_end = .;
@@ -119,7 +123,7 @@ SECTIONS
119 * first, the init task union, aligned 123 * first, the init task union, aligned
120 * to an 8192 byte boundary. 124 * to an 8192 byte boundary.
121 */ 125 */
122 *(.init.task) 126 *(.data.init_task)
123 127
124#ifdef CONFIG_XIP_KERNEL 128#ifdef CONFIG_XIP_KERNEL
125 . = ALIGN(4096); 129 . = ALIGN(4096);
diff --git a/arch/arm/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig
index bf0d96272e3a..e238ad8cfd8f 100644
--- a/arch/arm/mach-at91/Kconfig
+++ b/arch/arm/mach-at91/Kconfig
@@ -81,6 +81,13 @@ config MACH_KB9200
81 Select this if you are using KwikByte's KB920x board. 81 Select this if you are using KwikByte's KB920x board.
82 <http://kwikbyte.com/KB9202_description_new.htm> 82 <http://kwikbyte.com/KB9202_description_new.htm>
83 83
84config MACH_PICOTUX2XX
85 bool "picotux 200"
86 depends on ARCH_AT91RM9200
87 help
88 Select this if you are using a picotux 200.
89 <http://www.picotux.com/>
90
84config MACH_KAFA 91config MACH_KAFA
85 bool "Sperry-Sun KAFA board" 92 bool "Sperry-Sun KAFA board"
86 depends on ARCH_AT91RM9200 93 depends on ARCH_AT91RM9200
diff --git a/arch/arm/mach-at91/Makefile b/arch/arm/mach-at91/Makefile
index 05de6cdc88f1..a412ae18a421 100644
--- a/arch/arm/mach-at91/Makefile
+++ b/arch/arm/mach-at91/Makefile
@@ -25,6 +25,7 @@ obj-$(CONFIG_MACH_CARMEVA) += board-carmeva.o
25obj-$(CONFIG_MACH_KB9200) += board-kb9202.o 25obj-$(CONFIG_MACH_KB9200) += board-kb9202.o
26obj-$(CONFIG_MACH_ATEB9200) += board-eb9200.o 26obj-$(CONFIG_MACH_ATEB9200) += board-eb9200.o
27obj-$(CONFIG_MACH_KAFA) += board-kafa.o 27obj-$(CONFIG_MACH_KAFA) += board-kafa.o
28obj-$(CONFIG_MACH_PICOTUX2XX) += board-picotux200.o
28 29
29# AT91SAM9260 board-specific support 30# AT91SAM9260 board-specific support
30obj-$(CONFIG_MACH_AT91SAM9260EK) += board-sam9260ek.o 31obj-$(CONFIG_MACH_AT91SAM9260EK) += board-sam9260ek.o
diff --git a/arch/arm/mach-at91/at91rm9200.c b/arch/arm/mach-at91/at91rm9200.c
index 2ddcdd69df7d..2cad2bf864be 100644
--- a/arch/arm/mach-at91/at91rm9200.c
+++ b/arch/arm/mach-at91/at91rm9200.c
@@ -117,6 +117,21 @@ static struct clk pioD_clk = {
117 .pmc_mask = 1 << AT91RM9200_ID_PIOD, 117 .pmc_mask = 1 << AT91RM9200_ID_PIOD,
118 .type = CLK_TYPE_PERIPHERAL, 118 .type = CLK_TYPE_PERIPHERAL,
119}; 119};
120static struct clk ssc0_clk = {
121 .name = "ssc0_clk",
122 .pmc_mask = 1 << AT91RM9200_ID_SSC0,
123 .type = CLK_TYPE_PERIPHERAL,
124};
125static struct clk ssc1_clk = {
126 .name = "ssc1_clk",
127 .pmc_mask = 1 << AT91RM9200_ID_SSC1,
128 .type = CLK_TYPE_PERIPHERAL,
129};
130static struct clk ssc2_clk = {
131 .name = "ssc2_clk",
132 .pmc_mask = 1 << AT91RM9200_ID_SSC2,
133 .type = CLK_TYPE_PERIPHERAL,
134};
120static struct clk tc0_clk = { 135static struct clk tc0_clk = {
121 .name = "tc0_clk", 136 .name = "tc0_clk",
122 .pmc_mask = 1 << AT91RM9200_ID_TC0, 137 .pmc_mask = 1 << AT91RM9200_ID_TC0,
@@ -161,7 +176,9 @@ static struct clk *periph_clocks[] __initdata = {
161 &udc_clk, 176 &udc_clk,
162 &twi_clk, 177 &twi_clk,
163 &spi_clk, 178 &spi_clk,
164 // ssc 0 .. ssc2 179 &ssc0_clk,
180 &ssc1_clk,
181 &ssc2_clk,
165 &tc0_clk, 182 &tc0_clk,
166 &tc1_clk, 183 &tc1_clk,
167 &tc2_clk, 184 &tc2_clk,
diff --git a/arch/arm/mach-at91/at91sam9260.c b/arch/arm/mach-at91/at91sam9260.c
index 6ea41d8266cb..e47381e8aaba 100644
--- a/arch/arm/mach-at91/at91sam9260.c
+++ b/arch/arm/mach-at91/at91sam9260.c
@@ -119,6 +119,11 @@ static struct clk spi1_clk = {
119 .pmc_mask = 1 << AT91SAM9260_ID_SPI1, 119 .pmc_mask = 1 << AT91SAM9260_ID_SPI1,
120 .type = CLK_TYPE_PERIPHERAL, 120 .type = CLK_TYPE_PERIPHERAL,
121}; 121};
122static struct clk ssc_clk = {
123 .name = "ssc_clk",
124 .pmc_mask = 1 << AT91SAM9260_ID_SSC,
125 .type = CLK_TYPE_PERIPHERAL,
126};
122static struct clk tc0_clk = { 127static struct clk tc0_clk = {
123 .name = "tc0_clk", 128 .name = "tc0_clk",
124 .pmc_mask = 1 << AT91SAM9260_ID_TC0, 129 .pmc_mask = 1 << AT91SAM9260_ID_TC0,
@@ -193,7 +198,7 @@ static struct clk *periph_clocks[] __initdata = {
193 &twi_clk, 198 &twi_clk,
194 &spi0_clk, 199 &spi0_clk,
195 &spi1_clk, 200 &spi1_clk,
196 // ssc 201 &ssc_clk,
197 &tc0_clk, 202 &tc0_clk,
198 &tc1_clk, 203 &tc1_clk,
199 &tc2_clk, 204 &tc2_clk,
diff --git a/arch/arm/mach-at91/at91sam9261.c b/arch/arm/mach-at91/at91sam9261.c
index 784d1e682d6d..dfe8c39c9fb9 100644
--- a/arch/arm/mach-at91/at91sam9261.c
+++ b/arch/arm/mach-at91/at91sam9261.c
@@ -97,6 +97,21 @@ static struct clk spi1_clk = {
97 .pmc_mask = 1 << AT91SAM9261_ID_SPI1, 97 .pmc_mask = 1 << AT91SAM9261_ID_SPI1,
98 .type = CLK_TYPE_PERIPHERAL, 98 .type = CLK_TYPE_PERIPHERAL,
99}; 99};
100static struct clk ssc0_clk = {
101 .name = "ssc0_clk",
102 .pmc_mask = 1 << AT91SAM9261_ID_SSC0,
103 .type = CLK_TYPE_PERIPHERAL,
104};
105static struct clk ssc1_clk = {
106 .name = "ssc1_clk",
107 .pmc_mask = 1 << AT91SAM9261_ID_SSC1,
108 .type = CLK_TYPE_PERIPHERAL,
109};
110static struct clk ssc2_clk = {
111 .name = "ssc2_clk",
112 .pmc_mask = 1 << AT91SAM9261_ID_SSC2,
113 .type = CLK_TYPE_PERIPHERAL,
114};
100static struct clk tc0_clk = { 115static struct clk tc0_clk = {
101 .name = "tc0_clk", 116 .name = "tc0_clk",
102 .pmc_mask = 1 << AT91SAM9261_ID_TC0, 117 .pmc_mask = 1 << AT91SAM9261_ID_TC0,
@@ -135,7 +150,9 @@ static struct clk *periph_clocks[] __initdata = {
135 &twi_clk, 150 &twi_clk,
136 &spi0_clk, 151 &spi0_clk,
137 &spi1_clk, 152 &spi1_clk,
138 // ssc 0 .. ssc2 153 &ssc0_clk,
154 &ssc1_clk,
155 &ssc2_clk,
139 &tc0_clk, 156 &tc0_clk,
140 &tc1_clk, 157 &tc1_clk,
141 &tc2_clk, 158 &tc2_clk,
diff --git a/arch/arm/mach-at91/at91sam9261_devices.c b/arch/arm/mach-at91/at91sam9261_devices.c
index e1504766fd64..8e781997716a 100644
--- a/arch/arm/mach-at91/at91sam9261_devices.c
+++ b/arch/arm/mach-at91/at91sam9261_devices.c
@@ -430,9 +430,9 @@ void __init at91_add_device_spi(struct spi_board_info *devices, int nr_devices)
430 * LCD Controller 430 * LCD Controller
431 * -------------------------------------------------------------------- */ 431 * -------------------------------------------------------------------- */
432 432
433#if defined(CONFIG_FB_AT91) || defined(CONFIG_FB_AT91_MODULE) 433#if defined(CONFIG_FB_ATMEL) || defined(CONFIG_FB_ATMEL_MODULE)
434static u64 lcdc_dmamask = 0xffffffffUL; 434static u64 lcdc_dmamask = 0xffffffffUL;
435static struct at91fb_info lcdc_data; 435static struct atmel_lcdfb_info lcdc_data;
436 436
437static struct resource lcdc_resources[] = { 437static struct resource lcdc_resources[] = {
438 [0] = { 438 [0] = {
@@ -455,7 +455,7 @@ static struct resource lcdc_resources[] = {
455}; 455};
456 456
457static struct platform_device at91_lcdc_device = { 457static struct platform_device at91_lcdc_device = {
458 .name = "at91-fb", 458 .name = "atmel_lcdfb",
459 .id = 0, 459 .id = 0,
460 .dev = { 460 .dev = {
461 .dma_mask = &lcdc_dmamask, 461 .dma_mask = &lcdc_dmamask,
@@ -466,7 +466,7 @@ static struct platform_device at91_lcdc_device = {
466 .num_resources = ARRAY_SIZE(lcdc_resources), 466 .num_resources = ARRAY_SIZE(lcdc_resources),
467}; 467};
468 468
469void __init at91_add_device_lcdc(struct at91fb_info *data) 469void __init at91_add_device_lcdc(struct atmel_lcdfb_info *data)
470{ 470{
471 if (!data) { 471 if (!data) {
472 return; 472 return;
@@ -499,7 +499,7 @@ void __init at91_add_device_lcdc(struct at91fb_info *data)
499 platform_device_register(&at91_lcdc_device); 499 platform_device_register(&at91_lcdc_device);
500} 500}
501#else 501#else
502void __init at91_add_device_lcdc(struct at91fb_info *data) {} 502void __init at91_add_device_lcdc(struct atmel_lcdfb_info *data) {}
503#endif 503#endif
504 504
505 505
diff --git a/arch/arm/mach-at91/at91sam9263.c b/arch/arm/mach-at91/at91sam9263.c
index 0e89a7fca3fa..00e27b177857 100644
--- a/arch/arm/mach-at91/at91sam9263.c
+++ b/arch/arm/mach-at91/at91sam9263.c
@@ -87,6 +87,11 @@ static struct clk mmc1_clk = {
87 .pmc_mask = 1 << AT91SAM9263_ID_MCI1, 87 .pmc_mask = 1 << AT91SAM9263_ID_MCI1,
88 .type = CLK_TYPE_PERIPHERAL, 88 .type = CLK_TYPE_PERIPHERAL,
89}; 89};
90static struct clk can_clk = {
91 .name = "can_clk",
92 .pmc_mask = 1 << AT91SAM9263_ID_CAN,
93 .type = CLK_TYPE_PERIPHERAL,
94};
90static struct clk twi_clk = { 95static struct clk twi_clk = {
91 .name = "twi_clk", 96 .name = "twi_clk",
92 .pmc_mask = 1 << AT91SAM9263_ID_TWI, 97 .pmc_mask = 1 << AT91SAM9263_ID_TWI,
@@ -102,16 +107,46 @@ static struct clk spi1_clk = {
102 .pmc_mask = 1 << AT91SAM9263_ID_SPI1, 107 .pmc_mask = 1 << AT91SAM9263_ID_SPI1,
103 .type = CLK_TYPE_PERIPHERAL, 108 .type = CLK_TYPE_PERIPHERAL,
104}; 109};
110static struct clk ssc0_clk = {
111 .name = "ssc0_clk",
112 .pmc_mask = 1 << AT91SAM9263_ID_SSC0,
113 .type = CLK_TYPE_PERIPHERAL,
114};
115static struct clk ssc1_clk = {
116 .name = "ssc1_clk",
117 .pmc_mask = 1 << AT91SAM9263_ID_SSC1,
118 .type = CLK_TYPE_PERIPHERAL,
119};
120static struct clk ac97_clk = {
121 .name = "ac97_clk",
122 .pmc_mask = 1 << AT91SAM9263_ID_AC97C,
123 .type = CLK_TYPE_PERIPHERAL,
124};
105static struct clk tcb_clk = { 125static struct clk tcb_clk = {
106 .name = "tcb_clk", 126 .name = "tcb_clk",
107 .pmc_mask = 1 << AT91SAM9263_ID_TCB, 127 .pmc_mask = 1 << AT91SAM9263_ID_TCB,
108 .type = CLK_TYPE_PERIPHERAL, 128 .type = CLK_TYPE_PERIPHERAL,
109}; 129};
130static struct clk pwmc_clk = {
131 .name = "pwmc_clk",
132 .pmc_mask = 1 << AT91SAM9263_ID_PWMC,
133 .type = CLK_TYPE_PERIPHERAL,
134};
110static struct clk macb_clk = { 135static struct clk macb_clk = {
111 .name = "macb_clk", 136 .name = "macb_clk",
112 .pmc_mask = 1 << AT91SAM9263_ID_EMAC, 137 .pmc_mask = 1 << AT91SAM9263_ID_EMAC,
113 .type = CLK_TYPE_PERIPHERAL, 138 .type = CLK_TYPE_PERIPHERAL,
114}; 139};
140static struct clk dma_clk = {
141 .name = "dma_clk",
142 .pmc_mask = 1 << AT91SAM9263_ID_DMA,
143 .type = CLK_TYPE_PERIPHERAL,
144};
145static struct clk twodge_clk = {
146 .name = "2dge_clk",
147 .pmc_mask = 1 << AT91SAM9263_ID_2DGE,
148 .type = CLK_TYPE_PERIPHERAL,
149};
115static struct clk udc_clk = { 150static struct clk udc_clk = {
116 .name = "udc_clk", 151 .name = "udc_clk",
117 .pmc_mask = 1 << AT91SAM9263_ID_UDP, 152 .pmc_mask = 1 << AT91SAM9263_ID_UDP,
@@ -142,20 +177,21 @@ static struct clk *periph_clocks[] __initdata = {
142 &usart2_clk, 177 &usart2_clk,
143 &mmc0_clk, 178 &mmc0_clk,
144 &mmc1_clk, 179 &mmc1_clk,
145 // can 180 &can_clk,
146 &twi_clk, 181 &twi_clk,
147 &spi0_clk, 182 &spi0_clk,
148 &spi1_clk, 183 &spi1_clk,
149 // ssc0 .. ssc1 184 &ssc0_clk,
150 // ac97 185 &ssc1_clk,
186 &ac97_clk,
151 &tcb_clk, 187 &tcb_clk,
152 // pwmc 188 &pwmc_clk,
153 &macb_clk, 189 &macb_clk,
154 // 2dge 190 &twodge_clk,
155 &udc_clk, 191 &udc_clk,
156 &isi_clk, 192 &isi_clk,
157 &lcdc_clk, 193 &lcdc_clk,
158 // dma 194 &dma_clk,
159 &ohci_clk, 195 &ohci_clk,
160 // irq0 .. irq1 196 // irq0 .. irq1
161}; 197};
diff --git a/arch/arm/mach-at91/at91sam9263_devices.c b/arch/arm/mach-at91/at91sam9263_devices.c
index b77121f27f34..2b2e18a67128 100644
--- a/arch/arm/mach-at91/at91sam9263_devices.c
+++ b/arch/arm/mach-at91/at91sam9263_devices.c
@@ -573,6 +573,130 @@ void __init at91_add_device_spi(struct spi_board_info *devices, int nr_devices)
573 573
574 574
575/* -------------------------------------------------------------------- 575/* --------------------------------------------------------------------
576 * AC97
577 * -------------------------------------------------------------------- */
578
579#if defined(CONFIG_SND_AT91_AC97) || defined(CONFIG_SND_AT91_AC97_MODULE)
580static u64 ac97_dmamask = 0xffffffffUL;
581static struct atmel_ac97_data ac97_data;
582
583static struct resource ac97_resources[] = {
584 [0] = {
585 .start = AT91SAM9263_BASE_AC97C,
586 .end = AT91SAM9263_BASE_AC97C + SZ_16K - 1,
587 .flags = IORESOURCE_MEM,
588 },
589 [1] = {
590 .start = AT91SAM9263_ID_AC97C,
591 .end = AT91SAM9263_ID_AC97C,
592 .flags = IORESOURCE_IRQ,
593 },
594};
595
596static struct platform_device at91sam9263_ac97_device = {
597 .name = "ac97c",
598 .id = 1,
599 .dev = {
600 .dma_mask = &ac97_dmamask,
601 .coherent_dma_mask = 0xffffffff,
602 .platform_data = &ac97_data,
603 },
604 .resource = ac97_resources,
605 .num_resources = ARRAY_SIZE(ac97_resources),
606};
607
608void __init at91_add_device_ac97(struct atmel_ac97_data *data)
609{
610 if (!data)
611 return;
612
613 at91_set_A_periph(AT91_PIN_PB0, 0); /* AC97FS */
614 at91_set_A_periph(AT91_PIN_PB1, 0); /* AC97CK */
615 at91_set_A_periph(AT91_PIN_PB2, 0); /* AC97TX */
616 at91_set_A_periph(AT91_PIN_PB3, 0); /* AC97RX */
617
618 /* reset */
619 if (data->reset_pin)
620 at91_set_gpio_output(data->reset_pin, 0);
621
622 ac97_data = *ek_data;
623 platform_device_register(&at91sam9263_ac97_device);
624}
625#else
626void __init at91_add_device_ac97(struct atmel_ac97_data *data) {}
627#endif
628
629
630/* --------------------------------------------------------------------
631 * LCD Controller
632 * -------------------------------------------------------------------- */
633
634#if defined(CONFIG_FB_ATMEL) || defined(CONFIG_FB_ATMEL_MODULE)
635static u64 lcdc_dmamask = 0xffffffffUL;
636static struct atmel_lcdfb_info lcdc_data;
637
638static struct resource lcdc_resources[] = {
639 [0] = {
640 .start = AT91SAM9263_LCDC_BASE,
641 .end = AT91SAM9263_LCDC_BASE + SZ_4K - 1,
642 .flags = IORESOURCE_MEM,
643 },
644 [1] = {
645 .start = AT91SAM9263_ID_LCDC,
646 .end = AT91SAM9263_ID_LCDC,
647 .flags = IORESOURCE_IRQ,
648 },
649};
650
651static struct platform_device at91_lcdc_device = {
652 .name = "atmel_lcdfb",
653 .id = 0,
654 .dev = {
655 .dma_mask = &lcdc_dmamask,
656 .coherent_dma_mask = 0xffffffff,
657 .platform_data = &lcdc_data,
658 },
659 .resource = lcdc_resources,
660 .num_resources = ARRAY_SIZE(lcdc_resources),
661};
662
663void __init at91_add_device_lcdc(struct atmel_lcdfb_info *data)
664{
665 if (!data)
666 return;
667
668 at91_set_A_periph(AT91_PIN_PC1, 0); /* LCDHSYNC */
669 at91_set_A_periph(AT91_PIN_PC2, 0); /* LCDDOTCK */
670 at91_set_A_periph(AT91_PIN_PC3, 0); /* LCDDEN */
671 at91_set_B_periph(AT91_PIN_PB9, 0); /* LCDCC */
672 at91_set_A_periph(AT91_PIN_PC6, 0); /* LCDD2 */
673 at91_set_A_periph(AT91_PIN_PC7, 0); /* LCDD3 */
674 at91_set_A_periph(AT91_PIN_PC8, 0); /* LCDD4 */
675 at91_set_A_periph(AT91_PIN_PC9, 0); /* LCDD5 */
676 at91_set_A_periph(AT91_PIN_PC10, 0); /* LCDD6 */
677 at91_set_A_periph(AT91_PIN_PC11, 0); /* LCDD7 */
678 at91_set_A_periph(AT91_PIN_PC14, 0); /* LCDD10 */
679 at91_set_A_periph(AT91_PIN_PC15, 0); /* LCDD11 */
680 at91_set_A_periph(AT91_PIN_PC16, 0); /* LCDD12 */
681 at91_set_B_periph(AT91_PIN_PC12, 0); /* LCDD13 */
682 at91_set_A_periph(AT91_PIN_PC18, 0); /* LCDD14 */
683 at91_set_A_periph(AT91_PIN_PC19, 0); /* LCDD15 */
684 at91_set_A_periph(AT91_PIN_PC22, 0); /* LCDD18 */
685 at91_set_A_periph(AT91_PIN_PC23, 0); /* LCDD19 */
686 at91_set_A_periph(AT91_PIN_PC24, 0); /* LCDD20 */
687 at91_set_B_periph(AT91_PIN_PC17, 0); /* LCDD21 */
688 at91_set_A_periph(AT91_PIN_PC26, 0); /* LCDD22 */
689 at91_set_A_periph(AT91_PIN_PC27, 0); /* LCDD23 */
690
691 lcdc_data = *data;
692 platform_device_register(&at91_lcdc_device);
693}
694#else
695void __init at91_add_device_lcdc(struct atmel_lcdfb_info *data) {}
696#endif
697
698
699/* --------------------------------------------------------------------
576 * LEDs 700 * LEDs
577 * -------------------------------------------------------------------- */ 701 * -------------------------------------------------------------------- */
578 702
diff --git a/arch/arm/mach-at91/board-picotux200.c b/arch/arm/mach-at91/board-picotux200.c
new file mode 100644
index 000000000000..49cfe7ab4a85
--- /dev/null
+++ b/arch/arm/mach-at91/board-picotux200.c
@@ -0,0 +1,166 @@
1/*
2 * linux/arch/arm/mach-at91/board-picotux200.c
3 *
4 * Copyright (C) 2005 SAN People
5 * Copyright (C) 2007 Kleinhenz Elektronik GmbH
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
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */
21
22#include <linux/types.h>
23#include <linux/init.h>
24#include <linux/mm.h>
25#include <linux/module.h>
26#include <linux/platform_device.h>
27#include <linux/spi/spi.h>
28#include <linux/mtd/physmap.h>
29
30#include <asm/hardware.h>
31#include <asm/setup.h>
32#include <asm/mach-types.h>
33#include <asm/irq.h>
34
35#include <asm/mach/arch.h>
36#include <asm/mach/map.h>
37#include <asm/mach/irq.h>
38
39#include <asm/arch/board.h>
40#include <asm/arch/gpio.h>
41#include <asm/arch/at91rm9200_mc.h>
42
43#include "generic.h"
44
45
46/*
47 * Serial port configuration.
48 * 0 .. 3 = USART0 .. USART3
49 * 4 = DBGU
50 */
51static struct at91_uart_config __initdata picotux200_uart_config = {
52 .console_tty = 0, /* ttyS0 */
53 .nr_tty = 2,
54 .tty_map = { 4, 1, -1, -1, -1 } /* ttyS0, ..., ttyS4 */
55};
56
57static void __init picotux200_map_io(void)
58{
59 /* Initialize processor: 18.432 MHz crystal */
60 at91rm9200_initialize(18432000, AT91RM9200_BGA);
61
62 /* Setup the serial ports and console */
63 at91_init_serial(&picotux200_uart_config);
64}
65
66static void __init picotux200_init_irq(void)
67{
68 at91rm9200_init_interrupts(NULL);
69}
70
71static struct at91_eth_data __initdata picotux200_eth_data = {
72 .phy_irq_pin = AT91_PIN_PC4,
73 .is_rmii = 1,
74};
75
76static struct at91_usbh_data __initdata picotux200_usbh_data = {
77 .ports = 1,
78};
79
80// static struct at91_udc_data __initdata picotux200_udc_data = {
81// .vbus_pin = AT91_PIN_PD4,
82// .pullup_pin = AT91_PIN_PD5,
83// };
84
85static struct at91_mmc_data __initdata picotux200_mmc_data = {
86 .det_pin = AT91_PIN_PB27,
87 .slot_b = 0,
88 .wire4 = 1,
89 .wp_pin = AT91_PIN_PA17,
90};
91
92// static struct spi_board_info picotux200_spi_devices[] = {
93// { /* DataFlash chip */
94// .modalias = "mtd_dataflash",
95// .chip_select = 0,
96// .max_speed_hz = 15 * 1000 * 1000,
97// },
98// #ifdef CONFIG_MTD_AT91_DATAFLASH_CARD
99// { /* DataFlash card */
100// .modalias = "mtd_dataflash",
101// .chip_select = 3,
102// .max_speed_hz = 15 * 1000 * 1000,
103// },
104// #endif
105// };
106
107#define PICOTUX200_FLASH_BASE AT91_CHIPSELECT_0
108#define PICOTUX200_FLASH_SIZE 0x400000
109
110static struct physmap_flash_data picotux200_flash_data = {
111 .width = 2,
112};
113
114static struct resource picotux200_flash_resource = {
115 .start = PICOTUX200_FLASH_BASE,
116 .end = PICOTUX200_FLASH_BASE + PICOTUX200_FLASH_SIZE - 1,
117 .flags = IORESOURCE_MEM,
118};
119
120static struct platform_device picotux200_flash = {
121 .name = "physmap-flash",
122 .id = 0,
123 .dev = {
124 .platform_data = &picotux200_flash_data,
125 },
126 .resource = &picotux200_flash_resource,
127 .num_resources = 1,
128};
129
130static void __init picotux200_board_init(void)
131{
132 /* Serial */
133 at91_add_device_serial();
134 /* Ethernet */
135 at91_add_device_eth(&picotux200_eth_data);
136 /* USB Host */
137 at91_add_device_usbh(&picotux200_usbh_data);
138 /* USB Device */
139 // at91_add_device_udc(&picotux200_udc_data);
140 // at91_set_multi_drive(picotux200_udc_data.pullup_pin, 1); /* pullup_pin is connected to reset */
141 /* I2C */
142 at91_add_device_i2c();
143 /* SPI */
144 // at91_add_device_spi(picotux200_spi_devices, ARRAY_SIZE(picotux200_spi_devices));
145#ifdef CONFIG_MTD_AT91_DATAFLASH_CARD
146 /* DataFlash card */
147 at91_set_gpio_output(AT91_PIN_PB22, 0);
148#else
149 /* MMC */
150 at91_set_gpio_output(AT91_PIN_PB22, 1); /* this MMC card slot can optionally use SPI signaling (CS3). */
151 at91_add_device_mmc(0, &picotux200_mmc_data);
152#endif
153 /* NOR Flash */
154 platform_device_register(&picotux200_flash);
155}
156
157MACHINE_START(PICOTUX2XX, "picotux 200")
158 /* Maintainer: Kleinhenz Elektronik GmbH */
159 .phys_io = AT91_BASE_SYS,
160 .io_pg_offst = (AT91_VA_BASE_SYS >> 18) & 0xfffc,
161 .boot_params = AT91_SDRAM_BASE + 0x100,
162 .timer = &at91rm9200_timer,
163 .map_io = picotux200_map_io,
164 .init_irq = picotux200_init_irq,
165 .init_machine = picotux200_board_init,
166MACHINE_END
diff --git a/arch/arm/mach-at91/board-sam9260ek.c b/arch/arm/mach-at91/board-sam9260ek.c
index 57fb4499d969..65fa532bb4ac 100644
--- a/arch/arm/mach-at91/board-sam9260ek.c
+++ b/arch/arm/mach-at91/board-sam9260ek.c
@@ -104,9 +104,9 @@ static struct spi_board_info ek_spi_devices[] = {
104 }, 104 },
105#endif 105#endif
106#endif 106#endif
107#if defined(CONFIG_SND_AT73C213) 107#if defined(CONFIG_SND_AT73C213) || defined(CONFIG_SND_AT73C213_MODULE)
108 { /* AT73C213 DAC */ 108 { /* AT73C213 DAC */
109 .modalias = "snd_at73c213", 109 .modalias = "at73c213",
110 .chip_select = 0, 110 .chip_select = 0,
111 .max_speed_hz = 10 * 1000 * 1000, 111 .max_speed_hz = 10 * 1000 * 1000,
112 .bus_num = 1, 112 .bus_num = 1,
@@ -118,7 +118,7 @@ static struct spi_board_info ek_spi_devices[] = {
118/* 118/*
119 * MACB Ethernet device 119 * MACB Ethernet device
120 */ 120 */
121static struct __initdata at91_eth_data ek_macb_data = { 121static struct at91_eth_data __initdata ek_macb_data = {
122 .phy_irq_pin = AT91_PIN_PA7, 122 .phy_irq_pin = AT91_PIN_PA7,
123 .is_rmii = 1, 123 .is_rmii = 1,
124}; 124};
@@ -140,7 +140,7 @@ static struct mtd_partition __initdata ek_nand_partition[] = {
140 }, 140 },
141}; 141};
142 142
143static struct mtd_partition *nand_partitions(int size, int *num_partitions) 143static struct mtd_partition * __init nand_partitions(int size, int *num_partitions)
144{ 144{
145 *num_partitions = ARRAY_SIZE(ek_nand_partition); 145 *num_partitions = ARRAY_SIZE(ek_nand_partition);
146 return ek_nand_partition; 146 return ek_nand_partition;
@@ -188,6 +188,8 @@ static void __init ek_board_init(void)
188 at91_add_device_eth(&ek_macb_data); 188 at91_add_device_eth(&ek_macb_data);
189 /* MMC */ 189 /* MMC */
190 at91_add_device_mmc(0, &ek_mmc_data); 190 at91_add_device_mmc(0, &ek_mmc_data);
191 /* I2C */
192 at91_add_device_i2c();
191} 193}
192 194
193MACHINE_START(AT91SAM9260EK, "Atmel AT91SAM9260-EK") 195MACHINE_START(AT91SAM9260EK, "Atmel AT91SAM9260-EK")
diff --git a/arch/arm/mach-at91/board-sam9261ek.c b/arch/arm/mach-at91/board-sam9261ek.c
index b7e772467cf6..bcf71536cc6d 100644
--- a/arch/arm/mach-at91/board-sam9261ek.c
+++ b/arch/arm/mach-at91/board-sam9261ek.c
@@ -25,6 +25,7 @@
25#include <linux/module.h> 25#include <linux/module.h>
26#include <linux/platform_device.h> 26#include <linux/platform_device.h>
27#include <linux/spi/spi.h> 27#include <linux/spi/spi.h>
28#include <linux/spi/ads7846.h>
28#include <linux/dm9000.h> 29#include <linux/dm9000.h>
29 30
30#include <asm/hardware.h> 31#include <asm/hardware.h>
@@ -195,6 +196,41 @@ static struct at91_nand_data __initdata ek_nand_data = {
195}; 196};
196 197
197/* 198/*
199 * ADS7846 Touchscreen
200 */
201#if defined(CONFIG_TOUCHSCREEN_ADS7846) || defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE)
202
203static int ads7843_pendown_state(void)
204{
205 return !at91_get_gpio_value(AT91_PIN_PC2); /* Touchscreen PENIRQ */
206}
207
208static struct ads7846_platform_data ads_info = {
209 .model = 7843,
210 .x_min = 150,
211 .x_max = 3830,
212 .y_min = 190,
213 .y_max = 3830,
214 .vref_delay_usecs = 100,
215 .x_plate_ohms = 450,
216 .y_plate_ohms = 250,
217 .pressure_max = 15000,
218 .debounce_max = 1,
219 .debounce_rep = 0,
220 .debounce_tol = (~0),
221 .get_pendown_state = ads7843_pendown_state,
222};
223
224static void __init ek_add_device_ts(void)
225{
226 at91_set_B_periph(AT91_PIN_PC2, 1); /* External IRQ0, with pullup */
227 at91_set_gpio_input(AT91_PIN_PA11, 1); /* Touchscreen BUSY signal */
228}
229#else
230static void __init ek_add_device_ts(void) {}
231#endif
232
233/*
198 * SPI devices 234 * SPI devices
199 */ 235 */
200static struct spi_board_info ek_spi_devices[] = { 236static struct spi_board_info ek_spi_devices[] = {
@@ -204,6 +240,16 @@ static struct spi_board_info ek_spi_devices[] = {
204 .max_speed_hz = 15 * 1000 * 1000, 240 .max_speed_hz = 15 * 1000 * 1000,
205 .bus_num = 0, 241 .bus_num = 0,
206 }, 242 },
243#if defined(CONFIG_TOUCHSCREEN_ADS7846) || defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE)
244 {
245 .modalias = "ads7846",
246 .chip_select = 2,
247 .max_speed_hz = 125000 * 26, /* (max sample rate @ 3V) * (cmd + data + overhead) */
248 .bus_num = 0,
249 .platform_data = &ads_info,
250 .irq = AT91SAM9261_ID_IRQ0,
251 },
252#endif
207#if defined(CONFIG_MTD_AT91_DATAFLASH_CARD) 253#if defined(CONFIG_MTD_AT91_DATAFLASH_CARD)
208 { /* DataFlash card - jumper (J12) configurable to CS3 or CS0 */ 254 { /* DataFlash card - jumper (J12) configurable to CS3 or CS0 */
209 .modalias = "mtd_dataflash", 255 .modalias = "mtd_dataflash",
@@ -211,9 +257,9 @@ static struct spi_board_info ek_spi_devices[] = {
211 .max_speed_hz = 15 * 1000 * 1000, 257 .max_speed_hz = 15 * 1000 * 1000,
212 .bus_num = 0, 258 .bus_num = 0,
213 }, 259 },
214#elif defined(CONFIG_SND_AT73C213) 260#elif defined(CONFIG_SND_AT73C213) || defined(CONFIG_SND_AT73C213_MODULE)
215 { /* AT73C213 DAC */ 261 { /* AT73C213 DAC */
216 .modalias = "snd_at73c213", 262 .modalias = "at73c213",
217 .chip_select = 3, 263 .chip_select = 3,
218 .max_speed_hz = 10 * 1000 * 1000, 264 .max_speed_hz = 10 * 1000 * 1000,
219 .bus_num = 0, 265 .bus_num = 0,
@@ -241,6 +287,8 @@ static void __init ek_board_init(void)
241#if defined(CONFIG_SPI_ATMEL) || defined(CONFIG_SPI_ATMEL_MODULE) 287#if defined(CONFIG_SPI_ATMEL) || defined(CONFIG_SPI_ATMEL_MODULE)
242 /* SPI */ 288 /* SPI */
243 at91_add_device_spi(ek_spi_devices, ARRAY_SIZE(ek_spi_devices)); 289 at91_add_device_spi(ek_spi_devices, ARRAY_SIZE(ek_spi_devices));
290 /* Touchscreen */
291 ek_add_device_ts();
244#else 292#else
245 /* MMC */ 293 /* MMC */
246 at91_add_device_mmc(0, &ek_mmc_data); 294 at91_add_device_mmc(0, &ek_mmc_data);
diff --git a/arch/arm/mach-at91/board-sam9263ek.c b/arch/arm/mach-at91/board-sam9263ek.c
index 8fdce11a880c..f57458559fb6 100644
--- a/arch/arm/mach-at91/board-sam9263ek.c
+++ b/arch/arm/mach-at91/board-sam9263ek.c
@@ -25,6 +25,7 @@
25#include <linux/module.h> 25#include <linux/module.h>
26#include <linux/platform_device.h> 26#include <linux/platform_device.h>
27#include <linux/spi/spi.h> 27#include <linux/spi/spi.h>
28#include <linux/spi/ads7846.h>
28 29
29#include <asm/hardware.h> 30#include <asm/hardware.h>
30#include <asm/setup.h> 31#include <asm/setup.h>
@@ -86,6 +87,40 @@ static struct at91_udc_data __initdata ek_udc_data = {
86 87
87 88
88/* 89/*
90 * ADS7846 Touchscreen
91 */
92#if defined(CONFIG_TOUCHSCREEN_ADS7846) || defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE)
93static int ads7843_pendown_state(void)
94{
95 return !at91_get_gpio_value(AT91_PIN_PA15); /* Touchscreen PENIRQ */
96}
97
98static struct ads7846_platform_data ads_info = {
99 .model = 7843,
100 .x_min = 150,
101 .x_max = 3830,
102 .y_min = 190,
103 .y_max = 3830,
104 .vref_delay_usecs = 100,
105 .x_plate_ohms = 450,
106 .y_plate_ohms = 250,
107 .pressure_max = 15000,
108 .debounce_max = 1,
109 .debounce_rep = 0,
110 .debounce_tol = (~0),
111 .get_pendown_state = ads7843_pendown_state,
112};
113
114static void __init ek_add_device_ts(void)
115{
116 at91_set_B_periph(AT91_PIN_PA15, 1); /* External IRQ1, with pullup */
117 at91_set_gpio_input(AT91_PIN_PA31, 1); /* Touchscreen BUSY signal */
118}
119#else
120static void __init ek_add_device_ts(void) {}
121#endif
122
123/*
89 * SPI devices. 124 * SPI devices.
90 */ 125 */
91static struct spi_board_info ek_spi_devices[] = { 126static struct spi_board_info ek_spi_devices[] = {
@@ -97,6 +132,16 @@ static struct spi_board_info ek_spi_devices[] = {
97 .bus_num = 0, 132 .bus_num = 0,
98 }, 133 },
99#endif 134#endif
135#if defined(CONFIG_TOUCHSCREEN_ADS7846) || defined(CONFIG_TOUCHSCREEN_ADS7846_MODULE)
136 {
137 .modalias = "ads7846",
138 .chip_select = 3,
139 .max_speed_hz = 125000 * 26, /* (max sample rate @ 3V) * (cmd + data + overhead) */
140 .bus_num = 0,
141 .platform_data = &ads_info,
142 .irq = AT91SAM9263_ID_IRQ1,
143 },
144#endif
100}; 145};
101 146
102 147
@@ -112,6 +157,14 @@ static struct at91_mmc_data __initdata ek_mmc_data = {
112 157
113 158
114/* 159/*
160 * MACB Ethernet device
161 */
162static struct at91_eth_data __initdata ek_macb_data = {
163 .is_rmii = 1,
164};
165
166
167/*
115 * NAND flash 168 * NAND flash
116 */ 169 */
117static struct mtd_partition __initdata ek_nand_partition[] = { 170static struct mtd_partition __initdata ek_nand_partition[] = {
@@ -148,6 +201,14 @@ static struct at91_nand_data __initdata ek_nand_data = {
148}; 201};
149 202
150 203
204/*
205 * AC97
206 */
207static struct atmel_ac97_data ek_ac97_data = {
208 .reset_pin = AT91_PIN_PA13,
209};
210
211
151static void __init ek_board_init(void) 212static void __init ek_board_init(void)
152{ 213{
153 /* Serial */ 214 /* Serial */
@@ -157,11 +218,20 @@ static void __init ek_board_init(void)
157 /* USB Device */ 218 /* USB Device */
158 at91_add_device_udc(&ek_udc_data); 219 at91_add_device_udc(&ek_udc_data);
159 /* SPI */ 220 /* SPI */
221 at91_set_gpio_output(AT91_PIN_PE20, 1); /* select spi0 clock */
160 at91_add_device_spi(ek_spi_devices, ARRAY_SIZE(ek_spi_devices)); 222 at91_add_device_spi(ek_spi_devices, ARRAY_SIZE(ek_spi_devices));
223 /* Touchscreen */
224 ek_add_device_ts();
161 /* MMC */ 225 /* MMC */
162 at91_add_device_mmc(1, &ek_mmc_data); 226 at91_add_device_mmc(1, &ek_mmc_data);
227 /* Ethernet */
228 at91_add_device_eth(&ek_macb_data);
163 /* NAND */ 229 /* NAND */
164 at91_add_device_nand(&ek_nand_data); 230 at91_add_device_nand(&ek_nand_data);
231 /* I2C */
232 at91_add_device_i2c();
233 /* AC97 */
234 at91_add_device_ac97(&ek_ac97_data);
165} 235}
166 236
167MACHINE_START(AT91SAM9263EK, "Atmel AT91SAM9263-EK") 237MACHINE_START(AT91SAM9263EK, "Atmel AT91SAM9263-EK")
diff --git a/arch/arm/mach-at91/pm.c b/arch/arm/mach-at91/pm.c
index b49bfda53d7f..ff8db29e989e 100644
--- a/arch/arm/mach-at91/pm.c
+++ b/arch/arm/mach-at91/pm.c
@@ -201,7 +201,6 @@ error:
201 201
202 202
203static struct pm_ops at91_pm_ops ={ 203static struct pm_ops at91_pm_ops ={
204 .pm_disk_mode = 0,
205 .valid = at91_pm_valid_state, 204 .valid = at91_pm_valid_state,
206 .prepare = at91_pm_prepare, 205 .prepare = at91_pm_prepare,
207 .enter = at91_pm_enter, 206 .enter = at91_pm_enter,
diff --git a/arch/arm/mach-ep93xx/clock.c b/arch/arm/mach-ep93xx/clock.c
index f174d1a3b11c..9d7515c36bff 100644
--- a/arch/arm/mach-ep93xx/clock.c
+++ b/arch/arm/mach-ep93xx/clock.c
@@ -27,6 +27,10 @@ struct clk {
27 u32 enable_mask; 27 u32 enable_mask;
28}; 28};
29 29
30static struct clk clk_uart = {
31 .name = "UARTCLK",
32 .rate = 14745600,
33};
30static struct clk clk_pll1 = { 34static struct clk clk_pll1 = {
31 .name = "pll1", 35 .name = "pll1",
32}; 36};
@@ -50,6 +54,7 @@ static struct clk clk_usb_host = {
50 54
51 55
52static struct clk *clocks[] = { 56static struct clk *clocks[] = {
57 &clk_uart,
53 &clk_pll1, 58 &clk_pll1,
54 &clk_f, 59 &clk_f,
55 &clk_h, 60 &clk_h,
diff --git a/arch/arm/mach-iop13xx/Makefile b/arch/arm/mach-iop13xx/Makefile
index 4185e0586c33..da1609dc0dee 100644
--- a/arch/arm/mach-iop13xx/Makefile
+++ b/arch/arm/mach-iop13xx/Makefile
@@ -7,5 +7,6 @@ obj-$(CONFIG_ARCH_IOP13XX) += setup.o
7obj-$(CONFIG_ARCH_IOP13XX) += irq.o 7obj-$(CONFIG_ARCH_IOP13XX) += irq.o
8obj-$(CONFIG_ARCH_IOP13XX) += pci.o 8obj-$(CONFIG_ARCH_IOP13XX) += pci.o
9obj-$(CONFIG_ARCH_IOP13XX) += io.o 9obj-$(CONFIG_ARCH_IOP13XX) += io.o
10obj-$(CONFIG_ARCH_IOP13XX) += tpmi.o
10obj-$(CONFIG_MACH_IQ81340SC) += iq81340sc.o 11obj-$(CONFIG_MACH_IQ81340SC) += iq81340sc.o
11obj-$(CONFIG_MACH_IQ81340MC) += iq81340mc.o 12obj-$(CONFIG_MACH_IQ81340MC) += iq81340mc.o
diff --git a/arch/arm/mach-iop13xx/io.c b/arch/arm/mach-iop13xx/io.c
index e79a1b62600f..5b22fdeca52c 100644
--- a/arch/arm/mach-iop13xx/io.c
+++ b/arch/arm/mach-iop13xx/io.c
@@ -41,7 +41,7 @@ void * __iomem __iop13xx_io(unsigned long io_addr)
41EXPORT_SYMBOL(__iop13xx_io); 41EXPORT_SYMBOL(__iop13xx_io);
42 42
43void * __iomem __iop13xx_ioremap(unsigned long cookie, size_t size, 43void * __iomem __iop13xx_ioremap(unsigned long cookie, size_t size,
44 unsigned long flags) 44 unsigned int mtype)
45{ 45{
46 void __iomem * retval; 46 void __iomem * retval;
47 47
@@ -61,9 +61,9 @@ void * __iomem __iop13xx_ioremap(unsigned long cookie, size_t size,
61 (cookie - IOP13XX_PCIE_LOWER_MEM_RA)); 61 (cookie - IOP13XX_PCIE_LOWER_MEM_RA));
62 break; 62 break;
63 case IOP13XX_PBI_LOWER_MEM_RA ... IOP13XX_PBI_UPPER_MEM_RA: 63 case IOP13XX_PBI_LOWER_MEM_RA ... IOP13XX_PBI_UPPER_MEM_RA:
64 retval = __ioremap(IOP13XX_PBI_LOWER_MEM_PA + 64 retval = __arm_ioremap(IOP13XX_PBI_LOWER_MEM_PA +
65 (cookie - IOP13XX_PBI_LOWER_MEM_RA), 65 (cookie - IOP13XX_PBI_LOWER_MEM_RA),
66 size, flags); 66 size, mtype);
67 break; 67 break;
68 case IOP13XX_PCIE_LOWER_IO_PA ... IOP13XX_PCIE_UPPER_IO_PA: 68 case IOP13XX_PCIE_LOWER_IO_PA ... IOP13XX_PCIE_UPPER_IO_PA:
69 retval = (void *) IOP13XX_PCIE_IO_PHYS_TO_VIRT(cookie); 69 retval = (void *) IOP13XX_PCIE_IO_PHYS_TO_VIRT(cookie);
@@ -75,7 +75,7 @@ void * __iomem __iop13xx_ioremap(unsigned long cookie, size_t size,
75 retval = (void *) IOP13XX_PMMR_PHYS_TO_VIRT(cookie); 75 retval = (void *) IOP13XX_PMMR_PHYS_TO_VIRT(cookie);
76 break; 76 break;
77 default: 77 default:
78 retval = __ioremap(cookie, size, flags); 78 retval = __arm_ioremap(cookie, size, mtype);
79 } 79 }
80 80
81 return retval; 81 return retval;
diff --git a/arch/arm/mach-iop13xx/iq81340mc.c b/arch/arm/mach-iop13xx/iq81340mc.c
index a519d707571c..268a8d84999c 100644
--- a/arch/arm/mach-iop13xx/iq81340mc.c
+++ b/arch/arm/mach-iop13xx/iq81340mc.c
@@ -75,11 +75,14 @@ static void __init iq81340mc_init(void)
75{ 75{
76 iop13xx_platform_init(); 76 iop13xx_platform_init();
77 iq81340mc_pci_init(); 77 iq81340mc_pci_init();
78 iop13xx_add_tpmi_devices();
78} 79}
79 80
80static void __init iq81340mc_timer_init(void) 81static void __init iq81340mc_timer_init(void)
81{ 82{
82 iop_init_time(400000000); 83 unsigned long bus_freq = iop13xx_core_freq() / iop13xx_xsi_bus_ratio();
84 printk(KERN_DEBUG "%s: bus frequency: %lu\n", __FUNCTION__, bus_freq);
85 iop_init_time(bus_freq);
83} 86}
84 87
85static struct sys_timer iq81340mc_timer = { 88static struct sys_timer iq81340mc_timer = {
diff --git a/arch/arm/mach-iop13xx/iq81340sc.c b/arch/arm/mach-iop13xx/iq81340sc.c
index 0e71fbcabe00..a51ffd2683e5 100644
--- a/arch/arm/mach-iop13xx/iq81340sc.c
+++ b/arch/arm/mach-iop13xx/iq81340sc.c
@@ -77,11 +77,14 @@ static void __init iq81340sc_init(void)
77{ 77{
78 iop13xx_platform_init(); 78 iop13xx_platform_init();
79 iq81340sc_pci_init(); 79 iq81340sc_pci_init();
80 iop13xx_add_tpmi_devices();
80} 81}
81 82
82static void __init iq81340sc_timer_init(void) 83static void __init iq81340sc_timer_init(void)
83{ 84{
84 iop_init_time(400000000); 85 unsigned long bus_freq = iop13xx_core_freq() / iop13xx_xsi_bus_ratio();
86 printk(KERN_DEBUG "%s: bus frequency: %lu\n", __FUNCTION__, bus_freq);
87 iop_init_time(bus_freq);
85} 88}
86 89
87static struct sys_timer iq81340sc_timer = { 90static struct sys_timer iq81340sc_timer = {
diff --git a/arch/arm/mach-iop13xx/pci.c b/arch/arm/mach-iop13xx/pci.c
index 89ec70ea3187..d1d0d32ca77c 100644
--- a/arch/arm/mach-iop13xx/pci.c
+++ b/arch/arm/mach-iop13xx/pci.c
@@ -88,9 +88,9 @@ void iop13xx_map_pci_memory(void)
88 88
89 if (end) { 89 if (end) {
90 iop13xx_atux_mem_base = 90 iop13xx_atux_mem_base =
91 (u32) __ioremap_pfn( 91 (u32) __arm_ioremap_pfn(
92 __phys_to_pfn(IOP13XX_PCIX_LOWER_MEM_PA) 92 __phys_to_pfn(IOP13XX_PCIX_LOWER_MEM_PA)
93 , 0, iop13xx_atux_mem_size, 0); 93 , 0, iop13xx_atux_mem_size, MT_DEVICE);
94 if (!iop13xx_atux_mem_base) { 94 if (!iop13xx_atux_mem_base) {
95 printk("%s: atux allocation " 95 printk("%s: atux allocation "
96 "failed\n", __FUNCTION__); 96 "failed\n", __FUNCTION__);
@@ -114,9 +114,9 @@ void iop13xx_map_pci_memory(void)
114 114
115 if (end) { 115 if (end) {
116 iop13xx_atue_mem_base = 116 iop13xx_atue_mem_base =
117 (u32) __ioremap_pfn( 117 (u32) __arm_ioremap_pfn(
118 __phys_to_pfn(IOP13XX_PCIE_LOWER_MEM_PA) 118 __phys_to_pfn(IOP13XX_PCIE_LOWER_MEM_PA)
119 , 0, iop13xx_atue_mem_size, 0); 119 , 0, iop13xx_atue_mem_size, MT_DEVICE);
120 if (!iop13xx_atue_mem_base) { 120 if (!iop13xx_atue_mem_base) {
121 printk("%s: atue allocation " 121 printk("%s: atue allocation "
122 "failed\n", __FUNCTION__); 122 "failed\n", __FUNCTION__);
@@ -1023,7 +1023,7 @@ int iop13xx_pci_setup(int nr, struct pci_sys_data *sys)
1023 << IOP13XX_ATUX_PCIXSR_FUNC_NUM; 1023 << IOP13XX_ATUX_PCIXSR_FUNC_NUM;
1024 __raw_writel(pcixsr, IOP13XX_ATUX_PCIXSR); 1024 __raw_writel(pcixsr, IOP13XX_ATUX_PCIXSR);
1025 1025
1026 res[0].start = IOP13XX_PCIX_LOWER_IO_PA; 1026 res[0].start = IOP13XX_PCIX_LOWER_IO_PA + IOP13XX_PCIX_IO_BUS_OFFSET;
1027 res[0].end = IOP13XX_PCIX_UPPER_IO_PA; 1027 res[0].end = IOP13XX_PCIX_UPPER_IO_PA;
1028 res[0].name = "IQ81340 ATUX PCI I/O Space"; 1028 res[0].name = "IQ81340 ATUX PCI I/O Space";
1029 res[0].flags = IORESOURCE_IO; 1029 res[0].flags = IORESOURCE_IO;
@@ -1033,7 +1033,7 @@ int iop13xx_pci_setup(int nr, struct pci_sys_data *sys)
1033 res[1].name = "IQ81340 ATUX PCI Memory Space"; 1033 res[1].name = "IQ81340 ATUX PCI Memory Space";
1034 res[1].flags = IORESOURCE_MEM; 1034 res[1].flags = IORESOURCE_MEM;
1035 sys->mem_offset = IOP13XX_PCIX_MEM_OFFSET; 1035 sys->mem_offset = IOP13XX_PCIX_MEM_OFFSET;
1036 sys->io_offset = IOP13XX_PCIX_IO_OFFSET; 1036 sys->io_offset = IOP13XX_PCIX_LOWER_IO_PA;
1037 break; 1037 break;
1038 case IOP13XX_INIT_ATU_ATUE: 1038 case IOP13XX_INIT_ATU_ATUE:
1039 /* Note: the function number field in the PCSR is ro */ 1039 /* Note: the function number field in the PCSR is ro */
@@ -1044,7 +1044,7 @@ int iop13xx_pci_setup(int nr, struct pci_sys_data *sys)
1044 1044
1045 __raw_writel(pcsr, IOP13XX_ATUE_PCSR); 1045 __raw_writel(pcsr, IOP13XX_ATUE_PCSR);
1046 1046
1047 res[0].start = IOP13XX_PCIE_LOWER_IO_PA; 1047 res[0].start = IOP13XX_PCIE_LOWER_IO_PA + IOP13XX_PCIE_IO_BUS_OFFSET;
1048 res[0].end = IOP13XX_PCIE_UPPER_IO_PA; 1048 res[0].end = IOP13XX_PCIE_UPPER_IO_PA;
1049 res[0].name = "IQ81340 ATUE PCI I/O Space"; 1049 res[0].name = "IQ81340 ATUE PCI I/O Space";
1050 res[0].flags = IORESOURCE_IO; 1050 res[0].flags = IORESOURCE_IO;
@@ -1054,7 +1054,7 @@ int iop13xx_pci_setup(int nr, struct pci_sys_data *sys)
1054 res[1].name = "IQ81340 ATUE PCI Memory Space"; 1054 res[1].name = "IQ81340 ATUE PCI Memory Space";
1055 res[1].flags = IORESOURCE_MEM; 1055 res[1].flags = IORESOURCE_MEM;
1056 sys->mem_offset = IOP13XX_PCIE_MEM_OFFSET; 1056 sys->mem_offset = IOP13XX_PCIE_MEM_OFFSET;
1057 sys->io_offset = IOP13XX_PCIE_IO_OFFSET; 1057 sys->io_offset = IOP13XX_PCIE_LOWER_IO_PA;
1058 sys->map_irq = iop13xx_pcie_map_irq; 1058 sys->map_irq = iop13xx_pcie_map_irq;
1059 break; 1059 break;
1060 default: 1060 default:
diff --git a/arch/arm/mach-iop13xx/setup.c b/arch/arm/mach-iop13xx/setup.c
index 9a46bcd5f18e..bc4871553f6a 100644
--- a/arch/arm/mach-iop13xx/setup.c
+++ b/arch/arm/mach-iop13xx/setup.c
@@ -258,15 +258,11 @@ void __init iop13xx_platform_init(void)
258 258
259 if (init_uart == IOP13XX_INIT_UART_DEFAULT) { 259 if (init_uart == IOP13XX_INIT_UART_DEFAULT) {
260 switch (iop13xx_dev_id()) { 260 switch (iop13xx_dev_id()) {
261 /* enable both uarts on iop341 and iop342 */ 261 /* enable both uarts on iop341 */
262 case 0x3380: 262 case 0x3380:
263 case 0x3384: 263 case 0x3384:
264 case 0x3388: 264 case 0x3388:
265 case 0x338c: 265 case 0x338c:
266 case 0x3382:
267 case 0x3386:
268 case 0x338a:
269 case 0x338e:
270 init_uart |= IOP13XX_INIT_UART_0; 266 init_uart |= IOP13XX_INIT_UART_0;
271 init_uart |= IOP13XX_INIT_UART_1; 267 init_uart |= IOP13XX_INIT_UART_1;
272 break; 268 break;
diff --git a/arch/arm/mach-iop13xx/tpmi.c b/arch/arm/mach-iop13xx/tpmi.c
new file mode 100644
index 000000000000..d3dc278213da
--- /dev/null
+++ b/arch/arm/mach-iop13xx/tpmi.c
@@ -0,0 +1,234 @@
1/*
2 * iop13xx tpmi device resources
3 * Copyright (c) 2005-2006, Intel Corporation.
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms and conditions of the GNU General Public License,
7 * version 2, as published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along with
15 * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
16 * Place - Suite 330, Boston, MA 02111-1307 USA.
17 *
18 */
19
20#include <linux/kernel.h>
21#include <linux/init.h>
22#include <linux/platform_device.h>
23#include <linux/dma-mapping.h>
24#include <asm/io.h>
25#include <asm/irq.h>
26#include <asm/sizes.h>
27
28/* assumes CONTROLLER_ONLY# is never asserted in the ESSR register */
29#define IOP13XX_TPMI_MMR(dev) IOP13XX_REG_ADDR32_PHYS(0x48000 + (dev << 12))
30#define IOP13XX_TPMI_MEM(dev) IOP13XX_REG_ADDR32_PHYS(0x60000 + (dev << 13))
31#define IOP13XX_TPMI_CTRL(dev) IOP13XX_REG_ADDR32_PHYS(0x50000 + (dev << 10))
32#define IOP13XX_TPMI_MMR_SIZE (SZ_4K - 1)
33#define IOP13XX_TPMI_MEM_SIZE (255)
34#define IOP13XX_TPMI_MEM_CTRL (SZ_1K - 1)
35#define IOP13XX_TPMI_RESOURCE_MMR 0
36#define IOP13XX_TPMI_RESOURCE_MEM 1
37#define IOP13XX_TPMI_RESOURCE_CTRL 2
38#define IOP13XX_TPMI_RESOURCE_IRQ 3
39
40static struct resource iop13xx_tpmi_0_resources[] = {
41 [IOP13XX_TPMI_RESOURCE_MMR] = {
42 .start = IOP13XX_TPMI_MMR(4), /* tpmi0 starts at dev == 4 */
43 .end = IOP13XX_TPMI_MMR(4) + IOP13XX_TPMI_MMR_SIZE,
44 .flags = IORESOURCE_MEM,
45 },
46 [IOP13XX_TPMI_RESOURCE_MEM] = {
47 .start = IOP13XX_TPMI_MEM(0),
48 .end = IOP13XX_TPMI_MEM(0) + IOP13XX_TPMI_MEM_SIZE,
49 .flags = IORESOURCE_MEM,
50 },
51 [IOP13XX_TPMI_RESOURCE_CTRL] = {
52 .start = IOP13XX_TPMI_CTRL(0),
53 .end = IOP13XX_TPMI_CTRL(0) + IOP13XX_TPMI_MEM_CTRL,
54 .flags = IORESOURCE_MEM,
55 },
56 [IOP13XX_TPMI_RESOURCE_IRQ] = {
57 .start = IRQ_IOP13XX_TPMI0_OUT,
58 .end = IRQ_IOP13XX_TPMI0_OUT,
59 .flags = IORESOURCE_IRQ
60 }
61};
62
63static struct resource iop13xx_tpmi_1_resources[] = {
64 [IOP13XX_TPMI_RESOURCE_MMR] = {
65 .start = IOP13XX_TPMI_MMR(1),
66 .end = IOP13XX_TPMI_MMR(1) + IOP13XX_TPMI_MMR_SIZE,
67 .flags = IORESOURCE_MEM,
68 },
69 [IOP13XX_TPMI_RESOURCE_MEM] = {
70 .start = IOP13XX_TPMI_MEM(1),
71 .end = IOP13XX_TPMI_MEM(1) + IOP13XX_TPMI_MEM_SIZE,
72 .flags = IORESOURCE_MEM,
73 },
74 [IOP13XX_TPMI_RESOURCE_CTRL] = {
75 .start = IOP13XX_TPMI_CTRL(1),
76 .end = IOP13XX_TPMI_CTRL(1) + IOP13XX_TPMI_MEM_CTRL,
77 .flags = IORESOURCE_MEM,
78 },
79 [IOP13XX_TPMI_RESOURCE_IRQ] = {
80 .start = IRQ_IOP13XX_TPMI1_OUT,
81 .end = IRQ_IOP13XX_TPMI1_OUT,
82 .flags = IORESOURCE_IRQ
83 }
84};
85
86static struct resource iop13xx_tpmi_2_resources[] = {
87 [IOP13XX_TPMI_RESOURCE_MMR] = {
88 .start = IOP13XX_TPMI_MMR(2),
89 .end = IOP13XX_TPMI_MMR(2) + IOP13XX_TPMI_MMR_SIZE,
90 .flags = IORESOURCE_MEM,
91 },
92 [IOP13XX_TPMI_RESOURCE_MEM] = {
93 .start = IOP13XX_TPMI_MEM(2),
94 .end = IOP13XX_TPMI_MEM(2) + IOP13XX_TPMI_MEM_SIZE,
95 .flags = IORESOURCE_MEM,
96 },
97 [IOP13XX_TPMI_RESOURCE_CTRL] = {
98 .start = IOP13XX_TPMI_CTRL(2),
99 .end = IOP13XX_TPMI_CTRL(2) + IOP13XX_TPMI_MEM_CTRL,
100 .flags = IORESOURCE_MEM,
101 },
102 [IOP13XX_TPMI_RESOURCE_IRQ] = {
103 .start = IRQ_IOP13XX_TPMI2_OUT,
104 .end = IRQ_IOP13XX_TPMI2_OUT,
105 .flags = IORESOURCE_IRQ
106 }
107};
108
109static struct resource iop13xx_tpmi_3_resources[] = {
110 [IOP13XX_TPMI_RESOURCE_MMR] = {
111 .start = IOP13XX_TPMI_MMR(3),
112 .end = IOP13XX_TPMI_MMR(3) + IOP13XX_TPMI_MMR_SIZE,
113 .flags = IORESOURCE_MEM,
114 },
115 [IOP13XX_TPMI_RESOURCE_MEM] = {
116 .start = IOP13XX_TPMI_MEM(3),
117 .end = IOP13XX_TPMI_MEM(3) + IOP13XX_TPMI_MEM_SIZE,
118 .flags = IORESOURCE_MEM,
119 },
120 [IOP13XX_TPMI_RESOURCE_CTRL] = {
121 .start = IOP13XX_TPMI_CTRL(3),
122 .end = IOP13XX_TPMI_CTRL(3) + IOP13XX_TPMI_MEM_CTRL,
123 .flags = IORESOURCE_MEM,
124 },
125 [IOP13XX_TPMI_RESOURCE_IRQ] = {
126 .start = IRQ_IOP13XX_TPMI3_OUT,
127 .end = IRQ_IOP13XX_TPMI3_OUT,
128 .flags = IORESOURCE_IRQ
129 }
130};
131
132u64 iop13xx_tpmi_mask = DMA_64BIT_MASK;
133static struct platform_device iop13xx_tpmi_0_device = {
134 .name = "iop-tpmi",
135 .id = 0,
136 .num_resources = 4,
137 .resource = iop13xx_tpmi_0_resources,
138 .dev = {
139 .dma_mask = &iop13xx_tpmi_mask,
140 .coherent_dma_mask = DMA_64BIT_MASK,
141 },
142};
143
144static struct platform_device iop13xx_tpmi_1_device = {
145 .name = "iop-tpmi",
146 .id = 1,
147 .num_resources = 4,
148 .resource = iop13xx_tpmi_1_resources,
149 .dev = {
150 .dma_mask = &iop13xx_tpmi_mask,
151 .coherent_dma_mask = DMA_64BIT_MASK,
152 },
153};
154
155static struct platform_device iop13xx_tpmi_2_device = {
156 .name = "iop-tpmi",
157 .id = 2,
158 .num_resources = 4,
159 .resource = iop13xx_tpmi_2_resources,
160 .dev = {
161 .dma_mask = &iop13xx_tpmi_mask,
162 .coherent_dma_mask = DMA_64BIT_MASK,
163 },
164};
165
166static struct platform_device iop13xx_tpmi_3_device = {
167 .name = "iop-tpmi",
168 .id = 3,
169 .num_resources = 4,
170 .resource = iop13xx_tpmi_3_resources,
171 .dev = {
172 .dma_mask = &iop13xx_tpmi_mask,
173 .coherent_dma_mask = DMA_64BIT_MASK,
174 },
175};
176
177__init void iop13xx_add_tpmi_devices(void)
178{
179 unsigned short device_id;
180
181 /* tpmi's not present on iop341 or iop342 */
182 if (__raw_readl(IOP13XX_ESSR0) & IOP13XX_INTERFACE_SEL_PCIX)
183 /* ATUE must be present */
184 device_id = __raw_readw(IOP13XX_ATUE_DID);
185 else
186 /* ATUX must be present */
187 device_id = __raw_readw(IOP13XX_ATUX_DID);
188
189 switch (device_id) {
190 /* iop34[1|2] 0-tpmi */
191 case 0x3380:
192 case 0x3384:
193 case 0x3388:
194 case 0x338c:
195 case 0x3382:
196 case 0x3386:
197 case 0x338a:
198 case 0x338e:
199 return;
200 /* iop348 1-tpmi */
201 case 0x3310:
202 case 0x3312:
203 case 0x3314:
204 case 0x3318:
205 case 0x331a:
206 case 0x331c:
207 case 0x33c0:
208 case 0x33c2:
209 case 0x33c4:
210 case 0x33c8:
211 case 0x33ca:
212 case 0x33cc:
213 case 0x33b0:
214 case 0x33b2:
215 case 0x33b4:
216 case 0x33b8:
217 case 0x33ba:
218 case 0x33bc:
219 case 0x3320:
220 case 0x3322:
221 case 0x3324:
222 case 0x3328:
223 case 0x332a:
224 case 0x332c:
225 platform_device_register(&iop13xx_tpmi_0_device);
226 return;
227 default:
228 platform_device_register(&iop13xx_tpmi_0_device);
229 platform_device_register(&iop13xx_tpmi_1_device);
230 platform_device_register(&iop13xx_tpmi_2_device);
231 platform_device_register(&iop13xx_tpmi_3_device);
232 return;
233 }
234}
diff --git a/arch/arm/mach-iop32x/Kconfig b/arch/arm/mach-iop32x/Kconfig
index 9dd49cff21ff..9bb02b6d7ae1 100644
--- a/arch/arm/mach-iop32x/Kconfig
+++ b/arch/arm/mach-iop32x/Kconfig
@@ -34,6 +34,14 @@ config MACH_N2100
34 Say Y here if you want to run your kernel on the Thecus n2100 34 Say Y here if you want to run your kernel on the Thecus n2100
35 NAS appliance. 35 NAS appliance.
36 36
37config IOP3XX_ATU
38 bool "Enable the PCI Controller"
39 default y
40 help
41 Say Y here if you want the IOP to initialize its PCI Controller.
42 Say N if the IOP is an add in card, the host system owns the PCI
43 bus in this case.
44
37endmenu 45endmenu
38 46
39endif 47endif
diff --git a/arch/arm/mach-iop32x/iq31244.c b/arch/arm/mach-iop32x/iq31244.c
index 60e74309a458..7b21c6e13e59 100644
--- a/arch/arm/mach-iop32x/iq31244.c
+++ b/arch/arm/mach-iop32x/iq31244.c
@@ -178,9 +178,10 @@ static struct hw_pci iq31244_pci __initdata = {
178 178
179static int __init iq31244_pci_init(void) 179static int __init iq31244_pci_init(void)
180{ 180{
181 if (is_ep80219()) 181 if (is_ep80219()) {
182 pci_common_init(&ep80219_pci); 182 if (iop3xx_get_init_atu() == IOP3XX_INIT_ATU_ENABLE)
183 else if (machine_is_iq31244()) { 183 pci_common_init(&ep80219_pci);
184 } else if (machine_is_iq31244()) {
184 if (is_80219()) { 185 if (is_80219()) {
185 printk("note: iq31244 board type has been selected\n"); 186 printk("note: iq31244 board type has been selected\n");
186 printk("note: to select ep80219 operation:\n"); 187 printk("note: to select ep80219 operation:\n");
@@ -189,7 +190,9 @@ static int __init iq31244_pci_init(void)
189 printk("\t2/ update boot loader to pass" 190 printk("\t2/ update boot loader to pass"
190 " the ep80219 id: %d\n", MACH_TYPE_EP80219); 191 " the ep80219 id: %d\n", MACH_TYPE_EP80219);
191 } 192 }
192 pci_common_init(&iq31244_pci); 193
194 if (iop3xx_get_init_atu() == IOP3XX_INIT_ATU_ENABLE)
195 pci_common_init(&iq31244_pci);
193 } 196 }
194 197
195 return 0; 198 return 0;
diff --git a/arch/arm/mach-iop32x/iq80321.c b/arch/arm/mach-iop32x/iq80321.c
index 361c70c0f64c..bc25fb91e7b9 100644
--- a/arch/arm/mach-iop32x/iq80321.c
+++ b/arch/arm/mach-iop32x/iq80321.c
@@ -113,7 +113,8 @@ static struct hw_pci iq80321_pci __initdata = {
113 113
114static int __init iq80321_pci_init(void) 114static int __init iq80321_pci_init(void)
115{ 115{
116 if (machine_is_iq80321()) 116 if ((iop3xx_get_init_atu() == IOP3XX_INIT_ATU_ENABLE) &&
117 machine_is_iq80321())
117 pci_common_init(&iq80321_pci); 118 pci_common_init(&iq80321_pci);
118 119
119 return 0; 120 return 0;
diff --git a/arch/arm/mach-iop33x/Kconfig b/arch/arm/mach-iop33x/Kconfig
index 9aa016bb18f9..45598e096898 100644
--- a/arch/arm/mach-iop33x/Kconfig
+++ b/arch/arm/mach-iop33x/Kconfig
@@ -16,6 +16,14 @@ config MACH_IQ80332
16 Say Y here if you want to run your kernel on the Intel IQ80332 16 Say Y here if you want to run your kernel on the Intel IQ80332
17 evaluation kit for the IOP332 chipset. 17 evaluation kit for the IOP332 chipset.
18 18
19config IOP3XX_ATU
20 bool "Enable the PCI Controller"
21 default y
22 help
23 Say Y here if you want the IOP to initialize its PCI Controller.
24 Say N if the IOP is an add in card, the host system owns the PCI
25 bus in this case.
26
19endmenu 27endmenu
20 28
21endif 29endif
diff --git a/arch/arm/mach-iop33x/iq80331.c b/arch/arm/mach-iop33x/iq80331.c
index 1a9e36138d80..376c932830be 100644
--- a/arch/arm/mach-iop33x/iq80331.c
+++ b/arch/arm/mach-iop33x/iq80331.c
@@ -96,7 +96,8 @@ static struct hw_pci iq80331_pci __initdata = {
96 96
97static int __init iq80331_pci_init(void) 97static int __init iq80331_pci_init(void)
98{ 98{
99 if (machine_is_iq80331()) 99 if ((iop3xx_get_init_atu() == IOP3XX_INIT_ATU_ENABLE) &&
100 machine_is_iq80331())
100 pci_common_init(&iq80331_pci); 101 pci_common_init(&iq80331_pci);
101 102
102 return 0; 103 return 0;
diff --git a/arch/arm/mach-iop33x/iq80332.c b/arch/arm/mach-iop33x/iq80332.c
index 96d6f0f3cd21..58c81496c6f6 100644
--- a/arch/arm/mach-iop33x/iq80332.c
+++ b/arch/arm/mach-iop33x/iq80332.c
@@ -96,7 +96,8 @@ static struct hw_pci iq80332_pci __initdata = {
96 96
97static int __init iq80332_pci_init(void) 97static int __init iq80332_pci_init(void)
98{ 98{
99 if (machine_is_iq80332()) 99 if ((iop3xx_get_init_atu() == IOP3XX_INIT_ATU_ENABLE) &&
100 machine_is_iq80332())
100 pci_common_init(&iq80332_pci); 101 pci_common_init(&iq80332_pci);
101 102
102 return 0; 103 return 0;
diff --git a/arch/arm/mach-ixp2000/core.c b/arch/arm/mach-ixp2000/core.c
index 27b7480f4afe..9cf2498dc99e 100644
--- a/arch/arm/mach-ixp2000/core.c
+++ b/arch/arm/mach-ixp2000/core.c
@@ -84,59 +84,59 @@ static struct map_desc ixp2000_io_desc[] __initdata = {
84 .virtual = IXP2000_CAP_VIRT_BASE, 84 .virtual = IXP2000_CAP_VIRT_BASE,
85 .pfn = __phys_to_pfn(IXP2000_CAP_PHYS_BASE), 85 .pfn = __phys_to_pfn(IXP2000_CAP_PHYS_BASE),
86 .length = IXP2000_CAP_SIZE, 86 .length = IXP2000_CAP_SIZE,
87 .type = MT_IXP2000_DEVICE, 87 .type = MT_DEVICE_IXP2000,
88 }, { 88 }, {
89 .virtual = IXP2000_INTCTL_VIRT_BASE, 89 .virtual = IXP2000_INTCTL_VIRT_BASE,
90 .pfn = __phys_to_pfn(IXP2000_INTCTL_PHYS_BASE), 90 .pfn = __phys_to_pfn(IXP2000_INTCTL_PHYS_BASE),
91 .length = IXP2000_INTCTL_SIZE, 91 .length = IXP2000_INTCTL_SIZE,
92 .type = MT_IXP2000_DEVICE, 92 .type = MT_DEVICE_IXP2000,
93 }, { 93 }, {
94 .virtual = IXP2000_PCI_CREG_VIRT_BASE, 94 .virtual = IXP2000_PCI_CREG_VIRT_BASE,
95 .pfn = __phys_to_pfn(IXP2000_PCI_CREG_PHYS_BASE), 95 .pfn = __phys_to_pfn(IXP2000_PCI_CREG_PHYS_BASE),
96 .length = IXP2000_PCI_CREG_SIZE, 96 .length = IXP2000_PCI_CREG_SIZE,
97 .type = MT_IXP2000_DEVICE, 97 .type = MT_DEVICE_IXP2000,
98 }, { 98 }, {
99 .virtual = IXP2000_PCI_CSR_VIRT_BASE, 99 .virtual = IXP2000_PCI_CSR_VIRT_BASE,
100 .pfn = __phys_to_pfn(IXP2000_PCI_CSR_PHYS_BASE), 100 .pfn = __phys_to_pfn(IXP2000_PCI_CSR_PHYS_BASE),
101 .length = IXP2000_PCI_CSR_SIZE, 101 .length = IXP2000_PCI_CSR_SIZE,
102 .type = MT_IXP2000_DEVICE, 102 .type = MT_DEVICE_IXP2000,
103 }, { 103 }, {
104 .virtual = IXP2000_MSF_VIRT_BASE, 104 .virtual = IXP2000_MSF_VIRT_BASE,
105 .pfn = __phys_to_pfn(IXP2000_MSF_PHYS_BASE), 105 .pfn = __phys_to_pfn(IXP2000_MSF_PHYS_BASE),
106 .length = IXP2000_MSF_SIZE, 106 .length = IXP2000_MSF_SIZE,
107 .type = MT_IXP2000_DEVICE, 107 .type = MT_DEVICE_IXP2000,
108 }, { 108 }, {
109 .virtual = IXP2000_SCRATCH_RING_VIRT_BASE, 109 .virtual = IXP2000_SCRATCH_RING_VIRT_BASE,
110 .pfn = __phys_to_pfn(IXP2000_SCRATCH_RING_PHYS_BASE), 110 .pfn = __phys_to_pfn(IXP2000_SCRATCH_RING_PHYS_BASE),
111 .length = IXP2000_SCRATCH_RING_SIZE, 111 .length = IXP2000_SCRATCH_RING_SIZE,
112 .type = MT_IXP2000_DEVICE, 112 .type = MT_DEVICE_IXP2000,
113 }, { 113 }, {
114 .virtual = IXP2000_SRAM0_VIRT_BASE, 114 .virtual = IXP2000_SRAM0_VIRT_BASE,
115 .pfn = __phys_to_pfn(IXP2000_SRAM0_PHYS_BASE), 115 .pfn = __phys_to_pfn(IXP2000_SRAM0_PHYS_BASE),
116 .length = IXP2000_SRAM0_SIZE, 116 .length = IXP2000_SRAM0_SIZE,
117 .type = MT_IXP2000_DEVICE, 117 .type = MT_DEVICE_IXP2000,
118 }, { 118 }, {
119 .virtual = IXP2000_PCI_IO_VIRT_BASE, 119 .virtual = IXP2000_PCI_IO_VIRT_BASE,
120 .pfn = __phys_to_pfn(IXP2000_PCI_IO_PHYS_BASE), 120 .pfn = __phys_to_pfn(IXP2000_PCI_IO_PHYS_BASE),
121 .length = IXP2000_PCI_IO_SIZE, 121 .length = IXP2000_PCI_IO_SIZE,
122 .type = MT_IXP2000_DEVICE, 122 .type = MT_DEVICE_IXP2000,
123 }, { 123 }, {
124 .virtual = IXP2000_PCI_CFG0_VIRT_BASE, 124 .virtual = IXP2000_PCI_CFG0_VIRT_BASE,
125 .pfn = __phys_to_pfn(IXP2000_PCI_CFG0_PHYS_BASE), 125 .pfn = __phys_to_pfn(IXP2000_PCI_CFG0_PHYS_BASE),
126 .length = IXP2000_PCI_CFG0_SIZE, 126 .length = IXP2000_PCI_CFG0_SIZE,
127 .type = MT_IXP2000_DEVICE, 127 .type = MT_DEVICE_IXP2000,
128 }, { 128 }, {
129 .virtual = IXP2000_PCI_CFG1_VIRT_BASE, 129 .virtual = IXP2000_PCI_CFG1_VIRT_BASE,
130 .pfn = __phys_to_pfn(IXP2000_PCI_CFG1_PHYS_BASE), 130 .pfn = __phys_to_pfn(IXP2000_PCI_CFG1_PHYS_BASE),
131 .length = IXP2000_PCI_CFG1_SIZE, 131 .length = IXP2000_PCI_CFG1_SIZE,
132 .type = MT_IXP2000_DEVICE, 132 .type = MT_DEVICE_IXP2000,
133 } 133 }
134}; 134};
135 135
136void __init ixp2000_map_io(void) 136void __init ixp2000_map_io(void)
137{ 137{
138 /* 138 /*
139 * On IXP2400 CPUs we need to use MT_IXP2000_DEVICE so that 139 * On IXP2400 CPUs we need to use MT_DEVICE_IXP2000 so that
140 * XCB=101 (to avoid triggering erratum #66), and given that 140 * XCB=101 (to avoid triggering erratum #66), and given that
141 * this mode speeds up I/O accesses and we have write buffer 141 * this mode speeds up I/O accesses and we have write buffer
142 * flushes in the right places anyway, it doesn't hurt to use 142 * flushes in the right places anyway, it doesn't hurt to use
diff --git a/arch/arm/mach-ixp2000/enp2611.c b/arch/arm/mach-ixp2000/enp2611.c
index ac29298c5d3f..500e997ba7a4 100644
--- a/arch/arm/mach-ixp2000/enp2611.c
+++ b/arch/arm/mach-ixp2000/enp2611.c
@@ -70,17 +70,17 @@ static struct map_desc enp2611_io_desc[] __initdata = {
70 .virtual = ENP2611_CALEB_VIRT_BASE, 70 .virtual = ENP2611_CALEB_VIRT_BASE,
71 .pfn = __phys_to_pfn(ENP2611_CALEB_PHYS_BASE), 71 .pfn = __phys_to_pfn(ENP2611_CALEB_PHYS_BASE),
72 .length = ENP2611_CALEB_SIZE, 72 .length = ENP2611_CALEB_SIZE,
73 .type = MT_IXP2000_DEVICE, 73 .type = MT_DEVICE_IXP2000,
74 }, { 74 }, {
75 .virtual = ENP2611_PM3386_0_VIRT_BASE, 75 .virtual = ENP2611_PM3386_0_VIRT_BASE,
76 .pfn = __phys_to_pfn(ENP2611_PM3386_0_PHYS_BASE), 76 .pfn = __phys_to_pfn(ENP2611_PM3386_0_PHYS_BASE),
77 .length = ENP2611_PM3386_0_SIZE, 77 .length = ENP2611_PM3386_0_SIZE,
78 .type = MT_IXP2000_DEVICE, 78 .type = MT_DEVICE_IXP2000,
79 }, { 79 }, {
80 .virtual = ENP2611_PM3386_1_VIRT_BASE, 80 .virtual = ENP2611_PM3386_1_VIRT_BASE,
81 .pfn = __phys_to_pfn(ENP2611_PM3386_1_PHYS_BASE), 81 .pfn = __phys_to_pfn(ENP2611_PM3386_1_PHYS_BASE),
82 .length = ENP2611_PM3386_1_SIZE, 82 .length = ENP2611_PM3386_1_SIZE,
83 .type = MT_IXP2000_DEVICE, 83 .type = MT_DEVICE_IXP2000,
84 } 84 }
85}; 85};
86 86
diff --git a/arch/arm/mach-ixp4xx/Kconfig b/arch/arm/mach-ixp4xx/Kconfig
index 8a339cdfe222..9715ef506c24 100644
--- a/arch/arm/mach-ixp4xx/Kconfig
+++ b/arch/arm/mach-ixp4xx/Kconfig
@@ -62,6 +62,12 @@ config MACH_IXDP465
62 IXDP465 Development Platform (Also known as BMP). 62 IXDP465 Development Platform (Also known as BMP).
63 For more information on this platform, see <file:Documentation/arm/IXP4xx>. 63 For more information on this platform, see <file:Documentation/arm/IXP4xx>.
64 64
65config MACH_KIXRP435
66 bool "KIXRP435"
67 help
68 Say 'Y' here if you want your kernel to support Intel's
69 KIXRP435 Reference Platform.
70 For more information on this platform, see <file:Documentation/arm/IXP4xx>.
65 71
66# 72#
67# IXCDP1100 is the exact same HW as IXDP425, but with a different machine 73# IXCDP1100 is the exact same HW as IXDP425, but with a different machine
@@ -89,12 +95,21 @@ config MACH_NAS100D
89 NAS 100d device. For more information on this platform, 95 NAS 100d device. For more information on this platform,
90 see http://www.nslu2-linux.org/wiki/NAS100d/HomePage 96 see http://www.nslu2-linux.org/wiki/NAS100d/HomePage
91 97
98config MACH_DSMG600
99 bool
100 prompt "D-Link DSM-G600 RevA"
101 select PCI
102 help
103 Say 'Y' here if you want your kernel to support D-Link's
104 DSM-G600 RevA device. For more information on this platform,
105 see http://www.nslu2-linux.org/wiki/DSMG600/HomePage
106
92# 107#
93# Avila and IXDP share the same source for now. Will change in future 108# Avila and IXDP share the same source for now. Will change in future
94# 109#
95config ARCH_IXDP4XX 110config ARCH_IXDP4XX
96 bool 111 bool
97 depends on ARCH_IXDP425 || MACH_IXDP465 112 depends on ARCH_IXDP425 || MACH_IXDP465 || MACH_KIXRP435
98 default y 113 default y
99 114
100# 115#
@@ -105,6 +120,11 @@ config CPU_IXP46X
105 depends on MACH_IXDP465 120 depends on MACH_IXDP465
106 default y 121 default y
107 122
123config CPU_IXP43X
124 bool
125 depends on MACH_KIXRP435
126 default y
127
108config MACH_GTWX5715 128config MACH_GTWX5715
109 bool "Gemtek WX5715 (Linksys WRV54G)" 129 bool "Gemtek WX5715 (Linksys WRV54G)"
110 depends on ARCH_IXP4XX 130 depends on ARCH_IXP4XX
diff --git a/arch/arm/mach-ixp4xx/Makefile b/arch/arm/mach-ixp4xx/Makefile
index 746e297284ed..3b87c47e06cf 100644
--- a/arch/arm/mach-ixp4xx/Makefile
+++ b/arch/arm/mach-ixp4xx/Makefile
@@ -12,6 +12,7 @@ obj-pci-$(CONFIG_ARCH_ADI_COYOTE) += coyote-pci.o
12obj-pci-$(CONFIG_MACH_GTWX5715) += gtwx5715-pci.o 12obj-pci-$(CONFIG_MACH_GTWX5715) += gtwx5715-pci.o
13obj-pci-$(CONFIG_MACH_NSLU2) += nslu2-pci.o 13obj-pci-$(CONFIG_MACH_NSLU2) += nslu2-pci.o
14obj-pci-$(CONFIG_MACH_NAS100D) += nas100d-pci.o 14obj-pci-$(CONFIG_MACH_NAS100D) += nas100d-pci.o
15obj-pci-$(CONFIG_MACH_DSMG600) += dsmg600-pci.o
15 16
16obj-y += common.o 17obj-y += common.o
17 18
@@ -22,5 +23,6 @@ obj-$(CONFIG_ARCH_ADI_COYOTE) += coyote-setup.o
22obj-$(CONFIG_MACH_GTWX5715) += gtwx5715-setup.o 23obj-$(CONFIG_MACH_GTWX5715) += gtwx5715-setup.o
23obj-$(CONFIG_MACH_NSLU2) += nslu2-setup.o nslu2-power.o 24obj-$(CONFIG_MACH_NSLU2) += nslu2-setup.o nslu2-power.o
24obj-$(CONFIG_MACH_NAS100D) += nas100d-setup.o nas100d-power.o 25obj-$(CONFIG_MACH_NAS100D) += nas100d-setup.o nas100d-power.o
26obj-$(CONFIG_MACH_DSMG600) += dsmg600-setup.o dsmg600-power.o
25 27
26obj-$(CONFIG_PCI) += $(obj-pci-$(CONFIG_PCI)) common-pci.o 28obj-$(CONFIG_PCI) += $(obj-pci-$(CONFIG_PCI)) common-pci.o
diff --git a/arch/arm/mach-ixp4xx/common-pci.c b/arch/arm/mach-ixp4xx/common-pci.c
index 9562177b5fe1..bf04121d1a31 100644
--- a/arch/arm/mach-ixp4xx/common-pci.c
+++ b/arch/arm/mach-ixp4xx/common-pci.c
@@ -374,7 +374,7 @@ void __init ixp4xx_pci_preinit(void)
374 * Determine which PCI read method to use. 374 * Determine which PCI read method to use.
375 * Rev 0 IXP425 requires workaround. 375 * Rev 0 IXP425 requires workaround.
376 */ 376 */
377 if (!(processor_id & 0xf) && !cpu_is_ixp46x()) { 377 if (!(processor_id & 0xf) && cpu_is_ixp42x()) {
378 printk("PCI: IXP42x A0 silicon detected - " 378 printk("PCI: IXP42x A0 silicon detected - "
379 "PCI Non-Prefetch Workaround Enabled\n"); 379 "PCI Non-Prefetch Workaround Enabled\n");
380 ixp4xx_pci_read = ixp4xx_pci_read_errata; 380 ixp4xx_pci_read = ixp4xx_pci_read_errata;
@@ -480,7 +480,7 @@ int ixp4xx_setup(int nr, struct pci_sys_data *sys)
480 res[0].flags = IORESOURCE_IO; 480 res[0].flags = IORESOURCE_IO;
481 481
482 res[1].name = "PCI Memory Space"; 482 res[1].name = "PCI Memory Space";
483 res[1].start = 0x48000000; 483 res[1].start = PCIBIOS_MIN_MEM;
484#ifndef CONFIG_IXP4XX_INDIRECT_PCI 484#ifndef CONFIG_IXP4XX_INDIRECT_PCI
485 res[1].end = 0x4bffffff; 485 res[1].end = 0x4bffffff;
486#else 486#else
diff --git a/arch/arm/mach-ixp4xx/common.c b/arch/arm/mach-ixp4xx/common.c
index 45068c3d8dcc..f5cae1e46b7e 100644
--- a/arch/arm/mach-ixp4xx/common.c
+++ b/arch/arm/mach-ixp4xx/common.c
@@ -27,6 +27,7 @@
27#include <linux/time.h> 27#include <linux/time.h>
28#include <linux/timex.h> 28#include <linux/timex.h>
29#include <linux/clocksource.h> 29#include <linux/clocksource.h>
30#include <linux/clockchips.h>
30 31
31#include <asm/arch/udc.h> 32#include <asm/arch/udc.h>
32#include <asm/hardware.h> 33#include <asm/hardware.h>
@@ -41,6 +42,8 @@
41#include <asm/mach/time.h> 42#include <asm/mach/time.h>
42 43
43static int __init ixp4xx_clocksource_init(void); 44static int __init ixp4xx_clocksource_init(void);
45static int __init ixp4xx_clockevent_init(void);
46static struct clock_event_device clockevent_ixp4xx;
44 47
45/************************************************************************* 48/*************************************************************************
46 * IXP4xx chipset I/O mapping 49 * IXP4xx chipset I/O mapping
@@ -102,6 +105,29 @@ static signed char irq2gpio[32] = {
102 7, 8, 9, 10, 11, 12, -1, -1, 105 7, 8, 9, 10, 11, 12, -1, -1,
103}; 106};
104 107
108int gpio_to_irq(int gpio)
109{
110 int irq;
111
112 for (irq = 0; irq < 32; irq++) {
113 if (irq2gpio[irq] == gpio)
114 return irq;
115 }
116 return -EINVAL;
117}
118EXPORT_SYMBOL(gpio_to_irq);
119
120int irq_to_gpio(int irq)
121{
122 int gpio = (irq < 32) ? irq2gpio[irq] : -EINVAL;
123
124 if (gpio == -1)
125 return -EINVAL;
126
127 return gpio;
128}
129EXPORT_SYMBOL(irq_to_gpio);
130
105static int ixp4xx_set_irq_type(unsigned int irq, unsigned int type) 131static int ixp4xx_set_irq_type(unsigned int irq, unsigned int type)
106{ 132{
107 int line = irq2gpio[irq]; 133 int line = irq2gpio[irq];
@@ -169,7 +195,7 @@ static int ixp4xx_set_irq_type(unsigned int irq, unsigned int type)
169 195
170static void ixp4xx_irq_mask(unsigned int irq) 196static void ixp4xx_irq_mask(unsigned int irq)
171{ 197{
172 if (cpu_is_ixp46x() && irq >= 32) 198 if ((cpu_is_ixp46x() || cpu_is_ixp43x()) && irq >= 32)
173 *IXP4XX_ICMR2 &= ~(1 << (irq - 32)); 199 *IXP4XX_ICMR2 &= ~(1 << (irq - 32));
174 else 200 else
175 *IXP4XX_ICMR &= ~(1 << irq); 201 *IXP4XX_ICMR &= ~(1 << irq);
@@ -192,7 +218,7 @@ static void ixp4xx_irq_unmask(unsigned int irq)
192 if (!(ixp4xx_irq_edge & (1 << irq))) 218 if (!(ixp4xx_irq_edge & (1 << irq)))
193 ixp4xx_irq_ack(irq); 219 ixp4xx_irq_ack(irq);
194 220
195 if (cpu_is_ixp46x() && irq >= 32) 221 if ((cpu_is_ixp46x() || cpu_is_ixp43x()) && irq >= 32)
196 *IXP4XX_ICMR2 |= (1 << (irq - 32)); 222 *IXP4XX_ICMR2 |= (1 << (irq - 32));
197 else 223 else
198 *IXP4XX_ICMR |= (1 << irq); 224 *IXP4XX_ICMR |= (1 << irq);
@@ -216,7 +242,7 @@ void __init ixp4xx_init_irq(void)
216 /* Disable all interrupt */ 242 /* Disable all interrupt */
217 *IXP4XX_ICMR = 0x0; 243 *IXP4XX_ICMR = 0x0;
218 244
219 if (cpu_is_ixp46x()) { 245 if (cpu_is_ixp46x() || cpu_is_ixp43x()) {
220 /* Route upper 32 sources to IRQ instead of FIQ */ 246 /* Route upper 32 sources to IRQ instead of FIQ */
221 *IXP4XX_ICLR2 = 0x00; 247 *IXP4XX_ICLR2 = 0x00;
222 248
@@ -239,52 +265,40 @@ void __init ixp4xx_init_irq(void)
239 * counter as a source of real clock ticks to account for missed jiffies. 265 * counter as a source of real clock ticks to account for missed jiffies.
240 *************************************************************************/ 266 *************************************************************************/
241 267
242static unsigned volatile last_jiffy_time;
243
244#define CLOCK_TICKS_PER_USEC ((CLOCK_TICK_RATE + USEC_PER_SEC/2) / USEC_PER_SEC)
245
246static irqreturn_t ixp4xx_timer_interrupt(int irq, void *dev_id) 268static irqreturn_t ixp4xx_timer_interrupt(int irq, void *dev_id)
247{ 269{
248 write_seqlock(&xtime_lock); 270 struct clock_event_device *evt = &clockevent_ixp4xx;
249 271
250 /* Clear Pending Interrupt by writing '1' to it */ 272 /* Clear Pending Interrupt by writing '1' to it */
251 *IXP4XX_OSST = IXP4XX_OSST_TIMER_1_PEND; 273 *IXP4XX_OSST = IXP4XX_OSST_TIMER_1_PEND;
252 274
253 /* 275 evt->event_handler(evt);
254 * Catch up with the real idea of time
255 */
256 while ((signed long)(*IXP4XX_OSTS - last_jiffy_time) >= LATCH) {
257 timer_tick();
258 last_jiffy_time += LATCH;
259 }
260
261 write_sequnlock(&xtime_lock);
262 276
263 return IRQ_HANDLED; 277 return IRQ_HANDLED;
264} 278}
265 279
266static struct irqaction ixp4xx_timer_irq = { 280static struct irqaction ixp4xx_timer_irq = {
267 .name = "IXP4xx Timer Tick", 281 .name = "timer1",
268 .flags = IRQF_DISABLED | IRQF_TIMER, 282 .flags = IRQF_DISABLED | IRQF_TIMER,
269 .handler = ixp4xx_timer_interrupt, 283 .handler = ixp4xx_timer_interrupt,
270}; 284};
271 285
272static void __init ixp4xx_timer_init(void) 286static void __init ixp4xx_timer_init(void)
273{ 287{
288 /* Reset/disable counter */
289 *IXP4XX_OSRT1 = 0;
290
274 /* Clear Pending Interrupt by writing '1' to it */ 291 /* Clear Pending Interrupt by writing '1' to it */
275 *IXP4XX_OSST = IXP4XX_OSST_TIMER_1_PEND; 292 *IXP4XX_OSST = IXP4XX_OSST_TIMER_1_PEND;
276 293
277 /* Setup the Timer counter value */
278 *IXP4XX_OSRT1 = (LATCH & ~IXP4XX_OST_RELOAD_MASK) | IXP4XX_OST_ENABLE;
279
280 /* Reset time-stamp counter */ 294 /* Reset time-stamp counter */
281 *IXP4XX_OSTS = 0; 295 *IXP4XX_OSTS = 0;
282 last_jiffy_time = 0;
283 296
284 /* Connect the interrupt handler and enable the interrupt */ 297 /* Connect the interrupt handler and enable the interrupt */
285 setup_irq(IRQ_IXP4XX_TIMER1, &ixp4xx_timer_irq); 298 setup_irq(IRQ_IXP4XX_TIMER1, &ixp4xx_timer_irq);
286 299
287 ixp4xx_clocksource_init(); 300 ixp4xx_clocksource_init();
301 ixp4xx_clockevent_init();
288} 302}
289 303
290struct sys_timer ixp4xx_timer = { 304struct sys_timer ixp4xx_timer = {
@@ -384,6 +398,9 @@ void __init ixp4xx_sys_init(void)
384 ixp4xx_exp_bus_size >> 20); 398 ixp4xx_exp_bus_size >> 20);
385} 399}
386 400
401/*
402 * clocksource
403 */
387cycle_t ixp4xx_get_cycles(void) 404cycle_t ixp4xx_get_cycles(void)
388{ 405{
389 return *IXP4XX_OSTS; 406 return *IXP4XX_OSTS;
@@ -408,3 +425,64 @@ static int __init ixp4xx_clocksource_init(void)
408 425
409 return 0; 426 return 0;
410} 427}
428
429/*
430 * clockevents
431 */
432static int ixp4xx_set_next_event(unsigned long evt,
433 struct clock_event_device *unused)
434{
435 unsigned long opts = *IXP4XX_OSRT1 & IXP4XX_OST_RELOAD_MASK;
436
437 *IXP4XX_OSRT1 = (evt & ~IXP4XX_OST_RELOAD_MASK) | opts;
438
439 return 0;
440}
441
442static void ixp4xx_set_mode(enum clock_event_mode mode,
443 struct clock_event_device *evt)
444{
445 unsigned long opts, osrt = *IXP4XX_OSRT1 & ~IXP4XX_OST_RELOAD_MASK;
446
447 switch (mode) {
448 case CLOCK_EVT_MODE_PERIODIC:
449 osrt = LATCH & ~IXP4XX_OST_RELOAD_MASK;
450 opts = IXP4XX_OST_ENABLE;
451 break;
452 case CLOCK_EVT_MODE_ONESHOT:
453 /* period set by 'set next_event' */
454 osrt = 0;
455 opts = IXP4XX_OST_ENABLE | IXP4XX_OST_ONE_SHOT;
456 break;
457 case CLOCK_EVT_MODE_SHUTDOWN:
458 case CLOCK_EVT_MODE_UNUSED:
459 default:
460 osrt = opts = 0;
461 break;
462 }
463
464 *IXP4XX_OSRT1 = osrt | opts;
465}
466
467static struct clock_event_device clockevent_ixp4xx = {
468 .name = "ixp4xx timer1",
469 .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT,
470 .rating = 200,
471 .shift = 24,
472 .set_mode = ixp4xx_set_mode,
473 .set_next_event = ixp4xx_set_next_event,
474};
475
476static int __init ixp4xx_clockevent_init(void)
477{
478 clockevent_ixp4xx.mult = div_sc(FREQ, NSEC_PER_SEC,
479 clockevent_ixp4xx.shift);
480 clockevent_ixp4xx.max_delta_ns =
481 clockevent_delta2ns(0xfffffffe, &clockevent_ixp4xx);
482 clockevent_ixp4xx.min_delta_ns =
483 clockevent_delta2ns(0xf, &clockevent_ixp4xx);
484 clockevent_ixp4xx.cpumask = cpumask_of_cpu(0);
485
486 clockevents_register_device(&clockevent_ixp4xx);
487 return 0;
488}
diff --git a/arch/arm/mach-ixp4xx/dsmg600-pci.c b/arch/arm/mach-ixp4xx/dsmg600-pci.c
new file mode 100644
index 000000000000..9db7e1f42011
--- /dev/null
+++ b/arch/arm/mach-ixp4xx/dsmg600-pci.c
@@ -0,0 +1,74 @@
1/*
2 * DSM-G600 board-level PCI initialization
3 *
4 * Copyright (C) 2006 Tower Technologies
5 * Author: Alessandro Zummo <a.zummo@towertech.it>
6 *
7 * based on ixdp425-pci.c:
8 * Copyright (C) 2002 Intel Corporation.
9 * Copyright (C) 2003-2004 MontaVista Software, Inc.
10 *
11 * Maintainer: http://www.nslu2-linux.org/
12 *
13 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License version 2 as
15 * published by the Free Software Foundation.
16 *
17 */
18
19#include <linux/pci.h>
20#include <linux/init.h>
21#include <linux/irq.h>
22
23#include <asm/mach/pci.h>
24#include <asm/mach-types.h>
25
26void __init dsmg600_pci_preinit(void)
27{
28 set_irq_type(IRQ_DSMG600_PCI_INTA, IRQT_LOW);
29 set_irq_type(IRQ_DSMG600_PCI_INTB, IRQT_LOW);
30 set_irq_type(IRQ_DSMG600_PCI_INTC, IRQT_LOW);
31 set_irq_type(IRQ_DSMG600_PCI_INTD, IRQT_LOW);
32 set_irq_type(IRQ_DSMG600_PCI_INTE, IRQT_LOW);
33 set_irq_type(IRQ_DSMG600_PCI_INTF, IRQT_LOW);
34
35 ixp4xx_pci_preinit();
36}
37
38static int __init dsmg600_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
39{
40 static int pci_irq_table[DSMG600_PCI_MAX_DEV][DSMG600_PCI_IRQ_LINES] =
41 {
42 { IRQ_DSMG600_PCI_INTE, -1, -1 },
43 { IRQ_DSMG600_PCI_INTA, -1, -1 },
44 { IRQ_DSMG600_PCI_INTB, IRQ_DSMG600_PCI_INTC, IRQ_DSMG600_PCI_INTD },
45 { IRQ_DSMG600_PCI_INTF, -1, -1 },
46 };
47
48 int irq = -1;
49
50 if (slot >= 1 && slot <= DSMG600_PCI_MAX_DEV &&
51 pin >= 1 && pin <= DSMG600_PCI_IRQ_LINES)
52 irq = pci_irq_table[slot-1][pin-1];
53
54 return irq;
55}
56
57struct hw_pci __initdata dsmg600_pci = {
58 .nr_controllers = 1,
59 .preinit = dsmg600_pci_preinit,
60 .swizzle = pci_std_swizzle,
61 .setup = ixp4xx_setup,
62 .scan = ixp4xx_scan_bus,
63 .map_irq = dsmg600_map_irq,
64};
65
66int __init dsmg600_pci_init(void)
67{
68 if (machine_is_dsmg600())
69 pci_common_init(&dsmg600_pci);
70
71 return 0;
72}
73
74subsys_initcall(dsmg600_pci_init);
diff --git a/arch/arm/mach-ixp4xx/dsmg600-power.c b/arch/arm/mach-ixp4xx/dsmg600-power.c
new file mode 100644
index 000000000000..34717872d076
--- /dev/null
+++ b/arch/arm/mach-ixp4xx/dsmg600-power.c
@@ -0,0 +1,125 @@
1/*
2 * arch/arm/mach-ixp4xx/dsmg600-power.c
3 *
4 * DSM-G600 Power/Reset driver
5 * Author: Michael Westerhof <mwester@dls.net>
6 *
7 * Based on nslu2-power.c
8 * Copyright (C) 2005 Tower Technologies
9 * Author: Alessandro Zummo <a.zummo@towertech.it>
10 *
11 * which was based on nslu2-io.c
12 * Copyright (C) 2004 Karen Spearel
13 *
14 * Maintainers: http://www.nslu2-linux.org/
15 *
16 * This program is free software; you can redistribute it and/or modify
17 * it under the terms of the GNU General Public License version 2 as
18 * published by the Free Software Foundation.
19 *
20 */
21
22#include <linux/module.h>
23#include <linux/reboot.h>
24#include <linux/interrupt.h>
25#include <linux/irq.h>
26#include <linux/jiffies.h>
27#include <linux/timer.h>
28
29#include <asm/mach-types.h>
30
31extern void ctrl_alt_del(void);
32
33/* This is used to make sure the power-button pusher is serious. The button
34 * must be held until the value of this counter reaches zero.
35 */
36static volatile int power_button_countdown;
37
38/* Must hold the button down for at least this many counts to be processed */
39#define PBUTTON_HOLDDOWN_COUNT 4 /* 2 secs */
40
41static void dsmg600_power_handler(unsigned long data);
42static DEFINE_TIMER(dsmg600_power_timer, dsmg600_power_handler, 0, 0);
43
44static void dsmg600_power_handler(unsigned long data)
45{
46 /* This routine is called twice per second to check the
47 * state of the power button.
48 */
49
50 if (*IXP4XX_GPIO_GPINR & DSMG600_PB_BM) {
51
52 /* IO Pin is 1 (button pushed) */
53 if (power_button_countdown == 0) {
54 /* Signal init to do the ctrlaltdel action, this will bypass
55 * init if it hasn't started and do a kernel_restart.
56 */
57 ctrl_alt_del();
58
59 /* Change the state of the power LED to "blink" */
60 gpio_line_set(DSMG600_LED_PWR_GPIO, IXP4XX_GPIO_LOW);
61 }
62 power_button_countdown--;
63
64 } else {
65 power_button_countdown = PBUTTON_HOLDDOWN_COUNT;
66 }
67
68 mod_timer(&dsmg600_power_timer, jiffies + msecs_to_jiffies(500));
69}
70
71static irqreturn_t dsmg600_reset_handler(int irq, void *dev_id)
72{
73 /* This is the paper-clip reset, it shuts the machine down directly. */
74 machine_power_off();
75
76 return IRQ_HANDLED;
77}
78
79static int __init dsmg600_power_init(void)
80{
81 if (!(machine_is_dsmg600()))
82 return 0;
83
84 if (request_irq(DSMG600_RB_IRQ, &dsmg600_reset_handler,
85 IRQF_DISABLED | IRQF_TRIGGER_LOW, "DSM-G600 reset button",
86 NULL) < 0) {
87
88 printk(KERN_DEBUG "Reset Button IRQ %d not available\n",
89 DSMG600_RB_IRQ);
90
91 return -EIO;
92 }
93
94 /* The power button on the D-Link DSM-G600 is on GPIO 15, but
95 * it cannot handle interrupts on that GPIO line. So we'll
96 * have to poll it with a kernel timer.
97 */
98
99 /* Make sure that the power button GPIO is set up as an input */
100 gpio_line_config(DSMG600_PB_GPIO, IXP4XX_GPIO_IN);
101
102 /* Set the initial value for the power button IRQ handler */
103 power_button_countdown = PBUTTON_HOLDDOWN_COUNT;
104
105 mod_timer(&dsmg600_power_timer, jiffies + msecs_to_jiffies(500));
106
107 return 0;
108}
109
110static void __exit dsmg600_power_exit(void)
111{
112 if (!(machine_is_dsmg600()))
113 return;
114
115 del_timer_sync(&dsmg600_power_timer);
116
117 free_irq(DSMG600_RB_IRQ, NULL);
118}
119
120module_init(dsmg600_power_init);
121module_exit(dsmg600_power_exit);
122
123MODULE_AUTHOR("Michael Westerhof <mwester@dls.net>");
124MODULE_DESCRIPTION("DSM-G600 Power/Reset driver");
125MODULE_LICENSE("GPL");
diff --git a/arch/arm/mach-ixp4xx/dsmg600-setup.c b/arch/arm/mach-ixp4xx/dsmg600-setup.c
new file mode 100644
index 000000000000..1caff65e22cc
--- /dev/null
+++ b/arch/arm/mach-ixp4xx/dsmg600-setup.c
@@ -0,0 +1,175 @@
1/*
2 * DSM-G600 board-setup
3 *
4 * Copyright (C) 2006 Tower Technologies
5 * Author: Alessandro Zummo <a.zummo@towertech.it>
6 *
7 * based ixdp425-setup.c:
8 * Copyright (C) 2003-2004 MontaVista Software, Inc.
9 *
10 * Author: Alessandro Zummo <a.zummo@towertech.it>
11 * Maintainers: http://www.nslu2-linux.org/
12 */
13
14#include <linux/kernel.h>
15#include <linux/serial.h>
16#include <linux/serial_8250.h>
17
18#include <asm/mach-types.h>
19#include <asm/mach/arch.h>
20#include <asm/mach/flash.h>
21
22static struct flash_platform_data dsmg600_flash_data = {
23 .map_name = "cfi_probe",
24 .width = 2,
25};
26
27static struct resource dsmg600_flash_resource = {
28 .flags = IORESOURCE_MEM,
29};
30
31static struct platform_device dsmg600_flash = {
32 .name = "IXP4XX-Flash",
33 .id = 0,
34 .dev.platform_data = &dsmg600_flash_data,
35 .num_resources = 1,
36 .resource = &dsmg600_flash_resource,
37};
38
39static struct ixp4xx_i2c_pins dsmg600_i2c_gpio_pins = {
40 .sda_pin = DSMG600_SDA_PIN,
41 .scl_pin = DSMG600_SCL_PIN,
42};
43
44static struct platform_device dsmg600_i2c_controller = {
45 .name = "IXP4XX-I2C",
46 .id = 0,
47 .dev.platform_data = &dsmg600_i2c_gpio_pins,
48};
49
50#ifdef CONFIG_LEDS_CLASS
51static struct resource dsmg600_led_resources[] = {
52 {
53 .name = "power",
54 .start = DSMG600_LED_PWR_GPIO,
55 .end = DSMG600_LED_PWR_GPIO,
56 .flags = IXP4XX_GPIO_HIGH,
57 },
58 {
59 .name = "wlan",
60 .start = DSMG600_LED_WLAN_GPIO,
61 .end = DSMG600_LED_WLAN_GPIO,
62 .flags = IXP4XX_GPIO_LOW,
63 },
64};
65
66static struct platform_device dsmg600_leds = {
67 .name = "IXP4XX-GPIO-LED",
68 .id = -1,
69 .num_resources = ARRAY_SIZE(dsmg600_led_resources),
70 .resource = dsmg600_led_resources,
71};
72#endif
73
74static struct resource dsmg600_uart_resources[] = {
75 {
76 .start = IXP4XX_UART1_BASE_PHYS,
77 .end = IXP4XX_UART1_BASE_PHYS + 0x0fff,
78 .flags = IORESOURCE_MEM,
79 },
80 {
81 .start = IXP4XX_UART2_BASE_PHYS,
82 .end = IXP4XX_UART2_BASE_PHYS + 0x0fff,
83 .flags = IORESOURCE_MEM,
84 }
85};
86
87static struct plat_serial8250_port dsmg600_uart_data[] = {
88 {
89 .mapbase = IXP4XX_UART1_BASE_PHYS,
90 .membase = (char *)IXP4XX_UART1_BASE_VIRT + REG_OFFSET,
91 .irq = IRQ_IXP4XX_UART1,
92 .flags = UPF_BOOT_AUTOCONF,
93 .iotype = UPIO_MEM,
94 .regshift = 2,
95 .uartclk = IXP4XX_UART_XTAL,
96 },
97 {
98 .mapbase = IXP4XX_UART2_BASE_PHYS,
99 .membase = (char *)IXP4XX_UART2_BASE_VIRT + REG_OFFSET,
100 .irq = IRQ_IXP4XX_UART2,
101 .flags = UPF_BOOT_AUTOCONF,
102 .iotype = UPIO_MEM,
103 .regshift = 2,
104 .uartclk = IXP4XX_UART_XTAL,
105 },
106 { }
107};
108
109static struct platform_device dsmg600_uart = {
110 .name = "serial8250",
111 .id = PLAT8250_DEV_PLATFORM,
112 .dev.platform_data = dsmg600_uart_data,
113 .num_resources = ARRAY_SIZE(dsmg600_uart_resources),
114 .resource = dsmg600_uart_resources,
115};
116
117static struct platform_device *dsmg600_devices[] __initdata = {
118 &dsmg600_i2c_controller,
119 &dsmg600_flash,
120};
121
122static void dsmg600_power_off(void)
123{
124 /* enable the pwr cntl gpio */
125 gpio_line_config(DSMG600_PO_GPIO, IXP4XX_GPIO_OUT);
126
127 /* poweroff */
128 gpio_line_set(DSMG600_PO_GPIO, IXP4XX_GPIO_HIGH);
129}
130
131static void __init dsmg600_init(void)
132{
133 ixp4xx_sys_init();
134
135 /* Make sure that GPIO14 and GPIO15 are not used as clocks */
136 *IXP4XX_GPIO_GPCLKR = 0;
137
138 dsmg600_flash_resource.start = IXP4XX_EXP_BUS_BASE(0);
139 dsmg600_flash_resource.end =
140 IXP4XX_EXP_BUS_BASE(0) + ixp4xx_exp_bus_size - 1;
141
142 pm_power_off = dsmg600_power_off;
143
144 /* The UART is required on the DSM-G600 (Redboot cannot use the
145 * NIC) -- do it here so that it does *not* get removed if
146 * platform_add_devices fails!
147 */
148 (void)platform_device_register(&dsmg600_uart);
149
150 platform_add_devices(dsmg600_devices, ARRAY_SIZE(dsmg600_devices));
151
152#ifdef CONFIG_LEDS_CLASS
153 /* We don't care whether or not this works. */
154 (void)platform_device_register(&dsmg600_leds);
155#endif
156}
157
158static void __init dsmg600_fixup(struct machine_desc *desc,
159 struct tag *tags, char **cmdline, struct meminfo *mi)
160{
161 /* The xtal on this machine is non-standard. */
162 ixp4xx_timer_freq = DSMG600_FREQ;
163}
164
165MACHINE_START(DSMG600, "D-Link DSM-G600 RevA")
166 /* Maintainer: www.nslu2-linux.org */
167 .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS,
168 .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xFFFC,
169 .boot_params = 0x00000100,
170 .fixup = dsmg600_fixup,
171 .map_io = ixp4xx_map_io,
172 .init_irq = ixp4xx_init_irq,
173 .timer = &ixp4xx_timer,
174 .init_machine = dsmg600_init,
175MACHINE_END
diff --git a/arch/arm/mach-ixp4xx/ixdp425-pci.c b/arch/arm/mach-ixp4xx/ixdp425-pci.c
index 99c1dc8033c8..408796004812 100644
--- a/arch/arm/mach-ixp4xx/ixdp425-pci.c
+++ b/arch/arm/mach-ixp4xx/ixdp425-pci.c
@@ -66,7 +66,7 @@ struct hw_pci ixdp425_pci __initdata = {
66int __init ixdp425_pci_init(void) 66int __init ixdp425_pci_init(void)
67{ 67{
68 if (machine_is_ixdp425() || machine_is_ixcdp1100() || 68 if (machine_is_ixdp425() || machine_is_ixcdp1100() ||
69 machine_is_ixdp465()) 69 machine_is_ixdp465() || machine_is_kixrp435())
70 pci_common_init(&ixdp425_pci); 70 pci_common_init(&ixdp425_pci);
71 return 0; 71 return 0;
72} 72}
diff --git a/arch/arm/mach-ixp4xx/ixdp425-setup.c b/arch/arm/mach-ixp4xx/ixdp425-setup.c
index 04b1d56396a0..ec4f07950ec6 100644
--- a/arch/arm/mach-ixp4xx/ixdp425-setup.c
+++ b/arch/arm/mach-ixp4xx/ixdp425-setup.c
@@ -115,6 +115,11 @@ static void __init ixdp425_init(void)
115 ixdp425_flash_resource.end = 115 ixdp425_flash_resource.end =
116 IXP4XX_EXP_BUS_BASE(0) + ixp4xx_exp_bus_size - 1; 116 IXP4XX_EXP_BUS_BASE(0) + ixp4xx_exp_bus_size - 1;
117 117
118 if (cpu_is_ixp43x()) {
119 ixdp425_uart.num_resources = 1;
120 ixdp425_uart_data[1].flags = 0;
121 }
122
118 platform_add_devices(ixdp425_devices, ARRAY_SIZE(ixdp425_devices)); 123 platform_add_devices(ixdp425_devices, ARRAY_SIZE(ixdp425_devices));
119} 124}
120 125
@@ -156,3 +161,16 @@ MACHINE_START(IXCDP1100, "Intel IXCDP1100 Development Platform")
156 .init_machine = ixdp425_init, 161 .init_machine = ixdp425_init,
157MACHINE_END 162MACHINE_END
158#endif 163#endif
164
165#ifdef CONFIG_MACH_KIXRP435
166MACHINE_START(KIXRP435, "Intel KIXRP435 Reference Platform")
167 /* Maintainer: MontaVista Software, Inc. */
168 .phys_io = IXP4XX_PERIPHERAL_BASE_PHYS,
169 .io_pg_offst = ((IXP4XX_PERIPHERAL_BASE_VIRT) >> 18) & 0xfffc,
170 .map_io = ixp4xx_map_io,
171 .init_irq = ixp4xx_init_irq,
172 .timer = &ixp4xx_timer,
173 .boot_params = 0x0100,
174 .init_machine = ixdp425_init,
175MACHINE_END
176#endif
diff --git a/arch/arm/mach-ns9xxx/Kconfig b/arch/arm/mach-ns9xxx/Kconfig
index 8175ba92a2fa..8584ed107991 100644
--- a/arch/arm/mach-ns9xxx/Kconfig
+++ b/arch/arm/mach-ns9xxx/Kconfig
@@ -3,19 +3,30 @@ if ARCH_NS9XXX
3menu "NS9xxx Implementations" 3menu "NS9xxx Implementations"
4 4
5config MACH_CC9P9360DEV 5config MACH_CC9P9360DEV
6 bool "Connect Core 9P 9360 on an A9M9750 Devboard" 6 bool "ConnectCore 9P 9360 on an A9M9750 Devboard"
7 select PROCESSOR_NS9360 7 select PROCESSOR_NS9360
8 select BOARD_A9M9750DEV 8 select BOARD_A9M9750DEV
9 help 9 help
10 Say Y here if you are using the Digi Connect Core 9P 9360 10 Say Y here if you are using the Digi ConnectCore 9P 9360
11 on an A9M9750 Development Board. 11 on an A9M9750 Development Board.
12 12
13config MACH_CC9P9360JS
14 bool "ConnectCore 9P 9360 on a JSCC9P9360 Devboard"
15 select PROCESSOR_NS9360
16 select BOARD_JSCC9P9360
17 help
18 Say Y here if you are using the Digi ConnectCore 9P 9360
19 on an JSCC9P9360 Development Board.
20
13config PROCESSOR_NS9360 21config PROCESSOR_NS9360
14 bool 22 bool
15 23
16config BOARD_A9M9750DEV 24config BOARD_A9M9750DEV
17 bool 25 bool
18 26
27config BOARD_JSCC9P9360
28 bool
29
19endmenu 30endmenu
20 31
21endif 32endif
diff --git a/arch/arm/mach-ns9xxx/Makefile b/arch/arm/mach-ns9xxx/Makefile
index 91e945f5e16d..53213a69f601 100644
--- a/arch/arm/mach-ns9xxx/Makefile
+++ b/arch/arm/mach-ns9xxx/Makefile
@@ -3,3 +3,4 @@ obj-y := irq.o time.o generic.o
3obj-$(CONFIG_MACH_CC9P9360DEV) += mach-cc9p9360dev.o 3obj-$(CONFIG_MACH_CC9P9360DEV) += mach-cc9p9360dev.o
4 4
5obj-$(CONFIG_BOARD_A9M9750DEV) += board-a9m9750dev.o 5obj-$(CONFIG_BOARD_A9M9750DEV) += board-a9m9750dev.o
6obj-$(CONFIG_BOARD_JSCC9P9360) += board-jscc9p9360.o
diff --git a/arch/arm/mach-ns9xxx/board-jscc9p9360.c b/arch/arm/mach-ns9xxx/board-jscc9p9360.c
new file mode 100644
index 000000000000..4bd3eec04bfe
--- /dev/null
+++ b/arch/arm/mach-ns9xxx/board-jscc9p9360.c
@@ -0,0 +1,17 @@
1/*
2 * arch/arm/mach-ns9xxx/board-jscc9p9360.c
3 *
4 * Copyright (C) 2006,2007 by Digi International Inc.
5 * All rights reserved.
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License version 2 as published by
9 * the Free Software Foundation.
10 */
11#include "board-jscc9p9360.h"
12
13void __init board_jscc9p9360_init_machine(void)
14{
15 /* TODO: reserve GPIOs for push buttons, etc pp */
16}
17
diff --git a/arch/arm/mach-ns9xxx/board-jscc9p9360.h b/arch/arm/mach-ns9xxx/board-jscc9p9360.h
new file mode 100644
index 000000000000..1a81a074df45
--- /dev/null
+++ b/arch/arm/mach-ns9xxx/board-jscc9p9360.h
@@ -0,0 +1,13 @@
1/*
2 * arch/arm/mach-ns9xxx/board-jscc9p9360.h
3 *
4 * Copyright (C) 2006 by Digi International Inc.
5 * All rights reserved.
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License version 2 as published by
9 * the Free Software Foundation.
10 */
11#include <linux/init.h>
12
13void __init board_jscc9p9360_init_machine(void);
diff --git a/arch/arm/mach-ns9xxx/mach-cc9p9360js.c b/arch/arm/mach-ns9xxx/mach-cc9p9360js.c
new file mode 100644
index 000000000000..d09d5fa5620a
--- /dev/null
+++ b/arch/arm/mach-ns9xxx/mach-cc9p9360js.c
@@ -0,0 +1,29 @@
1/*
2 * arch/arm/mach-ns9xxx/mach-cc9p9360js.c
3 *
4 * Copyright (C) 2006 by Digi International Inc.
5 * All rights reserved.
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License version 2 as published by
9 * the Free Software Foundation.
10 */
11#include <asm/mach/arch.h>
12#include <asm/mach-types.h>
13
14#include "board-jscc9p9360.h"
15#include "generic.h"
16
17static void __init mach_cc9p9360js_init_machine(void)
18{
19 ns9xxx_init_machine();
20 board_jscc9p9360_init_machine();
21}
22
23MACHINE_START(CC9P9360DEV, "Digi ConnectCore 9P 9360 on an JSCC9P9360 Devboard")
24 .map_io = ns9xxx_map_io,
25 .init_irq = ns9xxx_init_irq,
26 .init_machine = mach_cc9p9360js_init_machine,
27 .timer = &ns9xxx_timer,
28 .boot_params = 0x100,
29MACHINE_END
diff --git a/arch/arm/mach-omap1/pm.c b/arch/arm/mach-omap1/pm.c
index 49efe903dacd..6f4ea4bda5e0 100644
--- a/arch/arm/mach-omap1/pm.c
+++ b/arch/arm/mach-omap1/pm.c
@@ -72,12 +72,12 @@ static unsigned int mpui1610_sleep_save[MPUI1610_SLEEP_SAVE_SIZE];
72 72
73static unsigned short enable_dyn_sleep = 1; 73static unsigned short enable_dyn_sleep = 1;
74 74
75static ssize_t omap_pm_sleep_while_idle_show(struct subsystem * subsys, char *buf) 75static ssize_t omap_pm_sleep_while_idle_show(struct kset *kset, char *buf)
76{ 76{
77 return sprintf(buf, "%hu\n", enable_dyn_sleep); 77 return sprintf(buf, "%hu\n", enable_dyn_sleep);
78} 78}
79 79
80static ssize_t omap_pm_sleep_while_idle_store(struct subsystem * subsys, 80static ssize_t omap_pm_sleep_while_idle_store(struct kset *kset,
81 const char * buf, 81 const char * buf,
82 size_t n) 82 size_t n)
83{ 83{
@@ -100,7 +100,7 @@ static struct subsys_attribute sleep_while_idle_attr = {
100 .store = omap_pm_sleep_while_idle_store, 100 .store = omap_pm_sleep_while_idle_store,
101}; 101};
102 102
103extern struct subsystem power_subsys; 103extern struct kset power_subsys;
104static void (*omap_sram_idle)(void) = NULL; 104static void (*omap_sram_idle)(void) = NULL;
105static void (*omap_sram_suspend)(unsigned long r0, unsigned long r1) = NULL; 105static void (*omap_sram_suspend)(unsigned long r0, unsigned long r1) = NULL;
106 106
@@ -698,10 +698,10 @@ static struct irqaction omap_wakeup_irq = {
698 698
699 699
700static struct pm_ops omap_pm_ops ={ 700static struct pm_ops omap_pm_ops ={
701 .pm_disk_mode = 0,
702 .prepare = omap_pm_prepare, 701 .prepare = omap_pm_prepare,
703 .enter = omap_pm_enter, 702 .enter = omap_pm_enter,
704 .finish = omap_pm_finish, 703 .finish = omap_pm_finish,
704 .valid = pm_valid_only_mem,
705}; 705};
706 706
707static int __init omap_pm_init(void) 707static int __init omap_pm_init(void)
diff --git a/arch/arm/mach-omap1/time.c b/arch/arm/mach-omap1/time.c
index 1b7e4a506c26..85e048b259f5 100644
--- a/arch/arm/mach-omap1/time.c
+++ b/arch/arm/mach-omap1/time.c
@@ -39,6 +39,10 @@
39#include <linux/interrupt.h> 39#include <linux/interrupt.h>
40#include <linux/sched.h> 40#include <linux/sched.h>
41#include <linux/spinlock.h> 41#include <linux/spinlock.h>
42#include <linux/clk.h>
43#include <linux/err.h>
44#include <linux/clocksource.h>
45#include <linux/clockchips.h>
42 46
43#include <asm/system.h> 47#include <asm/system.h>
44#include <asm/hardware.h> 48#include <asm/hardware.h>
@@ -48,13 +52,7 @@
48#include <asm/mach/irq.h> 52#include <asm/mach/irq.h>
49#include <asm/mach/time.h> 53#include <asm/mach/time.h>
50 54
51struct sys_timer omap_timer;
52 55
53/*
54 * ---------------------------------------------------------------------------
55 * MPU timer
56 * ---------------------------------------------------------------------------
57 */
58#define OMAP_MPU_TIMER_BASE OMAP_MPU_TIMER1_BASE 56#define OMAP_MPU_TIMER_BASE OMAP_MPU_TIMER1_BASE
59#define OMAP_MPU_TIMER_OFFSET 0x100 57#define OMAP_MPU_TIMER_OFFSET 0x100
60 58
@@ -88,21 +86,6 @@ static inline unsigned long long cycles_2_ns(unsigned long long cyc)
88 return (cyc * cyc2ns_scale) >> CYC2NS_SCALE_FACTOR; 86 return (cyc * cyc2ns_scale) >> CYC2NS_SCALE_FACTOR;
89} 87}
90 88
91/*
92 * MPU_TICKS_PER_SEC must be an even number, otherwise machinecycles_to_usecs
93 * will break. On P2, the timer count rate is 6.5 MHz after programming PTV
94 * with 0. This divides the 13MHz input by 2, and is undocumented.
95 */
96#if defined(CONFIG_MACH_OMAP_PERSEUS2) || defined(CONFIG_MACH_OMAP_FSAMPLE)
97/* REVISIT: This ifdef construct should be replaced by a query to clock
98 * framework to see if timer base frequency is 12.0, 13.0 or 19.2 MHz.
99 */
100#define MPU_TICKS_PER_SEC (13000000 / 2)
101#else
102#define MPU_TICKS_PER_SEC (12000000 / 2)
103#endif
104
105#define MPU_TIMER_TICK_PERIOD ((MPU_TICKS_PER_SEC / HZ) - 1)
106 89
107typedef struct { 90typedef struct {
108 u32 cntl; /* CNTL_TIMER, R/W */ 91 u32 cntl; /* CNTL_TIMER, R/W */
@@ -120,98 +103,164 @@ static inline unsigned long omap_mpu_timer_read(int nr)
120 return timer->read_tim; 103 return timer->read_tim;
121} 104}
122 105
123static inline void omap_mpu_timer_start(int nr, unsigned long load_val) 106static inline void omap_mpu_set_autoreset(int nr)
124{ 107{
125 volatile omap_mpu_timer_regs_t* timer = omap_mpu_timer_base(nr); 108 volatile omap_mpu_timer_regs_t* timer = omap_mpu_timer_base(nr);
126 109
127 timer->cntl = MPU_TIMER_CLOCK_ENABLE; 110 timer->cntl = timer->cntl | MPU_TIMER_AR;
128 udelay(1);
129 timer->load_tim = load_val;
130 udelay(1);
131 timer->cntl = (MPU_TIMER_CLOCK_ENABLE | MPU_TIMER_AR | MPU_TIMER_ST);
132} 111}
133 112
134unsigned long omap_mpu_timer_ticks_to_usecs(unsigned long nr_ticks) 113static inline void omap_mpu_remove_autoreset(int nr)
135{ 114{
136 unsigned long long nsec; 115 volatile omap_mpu_timer_regs_t* timer = omap_mpu_timer_base(nr);
137 116
138 nsec = cycles_2_ns((unsigned long long)nr_ticks); 117 timer->cntl = timer->cntl & ~MPU_TIMER_AR;
139 return (unsigned long)nsec / 1000;
140} 118}
141 119
142/* 120static inline void omap_mpu_timer_start(int nr, unsigned long load_val,
143 * Last processed system timer interrupt 121 int autoreset)
144 */ 122{
145static unsigned long omap_mpu_timer_last = 0; 123 volatile omap_mpu_timer_regs_t* timer = omap_mpu_timer_base(nr);
124 unsigned int timerflags = (MPU_TIMER_CLOCK_ENABLE | MPU_TIMER_ST);
125
126 if (autoreset) timerflags |= MPU_TIMER_AR;
127
128 timer->cntl = MPU_TIMER_CLOCK_ENABLE;
129 udelay(1);
130 timer->load_tim = load_val;
131 udelay(1);
132 timer->cntl = timerflags;
133}
146 134
147/* 135/*
148 * Returns elapsed usecs since last system timer interrupt 136 * ---------------------------------------------------------------------------
137 * MPU timer 1 ... count down to zero, interrupt, reload
138 * ---------------------------------------------------------------------------
149 */ 139 */
150static unsigned long omap_mpu_timer_gettimeoffset(void) 140static int omap_mpu_set_next_event(unsigned long cycles,
141 struct clock_event_device *evt)
151{ 142{
152 unsigned long now = 0 - omap_mpu_timer_read(0); 143 omap_mpu_timer_start(0, cycles, 0);
153 unsigned long elapsed = now - omap_mpu_timer_last; 144 return 0;
145}
154 146
155 return omap_mpu_timer_ticks_to_usecs(elapsed); 147static void omap_mpu_set_mode(enum clock_event_mode mode,
148 struct clock_event_device *evt)
149{
150 switch (mode) {
151 case CLOCK_EVT_MODE_PERIODIC:
152 omap_mpu_set_autoreset(0);
153 break;
154 case CLOCK_EVT_MODE_ONESHOT:
155 omap_mpu_remove_autoreset(0);
156 break;
157 case CLOCK_EVT_MODE_UNUSED:
158 case CLOCK_EVT_MODE_SHUTDOWN:
159 break;
160 }
156} 161}
157 162
158/* 163static struct clock_event_device clockevent_mpu_timer1 = {
159 * Elapsed time between interrupts is calculated using timer0. 164 .name = "mpu_timer1",
160 * Latency during the interrupt is calculated using timer1. 165 .features = CLOCK_EVT_FEAT_PERIODIC, CLOCK_EVT_FEAT_ONESHOT,
161 * Both timer0 and timer1 are counting at 6MHz (P2 6.5MHz). 166 .shift = 32,
162 */ 167 .set_next_event = omap_mpu_set_next_event,
163static irqreturn_t omap_mpu_timer_interrupt(int irq, void *dev_id) 168 .set_mode = omap_mpu_set_mode,
169};
170
171static irqreturn_t omap_mpu_timer1_interrupt(int irq, void *dev_id)
164{ 172{
165 unsigned long now, latency; 173 struct clock_event_device *evt = &clockevent_mpu_timer1;
166 174
167 write_seqlock(&xtime_lock); 175 evt->event_handler(evt);
168 now = 0 - omap_mpu_timer_read(0);
169 latency = MPU_TICKS_PER_SEC / HZ - omap_mpu_timer_read(1);
170 omap_mpu_timer_last = now - latency;
171 timer_tick();
172 write_sequnlock(&xtime_lock);
173 176
174 return IRQ_HANDLED; 177 return IRQ_HANDLED;
175} 178}
176 179
177static struct irqaction omap_mpu_timer_irq = { 180static struct irqaction omap_mpu_timer1_irq = {
178 .name = "mpu timer", 181 .name = "mpu_timer1",
179 .flags = IRQF_DISABLED | IRQF_TIMER, 182 .flags = IRQF_DISABLED | IRQF_TIMER,
180 .handler = omap_mpu_timer_interrupt, 183 .handler = omap_mpu_timer1_interrupt,
181}; 184};
182 185
183static unsigned long omap_mpu_timer1_overflows; 186static __init void omap_init_mpu_timer(unsigned long rate)
184static irqreturn_t omap_mpu_timer1_interrupt(int irq, void *dev_id) 187{
188 set_cyc2ns_scale(rate / 1000);
189
190 setup_irq(INT_TIMER1, &omap_mpu_timer1_irq);
191 omap_mpu_timer_start(0, (rate / HZ) - 1, 1);
192
193 clockevent_mpu_timer1.mult = div_sc(rate, NSEC_PER_SEC,
194 clockevent_mpu_timer1.shift);
195 clockevent_mpu_timer1.max_delta_ns =
196 clockevent_delta2ns(-1, &clockevent_mpu_timer1);
197 clockevent_mpu_timer1.min_delta_ns =
198 clockevent_delta2ns(1, &clockevent_mpu_timer1);
199
200 clockevent_mpu_timer1.cpumask = cpumask_of_cpu(0);
201 clockevents_register_device(&clockevent_mpu_timer1);
202}
203
204
205/*
206 * ---------------------------------------------------------------------------
207 * MPU timer 2 ... free running 32-bit clock source and scheduler clock
208 * ---------------------------------------------------------------------------
209 */
210
211static unsigned long omap_mpu_timer2_overflows;
212
213static irqreturn_t omap_mpu_timer2_interrupt(int irq, void *dev_id)
185{ 214{
186 omap_mpu_timer1_overflows++; 215 omap_mpu_timer2_overflows++;
187 return IRQ_HANDLED; 216 return IRQ_HANDLED;
188} 217}
189 218
190static struct irqaction omap_mpu_timer1_irq = { 219static struct irqaction omap_mpu_timer2_irq = {
191 .name = "mpu timer1 overflow", 220 .name = "mpu_timer2",
192 .flags = IRQF_DISABLED, 221 .flags = IRQF_DISABLED,
193 .handler = omap_mpu_timer1_interrupt, 222 .handler = omap_mpu_timer2_interrupt,
194}; 223};
195 224
196static __init void omap_init_mpu_timer(void) 225static cycle_t mpu_read(void)
197{ 226{
198 set_cyc2ns_scale(MPU_TICKS_PER_SEC / 1000); 227 return ~omap_mpu_timer_read(1);
199 omap_timer.offset = omap_mpu_timer_gettimeoffset; 228}
200 setup_irq(INT_TIMER1, &omap_mpu_timer1_irq); 229
201 setup_irq(INT_TIMER2, &omap_mpu_timer_irq); 230static struct clocksource clocksource_mpu = {
202 omap_mpu_timer_start(0, 0xffffffff); 231 .name = "mpu_timer2",
203 omap_mpu_timer_start(1, MPU_TIMER_TICK_PERIOD); 232 .rating = 300,
233 .read = mpu_read,
234 .mask = CLOCKSOURCE_MASK(32),
235 .shift = 24,
236 .flags = CLOCK_SOURCE_IS_CONTINUOUS,
237};
238
239static void __init omap_init_clocksource(unsigned long rate)
240{
241 static char err[] __initdata = KERN_ERR
242 "%s: can't register clocksource!\n";
243
244 clocksource_mpu.mult
245 = clocksource_khz2mult(rate/1000, clocksource_mpu.shift);
246
247 setup_irq(INT_TIMER2, &omap_mpu_timer2_irq);
248 omap_mpu_timer_start(1, ~0, 1);
249
250 if (clocksource_register(&clocksource_mpu))
251 printk(err, clocksource_mpu.name);
204} 252}
205 253
254
206/* 255/*
207 * Scheduler clock - returns current time in nanosec units. 256 * Scheduler clock - returns current time in nanosec units.
208 */ 257 */
209unsigned long long sched_clock(void) 258unsigned long long sched_clock(void)
210{ 259{
211 unsigned long ticks = 0 - omap_mpu_timer_read(0); 260 unsigned long ticks = 0 - omap_mpu_timer_read(1);
212 unsigned long long ticks64; 261 unsigned long long ticks64;
213 262
214 ticks64 = omap_mpu_timer1_overflows; 263 ticks64 = omap_mpu_timer2_overflows;
215 ticks64 <<= 32; 264 ticks64 <<= 32;
216 ticks64 |= ticks; 265 ticks64 |= ticks;
217 266
@@ -225,10 +274,21 @@ unsigned long long sched_clock(void)
225 */ 274 */
226static void __init omap_timer_init(void) 275static void __init omap_timer_init(void)
227{ 276{
228 omap_init_mpu_timer(); 277 struct clk *ck_ref = clk_get(NULL, "ck_ref");
278 unsigned long rate;
279
280 BUG_ON(IS_ERR(ck_ref));
281
282 rate = clk_get_rate(ck_ref);
283 clk_put(ck_ref);
284
285 /* PTV = 0 */
286 rate /= 2;
287
288 omap_init_mpu_timer(rate);
289 omap_init_clocksource(rate);
229} 290}
230 291
231struct sys_timer omap_timer = { 292struct sys_timer omap_timer = {
232 .init = omap_timer_init, 293 .init = omap_timer_init,
233 .offset = NULL, /* Initialized later */
234}; 294};
diff --git a/arch/arm/mach-omap2/pm.c b/arch/arm/mach-omap2/pm.c
index d7eee99b7e3f..6f4a5436d0ce 100644
--- a/arch/arm/mach-omap2/pm.c
+++ b/arch/arm/mach-omap2/pm.c
@@ -370,10 +370,10 @@ static int omap2_pm_finish(suspend_state_t state)
370} 370}
371 371
372static struct pm_ops omap_pm_ops = { 372static struct pm_ops omap_pm_ops = {
373 .pm_disk_mode = 0,
374 .prepare = omap2_pm_prepare, 373 .prepare = omap2_pm_prepare,
375 .enter = omap2_pm_enter, 374 .enter = omap2_pm_enter,
376 .finish = omap2_pm_finish, 375 .finish = omap2_pm_finish,
376 .valid = pm_valid_only_mem,
377}; 377};
378 378
379int __init omap2_pm_init(void) 379int __init omap2_pm_init(void)
diff --git a/arch/arm/mach-pnx4008/pm.c b/arch/arm/mach-pnx4008/pm.c
index 3649cd3dfc9a..2a137f33f752 100644
--- a/arch/arm/mach-pnx4008/pm.c
+++ b/arch/arm/mach-pnx4008/pm.c
@@ -107,50 +107,19 @@ static int pnx4008_pm_enter(suspend_state_t state)
107 case PM_SUSPEND_MEM: 107 case PM_SUSPEND_MEM:
108 pnx4008_suspend(); 108 pnx4008_suspend();
109 break; 109 break;
110 case PM_SUSPEND_DISK:
111 return -ENOTSUPP;
112 default:
113 return -EINVAL;
114 } 110 }
115 return 0; 111 return 0;
116} 112}
117 113
118/* 114static int pnx4008_pm_valid(suspend_state_t state)
119 * Called after processes are frozen, but before we shut down devices.
120 */
121static int pnx4008_pm_prepare(suspend_state_t state)
122{
123 switch (state) {
124 case PM_SUSPEND_STANDBY:
125 case PM_SUSPEND_MEM:
126 break;
127
128 case PM_SUSPEND_DISK:
129 return -ENOTSUPP;
130 break;
131
132 default:
133 return -EINVAL;
134 break;
135 }
136 return 0;
137}
138
139/*
140 * Called after devices are re-setup, but before processes are thawed.
141 */
142static int pnx4008_pm_finish(suspend_state_t state)
143{ 115{
144 return 0; 116 return (state == PM_SUSPEND_STANDBY) ||
117 (state == PM_SUSPEND_MEM);
145} 118}
146 119
147/*
148 * Set to PM_DISK_FIRMWARE so we can quickly veto suspend-to-disk.
149 */
150static struct pm_ops pnx4008_pm_ops = { 120static struct pm_ops pnx4008_pm_ops = {
151 .prepare = pnx4008_pm_prepare,
152 .enter = pnx4008_pm_enter, 121 .enter = pnx4008_pm_enter,
153 .finish = pnx4008_pm_finish, 122 .valid = pnx4008_pm_valid,
154}; 123};
155 124
156static int __init pnx4008_pm_init(void) 125static int __init pnx4008_pm_init(void)
diff --git a/arch/arm/mach-pxa/generic.c b/arch/arm/mach-pxa/generic.c
index b8cb79f899d5..64b08b744f9f 100644
--- a/arch/arm/mach-pxa/generic.c
+++ b/arch/arm/mach-pxa/generic.c
@@ -164,9 +164,9 @@ void pxa_set_cken(int clock, int enable)
164 local_irq_save(flags); 164 local_irq_save(flags);
165 165
166 if (enable) 166 if (enable)
167 CKEN |= clock; 167 CKEN |= (1 << clock);
168 else 168 else
169 CKEN &= ~clock; 169 CKEN &= ~(1 << clock);
170 170
171 local_irq_restore(flags); 171 local_irq_restore(flags);
172} 172}
diff --git a/arch/arm/mach-pxa/irq.c b/arch/arm/mach-pxa/irq.c
index 9f7499b6d435..4619d5fe606c 100644
--- a/arch/arm/mach-pxa/irq.c
+++ b/arch/arm/mach-pxa/irq.c
@@ -38,11 +38,33 @@ static void pxa_unmask_low_irq(unsigned int irq)
38 ICMR |= (1 << (irq + PXA_IRQ_SKIP)); 38 ICMR |= (1 << (irq + PXA_IRQ_SKIP));
39} 39}
40 40
41static int pxa_set_wake(unsigned int irq, unsigned int on)
42{
43 u32 mask;
44
45 switch (irq) {
46 case IRQ_RTCAlrm:
47 mask = PWER_RTC;
48 break;
49#ifdef CONFIG_PXA27x
50 /* REVISIT can handle USBH1, USBH2, USB, MSL, USIM, ... */
51#endif
52 default:
53 return -EINVAL;
54 }
55 if (on)
56 PWER |= mask;
57 else
58 PWER &= ~mask;
59 return 0;
60}
61
41static struct irq_chip pxa_internal_chip_low = { 62static struct irq_chip pxa_internal_chip_low = {
42 .name = "SC", 63 .name = "SC",
43 .ack = pxa_mask_low_irq, 64 .ack = pxa_mask_low_irq,
44 .mask = pxa_mask_low_irq, 65 .mask = pxa_mask_low_irq,
45 .unmask = pxa_unmask_low_irq, 66 .unmask = pxa_unmask_low_irq,
67 .set_wake = pxa_set_wake,
46}; 68};
47 69
48#if PXA_INTERNAL_IRQS > 32 70#if PXA_INTERNAL_IRQS > 32
@@ -70,6 +92,26 @@ static struct irq_chip pxa_internal_chip_high = {
70 92
71#endif 93#endif
72 94
95/* Note that if an input/irq line ever gets changed to an output during
96 * suspend, the relevant PWER, PRER, and PFER bits should be cleared.
97 */
98#ifdef CONFIG_PXA27x
99
100/* PXA27x: Various gpios can issue wakeup events. This logic only
101 * handles the simple cases, not the WEMUX2 and WEMUX3 options
102 */
103#define PXA27x_GPIO_NOWAKE_MASK \
104 ((1 << 8) | (1 << 7) | (1 << 6) | (1 << 5) | (1 << 2))
105#define WAKEMASK(gpio) \
106 (((gpio) <= 15) \
107 ? ((1 << (gpio)) & ~PXA27x_GPIO_NOWAKE_MASK) \
108 : ((gpio == 35) ? (1 << 24) : 0))
109#else
110
111/* pxa 210, 250, 255, 26x: gpios 0..15 can issue wakeups */
112#define WAKEMASK(gpio) (((gpio) <= 15) ? (1 << (gpio)) : 0)
113#endif
114
73/* 115/*
74 * PXA GPIO edge detection for IRQs: 116 * PXA GPIO edge detection for IRQs:
75 * IRQs are generated on Falling-Edge, Rising-Edge, or both. 117 * IRQs are generated on Falling-Edge, Rising-Edge, or both.
@@ -83,9 +125,11 @@ static long GPIO_IRQ_mask[4];
83static int pxa_gpio_irq_type(unsigned int irq, unsigned int type) 125static int pxa_gpio_irq_type(unsigned int irq, unsigned int type)
84{ 126{
85 int gpio, idx; 127 int gpio, idx;
128 u32 mask;
86 129
87 gpio = IRQ_TO_GPIO(irq); 130 gpio = IRQ_TO_GPIO(irq);
88 idx = gpio >> 5; 131 idx = gpio >> 5;
132 mask = WAKEMASK(gpio);
89 133
90 if (type == IRQT_PROBE) { 134 if (type == IRQT_PROBE) {
91 /* Don't mess with enabled GPIOs using preconfigured edges or 135 /* Don't mess with enabled GPIOs using preconfigured edges or
@@ -105,14 +149,20 @@ static int pxa_gpio_irq_type(unsigned int irq, unsigned int type)
105 if (type & __IRQT_RISEDGE) { 149 if (type & __IRQT_RISEDGE) {
106 /* printk("rising "); */ 150 /* printk("rising "); */
107 __set_bit (gpio, GPIO_IRQ_rising_edge); 151 __set_bit (gpio, GPIO_IRQ_rising_edge);
108 } else 152 PRER |= mask;
153 } else {
109 __clear_bit (gpio, GPIO_IRQ_rising_edge); 154 __clear_bit (gpio, GPIO_IRQ_rising_edge);
155 PRER &= ~mask;
156 }
110 157
111 if (type & __IRQT_FALEDGE) { 158 if (type & __IRQT_FALEDGE) {
112 /* printk("falling "); */ 159 /* printk("falling "); */
113 __set_bit (gpio, GPIO_IRQ_falling_edge); 160 __set_bit (gpio, GPIO_IRQ_falling_edge);
114 } else 161 PFER |= mask;
162 } else {
115 __clear_bit (gpio, GPIO_IRQ_falling_edge); 163 __clear_bit (gpio, GPIO_IRQ_falling_edge);
164 PFER &= ~mask;
165 }
116 166
117 /* printk("edges\n"); */ 167 /* printk("edges\n"); */
118 168
@@ -130,12 +180,29 @@ static void pxa_ack_low_gpio(unsigned int irq)
130 GEDR0 = (1 << (irq - IRQ_GPIO0)); 180 GEDR0 = (1 << (irq - IRQ_GPIO0));
131} 181}
132 182
183static int pxa_set_gpio_wake(unsigned int irq, unsigned int on)
184{
185 int gpio = IRQ_TO_GPIO(irq);
186 u32 mask = WAKEMASK(gpio);
187
188 if (!mask)
189 return -EINVAL;
190
191 if (on)
192 PWER |= mask;
193 else
194 PWER &= ~mask;
195 return 0;
196}
197
198
133static struct irq_chip pxa_low_gpio_chip = { 199static struct irq_chip pxa_low_gpio_chip = {
134 .name = "GPIO-l", 200 .name = "GPIO-l",
135 .ack = pxa_ack_low_gpio, 201 .ack = pxa_ack_low_gpio,
136 .mask = pxa_mask_low_irq, 202 .mask = pxa_mask_low_irq,
137 .unmask = pxa_unmask_low_irq, 203 .unmask = pxa_unmask_low_irq,
138 .set_type = pxa_gpio_irq_type, 204 .set_type = pxa_gpio_irq_type,
205 .set_wake = pxa_set_gpio_wake,
139}; 206};
140 207
141/* 208/*
@@ -244,6 +311,7 @@ static struct irq_chip pxa_muxed_gpio_chip = {
244 .mask = pxa_mask_muxed_gpio, 311 .mask = pxa_mask_muxed_gpio,
245 .unmask = pxa_unmask_muxed_gpio, 312 .unmask = pxa_unmask_muxed_gpio,
246 .set_type = pxa_gpio_irq_type, 313 .set_type = pxa_gpio_irq_type,
314 .set_wake = pxa_set_gpio_wake,
247}; 315};
248 316
249 317
diff --git a/arch/arm/mach-pxa/lpd270.c b/arch/arm/mach-pxa/lpd270.c
index 8e27a64fa9f4..e3097664ffe1 100644
--- a/arch/arm/mach-pxa/lpd270.c
+++ b/arch/arm/mach-pxa/lpd270.c
@@ -234,7 +234,7 @@ static void lpd270_backlight_power(int on)
234{ 234{
235 if (on) { 235 if (on) {
236 pxa_gpio_mode(GPIO16_PWM0_MD); 236 pxa_gpio_mode(GPIO16_PWM0_MD);
237 pxa_set_cken(CKEN0_PWM0, 1); 237 pxa_set_cken(CKEN_PWM0, 1);
238 PWM_CTRL0 = 0; 238 PWM_CTRL0 = 0;
239 PWM_PWDUTY0 = 0x3ff; 239 PWM_PWDUTY0 = 0x3ff;
240 PWM_PERVAL0 = 0x3ff; 240 PWM_PERVAL0 = 0x3ff;
@@ -242,7 +242,7 @@ static void lpd270_backlight_power(int on)
242 PWM_CTRL0 = 0; 242 PWM_CTRL0 = 0;
243 PWM_PWDUTY0 = 0x0; 243 PWM_PWDUTY0 = 0x0;
244 PWM_PERVAL0 = 0x3FF; 244 PWM_PERVAL0 = 0x3FF;
245 pxa_set_cken(CKEN0_PWM0, 0); 245 pxa_set_cken(CKEN_PWM0, 0);
246 } 246 }
247} 247}
248 248
diff --git a/arch/arm/mach-pxa/lubbock.c b/arch/arm/mach-pxa/lubbock.c
index 055de7f4f00a..6377b2e29ff0 100644
--- a/arch/arm/mach-pxa/lubbock.c
+++ b/arch/arm/mach-pxa/lubbock.c
@@ -220,7 +220,7 @@ static struct resource pxa_ssp_resources[] = {
220 220
221static struct pxa2xx_spi_master pxa_ssp_master_info = { 221static struct pxa2xx_spi_master pxa_ssp_master_info = {
222 .ssp_type = PXA25x_SSP, 222 .ssp_type = PXA25x_SSP,
223 .clock_enable = CKEN3_SSP, 223 .clock_enable = CKEN_SSP,
224 .num_chipselect = 0, 224 .num_chipselect = 0,
225}; 225};
226 226
diff --git a/arch/arm/mach-pxa/mainstone.c b/arch/arm/mach-pxa/mainstone.c
index 56d94d88d5ca..ed99a81b98f3 100644
--- a/arch/arm/mach-pxa/mainstone.c
+++ b/arch/arm/mach-pxa/mainstone.c
@@ -266,7 +266,7 @@ static void mainstone_backlight_power(int on)
266{ 266{
267 if (on) { 267 if (on) {
268 pxa_gpio_mode(GPIO16_PWM0_MD); 268 pxa_gpio_mode(GPIO16_PWM0_MD);
269 pxa_set_cken(CKEN0_PWM0, 1); 269 pxa_set_cken(CKEN_PWM0, 1);
270 PWM_CTRL0 = 0; 270 PWM_CTRL0 = 0;
271 PWM_PWDUTY0 = 0x3ff; 271 PWM_PWDUTY0 = 0x3ff;
272 PWM_PERVAL0 = 0x3ff; 272 PWM_PERVAL0 = 0x3ff;
@@ -274,7 +274,7 @@ static void mainstone_backlight_power(int on)
274 PWM_CTRL0 = 0; 274 PWM_CTRL0 = 0;
275 PWM_PWDUTY0 = 0x0; 275 PWM_PWDUTY0 = 0x0;
276 PWM_PERVAL0 = 0x3FF; 276 PWM_PERVAL0 = 0x3FF;
277 pxa_set_cken(CKEN0_PWM0, 0); 277 pxa_set_cken(CKEN_PWM0, 0);
278 } 278 }
279} 279}
280 280
diff --git a/arch/arm/mach-pxa/pm.c b/arch/arm/mach-pxa/pm.c
index b4d8276d6050..6bf15ae73848 100644
--- a/arch/arm/mach-pxa/pm.c
+++ b/arch/arm/mach-pxa/pm.c
@@ -223,14 +223,11 @@ int pxa_pm_finish(suspend_state_t state)
223 223
224EXPORT_SYMBOL_GPL(pxa_pm_finish); 224EXPORT_SYMBOL_GPL(pxa_pm_finish);
225 225
226/*
227 * Set to PM_DISK_FIRMWARE so we can quickly veto suspend-to-disk.
228 */
229static struct pm_ops pxa_pm_ops = { 226static struct pm_ops pxa_pm_ops = {
230 .pm_disk_mode = PM_DISK_FIRMWARE,
231 .prepare = pxa_pm_prepare, 227 .prepare = pxa_pm_prepare,
232 .enter = pxa_pm_enter, 228 .enter = pxa_pm_enter,
233 .finish = pxa_pm_finish, 229 .finish = pxa_pm_finish,
230 .valid = pm_valid_only_mem,
234}; 231};
235 232
236static int __init pxa_pm_init(void) 233static int __init pxa_pm_init(void)
diff --git a/arch/arm/mach-pxa/pxa27x.c b/arch/arm/mach-pxa/pxa27x.c
index 74eeada1e2fc..c64bab49efc4 100644
--- a/arch/arm/mach-pxa/pxa27x.c
+++ b/arch/arm/mach-pxa/pxa27x.c
@@ -140,9 +140,9 @@ void pxa_cpu_pm_enter(suspend_state_t state)
140 extern void pxa_cpu_resume(void); 140 extern void pxa_cpu_resume(void);
141 141
142 if (state == PM_SUSPEND_STANDBY) 142 if (state == PM_SUSPEND_STANDBY)
143 CKEN = CKEN22_MEMC | CKEN9_OSTIMER | CKEN16_LCD |CKEN0_PWM0; 143 CKEN = CKEN_MEMC | CKEN_OSTIMER | CKEN_LCD | CKEN_PWM0;
144 else 144 else
145 CKEN = CKEN22_MEMC | CKEN9_OSTIMER; 145 CKEN = CKEN_MEMC | CKEN_OSTIMER;
146 146
147 /* ensure voltage-change sequencer not initiated, which hangs */ 147 /* ensure voltage-change sequencer not initiated, which hangs */
148 PCFR &= ~PCFR_FVC; 148 PCFR &= ~PCFR_FVC;
diff --git a/arch/arm/mach-pxa/ssp.c b/arch/arm/mach-pxa/ssp.c
index 6cc202755fb4..71766ac0328b 100644
--- a/arch/arm/mach-pxa/ssp.c
+++ b/arch/arm/mach-pxa/ssp.c
@@ -52,13 +52,13 @@ struct ssp_info_ {
52 */ 52 */
53static const struct ssp_info_ ssp_info[PXA_SSP_PORTS] = { 53static const struct ssp_info_ ssp_info[PXA_SSP_PORTS] = {
54#if defined (CONFIG_PXA27x) 54#if defined (CONFIG_PXA27x)
55 {IRQ_SSP, CKEN23_SSP1}, 55 {IRQ_SSP, CKEN_SSP1},
56 {IRQ_SSP2, CKEN3_SSP2}, 56 {IRQ_SSP2, CKEN_SSP2},
57 {IRQ_SSP3, CKEN4_SSP3}, 57 {IRQ_SSP3, CKEN_SSP3},
58#else 58#else
59 {IRQ_SSP, CKEN3_SSP}, 59 {IRQ_SSP, CKEN_SSP},
60 {IRQ_NSSP, CKEN9_NSSP}, 60 {IRQ_NSSP, CKEN_NSSP},
61 {IRQ_ASSP, CKEN10_ASSP}, 61 {IRQ_ASSP, CKEN_ASSP},
62#endif 62#endif
63}; 63};
64 64
diff --git a/arch/arm/mach-rpc/riscpc.c b/arch/arm/mach-rpc/riscpc.c
index 208a2b5dba1b..570cf937e73b 100644
--- a/arch/arm/mach-rpc/riscpc.c
+++ b/arch/arm/mach-rpc/riscpc.c
@@ -17,6 +17,7 @@
17#include <linux/sched.h> 17#include <linux/sched.h>
18#include <linux/device.h> 18#include <linux/device.h>
19#include <linux/serial_8250.h> 19#include <linux/serial_8250.h>
20#include <linux/pata_platform.h>
20 21
21#include <asm/elf.h> 22#include <asm/elf.h>
22#include <asm/io.h> 23#include <asm/io.h>
@@ -159,11 +160,45 @@ static struct platform_device serial_device = {
159 }, 160 },
160}; 161};
161 162
163static struct pata_platform_info pata_platform_data = {
164 .ioport_shift = 2,
165};
166
167static struct resource pata_resources[] = {
168 [0] = {
169 .start = 0x030107c0,
170 .end = 0x030107df,
171 .flags = IORESOURCE_MEM,
172 },
173 [1] = {
174 .start = 0x03010fd8,
175 .end = 0x03010fdb,
176 .flags = IORESOURCE_MEM,
177 },
178 [2] = {
179 .start = IRQ_HARDDISK,
180 .end = IRQ_HARDDISK,
181 .flags = IORESOURCE_IRQ,
182 },
183};
184
185static struct platform_device pata_device = {
186 .name = "pata_platform",
187 .id = -1,
188 .num_resources = ARRAY_SIZE(pata_resources),
189 .resource = pata_resources,
190 .dev = {
191 .platform_data = &pata_platform_data,
192 .coherent_dma_mask = ~0, /* grumble */
193 },
194};
195
162static struct platform_device *devs[] __initdata = { 196static struct platform_device *devs[] __initdata = {
163 &iomd_device, 197 &iomd_device,
164 &kbd_device, 198 &kbd_device,
165 &serial_device, 199 &serial_device,
166 &acornfb_device, 200 &acornfb_device,
201 &pata_device,
167}; 202};
168 203
169static int __init rpc_init(void) 204static int __init rpc_init(void)
diff --git a/arch/arm/mach-s3c2410/mach-amlm5900.c b/arch/arm/mach-s3c2410/mach-amlm5900.c
index 72f2cc4fcd03..bc308ceb91c3 100644
--- a/arch/arm/mach-s3c2410/mach-amlm5900.c
+++ b/arch/arm/mach-s3c2410/mach-amlm5900.c
@@ -160,17 +160,11 @@ static struct platform_device *amlm5900_devices[] __initdata = {
160#endif 160#endif
161}; 161};
162 162
163static struct s3c24xx_board amlm5900_board __initdata = {
164 .devices = amlm5900_devices,
165 .devices_count = ARRAY_SIZE(amlm5900_devices)
166};
167
168void __init amlm5900_map_io(void) 163void __init amlm5900_map_io(void)
169{ 164{
170 s3c24xx_init_io(amlm5900_iodesc, ARRAY_SIZE(amlm5900_iodesc)); 165 s3c24xx_init_io(amlm5900_iodesc, ARRAY_SIZE(amlm5900_iodesc));
171 s3c24xx_init_clocks(0); 166 s3c24xx_init_clocks(0);
172 s3c24xx_init_uarts(amlm5900_uartcfgs, ARRAY_SIZE(amlm5900_uartcfgs)); 167 s3c24xx_init_uarts(amlm5900_uartcfgs, ARRAY_SIZE(amlm5900_uartcfgs));
173 s3c24xx_set_board(&amlm5900_board);
174} 168}
175 169
176#ifdef CONFIG_FB_S3C2410 170#ifdef CONFIG_FB_S3C2410
@@ -247,6 +241,7 @@ static void __init amlm5900_init(void)
247#ifdef CONFIG_FB_S3C2410 241#ifdef CONFIG_FB_S3C2410
248 s3c24xx_fb_set_platdata(&amlm5900_lcd_info); 242 s3c24xx_fb_set_platdata(&amlm5900_lcd_info);
249#endif 243#endif
244 platform_add_devices(amlm5900_devices, ARRAY_SIZE(amlm5900_devices));
250} 245}
251 246
252MACHINE_START(AML_M5900, "AML_M5900") 247MACHINE_START(AML_M5900, "AML_M5900")
diff --git a/arch/arm/mach-s3c2410/mach-bast.c b/arch/arm/mach-s3c2410/mach-bast.c
index 7b81296427eb..f01de807b72f 100644
--- a/arch/arm/mach-s3c2410/mach-bast.c
+++ b/arch/arm/mach-s3c2410/mach-bast.c
@@ -464,13 +464,6 @@ static struct clk *bast_clocks[] = {
464 &s3c24xx_uclk, 464 &s3c24xx_uclk,
465}; 465};
466 466
467static struct s3c24xx_board bast_board __initdata = {
468 .devices = bast_devices,
469 .devices_count = ARRAY_SIZE(bast_devices),
470 .clocks = bast_clocks,
471 .clocks_count = ARRAY_SIZE(bast_clocks),
472};
473
474static void __init bast_map_io(void) 467static void __init bast_map_io(void)
475{ 468{
476 /* initialise the clocks */ 469 /* initialise the clocks */
@@ -486,19 +479,22 @@ static void __init bast_map_io(void)
486 479
487 s3c24xx_uclk.parent = &s3c24xx_clkout1; 480 s3c24xx_uclk.parent = &s3c24xx_clkout1;
488 481
482 s3c24xx_register_clocks(bast_clocks, ARRAY_SIZE(bast_clocks));
483
489 s3c_device_nand.dev.platform_data = &bast_nand_info; 484 s3c_device_nand.dev.platform_data = &bast_nand_info;
490 s3c_device_i2c.dev.platform_data = &bast_i2c_info; 485 s3c_device_i2c.dev.platform_data = &bast_i2c_info;
491 486
492 s3c24xx_init_io(bast_iodesc, ARRAY_SIZE(bast_iodesc)); 487 s3c24xx_init_io(bast_iodesc, ARRAY_SIZE(bast_iodesc));
493 s3c24xx_init_clocks(0); 488 s3c24xx_init_clocks(0);
494 s3c24xx_init_uarts(bast_uartcfgs, ARRAY_SIZE(bast_uartcfgs)); 489 s3c24xx_init_uarts(bast_uartcfgs, ARRAY_SIZE(bast_uartcfgs));
495 s3c24xx_set_board(&bast_board); 490
496 usb_simtec_init(); 491 usb_simtec_init();
497} 492}
498 493
499static void __init bast_init(void) 494static void __init bast_init(void)
500{ 495{
501 s3c24xx_fb_set_platdata(&bast_lcd_info); 496 s3c24xx_fb_set_platdata(&bast_lcd_info);
497 platform_add_devices(bast_devices, ARRAY_SIZE(bast_devices));
502} 498}
503 499
504MACHINE_START(BAST, "Simtec-BAST") 500MACHINE_START(BAST, "Simtec-BAST")
diff --git a/arch/arm/mach-s3c2410/mach-h1940.c b/arch/arm/mach-s3c2410/mach-h1940.c
index d052ab2d9377..5d5f00e9c462 100644
--- a/arch/arm/mach-s3c2410/mach-h1940.c
+++ b/arch/arm/mach-s3c2410/mach-h1940.c
@@ -129,7 +129,6 @@ static struct s3c2410_udc_mach_info h1940_udc_cfg __initdata = {
129}; 129};
130 130
131 131
132
133/** 132/**
134 * Set lcd on or off 133 * Set lcd on or off
135 **/ 134 **/
@@ -188,17 +187,11 @@ static struct platform_device *h1940_devices[] __initdata = {
188 &s3c_device_leds, 187 &s3c_device_leds,
189}; 188};
190 189
191static struct s3c24xx_board h1940_board __initdata = {
192 .devices = h1940_devices,
193 .devices_count = ARRAY_SIZE(h1940_devices)
194};
195
196static void __init h1940_map_io(void) 190static void __init h1940_map_io(void)
197{ 191{
198 s3c24xx_init_io(h1940_iodesc, ARRAY_SIZE(h1940_iodesc)); 192 s3c24xx_init_io(h1940_iodesc, ARRAY_SIZE(h1940_iodesc));
199 s3c24xx_init_clocks(0); 193 s3c24xx_init_clocks(0);
200 s3c24xx_init_uarts(h1940_uartcfgs, ARRAY_SIZE(h1940_uartcfgs)); 194 s3c24xx_init_uarts(h1940_uartcfgs, ARRAY_SIZE(h1940_uartcfgs));
201 s3c24xx_set_board(&h1940_board);
202 195
203 /* setup PM */ 196 /* setup PM */
204 197
@@ -232,6 +225,8 @@ static void __init h1940_init(void)
232 | (0x02 << S3C2410_PLLCON_PDIVSHIFT) 225 | (0x02 << S3C2410_PLLCON_PDIVSHIFT)
233 | (0x03 << S3C2410_PLLCON_SDIVSHIFT); 226 | (0x03 << S3C2410_PLLCON_SDIVSHIFT);
234 writel(tmp, S3C2410_UPLLCON); 227 writel(tmp, S3C2410_UPLLCON);
228
229 platform_add_devices(h1940_devices, ARRAY_SIZE(h1940_devices));
235} 230}
236 231
237MACHINE_START(H1940, "IPAQ-H1940") 232MACHINE_START(H1940, "IPAQ-H1940")
diff --git a/arch/arm/mach-s3c2410/mach-n30.c b/arch/arm/mach-s3c2410/mach-n30.c
index 261aa4cc0770..412e50c3d28a 100644
--- a/arch/arm/mach-s3c2410/mach-n30.c
+++ b/arch/arm/mach-s3c2410/mach-n30.c
@@ -90,17 +90,11 @@ static struct s3c2410_platform_i2c n30_i2ccfg = {
90 .max_freq = 10*1000, 90 .max_freq = 10*1000,
91}; 91};
92 92
93static struct s3c24xx_board n30_board __initdata = {
94 .devices = n30_devices,
95 .devices_count = ARRAY_SIZE(n30_devices)
96};
97
98static void __init n30_map_io(void) 93static void __init n30_map_io(void)
99{ 94{
100 s3c24xx_init_io(n30_iodesc, ARRAY_SIZE(n30_iodesc)); 95 s3c24xx_init_io(n30_iodesc, ARRAY_SIZE(n30_iodesc));
101 s3c24xx_init_clocks(0); 96 s3c24xx_init_clocks(0);
102 s3c24xx_init_uarts(n30_uartcfgs, ARRAY_SIZE(n30_uartcfgs)); 97 s3c24xx_init_uarts(n30_uartcfgs, ARRAY_SIZE(n30_uartcfgs));
103 s3c24xx_set_board(&n30_board);
104} 98}
105 99
106static void __init n30_init_irq(void) 100static void __init n30_init_irq(void)
@@ -120,6 +114,8 @@ static void __init n30_init(void)
120 s3c2410_modify_misccr(S3C2410_MISCCR_USBHOST | 114 s3c2410_modify_misccr(S3C2410_MISCCR_USBHOST |
121 S3C2410_MISCCR_USBSUSPND0 | 115 S3C2410_MISCCR_USBSUSPND0 |
122 S3C2410_MISCCR_USBSUSPND1, 0x0); 116 S3C2410_MISCCR_USBSUSPND1, 0x0);
117
118 platform_add_devices(n30_devices, ARRAY_SIZE(n30_devices));
123} 119}
124 120
125MACHINE_START(N30, "Acer-N30") 121MACHINE_START(N30, "Acer-N30")
diff --git a/arch/arm/mach-s3c2410/mach-otom.c b/arch/arm/mach-s3c2410/mach-otom.c
index c78ab75b44f3..1f899fa588df 100644
--- a/arch/arm/mach-s3c2410/mach-otom.c
+++ b/arch/arm/mach-s3c2410/mach-otom.c
@@ -100,20 +100,17 @@ static struct platform_device *otom11_devices[] __initdata = {
100 &otom_device_nor, 100 &otom_device_nor,
101}; 101};
102 102
103static struct s3c24xx_board otom11_board __initdata = {
104 .devices = otom11_devices,
105 .devices_count = ARRAY_SIZE(otom11_devices)
106};
107
108
109static void __init otom11_map_io(void) 103static void __init otom11_map_io(void)
110{ 104{
111 s3c24xx_init_io(otom11_iodesc, ARRAY_SIZE(otom11_iodesc)); 105 s3c24xx_init_io(otom11_iodesc, ARRAY_SIZE(otom11_iodesc));
112 s3c24xx_init_clocks(0); 106 s3c24xx_init_clocks(0);
113 s3c24xx_init_uarts(otom11_uartcfgs, ARRAY_SIZE(otom11_uartcfgs)); 107 s3c24xx_init_uarts(otom11_uartcfgs, ARRAY_SIZE(otom11_uartcfgs));
114 s3c24xx_set_board(&otom11_board);
115} 108}
116 109
110static void __init otom11_init(void)
111{
112 platform_add_devices(otom11_devices, ARRAY_SIZE(otom11_devices));
113}
117 114
118MACHINE_START(OTOM, "Nex Vision - Otom 1.1") 115MACHINE_START(OTOM, "Nex Vision - Otom 1.1")
119 /* Maintainer: Guillaume GOURAT <guillaume.gourat@nexvision.tv> */ 116 /* Maintainer: Guillaume GOURAT <guillaume.gourat@nexvision.tv> */
@@ -121,6 +118,7 @@ MACHINE_START(OTOM, "Nex Vision - Otom 1.1")
121 .io_pg_offst = (((u32)S3C24XX_VA_UART) >> 18) & 0xfffc, 118 .io_pg_offst = (((u32)S3C24XX_VA_UART) >> 18) & 0xfffc,
122 .boot_params = S3C2410_SDRAM_PA + 0x100, 119 .boot_params = S3C2410_SDRAM_PA + 0x100,
123 .map_io = otom11_map_io, 120 .map_io = otom11_map_io,
121 .init_machine = otom11_init,
124 .init_irq = s3c24xx_init_irq, 122 .init_irq = s3c24xx_init_irq,
125 .timer = &s3c24xx_timer, 123 .timer = &s3c24xx_timer,
126MACHINE_END 124MACHINE_END
diff --git a/arch/arm/mach-s3c2410/mach-qt2410.c b/arch/arm/mach-s3c2410/mach-qt2410.c
index c6a41593de21..9cc4253d7bbc 100644
--- a/arch/arm/mach-s3c2410/mach-qt2410.c
+++ b/arch/arm/mach-s3c2410/mach-qt2410.c
@@ -29,7 +29,6 @@
29#include <linux/init.h> 29#include <linux/init.h>
30#include <linux/platform_device.h> 30#include <linux/platform_device.h>
31#include <linux/serial_core.h> 31#include <linux/serial_core.h>
32#include <linux/mmc/protocol.h>
33#include <linux/spi/spi.h> 32#include <linux/spi/spi.h>
34#include <linux/spi/spi_bitbang.h> 33#include <linux/spi/spi_bitbang.h>
35 34
@@ -331,11 +330,6 @@ static struct platform_device *qt2410_devices[] __initdata = {
331 &qt2410_led, 330 &qt2410_led,
332}; 331};
333 332
334static struct s3c24xx_board qt2410_board __initdata = {
335 .devices = qt2410_devices,
336 .devices_count = ARRAY_SIZE(qt2410_devices)
337};
338
339static struct mtd_partition qt2410_nand_part[] = { 333static struct mtd_partition qt2410_nand_part[] = {
340 [0] = { 334 [0] = {
341 .name = "U-Boot", 335 .name = "U-Boot",
@@ -405,7 +399,6 @@ static void __init qt2410_map_io(void)
405 s3c24xx_init_io(qt2410_iodesc, ARRAY_SIZE(qt2410_iodesc)); 399 s3c24xx_init_io(qt2410_iodesc, ARRAY_SIZE(qt2410_iodesc));
406 s3c24xx_init_clocks(12*1000*1000); 400 s3c24xx_init_clocks(12*1000*1000);
407 s3c24xx_init_uarts(smdk2410_uartcfgs, ARRAY_SIZE(smdk2410_uartcfgs)); 401 s3c24xx_init_uarts(smdk2410_uartcfgs, ARRAY_SIZE(smdk2410_uartcfgs));
408 s3c24xx_set_board(&qt2410_board);
409} 402}
410 403
411static void __init qt2410_machine_init(void) 404static void __init qt2410_machine_init(void)
@@ -432,6 +425,7 @@ static void __init qt2410_machine_init(void)
432 425
433 s3c2410_gpio_cfgpin(S3C2410_GPB5, S3C2410_GPIO_OUTPUT); 426 s3c2410_gpio_cfgpin(S3C2410_GPB5, S3C2410_GPIO_OUTPUT);
434 427
428 platform_add_devices(qt2410_devices, ARRAY_SIZE(qt2410_devices));
435 s3c2410_pm_init(); 429 s3c2410_pm_init();
436} 430}
437 431
diff --git a/arch/arm/mach-s3c2410/mach-smdk2410.c b/arch/arm/mach-s3c2410/mach-smdk2410.c
index 57b8a80f33d0..5852d300d52f 100644
--- a/arch/arm/mach-s3c2410/mach-smdk2410.c
+++ b/arch/arm/mach-s3c2410/mach-smdk2410.c
@@ -94,17 +94,17 @@ static struct platform_device *smdk2410_devices[] __initdata = {
94 &s3c_device_iis, 94 &s3c_device_iis,
95}; 95};
96 96
97static struct s3c24xx_board smdk2410_board __initdata = {
98 .devices = smdk2410_devices,
99 .devices_count = ARRAY_SIZE(smdk2410_devices)
100};
101
102static void __init smdk2410_map_io(void) 97static void __init smdk2410_map_io(void)
103{ 98{
104 s3c24xx_init_io(smdk2410_iodesc, ARRAY_SIZE(smdk2410_iodesc)); 99 s3c24xx_init_io(smdk2410_iodesc, ARRAY_SIZE(smdk2410_iodesc));
105 s3c24xx_init_clocks(0); 100 s3c24xx_init_clocks(0);
106 s3c24xx_init_uarts(smdk2410_uartcfgs, ARRAY_SIZE(smdk2410_uartcfgs)); 101 s3c24xx_init_uarts(smdk2410_uartcfgs, ARRAY_SIZE(smdk2410_uartcfgs));
107 s3c24xx_set_board(&smdk2410_board); 102}
103
104static void __init smdk2410_init(void)
105{
106 platform_add_devices(smdk2410_devices, ARRAY_SIZE(smdk2410_devices));
107 smdk_machine_init();
108} 108}
109 109
110MACHINE_START(SMDK2410, "SMDK2410") /* @TODO: request a new identifier and switch 110MACHINE_START(SMDK2410, "SMDK2410") /* @TODO: request a new identifier and switch
@@ -115,7 +115,7 @@ MACHINE_START(SMDK2410, "SMDK2410") /* @TODO: request a new identifier and switc
115 .boot_params = S3C2410_SDRAM_PA + 0x100, 115 .boot_params = S3C2410_SDRAM_PA + 0x100,
116 .map_io = smdk2410_map_io, 116 .map_io = smdk2410_map_io,
117 .init_irq = s3c24xx_init_irq, 117 .init_irq = s3c24xx_init_irq,
118 .init_machine = smdk_machine_init, 118 .init_machine = smdk2410_init,
119 .timer = &s3c24xx_timer, 119 .timer = &s3c24xx_timer,
120MACHINE_END 120MACHINE_END
121 121
diff --git a/arch/arm/mach-s3c2410/mach-vr1000.c b/arch/arm/mach-s3c2410/mach-vr1000.c
index c947c75bcbf0..7b624bb00490 100644
--- a/arch/arm/mach-s3c2410/mach-vr1000.c
+++ b/arch/arm/mach-s3c2410/mach-vr1000.c
@@ -384,13 +384,6 @@ static struct clk *vr1000_clocks[] = {
384 &s3c24xx_uclk, 384 &s3c24xx_uclk,
385}; 385};
386 386
387static struct s3c24xx_board vr1000_board __initdata = {
388 .devices = vr1000_devices,
389 .devices_count = ARRAY_SIZE(vr1000_devices),
390 .clocks = vr1000_clocks,
391 .clocks_count = ARRAY_SIZE(vr1000_clocks),
392};
393
394static void vr1000_power_off(void) 387static void vr1000_power_off(void)
395{ 388{
396 s3c2410_gpio_cfgpin(S3C2410_GPB9, S3C2410_GPB9_OUTP); 389 s3c2410_gpio_cfgpin(S3C2410_GPB9, S3C2410_GPB9_OUTP);
@@ -412,15 +405,19 @@ static void __init vr1000_map_io(void)
412 405
413 s3c24xx_uclk.parent = &s3c24xx_clkout1; 406 s3c24xx_uclk.parent = &s3c24xx_clkout1;
414 407
408 s3c24xx_register_clocks(vr1000_clocks, ARRAY_SIZE(vr1000_clocks));
409
415 pm_power_off = vr1000_power_off; 410 pm_power_off = vr1000_power_off;
416 411
417 s3c24xx_init_io(vr1000_iodesc, ARRAY_SIZE(vr1000_iodesc)); 412 s3c24xx_init_io(vr1000_iodesc, ARRAY_SIZE(vr1000_iodesc));
418 s3c24xx_init_clocks(0); 413 s3c24xx_init_clocks(0);
419 s3c24xx_init_uarts(vr1000_uartcfgs, ARRAY_SIZE(vr1000_uartcfgs)); 414 s3c24xx_init_uarts(vr1000_uartcfgs, ARRAY_SIZE(vr1000_uartcfgs));
420 s3c24xx_set_board(&vr1000_board);
421 usb_simtec_init();
422} 415}
423 416
417static void __init vr1000_init(void)
418{
419 platform_add_devices(vr1000_devices, ARRAY_SIZE(vr1000_devices));
420}
424 421
425MACHINE_START(VR1000, "Thorcom-VR1000") 422MACHINE_START(VR1000, "Thorcom-VR1000")
426 /* Maintainer: Ben Dooks <ben@simtec.co.uk> */ 423 /* Maintainer: Ben Dooks <ben@simtec.co.uk> */
@@ -428,6 +425,7 @@ MACHINE_START(VR1000, "Thorcom-VR1000")
428 .io_pg_offst = (((u32)S3C24XX_VA_UART) >> 18) & 0xfffc, 425 .io_pg_offst = (((u32)S3C24XX_VA_UART) >> 18) & 0xfffc,
429 .boot_params = S3C2410_SDRAM_PA + 0x100, 426 .boot_params = S3C2410_SDRAM_PA + 0x100,
430 .map_io = vr1000_map_io, 427 .map_io = vr1000_map_io,
428 .init_machine = vr1000_init,
431 .init_irq = s3c24xx_init_irq, 429 .init_irq = s3c24xx_init_irq,
432 .timer = &s3c24xx_timer, 430 .timer = &s3c24xx_timer,
433MACHINE_END 431MACHINE_END
diff --git a/arch/arm/mach-s3c2412/Kconfig b/arch/arm/mach-s3c2412/Kconfig
index befc5fdbb613..d5be5d053264 100644
--- a/arch/arm/mach-s3c2412/Kconfig
+++ b/arch/arm/mach-s3c2412/Kconfig
@@ -47,6 +47,15 @@ config MACH_S3C2413
47 machine_is_s3c2413() will work when MACH_SMDK2413 is 47 machine_is_s3c2413() will work when MACH_SMDK2413 is
48 selected 48 selected
49 49
50config MACH_SMDK2412
51 bool "SMDK2412"
52 select MACH_SMDK2413
53 help
54 Say Y here if you are using an SMDK2412
55
56 Note, this shares support with SMDK2413, so will automatically
57 select MACH_SMDK2413.
58
50config MACH_VSTMS 59config MACH_VSTMS
51 bool "VMSTMS" 60 bool "VMSTMS"
52 select CPU_S3C2412 61 select CPU_S3C2412
diff --git a/arch/arm/mach-s3c2412/mach-smdk2413.c b/arch/arm/mach-s3c2412/mach-smdk2413.c
index b5befce6c8d3..063af09f899d 100644
--- a/arch/arm/mach-s3c2412/mach-smdk2413.c
+++ b/arch/arm/mach-s3c2412/mach-smdk2413.c
@@ -110,11 +110,6 @@ static struct platform_device *smdk2413_devices[] __initdata = {
110 &s3c_device_usbgadget, 110 &s3c_device_usbgadget,
111}; 111};
112 112
113static struct s3c24xx_board smdk2413_board __initdata = {
114 .devices = smdk2413_devices,
115 .devices_count = ARRAY_SIZE(smdk2413_devices)
116};
117
118static void __init smdk2413_fixup(struct machine_desc *desc, 113static void __init smdk2413_fixup(struct machine_desc *desc,
119 struct tag *tags, char **cmdline, 114 struct tag *tags, char **cmdline,
120 struct meminfo *mi) 115 struct meminfo *mi)
@@ -132,7 +127,6 @@ static void __init smdk2413_map_io(void)
132 s3c24xx_init_io(smdk2413_iodesc, ARRAY_SIZE(smdk2413_iodesc)); 127 s3c24xx_init_io(smdk2413_iodesc, ARRAY_SIZE(smdk2413_iodesc));
133 s3c24xx_init_clocks(12000000); 128 s3c24xx_init_clocks(12000000);
134 s3c24xx_init_uarts(smdk2413_uartcfgs, ARRAY_SIZE(smdk2413_uartcfgs)); 129 s3c24xx_init_uarts(smdk2413_uartcfgs, ARRAY_SIZE(smdk2413_uartcfgs));
135 s3c24xx_set_board(&smdk2413_board);
136} 130}
137 131
138static void __init smdk2413_machine_init(void) 132static void __init smdk2413_machine_init(void)
@@ -149,6 +143,7 @@ static void __init smdk2413_machine_init(void)
149 143
150 s3c24xx_udc_set_platdata(&smdk2413_udc_cfg); 144 s3c24xx_udc_set_platdata(&smdk2413_udc_cfg);
151 145
146 platform_add_devices(smdk2413_devices, ARRAY_SIZE(smdk2413_devices));
152 smdk_machine_init(); 147 smdk_machine_init();
153} 148}
154 149
diff --git a/arch/arm/mach-s3c2412/mach-vstms.c b/arch/arm/mach-s3c2412/mach-vstms.c
index 4231b549d797..f2fbd65956ac 100644
--- a/arch/arm/mach-s3c2412/mach-vstms.c
+++ b/arch/arm/mach-s3c2412/mach-vstms.c
@@ -129,11 +129,6 @@ static struct platform_device *vstms_devices[] __initdata = {
129 &s3c_device_nand, 129 &s3c_device_nand,
130}; 130};
131 131
132static struct s3c24xx_board vstms_board __initdata = {
133 .devices = vstms_devices,
134 .devices_count = ARRAY_SIZE(vstms_devices)
135};
136
137static void __init vstms_fixup(struct machine_desc *desc, 132static void __init vstms_fixup(struct machine_desc *desc,
138 struct tag *tags, char **cmdline, 133 struct tag *tags, char **cmdline,
139 struct meminfo *mi) 134 struct meminfo *mi)
@@ -153,7 +148,11 @@ static void __init vstms_map_io(void)
153 s3c24xx_init_io(vstms_iodesc, ARRAY_SIZE(vstms_iodesc)); 148 s3c24xx_init_io(vstms_iodesc, ARRAY_SIZE(vstms_iodesc));
154 s3c24xx_init_clocks(12000000); 149 s3c24xx_init_clocks(12000000);
155 s3c24xx_init_uarts(vstms_uartcfgs, ARRAY_SIZE(vstms_uartcfgs)); 150 s3c24xx_init_uarts(vstms_uartcfgs, ARRAY_SIZE(vstms_uartcfgs));
156 s3c24xx_set_board(&vstms_board); 151}
152
153static void __init vstms_init(void)
154{
155 platform_add_devices(vstms_devices, ARRAY_SIZE(vstms_devices));
157} 156}
158 157
159MACHINE_START(VSTMS, "VSTMS") 158MACHINE_START(VSTMS, "VSTMS")
@@ -163,6 +162,7 @@ MACHINE_START(VSTMS, "VSTMS")
163 162
164 .fixup = vstms_fixup, 163 .fixup = vstms_fixup,
165 .init_irq = s3c24xx_init_irq, 164 .init_irq = s3c24xx_init_irq,
165 .init_machine = vstms_init,
166 .map_io = vstms_map_io, 166 .map_io = vstms_map_io,
167 .timer = &s3c24xx_timer, 167 .timer = &s3c24xx_timer,
168MACHINE_END 168MACHINE_END
diff --git a/arch/arm/mach-s3c2440/mach-anubis.c b/arch/arm/mach-s3c2440/mach-anubis.c
index 3f0288eb1ed5..b5d387ef37e1 100644
--- a/arch/arm/mach-s3c2440/mach-anubis.c
+++ b/arch/arm/mach-s3c2440/mach-anubis.c
@@ -281,13 +281,6 @@ static struct clk *anubis_clocks[] = {
281 &s3c24xx_uclk, 281 &s3c24xx_uclk,
282}; 282};
283 283
284static struct s3c24xx_board anubis_board __initdata = {
285 .devices = anubis_devices,
286 .devices_count = ARRAY_SIZE(anubis_devices),
287 .clocks = anubis_clocks,
288 .clocks_count = ARRAY_SIZE(anubis_clocks),
289};
290
291static void __init anubis_map_io(void) 284static void __init anubis_map_io(void)
292{ 285{
293 /* initialise the clocks */ 286 /* initialise the clocks */
@@ -303,23 +296,31 @@ static void __init anubis_map_io(void)
303 296
304 s3c24xx_uclk.parent = &s3c24xx_clkout1; 297 s3c24xx_uclk.parent = &s3c24xx_clkout1;
305 298
299 s3c24xx_register_clocks(anubis_clocks, ARRAY_SIZE(anubis_clocks));
300
306 s3c_device_nand.dev.platform_data = &anubis_nand_info; 301 s3c_device_nand.dev.platform_data = &anubis_nand_info;
307 302
308 s3c24xx_init_io(anubis_iodesc, ARRAY_SIZE(anubis_iodesc)); 303 s3c24xx_init_io(anubis_iodesc, ARRAY_SIZE(anubis_iodesc));
309 s3c24xx_init_clocks(0); 304 s3c24xx_init_clocks(0);
310 s3c24xx_init_uarts(anubis_uartcfgs, ARRAY_SIZE(anubis_uartcfgs)); 305 s3c24xx_init_uarts(anubis_uartcfgs, ARRAY_SIZE(anubis_uartcfgs));
311 s3c24xx_set_board(&anubis_board);
312 306
313 /* ensure that the GPIO is setup */ 307 /* ensure that the GPIO is setup */
314 s3c2410_gpio_setpin(S3C2410_GPA0, 1); 308 s3c2410_gpio_setpin(S3C2410_GPA0, 1);
315} 309}
316 310
311static void __init anubis_init(void)
312{
313 platform_add_devices(anubis_devices, ARRAY_SIZE(anubis_devices));
314}
315
316
317MACHINE_START(ANUBIS, "Simtec-Anubis") 317MACHINE_START(ANUBIS, "Simtec-Anubis")
318 /* Maintainer: Ben Dooks <ben@simtec.co.uk> */ 318 /* Maintainer: Ben Dooks <ben@simtec.co.uk> */
319 .phys_io = S3C2410_PA_UART, 319 .phys_io = S3C2410_PA_UART,
320 .io_pg_offst = (((u32)S3C24XX_VA_UART) >> 18) & 0xfffc, 320 .io_pg_offst = (((u32)S3C24XX_VA_UART) >> 18) & 0xfffc,
321 .boot_params = S3C2410_SDRAM_PA + 0x100, 321 .boot_params = S3C2410_SDRAM_PA + 0x100,
322 .map_io = anubis_map_io, 322 .map_io = anubis_map_io,
323 .init_machine = anubis_init,
323 .init_irq = s3c24xx_init_irq, 324 .init_irq = s3c24xx_init_irq,
324 .timer = &s3c24xx_timer, 325 .timer = &s3c24xx_timer,
325MACHINE_END 326MACHINE_END
diff --git a/arch/arm/mach-s3c2440/mach-nexcoder.c b/arch/arm/mach-s3c2440/mach-nexcoder.c
index 6d551d88330b..5e61f2166c76 100644
--- a/arch/arm/mach-s3c2440/mach-nexcoder.c
+++ b/arch/arm/mach-s3c2440/mach-nexcoder.c
@@ -116,12 +116,6 @@ static struct platform_device *nexcoder_devices[] __initdata = {
116 &nexcoder_device_nor, 116 &nexcoder_device_nor,
117}; 117};
118 118
119static struct s3c24xx_board nexcoder_board __initdata = {
120 .devices = nexcoder_devices,
121 .devices_count = ARRAY_SIZE(nexcoder_devices),
122};
123
124
125static void __init nexcoder_sensorboard_init(void) 119static void __init nexcoder_sensorboard_init(void)
126{ 120{
127 // Initialize SCCB bus 121 // Initialize SCCB bus
@@ -142,10 +136,14 @@ static void __init nexcoder_map_io(void)
142 s3c24xx_init_io(nexcoder_iodesc, ARRAY_SIZE(nexcoder_iodesc)); 136 s3c24xx_init_io(nexcoder_iodesc, ARRAY_SIZE(nexcoder_iodesc));
143 s3c24xx_init_clocks(0); 137 s3c24xx_init_clocks(0);
144 s3c24xx_init_uarts(nexcoder_uartcfgs, ARRAY_SIZE(nexcoder_uartcfgs)); 138 s3c24xx_init_uarts(nexcoder_uartcfgs, ARRAY_SIZE(nexcoder_uartcfgs));
145 s3c24xx_set_board(&nexcoder_board); 139
146 nexcoder_sensorboard_init(); 140 nexcoder_sensorboard_init();
147} 141}
148 142
143static void __init nexcoder_init(void)
144{
145 platform_add_devices(nexcoder_devices, ARRAY_SIZE(nexcoder_devices));
146};
149 147
150MACHINE_START(NEXCODER_2440, "NexVision - Nexcoder 2440") 148MACHINE_START(NEXCODER_2440, "NexVision - Nexcoder 2440")
151 /* Maintainer: Guillaume GOURAT <guillaume.gourat@nexvision.tv> */ 149 /* Maintainer: Guillaume GOURAT <guillaume.gourat@nexvision.tv> */
@@ -153,6 +151,7 @@ MACHINE_START(NEXCODER_2440, "NexVision - Nexcoder 2440")
153 .io_pg_offst = (((u32)S3C24XX_VA_UART) >> 18) & 0xfffc, 151 .io_pg_offst = (((u32)S3C24XX_VA_UART) >> 18) & 0xfffc,
154 .boot_params = S3C2410_SDRAM_PA + 0x100, 152 .boot_params = S3C2410_SDRAM_PA + 0x100,
155 .map_io = nexcoder_map_io, 153 .map_io = nexcoder_map_io,
154 .init_machine = nexcoder_init,
156 .init_irq = s3c24xx_init_irq, 155 .init_irq = s3c24xx_init_irq,
157 .timer = &s3c24xx_timer, 156 .timer = &s3c24xx_timer,
158MACHINE_END 157MACHINE_END
diff --git a/arch/arm/mach-s3c2440/mach-osiris.c b/arch/arm/mach-s3c2440/mach-osiris.c
index 2ed8e51f20c8..324f5a237921 100644
--- a/arch/arm/mach-s3c2440/mach-osiris.c
+++ b/arch/arm/mach-s3c2440/mach-osiris.c
@@ -251,13 +251,6 @@ static struct clk *osiris_clocks[] = {
251 &s3c24xx_uclk, 251 &s3c24xx_uclk,
252}; 252};
253 253
254static struct s3c24xx_board osiris_board __initdata = {
255 .devices = osiris_devices,
256 .devices_count = ARRAY_SIZE(osiris_devices),
257 .clocks = osiris_clocks,
258 .clocks_count = ARRAY_SIZE(osiris_clocks),
259};
260
261static void __init osiris_map_io(void) 254static void __init osiris_map_io(void)
262{ 255{
263 unsigned long flags; 256 unsigned long flags;
@@ -275,12 +268,13 @@ static void __init osiris_map_io(void)
275 268
276 s3c24xx_uclk.parent = &s3c24xx_clkout1; 269 s3c24xx_uclk.parent = &s3c24xx_clkout1;
277 270
271 s3c24xx_register_clocks(osiris_clocks, ARRAY_SIZE(osiris_clocks));
272
278 s3c_device_nand.dev.platform_data = &osiris_nand_info; 273 s3c_device_nand.dev.platform_data = &osiris_nand_info;
279 274
280 s3c24xx_init_io(osiris_iodesc, ARRAY_SIZE(osiris_iodesc)); 275 s3c24xx_init_io(osiris_iodesc, ARRAY_SIZE(osiris_iodesc));
281 s3c24xx_init_clocks(0); 276 s3c24xx_init_clocks(0);
282 s3c24xx_init_uarts(osiris_uartcfgs, ARRAY_SIZE(osiris_uartcfgs)); 277 s3c24xx_init_uarts(osiris_uartcfgs, ARRAY_SIZE(osiris_uartcfgs));
283 s3c24xx_set_board(&osiris_board);
284 278
285 /* fix bus configuration (nBE settings wrong on ABLE pre v2.20) */ 279 /* fix bus configuration (nBE settings wrong on ABLE pre v2.20) */
286 280
@@ -292,12 +286,18 @@ static void __init osiris_map_io(void)
292 s3c2410_gpio_setpin(S3C2410_GPA0, 1); 286 s3c2410_gpio_setpin(S3C2410_GPA0, 1);
293} 287}
294 288
289static void __init osiris_init(void)
290{
291 platform_add_devices(osiris_devices, ARRAY_SIZE(osiris_devices));
292};
293
295MACHINE_START(OSIRIS, "Simtec-OSIRIS") 294MACHINE_START(OSIRIS, "Simtec-OSIRIS")
296 /* Maintainer: Ben Dooks <ben@simtec.co.uk> */ 295 /* Maintainer: Ben Dooks <ben@simtec.co.uk> */
297 .phys_io = S3C2410_PA_UART, 296 .phys_io = S3C2410_PA_UART,
298 .io_pg_offst = (((u32)S3C24XX_VA_UART) >> 18) & 0xfffc, 297 .io_pg_offst = (((u32)S3C24XX_VA_UART) >> 18) & 0xfffc,
299 .boot_params = S3C2410_SDRAM_PA + 0x100, 298 .boot_params = S3C2410_SDRAM_PA + 0x100,
300 .map_io = osiris_map_io, 299 .map_io = osiris_map_io,
300 .init_machine = osiris_init,
301 .init_irq = s3c24xx_init_irq, 301 .init_irq = s3c24xx_init_irq,
302 .timer = &s3c24xx_timer, 302 .timer = &s3c24xx_timer,
303MACHINE_END 303MACHINE_END
diff --git a/arch/arm/mach-s3c2440/mach-rx3715.c b/arch/arm/mach-s3c2440/mach-rx3715.c
index ae1d0a81fd6a..c3cc4bf158f6 100644
--- a/arch/arm/mach-s3c2440/mach-rx3715.c
+++ b/arch/arm/mach-s3c2440/mach-rx3715.c
@@ -202,11 +202,6 @@ static struct platform_device *rx3715_devices[] __initdata = {
202 &s3c_device_nand, 202 &s3c_device_nand,
203}; 203};
204 204
205static struct s3c24xx_board rx3715_board __initdata = {
206 .devices = rx3715_devices,
207 .devices_count = ARRAY_SIZE(rx3715_devices)
208};
209
210static void __init rx3715_map_io(void) 205static void __init rx3715_map_io(void)
211{ 206{
212 s3c_device_nand.dev.platform_data = &rx3715_nand_info; 207 s3c_device_nand.dev.platform_data = &rx3715_nand_info;
@@ -214,7 +209,6 @@ static void __init rx3715_map_io(void)
214 s3c24xx_init_io(rx3715_iodesc, ARRAY_SIZE(rx3715_iodesc)); 209 s3c24xx_init_io(rx3715_iodesc, ARRAY_SIZE(rx3715_iodesc));
215 s3c24xx_init_clocks(16934000); 210 s3c24xx_init_clocks(16934000);
216 s3c24xx_init_uarts(rx3715_uartcfgs, ARRAY_SIZE(rx3715_uartcfgs)); 211 s3c24xx_init_uarts(rx3715_uartcfgs, ARRAY_SIZE(rx3715_uartcfgs));
217 s3c24xx_set_board(&rx3715_board);
218} 212}
219 213
220static void __init rx3715_init_irq(void) 214static void __init rx3715_init_irq(void)
@@ -230,9 +224,9 @@ static void __init rx3715_init_machine(void)
230 s3c2410_pm_init(); 224 s3c2410_pm_init();
231 225
232 s3c24xx_fb_set_platdata(&rx3715_lcdcfg); 226 s3c24xx_fb_set_platdata(&rx3715_lcdcfg);
227 platform_add_devices(rx3715_devices, ARRAY_SIZE(rx3715_devices));
233} 228}
234 229
235
236MACHINE_START(RX3715, "IPAQ-RX3715") 230MACHINE_START(RX3715, "IPAQ-RX3715")
237 /* Maintainer: Ben Dooks <ben@fluff.org> */ 231 /* Maintainer: Ben Dooks <ben@fluff.org> */
238 .phys_io = S3C2410_PA_UART, 232 .phys_io = S3C2410_PA_UART,
diff --git a/arch/arm/mach-s3c2440/mach-smdk2440.c b/arch/arm/mach-s3c2440/mach-smdk2440.c
index c17eb5b1f6b4..e167254e232e 100644
--- a/arch/arm/mach-s3c2440/mach-smdk2440.c
+++ b/arch/arm/mach-s3c2440/mach-smdk2440.c
@@ -174,23 +174,18 @@ static struct platform_device *smdk2440_devices[] __initdata = {
174 &s3c_device_iis, 174 &s3c_device_iis,
175}; 175};
176 176
177static struct s3c24xx_board smdk2440_board __initdata = {
178 .devices = smdk2440_devices,
179 .devices_count = ARRAY_SIZE(smdk2440_devices)
180};
181
182static void __init smdk2440_map_io(void) 177static void __init smdk2440_map_io(void)
183{ 178{
184 s3c24xx_init_io(smdk2440_iodesc, ARRAY_SIZE(smdk2440_iodesc)); 179 s3c24xx_init_io(smdk2440_iodesc, ARRAY_SIZE(smdk2440_iodesc));
185 s3c24xx_init_clocks(16934400); 180 s3c24xx_init_clocks(16934400);
186 s3c24xx_init_uarts(smdk2440_uartcfgs, ARRAY_SIZE(smdk2440_uartcfgs)); 181 s3c24xx_init_uarts(smdk2440_uartcfgs, ARRAY_SIZE(smdk2440_uartcfgs));
187 s3c24xx_set_board(&smdk2440_board);
188} 182}
189 183
190static void __init smdk2440_machine_init(void) 184static void __init smdk2440_machine_init(void)
191{ 185{
192 s3c24xx_fb_set_platdata(&smdk2440_lcd_cfg); 186 s3c24xx_fb_set_platdata(&smdk2440_lcd_cfg);
193 187
188 platform_add_devices(smdk2440_devices, ARRAY_SIZE(smdk2440_devices));
194 smdk_machine_init(); 189 smdk_machine_init();
195} 190}
196 191
diff --git a/arch/arm/mach-s3c2443/mach-smdk2443.c b/arch/arm/mach-s3c2443/mach-smdk2443.c
index e82aaff7dee4..b71ee53c2865 100644
--- a/arch/arm/mach-s3c2443/mach-smdk2443.c
+++ b/arch/arm/mach-s3c2443/mach-smdk2443.c
@@ -106,21 +106,16 @@ static struct platform_device *smdk2443_devices[] __initdata = {
106 &s3c_device_i2c, 106 &s3c_device_i2c,
107}; 107};
108 108
109static struct s3c24xx_board smdk2443_board __initdata = {
110 .devices = smdk2443_devices,
111 .devices_count = ARRAY_SIZE(smdk2443_devices)
112};
113
114static void __init smdk2443_map_io(void) 109static void __init smdk2443_map_io(void)
115{ 110{
116 s3c24xx_init_io(smdk2443_iodesc, ARRAY_SIZE(smdk2443_iodesc)); 111 s3c24xx_init_io(smdk2443_iodesc, ARRAY_SIZE(smdk2443_iodesc));
117 s3c24xx_init_clocks(12000000); 112 s3c24xx_init_clocks(12000000);
118 s3c24xx_init_uarts(smdk2443_uartcfgs, ARRAY_SIZE(smdk2443_uartcfgs)); 113 s3c24xx_init_uarts(smdk2443_uartcfgs, ARRAY_SIZE(smdk2443_uartcfgs));
119 s3c24xx_set_board(&smdk2443_board);
120} 114}
121 115
122static void __init smdk2443_machine_init(void) 116static void __init smdk2443_machine_init(void)
123{ 117{
118 platform_add_devices(smdk2443_devices, ARRAY_SIZE(smdk2443_devices));
124 smdk_machine_init(); 119 smdk_machine_init();
125} 120}
126 121
diff --git a/arch/arm/mach-sa1100/clock.c b/arch/arm/mach-sa1100/clock.c
index b1e8fd766c1a..fc97fe57ee6f 100644
--- a/arch/arm/mach-sa1100/clock.c
+++ b/arch/arm/mach-sa1100/clock.c
@@ -9,14 +9,17 @@
9#include <linux/string.h> 9#include <linux/string.h>
10#include <linux/clk.h> 10#include <linux/clk.h>
11#include <linux/spinlock.h> 11#include <linux/spinlock.h>
12#include <linux/mutex.h>
12 13
13#include <asm/hardware.h> 14#include <asm/hardware.h>
14#include <asm/semaphore.h>
15 15
16/*
17 * Very simple clock implementation - we only have one clock to
18 * deal with at the moment, so we only match using the "name".
19 */
16struct clk { 20struct clk {
17 struct list_head node; 21 struct list_head node;
18 unsigned long rate; 22 unsigned long rate;
19 struct module *owner;
20 const char *name; 23 const char *name;
21 unsigned int enabled; 24 unsigned int enabled;
22 void (*enable)(void); 25 void (*enable)(void);
@@ -24,21 +27,21 @@ struct clk {
24}; 27};
25 28
26static LIST_HEAD(clocks); 29static LIST_HEAD(clocks);
27static DECLARE_MUTEX(clocks_sem); 30static DEFINE_MUTEX(clocks_mutex);
28static DEFINE_SPINLOCK(clocks_lock); 31static DEFINE_SPINLOCK(clocks_lock);
29 32
30struct clk *clk_get(struct device *dev, const char *id) 33struct clk *clk_get(struct device *dev, const char *id)
31{ 34{
32 struct clk *p, *clk = ERR_PTR(-ENOENT); 35 struct clk *p, *clk = ERR_PTR(-ENOENT);
33 36
34 down(&clocks_sem); 37 mutex_lock(&clocks_mutex);
35 list_for_each_entry(p, &clocks, node) { 38 list_for_each_entry(p, &clocks, node) {
36 if (strcmp(id, p->name) == 0 && try_module_get(p->owner)) { 39 if (strcmp(id, p->name) == 0) {
37 clk = p; 40 clk = p;
38 break; 41 break;
39 } 42 }
40 } 43 }
41 up(&clocks_sem); 44 mutex_unlock(&clocks_mutex);
42 45
43 return clk; 46 return clk;
44} 47}
@@ -46,7 +49,6 @@ EXPORT_SYMBOL(clk_get);
46 49
47void clk_put(struct clk *clk) 50void clk_put(struct clk *clk)
48{ 51{
49 module_put(clk->owner);
50} 52}
51EXPORT_SYMBOL(clk_put); 53EXPORT_SYMBOL(clk_put);
52 54
@@ -109,18 +111,18 @@ static struct clk clk_gpio27 = {
109 111
110int clk_register(struct clk *clk) 112int clk_register(struct clk *clk)
111{ 113{
112 down(&clocks_sem); 114 mutex_lock(&clocks_mutex);
113 list_add(&clk->node, &clocks); 115 list_add(&clk->node, &clocks);
114 up(&clocks_sem); 116 mutex_unlock(&clocks_mutex);
115 return 0; 117 return 0;
116} 118}
117EXPORT_SYMBOL(clk_register); 119EXPORT_SYMBOL(clk_register);
118 120
119void clk_unregister(struct clk *clk) 121void clk_unregister(struct clk *clk)
120{ 122{
121 down(&clocks_sem); 123 mutex_lock(&clocks_mutex);
122 list_del(&clk->node); 124 list_del(&clk->node);
123 up(&clocks_sem); 125 mutex_unlock(&clocks_mutex);
124} 126}
125EXPORT_SYMBOL(clk_unregister); 127EXPORT_SYMBOL(clk_unregister);
126 128
diff --git a/arch/arm/mach-sa1100/pm.c b/arch/arm/mach-sa1100/pm.c
index 786c8534231f..d674cf343156 100644
--- a/arch/arm/mach-sa1100/pm.c
+++ b/arch/arm/mach-sa1100/pm.c
@@ -59,9 +59,6 @@ static int sa11x0_pm_enter(suspend_state_t state)
59 unsigned long gpio, sleep_save[SLEEP_SAVE_SIZE]; 59 unsigned long gpio, sleep_save[SLEEP_SAVE_SIZE];
60 struct timespec delta, rtc; 60 struct timespec delta, rtc;
61 61
62 if (state != PM_SUSPEND_MEM)
63 return -EINVAL;
64
65 /* preserve current time */ 62 /* preserve current time */
66 rtc.tv_sec = RCNR; 63 rtc.tv_sec = RCNR;
67 rtc.tv_nsec = 0; 64 rtc.tv_nsec = 0;
@@ -134,12 +131,9 @@ unsigned long sleep_phys_sp(void *sp)
134 return virt_to_phys(sp); 131 return virt_to_phys(sp);
135} 132}
136 133
137/*
138 * Set to PM_DISK_FIRMWARE so we can quickly veto suspend-to-disk.
139 */
140static struct pm_ops sa11x0_pm_ops = { 134static struct pm_ops sa11x0_pm_ops = {
141 .pm_disk_mode = PM_DISK_FIRMWARE,
142 .enter = sa11x0_pm_enter, 135 .enter = sa11x0_pm_enter,
136 .valid = pm_valid_only_mem,
143}; 137};
144 138
145static int __init sa11x0_pm_init(void) 139static int __init sa11x0_pm_init(void)
diff --git a/arch/arm/mach-versatile/core.c b/arch/arm/mach-versatile/core.c
index bf71507c76fd..1275aa7d2eb1 100644
--- a/arch/arm/mach-versatile/core.c
+++ b/arch/arm/mach-versatile/core.c
@@ -26,6 +26,8 @@
26#include <linux/interrupt.h> 26#include <linux/interrupt.h>
27#include <linux/amba/bus.h> 27#include <linux/amba/bus.h>
28#include <linux/amba/clcd.h> 28#include <linux/amba/clcd.h>
29#include <linux/clocksource.h>
30#include <linux/clockchips.h>
29 31
30#include <asm/cnt32_to_63.h> 32#include <asm/cnt32_to_63.h>
31#include <asm/system.h> 33#include <asm/system.h>
@@ -828,59 +830,61 @@ void __init versatile_init(void)
828#define TICKS2USECS(x) ((x) / TICKS_PER_uSEC) 830#define TICKS2USECS(x) ((x) / TICKS_PER_uSEC)
829#endif 831#endif
830 832
831/* 833static void timer_set_mode(enum clock_event_mode mode,
832 * Returns number of ms since last clock interrupt. Note that interrupts 834 struct clock_event_device *clk)
833 * will have been disabled by do_gettimeoffset()
834 */
835static unsigned long versatile_gettimeoffset(void)
836{ 835{
837 unsigned long ticks1, ticks2, status; 836 unsigned long ctrl;
838 837
839 /* 838 switch(mode) {
840 * Get the current number of ticks. Note that there is a race 839 case CLOCK_EVT_MODE_PERIODIC:
841 * condition between us reading the timer and checking for 840 writel(TIMER_RELOAD, TIMER0_VA_BASE + TIMER_LOAD);
842 * an interrupt. We get around this by ensuring that the
843 * counter has not reloaded between our two reads.
844 */
845 ticks2 = readl(TIMER0_VA_BASE + TIMER_VALUE) & 0xffff;
846 do {
847 ticks1 = ticks2;
848 status = __raw_readl(VA_IC_BASE + VIC_RAW_STATUS);
849 ticks2 = readl(TIMER0_VA_BASE + TIMER_VALUE) & 0xffff;
850 } while (ticks2 > ticks1);
851 841
852 /* 842 ctrl = TIMER_CTRL_PERIODIC;
853 * Number of ticks since last interrupt. 843 ctrl |= TIMER_CTRL_32BIT | TIMER_CTRL_IE | TIMER_CTRL_ENABLE;
854 */ 844 break;
855 ticks1 = TIMER_RELOAD - ticks2; 845 case CLOCK_EVT_MODE_ONESHOT:
846 /* period set, and timer enabled in 'next_event' hook */
847 ctrl = TIMER_CTRL_ONESHOT;
848 ctrl |= TIMER_CTRL_32BIT | TIMER_CTRL_IE;
849 break;
850 case CLOCK_EVT_MODE_UNUSED:
851 case CLOCK_EVT_MODE_SHUTDOWN:
852 default:
853 ctrl = 0;
854 }
856 855
857 /* 856 writel(ctrl, TIMER0_VA_BASE + TIMER_CTRL);
858 * Interrupt pending? If so, we've reloaded once already. 857}
859 *
860 * FIXME: Need to check this is effectively timer 0 that expires
861 */
862 if (status & IRQMASK_TIMERINT0_1)
863 ticks1 += TIMER_RELOAD;
864 858
865 /* 859static int timer_set_next_event(unsigned long evt,
866 * Convert the ticks to usecs 860 struct clock_event_device *unused)
867 */ 861{
868 return TICKS2USECS(ticks1); 862 unsigned long ctrl = readl(TIMER0_VA_BASE + TIMER_CTRL);
863
864 writel(evt, TIMER0_VA_BASE + TIMER_LOAD);
865 writel(ctrl | TIMER_CTRL_ENABLE, TIMER0_VA_BASE + TIMER_CTRL);
866
867 return 0;
869} 868}
870 869
870static struct clock_event_device timer0_clockevent = {
871 .name = "timer0",
872 .shift = 32,
873 .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT,
874 .set_mode = timer_set_mode,
875 .set_next_event = timer_set_next_event,
876};
877
871/* 878/*
872 * IRQ handler for the timer 879 * IRQ handler for the timer
873 */ 880 */
874static irqreturn_t versatile_timer_interrupt(int irq, void *dev_id) 881static irqreturn_t versatile_timer_interrupt(int irq, void *dev_id)
875{ 882{
876 write_seqlock(&xtime_lock); 883 struct clock_event_device *evt = &timer0_clockevent;
877 884
878 // ...clear the interrupt
879 writel(1, TIMER0_VA_BASE + TIMER_INTCLR); 885 writel(1, TIMER0_VA_BASE + TIMER_INTCLR);
880 886
881 timer_tick(); 887 evt->event_handler(evt);
882
883 write_sequnlock(&xtime_lock);
884 888
885 return IRQ_HANDLED; 889 return IRQ_HANDLED;
886} 890}
@@ -891,6 +895,36 @@ static struct irqaction versatile_timer_irq = {
891 .handler = versatile_timer_interrupt, 895 .handler = versatile_timer_interrupt,
892}; 896};
893 897
898static cycle_t versatile_get_cycles(void)
899{
900 return ~readl(TIMER3_VA_BASE + TIMER_VALUE);
901}
902
903static struct clocksource clocksource_versatile = {
904 .name = "timer3",
905 .rating = 200,
906 .read = versatile_get_cycles,
907 .mask = CLOCKSOURCE_MASK(32),
908 .shift = 20,
909 .flags = CLOCK_SOURCE_IS_CONTINUOUS,
910};
911
912static int __init versatile_clocksource_init(void)
913{
914 /* setup timer3 as free-running clocksource */
915 writel(0, TIMER3_VA_BASE + TIMER_CTRL);
916 writel(0xffffffff, TIMER3_VA_BASE + TIMER_LOAD);
917 writel(0xffffffff, TIMER3_VA_BASE + TIMER_VALUE);
918 writel(TIMER_CTRL_32BIT | TIMER_CTRL_ENABLE | TIMER_CTRL_PERIODIC,
919 TIMER3_VA_BASE + TIMER_CTRL);
920
921 clocksource_versatile.mult =
922 clocksource_khz2mult(1000, clocksource_versatile.shift);
923 clocksource_register(&clocksource_versatile);
924
925 return 0;
926}
927
894/* 928/*
895 * Set up timer interrupt, and return the current time in seconds. 929 * Set up timer interrupt, and return the current time in seconds.
896 */ 930 */
@@ -918,18 +952,25 @@ static void __init versatile_timer_init(void)
918 writel(0, TIMER2_VA_BASE + TIMER_CTRL); 952 writel(0, TIMER2_VA_BASE + TIMER_CTRL);
919 writel(0, TIMER3_VA_BASE + TIMER_CTRL); 953 writel(0, TIMER3_VA_BASE + TIMER_CTRL);
920 954
921 writel(TIMER_RELOAD, TIMER0_VA_BASE + TIMER_LOAD);
922 writel(TIMER_RELOAD, TIMER0_VA_BASE + TIMER_VALUE);
923 writel(TIMER_DIVISOR | TIMER_CTRL_ENABLE | TIMER_CTRL_PERIODIC |
924 TIMER_CTRL_IE, TIMER0_VA_BASE + TIMER_CTRL);
925
926 /* 955 /*
927 * Make irqs happen for the system timer 956 * Make irqs happen for the system timer
928 */ 957 */
929 setup_irq(IRQ_TIMERINT0_1, &versatile_timer_irq); 958 setup_irq(IRQ_TIMERINT0_1, &versatile_timer_irq);
959
960 versatile_clocksource_init();
961
962 timer0_clockevent.mult =
963 div_sc(1000000, NSEC_PER_SEC, timer0_clockevent.shift);
964 timer0_clockevent.max_delta_ns =
965 clockevent_delta2ns(0xffffffff, &timer0_clockevent);
966 timer0_clockevent.min_delta_ns =
967 clockevent_delta2ns(0xf, &timer0_clockevent);
968
969 timer0_clockevent.cpumask = cpumask_of_cpu(0);
970 clockevents_register_device(&timer0_clockevent);
930} 971}
931 972
932struct sys_timer versatile_timer = { 973struct sys_timer versatile_timer = {
933 .init = versatile_timer_init, 974 .init = versatile_timer_init,
934 .offset = versatile_gettimeoffset,
935}; 975};
976
diff --git a/arch/arm/mm/Kconfig b/arch/arm/mm/Kconfig
index e684e9b38216..b81391a4e374 100644
--- a/arch/arm/mm/Kconfig
+++ b/arch/arm/mm/Kconfig
@@ -366,6 +366,19 @@ config CPU_32v6K
366 enabled will not boot on processors with do not support these 366 enabled will not boot on processors with do not support these
367 instructions. 367 instructions.
368 368
369# ARMv7
370config CPU_V7
371 bool "Support ARM V7 processor"
372 depends on ARCH_INTEGRATOR
373 select CPU_32v6K
374 select CPU_32v7
375 select CPU_ABRT_EV7
376 select CPU_CACHE_V7
377 select CPU_CACHE_VIPT
378 select CPU_CP15_MMU
379 select CPU_COPY_V6 if MMU
380 select CPU_TLB_V6 if MMU
381
369# Figure out what processor architecture version we should be using. 382# Figure out what processor architecture version we should be using.
370# This defines the compiler instruction set which depends on the machine type. 383# This defines the compiler instruction set which depends on the machine type.
371config CPU_32v3 384config CPU_32v3
@@ -391,6 +404,9 @@ config CPU_32v5
391config CPU_32v6 404config CPU_32v6
392 bool 405 bool
393 406
407config CPU_32v7
408 bool
409
394# The abort model 410# The abort model
395config CPU_ABRT_NOMMU 411config CPU_ABRT_NOMMU
396 bool 412 bool
@@ -413,6 +429,9 @@ config CPU_ABRT_EV5TJ
413config CPU_ABRT_EV6 429config CPU_ABRT_EV6
414 bool 430 bool
415 431
432config CPU_ABRT_EV7
433 bool
434
416# The cache model 435# The cache model
417config CPU_CACHE_V3 436config CPU_CACHE_V3
418 bool 437 bool
@@ -429,6 +448,9 @@ config CPU_CACHE_V4WB
429config CPU_CACHE_V6 448config CPU_CACHE_V6
430 bool 449 bool
431 450
451config CPU_CACHE_V7
452 bool
453
432config CPU_CACHE_VIVT 454config CPU_CACHE_VIVT
433 bool 455 bool
434 456
@@ -503,7 +525,7 @@ comment "Processor Features"
503 525
504config ARM_THUMB 526config ARM_THUMB
505 bool "Support Thumb user binaries" 527 bool "Support Thumb user binaries"
506 depends on CPU_ARM720T || CPU_ARM740T || CPU_ARM920T || CPU_ARM922T || CPU_ARM925T || CPU_ARM926T || CPU_ARM940T || CPU_ARM946E || CPU_ARM1020 || CPU_ARM1020E || CPU_ARM1022 || CPU_ARM1026 || CPU_XSCALE || CPU_XSC3 || CPU_V6 528 depends on CPU_ARM720T || CPU_ARM740T || CPU_ARM920T || CPU_ARM922T || CPU_ARM925T || CPU_ARM926T || CPU_ARM940T || CPU_ARM946E || CPU_ARM1020 || CPU_ARM1020E || CPU_ARM1022 || CPU_ARM1026 || CPU_XSCALE || CPU_XSC3 || CPU_V6 || CPU_V7
507 default y 529 default y
508 help 530 help
509 Say Y if you want to include kernel support for running user space 531 Say Y if you want to include kernel support for running user space
@@ -578,9 +600,15 @@ config CPU_CACHE_ROUND_ROBIN
578 Say Y here to use the predictable round-robin cache replacement 600 Say Y here to use the predictable round-robin cache replacement
579 policy. Unless you specifically require this or are unsure, say N. 601 policy. Unless you specifically require this or are unsure, say N.
580 602
603config CPU_L2CACHE_DISABLE
604 bool "Disable level 2 cache"
605 depends on CPU_V7
606 help
607 Say Y here to disable the level 2 cache. If unsure, say N.
608
581config CPU_BPREDICT_DISABLE 609config CPU_BPREDICT_DISABLE
582 bool "Disable branch prediction" 610 bool "Disable branch prediction"
583 depends on CPU_ARM1020 || CPU_V6 || CPU_XSC3 611 depends on CPU_ARM1020 || CPU_V6 || CPU_XSC3 || CPU_V7
584 help 612 help
585 Say Y here to disable branch prediction. If unsure, say N. 613 Say Y here to disable branch prediction. If unsure, say N.
586 614
diff --git a/arch/arm/mm/Makefile b/arch/arm/mm/Makefile
index 2f8b95947774..b5bd335ff14a 100644
--- a/arch/arm/mm/Makefile
+++ b/arch/arm/mm/Makefile
@@ -24,12 +24,14 @@ obj-$(CONFIG_CPU_ABRT_LV4T) += abort-lv4t.o
24obj-$(CONFIG_CPU_ABRT_EV5T) += abort-ev5t.o 24obj-$(CONFIG_CPU_ABRT_EV5T) += abort-ev5t.o
25obj-$(CONFIG_CPU_ABRT_EV5TJ) += abort-ev5tj.o 25obj-$(CONFIG_CPU_ABRT_EV5TJ) += abort-ev5tj.o
26obj-$(CONFIG_CPU_ABRT_EV6) += abort-ev6.o 26obj-$(CONFIG_CPU_ABRT_EV6) += abort-ev6.o
27obj-$(CONFIG_CPU_ABRT_EV7) += abort-ev7.o
27 28
28obj-$(CONFIG_CPU_CACHE_V3) += cache-v3.o 29obj-$(CONFIG_CPU_CACHE_V3) += cache-v3.o
29obj-$(CONFIG_CPU_CACHE_V4) += cache-v4.o 30obj-$(CONFIG_CPU_CACHE_V4) += cache-v4.o
30obj-$(CONFIG_CPU_CACHE_V4WT) += cache-v4wt.o 31obj-$(CONFIG_CPU_CACHE_V4WT) += cache-v4wt.o
31obj-$(CONFIG_CPU_CACHE_V4WB) += cache-v4wb.o 32obj-$(CONFIG_CPU_CACHE_V4WB) += cache-v4wb.o
32obj-$(CONFIG_CPU_CACHE_V6) += cache-v6.o 33obj-$(CONFIG_CPU_CACHE_V6) += cache-v6.o
34obj-$(CONFIG_CPU_CACHE_V7) += cache-v7.o
33 35
34obj-$(CONFIG_CPU_COPY_V3) += copypage-v3.o 36obj-$(CONFIG_CPU_COPY_V3) += copypage-v3.o
35obj-$(CONFIG_CPU_COPY_V4WT) += copypage-v4wt.o 37obj-$(CONFIG_CPU_COPY_V4WT) += copypage-v4wt.o
@@ -66,5 +68,6 @@ obj-$(CONFIG_CPU_SA1100) += proc-sa1100.o
66obj-$(CONFIG_CPU_XSCALE) += proc-xscale.o 68obj-$(CONFIG_CPU_XSCALE) += proc-xscale.o
67obj-$(CONFIG_CPU_XSC3) += proc-xsc3.o 69obj-$(CONFIG_CPU_XSC3) += proc-xsc3.o
68obj-$(CONFIG_CPU_V6) += proc-v6.o 70obj-$(CONFIG_CPU_V6) += proc-v6.o
71obj-$(CONFIG_CPU_V7) += proc-v7.o
69 72
70obj-$(CONFIG_CACHE_L2X0) += cache-l2x0.o 73obj-$(CONFIG_CACHE_L2X0) += cache-l2x0.o
diff --git a/arch/arm/mm/abort-ev7.S b/arch/arm/mm/abort-ev7.S
new file mode 100644
index 000000000000..eb90bce38e14
--- /dev/null
+++ b/arch/arm/mm/abort-ev7.S
@@ -0,0 +1,32 @@
1#include <linux/linkage.h>
2#include <asm/assembler.h>
3/*
4 * Function: v7_early_abort
5 *
6 * Params : r2 = address of aborted instruction
7 * : r3 = saved SPSR
8 *
9 * Returns : r0 = address of abort
10 * : r1 = FSR, bit 11 = write
11 * : r2-r8 = corrupted
12 * : r9 = preserved
13 * : sp = pointer to registers
14 *
15 * Purpose : obtain information about current aborted instruction.
16 */
17 .align 5
18ENTRY(v7_early_abort)
19 /*
20 * The effect of data aborts on on the exclusive access monitor are
21 * UNPREDICTABLE. Do a CLREX to clear the state
22 */
23 clrex
24
25 mrc p15, 0, r1, c5, c0, 0 @ get FSR
26 mrc p15, 0, r0, c6, c0, 0 @ get FAR
27
28 /*
29 * V6 code adjusts the returned DFSR.
30 * New designs should not need to patch up faults.
31 */
32 mov pc, lr
diff --git a/arch/arm/mm/cache-v7.S b/arch/arm/mm/cache-v7.S
new file mode 100644
index 000000000000..35ffc4d95997
--- /dev/null
+++ b/arch/arm/mm/cache-v7.S
@@ -0,0 +1,253 @@
1/*
2 * linux/arch/arm/mm/cache-v7.S
3 *
4 * Copyright (C) 2001 Deep Blue Solutions Ltd.
5 * Copyright (C) 2005 ARM Ltd.
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 * This is the "shell" of the ARMv7 processor support.
12 */
13#include <linux/linkage.h>
14#include <linux/init.h>
15#include <asm/assembler.h>
16
17#include "proc-macros.S"
18
19/*
20 * v7_flush_dcache_all()
21 *
22 * Flush the whole D-cache.
23 *
24 * Corrupted registers: r0-r5, r7, r9-r11
25 *
26 * - mm - mm_struct describing address space
27 */
28ENTRY(v7_flush_dcache_all)
29 mrc p15, 1, r0, c0, c0, 1 @ read clidr
30 ands r3, r0, #0x7000000 @ extract loc from clidr
31 mov r3, r3, lsr #23 @ left align loc bit field
32 beq finished @ if loc is 0, then no need to clean
33 mov r10, #0 @ start clean at cache level 0
34loop1:
35 add r2, r10, r10, lsr #1 @ work out 3x current cache level
36 mov r1, r0, lsr r2 @ extract cache type bits from clidr
37 and r1, r1, #7 @ mask of the bits for current cache only
38 cmp r1, #2 @ see what cache we have at this level
39 blt skip @ skip if no cache, or just i-cache
40 mcr p15, 2, r10, c0, c0, 0 @ select current cache level in cssr
41 isb @ isb to sych the new cssr&csidr
42 mrc p15, 1, r1, c0, c0, 0 @ read the new csidr
43 and r2, r1, #7 @ extract the length of the cache lines
44 add r2, r2, #4 @ add 4 (line length offset)
45 ldr r4, =0x3ff
46 ands r4, r4, r1, lsr #3 @ find maximum number on the way size
47 clz r5, r4 @ find bit position of way size increment
48 ldr r7, =0x7fff
49 ands r7, r7, r1, lsr #13 @ extract max number of the index size
50loop2:
51 mov r9, r4 @ create working copy of max way size
52loop3:
53 orr r11, r10, r9, lsl r5 @ factor way and cache number into r11
54 orr r11, r11, r7, lsl r2 @ factor index number into r11
55 mcr p15, 0, r11, c7, c14, 2 @ clean & invalidate by set/way
56 subs r9, r9, #1 @ decrement the way
57 bge loop3
58 subs r7, r7, #1 @ decrement the index
59 bge loop2
60skip:
61 add r10, r10, #2 @ increment cache number
62 cmp r3, r10
63 bgt loop1
64finished:
65 mov r10, #0 @ swith back to cache level 0
66 mcr p15, 2, r10, c0, c0, 0 @ select current cache level in cssr
67 isb
68 mov pc, lr
69
70/*
71 * v7_flush_cache_all()
72 *
73 * Flush the entire cache system.
74 * The data cache flush is now achieved using atomic clean / invalidates
75 * working outwards from L1 cache. This is done using Set/Way based cache
76 * maintainance instructions.
77 * The instruction cache can still be invalidated back to the point of
78 * unification in a single instruction.
79 *
80 */
81ENTRY(v7_flush_kern_cache_all)
82 stmfd sp!, {r4-r5, r7, r9-r11, lr}
83 bl v7_flush_dcache_all
84 mov r0, #0
85 mcr p15, 0, r0, c7, c5, 0 @ I+BTB cache invalidate
86 ldmfd sp!, {r4-r5, r7, r9-r11, lr}
87 mov pc, lr
88
89/*
90 * v7_flush_cache_all()
91 *
92 * Flush all TLB entries in a particular address space
93 *
94 * - mm - mm_struct describing address space
95 */
96ENTRY(v7_flush_user_cache_all)
97 /*FALLTHROUGH*/
98
99/*
100 * v7_flush_cache_range(start, end, flags)
101 *
102 * Flush a range of TLB entries in the specified address space.
103 *
104 * - start - start address (may not be aligned)
105 * - end - end address (exclusive, may not be aligned)
106 * - flags - vm_area_struct flags describing address space
107 *
108 * It is assumed that:
109 * - we have a VIPT cache.
110 */
111ENTRY(v7_flush_user_cache_range)
112 mov pc, lr
113
114/*
115 * v7_coherent_kern_range(start,end)
116 *
117 * Ensure that the I and D caches are coherent within specified
118 * region. This is typically used when code has been written to
119 * a memory region, and will be executed.
120 *
121 * - start - virtual start address of region
122 * - end - virtual end address of region
123 *
124 * It is assumed that:
125 * - the Icache does not read data from the write buffer
126 */
127ENTRY(v7_coherent_kern_range)
128 /* FALLTHROUGH */
129
130/*
131 * v7_coherent_user_range(start,end)
132 *
133 * Ensure that the I and D caches are coherent within specified
134 * region. This is typically used when code has been written to
135 * a memory region, and will be executed.
136 *
137 * - start - virtual start address of region
138 * - end - virtual end address of region
139 *
140 * It is assumed that:
141 * - the Icache does not read data from the write buffer
142 */
143ENTRY(v7_coherent_user_range)
144 dcache_line_size r2, r3
145 sub r3, r2, #1
146 bic r0, r0, r3
1471: mcr p15, 0, r0, c7, c11, 1 @ clean D line to the point of unification
148 dsb
149 mcr p15, 0, r0, c7, c5, 1 @ invalidate I line
150 add r0, r0, r2
151 cmp r0, r1
152 blo 1b
153 mov r0, #0
154 mcr p15, 0, r0, c7, c5, 6 @ invalidate BTB
155 dsb
156 isb
157 mov pc, lr
158
159/*
160 * v7_flush_kern_dcache_page(kaddr)
161 *
162 * Ensure that the data held in the page kaddr is written back
163 * to the page in question.
164 *
165 * - kaddr - kernel address (guaranteed to be page aligned)
166 */
167ENTRY(v7_flush_kern_dcache_page)
168 dcache_line_size r2, r3
169 add r1, r0, #PAGE_SZ
1701:
171 mcr p15, 0, r0, c7, c14, 1 @ clean & invalidate D line / unified line
172 add r0, r0, r2
173 cmp r0, r1
174 blo 1b
175 dsb
176 mov pc, lr
177
178/*
179 * v7_dma_inv_range(start,end)
180 *
181 * Invalidate the data cache within the specified region; we will
182 * be performing a DMA operation in this region and we want to
183 * purge old data in the cache.
184 *
185 * - start - virtual start address of region
186 * - end - virtual end address of region
187 */
188ENTRY(v7_dma_inv_range)
189 dcache_line_size r2, r3
190 sub r3, r2, #1
191 tst r0, r3
192 bic r0, r0, r3
193 mcrne p15, 0, r0, c7, c14, 1 @ clean & invalidate D / U line
194
195 tst r1, r3
196 bic r1, r1, r3
197 mcrne p15, 0, r1, c7, c14, 1 @ clean & invalidate D / U line
1981:
199 mcr p15, 0, r0, c7, c6, 1 @ invalidate D / U line
200 add r0, r0, r2
201 cmp r0, r1
202 blo 1b
203 dsb
204 mov pc, lr
205
206/*
207 * v7_dma_clean_range(start,end)
208 * - start - virtual start address of region
209 * - end - virtual end address of region
210 */
211ENTRY(v7_dma_clean_range)
212 dcache_line_size r2, r3
213 sub r3, r2, #1
214 bic r0, r0, r3
2151:
216 mcr p15, 0, r0, c7, c10, 1 @ clean D / U line
217 add r0, r0, r2
218 cmp r0, r1
219 blo 1b
220 dsb
221 mov pc, lr
222
223/*
224 * v7_dma_flush_range(start,end)
225 * - start - virtual start address of region
226 * - end - virtual end address of region
227 */
228ENTRY(v7_dma_flush_range)
229 dcache_line_size r2, r3
230 sub r3, r2, #1
231 bic r0, r0, r3
2321:
233 mcr p15, 0, r0, c7, c14, 1 @ clean & invalidate D / U line
234 add r0, r0, r2
235 cmp r0, r1
236 blo 1b
237 dsb
238 mov pc, lr
239
240 __INITDATA
241
242 .type v7_cache_fns, #object
243ENTRY(v7_cache_fns)
244 .long v7_flush_kern_cache_all
245 .long v7_flush_user_cache_all
246 .long v7_flush_user_cache_range
247 .long v7_coherent_kern_range
248 .long v7_coherent_user_range
249 .long v7_flush_kern_dcache_page
250 .long v7_dma_inv_range
251 .long v7_dma_clean_range
252 .long v7_dma_flush_range
253 .size v7_cache_fns, . - v7_cache_fns
diff --git a/arch/arm/mm/context.c b/arch/arm/mm/context.c
index 9da43a0fdcdf..fc84fcc74380 100644
--- a/arch/arm/mm/context.c
+++ b/arch/arm/mm/context.c
@@ -14,7 +14,8 @@
14#include <asm/mmu_context.h> 14#include <asm/mmu_context.h>
15#include <asm/tlbflush.h> 15#include <asm/tlbflush.h>
16 16
17unsigned int cpu_last_asid = { 1 << ASID_BITS }; 17static DEFINE_SPINLOCK(cpu_asid_lock);
18unsigned int cpu_last_asid = ASID_FIRST_VERSION;
18 19
19/* 20/*
20 * We fork()ed a process, and we need a new context for the child 21 * We fork()ed a process, and we need a new context for the child
@@ -31,15 +32,16 @@ void __new_context(struct mm_struct *mm)
31{ 32{
32 unsigned int asid; 33 unsigned int asid;
33 34
35 spin_lock(&cpu_asid_lock);
34 asid = ++cpu_last_asid; 36 asid = ++cpu_last_asid;
35 if (asid == 0) 37 if (asid == 0)
36 asid = cpu_last_asid = 1 << ASID_BITS; 38 asid = cpu_last_asid = ASID_FIRST_VERSION;
37 39
38 /* 40 /*
39 * If we've used up all our ASIDs, we need 41 * If we've used up all our ASIDs, we need
40 * to start a new version and flush the TLB. 42 * to start a new version and flush the TLB.
41 */ 43 */
42 if ((asid & ~ASID_MASK) == 0) { 44 if (unlikely((asid & ~ASID_MASK) == 0)) {
43 asid = ++cpu_last_asid; 45 asid = ++cpu_last_asid;
44 /* set the reserved ASID before flushing the TLB */ 46 /* set the reserved ASID before flushing the TLB */
45 asm("mcr p15, 0, %0, c13, c0, 1 @ set reserved context ID\n" 47 asm("mcr p15, 0, %0, c13, c0, 1 @ set reserved context ID\n"
@@ -47,7 +49,16 @@ void __new_context(struct mm_struct *mm)
47 : "r" (0)); 49 : "r" (0));
48 isb(); 50 isb();
49 flush_tlb_all(); 51 flush_tlb_all();
52 if (icache_is_vivt_asid_tagged()) {
53 asm("mcr p15, 0, %0, c7, c5, 0 @ invalidate I-cache\n"
54 "mcr p15, 0, %0, c7, c5, 6 @ flush BTAC/BTB\n"
55 :
56 : "r" (0));
57 dsb();
58 }
50 } 59 }
60 spin_unlock(&cpu_asid_lock);
51 61
62 mm->cpu_vm_mask = cpumask_of_cpu(smp_processor_id());
52 mm->context.id = asid; 63 mm->context.id = asid;
53} 64}
diff --git a/arch/arm/mm/ioremap.c b/arch/arm/mm/ioremap.c
index 0ac615c0f798..d6167ad4e011 100644
--- a/arch/arm/mm/ioremap.c
+++ b/arch/arm/mm/ioremap.c
@@ -32,6 +32,9 @@
32#include <asm/tlbflush.h> 32#include <asm/tlbflush.h>
33#include <asm/sizes.h> 33#include <asm/sizes.h>
34 34
35#include <asm/mach/map.h>
36#include "mm.h"
37
35/* 38/*
36 * Used by ioremap() and iounmap() code to mark (super)section-mapped 39 * Used by ioremap() and iounmap() code to mark (super)section-mapped
37 * I/O regions in vm_struct->flags field. 40 * I/O regions in vm_struct->flags field.
@@ -39,8 +42,9 @@
39#define VM_ARM_SECTION_MAPPING 0x80000000 42#define VM_ARM_SECTION_MAPPING 0x80000000
40 43
41static int remap_area_pte(pmd_t *pmd, unsigned long addr, unsigned long end, 44static int remap_area_pte(pmd_t *pmd, unsigned long addr, unsigned long end,
42 unsigned long phys_addr, pgprot_t prot) 45 unsigned long phys_addr, const struct mem_type *type)
43{ 46{
47 pgprot_t prot = __pgprot(type->prot_pte);
44 pte_t *pte; 48 pte_t *pte;
45 49
46 pte = pte_alloc_kernel(pmd, addr); 50 pte = pte_alloc_kernel(pmd, addr);
@@ -51,7 +55,8 @@ static int remap_area_pte(pmd_t *pmd, unsigned long addr, unsigned long end,
51 if (!pte_none(*pte)) 55 if (!pte_none(*pte))
52 goto bad; 56 goto bad;
53 57
54 set_pte_ext(pte, pfn_pte(phys_addr >> PAGE_SHIFT, prot), 0); 58 set_pte_ext(pte, pfn_pte(phys_addr >> PAGE_SHIFT, prot),
59 type->prot_pte_ext);
55 phys_addr += PAGE_SIZE; 60 phys_addr += PAGE_SIZE;
56 } while (pte++, addr += PAGE_SIZE, addr != end); 61 } while (pte++, addr += PAGE_SIZE, addr != end);
57 return 0; 62 return 0;
@@ -63,7 +68,7 @@ static int remap_area_pte(pmd_t *pmd, unsigned long addr, unsigned long end,
63 68
64static inline int remap_area_pmd(pgd_t *pgd, unsigned long addr, 69static inline int remap_area_pmd(pgd_t *pgd, unsigned long addr,
65 unsigned long end, unsigned long phys_addr, 70 unsigned long end, unsigned long phys_addr,
66 pgprot_t prot) 71 const struct mem_type *type)
67{ 72{
68 unsigned long next; 73 unsigned long next;
69 pmd_t *pmd; 74 pmd_t *pmd;
@@ -75,7 +80,7 @@ static inline int remap_area_pmd(pgd_t *pgd, unsigned long addr,
75 80
76 do { 81 do {
77 next = pmd_addr_end(addr, end); 82 next = pmd_addr_end(addr, end);
78 ret = remap_area_pte(pmd, addr, next, phys_addr, prot); 83 ret = remap_area_pte(pmd, addr, next, phys_addr, type);
79 if (ret) 84 if (ret)
80 return ret; 85 return ret;
81 phys_addr += next - addr; 86 phys_addr += next - addr;
@@ -84,13 +89,11 @@ static inline int remap_area_pmd(pgd_t *pgd, unsigned long addr,
84} 89}
85 90
86static int remap_area_pages(unsigned long start, unsigned long pfn, 91static int remap_area_pages(unsigned long start, unsigned long pfn,
87 unsigned long size, unsigned long flags) 92 size_t size, const struct mem_type *type)
88{ 93{
89 unsigned long addr = start; 94 unsigned long addr = start;
90 unsigned long next, end = start + size; 95 unsigned long next, end = start + size;
91 unsigned long phys_addr = __pfn_to_phys(pfn); 96 unsigned long phys_addr = __pfn_to_phys(pfn);
92 pgprot_t prot = __pgprot(L_PTE_PRESENT | L_PTE_YOUNG |
93 L_PTE_DIRTY | L_PTE_WRITE | flags);
94 pgd_t *pgd; 97 pgd_t *pgd;
95 int err = 0; 98 int err = 0;
96 99
@@ -98,7 +101,7 @@ static int remap_area_pages(unsigned long start, unsigned long pfn,
98 pgd = pgd_offset_k(addr); 101 pgd = pgd_offset_k(addr);
99 do { 102 do {
100 next = pgd_addr_end(addr, end); 103 next = pgd_addr_end(addr, end);
101 err = remap_area_pmd(pgd, addr, next, phys_addr, prot); 104 err = remap_area_pmd(pgd, addr, next, phys_addr, type);
102 if (err) 105 if (err)
103 break; 106 break;
104 phys_addr += next - addr; 107 phys_addr += next - addr;
@@ -178,9 +181,9 @@ static void unmap_area_sections(unsigned long virt, unsigned long size)
178 181
179static int 182static int
180remap_area_sections(unsigned long virt, unsigned long pfn, 183remap_area_sections(unsigned long virt, unsigned long pfn,
181 unsigned long size, unsigned long flags) 184 size_t size, const struct mem_type *type)
182{ 185{
183 unsigned long prot, addr = virt, end = virt + size; 186 unsigned long addr = virt, end = virt + size;
184 pgd_t *pgd; 187 pgd_t *pgd;
185 188
186 /* 189 /*
@@ -189,23 +192,13 @@ remap_area_sections(unsigned long virt, unsigned long pfn,
189 */ 192 */
190 unmap_area_sections(virt, size); 193 unmap_area_sections(virt, size);
191 194
192 prot = PMD_TYPE_SECT | PMD_SECT_AP_WRITE | PMD_DOMAIN(DOMAIN_IO) |
193 (flags & (L_PTE_CACHEABLE | L_PTE_BUFFERABLE));
194
195 /*
196 * ARMv6 and above need XN set to prevent speculative prefetches
197 * hitting IO.
198 */
199 if (cpu_architecture() >= CPU_ARCH_ARMv6)
200 prot |= PMD_SECT_XN;
201
202 pgd = pgd_offset_k(addr); 195 pgd = pgd_offset_k(addr);
203 do { 196 do {
204 pmd_t *pmd = pmd_offset(pgd, addr); 197 pmd_t *pmd = pmd_offset(pgd, addr);
205 198
206 pmd[0] = __pmd(__pfn_to_phys(pfn) | prot); 199 pmd[0] = __pmd(__pfn_to_phys(pfn) | type->prot_sect);
207 pfn += SZ_1M >> PAGE_SHIFT; 200 pfn += SZ_1M >> PAGE_SHIFT;
208 pmd[1] = __pmd(__pfn_to_phys(pfn) | prot); 201 pmd[1] = __pmd(__pfn_to_phys(pfn) | type->prot_sect);
209 pfn += SZ_1M >> PAGE_SHIFT; 202 pfn += SZ_1M >> PAGE_SHIFT;
210 flush_pmd_entry(pmd); 203 flush_pmd_entry(pmd);
211 204
@@ -218,9 +211,9 @@ remap_area_sections(unsigned long virt, unsigned long pfn,
218 211
219static int 212static int
220remap_area_supersections(unsigned long virt, unsigned long pfn, 213remap_area_supersections(unsigned long virt, unsigned long pfn,
221 unsigned long size, unsigned long flags) 214 size_t size, const struct mem_type *type)
222{ 215{
223 unsigned long prot, addr = virt, end = virt + size; 216 unsigned long addr = virt, end = virt + size;
224 pgd_t *pgd; 217 pgd_t *pgd;
225 218
226 /* 219 /*
@@ -229,22 +222,12 @@ remap_area_supersections(unsigned long virt, unsigned long pfn,
229 */ 222 */
230 unmap_area_sections(virt, size); 223 unmap_area_sections(virt, size);
231 224
232 prot = PMD_TYPE_SECT | PMD_SECT_SUPER | PMD_SECT_AP_WRITE |
233 PMD_DOMAIN(DOMAIN_IO) |
234 (flags & (L_PTE_CACHEABLE | L_PTE_BUFFERABLE));
235
236 /*
237 * ARMv6 and above need XN set to prevent speculative prefetches
238 * hitting IO.
239 */
240 if (cpu_architecture() >= CPU_ARCH_ARMv6)
241 prot |= PMD_SECT_XN;
242
243 pgd = pgd_offset_k(virt); 225 pgd = pgd_offset_k(virt);
244 do { 226 do {
245 unsigned long super_pmd_val, i; 227 unsigned long super_pmd_val, i;
246 228
247 super_pmd_val = __pfn_to_phys(pfn) | prot; 229 super_pmd_val = __pfn_to_phys(pfn) | type->prot_sect |
230 PMD_SECT_SUPER;
248 super_pmd_val |= ((pfn >> (32 - PAGE_SHIFT)) & 0xf) << 20; 231 super_pmd_val |= ((pfn >> (32 - PAGE_SHIFT)) & 0xf) << 20;
249 232
250 for (i = 0; i < 8; i++) { 233 for (i = 0; i < 8; i++) {
@@ -279,9 +262,10 @@ remap_area_supersections(unsigned long virt, unsigned long pfn,
279 * mapping. See include/asm-arm/proc-armv/pgtable.h for more information. 262 * mapping. See include/asm-arm/proc-armv/pgtable.h for more information.
280 */ 263 */
281void __iomem * 264void __iomem *
282__ioremap_pfn(unsigned long pfn, unsigned long offset, size_t size, 265__arm_ioremap_pfn(unsigned long pfn, unsigned long offset, size_t size,
283 unsigned long flags) 266 unsigned int mtype)
284{ 267{
268 const struct mem_type *type;
285 int err; 269 int err;
286 unsigned long addr; 270 unsigned long addr;
287 struct vm_struct * area; 271 struct vm_struct * area;
@@ -292,6 +276,10 @@ __ioremap_pfn(unsigned long pfn, unsigned long offset, size_t size,
292 if (pfn >= 0x100000 && (__pfn_to_phys(pfn) & ~SUPERSECTION_MASK)) 276 if (pfn >= 0x100000 && (__pfn_to_phys(pfn) & ~SUPERSECTION_MASK))
293 return NULL; 277 return NULL;
294 278
279 type = get_mem_type(mtype);
280 if (!type)
281 return NULL;
282
295 size = PAGE_ALIGN(size); 283 size = PAGE_ALIGN(size);
296 284
297 area = get_vm_area(size, VM_IOREMAP); 285 area = get_vm_area(size, VM_IOREMAP);
@@ -302,16 +290,16 @@ __ioremap_pfn(unsigned long pfn, unsigned long offset, size_t size,
302#ifndef CONFIG_SMP 290#ifndef CONFIG_SMP
303 if (DOMAIN_IO == 0 && 291 if (DOMAIN_IO == 0 &&
304 (((cpu_architecture() >= CPU_ARCH_ARMv6) && (get_cr() & CR_XP)) || 292 (((cpu_architecture() >= CPU_ARCH_ARMv6) && (get_cr() & CR_XP)) ||
305 cpu_is_xsc3()) && 293 cpu_is_xsc3()) && pfn >= 0x100000 &&
306 !((__pfn_to_phys(pfn) | size | addr) & ~SUPERSECTION_MASK)) { 294 !((__pfn_to_phys(pfn) | size | addr) & ~SUPERSECTION_MASK)) {
307 area->flags |= VM_ARM_SECTION_MAPPING; 295 area->flags |= VM_ARM_SECTION_MAPPING;
308 err = remap_area_supersections(addr, pfn, size, flags); 296 err = remap_area_supersections(addr, pfn, size, type);
309 } else if (!((__pfn_to_phys(pfn) | size | addr) & ~PMD_MASK)) { 297 } else if (!((__pfn_to_phys(pfn) | size | addr) & ~PMD_MASK)) {
310 area->flags |= VM_ARM_SECTION_MAPPING; 298 area->flags |= VM_ARM_SECTION_MAPPING;
311 err = remap_area_sections(addr, pfn, size, flags); 299 err = remap_area_sections(addr, pfn, size, type);
312 } else 300 } else
313#endif 301#endif
314 err = remap_area_pages(addr, pfn, size, flags); 302 err = remap_area_pages(addr, pfn, size, type);
315 303
316 if (err) { 304 if (err) {
317 vunmap((void *)addr); 305 vunmap((void *)addr);
@@ -321,10 +309,10 @@ __ioremap_pfn(unsigned long pfn, unsigned long offset, size_t size,
321 flush_cache_vmap(addr, addr + size); 309 flush_cache_vmap(addr, addr + size);
322 return (void __iomem *) (offset + addr); 310 return (void __iomem *) (offset + addr);
323} 311}
324EXPORT_SYMBOL(__ioremap_pfn); 312EXPORT_SYMBOL(__arm_ioremap_pfn);
325 313
326void __iomem * 314void __iomem *
327__ioremap(unsigned long phys_addr, size_t size, unsigned long flags) 315__arm_ioremap(unsigned long phys_addr, size_t size, unsigned int mtype)
328{ 316{
329 unsigned long last_addr; 317 unsigned long last_addr;
330 unsigned long offset = phys_addr & ~PAGE_MASK; 318 unsigned long offset = phys_addr & ~PAGE_MASK;
@@ -342,9 +330,9 @@ __ioremap(unsigned long phys_addr, size_t size, unsigned long flags)
342 */ 330 */
343 size = PAGE_ALIGN(last_addr + 1) - phys_addr; 331 size = PAGE_ALIGN(last_addr + 1) - phys_addr;
344 332
345 return __ioremap_pfn(pfn, offset, size, flags); 333 return __arm_ioremap_pfn(pfn, offset, size, mtype);
346} 334}
347EXPORT_SYMBOL(__ioremap); 335EXPORT_SYMBOL(__arm_ioremap);
348 336
349void __iounmap(volatile void __iomem *addr) 337void __iounmap(volatile void __iomem *addr)
350{ 338{
diff --git a/arch/arm/mm/mm.h b/arch/arm/mm/mm.h
index a44e30970635..7647c597fc59 100644
--- a/arch/arm/mm/mm.h
+++ b/arch/arm/mm/mm.h
@@ -16,6 +16,16 @@ static inline pmd_t *pmd_off_k(unsigned long virt)
16 return pmd_off(pgd_offset_k(virt), virt); 16 return pmd_off(pgd_offset_k(virt), virt);
17} 17}
18 18
19struct mem_type {
20 unsigned int prot_pte;
21 unsigned int prot_pte_ext;
22 unsigned int prot_l1;
23 unsigned int prot_sect;
24 unsigned int domain;
25};
26
27const struct mem_type *get_mem_type(unsigned int type);
28
19#endif 29#endif
20 30
21struct map_desc; 31struct map_desc;
diff --git a/arch/arm/mm/mmap.c b/arch/arm/mm/mmap.c
index b0b5f4694070..2c4c2422cd1e 100644
--- a/arch/arm/mm/mmap.c
+++ b/arch/arm/mm/mmap.c
@@ -49,8 +49,7 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr,
49#endif 49#endif
50 50
51 /* 51 /*
52 * We should enforce the MAP_FIXED case. However, currently 52 * We enforce the MAP_FIXED case.
53 * the generic kernel code doesn't allow us to handle this.
54 */ 53 */
55 if (flags & MAP_FIXED) { 54 if (flags & MAP_FIXED) {
56 if (aliasing && flags & MAP_SHARED && addr & (SHMLBA - 1)) 55 if (aliasing && flags & MAP_SHARED && addr & (SHMLBA - 1))
diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c
index 94fd4bf5cb9e..2ba1530d1ce1 100644
--- a/arch/arm/mm/mmu.c
+++ b/arch/arm/mm/mmu.c
@@ -176,28 +176,42 @@ void adjust_cr(unsigned long mask, unsigned long set)
176} 176}
177#endif 177#endif
178 178
179struct mem_types { 179#define PROT_PTE_DEVICE L_PTE_PRESENT|L_PTE_YOUNG|L_PTE_DIRTY|L_PTE_WRITE
180 unsigned int prot_pte; 180#define PROT_SECT_DEVICE PMD_TYPE_SECT|PMD_SECT_XN|PMD_SECT_AP_WRITE
181 unsigned int prot_l1; 181
182 unsigned int prot_sect; 182static struct mem_type mem_types[] = {
183 unsigned int domain; 183 [MT_DEVICE] = { /* Strongly ordered / ARMv6 shared device */
184}; 184 .prot_pte = PROT_PTE_DEVICE,
185 185 .prot_l1 = PMD_TYPE_TABLE,
186static struct mem_types mem_types[] __initdata = { 186 .prot_sect = PROT_SECT_DEVICE | PMD_SECT_UNCACHED,
187 [MT_DEVICE] = { 187 .domain = DOMAIN_IO,
188 .prot_pte = L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_DIRTY | 188 },
189 L_PTE_WRITE, 189 [MT_DEVICE_NONSHARED] = { /* ARMv6 non-shared device */
190 .prot_l1 = PMD_TYPE_TABLE, 190 .prot_pte = PROT_PTE_DEVICE,
191 .prot_sect = PMD_TYPE_SECT | PMD_BIT4 | PMD_SECT_UNCACHED | 191 .prot_pte_ext = PTE_EXT_TEX(2),
192 PMD_SECT_AP_WRITE, 192 .prot_l1 = PMD_TYPE_TABLE,
193 .domain = DOMAIN_IO, 193 .prot_sect = PROT_SECT_DEVICE | PMD_SECT_TEX(2),
194 .domain = DOMAIN_IO,
195 },
196 [MT_DEVICE_CACHED] = { /* ioremap_cached */
197 .prot_pte = PROT_PTE_DEVICE | L_PTE_CACHEABLE | L_PTE_BUFFERABLE,
198 .prot_l1 = PMD_TYPE_TABLE,
199 .prot_sect = PROT_SECT_DEVICE | PMD_SECT_WB,
200 .domain = DOMAIN_IO,
201 },
202 [MT_DEVICE_IXP2000] = { /* IXP2400 requires XCB=101 for on-chip I/O */
203 .prot_pte = PROT_PTE_DEVICE,
204 .prot_l1 = PMD_TYPE_TABLE,
205 .prot_sect = PROT_SECT_DEVICE | PMD_SECT_BUFFERABLE |
206 PMD_SECT_TEX(1),
207 .domain = DOMAIN_IO,
194 }, 208 },
195 [MT_CACHECLEAN] = { 209 [MT_CACHECLEAN] = {
196 .prot_sect = PMD_TYPE_SECT | PMD_BIT4, 210 .prot_sect = PMD_TYPE_SECT | PMD_SECT_XN,
197 .domain = DOMAIN_KERNEL, 211 .domain = DOMAIN_KERNEL,
198 }, 212 },
199 [MT_MINICLEAN] = { 213 [MT_MINICLEAN] = {
200 .prot_sect = PMD_TYPE_SECT | PMD_BIT4 | PMD_SECT_MINICACHE, 214 .prot_sect = PMD_TYPE_SECT | PMD_SECT_XN | PMD_SECT_MINICACHE,
201 .domain = DOMAIN_KERNEL, 215 .domain = DOMAIN_KERNEL,
202 }, 216 },
203 [MT_LOW_VECTORS] = { 217 [MT_LOW_VECTORS] = {
@@ -213,30 +227,20 @@ static struct mem_types mem_types[] __initdata = {
213 .domain = DOMAIN_USER, 227 .domain = DOMAIN_USER,
214 }, 228 },
215 [MT_MEMORY] = { 229 [MT_MEMORY] = {
216 .prot_sect = PMD_TYPE_SECT | PMD_BIT4 | PMD_SECT_AP_WRITE, 230 .prot_sect = PMD_TYPE_SECT | PMD_SECT_AP_WRITE,
217 .domain = DOMAIN_KERNEL, 231 .domain = DOMAIN_KERNEL,
218 }, 232 },
219 [MT_ROM] = { 233 [MT_ROM] = {
220 .prot_sect = PMD_TYPE_SECT | PMD_BIT4, 234 .prot_sect = PMD_TYPE_SECT,
221 .domain = DOMAIN_KERNEL, 235 .domain = DOMAIN_KERNEL,
222 }, 236 },
223 [MT_IXP2000_DEVICE] = { /* IXP2400 requires XCB=101 for on-chip I/O */
224 .prot_pte = L_PTE_PRESENT | L_PTE_YOUNG | L_PTE_DIRTY |
225 L_PTE_WRITE,
226 .prot_l1 = PMD_TYPE_TABLE,
227 .prot_sect = PMD_TYPE_SECT | PMD_BIT4 | PMD_SECT_UNCACHED |
228 PMD_SECT_AP_WRITE | PMD_SECT_BUFFERABLE |
229 PMD_SECT_TEX(1),
230 .domain = DOMAIN_IO,
231 },
232 [MT_NONSHARED_DEVICE] = {
233 .prot_l1 = PMD_TYPE_TABLE,
234 .prot_sect = PMD_TYPE_SECT | PMD_BIT4 | PMD_SECT_NONSHARED_DEV |
235 PMD_SECT_AP_WRITE,
236 .domain = DOMAIN_IO,
237 }
238}; 237};
239 238
239const struct mem_type *get_mem_type(unsigned int type)
240{
241 return type < ARRAY_SIZE(mem_types) ? &mem_types[type] : NULL;
242}
243
240/* 244/*
241 * Adjust the PMD section entries according to the CPU in use. 245 * Adjust the PMD section entries according to the CPU in use.
242 */ 246 */
@@ -262,20 +266,23 @@ static void __init build_mem_type_table(void)
262 } 266 }
263 267
264 /* 268 /*
265 * Xscale must not have PMD bit 4 set for section mappings. 269 * ARMv5 and lower, bit 4 must be set for page tables.
270 * (was: cache "update-able on write" bit on ARM610)
271 * However, Xscale cores require this bit to be cleared.
266 */ 272 */
267 if (cpu_is_xscale()) 273 if (cpu_is_xscale()) {
268 for (i = 0; i < ARRAY_SIZE(mem_types); i++) 274 for (i = 0; i < ARRAY_SIZE(mem_types); i++) {
269 mem_types[i].prot_sect &= ~PMD_BIT4; 275 mem_types[i].prot_sect &= ~PMD_BIT4;
270 276 mem_types[i].prot_l1 &= ~PMD_BIT4;
271 /* 277 }
272 * ARMv5 and lower, excluding Xscale, bit 4 must be set for 278 } else if (cpu_arch < CPU_ARCH_ARMv6) {
273 * page tables. 279 for (i = 0; i < ARRAY_SIZE(mem_types); i++) {
274 */
275 if (cpu_arch < CPU_ARCH_ARMv6 && !cpu_is_xscale())
276 for (i = 0; i < ARRAY_SIZE(mem_types); i++)
277 if (mem_types[i].prot_l1) 280 if (mem_types[i].prot_l1)
278 mem_types[i].prot_l1 |= PMD_BIT4; 281 mem_types[i].prot_l1 |= PMD_BIT4;
282 if (mem_types[i].prot_sect)
283 mem_types[i].prot_sect |= PMD_BIT4;
284 }
285 }
279 286
280 cp = &cache_policies[cachepolicy]; 287 cp = &cache_policies[cachepolicy];
281 kern_pgprot = user_pgprot = cp->pte; 288 kern_pgprot = user_pgprot = cp->pte;
@@ -296,13 +303,6 @@ static void __init build_mem_type_table(void)
296 */ 303 */
297 if (cpu_arch >= CPU_ARCH_ARMv6 && (cr & CR_XP)) { 304 if (cpu_arch >= CPU_ARCH_ARMv6 && (cr & CR_XP)) {
298 /* 305 /*
299 * bit 4 becomes XN which we must clear for the
300 * kernel memory mapping.
301 */
302 mem_types[MT_MEMORY].prot_sect &= ~PMD_SECT_XN;
303 mem_types[MT_ROM].prot_sect &= ~PMD_SECT_XN;
304
305 /*
306 * Mark cache clean areas and XIP ROM read only 306 * Mark cache clean areas and XIP ROM read only
307 * from SVC mode and no access from userspace. 307 * from SVC mode and no access from userspace.
308 */ 308 */
@@ -368,64 +368,126 @@ static void __init build_mem_type_table(void)
368 } 368 }
369 printk("Memory policy: ECC %sabled, Data cache %s\n", 369 printk("Memory policy: ECC %sabled, Data cache %s\n",
370 ecc_mask ? "en" : "dis", cp->policy); 370 ecc_mask ? "en" : "dis", cp->policy);
371
372 for (i = 0; i < ARRAY_SIZE(mem_types); i++) {
373 struct mem_type *t = &mem_types[i];
374 if (t->prot_l1)
375 t->prot_l1 |= PMD_DOMAIN(t->domain);
376 if (t->prot_sect)
377 t->prot_sect |= PMD_DOMAIN(t->domain);
378 }
371} 379}
372 380
373#define vectors_base() (vectors_high() ? 0xffff0000 : 0) 381#define vectors_base() (vectors_high() ? 0xffff0000 : 0)
374 382
375/* 383static void __init alloc_init_pte(pmd_t *pmd, unsigned long addr,
376 * Create a SECTION PGD between VIRT and PHYS in domain 384 unsigned long end, unsigned long pfn,
377 * DOMAIN with protection PROT. This operates on half- 385 const struct mem_type *type)
378 * pgdir entry increments.
379 */
380static inline void
381alloc_init_section(unsigned long virt, unsigned long phys, int prot)
382{ 386{
383 pmd_t *pmdp = pmd_off_k(virt); 387 pte_t *pte;
384 388
385 if (virt & (1 << 20)) 389 if (pmd_none(*pmd)) {
386 pmdp++; 390 pte = alloc_bootmem_low_pages(2 * PTRS_PER_PTE * sizeof(pte_t));
391 __pmd_populate(pmd, __pa(pte) | type->prot_l1);
392 }
387 393
388 *pmdp = __pmd(phys | prot); 394 pte = pte_offset_kernel(pmd, addr);
389 flush_pmd_entry(pmdp); 395 do {
396 set_pte_ext(pte, pfn_pte(pfn, __pgprot(type->prot_pte)),
397 type->prot_pte_ext);
398 pfn++;
399 } while (pte++, addr += PAGE_SIZE, addr != end);
390} 400}
391 401
392/* 402static void __init alloc_init_section(pgd_t *pgd, unsigned long addr,
393 * Create a SUPER SECTION PGD between VIRT and PHYS with protection PROT 403 unsigned long end, unsigned long phys,
394 */ 404 const struct mem_type *type)
395static inline void
396alloc_init_supersection(unsigned long virt, unsigned long phys, int prot)
397{ 405{
398 int i; 406 pmd_t *pmd = pmd_offset(pgd, addr);
407
408 /*
409 * Try a section mapping - end, addr and phys must all be aligned
410 * to a section boundary. Note that PMDs refer to the individual
411 * L1 entries, whereas PGDs refer to a group of L1 entries making
412 * up one logical pointer to an L2 table.
413 */
414 if (((addr | end | phys) & ~SECTION_MASK) == 0) {
415 pmd_t *p = pmd;
416
417 if (addr & SECTION_SIZE)
418 pmd++;
399 419
400 for (i = 0; i < 16; i += 1) { 420 do {
401 alloc_init_section(virt, phys, prot | PMD_SECT_SUPER); 421 *pmd = __pmd(phys | type->prot_sect);
422 phys += SECTION_SIZE;
423 } while (pmd++, addr += SECTION_SIZE, addr != end);
402 424
403 virt += (PGDIR_SIZE / 2); 425 flush_pmd_entry(p);
426 } else {
427 /*
428 * No need to loop; pte's aren't interested in the
429 * individual L1 entries.
430 */
431 alloc_init_pte(pmd, addr, end, __phys_to_pfn(phys), type);
404 } 432 }
405} 433}
406 434
407/* 435static void __init create_36bit_mapping(struct map_desc *md,
408 * Add a PAGE mapping between VIRT and PHYS in domain 436 const struct mem_type *type)
409 * DOMAIN with protection PROT. Note that due to the
410 * way we map the PTEs, we must allocate two PTE_SIZE'd
411 * blocks - one for the Linux pte table, and one for
412 * the hardware pte table.
413 */
414static inline void
415alloc_init_page(unsigned long virt, unsigned long phys, unsigned int prot_l1, pgprot_t prot)
416{ 437{
417 pmd_t *pmdp = pmd_off_k(virt); 438 unsigned long phys, addr, length, end;
418 pte_t *ptep; 439 pgd_t *pgd;
440
441 addr = md->virtual;
442 phys = (unsigned long)__pfn_to_phys(md->pfn);
443 length = PAGE_ALIGN(md->length);
444
445 if (!(cpu_architecture() >= CPU_ARCH_ARMv6 || cpu_is_xsc3())) {
446 printk(KERN_ERR "MM: CPU does not support supersection "
447 "mapping for 0x%08llx at 0x%08lx\n",
448 __pfn_to_phys((u64)md->pfn), addr);
449 return;
450 }
419 451
420 if (pmd_none(*pmdp)) { 452 /* N.B. ARMv6 supersections are only defined to work with domain 0.
421 ptep = alloc_bootmem_low_pages(2 * PTRS_PER_PTE * 453 * Since domain assignments can in fact be arbitrary, the
422 sizeof(pte_t)); 454 * 'domain == 0' check below is required to insure that ARMv6
455 * supersections are only allocated for domain 0 regardless
456 * of the actual domain assignments in use.
457 */
458 if (type->domain) {
459 printk(KERN_ERR "MM: invalid domain in supersection "
460 "mapping for 0x%08llx at 0x%08lx\n",
461 __pfn_to_phys((u64)md->pfn), addr);
462 return;
463 }
423 464
424 __pmd_populate(pmdp, __pa(ptep) | prot_l1); 465 if ((addr | length | __pfn_to_phys(md->pfn)) & ~SUPERSECTION_MASK) {
466 printk(KERN_ERR "MM: cannot create mapping for "
467 "0x%08llx at 0x%08lx invalid alignment\n",
468 __pfn_to_phys((u64)md->pfn), addr);
469 return;
425 } 470 }
426 ptep = pte_offset_kernel(pmdp, virt);
427 471
428 set_pte_ext(ptep, pfn_pte(phys >> PAGE_SHIFT, prot), 0); 472 /*
473 * Shift bits [35:32] of address into bits [23:20] of PMD
474 * (See ARMv6 spec).
475 */
476 phys |= (((md->pfn >> (32 - PAGE_SHIFT)) & 0xF) << 20);
477
478 pgd = pgd_offset_k(addr);
479 end = addr + length;
480 do {
481 pmd_t *pmd = pmd_offset(pgd, addr);
482 int i;
483
484 for (i = 0; i < 16; i++)
485 *pmd++ = __pmd(phys | type->prot_sect | PMD_SECT_SUPER);
486
487 addr += SUPERSECTION_SIZE;
488 phys += SUPERSECTION_SIZE;
489 pgd += SUPERSECTION_SIZE >> PGDIR_SHIFT;
490 } while (addr != end);
429} 491}
430 492
431/* 493/*
@@ -437,10 +499,9 @@ alloc_init_page(unsigned long virt, unsigned long phys, unsigned int prot_l1, pg
437 */ 499 */
438void __init create_mapping(struct map_desc *md) 500void __init create_mapping(struct map_desc *md)
439{ 501{
440 unsigned long virt, length; 502 unsigned long phys, addr, length, end;
441 int prot_sect, prot_l1, domain; 503 const struct mem_type *type;
442 pgprot_t prot_pte; 504 pgd_t *pgd;
443 unsigned long off = (u32)__pfn_to_phys(md->pfn);
444 505
445 if (md->virtual != vectors_base() && md->virtual < TASK_SIZE) { 506 if (md->virtual != vectors_base() && md->virtual < TASK_SIZE) {
446 printk(KERN_WARNING "BUG: not creating mapping for " 507 printk(KERN_WARNING "BUG: not creating mapping for "
@@ -456,105 +517,37 @@ void __init create_mapping(struct map_desc *md)
456 __pfn_to_phys((u64)md->pfn), md->virtual); 517 __pfn_to_phys((u64)md->pfn), md->virtual);
457 } 518 }
458 519
459 domain = mem_types[md->type].domain; 520 type = &mem_types[md->type];
460 prot_pte = __pgprot(mem_types[md->type].prot_pte);
461 prot_l1 = mem_types[md->type].prot_l1 | PMD_DOMAIN(domain);
462 prot_sect = mem_types[md->type].prot_sect | PMD_DOMAIN(domain);
463 521
464 /* 522 /*
465 * Catch 36-bit addresses 523 * Catch 36-bit addresses
466 */ 524 */
467 if(md->pfn >= 0x100000) { 525 if (md->pfn >= 0x100000) {
468 if(domain) { 526 create_36bit_mapping(md, type);
469 printk(KERN_ERR "MM: invalid domain in supersection " 527 return;
470 "mapping for 0x%08llx at 0x%08lx\n",
471 __pfn_to_phys((u64)md->pfn), md->virtual);
472 return;
473 }
474 if((md->virtual | md->length | __pfn_to_phys(md->pfn))
475 & ~SUPERSECTION_MASK) {
476 printk(KERN_ERR "MM: cannot create mapping for "
477 "0x%08llx at 0x%08lx invalid alignment\n",
478 __pfn_to_phys((u64)md->pfn), md->virtual);
479 return;
480 }
481
482 /*
483 * Shift bits [35:32] of address into bits [23:20] of PMD
484 * (See ARMv6 spec).
485 */
486 off |= (((md->pfn >> (32 - PAGE_SHIFT)) & 0xF) << 20);
487 } 528 }
488 529
489 virt = md->virtual; 530 addr = md->virtual;
490 off -= virt; 531 phys = (unsigned long)__pfn_to_phys(md->pfn);
491 length = md->length; 532 length = PAGE_ALIGN(md->length);
492 533
493 if (mem_types[md->type].prot_l1 == 0 && 534 if (type->prot_l1 == 0 && ((addr | phys | length) & ~SECTION_MASK)) {
494 (virt & 0xfffff || (virt + off) & 0xfffff || (virt + length) & 0xfffff)) {
495 printk(KERN_WARNING "BUG: map for 0x%08lx at 0x%08lx can not " 535 printk(KERN_WARNING "BUG: map for 0x%08lx at 0x%08lx can not "
496 "be mapped using pages, ignoring.\n", 536 "be mapped using pages, ignoring.\n",
497 __pfn_to_phys(md->pfn), md->virtual); 537 __pfn_to_phys(md->pfn), addr);
498 return; 538 return;
499 } 539 }
500 540
501 while ((virt & 0xfffff || (virt + off) & 0xfffff) && length >= PAGE_SIZE) { 541 pgd = pgd_offset_k(addr);
502 alloc_init_page(virt, virt + off, prot_l1, prot_pte); 542 end = addr + length;
543 do {
544 unsigned long next = pgd_addr_end(addr, end);
503 545
504 virt += PAGE_SIZE; 546 alloc_init_section(pgd, addr, next, phys, type);
505 length -= PAGE_SIZE;
506 }
507
508 /* N.B. ARMv6 supersections are only defined to work with domain 0.
509 * Since domain assignments can in fact be arbitrary, the
510 * 'domain == 0' check below is required to insure that ARMv6
511 * supersections are only allocated for domain 0 regardless
512 * of the actual domain assignments in use.
513 */
514 if ((cpu_architecture() >= CPU_ARCH_ARMv6 || cpu_is_xsc3())
515 && domain == 0) {
516 /*
517 * Align to supersection boundary if !high pages.
518 * High pages have already been checked for proper
519 * alignment above and they will fail the SUPSERSECTION_MASK
520 * check because of the way the address is encoded into
521 * offset.
522 */
523 if (md->pfn <= 0x100000) {
524 while ((virt & ~SUPERSECTION_MASK ||
525 (virt + off) & ~SUPERSECTION_MASK) &&
526 length >= (PGDIR_SIZE / 2)) {
527 alloc_init_section(virt, virt + off, prot_sect);
528
529 virt += (PGDIR_SIZE / 2);
530 length -= (PGDIR_SIZE / 2);
531 }
532 }
533 547
534 while (length >= SUPERSECTION_SIZE) { 548 phys += next - addr;
535 alloc_init_supersection(virt, virt + off, prot_sect); 549 addr = next;
536 550 } while (pgd++, addr != end);
537 virt += SUPERSECTION_SIZE;
538 length -= SUPERSECTION_SIZE;
539 }
540 }
541
542 /*
543 * A section mapping covers half a "pgdir" entry.
544 */
545 while (length >= (PGDIR_SIZE / 2)) {
546 alloc_init_section(virt, virt + off, prot_sect);
547
548 virt += (PGDIR_SIZE / 2);
549 length -= (PGDIR_SIZE / 2);
550 }
551
552 while (length >= PAGE_SIZE) {
553 alloc_init_page(virt, virt + off, prot_l1, prot_pte);
554
555 virt += PAGE_SIZE;
556 length -= PAGE_SIZE;
557 }
558} 551}
559 552
560/* 553/*
diff --git a/arch/arm/mm/nommu.c b/arch/arm/mm/nommu.c
index 05818fc0c705..8cd3a60954f0 100644
--- a/arch/arm/mm/nommu.c
+++ b/arch/arm/mm/nommu.c
@@ -62,21 +62,21 @@ void flush_dcache_page(struct page *page)
62} 62}
63EXPORT_SYMBOL(flush_dcache_page); 63EXPORT_SYMBOL(flush_dcache_page);
64 64
65void __iomem *__ioremap_pfn(unsigned long pfn, unsigned long offset, 65void __iomem *__arm_ioremap_pfn(unsigned long pfn, unsigned long offset,
66 size_t size, unsigned long flags) 66 size_t size, unsigned int mtype)
67{ 67{
68 if (pfn >= (0x100000000ULL >> PAGE_SHIFT)) 68 if (pfn >= (0x100000000ULL >> PAGE_SHIFT))
69 return NULL; 69 return NULL;
70 return (void __iomem *) (offset + (pfn << PAGE_SHIFT)); 70 return (void __iomem *) (offset + (pfn << PAGE_SHIFT));
71} 71}
72EXPORT_SYMBOL(__ioremap_pfn); 72EXPORT_SYMBOL(__arm_ioremap_pfn);
73 73
74void __iomem *__ioremap(unsigned long phys_addr, size_t size, 74void __iomem *__arm_ioremap(unsigned long phys_addr, size_t size,
75 unsigned long flags) 75 unsigned int mtype)
76{ 76{
77 return (void __iomem *)phys_addr; 77 return (void __iomem *)phys_addr;
78} 78}
79EXPORT_SYMBOL(__ioremap); 79EXPORT_SYMBOL(__arm_ioremap);
80 80
81void __iounmap(volatile void __iomem *addr) 81void __iounmap(volatile void __iomem *addr)
82{ 82{
diff --git a/arch/arm/mm/proc-macros.S b/arch/arm/mm/proc-macros.S
index 9e2c89eb2115..b13150052a76 100644
--- a/arch/arm/mm/proc-macros.S
+++ b/arch/arm/mm/proc-macros.S
@@ -59,3 +59,15 @@
59 .word \ucset 59 .word \ucset
60#endif 60#endif
61 .endm 61 .endm
62
63/*
64 * cache_line_size - get the cache line size from the CSIDR register
65 * (available on ARMv7+). It assumes that the CSSR register was configured
66 * to access the L1 data cache CSIDR.
67 */
68 .macro dcache_line_size, reg, tmp
69 mrc p15, 1, \tmp, c0, c0, 0 @ read CSIDR
70 and \tmp, \tmp, #7 @ cache line size encoding
71 mov \reg, #16 @ size offset
72 mov \reg, \reg, lsl \tmp @ actual cache line size
73 .endm
diff --git a/arch/arm/mm/proc-v7.S b/arch/arm/mm/proc-v7.S
new file mode 100644
index 000000000000..dd823dd4a374
--- /dev/null
+++ b/arch/arm/mm/proc-v7.S
@@ -0,0 +1,262 @@
1/*
2 * linux/arch/arm/mm/proc-v7.S
3 *
4 * Copyright (C) 2001 Deep Blue Solutions Ltd.
5 *
6 * 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 * published by the Free Software Foundation.
9 *
10 * This is the "shell" of the ARMv7 processor support.
11 */
12#include <linux/linkage.h>
13#include <asm/assembler.h>
14#include <asm/asm-offsets.h>
15#include <asm/elf.h>
16#include <asm/pgtable-hwdef.h>
17#include <asm/pgtable.h>
18
19#include "proc-macros.S"
20
21#define TTB_C (1 << 0)
22#define TTB_S (1 << 1)
23#define TTB_RGN_OC_WT (2 << 3)
24#define TTB_RGN_OC_WB (3 << 3)
25
26ENTRY(cpu_v7_proc_init)
27 mov pc, lr
28
29ENTRY(cpu_v7_proc_fin)
30 mov pc, lr
31
32/*
33 * cpu_v7_reset(loc)
34 *
35 * Perform a soft reset of the system. Put the CPU into the
36 * same state as it would be if it had been reset, and branch
37 * to what would be the reset vector.
38 *
39 * - loc - location to jump to for soft reset
40 *
41 * It is assumed that:
42 */
43 .align 5
44ENTRY(cpu_v7_reset)
45 mov pc, r0
46
47/*
48 * cpu_v7_do_idle()
49 *
50 * Idle the processor (eg, wait for interrupt).
51 *
52 * IRQs are already disabled.
53 */
54ENTRY(cpu_v7_do_idle)
55 .long 0xe320f003 @ ARM V7 WFI instruction
56 mov pc, lr
57
58ENTRY(cpu_v7_dcache_clean_area)
59#ifndef TLB_CAN_READ_FROM_L1_CACHE
60 dcache_line_size r2, r3
611: mcr p15, 0, r0, c7, c10, 1 @ clean D entry
62 add r0, r0, r2
63 subs r1, r1, r2
64 bhi 1b
65 dsb
66#endif
67 mov pc, lr
68
69/*
70 * cpu_v7_switch_mm(pgd_phys, tsk)
71 *
72 * Set the translation table base pointer to be pgd_phys
73 *
74 * - pgd_phys - physical address of new TTB
75 *
76 * It is assumed that:
77 * - we are not using split page tables
78 */
79ENTRY(cpu_v7_switch_mm)
80 mov r2, #0
81 ldr r1, [r1, #MM_CONTEXT_ID] @ get mm->context.id
82 orr r0, r0, #TTB_RGN_OC_WB @ mark PTWs outer cacheable, WB
83 mcr p15, 0, r2, c13, c0, 1 @ set reserved context ID
84 isb
851: mcr p15, 0, r0, c2, c0, 0 @ set TTB 0
86 isb
87 mcr p15, 0, r1, c13, c0, 1 @ set context ID
88 isb
89 mov pc, lr
90
91/*
92 * cpu_v7_set_pte_ext(ptep, pte)
93 *
94 * Set a level 2 translation table entry.
95 *
96 * - ptep - pointer to level 2 translation table entry
97 * (hardware version is stored at -1024 bytes)
98 * - pte - PTE value to store
99 * - ext - value for extended PTE bits
100 *
101 * Permissions:
102 * YUWD APX AP1 AP0 SVC User
103 * 0xxx 0 0 0 no acc no acc
104 * 100x 1 0 1 r/o no acc
105 * 10x0 1 0 1 r/o no acc
106 * 1011 0 0 1 r/w no acc
107 * 110x 0 1 0 r/w r/o
108 * 11x0 0 1 0 r/w r/o
109 * 1111 0 1 1 r/w r/w
110 */
111ENTRY(cpu_v7_set_pte_ext)
112 str r1, [r0], #-2048 @ linux version
113
114 bic r3, r1, #0x000003f0
115 bic r3, r3, #0x00000003
116 orr r3, r3, r2
117 orr r3, r3, #PTE_EXT_AP0 | 2
118
119 tst r1, #L_PTE_WRITE
120 tstne r1, #L_PTE_DIRTY
121 orreq r3, r3, #PTE_EXT_APX
122
123 tst r1, #L_PTE_USER
124 orrne r3, r3, #PTE_EXT_AP1
125 tstne r3, #PTE_EXT_APX
126 bicne r3, r3, #PTE_EXT_APX | PTE_EXT_AP0
127
128 tst r1, #L_PTE_YOUNG
129 biceq r3, r3, #PTE_EXT_APX | PTE_EXT_AP_MASK
130
131 tst r1, #L_PTE_EXEC
132 orreq r3, r3, #PTE_EXT_XN
133
134 tst r1, #L_PTE_PRESENT
135 moveq r3, #0
136
137 str r3, [r0]
138 mcr p15, 0, r0, c7, c10, 1 @ flush_pte
139 mov pc, lr
140
141cpu_v7_name:
142 .ascii "ARMv7 Processor"
143 .align
144
145 .section ".text.init", #alloc, #execinstr
146
147/*
148 * __v7_setup
149 *
150 * Initialise TLB, Caches, and MMU state ready to switch the MMU
151 * on. Return in r0 the new CP15 C1 control register setting.
152 *
153 * We automatically detect if we have a Harvard cache, and use the
154 * Harvard cache control instructions insead of the unified cache
155 * control instructions.
156 *
157 * This should be able to cover all ARMv7 cores.
158 *
159 * It is assumed that:
160 * - cache type register is implemented
161 */
162__v7_setup:
163 adr r12, __v7_setup_stack @ the local stack
164 stmia r12, {r0-r5, r7, r9, r11, lr}
165 bl v7_flush_dcache_all
166 ldmia r12, {r0-r5, r7, r9, r11, lr}
167 mov r10, #0
168#ifdef HARVARD_CACHE
169 mcr p15, 0, r10, c7, c5, 0 @ I+BTB cache invalidate
170#endif
171 dsb
172 mcr p15, 0, r10, c8, c7, 0 @ invalidate I + D TLBs
173 mcr p15, 0, r10, c2, c0, 2 @ TTB control register
174 orr r4, r4, #TTB_RGN_OC_WB @ mark PTWs outer cacheable, WB
175 mcr p15, 0, r4, c2, c0, 0 @ load TTB0
176 mcr p15, 0, r4, c2, c0, 1 @ load TTB1
177 mov r10, #0x1f @ domains 0, 1 = manager
178 mcr p15, 0, r10, c3, c0, 0 @ load domain access register
179#ifndef CONFIG_CPU_L2CACHE_DISABLE
180 @ L2 cache configuration in the L2 aux control register
181 mrc p15, 1, r10, c9, c0, 2
182 bic r10, r10, #(1 << 16) @ L2 outer cache
183 mcr p15, 1, r10, c9, c0, 2
184 @ L2 cache is enabled in the aux control register
185 mrc p15, 0, r10, c1, c0, 1
186 orr r10, r10, #2
187 mcr p15, 0, r10, c1, c0, 1
188#endif
189 mrc p15, 0, r0, c1, c0, 0 @ read control register
190 ldr r10, cr1_clear @ get mask for bits to clear
191 bic r0, r0, r10 @ clear bits them
192 ldr r10, cr1_set @ get mask for bits to set
193 orr r0, r0, r10 @ set them
194 mov pc, lr @ return to head.S:__ret
195
196 /*
197 * V X F I D LR
198 * .... ...E PUI. .T.T 4RVI ZFRS BLDP WCAM
199 * rrrr rrrx xxx0 0101 xxxx xxxx x111 xxxx < forced
200 * 0 110 0011 1.00 .111 1101 < we want
201 */
202 .type cr1_clear, #object
203 .type cr1_set, #object
204cr1_clear:
205 .word 0x0120c302
206cr1_set:
207 .word 0x00c0387d
208
209__v7_setup_stack:
210 .space 4 * 11 @ 11 registers
211
212 .type v7_processor_functions, #object
213ENTRY(v7_processor_functions)
214 .word v7_early_abort
215 .word cpu_v7_proc_init
216 .word cpu_v7_proc_fin
217 .word cpu_v7_reset
218 .word cpu_v7_do_idle
219 .word cpu_v7_dcache_clean_area
220 .word cpu_v7_switch_mm
221 .word cpu_v7_set_pte_ext
222 .size v7_processor_functions, . - v7_processor_functions
223
224 .type cpu_arch_name, #object
225cpu_arch_name:
226 .asciz "armv7"
227 .size cpu_arch_name, . - cpu_arch_name
228
229 .type cpu_elf_name, #object
230cpu_elf_name:
231 .asciz "v7"
232 .size cpu_elf_name, . - cpu_elf_name
233 .align
234
235 .section ".proc.info.init", #alloc, #execinstr
236
237 /*
238 * Match any ARMv7 processor core.
239 */
240 .type __v7_proc_info, #object
241__v7_proc_info:
242 .long 0x000f0000 @ Required ID value
243 .long 0x000f0000 @ Mask for ID
244 .long PMD_TYPE_SECT | \
245 PMD_SECT_BUFFERABLE | \
246 PMD_SECT_CACHEABLE | \
247 PMD_SECT_AP_WRITE | \
248 PMD_SECT_AP_READ
249 .long PMD_TYPE_SECT | \
250 PMD_SECT_XN | \
251 PMD_SECT_AP_WRITE | \
252 PMD_SECT_AP_READ
253 b __v7_setup
254 .long cpu_arch_name
255 .long cpu_elf_name
256 .long HWCAP_SWP|HWCAP_HALF|HWCAP_THUMB|HWCAP_FAST_MULT|HWCAP_EDSP
257 .long cpu_v7_name
258 .long v7_processor_functions
259 .long v6wbi_tlb_fns
260 .long v6_user_fns
261 .long v7_cache_fns
262 .size __v7_proc_info, . - __v7_proc_info
diff --git a/arch/arm/mm/proc-xscale.S b/arch/arm/mm/proc-xscale.S
index d29fe927ee9e..c156ddab9a2d 100644
--- a/arch/arm/mm/proc-xscale.S
+++ b/arch/arm/mm/proc-xscale.S
@@ -584,6 +584,11 @@ cpu_ixp42x_name:
584 .asciz "XScale-IXP42x Family" 584 .asciz "XScale-IXP42x Family"
585 .size cpu_ixp42x_name, . - cpu_ixp42x_name 585 .size cpu_ixp42x_name, . - cpu_ixp42x_name
586 586
587 .type cpu_ixp43x_name, #object
588cpu_ixp43x_name:
589 .asciz "XScale-IXP43x Family"
590 .size cpu_ixp43x_name, . - cpu_ixp43x_name
591
587 .type cpu_ixp46x_name, #object 592 .type cpu_ixp46x_name, #object
588cpu_ixp46x_name: 593cpu_ixp46x_name:
589 .asciz "XScale-IXP46x Family" 594 .asciz "XScale-IXP46x Family"
@@ -843,6 +848,29 @@ __ixp42x_proc_info:
843 .long xscale_cache_fns 848 .long xscale_cache_fns
844 .size __ixp42x_proc_info, . - __ixp42x_proc_info 849 .size __ixp42x_proc_info, . - __ixp42x_proc_info
845 850
851 .type __ixp43x_proc_info, #object
852__ixp43x_proc_info:
853 .long 0x69054040
854 .long 0xfffffff0
855 .long PMD_TYPE_SECT | \
856 PMD_SECT_BUFFERABLE | \
857 PMD_SECT_CACHEABLE | \
858 PMD_SECT_AP_WRITE | \
859 PMD_SECT_AP_READ
860 .long PMD_TYPE_SECT | \
861 PMD_SECT_AP_WRITE | \
862 PMD_SECT_AP_READ
863 b __xscale_setup
864 .long cpu_arch_name
865 .long cpu_elf_name
866 .long HWCAP_SWP|HWCAP_HALF|HWCAP_THUMB|HWCAP_FAST_MULT|HWCAP_EDSP
867 .long cpu_ixp43x_name
868 .long xscale_processor_functions
869 .long v4wbi_tlb_fns
870 .long xscale_mc_user_fns
871 .long xscale_cache_fns
872 .size __ixp43x_proc_info, . - __ixp43x_proc_info
873
846 .type __ixp46x_proc_info, #object 874 .type __ixp46x_proc_info, #object
847__ixp46x_proc_info: 875__ixp46x_proc_info:
848 .long 0x69054200 876 .long 0x69054200
diff --git a/arch/arm/oprofile/backtrace.c b/arch/arm/oprofile/backtrace.c
index 7c22c12618cc..f5ebf30151fa 100644
--- a/arch/arm/oprofile/backtrace.c
+++ b/arch/arm/oprofile/backtrace.c
@@ -19,6 +19,19 @@
19#include <asm/ptrace.h> 19#include <asm/ptrace.h>
20#include <asm/uaccess.h> 20#include <asm/uaccess.h>
21 21
22#include "../kernel/stacktrace.h"
23
24static int report_trace(struct stackframe *frame, void *d)
25{
26 unsigned int *depth = d;
27
28 if (*depth) {
29 oprofile_add_trace(frame->lr);
30 (*depth)--;
31 }
32
33 return *depth == 0;
34}
22 35
23/* 36/*
24 * The registers we're interested in are at the end of the variable 37 * The registers we're interested in are at the end of the variable
@@ -32,21 +45,6 @@ struct frame_tail {
32 unsigned long lr; 45 unsigned long lr;
33} __attribute__((packed)); 46} __attribute__((packed));
34 47
35
36#ifdef CONFIG_FRAME_POINTER
37static struct frame_tail* kernel_backtrace(struct frame_tail *tail)
38{
39 oprofile_add_trace(tail->lr);
40
41 /* frame pointers should strictly progress back up the stack
42 * (towards higher addresses) */
43 if (tail >= tail->fp)
44 return NULL;
45
46 return tail->fp-1;
47}
48#endif
49
50static struct frame_tail* user_backtrace(struct frame_tail *tail) 48static struct frame_tail* user_backtrace(struct frame_tail *tail)
51{ 49{
52 struct frame_tail buftail[2]; 50 struct frame_tail buftail[2];
@@ -67,47 +65,14 @@ static struct frame_tail* user_backtrace(struct frame_tail *tail)
67 return buftail[0].fp-1; 65 return buftail[0].fp-1;
68} 66}
69 67
70/*
71 * | | /\ Higher addresses
72 * | |
73 * --------------- stack base (address of current_thread_info)
74 * | thread info |
75 * . .
76 * | stack |
77 * --------------- saved regs->ARM_fp value if valid (frame_tail address)
78 * . .
79 * --------------- struct pt_regs stored on stack (struct pt_regs *)
80 * | |
81 * . .
82 * | |
83 * --------------- %esp
84 * | |
85 * | | \/ Lower addresses
86 *
87 * Thus, &pt_regs <-> stack base restricts the valid(ish) fp values
88 */
89static int valid_kernel_stack(struct frame_tail *tail, struct pt_regs *regs)
90{
91 unsigned long tailaddr = (unsigned long)tail;
92 unsigned long stack = (unsigned long)regs;
93 unsigned long stack_base = (stack & ~(THREAD_SIZE - 1)) + THREAD_SIZE;
94
95 return (tailaddr > stack) && (tailaddr < stack_base);
96}
97
98void arm_backtrace(struct pt_regs * const regs, unsigned int depth) 68void arm_backtrace(struct pt_regs * const regs, unsigned int depth)
99{ 69{
100 struct frame_tail *tail; 70 struct frame_tail *tail = ((struct frame_tail *) regs->ARM_fp) - 1;
101
102 tail = ((struct frame_tail *) regs->ARM_fp) - 1;
103 71
104 if (!user_mode(regs)) { 72 if (!user_mode(regs)) {
105 73 unsigned long base = ((unsigned long)regs) & ~(THREAD_SIZE - 1);
106#ifdef CONFIG_FRAME_POINTER 74 walk_stackframe(regs->ARM_fp, base, base + THREAD_SIZE,
107 while (depth-- && tail && valid_kernel_stack(tail, regs)) { 75 report_trace, &depth);
108 tail = kernel_backtrace(tail);
109 }
110#endif
111 return; 76 return;
112 } 77 }
113 78
diff --git a/arch/arm/plat-iop/io.c b/arch/arm/plat-iop/io.c
index f7eccecf2e47..498675d028d0 100644
--- a/arch/arm/plat-iop/io.c
+++ b/arch/arm/plat-iop/io.c
@@ -22,7 +22,7 @@
22#include <asm/io.h> 22#include <asm/io.h>
23 23
24void * __iomem __iop3xx_ioremap(unsigned long cookie, size_t size, 24void * __iomem __iop3xx_ioremap(unsigned long cookie, size_t size,
25 unsigned long flags) 25 unsigned int mtype)
26{ 26{
27 void __iomem * retval; 27 void __iomem * retval;
28 28
@@ -34,7 +34,7 @@ void * __iomem __iop3xx_ioremap(unsigned long cookie, size_t size,
34 retval = (void *) IOP3XX_PMMR_PHYS_TO_VIRT(cookie); 34 retval = (void *) IOP3XX_PMMR_PHYS_TO_VIRT(cookie);
35 break; 35 break;
36 default: 36 default:
37 retval = __ioremap(cookie, size, flags); 37 retval = __arm_ioremap(cookie, size, mtype);
38 } 38 }
39 39
40 return retval; 40 return retval;
diff --git a/arch/arm/plat-iop/pci.c b/arch/arm/plat-iop/pci.c
index b5f6ec35aafb..e2744b7227c5 100644
--- a/arch/arm/plat-iop/pci.c
+++ b/arch/arm/plat-iop/pci.c
@@ -55,7 +55,7 @@ static u32 iop3xx_cfg_address(struct pci_bus *bus, int devfn, int where)
55 * This routine checks the status of the last configuration cycle. If an error 55 * This routine checks the status of the last configuration cycle. If an error
56 * was detected it returns a 1, else it returns a 0. The errors being checked 56 * was detected it returns a 1, else it returns a 0. The errors being checked
57 * are parity, master abort, target abort (master and target). These types of 57 * are parity, master abort, target abort (master and target). These types of
58 * errors occure during a config cycle where there is no device, like during 58 * errors occur during a config cycle where there is no device, like during
59 * the discovery stage. 59 * the discovery stage.
60 */ 60 */
61static int iop3xx_pci_status(void) 61static int iop3xx_pci_status(void)
@@ -223,8 +223,111 @@ struct pci_bus *iop3xx_pci_scan_bus(int nr, struct pci_sys_data *sys)
223 return pci_scan_bus(sys->busnr, &iop3xx_ops, sys); 223 return pci_scan_bus(sys->busnr, &iop3xx_ops, sys);
224} 224}
225 225
226void __init iop3xx_atu_setup(void)
227{
228 /* BAR 0 ( Disabled ) */
229 *IOP3XX_IAUBAR0 = 0x0;
230 *IOP3XX_IABAR0 = 0x0;
231 *IOP3XX_IATVR0 = 0x0;
232 *IOP3XX_IALR0 = 0x0;
233
234 /* BAR 1 ( Disabled ) */
235 *IOP3XX_IAUBAR1 = 0x0;
236 *IOP3XX_IABAR1 = 0x0;
237 *IOP3XX_IALR1 = 0x0;
238
239 /* BAR 2 (1:1 mapping with Physical RAM) */
240 /* Set limit and enable */
241 *IOP3XX_IALR2 = ~((u32)IOP3XX_MAX_RAM_SIZE - 1) & ~0x1;
242 *IOP3XX_IAUBAR2 = 0x0;
243
244 /* Align the inbound bar with the base of memory */
245 *IOP3XX_IABAR2 = PHYS_OFFSET |
246 PCI_BASE_ADDRESS_MEM_TYPE_64 |
247 PCI_BASE_ADDRESS_MEM_PREFETCH;
248
249 *IOP3XX_IATVR2 = PHYS_OFFSET;
250
251 /* Outbound window 0 */
252 *IOP3XX_OMWTVR0 = IOP3XX_PCI_LOWER_MEM_PA;
253 *IOP3XX_OUMWTVR0 = 0;
254
255 /* Outbound window 1 */
256 *IOP3XX_OMWTVR1 = IOP3XX_PCI_LOWER_MEM_PA + IOP3XX_PCI_MEM_WINDOW_SIZE;
257 *IOP3XX_OUMWTVR1 = 0;
258
259 /* BAR 3 ( Disabled ) */
260 *IOP3XX_IAUBAR3 = 0x0;
261 *IOP3XX_IABAR3 = 0x0;
262 *IOP3XX_IATVR3 = 0x0;
263 *IOP3XX_IALR3 = 0x0;
264
265 /* Setup the I/O Bar
266 */
267 *IOP3XX_OIOWTVR = IOP3XX_PCI_LOWER_IO_PA;;
268
269 /* Enable inbound and outbound cycles
270 */
271 *IOP3XX_ATUCMD |= PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER |
272 PCI_COMMAND_PARITY | PCI_COMMAND_SERR;
273 *IOP3XX_ATUCR |= IOP3XX_ATUCR_OUT_EN;
274}
275
276void __init iop3xx_atu_disable(void)
277{
278 *IOP3XX_ATUCMD = 0;
279 *IOP3XX_ATUCR = 0;
280
281 /* wait for cycles to quiesce */
282 while (*IOP3XX_PCSR & (IOP3XX_PCSR_OUT_Q_BUSY |
283 IOP3XX_PCSR_IN_Q_BUSY))
284 cpu_relax();
285
286 /* BAR 0 ( Disabled ) */
287 *IOP3XX_IAUBAR0 = 0x0;
288 *IOP3XX_IABAR0 = 0x0;
289 *IOP3XX_IATVR0 = 0x0;
290 *IOP3XX_IALR0 = 0x0;
291
292 /* BAR 1 ( Disabled ) */
293 *IOP3XX_IAUBAR1 = 0x0;
294 *IOP3XX_IABAR1 = 0x0;
295 *IOP3XX_IALR1 = 0x0;
296
297 /* BAR 2 ( Disabled ) */
298 *IOP3XX_IAUBAR2 = 0x0;
299 *IOP3XX_IABAR2 = 0x0;
300 *IOP3XX_IATVR2 = 0x0;
301 *IOP3XX_IALR2 = 0x0;
302
303 /* BAR 3 ( Disabled ) */
304 *IOP3XX_IAUBAR3 = 0x0;
305 *IOP3XX_IABAR3 = 0x0;
306 *IOP3XX_IATVR3 = 0x0;
307 *IOP3XX_IALR3 = 0x0;
308
309 /* Clear the outbound windows */
310 *IOP3XX_OIOWTVR = 0;
311
312 /* Outbound window 0 */
313 *IOP3XX_OMWTVR0 = 0;
314 *IOP3XX_OUMWTVR0 = 0;
315
316 /* Outbound window 1 */
317 *IOP3XX_OMWTVR1 = 0;
318 *IOP3XX_OUMWTVR1 = 0;
319}
320
321/* Flag to determine whether the ATU is initialized and the PCI bus scanned */
322int init_atu;
323
226void iop3xx_pci_preinit(void) 324void iop3xx_pci_preinit(void)
227{ 325{
326 if (iop3xx_get_init_atu() == IOP3XX_INIT_ATU_ENABLE) {
327 iop3xx_atu_disable();
328 iop3xx_atu_setup();
329 }
330
228 DBG("PCI: Intel 803xx PCI init code.\n"); 331 DBG("PCI: Intel 803xx PCI init code.\n");
229 DBG("ATU: IOP3XX_ATUCMD=0x%04x\n", *IOP3XX_ATUCMD); 332 DBG("ATU: IOP3XX_ATUCMD=0x%04x\n", *IOP3XX_ATUCMD);
230 DBG("ATU: IOP3XX_OMWTVR0=0x%04x, IOP3XX_OIOWTVR=0x%04x\n", 333 DBG("ATU: IOP3XX_OMWTVR0=0x%04x, IOP3XX_OIOWTVR=0x%04x\n",
@@ -245,3 +348,38 @@ void iop3xx_pci_preinit(void)
245 348
246 hook_fault_code(16+6, iop3xx_pci_abort, SIGBUS, "imprecise external abort"); 349 hook_fault_code(16+6, iop3xx_pci_abort, SIGBUS, "imprecise external abort");
247} 350}
351
352/* allow init_atu to be user overridden */
353static int __init iop3xx_init_atu_setup(char *str)
354{
355 init_atu = IOP3XX_INIT_ATU_DEFAULT;
356 if (str) {
357 while (*str != '\0') {
358 switch (*str) {
359 case 'y':
360 case 'Y':
361 init_atu = IOP3XX_INIT_ATU_ENABLE;
362 break;
363 case 'n':
364 case 'N':
365 init_atu = IOP3XX_INIT_ATU_DISABLE;
366 break;
367 case ',':
368 case '=':
369 break;
370 default:
371 printk(KERN_DEBUG "\"%s\" malformed at "
372 "character: \'%c\'",
373 __FUNCTION__,
374 *str);
375 *(str + 1) = '\0';
376 }
377 str++;
378 }
379 }
380
381 return 1;
382}
383
384__setup("iop3xx_init_atu", iop3xx_init_atu_setup);
385
diff --git a/arch/arm/plat-iop/time.c b/arch/arm/plat-iop/time.c
index 16300adfb4de..0cc26da034a1 100644
--- a/arch/arm/plat-iop/time.c
+++ b/arch/arm/plat-iop/time.c
@@ -32,22 +32,22 @@ static unsigned long next_jiffy_time;
32 32
33unsigned long iop_gettimeoffset(void) 33unsigned long iop_gettimeoffset(void)
34{ 34{
35 unsigned long offset, temp1, temp2; 35 unsigned long offset, temp;
36 36
37 /* enable cp6, if necessary, to avoid taking the overhead of an 37 /* enable cp6, if necessary, to avoid taking the overhead of an
38 * undefined instruction trap 38 * undefined instruction trap
39 */ 39 */
40 asm volatile ( 40 asm volatile (
41 "mrc p15, 0, %0, c15, c1, 0\n\t" 41 "mrc p15, 0, %0, c15, c1, 0\n\t"
42 "ands %1, %0, #(1 << 6)\n\t" 42 "tst %0, #(1 << 6)\n\t"
43 "orreq %0, %0, #(1 << 6)\n\t" 43 "orreq %0, %0, #(1 << 6)\n\t"
44 "mcreq p15, 0, %0, c15, c1, 0\n\t" 44 "mcreq p15, 0, %0, c15, c1, 0\n\t"
45#ifdef CONFIG_XSCALE 45#ifdef CONFIG_CPU_XSCALE
46 "mrceq p15, 0, %0, c15, c1, 0\n\t" 46 "mrceq p15, 0, %0, c15, c1, 0\n\t"
47 "moveq %0, %0\n\t" 47 "moveq %0, %0\n\t"
48 "subeq pc, pc, #4\n\t" 48 "subeq pc, pc, #4\n\t"
49#endif 49#endif
50 : "=r"(temp1), "=r"(temp2) : : "cc"); 50 : "=r"(temp) : : "cc");
51 51
52 offset = next_jiffy_time - read_tcr1(); 52 offset = next_jiffy_time - read_tcr1();
53 53
diff --git a/arch/arm/plat-omap/Kconfig b/arch/arm/plat-omap/Kconfig
index a347fb5946c7..cfc69f3842fd 100644
--- a/arch/arm/plat-omap/Kconfig
+++ b/arch/arm/plat-omap/Kconfig
@@ -11,6 +11,7 @@ choice
11 11
12config ARCH_OMAP1 12config ARCH_OMAP1
13 bool "TI OMAP1" 13 bool "TI OMAP1"
14 select GENERIC_CLOCKEVENTS
14 15
15config ARCH_OMAP2 16config ARCH_OMAP2
16 bool "TI OMAP2" 17 bool "TI OMAP2"
diff --git a/arch/arm/plat-omap/common.c b/arch/arm/plat-omap/common.c
index ffb94aa164ad..dd8708ad0a71 100644
--- a/arch/arm/plat-omap/common.c
+++ b/arch/arm/plat-omap/common.c
@@ -160,3 +160,53 @@ static int __init omap_add_serial_console(void)
160 return add_preferred_console("ttyS", line, opt); 160 return add_preferred_console("ttyS", line, opt);
161} 161}
162console_initcall(omap_add_serial_console); 162console_initcall(omap_add_serial_console);
163
164
165/*
166 * 32KHz clocksource ... always available, on pretty most chips except
167 * OMAP 730 and 1510. Other timers could be used as clocksources, with
168 * higher resolution in free-running counter modes (e.g. 12 MHz xtal),
169 * but systems won't necessarily want to spend resources that way.
170 */
171
172#if defined(CONFIG_ARCH_OMAP16XX)
173#define TIMER_32K_SYNCHRONIZED 0xfffbc410
174#elif defined(CONFIG_ARCH_OMAP24XX)
175#define TIMER_32K_SYNCHRONIZED 0x48004010
176#endif
177
178#ifdef TIMER_32K_SYNCHRONIZED
179
180#include <linux/clocksource.h>
181
182static cycle_t omap_32k_read(void)
183{
184 return omap_readl(TIMER_32K_SYNCHRONIZED);
185}
186
187static struct clocksource clocksource_32k = {
188 .name = "32k_counter",
189 .rating = 250,
190 .read = omap_32k_read,
191 .mask = CLOCKSOURCE_MASK(32),
192 .shift = 10,
193 .flags = CLOCK_SOURCE_IS_CONTINUOUS,
194};
195
196static int __init omap_init_clocksource_32k(void)
197{
198 static char err[] __initdata = KERN_ERR
199 "%s: can't register clocksource!\n";
200
201 if (cpu_is_omap16xx() || cpu_is_omap24xx()) {
202 clocksource_32k.mult = clocksource_hz2mult(32768,
203 clocksource_32k.shift);
204
205 if (clocksource_register(&clocksource_32k))
206 printk(err, clocksource_32k.name);
207 }
208 return 0;
209}
210arch_initcall(omap_init_clocksource_32k);
211
212#endif /* TIMER_32K_SYNCHRONIZED */
diff --git a/arch/arm/plat-omap/timer32k.c b/arch/arm/plat-omap/timer32k.c
index 265310601161..114f87151d60 100644
--- a/arch/arm/plat-omap/timer32k.c
+++ b/arch/arm/plat-omap/timer32k.c
@@ -42,6 +42,8 @@
42#include <linux/spinlock.h> 42#include <linux/spinlock.h>
43#include <linux/err.h> 43#include <linux/err.h>
44#include <linux/clk.h> 44#include <linux/clk.h>
45#include <linux/clocksource.h>
46#include <linux/clockchips.h>
45 47
46#include <asm/system.h> 48#include <asm/system.h>
47#include <asm/hardware.h> 49#include <asm/hardware.h>
@@ -80,13 +82,13 @@ struct sys_timer omap_timer;
80#define OMAP1_32K_TIMER_TVR 0x00 82#define OMAP1_32K_TIMER_TVR 0x00
81#define OMAP1_32K_TIMER_TCR 0x04 83#define OMAP1_32K_TIMER_TCR 0x04
82 84
83#define OMAP_32K_TICKS_PER_HZ (32768 / HZ) 85#define OMAP_32K_TICKS_PER_SEC (32768)
84 86
85/* 87/*
86 * TRM says 1 / HZ = ( TVR + 1) / 32768, so TRV = (32768 / HZ) - 1 88 * TRM says 1 / HZ = ( TVR + 1) / 32768, so TRV = (32768 / HZ) - 1
87 * so with HZ = 128, TVR = 255. 89 * so with HZ = 128, TVR = 255.
88 */ 90 */
89#define OMAP_32K_TIMER_TICK_PERIOD ((32768 / HZ) - 1) 91#define OMAP_32K_TIMER_TICK_PERIOD ((OMAP_32K_TICKS_PER_SEC / HZ) - 1)
90 92
91#define JIFFIES_TO_HW_TICKS(nr_jiffies, clock_rate) \ 93#define JIFFIES_TO_HW_TICKS(nr_jiffies, clock_rate) \
92 (((nr_jiffies) * (clock_rate)) / HZ) 94 (((nr_jiffies) * (clock_rate)) / HZ)
@@ -142,6 +144,28 @@ static inline void omap_32k_timer_ack_irq(void)
142 144
143#endif 145#endif
144 146
147static void omap_32k_timer_set_mode(enum clock_event_mode mode,
148 struct clock_event_device *evt)
149{
150 switch (mode) {
151 case CLOCK_EVT_MODE_ONESHOT:
152 case CLOCK_EVT_MODE_PERIODIC:
153 omap_32k_timer_start(OMAP_32K_TIMER_TICK_PERIOD);
154 break;
155 case CLOCK_EVT_MODE_UNUSED:
156 case CLOCK_EVT_MODE_SHUTDOWN:
157 omap_32k_timer_stop();
158 break;
159 }
160}
161
162static struct clock_event_device clockevent_32k_timer = {
163 .name = "32k-timer",
164 .features = CLOCK_EVT_FEAT_PERIODIC,
165 .shift = 32,
166 .set_mode = omap_32k_timer_set_mode,
167};
168
145/* 169/*
146 * The 32KHz synchronized timer is an additional timer on 16xx. 170 * The 32KHz synchronized timer is an additional timer on 16xx.
147 * It is always running. 171 * It is always running.
@@ -171,15 +195,6 @@ omap_32k_ticks_to_nsecs(unsigned long ticks_32k)
171static unsigned long omap_32k_last_tick = 0; 195static unsigned long omap_32k_last_tick = 0;
172 196
173/* 197/*
174 * Returns elapsed usecs since last 32k timer interrupt
175 */
176static unsigned long omap_32k_timer_gettimeoffset(void)
177{
178 unsigned long now = omap_32k_sync_timer_read();
179 return omap_32k_ticks_to_usecs(now - omap_32k_last_tick);
180}
181
182/*
183 * Returns current time from boot in nsecs. It's OK for this to wrap 198 * Returns current time from boot in nsecs. It's OK for this to wrap
184 * around for now, as it's just a relative time stamp. 199 * around for now, as it's just a relative time stamp.
185 */ 200 */
@@ -188,95 +203,16 @@ unsigned long long sched_clock(void)
188 return omap_32k_ticks_to_nsecs(omap_32k_sync_timer_read()); 203 return omap_32k_ticks_to_nsecs(omap_32k_sync_timer_read());
189} 204}
190 205
191/*
192 * Timer interrupt for 32KHz timer. When dynamic tick is enabled, this
193 * function is also called from other interrupts to remove latency
194 * issues with dynamic tick. In the dynamic tick case, we need to lock
195 * with irqsave.
196 */
197static inline irqreturn_t _omap_32k_timer_interrupt(int irq, void *dev_id)
198{
199 unsigned long now;
200
201 omap_32k_timer_ack_irq();
202 now = omap_32k_sync_timer_read();
203
204 while ((signed long)(now - omap_32k_last_tick)
205 >= OMAP_32K_TICKS_PER_HZ) {
206 omap_32k_last_tick += OMAP_32K_TICKS_PER_HZ;
207 timer_tick();
208 }
209
210 /* Restart timer so we don't drift off due to modulo or dynamic tick.
211 * By default we program the next timer to be continuous to avoid
212 * latencies during high system load. During dynamic tick operation the
213 * continuous timer can be overridden from pm_idle to be longer.
214 */
215 omap_32k_timer_start(omap_32k_last_tick + OMAP_32K_TICKS_PER_HZ - now);
216
217 return IRQ_HANDLED;
218}
219
220static irqreturn_t omap_32k_timer_handler(int irq, void *dev_id)
221{
222 return _omap_32k_timer_interrupt(irq, dev_id);
223}
224
225static irqreturn_t omap_32k_timer_interrupt(int irq, void *dev_id) 206static irqreturn_t omap_32k_timer_interrupt(int irq, void *dev_id)
226{ 207{
227 unsigned long flags; 208 struct clock_event_device *evt = &clockevent_32k_timer;
209 omap_32k_timer_ack_irq();
228 210
229 write_seqlock_irqsave(&xtime_lock, flags); 211 evt->event_handler(evt);
230 _omap_32k_timer_interrupt(irq, dev_id);
231 write_sequnlock_irqrestore(&xtime_lock, flags);
232 212
233 return IRQ_HANDLED; 213 return IRQ_HANDLED;
234} 214}
235 215
236#ifdef CONFIG_NO_IDLE_HZ
237/*
238 * Programs the next timer interrupt needed. Called when dynamic tick is
239 * enabled, and to reprogram the ticks to skip from pm_idle. Note that
240 * we can keep the timer continuous, and don't need to set it to run in
241 * one-shot mode. This is because the timer will get reprogrammed again
242 * after next interrupt.
243 */
244void omap_32k_timer_reprogram(unsigned long next_tick)
245{
246 unsigned long ticks = JIFFIES_TO_HW_TICKS(next_tick, 32768) + 1;
247 unsigned long now = omap_32k_sync_timer_read();
248 unsigned long idled = now - omap_32k_last_tick;
249
250 if (idled + 1 < ticks)
251 ticks -= idled;
252 else
253 ticks = 1;
254 omap_32k_timer_start(ticks);
255}
256
257static struct irqaction omap_32k_timer_irq;
258extern struct timer_update_handler timer_update;
259
260static int omap_32k_timer_enable_dyn_tick(void)
261{
262 /* No need to reprogram timer, just use the next interrupt */
263 return 0;
264}
265
266static int omap_32k_timer_disable_dyn_tick(void)
267{
268 omap_32k_timer_start(OMAP_32K_TIMER_TICK_PERIOD);
269 return 0;
270}
271
272static struct dyn_tick_timer omap_dyn_tick_timer = {
273 .enable = omap_32k_timer_enable_dyn_tick,
274 .disable = omap_32k_timer_disable_dyn_tick,
275 .reprogram = omap_32k_timer_reprogram,
276 .handler = omap_32k_timer_handler,
277};
278#endif /* CONFIG_NO_IDLE_HZ */
279
280static struct irqaction omap_32k_timer_irq = { 216static struct irqaction omap_32k_timer_irq = {
281 .name = "32KHz timer", 217 .name = "32KHz timer",
282 .flags = IRQF_DISABLED | IRQF_TIMER, 218 .flags = IRQF_DISABLED | IRQF_TIMER,
@@ -285,13 +221,8 @@ static struct irqaction omap_32k_timer_irq = {
285 221
286static __init void omap_init_32k_timer(void) 222static __init void omap_init_32k_timer(void)
287{ 223{
288#ifdef CONFIG_NO_IDLE_HZ
289 omap_timer.dyn_tick = &omap_dyn_tick_timer;
290#endif
291
292 if (cpu_class_is_omap1()) 224 if (cpu_class_is_omap1())
293 setup_irq(INT_OS_TIMER, &omap_32k_timer_irq); 225 setup_irq(INT_OS_TIMER, &omap_32k_timer_irq);
294 omap_timer.offset = omap_32k_timer_gettimeoffset;
295 omap_32k_last_tick = omap_32k_sync_timer_read(); 226 omap_32k_last_tick = omap_32k_sync_timer_read();
296 227
297#ifdef CONFIG_ARCH_OMAP2 228#ifdef CONFIG_ARCH_OMAP2
@@ -308,7 +239,16 @@ static __init void omap_init_32k_timer(void)
308 } 239 }
309#endif 240#endif
310 241
311 omap_32k_timer_start(OMAP_32K_TIMER_TICK_PERIOD); 242 clockevent_32k_timer.mult = div_sc(OMAP_32K_TICKS_PER_SEC,
243 NSEC_PER_SEC,
244 clockevent_32k_timer.shift);
245 clockevent_32k_timer.max_delta_ns =
246 clockevent_delta2ns(0xfffffffe, &clockevent_32k_timer);
247 clockevent_32k_timer.min_delta_ns =
248 clockevent_delta2ns(1, &clockevent_32k_timer);
249
250 clockevent_32k_timer.cpumask = cpumask_of_cpu(0);
251 clockevents_register_device(&clockevent_32k_timer);
312} 252}
313 253
314/* 254/*
@@ -326,5 +266,4 @@ static void __init omap_timer_init(void)
326 266
327struct sys_timer omap_timer = { 267struct sys_timer omap_timer = {
328 .init = omap_timer_init, 268 .init = omap_timer_init,
329 .offset = NULL, /* Initialized later */
330}; 269};
diff --git a/arch/arm/plat-s3c24xx/clock.c b/arch/arm/plat-s3c24xx/clock.c
index d3dc03a7383a..79cda0faec86 100644
--- a/arch/arm/plat-s3c24xx/clock.c
+++ b/arch/arm/plat-s3c24xx/clock.c
@@ -404,6 +404,18 @@ int s3c24xx_register_clock(struct clk *clk)
404 return 0; 404 return 0;
405} 405}
406 406
407int s3c24xx_register_clocks(struct clk **clks, int nr_clks)
408{
409 int fails = 0;
410
411 for (; nr_clks > 0; nr_clks--, clks++) {
412 if (s3c24xx_register_clock(*clks) < 0)
413 fails++;
414 }
415
416 return fails;
417}
418
407/* initalise all the clocks */ 419/* initalise all the clocks */
408 420
409int __init s3c24xx_setup_clocks(unsigned long xtal, 421int __init s3c24xx_setup_clocks(unsigned long xtal,
diff --git a/arch/arm/plat-s3c24xx/cpu.c b/arch/arm/plat-s3c24xx/cpu.c
index 6a2d1070e5a0..8ce4904d3131 100644
--- a/arch/arm/plat-s3c24xx/cpu.c
+++ b/arch/arm/plat-s3c24xx/cpu.c
@@ -181,24 +181,6 @@ s3c_lookup_cpu(unsigned long idcode)
181 return NULL; 181 return NULL;
182} 182}
183 183
184/* board information */
185
186static struct s3c24xx_board *board;
187
188void s3c24xx_set_board(struct s3c24xx_board *b)
189{
190 int i;
191
192 board = b;
193
194 if (b->clocks_count != 0) {
195 struct clk **ptr = b->clocks;
196
197 for (i = b->clocks_count; i > 0; i--, ptr++)
198 s3c24xx_register_clock(*ptr);
199 }
200}
201
202/* cpu information */ 184/* cpu information */
203 185
204static struct cpu_table *cpu; 186static struct cpu_table *cpu;
@@ -342,26 +324,6 @@ static int __init s3c_arch_init(void)
342 return ret; 324 return ret;
343 325
344 ret = platform_add_devices(s3c24xx_uart_devs, nr_uarts); 326 ret = platform_add_devices(s3c24xx_uart_devs, nr_uarts);
345 if (ret != 0)
346 return ret;
347
348 if (board != NULL) {
349 struct platform_device **ptr = board->devices;
350 int i;
351
352 for (i = 0; i < board->devices_count; i++, ptr++) {
353 ret = platform_device_register(*ptr);
354
355 if (ret) {
356 printk(KERN_ERR "s3c24xx: failed to add board device %s (%d) @%p\n", (*ptr)->name, ret, *ptr);
357 }
358 }
359
360 /* mask any error, we may not need all these board
361 * devices */
362 ret = 0;
363 }
364
365 return ret; 327 return ret;
366} 328}
367 329
diff --git a/arch/arm/plat-s3c24xx/dma.c b/arch/arm/plat-s3c24xx/dma.c
index 4540a806f522..6f03c9370979 100644
--- a/arch/arm/plat-s3c24xx/dma.c
+++ b/arch/arm/plat-s3c24xx/dma.c
@@ -44,7 +44,7 @@ static struct kmem_cache *dma_kmem;
44 44
45static int dma_channels; 45static int dma_channels;
46 46
47struct s3c24xx_dma_selection dma_sel; 47static struct s3c24xx_dma_selection dma_sel;
48 48
49/* dma channel state information */ 49/* dma channel state information */
50struct s3c2410_dma_chan s3c2410_chans[S3C2410_DMA_CHANNELS]; 50struct s3c2410_dma_chan s3c2410_chans[S3C2410_DMA_CHANNELS];
@@ -880,7 +880,7 @@ static int s3c2410_dma_dostop(struct s3c2410_dma_chan *chan)
880 return 0; 880 return 0;
881} 881}
882 882
883void s3c2410_dma_waitforstop(struct s3c2410_dma_chan *chan) 883static void s3c2410_dma_waitforstop(struct s3c2410_dma_chan *chan)
884{ 884{
885 unsigned long tmp; 885 unsigned long tmp;
886 unsigned int timeout = 0x10000; 886 unsigned int timeout = 0x10000;
@@ -957,8 +957,7 @@ static int s3c2410_dma_flush(struct s3c2410_dma_chan *chan)
957 return 0; 957 return 0;
958} 958}
959 959
960int 960static int s3c2410_dma_started(struct s3c2410_dma_chan *chan)
961s3c2410_dma_started(struct s3c2410_dma_chan *chan)
962{ 961{
963 unsigned long flags; 962 unsigned long flags;
964 963
@@ -1280,7 +1279,7 @@ static void s3c2410_dma_cache_ctor(void *p, struct kmem_cache *c, unsigned long
1280 1279
1281/* initialisation code */ 1280/* initialisation code */
1282 1281
1283int __init s3c24xx_dma_sysclass_init(void) 1282static int __init s3c24xx_dma_sysclass_init(void)
1284{ 1283{
1285 int ret = sysdev_class_register(&dma_sysclass); 1284 int ret = sysdev_class_register(&dma_sysclass);
1286 1285
@@ -1292,7 +1291,7 @@ int __init s3c24xx_dma_sysclass_init(void)
1292 1291
1293core_initcall(s3c24xx_dma_sysclass_init); 1292core_initcall(s3c24xx_dma_sysclass_init);
1294 1293
1295int __init s3c24xx_dma_sysdev_register(void) 1294static int __init s3c24xx_dma_sysdev_register(void)
1296{ 1295{
1297 struct s3c2410_dma_chan *cp = s3c2410_chans; 1296 struct s3c2410_dma_chan *cp = s3c2410_chans;
1298 int channel, ret; 1297 int channel, ret;
@@ -1396,7 +1395,7 @@ static struct s3c24xx_dma_order *dma_order;
1396 * channel 1395 * channel
1397*/ 1396*/
1398 1397
1399struct s3c2410_dma_chan *s3c2410_dma_map_channel(int channel) 1398static struct s3c2410_dma_chan *s3c2410_dma_map_channel(int channel)
1400{ 1399{
1401 struct s3c24xx_dma_order_ch *ord = NULL; 1400 struct s3c24xx_dma_order_ch *ord = NULL;
1402 struct s3c24xx_dma_map *ch_map; 1401 struct s3c24xx_dma_map *ch_map;
diff --git a/arch/arm/plat-s3c24xx/pm.c b/arch/arm/plat-s3c24xx/pm.c
index ecf68d611904..c6b03f8ab260 100644
--- a/arch/arm/plat-s3c24xx/pm.c
+++ b/arch/arm/plat-s3c24xx/pm.c
@@ -511,11 +511,6 @@ static int s3c2410_pm_enter(suspend_state_t state)
511 return -EINVAL; 511 return -EINVAL;
512 } 512 }
513 513
514 if (state != PM_SUSPEND_MEM) {
515 printk(KERN_ERR PFX "error: only PM_SUSPEND_MEM supported\n");
516 return -EINVAL;
517 }
518
519 /* check if we have anything to wake-up with... bad things seem 514 /* check if we have anything to wake-up with... bad things seem
520 * to happen if you suspend with no wakeup (system will often 515 * to happen if you suspend with no wakeup (system will often
521 * require a full power-cycle) 516 * require a full power-cycle)
@@ -617,30 +612,9 @@ static int s3c2410_pm_enter(suspend_state_t state)
617 return 0; 612 return 0;
618} 613}
619 614
620/*
621 * Called after processes are frozen, but before we shut down devices.
622 */
623static int s3c2410_pm_prepare(suspend_state_t state)
624{
625 return 0;
626}
627
628/*
629 * Called after devices are re-setup, but before processes are thawed.
630 */
631static int s3c2410_pm_finish(suspend_state_t state)
632{
633 return 0;
634}
635
636/*
637 * Set to PM_DISK_FIRMWARE so we can quickly veto suspend-to-disk.
638 */
639static struct pm_ops s3c2410_pm_ops = { 615static struct pm_ops s3c2410_pm_ops = {
640 .pm_disk_mode = PM_DISK_FIRMWARE,
641 .prepare = s3c2410_pm_prepare,
642 .enter = s3c2410_pm_enter, 616 .enter = s3c2410_pm_enter,
643 .finish = s3c2410_pm_finish, 617 .valid = pm_valid_only_mem,
644}; 618};
645 619
646/* s3c2410_pm_init 620/* s3c2410_pm_init
diff --git a/arch/arm/vfp/vfpdouble.c b/arch/arm/vfp/vfpdouble.c
index e44b9ed0f81f..74e89f8fb3ab 100644
--- a/arch/arm/vfp/vfpdouble.c
+++ b/arch/arm/vfp/vfpdouble.c
@@ -34,7 +34,6 @@
34#include <linux/bitops.h> 34#include <linux/bitops.h>
35 35
36#include <asm/div64.h> 36#include <asm/div64.h>
37#include <asm/ptrace.h>
38#include <asm/vfp.h> 37#include <asm/vfp.h>
39 38
40#include "vfpinstr.h" 39#include "vfpinstr.h"
diff --git a/arch/arm/vfp/vfpsingle.c b/arch/arm/vfp/vfpsingle.c
index 0221ba3bc799..b252631b406b 100644
--- a/arch/arm/vfp/vfpsingle.c
+++ b/arch/arm/vfp/vfpsingle.c
@@ -34,7 +34,6 @@
34#include <linux/bitops.h> 34#include <linux/bitops.h>
35 35
36#include <asm/div64.h> 36#include <asm/div64.h>
37#include <asm/ptrace.h>
38#include <asm/vfp.h> 37#include <asm/vfp.h>
39 38
40#include "vfpinstr.h" 39#include "vfpinstr.h"