aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/Kconfig27
-rw-r--r--arch/arm/Makefile4
-rw-r--r--arch/arm/boot/Makefile8
-rw-r--r--arch/arm/common/scoop.c183
-rw-r--r--arch/arm/configs/am200epdkit_defconfig1149
-rw-r--r--arch/arm/configs/magician_defconfig1182
-rw-r--r--arch/arm/configs/ns9xxx_defconfig652
-rw-r--r--arch/arm/configs/orion5x_defconfig (renamed from arch/arm/configs/orion_defconfig)2
-rw-r--r--arch/arm/configs/tct_hammer_defconfig886
-rw-r--r--arch/arm/kernel/Makefile1
-rw-r--r--arch/arm/kernel/asm-offsets.c10
-rw-r--r--arch/arm/kernel/calls.S4
-rw-r--r--arch/arm/kernel/entry-armv.S111
-rw-r--r--arch/arm/kernel/entry-common.S5
-rw-r--r--arch/arm/kernel/head-common.S7
-rw-r--r--arch/arm/kernel/thumbee.c81
-rw-r--r--arch/arm/mach-clps711x/Kconfig2
-rw-r--r--arch/arm/mach-ep93xx/Makefile2
-rw-r--r--arch/arm/mach-ep93xx/core.c109
-rw-r--r--arch/arm/mach-ep93xx/gpio.c158
-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.c2
-rw-r--r--arch/arm/mach-iop33x/Kconfig8
-rw-r--r--arch/arm/mach-iop33x/iq80331.c2
-rw-r--r--arch/arm/mach-iop33x/iq80332.c2
-rw-r--r--arch/arm/mach-ks8695/Makefile3
-rw-r--r--arch/arm/mach-ks8695/devices.c21
-rw-r--r--arch/arm/mach-ks8695/leds.c94
-rw-r--r--arch/arm/mach-ns9xxx/Kconfig30
-rw-r--r--arch/arm/mach-ns9xxx/Makefile7
-rw-r--r--arch/arm/mach-ns9xxx/Makefile.boot2
-rw-r--r--arch/arm/mach-ns9xxx/board-a9m9750dev.c69
-rw-r--r--arch/arm/mach-ns9xxx/clock.c215
-rw-r--r--arch/arm/mach-ns9xxx/clock.h35
-rw-r--r--arch/arm/mach-ns9xxx/generic.c27
-rw-r--r--arch/arm/mach-ns9xxx/generic.h5
-rw-r--r--arch/arm/mach-ns9xxx/gpio-ns9360.c118
-rw-r--r--arch/arm/mach-ns9xxx/gpio-ns9360.h13
-rw-r--r--arch/arm/mach-ns9xxx/gpio.c141
-rw-r--r--arch/arm/mach-ns9xxx/irq.c74
-rw-r--r--arch/arm/mach-ns9xxx/mach-cc9p9360dev.c8
-rw-r--r--arch/arm/mach-ns9xxx/mach-cc9p9360js.c8
-rw-r--r--arch/arm/mach-ns9xxx/plat-serial8250.c69
-rw-r--r--arch/arm/mach-ns9xxx/processor-ns9360.c54
-rw-r--r--arch/arm/mach-ns9xxx/time-ns9360.c (renamed from arch/arm/mach-ns9xxx/time.c)75
-rw-r--r--arch/arm/mach-orion/addr-map.c490
-rw-r--r--arch/arm/mach-orion/common.h92
-rw-r--r--arch/arm/mach-orion/pci.c557
-rw-r--r--arch/arm/mach-orion/time.c181
-rw-r--r--arch/arm/mach-orion5x/Kconfig (renamed from arch/arm/mach-orion/Kconfig)10
-rw-r--r--arch/arm/mach-orion5x/Makefile (renamed from arch/arm/mach-orion/Makefile)3
-rw-r--r--arch/arm/mach-orion5x/Makefile.boot (renamed from arch/arm/mach-orion/Makefile.boot)0
-rw-r--r--arch/arm/mach-orion5x/addr-map.c240
-rw-r--r--arch/arm/mach-orion5x/common.c (renamed from arch/arm/mach-orion/common.c)220
-rw-r--r--arch/arm/mach-orion5x/common.h72
-rw-r--r--arch/arm/mach-orion5x/db88f5281-setup.c (renamed from arch/arm/mach-orion/db88f5281-setup.c)55
-rw-r--r--arch/arm/mach-orion5x/dns323-setup.c (renamed from arch/arm/mach-orion/dns323-setup.c)45
-rw-r--r--arch/arm/mach-orion5x/gpio.c (renamed from arch/arm/mach-orion/gpio.c)77
-rw-r--r--arch/arm/mach-orion5x/irq.c (renamed from arch/arm/mach-orion/irq.c)132
-rw-r--r--arch/arm/mach-orion5x/kurobox_pro-setup.c (renamed from arch/arm/mach-orion/kurobox_pro-setup.c)80
-rw-r--r--arch/arm/mach-orion5x/pci.c559
-rw-r--r--arch/arm/mach-orion5x/rd88f5182-setup.c (renamed from arch/arm/mach-orion/rd88f5182-setup.c)53
-rw-r--r--arch/arm/mach-orion5x/ts209-setup.c (renamed from arch/arm/mach-orion/ts209-setup.c)145
-rw-r--r--arch/arm/mach-pxa/Kconfig20
-rw-r--r--arch/arm/mach-pxa/Makefile7
-rw-r--r--arch/arm/mach-pxa/clock.c1
-rw-r--r--arch/arm/mach-pxa/cm-x270-pci.c1
-rw-r--r--arch/arm/mach-pxa/cm-x270.c1
-rw-r--r--arch/arm/mach-pxa/colibri.c1
-rw-r--r--arch/arm/mach-pxa/corgi.c1
-rw-r--r--arch/arm/mach-pxa/corgi_pm.c1
-rw-r--r--arch/arm/mach-pxa/corgi_ssp.c1
-rw-r--r--arch/arm/mach-pxa/devices.c58
-rw-r--r--arch/arm/mach-pxa/devices.h1
-rw-r--r--arch/arm/mach-pxa/em-x270.c1
-rw-r--r--arch/arm/mach-pxa/generic.c62
-rw-r--r--arch/arm/mach-pxa/generic.h12
-rw-r--r--arch/arm/mach-pxa/gpio.c325
-rw-r--r--arch/arm/mach-pxa/gumstix.c147
-rw-r--r--arch/arm/mach-pxa/idp.c1
-rw-r--r--arch/arm/mach-pxa/irq.c336
-rw-r--r--arch/arm/mach-pxa/leds-trizeps4.c1
-rw-r--r--arch/arm/mach-pxa/littleton.c67
-rw-r--r--arch/arm/mach-pxa/lpd270.c1
-rw-r--r--arch/arm/mach-pxa/lubbock.c121
-rw-r--r--arch/arm/mach-pxa/magician.c486
-rw-r--r--arch/arm/mach-pxa/mainstone.c219
-rw-r--r--arch/arm/mach-pxa/mfp-pxa2xx.c245
-rw-r--r--arch/arm/mach-pxa/mfp-pxa3xx.c (renamed from arch/arm/mach-pxa/mfp.c)20
-rw-r--r--arch/arm/mach-pxa/pcm027.c1
-rw-r--r--arch/arm/mach-pxa/pcm990-baseboard.c87
-rw-r--r--arch/arm/mach-pxa/poodle.c1
-rw-r--r--arch/arm/mach-pxa/pxa25x.c32
-rw-r--r--arch/arm/mach-pxa/pxa27x.c48
-rw-r--r--arch/arm/mach-pxa/pxa3xx.c77
-rw-r--r--arch/arm/mach-pxa/sharpsl_pm.c1
-rw-r--r--arch/arm/mach-pxa/spitz.c1
-rw-r--r--arch/arm/mach-pxa/spitz_pm.c1
-rw-r--r--arch/arm/mach-pxa/tosa.c297
-rw-r--r--arch/arm/mach-pxa/trizeps4.c1
-rw-r--r--arch/arm/mach-pxa/zylonite.c69
-rw-r--r--arch/arm/mach-pxa/zylonite_pxa300.c8
-rw-r--r--arch/arm/mach-pxa/zylonite_pxa320.c8
-rw-r--r--arch/arm/mach-realview/Kconfig15
-rw-r--r--arch/arm/mach-realview/Makefile2
-rw-r--r--arch/arm/mach-realview/core.c53
-rw-r--r--arch/arm/mach-realview/core.h5
-rw-r--r--arch/arm/mach-realview/platsmp.c56
-rw-r--r--arch/arm/mach-realview/realview_eb.c149
-rw-r--r--arch/arm/mach-realview/realview_pb1176.c292
-rw-r--r--arch/arm/mach-realview/realview_pb11mp.c342
-rw-r--r--arch/arm/mach-s3c2410/Kconfig7
-rw-r--r--arch/arm/mach-s3c2410/Makefile1
-rw-r--r--arch/arm/mach-s3c2410/mach-bast.c38
-rw-r--r--arch/arm/mach-s3c2410/mach-tct_hammer.c160
-rw-r--r--arch/arm/mach-s3c2410/mach-vr1000.c2
-rw-r--r--arch/arm/mach-s3c2412/s3c2412.c2
-rw-r--r--arch/arm/mach-s3c2440/mach-anubis.c4
-rw-r--r--arch/arm/mach-s3c2440/mach-osiris.c5
-rw-r--r--arch/arm/mach-sa1100/Makefile2
-rw-r--r--arch/arm/mach-sa1100/generic.c31
-rw-r--r--arch/arm/mach-sa1100/generic.h1
-rw-r--r--arch/arm/mach-sa1100/gpio.c65
-rw-r--r--arch/arm/mach-sa1100/irq.c2
-rw-r--r--arch/arm/mach-sa1100/time.c159
-rw-r--r--arch/arm/mm/Kconfig42
-rw-r--r--arch/arm/mm/init.c2
-rw-r--r--arch/arm/mm/proc-arm1020.S1
-rw-r--r--arch/arm/mm/proc-arm1020e.S1
-rw-r--r--arch/arm/mm/proc-arm1022.S1
-rw-r--r--arch/arm/mm/proc-arm1026.S1
-rw-r--r--arch/arm/mm/proc-arm6_7.S2
-rw-r--r--arch/arm/mm/proc-arm720.S1
-rw-r--r--arch/arm/mm/proc-arm920.S1
-rw-r--r--arch/arm/mm/proc-arm922.S1
-rw-r--r--arch/arm/mm/proc-arm925.S1
-rw-r--r--arch/arm/mm/proc-arm926.S1
-rw-r--r--arch/arm/mm/proc-feroceon.S1
-rw-r--r--arch/arm/mm/proc-sa110.S1
-rw-r--r--arch/arm/mm/proc-sa1100.S1
-rw-r--r--arch/arm/mm/proc-v6.S15
-rw-r--r--arch/arm/mm/proc-v7.S1
-rw-r--r--arch/arm/mm/proc-xscale.S1
-rw-r--r--arch/arm/plat-iop/pci.c79
-rw-r--r--arch/arm/plat-mxc/Kconfig2
-rw-r--r--arch/arm/plat-mxc/Makefile4
-rw-r--r--arch/arm/plat-mxc/irq.c14
-rw-r--r--arch/arm/plat-orion/Makefile8
-rw-r--r--arch/arm/plat-orion/irq.c64
-rw-r--r--arch/arm/plat-orion/pcie.c245
-rw-r--r--arch/arm/plat-orion/time.c203
-rw-r--r--arch/arm/plat-s3c24xx/clock.c56
-rw-r--r--arch/arm/plat-s3c24xx/cpu.c27
-rw-r--r--arch/arm/tools/mach-types117
155 files changed, 9990 insertions, 3761 deletions
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 4039a133006e..ac1bef1797e6 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -255,6 +255,7 @@ config ARCH_EP93XX
255 select ARM_AMBA 255 select ARM_AMBA
256 select ARM_VIC 256 select ARM_VIC
257 select GENERIC_GPIO 257 select GENERIC_GPIO
258 select HAVE_GPIO_LIB
258 help 259 help
259 This enables support for the Cirrus EP93xx series of CPUs. 260 This enables support for the Cirrus EP93xx series of CPUs.
260 261
@@ -377,15 +378,17 @@ config ARCH_MXC
377 help 378 help
378 Support for Freescale MXC/iMX-based family of processors 379 Support for Freescale MXC/iMX-based family of processors
379 380
380config ARCH_ORION 381config ARCH_ORION5X
381 bool "Marvell Orion" 382 bool "Marvell Orion"
382 depends on MMU 383 depends on MMU
383 select PCI 384 select PCI
384 select GENERIC_GPIO 385 select GENERIC_GPIO
385 select GENERIC_TIME 386 select GENERIC_TIME
386 select GENERIC_CLOCKEVENTS 387 select GENERIC_CLOCKEVENTS
388 select PLAT_ORION
387 help 389 help
388 Support for Marvell Orion System on Chip family. 390 Support for the following Marvell Orion 5x series SoCs:
391 Orion-1 (5181), Orion-NAS (5182), Orion-2 (5281.)
389 392
390config ARCH_PNX4008 393config ARCH_PNX4008
391 bool "Philips Nexperia PNX4008 Mobile" 394 bool "Philips Nexperia PNX4008 Mobile"
@@ -422,10 +425,15 @@ config ARCH_SA1100
422 bool "SA1100-based" 425 bool "SA1100-based"
423 select ISA 426 select ISA
424 select ARCH_DISCONTIGMEM_ENABLE 427 select ARCH_DISCONTIGMEM_ENABLE
428 select ARCH_SPARSEMEM_ENABLE
429 select ARCH_SELECT_MEMORY_MODEL
425 select ARCH_MTD_XIP 430 select ARCH_MTD_XIP
426 select GENERIC_GPIO 431 select GENERIC_GPIO
427 select GENERIC_TIME 432 select GENERIC_TIME
433 select GENERIC_CLOCKEVENTS
434 select TICK_ONESHOT
428 select HAVE_IDE 435 select HAVE_IDE
436 select HAVE_GPIO_LIB
429 help 437 help
430 Support for StrongARM 11x0 based boards. 438 Support for StrongARM 11x0 based boards.
431 439
@@ -516,7 +524,7 @@ source "arch/arm/mach-omap1/Kconfig"
516 524
517source "arch/arm/mach-omap2/Kconfig" 525source "arch/arm/mach-omap2/Kconfig"
518 526
519source "arch/arm/mach-orion/Kconfig" 527source "arch/arm/mach-orion5x/Kconfig"
520 528
521source "arch/arm/plat-s3c24xx/Kconfig" 529source "arch/arm/plat-s3c24xx/Kconfig"
522source "arch/arm/plat-s3c/Kconfig" 530source "arch/arm/plat-s3c/Kconfig"
@@ -563,6 +571,9 @@ config ARCH_ACORN
563config PLAT_IOP 571config PLAT_IOP
564 bool 572 bool
565 573
574config PLAT_ORION
575 bool
576
566source arch/arm/mm/Kconfig 577source arch/arm/mm/Kconfig
567 578
568config IWMMXT 579config IWMMXT
@@ -650,7 +661,7 @@ source "kernel/time/Kconfig"
650 661
651config SMP 662config SMP
652 bool "Symmetric Multi-Processing (EXPERIMENTAL)" 663 bool "Symmetric Multi-Processing (EXPERIMENTAL)"
653 depends on EXPERIMENTAL && REALVIEW_EB_ARM11MP 664 depends on EXPERIMENTAL && (REALVIEW_EB_ARM11MP || MACH_REALVIEW_PB11MP)
654 help 665 help
655 This enables support for systems with more than one CPU. If you have 666 This enables support for systems with more than one CPU. If you have
656 a system with only one CPU, like most personal computers, say N. If 667 a system with only one CPU, like most personal computers, say N. If
@@ -683,7 +694,7 @@ config HOTPLUG_CPU
683 694
684config LOCAL_TIMERS 695config LOCAL_TIMERS
685 bool "Use local timer interrupts" 696 bool "Use local timer interrupts"
686 depends on SMP && REALVIEW_EB_ARM11MP 697 depends on SMP && (REALVIEW_EB_ARM11MP || MACH_REALVIEW_PB11MP)
687 default y 698 default y
688 help 699 help
689 Enable support for local timers on SMP platforms, rather then the 700 Enable support for local timers on SMP platforms, rather then the
@@ -774,6 +785,12 @@ config ARCH_DISCONTIGMEM_ENABLE
774 or have huge holes in the physical address space for other reasons. 785 or have huge holes in the physical address space for other reasons.
775 See <file:Documentation/vm/numa> for more. 786 See <file:Documentation/vm/numa> for more.
776 787
788config ARCH_SPARSEMEM_ENABLE
789 bool
790
791config ARCH_SELECT_MEMORY_MODEL
792 bool
793
777config NODES_SHIFT 794config NODES_SHIFT
778 int 795 int
779 default "4" if ARCH_LH7A40X 796 default "4" if ARCH_LH7A40X
diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index 1a4649667ec8..e72db27e0ba0 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -134,12 +134,11 @@ endif
134 machine-$(CONFIG_ARCH_PNX4008) := pnx4008 134 machine-$(CONFIG_ARCH_PNX4008) := pnx4008
135 machine-$(CONFIG_ARCH_NETX) := netx 135 machine-$(CONFIG_ARCH_NETX) := netx
136 machine-$(CONFIG_ARCH_NS9XXX) := ns9xxx 136 machine-$(CONFIG_ARCH_NS9XXX) := ns9xxx
137 textofs-$(CONFIG_ARCH_NS9XXX) := 0x00108000
138 machine-$(CONFIG_ARCH_DAVINCI) := davinci 137 machine-$(CONFIG_ARCH_DAVINCI) := davinci
139 machine-$(CONFIG_ARCH_KS8695) := ks8695 138 machine-$(CONFIG_ARCH_KS8695) := ks8695
140 incdir-$(CONFIG_ARCH_MXC) := mxc 139 incdir-$(CONFIG_ARCH_MXC) := mxc
141 machine-$(CONFIG_ARCH_MX3) := mx3 140 machine-$(CONFIG_ARCH_MX3) := mx3
142 machine-$(CONFIG_ARCH_ORION) := orion 141 machine-$(CONFIG_ARCH_ORION5X) := orion5x
143 machine-$(CONFIG_ARCH_MSM7X00A) := msm 142 machine-$(CONFIG_ARCH_MSM7X00A) := msm
144 143
145ifeq ($(CONFIG_ARCH_EBSA110),y) 144ifeq ($(CONFIG_ARCH_EBSA110),y)
@@ -185,6 +184,7 @@ core-$(CONFIG_VFP) += arch/arm/vfp/
185 184
186# If we have a common platform directory, then include it in the build. 185# If we have a common platform directory, then include it in the build.
187core-$(CONFIG_PLAT_IOP) += arch/arm/plat-iop/ 186core-$(CONFIG_PLAT_IOP) += arch/arm/plat-iop/
187core-$(CONFIG_PLAT_ORION) += arch/arm/plat-orion/
188core-$(CONFIG_ARCH_OMAP) += arch/arm/plat-omap/ 188core-$(CONFIG_ARCH_OMAP) += arch/arm/plat-omap/
189core-$(CONFIG_PLAT_S3C24XX) += arch/arm/plat-s3c24xx/ 189core-$(CONFIG_PLAT_S3C24XX) += arch/arm/plat-s3c24xx/
190core-$(CONFIG_ARCH_MXC) += arch/arm/plat-mxc/ 190core-$(CONFIG_ARCH_MXC) += arch/arm/plat-mxc/
diff --git a/arch/arm/boot/Makefile b/arch/arm/boot/Makefile
index 25f12303b106..da226abce2d0 100644
--- a/arch/arm/boot/Makefile
+++ b/arch/arm/boot/Makefile
@@ -61,9 +61,15 @@ endif
61 61
62quiet_cmd_uimage = UIMAGE $@ 62quiet_cmd_uimage = UIMAGE $@
63 cmd_uimage = $(CONFIG_SHELL) $(MKIMAGE) -A arm -O linux -T kernel \ 63 cmd_uimage = $(CONFIG_SHELL) $(MKIMAGE) -A arm -O linux -T kernel \
64 -C none -a $(ZRELADDR) -e $(ZRELADDR) \ 64 -C none -a $(LOADADDR) -e $(LOADADDR) \
65 -n 'Linux-$(KERNELRELEASE)' -d $< $@ 65 -n 'Linux-$(KERNELRELEASE)' -d $< $@
66 66
67ifeq ($(CONFIG_ZBOOT_ROM),y)
68$(obj)/uImage: LOADADDR=$(CONFIG_ZBOOT_ROM_TEXT)
69else
70$(obj)/uImage: LOADADDR=$(ZRELADDR)
71endif
72
67$(obj)/uImage: $(obj)/zImage FORCE 73$(obj)/uImage: $(obj)/zImage FORCE
68 $(call if_changed,uimage) 74 $(call if_changed,uimage)
69 @echo ' Image $@ is ready' 75 @echo ' Image $@ is ready'
diff --git a/arch/arm/common/scoop.c b/arch/arm/common/scoop.c
index 314ebd3a1d71..bc299b07a6fa 100644
--- a/arch/arm/common/scoop.c
+++ b/arch/arm/common/scoop.c
@@ -16,6 +16,7 @@
16#include <linux/slab.h> 16#include <linux/slab.h>
17#include <linux/platform_device.h> 17#include <linux/platform_device.h>
18#include <asm/io.h> 18#include <asm/io.h>
19#include <asm/gpio.h>
19#include <asm/hardware/scoop.h> 20#include <asm/hardware/scoop.h>
20 21
21/* PCMCIA to Scoop linkage 22/* PCMCIA to Scoop linkage
@@ -30,10 +31,9 @@
30struct scoop_pcmcia_config *platform_scoop_config; 31struct scoop_pcmcia_config *platform_scoop_config;
31EXPORT_SYMBOL(platform_scoop_config); 32EXPORT_SYMBOL(platform_scoop_config);
32 33
33#define SCOOP_REG(d,adr) (*(volatile unsigned short*)(d +(adr)))
34
35struct scoop_dev { 34struct scoop_dev {
36 void *base; 35 void __iomem *base;
36 struct gpio_chip gpio;
37 spinlock_t scoop_lock; 37 spinlock_t scoop_lock;
38 unsigned short suspend_clr; 38 unsigned short suspend_clr;
39 unsigned short suspend_set; 39 unsigned short suspend_set;
@@ -44,13 +44,84 @@ void reset_scoop(struct device *dev)
44{ 44{
45 struct scoop_dev *sdev = dev_get_drvdata(dev); 45 struct scoop_dev *sdev = dev_get_drvdata(dev);
46 46
47 SCOOP_REG(sdev->base,SCOOP_MCR) = 0x0100; // 00 47 iowrite16(0x0100, sdev->base + SCOOP_MCR); // 00
48 SCOOP_REG(sdev->base,SCOOP_CDR) = 0x0000; // 04 48 iowrite16(0x0000, sdev->base + SCOOP_CDR); // 04
49 SCOOP_REG(sdev->base,SCOOP_CCR) = 0x0000; // 10 49 iowrite16(0x0000, sdev->base + SCOOP_CCR); // 10
50 SCOOP_REG(sdev->base,SCOOP_IMR) = 0x0000; // 18 50 iowrite16(0x0000, sdev->base + SCOOP_IMR); // 18
51 SCOOP_REG(sdev->base,SCOOP_IRM) = 0x00FF; // 14 51 iowrite16(0x00FF, sdev->base + SCOOP_IRM); // 14
52 SCOOP_REG(sdev->base,SCOOP_ISR) = 0x0000; // 1C 52 iowrite16(0x0000, sdev->base + SCOOP_ISR); // 1C
53 SCOOP_REG(sdev->base,SCOOP_IRM) = 0x0000; 53 iowrite16(0x0000, sdev->base + SCOOP_IRM);
54}
55
56static void __scoop_gpio_set(struct scoop_dev *sdev,
57 unsigned offset, int value)
58{
59 unsigned short gpwr;
60
61 gpwr = ioread16(sdev->base + SCOOP_GPWR);
62 if (value)
63 gpwr |= 1 << (offset + 1);
64 else
65 gpwr &= ~(1 << (offset + 1));
66 iowrite16(gpwr, sdev->base + SCOOP_GPWR);
67}
68
69static void scoop_gpio_set(struct gpio_chip *chip, unsigned offset, int value)
70{
71 struct scoop_dev *sdev = container_of(chip, struct scoop_dev, gpio);
72 unsigned long flags;
73
74 spin_lock_irqsave(&sdev->scoop_lock, flags);
75
76 __scoop_gpio_set(sdev, offset, value);
77
78 spin_unlock_irqrestore(&sdev->scoop_lock, flags);
79}
80
81static int scoop_gpio_get(struct gpio_chip *chip, unsigned offset)
82{
83 struct scoop_dev *sdev = container_of(chip, struct scoop_dev, gpio);
84
85 /* XXX: I'm usure, but it seems so */
86 return ioread16(sdev->base + SCOOP_GPRR) & (1 << (offset + 1));
87}
88
89static int scoop_gpio_direction_input(struct gpio_chip *chip,
90 unsigned offset)
91{
92 struct scoop_dev *sdev = container_of(chip, struct scoop_dev, gpio);
93 unsigned long flags;
94 unsigned short gpcr;
95
96 spin_lock_irqsave(&sdev->scoop_lock, flags);
97
98 gpcr = ioread16(sdev->base + SCOOP_GPCR);
99 gpcr &= ~(1 << (offset + 1));
100 iowrite16(gpcr, sdev->base + SCOOP_GPCR);
101
102 spin_unlock_irqrestore(&sdev->scoop_lock, flags);
103
104 return 0;
105}
106
107static int scoop_gpio_direction_output(struct gpio_chip *chip,
108 unsigned offset, int value)
109{
110 struct scoop_dev *sdev = container_of(chip, struct scoop_dev, gpio);
111 unsigned long flags;
112 unsigned short gpcr;
113
114 spin_lock_irqsave(&sdev->scoop_lock, flags);
115
116 __scoop_gpio_set(sdev, offset, value);
117
118 gpcr = ioread16(sdev->base + SCOOP_GPCR);
119 gpcr |= 1 << (offset + 1);
120 iowrite16(gpcr, sdev->base + SCOOP_GPCR);
121
122 spin_unlock_irqrestore(&sdev->scoop_lock, flags);
123
124 return 0;
54} 125}
55 126
56unsigned short set_scoop_gpio(struct device *dev, unsigned short bit) 127unsigned short set_scoop_gpio(struct device *dev, unsigned short bit)
@@ -60,8 +131,8 @@ unsigned short set_scoop_gpio(struct device *dev, unsigned short bit)
60 struct scoop_dev *sdev = dev_get_drvdata(dev); 131 struct scoop_dev *sdev = dev_get_drvdata(dev);
61 132
62 spin_lock_irqsave(&sdev->scoop_lock, flag); 133 spin_lock_irqsave(&sdev->scoop_lock, flag);
63 gpio_bit = SCOOP_REG(sdev->base, SCOOP_GPWR) | bit; 134 gpio_bit = ioread16(sdev->base + SCOOP_GPWR) | bit;
64 SCOOP_REG(sdev->base, SCOOP_GPWR) = gpio_bit; 135 iowrite16(gpio_bit, sdev->base + SCOOP_GPWR);
65 spin_unlock_irqrestore(&sdev->scoop_lock, flag); 136 spin_unlock_irqrestore(&sdev->scoop_lock, flag);
66 137
67 return gpio_bit; 138 return gpio_bit;
@@ -74,8 +145,8 @@ unsigned short reset_scoop_gpio(struct device *dev, unsigned short bit)
74 struct scoop_dev *sdev = dev_get_drvdata(dev); 145 struct scoop_dev *sdev = dev_get_drvdata(dev);
75 146
76 spin_lock_irqsave(&sdev->scoop_lock, flag); 147 spin_lock_irqsave(&sdev->scoop_lock, flag);
77 gpio_bit = SCOOP_REG(sdev->base, SCOOP_GPWR) & ~bit; 148 gpio_bit = ioread16(sdev->base + SCOOP_GPWR) & ~bit;
78 SCOOP_REG(sdev->base,SCOOP_GPWR) = gpio_bit; 149 iowrite16(gpio_bit, sdev->base + SCOOP_GPWR);
79 spin_unlock_irqrestore(&sdev->scoop_lock, flag); 150 spin_unlock_irqrestore(&sdev->scoop_lock, flag);
80 151
81 return gpio_bit; 152 return gpio_bit;
@@ -87,13 +158,13 @@ EXPORT_SYMBOL(reset_scoop_gpio);
87unsigned short read_scoop_reg(struct device *dev, unsigned short reg) 158unsigned short read_scoop_reg(struct device *dev, unsigned short reg)
88{ 159{
89 struct scoop_dev *sdev = dev_get_drvdata(dev); 160 struct scoop_dev *sdev = dev_get_drvdata(dev);
90 return SCOOP_REG(sdev->base,reg); 161 return ioread16(sdev->base + reg);
91} 162}
92 163
93void write_scoop_reg(struct device *dev, unsigned short reg, unsigned short data) 164void write_scoop_reg(struct device *dev, unsigned short reg, unsigned short data)
94{ 165{
95 struct scoop_dev *sdev = dev_get_drvdata(dev); 166 struct scoop_dev *sdev = dev_get_drvdata(dev);
96 SCOOP_REG(sdev->base,reg)=data; 167 iowrite16(data, sdev->base + reg);
97} 168}
98 169
99EXPORT_SYMBOL(reset_scoop); 170EXPORT_SYMBOL(reset_scoop);
@@ -104,9 +175,9 @@ static void check_scoop_reg(struct scoop_dev *sdev)
104{ 175{
105 unsigned short mcr; 176 unsigned short mcr;
106 177
107 mcr = SCOOP_REG(sdev->base, SCOOP_MCR); 178 mcr = ioread16(sdev->base + SCOOP_MCR);
108 if ((mcr & 0x100) == 0) 179 if ((mcr & 0x100) == 0)
109 SCOOP_REG(sdev->base, SCOOP_MCR) = 0x0101; 180 iowrite16(0x0101, sdev->base + SCOOP_MCR);
110} 181}
111 182
112#ifdef CONFIG_PM 183#ifdef CONFIG_PM
@@ -115,8 +186,8 @@ static int scoop_suspend(struct platform_device *dev, pm_message_t state)
115 struct scoop_dev *sdev = platform_get_drvdata(dev); 186 struct scoop_dev *sdev = platform_get_drvdata(dev);
116 187
117 check_scoop_reg(sdev); 188 check_scoop_reg(sdev);
118 sdev->scoop_gpwr = SCOOP_REG(sdev->base, SCOOP_GPWR); 189 sdev->scoop_gpwr = ioread16(sdev->base + SCOOP_GPWR);
119 SCOOP_REG(sdev->base, SCOOP_GPWR) = (sdev->scoop_gpwr & ~sdev->suspend_clr) | sdev->suspend_set; 190 iowrite16((sdev->scoop_gpwr & ~sdev->suspend_clr) | sdev->suspend_set, sdev->base + SCOOP_GPWR);
120 191
121 return 0; 192 return 0;
122} 193}
@@ -126,7 +197,7 @@ static int scoop_resume(struct platform_device *dev)
126 struct scoop_dev *sdev = platform_get_drvdata(dev); 197 struct scoop_dev *sdev = platform_get_drvdata(dev);
127 198
128 check_scoop_reg(sdev); 199 check_scoop_reg(sdev);
129 SCOOP_REG(sdev->base,SCOOP_GPWR) = sdev->scoop_gpwr; 200 iowrite16(sdev->scoop_gpwr, sdev->base + SCOOP_GPWR);
130 201
131 return 0; 202 return 0;
132} 203}
@@ -135,11 +206,13 @@ static int scoop_resume(struct platform_device *dev)
135#define scoop_resume NULL 206#define scoop_resume NULL
136#endif 207#endif
137 208
138int __init scoop_probe(struct platform_device *pdev) 209static int __devinit scoop_probe(struct platform_device *pdev)
139{ 210{
140 struct scoop_dev *devptr; 211 struct scoop_dev *devptr;
141 struct scoop_config *inf; 212 struct scoop_config *inf;
142 struct resource *mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); 213 struct resource *mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
214 int ret;
215 int temp;
143 216
144 if (!mem) 217 if (!mem)
145 return -EINVAL; 218 return -EINVAL;
@@ -154,40 +227,78 @@ int __init scoop_probe(struct platform_device *pdev)
154 devptr->base = ioremap(mem->start, mem->end - mem->start + 1); 227 devptr->base = ioremap(mem->start, mem->end - mem->start + 1);
155 228
156 if (!devptr->base) { 229 if (!devptr->base) {
157 kfree(devptr); 230 ret = -ENOMEM;
158 return -ENOMEM; 231 goto err_ioremap;
159 } 232 }
160 233
161 platform_set_drvdata(pdev, devptr); 234 platform_set_drvdata(pdev, devptr);
162 235
163 printk("Sharp Scoop Device found at 0x%08x -> 0x%08x\n",(unsigned int)mem->start,(unsigned int)devptr->base); 236 printk("Sharp Scoop Device found at 0x%08x -> 0x%8p\n",(unsigned int)mem->start, devptr->base);
164 237
165 SCOOP_REG(devptr->base, SCOOP_MCR) = 0x0140; 238 iowrite16(0x0140, devptr->base + SCOOP_MCR);
166 reset_scoop(&pdev->dev); 239 reset_scoop(&pdev->dev);
167 SCOOP_REG(devptr->base, SCOOP_CPR) = 0x0000; 240 iowrite16(0x0000, devptr->base + SCOOP_CPR);
168 SCOOP_REG(devptr->base, SCOOP_GPCR) = inf->io_dir & 0xffff; 241 iowrite16(inf->io_dir & 0xffff, devptr->base + SCOOP_GPCR);
169 SCOOP_REG(devptr->base, SCOOP_GPWR) = inf->io_out & 0xffff; 242 iowrite16(inf->io_out & 0xffff, devptr->base + SCOOP_GPWR);
170 243
171 devptr->suspend_clr = inf->suspend_clr; 244 devptr->suspend_clr = inf->suspend_clr;
172 devptr->suspend_set = inf->suspend_set; 245 devptr->suspend_set = inf->suspend_set;
173 246
247 devptr->gpio.base = -1;
248
249 if (inf->gpio_base != 0) {
250 devptr->gpio.label = pdev->dev.bus_id;
251 devptr->gpio.base = inf->gpio_base;
252 devptr->gpio.ngpio = 12; /* PA11 = 0, PA12 = 1, etc. up to PA22 = 11 */
253 devptr->gpio.set = scoop_gpio_set;
254 devptr->gpio.get = scoop_gpio_get;
255 devptr->gpio.direction_input = scoop_gpio_direction_input;
256 devptr->gpio.direction_output = scoop_gpio_direction_output;
257
258 ret = gpiochip_add(&devptr->gpio);
259 if (ret)
260 goto err_gpio;
261 }
262
174 return 0; 263 return 0;
264
265 if (devptr->gpio.base != -1)
266 temp = gpiochip_remove(&devptr->gpio);
267err_gpio:
268 platform_set_drvdata(pdev, NULL);
269err_ioremap:
270 iounmap(devptr->base);
271 kfree(devptr);
272
273 return ret;
175} 274}
176 275
177static int scoop_remove(struct platform_device *pdev) 276static int __devexit scoop_remove(struct platform_device *pdev)
178{ 277{
179 struct scoop_dev *sdev = platform_get_drvdata(pdev); 278 struct scoop_dev *sdev = platform_get_drvdata(pdev);
180 if (sdev) { 279 int ret;
181 iounmap(sdev->base); 280
182 kfree(sdev); 281 if (!sdev)
183 platform_set_drvdata(pdev, NULL); 282 return -EINVAL;
283
284 if (sdev->gpio.base != -1) {
285 ret = gpiochip_remove(&sdev->gpio);
286 if (ret) {
287 dev_err(&pdev->dev, "Can't remove gpio chip: %d\n", ret);
288 return ret;
289 }
184 } 290 }
291
292 platform_set_drvdata(pdev, NULL);
293 iounmap(sdev->base);
294 kfree(sdev);
295
185 return 0; 296 return 0;
186} 297}
187 298
188static struct platform_driver scoop_driver = { 299static struct platform_driver scoop_driver = {
189 .probe = scoop_probe, 300 .probe = scoop_probe,
190 .remove = scoop_remove, 301 .remove = __devexit_p(scoop_remove),
191 .suspend = scoop_suspend, 302 .suspend = scoop_suspend,
192 .resume = scoop_resume, 303 .resume = scoop_resume,
193 .driver = { 304 .driver = {
@@ -195,7 +306,7 @@ static struct platform_driver scoop_driver = {
195 }, 306 },
196}; 307};
197 308
198int __init scoop_init(void) 309static int __init scoop_init(void)
199{ 310{
200 return platform_driver_register(&scoop_driver); 311 return platform_driver_register(&scoop_driver);
201} 312}
diff --git a/arch/arm/configs/am200epdkit_defconfig b/arch/arm/configs/am200epdkit_defconfig
new file mode 100644
index 000000000000..dc030cfe5009
--- /dev/null
+++ b/arch/arm/configs/am200epdkit_defconfig
@@ -0,0 +1,1149 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.25-rc3
4# Sun Mar 9 06:33:33 2008
5#
6CONFIG_ARM=y
7CONFIG_SYS_SUPPORTS_APM_EMULATION=y
8CONFIG_GENERIC_GPIO=y
9CONFIG_GENERIC_TIME=y
10CONFIG_GENERIC_CLOCKEVENTS=y
11CONFIG_MMU=y
12# CONFIG_NO_IOPORT is not set
13CONFIG_GENERIC_HARDIRQS=y
14CONFIG_STACKTRACE_SUPPORT=y
15CONFIG_LOCKDEP_SUPPORT=y
16CONFIG_TRACE_IRQFLAGS_SUPPORT=y
17CONFIG_HARDIRQS_SW_RESEND=y
18CONFIG_GENERIC_IRQ_PROBE=y
19CONFIG_RWSEM_GENERIC_SPINLOCK=y
20# CONFIG_ARCH_HAS_ILOG2_U32 is not set
21# CONFIG_ARCH_HAS_ILOG2_U64 is not set
22CONFIG_GENERIC_HWEIGHT=y
23CONFIG_GENERIC_CALIBRATE_DELAY=y
24CONFIG_ARCH_SUPPORTS_AOUT=y
25CONFIG_ZONE_DMA=y
26CONFIG_ARCH_MTD_XIP=y
27CONFIG_VECTORS_BASE=0xffff0000
28CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
29
30#
31# General setup
32#
33CONFIG_EXPERIMENTAL=y
34CONFIG_BROKEN_ON_SMP=y
35CONFIG_LOCK_KERNEL=y
36CONFIG_INIT_ENV_ARG_LIMIT=32
37CONFIG_LOCALVERSION="gum"
38CONFIG_LOCALVERSION_AUTO=y
39# CONFIG_SWAP is not set
40CONFIG_SYSVIPC=y
41CONFIG_SYSVIPC_SYSCTL=y
42# CONFIG_POSIX_MQUEUE is not set
43# CONFIG_BSD_PROCESS_ACCT is not set
44# CONFIG_TASKSTATS is not set
45# CONFIG_AUDIT is not set
46# CONFIG_IKCONFIG is not set
47CONFIG_LOG_BUF_SHIFT=17
48# CONFIG_CGROUPS is not set
49CONFIG_GROUP_SCHED=y
50CONFIG_FAIR_GROUP_SCHED=y
51# CONFIG_RT_GROUP_SCHED is not set
52CONFIG_USER_SCHED=y
53# CONFIG_CGROUP_SCHED is not set
54# CONFIG_SYSFS_DEPRECATED is not set
55# CONFIG_RELAY is not set
56# CONFIG_NAMESPACES is not set
57# CONFIG_BLK_DEV_INITRD is not set
58CONFIG_CC_OPTIMIZE_FOR_SIZE=y
59CONFIG_SYSCTL=y
60CONFIG_EMBEDDED=y
61CONFIG_UID16=y
62# CONFIG_SYSCTL_SYSCALL is not set
63CONFIG_KALLSYMS=y
64# CONFIG_KALLSYMS_ALL is not set
65# CONFIG_KALLSYMS_EXTRA_PASS is not set
66CONFIG_HOTPLUG=y
67CONFIG_PRINTK=y
68CONFIG_BUG=y
69CONFIG_ELF_CORE=y
70CONFIG_COMPAT_BRK=y
71CONFIG_BASE_FULL=y
72CONFIG_FUTEX=y
73CONFIG_ANON_INODES=y
74# CONFIG_EPOLL is not set
75CONFIG_SIGNALFD=y
76CONFIG_TIMERFD=y
77CONFIG_EVENTFD=y
78# CONFIG_SHMEM is not set
79# CONFIG_VM_EVENT_COUNTERS is not set
80CONFIG_SLAB=y
81# CONFIG_SLUB is not set
82# CONFIG_SLOB is not set
83# CONFIG_PROFILING is not set
84# CONFIG_MARKERS is not set
85CONFIG_HAVE_OPROFILE=y
86# CONFIG_KPROBES is not set
87CONFIG_HAVE_KPROBES=y
88CONFIG_PROC_PAGE_MONITOR=y
89CONFIG_SLABINFO=y
90CONFIG_RT_MUTEXES=y
91CONFIG_TINY_SHMEM=y
92CONFIG_BASE_SMALL=0
93CONFIG_MODULES=y
94CONFIG_MODULE_UNLOAD=y
95# CONFIG_MODULE_FORCE_UNLOAD is not set
96# CONFIG_MODVERSIONS is not set
97# CONFIG_MODULE_SRCVERSION_ALL is not set
98CONFIG_KMOD=y
99CONFIG_BLOCK=y
100# CONFIG_LBD is not set
101# CONFIG_BLK_DEV_IO_TRACE is not set
102# CONFIG_LSF is not set
103# CONFIG_BLK_DEV_BSG is not set
104
105#
106# IO Schedulers
107#
108CONFIG_IOSCHED_NOOP=y
109# CONFIG_IOSCHED_AS is not set
110# CONFIG_IOSCHED_DEADLINE is not set
111# CONFIG_IOSCHED_CFQ is not set
112# CONFIG_DEFAULT_AS is not set
113# CONFIG_DEFAULT_DEADLINE is not set
114# CONFIG_DEFAULT_CFQ is not set
115CONFIG_DEFAULT_NOOP=y
116CONFIG_DEFAULT_IOSCHED="noop"
117CONFIG_CLASSIC_RCU=y
118# CONFIG_PREEMPT_RCU is not set
119
120#
121# System Type
122#
123# CONFIG_ARCH_AAEC2000 is not set
124# CONFIG_ARCH_INTEGRATOR is not set
125# CONFIG_ARCH_REALVIEW is not set
126# CONFIG_ARCH_VERSATILE is not set
127# CONFIG_ARCH_AT91 is not set
128# CONFIG_ARCH_CLPS7500 is not set
129# CONFIG_ARCH_CLPS711X is not set
130# CONFIG_ARCH_CO285 is not set
131# CONFIG_ARCH_EBSA110 is not set
132# CONFIG_ARCH_EP93XX is not set
133# CONFIG_ARCH_FOOTBRIDGE is not set
134# CONFIG_ARCH_NETX is not set
135# CONFIG_ARCH_H720X is not set
136# CONFIG_ARCH_IMX is not set
137# CONFIG_ARCH_IOP13XX is not set
138# CONFIG_ARCH_IOP32X is not set
139# CONFIG_ARCH_IOP33X is not set
140# CONFIG_ARCH_IXP23XX is not set
141# CONFIG_ARCH_IXP2000 is not set
142# CONFIG_ARCH_IXP4XX is not set
143# CONFIG_ARCH_L7200 is not set
144# CONFIG_ARCH_KS8695 is not set
145# CONFIG_ARCH_NS9XXX is not set
146# CONFIG_ARCH_MXC is not set
147# CONFIG_ARCH_ORION is not set
148# CONFIG_ARCH_PNX4008 is not set
149CONFIG_ARCH_PXA=y
150# CONFIG_ARCH_RPC is not set
151# CONFIG_ARCH_SA1100 is not set
152# CONFIG_ARCH_S3C2410 is not set
153# CONFIG_ARCH_SHARK is not set
154# CONFIG_ARCH_LH7A40X is not set
155# CONFIG_ARCH_DAVINCI is not set
156# CONFIG_ARCH_OMAP is not set
157# CONFIG_ARCH_MSM7X00A is not set
158
159#
160# Intel PXA2xx/PXA3xx Implementations
161#
162CONFIG_ARCH_GUMSTIX=y
163# CONFIG_ARCH_LUBBOCK is not set
164# CONFIG_MACH_LOGICPD_PXA270 is not set
165# CONFIG_MACH_MAINSTONE is not set
166# CONFIG_ARCH_PXA_IDP is not set
167# CONFIG_PXA_SHARPSL is not set
168# CONFIG_ARCH_PXA_ESERIES is not set
169# CONFIG_MACH_TRIZEPS4 is not set
170# CONFIG_MACH_EM_X270 is not set
171# CONFIG_MACH_COLIBRI is not set
172# CONFIG_MACH_ZYLONITE is not set
173# CONFIG_MACH_LITTLETON is not set
174# CONFIG_MACH_ARMCORE is not set
175# CONFIG_MACH_MAGICIAN is not set
176# CONFIG_MACH_PCM027 is not set
177CONFIG_MACH_GUMSTIX_F=y
178CONFIG_PXA25x=y
179
180#
181# Boot options
182#
183
184#
185# Power management
186#
187
188#
189# Processor Type
190#
191CONFIG_CPU_32=y
192CONFIG_CPU_XSCALE=y
193CONFIG_CPU_32v5=y
194CONFIG_CPU_ABRT_EV5T=y
195CONFIG_CPU_CACHE_VIVT=y
196CONFIG_CPU_TLB_V4WBI=y
197CONFIG_CPU_CP15=y
198CONFIG_CPU_CP15_MMU=y
199
200#
201# Processor Features
202#
203CONFIG_ARM_THUMB=y
204# CONFIG_CPU_DCACHE_DISABLE is not set
205# CONFIG_OUTER_CACHE is not set
206# CONFIG_IWMMXT is not set
207CONFIG_XSCALE_PMU=y
208
209#
210# Bus support
211#
212# CONFIG_PCI_SYSCALL is not set
213# CONFIG_ARCH_SUPPORTS_MSI is not set
214CONFIG_PCCARD=y
215# CONFIG_PCMCIA_DEBUG is not set
216CONFIG_PCMCIA=y
217CONFIG_PCMCIA_LOAD_CIS=y
218# CONFIG_PCMCIA_IOCTL is not set
219
220#
221# PC-card bridges
222#
223CONFIG_PCMCIA_PXA2XX=y
224
225#
226# Kernel Features
227#
228CONFIG_TICK_ONESHOT=y
229# CONFIG_NO_HZ is not set
230# CONFIG_HIGH_RES_TIMERS is not set
231CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
232CONFIG_PREEMPT=y
233CONFIG_HZ=100
234CONFIG_AEABI=y
235# CONFIG_OABI_COMPAT is not set
236# CONFIG_ARCH_DISCONTIGMEM_ENABLE is not set
237CONFIG_SELECT_MEMORY_MODEL=y
238CONFIG_FLATMEM_MANUAL=y
239# CONFIG_DISCONTIGMEM_MANUAL is not set
240# CONFIG_SPARSEMEM_MANUAL is not set
241CONFIG_FLATMEM=y
242CONFIG_FLAT_NODE_MEM_MAP=y
243# CONFIG_SPARSEMEM_STATIC is not set
244# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set
245CONFIG_SPLIT_PTLOCK_CPUS=4096
246# CONFIG_RESOURCES_64BIT is not set
247CONFIG_ZONE_DMA_FLAG=1
248CONFIG_BOUNCE=y
249CONFIG_VIRT_TO_BUS=y
250CONFIG_ALIGNMENT_TRAP=y
251
252#
253# Boot options
254#
255CONFIG_ZBOOT_ROM_TEXT=0x0
256CONFIG_ZBOOT_ROM_BSS=0x0
257CONFIG_CMDLINE="console=ttyS0,115200n8 root=1f01 rootfstype=jffs2"
258# CONFIG_XIP_KERNEL is not set
259# CONFIG_KEXEC is not set
260
261#
262# CPU Frequency scaling
263#
264# CONFIG_CPU_FREQ is not set
265
266#
267# Floating point emulation
268#
269
270#
271# At least one emulation must be selected
272#
273
274#
275# Userspace binary formats
276#
277CONFIG_BINFMT_ELF=y
278# CONFIG_BINFMT_AOUT is not set
279# CONFIG_BINFMT_MISC is not set
280
281#
282# Power management options
283#
284# CONFIG_PM is not set
285CONFIG_ARCH_SUSPEND_POSSIBLE=y
286
287#
288# Networking
289#
290CONFIG_NET=y
291
292#
293# Networking options
294#
295CONFIG_PACKET=m
296CONFIG_PACKET_MMAP=y
297CONFIG_UNIX=y
298# CONFIG_NET_KEY is not set
299CONFIG_INET=y
300# CONFIG_IP_MULTICAST is not set
301# CONFIG_IP_ADVANCED_ROUTER is not set
302CONFIG_IP_FIB_HASH=y
303# CONFIG_IP_PNP is not set
304# CONFIG_NET_IPIP is not set
305# CONFIG_NET_IPGRE is not set
306# CONFIG_ARPD is not set
307# CONFIG_SYN_COOKIES is not set
308# CONFIG_INET_AH is not set
309# CONFIG_INET_ESP is not set
310# CONFIG_INET_IPCOMP is not set
311# CONFIG_INET_XFRM_TUNNEL is not set
312# CONFIG_INET_TUNNEL is not set
313# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
314# CONFIG_INET_XFRM_MODE_TUNNEL is not set
315# CONFIG_INET_XFRM_MODE_BEET is not set
316# CONFIG_INET_LRO is not set
317# CONFIG_INET_DIAG is not set
318# CONFIG_TCP_CONG_ADVANCED is not set
319CONFIG_TCP_CONG_CUBIC=y
320CONFIG_DEFAULT_TCP_CONG="cubic"
321# CONFIG_TCP_MD5SIG is not set
322# CONFIG_IPV6 is not set
323# CONFIG_INET6_XFRM_TUNNEL is not set
324# CONFIG_INET6_TUNNEL is not set
325# CONFIG_NETWORK_SECMARK is not set
326# CONFIG_NETFILTER is not set
327# CONFIG_IP_DCCP is not set
328# CONFIG_IP_SCTP is not set
329# CONFIG_TIPC is not set
330# CONFIG_ATM is not set
331# CONFIG_BRIDGE is not set
332# CONFIG_VLAN_8021Q is not set
333# CONFIG_DECNET is not set
334# CONFIG_LLC2 is not set
335# CONFIG_IPX is not set
336# CONFIG_ATALK is not set
337# CONFIG_X25 is not set
338# CONFIG_LAPB is not set
339# CONFIG_ECONET is not set
340# CONFIG_WAN_ROUTER is not set
341# CONFIG_NET_SCHED is not set
342
343#
344# Network testing
345#
346# CONFIG_NET_PKTGEN is not set
347# CONFIG_HAMRADIO is not set
348# CONFIG_CAN is not set
349# CONFIG_IRDA is not set
350CONFIG_BT=m
351CONFIG_BT_L2CAP=m
352CONFIG_BT_SCO=m
353CONFIG_BT_RFCOMM=m
354CONFIG_BT_RFCOMM_TTY=y
355CONFIG_BT_BNEP=m
356# CONFIG_BT_BNEP_MC_FILTER is not set
357# CONFIG_BT_BNEP_PROTO_FILTER is not set
358# CONFIG_BT_HIDP is not set
359
360#
361# Bluetooth device drivers
362#
363# CONFIG_BT_HCIBTSDIO is not set
364CONFIG_BT_HCIUART=m
365CONFIG_BT_HCIUART_H4=y
366# CONFIG_BT_HCIUART_BCSP is not set
367# CONFIG_BT_HCIUART_LL is not set
368# CONFIG_BT_HCIDTL1 is not set
369# CONFIG_BT_HCIBT3C is not set
370# CONFIG_BT_HCIBLUECARD is not set
371# CONFIG_BT_HCIBTUART is not set
372# CONFIG_BT_HCIVHCI is not set
373# CONFIG_AF_RXRPC is not set
374
375#
376# Wireless
377#
378# CONFIG_CFG80211 is not set
379CONFIG_WIRELESS_EXT=y
380# CONFIG_MAC80211 is not set
381CONFIG_IEEE80211=m
382# CONFIG_IEEE80211_DEBUG is not set
383CONFIG_IEEE80211_CRYPT_WEP=m
384# CONFIG_IEEE80211_CRYPT_CCMP is not set
385# CONFIG_IEEE80211_CRYPT_TKIP is not set
386# CONFIG_IEEE80211_SOFTMAC is not set
387# CONFIG_RFKILL is not set
388# CONFIG_NET_9P is not set
389
390#
391# Device Drivers
392#
393
394#
395# Generic Driver Options
396#
397CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
398CONFIG_STANDALONE=y
399CONFIG_PREVENT_FIRMWARE_BUILD=y
400CONFIG_FW_LOADER=y
401# CONFIG_DEBUG_DRIVER is not set
402# CONFIG_DEBUG_DEVRES is not set
403# CONFIG_SYS_HYPERVISOR is not set
404# CONFIG_CONNECTOR is not set
405CONFIG_MTD=y
406# CONFIG_MTD_DEBUG is not set
407# CONFIG_MTD_CONCAT is not set
408CONFIG_MTD_PARTITIONS=y
409# CONFIG_MTD_REDBOOT_PARTS is not set
410# CONFIG_MTD_CMDLINE_PARTS is not set
411# CONFIG_MTD_AFS_PARTS is not set
412
413#
414# User Modules And Translation Layers
415#
416CONFIG_MTD_CHAR=y
417CONFIG_MTD_BLKDEVS=y
418CONFIG_MTD_BLOCK=y
419# CONFIG_FTL is not set
420# CONFIG_NFTL is not set
421# CONFIG_INFTL is not set
422# CONFIG_RFD_FTL is not set
423# CONFIG_SSFDC is not set
424# CONFIG_MTD_OOPS is not set
425
426#
427# RAM/ROM/Flash chip drivers
428#
429CONFIG_MTD_CFI=y
430# CONFIG_MTD_JEDECPROBE is not set
431CONFIG_MTD_GEN_PROBE=y
432CONFIG_MTD_CFI_ADV_OPTIONS=y
433CONFIG_MTD_CFI_NOSWAP=y
434# CONFIG_MTD_CFI_BE_BYTE_SWAP is not set
435# CONFIG_MTD_CFI_LE_BYTE_SWAP is not set
436CONFIG_MTD_CFI_GEOMETRY=y
437# CONFIG_MTD_MAP_BANK_WIDTH_1 is not set
438CONFIG_MTD_MAP_BANK_WIDTH_2=y
439# CONFIG_MTD_MAP_BANK_WIDTH_4 is not set
440# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
441# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
442# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
443CONFIG_MTD_CFI_I1=y
444# CONFIG_MTD_CFI_I2 is not set
445# CONFIG_MTD_CFI_I4 is not set
446# CONFIG_MTD_CFI_I8 is not set
447# CONFIG_MTD_OTP is not set
448CONFIG_MTD_CFI_INTELEXT=y
449# CONFIG_MTD_CFI_AMDSTD is not set
450# CONFIG_MTD_CFI_STAA is not set
451CONFIG_MTD_CFI_UTIL=y
452# CONFIG_MTD_RAM is not set
453# CONFIG_MTD_ROM is not set
454# CONFIG_MTD_ABSENT is not set
455# CONFIG_MTD_XIP is not set
456
457#
458# Mapping drivers for chip access
459#
460CONFIG_MTD_COMPLEX_MAPPINGS=y
461# CONFIG_MTD_PHYSMAP is not set
462CONFIG_MTD_PXA2XX=y
463# CONFIG_MTD_ARM_INTEGRATOR is not set
464# CONFIG_MTD_SHARP_SL is not set
465# CONFIG_MTD_PLATRAM is not set
466
467#
468# Self-contained MTD device drivers
469#
470# CONFIG_MTD_SLRAM is not set
471# CONFIG_MTD_PHRAM is not set
472# CONFIG_MTD_MTDRAM is not set
473# CONFIG_MTD_BLOCK2MTD is not set
474
475#
476# Disk-On-Chip Device Drivers
477#
478# CONFIG_MTD_DOC2000 is not set
479# CONFIG_MTD_DOC2001 is not set
480# CONFIG_MTD_DOC2001PLUS is not set
481# CONFIG_MTD_NAND is not set
482# CONFIG_MTD_ONENAND is not set
483
484#
485# UBI - Unsorted block images
486#
487# CONFIG_MTD_UBI is not set
488# CONFIG_PARPORT is not set
489CONFIG_BLK_DEV=y
490# CONFIG_BLK_DEV_COW_COMMON is not set
491CONFIG_BLK_DEV_LOOP=m
492# CONFIG_BLK_DEV_CRYPTOLOOP is not set
493# CONFIG_BLK_DEV_NBD is not set
494# CONFIG_BLK_DEV_RAM is not set
495# CONFIG_CDROM_PKTCDVD is not set
496# CONFIG_ATA_OVER_ETH is not set
497CONFIG_MISC_DEVICES=y
498# CONFIG_EEPROM_93CX6 is not set
499# CONFIG_ENCLOSURE_SERVICES is not set
500CONFIG_HAVE_IDE=y
501CONFIG_IDE=m
502CONFIG_IDE_MAX_HWIFS=2
503CONFIG_BLK_DEV_IDE=m
504
505#
506# Please see Documentation/ide.txt for help/info on IDE drives
507#
508# CONFIG_BLK_DEV_IDE_SATA is not set
509CONFIG_BLK_DEV_IDEDISK=m
510# CONFIG_IDEDISK_MULTI_MODE is not set
511CONFIG_BLK_DEV_IDECS=m
512# CONFIG_BLK_DEV_IDECD is not set
513# CONFIG_BLK_DEV_IDETAPE is not set
514# CONFIG_BLK_DEV_IDEFLOPPY is not set
515# CONFIG_IDE_TASK_IOCTL is not set
516CONFIG_IDE_PROC_FS=y
517
518#
519# IDE chipset support/bugfixes
520#
521CONFIG_IDE_GENERIC=m
522# CONFIG_BLK_DEV_PLATFORM is not set
523# CONFIG_BLK_DEV_IDEDMA is not set
524CONFIG_IDE_ARCH_OBSOLETE_INIT=y
525# CONFIG_BLK_DEV_HD is not set
526
527#
528# SCSI device support
529#
530# CONFIG_RAID_ATTRS is not set
531# CONFIG_SCSI is not set
532# CONFIG_SCSI_DMA is not set
533# CONFIG_SCSI_NETLINK is not set
534# CONFIG_ATA is not set
535# CONFIG_MD is not set
536CONFIG_NETDEVICES=y
537# CONFIG_NETDEVICES_MULTIQUEUE is not set
538# CONFIG_DUMMY is not set
539# CONFIG_BONDING is not set
540# CONFIG_MACVLAN is not set
541# CONFIG_EQUALIZER is not set
542# CONFIG_TUN is not set
543# CONFIG_VETH is not set
544# CONFIG_PHYLIB is not set
545CONFIG_NET_ETHERNET=y
546CONFIG_MII=m
547# CONFIG_AX88796 is not set
548CONFIG_SMC91X=m
549# CONFIG_DM9000 is not set
550# CONFIG_SMC911X is not set
551# CONFIG_IBM_NEW_EMAC_ZMII is not set
552# CONFIG_IBM_NEW_EMAC_RGMII is not set
553# CONFIG_IBM_NEW_EMAC_TAH is not set
554# CONFIG_IBM_NEW_EMAC_EMAC4 is not set
555# CONFIG_B44 is not set
556CONFIG_NETDEV_1000=y
557# CONFIG_E1000E_ENABLED is not set
558CONFIG_NETDEV_10000=y
559
560#
561# Wireless LAN
562#
563# CONFIG_WLAN_PRE80211 is not set
564# CONFIG_WLAN_80211 is not set
565# CONFIG_NET_PCMCIA is not set
566# CONFIG_WAN is not set
567# CONFIG_PPP is not set
568# CONFIG_SLIP is not set
569# CONFIG_NETCONSOLE is not set
570# CONFIG_NETPOLL is not set
571# CONFIG_NET_POLL_CONTROLLER is not set
572# CONFIG_ISDN is not set
573
574#
575# Input device support
576#
577CONFIG_INPUT=y
578# CONFIG_INPUT_FF_MEMLESS is not set
579# CONFIG_INPUT_POLLDEV is not set
580
581#
582# Userland interfaces
583#
584CONFIG_INPUT_MOUSEDEV=y
585CONFIG_INPUT_MOUSEDEV_PSAUX=y
586CONFIG_INPUT_MOUSEDEV_SCREEN_X=1024
587CONFIG_INPUT_MOUSEDEV_SCREEN_Y=768
588# CONFIG_INPUT_JOYDEV is not set
589# CONFIG_INPUT_EVDEV is not set
590# CONFIG_INPUT_EVBUG is not set
591
592#
593# Input Device Drivers
594#
595CONFIG_INPUT_KEYBOARD=y
596CONFIG_KEYBOARD_ATKBD=y
597# CONFIG_KEYBOARD_SUNKBD is not set
598# CONFIG_KEYBOARD_LKKBD is not set
599# CONFIG_KEYBOARD_XTKBD is not set
600# CONFIG_KEYBOARD_NEWTON is not set
601# CONFIG_KEYBOARD_STOWAWAY is not set
602# CONFIG_KEYBOARD_GPIO is not set
603CONFIG_INPUT_MOUSE=y
604CONFIG_MOUSE_PS2=y
605CONFIG_MOUSE_PS2_ALPS=y
606CONFIG_MOUSE_PS2_LOGIPS2PP=y
607CONFIG_MOUSE_PS2_SYNAPTICS=y
608CONFIG_MOUSE_PS2_LIFEBOOK=y
609CONFIG_MOUSE_PS2_TRACKPOINT=y
610# CONFIG_MOUSE_PS2_TOUCHKIT is not set
611# CONFIG_MOUSE_SERIAL is not set
612# CONFIG_MOUSE_APPLETOUCH is not set
613# CONFIG_MOUSE_VSXXXAA is not set
614# CONFIG_MOUSE_GPIO is not set
615# CONFIG_INPUT_JOYSTICK is not set
616# CONFIG_INPUT_TABLET is not set
617# CONFIG_INPUT_TOUCHSCREEN is not set
618# CONFIG_INPUT_MISC is not set
619
620#
621# Hardware I/O ports
622#
623CONFIG_SERIO=y
624CONFIG_SERIO_SERPORT=y
625CONFIG_SERIO_LIBPS2=y
626# CONFIG_SERIO_RAW is not set
627# CONFIG_GAMEPORT is not set
628
629#
630# Character devices
631#
632CONFIG_VT=y
633CONFIG_VT_CONSOLE=y
634CONFIG_HW_CONSOLE=y
635# CONFIG_VT_HW_CONSOLE_BINDING is not set
636# CONFIG_SERIAL_NONSTANDARD is not set
637
638#
639# Serial drivers
640#
641# CONFIG_SERIAL_8250 is not set
642
643#
644# Non-8250 serial port support
645#
646CONFIG_SERIAL_PXA=y
647CONFIG_SERIAL_PXA_CONSOLE=y
648CONFIG_SERIAL_CORE=y
649CONFIG_SERIAL_CORE_CONSOLE=y
650CONFIG_UNIX98_PTYS=y
651# CONFIG_LEGACY_PTYS is not set
652# CONFIG_IPMI_HANDLER is not set
653# CONFIG_HW_RANDOM is not set
654# CONFIG_NVRAM is not set
655# CONFIG_R3964 is not set
656
657#
658# PCMCIA character devices
659#
660# CONFIG_SYNCLINK_CS is not set
661# CONFIG_CARDMAN_4000 is not set
662# CONFIG_CARDMAN_4040 is not set
663# CONFIG_IPWIRELESS is not set
664# CONFIG_RAW_DRIVER is not set
665# CONFIG_TCG_TPM is not set
666# CONFIG_I2C is not set
667
668#
669# SPI support
670#
671# CONFIG_SPI is not set
672# CONFIG_SPI_MASTER is not set
673CONFIG_HAVE_GPIO_LIB=y
674
675#
676# GPIO Support
677#
678# CONFIG_DEBUG_GPIO is not set
679
680#
681# I2C GPIO expanders:
682#
683
684#
685# SPI GPIO expanders:
686#
687# CONFIG_W1 is not set
688# CONFIG_POWER_SUPPLY is not set
689# CONFIG_HWMON is not set
690CONFIG_WATCHDOG=y
691# CONFIG_WATCHDOG_NOWAYOUT is not set
692
693#
694# Watchdog Device Drivers
695#
696# CONFIG_SOFT_WATCHDOG is not set
697CONFIG_SA1100_WATCHDOG=m
698
699#
700# Sonics Silicon Backplane
701#
702CONFIG_SSB_POSSIBLE=y
703# CONFIG_SSB is not set
704
705#
706# Multifunction device drivers
707#
708# CONFIG_MFD_SM501 is not set
709# CONFIG_MFD_ASIC3 is not set
710
711#
712# Multimedia devices
713#
714# CONFIG_VIDEO_DEV is not set
715# CONFIG_DVB_CORE is not set
716CONFIG_DAB=y
717
718#
719# Graphics support
720#
721# CONFIG_VGASTATE is not set
722# CONFIG_VIDEO_OUTPUT_CONTROL is not set
723CONFIG_FB=y
724# CONFIG_FIRMWARE_EDID is not set
725# CONFIG_FB_DDC is not set
726CONFIG_FB_CFB_FILLRECT=y
727CONFIG_FB_CFB_COPYAREA=y
728CONFIG_FB_CFB_IMAGEBLIT=y
729# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set
730CONFIG_FB_SYS_FILLRECT=m
731CONFIG_FB_SYS_COPYAREA=m
732CONFIG_FB_SYS_IMAGEBLIT=m
733CONFIG_FB_SYS_FOPS=m
734CONFIG_FB_DEFERRED_IO=y
735# CONFIG_FB_SVGALIB is not set
736# CONFIG_FB_MACMODES is not set
737# CONFIG_FB_BACKLIGHT is not set
738CONFIG_FB_MODE_HELPERS=y
739CONFIG_FB_TILEBLITTING=y
740
741#
742# Frame buffer hardware drivers
743#
744# CONFIG_FB_S1D13XXX is not set
745CONFIG_FB_PXA=y
746CONFIG_FB_PXA_PARAMETERS=y
747CONFIG_FB_MBX=m
748CONFIG_FB_VIRTUAL=m
749# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
750
751#
752# Display device support
753#
754# CONFIG_DISPLAY_SUPPORT is not set
755
756#
757# Console display driver support
758#
759# CONFIG_VGA_CONSOLE is not set
760CONFIG_DUMMY_CONSOLE=y
761# CONFIG_FRAMEBUFFER_CONSOLE is not set
762# CONFIG_LOGO is not set
763
764#
765# Sound
766#
767CONFIG_SOUND=m
768
769#
770# Advanced Linux Sound Architecture
771#
772CONFIG_SND=m
773CONFIG_SND_TIMER=m
774CONFIG_SND_PCM=m
775# CONFIG_SND_SEQUENCER is not set
776CONFIG_SND_OSSEMUL=y
777CONFIG_SND_MIXER_OSS=m
778CONFIG_SND_PCM_OSS=m
779CONFIG_SND_PCM_OSS_PLUGINS=y
780# CONFIG_SND_DYNAMIC_MINORS is not set
781# CONFIG_SND_SUPPORT_OLD_API is not set
782# CONFIG_SND_VERBOSE_PROCFS is not set
783# CONFIG_SND_VERBOSE_PRINTK is not set
784# CONFIG_SND_DEBUG is not set
785
786#
787# Generic devices
788#
789CONFIG_SND_AC97_CODEC=m
790# CONFIG_SND_DUMMY is not set
791# CONFIG_SND_MTPAV is not set
792# CONFIG_SND_SERIAL_U16550 is not set
793# CONFIG_SND_MPU401 is not set
794
795#
796# ALSA ARM devices
797#
798CONFIG_SND_PXA2XX_PCM=m
799CONFIG_SND_PXA2XX_AC97=m
800
801#
802# PCMCIA devices
803#
804# CONFIG_SND_VXPOCKET is not set
805# CONFIG_SND_PDAUDIOCF is not set
806
807#
808# System on Chip audio support
809#
810# CONFIG_SND_SOC is not set
811
812#
813# SoC Audio support for SuperH
814#
815
816#
817# ALSA SoC audio for Freescale SOCs
818#
819
820#
821# Open Sound System
822#
823# CONFIG_SOUND_PRIME is not set
824CONFIG_AC97_BUS=m
825CONFIG_HID_SUPPORT=y
826CONFIG_HID=y
827# CONFIG_HID_DEBUG is not set
828# CONFIG_HIDRAW is not set
829CONFIG_USB_SUPPORT=y
830CONFIG_USB_ARCH_HAS_HCD=y
831# CONFIG_USB_ARCH_HAS_OHCI is not set
832# CONFIG_USB_ARCH_HAS_EHCI is not set
833# CONFIG_USB is not set
834
835#
836# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
837#
838CONFIG_USB_GADGET=y
839# CONFIG_USB_GADGET_DEBUG is not set
840# CONFIG_USB_GADGET_DEBUG_FILES is not set
841CONFIG_USB_GADGET_SELECTED=y
842# CONFIG_USB_GADGET_AMD5536UDC is not set
843# CONFIG_USB_GADGET_ATMEL_USBA is not set
844# CONFIG_USB_GADGET_FSL_USB2 is not set
845# CONFIG_USB_GADGET_NET2280 is not set
846CONFIG_USB_GADGET_PXA2XX=y
847CONFIG_USB_PXA2XX=y
848# CONFIG_USB_PXA2XX_SMALL is not set
849# CONFIG_USB_GADGET_M66592 is not set
850# CONFIG_USB_GADGET_GOKU is not set
851# CONFIG_USB_GADGET_LH7A40X is not set
852# CONFIG_USB_GADGET_OMAP is not set
853# CONFIG_USB_GADGET_S3C2410 is not set
854# CONFIG_USB_GADGET_AT91 is not set
855# CONFIG_USB_GADGET_DUMMY_HCD is not set
856# CONFIG_USB_GADGET_DUALSPEED is not set
857# CONFIG_USB_ZERO is not set
858CONFIG_USB_ETH=y
859CONFIG_USB_ETH_RNDIS=y
860# CONFIG_USB_GADGETFS is not set
861# CONFIG_USB_FILE_STORAGE is not set
862# CONFIG_USB_G_SERIAL is not set
863# CONFIG_USB_MIDI_GADGET is not set
864# CONFIG_USB_G_PRINTER is not set
865CONFIG_MMC=y
866# CONFIG_MMC_DEBUG is not set
867# CONFIG_MMC_UNSAFE_RESUME is not set
868
869#
870# MMC/SD Card Drivers
871#
872CONFIG_MMC_BLOCK=y
873CONFIG_MMC_BLOCK_BOUNCE=y
874# CONFIG_SDIO_UART is not set
875
876#
877# MMC/SD Host Controller Drivers
878#
879CONFIG_MMC_PXA=y
880# CONFIG_NEW_LEDS is not set
881CONFIG_RTC_LIB=y
882# CONFIG_RTC_CLASS is not set
883
884#
885# File systems
886#
887# CONFIG_EXT2_FS is not set
888# CONFIG_EXT3_FS is not set
889# CONFIG_EXT4DEV_FS is not set
890# CONFIG_REISERFS_FS is not set
891# CONFIG_JFS_FS is not set
892# CONFIG_FS_POSIX_ACL is not set
893# CONFIG_XFS_FS is not set
894# CONFIG_GFS2_FS is not set
895# CONFIG_OCFS2_FS is not set
896# CONFIG_DNOTIFY is not set
897CONFIG_INOTIFY=y
898CONFIG_INOTIFY_USER=y
899# CONFIG_QUOTA is not set
900# CONFIG_AUTOFS_FS is not set
901# CONFIG_AUTOFS4_FS is not set
902# CONFIG_FUSE_FS is not set
903
904#
905# CD-ROM/DVD Filesystems
906#
907# CONFIG_ISO9660_FS is not set
908# CONFIG_UDF_FS is not set
909
910#
911# DOS/FAT/NT Filesystems
912#
913CONFIG_FAT_FS=y
914# CONFIG_MSDOS_FS is not set
915CONFIG_VFAT_FS=y
916CONFIG_FAT_DEFAULT_CODEPAGE=437
917CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
918# CONFIG_NTFS_FS is not set
919
920#
921# Pseudo filesystems
922#
923CONFIG_PROC_FS=y
924CONFIG_PROC_SYSCTL=y
925CONFIG_SYSFS=y
926CONFIG_TMPFS=y
927# CONFIG_TMPFS_POSIX_ACL is not set
928# CONFIG_HUGETLB_PAGE is not set
929# CONFIG_CONFIGFS_FS is not set
930
931#
932# Miscellaneous filesystems
933#
934# CONFIG_ADFS_FS is not set
935# CONFIG_AFFS_FS is not set
936# CONFIG_HFS_FS is not set
937# CONFIG_HFSPLUS_FS is not set
938# CONFIG_BEFS_FS is not set
939# CONFIG_BFS_FS is not set
940# CONFIG_EFS_FS is not set
941CONFIG_JFFS2_FS=y
942CONFIG_JFFS2_FS_DEBUG=0
943CONFIG_JFFS2_FS_WRITEBUFFER=y
944# CONFIG_JFFS2_FS_WBUF_VERIFY is not set
945# CONFIG_JFFS2_SUMMARY is not set
946# CONFIG_JFFS2_FS_XATTR is not set
947CONFIG_JFFS2_COMPRESSION_OPTIONS=y
948CONFIG_JFFS2_ZLIB=y
949# CONFIG_JFFS2_LZO is not set
950CONFIG_JFFS2_RTIME=y
951CONFIG_JFFS2_RUBIN=y
952# CONFIG_JFFS2_CMODE_NONE is not set
953CONFIG_JFFS2_CMODE_PRIORITY=y
954# CONFIG_JFFS2_CMODE_SIZE is not set
955# CONFIG_JFFS2_CMODE_FAVOURLZO is not set
956# CONFIG_CRAMFS is not set
957# CONFIG_VXFS_FS is not set
958# CONFIG_MINIX_FS is not set
959# CONFIG_HPFS_FS is not set
960# CONFIG_QNX4FS_FS is not set
961# CONFIG_ROMFS_FS is not set
962# CONFIG_SYSV_FS is not set
963# CONFIG_UFS_FS is not set
964CONFIG_NETWORK_FILESYSTEMS=y
965# CONFIG_NFS_FS is not set
966# CONFIG_NFSD is not set
967# CONFIG_SMB_FS is not set
968# CONFIG_CIFS is not set
969# CONFIG_NCP_FS is not set
970# CONFIG_CODA_FS is not set
971# CONFIG_AFS_FS is not set
972
973#
974# Partition Types
975#
976CONFIG_PARTITION_ADVANCED=y
977# CONFIG_ACORN_PARTITION is not set
978# CONFIG_OSF_PARTITION is not set
979# CONFIG_AMIGA_PARTITION is not set
980# CONFIG_ATARI_PARTITION is not set
981# CONFIG_MAC_PARTITION is not set
982CONFIG_MSDOS_PARTITION=y
983# CONFIG_BSD_DISKLABEL is not set
984# CONFIG_MINIX_SUBPARTITION is not set
985# CONFIG_SOLARIS_X86_PARTITION is not set
986# CONFIG_UNIXWARE_DISKLABEL is not set
987# CONFIG_LDM_PARTITION is not set
988# CONFIG_SGI_PARTITION is not set
989# CONFIG_ULTRIX_PARTITION is not set
990# CONFIG_SUN_PARTITION is not set
991# CONFIG_KARMA_PARTITION is not set
992# CONFIG_EFI_PARTITION is not set
993# CONFIG_SYSV68_PARTITION is not set
994CONFIG_NLS=y
995CONFIG_NLS_DEFAULT="iso8859-1"
996CONFIG_NLS_CODEPAGE_437=y
997# CONFIG_NLS_CODEPAGE_737 is not set
998# CONFIG_NLS_CODEPAGE_775 is not set
999# CONFIG_NLS_CODEPAGE_850 is not set
1000# CONFIG_NLS_CODEPAGE_852 is not set
1001# CONFIG_NLS_CODEPAGE_855 is not set
1002# CONFIG_NLS_CODEPAGE_857 is not set
1003# CONFIG_NLS_CODEPAGE_860 is not set
1004# CONFIG_NLS_CODEPAGE_861 is not set
1005# CONFIG_NLS_CODEPAGE_862 is not set
1006# CONFIG_NLS_CODEPAGE_863 is not set
1007# CONFIG_NLS_CODEPAGE_864 is not set
1008# CONFIG_NLS_CODEPAGE_865 is not set
1009# CONFIG_NLS_CODEPAGE_866 is not set
1010# CONFIG_NLS_CODEPAGE_869 is not set
1011# CONFIG_NLS_CODEPAGE_936 is not set
1012# CONFIG_NLS_CODEPAGE_950 is not set
1013# CONFIG_NLS_CODEPAGE_932 is not set
1014# CONFIG_NLS_CODEPAGE_949 is not set
1015# CONFIG_NLS_CODEPAGE_874 is not set
1016# CONFIG_NLS_ISO8859_8 is not set
1017# CONFIG_NLS_CODEPAGE_1250 is not set
1018# CONFIG_NLS_CODEPAGE_1251 is not set
1019# CONFIG_NLS_ASCII is not set
1020CONFIG_NLS_ISO8859_1=y
1021# CONFIG_NLS_ISO8859_2 is not set
1022# CONFIG_NLS_ISO8859_3 is not set
1023# CONFIG_NLS_ISO8859_4 is not set
1024# CONFIG_NLS_ISO8859_5 is not set
1025# CONFIG_NLS_ISO8859_6 is not set
1026# CONFIG_NLS_ISO8859_7 is not set
1027# CONFIG_NLS_ISO8859_9 is not set
1028# CONFIG_NLS_ISO8859_13 is not set
1029# CONFIG_NLS_ISO8859_14 is not set
1030# CONFIG_NLS_ISO8859_15 is not set
1031# CONFIG_NLS_KOI8_R is not set
1032# CONFIG_NLS_KOI8_U is not set
1033# CONFIG_NLS_UTF8 is not set
1034# CONFIG_DLM is not set
1035
1036#
1037# Kernel hacking
1038#
1039# CONFIG_PRINTK_TIME is not set
1040CONFIG_ENABLE_WARN_DEPRECATED=y
1041CONFIG_ENABLE_MUST_CHECK=y
1042# CONFIG_MAGIC_SYSRQ is not set
1043# CONFIG_UNUSED_SYMBOLS is not set
1044# CONFIG_DEBUG_FS is not set
1045# CONFIG_HEADERS_CHECK is not set
1046CONFIG_DEBUG_KERNEL=y
1047# CONFIG_DEBUG_SHIRQ is not set
1048# CONFIG_DETECT_SOFTLOCKUP is not set
1049CONFIG_SCHED_DEBUG=y
1050# CONFIG_SCHEDSTATS is not set
1051# CONFIG_TIMER_STATS is not set
1052# CONFIG_DEBUG_SLAB is not set
1053# CONFIG_DEBUG_PREEMPT is not set
1054# CONFIG_DEBUG_RT_MUTEXES is not set
1055# CONFIG_RT_MUTEX_TESTER is not set
1056# CONFIG_DEBUG_SPINLOCK is not set
1057# CONFIG_DEBUG_MUTEXES is not set
1058# CONFIG_DEBUG_LOCK_ALLOC is not set
1059# CONFIG_PROVE_LOCKING is not set
1060# CONFIG_LOCK_STAT is not set
1061# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
1062# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
1063# CONFIG_DEBUG_KOBJECT is not set
1064# CONFIG_DEBUG_BUGVERBOSE is not set
1065# CONFIG_DEBUG_INFO is not set
1066# CONFIG_DEBUG_VM is not set
1067# CONFIG_DEBUG_LIST is not set
1068# CONFIG_DEBUG_SG is not set
1069CONFIG_FRAME_POINTER=y
1070# CONFIG_BOOT_PRINTK_DELAY is not set
1071# CONFIG_RCU_TORTURE_TEST is not set
1072# CONFIG_BACKTRACE_SELF_TEST is not set
1073# CONFIG_FAULT_INJECTION is not set
1074# CONFIG_SAMPLES is not set
1075CONFIG_DEBUG_USER=y
1076CONFIG_DEBUG_ERRORS=y
1077# CONFIG_DEBUG_STACK_USAGE is not set
1078# CONFIG_DEBUG_LL is not set
1079
1080#
1081# Security options
1082#
1083# CONFIG_KEYS is not set
1084# CONFIG_SECURITY is not set
1085# CONFIG_SECURITY_FILE_CAPABILITIES is not set
1086CONFIG_CRYPTO=y
1087CONFIG_CRYPTO_ALGAPI=m
1088CONFIG_CRYPTO_BLKCIPHER=m
1089# CONFIG_CRYPTO_SEQIV is not set
1090CONFIG_CRYPTO_MANAGER=m
1091# CONFIG_CRYPTO_HMAC is not set
1092# CONFIG_CRYPTO_XCBC is not set
1093# CONFIG_CRYPTO_NULL is not set
1094# CONFIG_CRYPTO_MD4 is not set
1095# CONFIG_CRYPTO_MD5 is not set
1096# CONFIG_CRYPTO_SHA1 is not set
1097# CONFIG_CRYPTO_SHA256 is not set
1098# CONFIG_CRYPTO_SHA512 is not set
1099# CONFIG_CRYPTO_WP512 is not set
1100# CONFIG_CRYPTO_TGR192 is not set
1101# CONFIG_CRYPTO_GF128MUL is not set
1102CONFIG_CRYPTO_ECB=m
1103CONFIG_CRYPTO_CBC=m
1104CONFIG_CRYPTO_PCBC=m
1105# CONFIG_CRYPTO_LRW is not set
1106# CONFIG_CRYPTO_XTS is not set
1107# CONFIG_CRYPTO_CTR is not set
1108# CONFIG_CRYPTO_GCM is not set
1109# CONFIG_CRYPTO_CCM is not set
1110# CONFIG_CRYPTO_CRYPTD is not set
1111# CONFIG_CRYPTO_DES is not set
1112# CONFIG_CRYPTO_FCRYPT is not set
1113# CONFIG_CRYPTO_BLOWFISH is not set
1114# CONFIG_CRYPTO_TWOFISH is not set
1115# CONFIG_CRYPTO_SERPENT is not set
1116# CONFIG_CRYPTO_AES is not set
1117# CONFIG_CRYPTO_CAST5 is not set
1118# CONFIG_CRYPTO_CAST6 is not set
1119# CONFIG_CRYPTO_TEA is not set
1120CONFIG_CRYPTO_ARC4=m
1121# CONFIG_CRYPTO_KHAZAD is not set
1122# CONFIG_CRYPTO_ANUBIS is not set
1123# CONFIG_CRYPTO_SEED is not set
1124# CONFIG_CRYPTO_SALSA20 is not set
1125# CONFIG_CRYPTO_DEFLATE is not set
1126# CONFIG_CRYPTO_MICHAEL_MIC is not set
1127# CONFIG_CRYPTO_CRC32C is not set
1128# CONFIG_CRYPTO_CAMELLIA is not set
1129# CONFIG_CRYPTO_TEST is not set
1130# CONFIG_CRYPTO_AUTHENC is not set
1131# CONFIG_CRYPTO_LZO is not set
1132CONFIG_CRYPTO_HW=y
1133
1134#
1135# Library routines
1136#
1137CONFIG_BITREVERSE=y
1138# CONFIG_CRC_CCITT is not set
1139# CONFIG_CRC16 is not set
1140# CONFIG_CRC_ITU_T is not set
1141CONFIG_CRC32=y
1142# CONFIG_CRC7 is not set
1143# CONFIG_LIBCRC32C is not set
1144CONFIG_ZLIB_INFLATE=y
1145CONFIG_ZLIB_DEFLATE=y
1146CONFIG_PLIST=y
1147CONFIG_HAS_IOMEM=y
1148CONFIG_HAS_IOPORT=y
1149CONFIG_HAS_DMA=y
diff --git a/arch/arm/configs/magician_defconfig b/arch/arm/configs/magician_defconfig
new file mode 100644
index 000000000000..4d11678584db
--- /dev/null
+++ b/arch/arm/configs/magician_defconfig
@@ -0,0 +1,1182 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.24-rc6
4# Sun Dec 30 13:02:54 2007
5#
6CONFIG_ARM=y
7CONFIG_SYS_SUPPORTS_APM_EMULATION=y
8CONFIG_GENERIC_GPIO=y
9CONFIG_GENERIC_TIME=y
10CONFIG_GENERIC_CLOCKEVENTS=y
11CONFIG_MMU=y
12# CONFIG_NO_IOPORT is not set
13CONFIG_GENERIC_HARDIRQS=y
14CONFIG_STACKTRACE_SUPPORT=y
15CONFIG_LOCKDEP_SUPPORT=y
16CONFIG_TRACE_IRQFLAGS_SUPPORT=y
17CONFIG_HARDIRQS_SW_RESEND=y
18CONFIG_GENERIC_IRQ_PROBE=y
19CONFIG_RWSEM_GENERIC_SPINLOCK=y
20# CONFIG_ARCH_HAS_ILOG2_U32 is not set
21# CONFIG_ARCH_HAS_ILOG2_U64 is not set
22CONFIG_GENERIC_HWEIGHT=y
23CONFIG_GENERIC_CALIBRATE_DELAY=y
24CONFIG_ZONE_DMA=y
25CONFIG_ARCH_MTD_XIP=y
26CONFIG_VECTORS_BASE=0xffff0000
27CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
28
29#
30# General setup
31#
32CONFIG_EXPERIMENTAL=y
33CONFIG_BROKEN_ON_SMP=y
34CONFIG_LOCK_KERNEL=y
35CONFIG_INIT_ENV_ARG_LIMIT=32
36CONFIG_LOCALVERSION=""
37CONFIG_LOCALVERSION_AUTO=y
38CONFIG_SWAP=y
39CONFIG_SYSVIPC=y
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_USER_NS is not set
45# CONFIG_PID_NS is not set
46# CONFIG_AUDIT is not set
47CONFIG_IKCONFIG=y
48CONFIG_IKCONFIG_PROC=y
49CONFIG_LOG_BUF_SHIFT=16
50# CONFIG_CGROUPS is not set
51# CONFIG_FAIR_GROUP_SCHED is not set
52# CONFIG_SYSFS_DEPRECATED is not set
53# CONFIG_RELAY is not set
54CONFIG_BLK_DEV_INITRD=y
55CONFIG_INITRAMFS_SOURCE=""
56CONFIG_CC_OPTIMIZE_FOR_SIZE=y
57CONFIG_SYSCTL=y
58CONFIG_EMBEDDED=y
59# CONFIG_UID16 is not set
60CONFIG_SYSCTL_SYSCALL=y
61CONFIG_KALLSYMS=y
62# CONFIG_KALLSYMS_ALL is not set
63# CONFIG_KALLSYMS_EXTRA_PASS is not set
64CONFIG_HOTPLUG=y
65CONFIG_PRINTK=y
66CONFIG_BUG=y
67CONFIG_ELF_CORE=y
68CONFIG_BASE_FULL=y
69CONFIG_FUTEX=y
70CONFIG_ANON_INODES=y
71CONFIG_EPOLL=y
72CONFIG_SIGNALFD=y
73CONFIG_EVENTFD=y
74CONFIG_SHMEM=y
75CONFIG_VM_EVENT_COUNTERS=y
76CONFIG_SLAB=y
77# CONFIG_SLUB is not set
78# CONFIG_SLOB is not set
79CONFIG_RT_MUTEXES=y
80# CONFIG_TINY_SHMEM is not set
81CONFIG_BASE_SMALL=0
82CONFIG_MODULES=y
83CONFIG_MODULE_UNLOAD=y
84CONFIG_MODULE_FORCE_UNLOAD=y
85# CONFIG_MODVERSIONS is not set
86# CONFIG_MODULE_SRCVERSION_ALL is not set
87CONFIG_KMOD=y
88CONFIG_BLOCK=y
89# CONFIG_LBD is not set
90# CONFIG_BLK_DEV_IO_TRACE is not set
91# CONFIG_LSF is not set
92# CONFIG_BLK_DEV_BSG is not set
93
94#
95# IO Schedulers
96#
97CONFIG_IOSCHED_NOOP=y
98# CONFIG_IOSCHED_AS is not set
99# CONFIG_IOSCHED_DEADLINE is not set
100# CONFIG_IOSCHED_CFQ is not set
101# CONFIG_DEFAULT_AS is not set
102# CONFIG_DEFAULT_DEADLINE is not set
103# CONFIG_DEFAULT_CFQ is not set
104CONFIG_DEFAULT_NOOP=y
105CONFIG_DEFAULT_IOSCHED="noop"
106CONFIG_CLASSIC_RCU=y
107# CONFIG_PREEMPT_RCU is not set
108
109#
110# System Type
111#
112# CONFIG_ARCH_AAEC2000 is not set
113# CONFIG_ARCH_INTEGRATOR is not set
114# CONFIG_ARCH_REALVIEW is not set
115# CONFIG_ARCH_VERSATILE is not set
116# CONFIG_ARCH_AT91 is not set
117# CONFIG_ARCH_CLPS7500 is not set
118# CONFIG_ARCH_CLPS711X is not set
119# CONFIG_ARCH_CO285 is not set
120# CONFIG_ARCH_EBSA110 is not set
121# CONFIG_ARCH_EP93XX is not set
122# CONFIG_ARCH_FOOTBRIDGE is not set
123# CONFIG_ARCH_NETX is not set
124# CONFIG_ARCH_H720X is not set
125# CONFIG_ARCH_IMX is not set
126# CONFIG_ARCH_IOP13XX is not set
127# CONFIG_ARCH_IOP32X is not set
128# CONFIG_ARCH_IOP33X is not set
129# CONFIG_ARCH_IXP23XX is not set
130# CONFIG_ARCH_IXP2000 is not set
131# CONFIG_ARCH_IXP4XX is not set
132# CONFIG_ARCH_L7200 is not set
133# CONFIG_ARCH_KS8695 is not set
134# CONFIG_ARCH_NS9XXX is not set
135# CONFIG_ARCH_MXC is not set
136# CONFIG_ARCH_PNX4008 is not set
137CONFIG_ARCH_PXA=y
138# CONFIG_ARCH_RPC is not set
139# CONFIG_ARCH_SA1100 is not set
140# CONFIG_ARCH_S3C2410 is not set
141# CONFIG_ARCH_SHARK is not set
142# CONFIG_ARCH_LH7A40X is not set
143# CONFIG_ARCH_DAVINCI is not set
144# CONFIG_ARCH_OMAP is not set
145
146#
147# Intel PXA2xx/PXA3xx Implementations
148#
149# CONFIG_ARCH_LUBBOCK is not set
150# CONFIG_MACH_LOGICPD_PXA270 is not set
151# CONFIG_MACH_MAINSTONE is not set
152# CONFIG_ARCH_PXA_IDP is not set
153# CONFIG_PXA_SHARPSL is not set
154# CONFIG_MACH_TRIZEPS4 is not set
155# CONFIG_MACH_EM_X270 is not set
156# CONFIG_MACH_ZYLONITE is not set
157# CONFIG_MACH_ARMCORE is not set
158CONFIG_MACH_MAGICIAN=y
159CONFIG_PXA27x=y
160
161#
162# Boot options
163#
164
165#
166# Power management
167#
168
169#
170# Processor Type
171#
172CONFIG_CPU_32=y
173CONFIG_CPU_XSCALE=y
174CONFIG_CPU_32v5=y
175CONFIG_CPU_ABRT_EV5T=y
176CONFIG_CPU_CACHE_VIVT=y
177CONFIG_CPU_TLB_V4WBI=y
178CONFIG_CPU_CP15=y
179CONFIG_CPU_CP15_MMU=y
180
181#
182# Processor Features
183#
184CONFIG_ARM_THUMB=y
185# CONFIG_CPU_DCACHE_DISABLE is not set
186# CONFIG_OUTER_CACHE is not set
187CONFIG_IWMMXT=y
188CONFIG_XSCALE_PMU=y
189
190#
191# Bus support
192#
193# CONFIG_PCI_SYSCALL is not set
194# CONFIG_ARCH_SUPPORTS_MSI is not set
195# CONFIG_PCCARD is not set
196
197#
198# Kernel Features
199#
200# CONFIG_TICK_ONESHOT is not set
201# CONFIG_NO_HZ is not set
202# CONFIG_HIGH_RES_TIMERS is not set
203CONFIG_GENERIC_CLOCKEVENTS_BUILD=y
204CONFIG_PREEMPT=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
216# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set
217CONFIG_SPLIT_PTLOCK_CPUS=4096
218# CONFIG_RESOURCES_64BIT is not set
219CONFIG_ZONE_DMA_FLAG=1
220CONFIG_BOUNCE=y
221CONFIG_VIRT_TO_BUS=y
222CONFIG_ALIGNMENT_TRAP=y
223
224#
225# Boot options
226#
227CONFIG_ZBOOT_ROM_TEXT=0x0
228CONFIG_ZBOOT_ROM_BSS=0x0
229CONFIG_CMDLINE="keepinitrd"
230# CONFIG_XIP_KERNEL is not set
231CONFIG_KEXEC=y
232
233#
234# CPU Frequency scaling
235#
236CONFIG_CPU_FREQ=y
237CONFIG_CPU_FREQ_TABLE=y
238# CONFIG_CPU_FREQ_DEBUG is not set
239CONFIG_CPU_FREQ_STAT=y
240# CONFIG_CPU_FREQ_STAT_DETAILS is not set
241CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y
242# CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set
243# CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND is not set
244# CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE is not set
245CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
246# CONFIG_CPU_FREQ_GOV_POWERSAVE is not set
247# CONFIG_CPU_FREQ_GOV_USERSPACE is not set
248CONFIG_CPU_FREQ_GOV_ONDEMAND=y
249# CONFIG_CPU_FREQ_GOV_CONSERVATIVE is not set
250
251#
252# Floating point emulation
253#
254
255#
256# At least one emulation must be selected
257#
258CONFIG_FPE_NWFPE=y
259# CONFIG_FPE_NWFPE_XP is not set
260# CONFIG_FPE_FASTFPE is not set
261
262#
263# Userspace binary formats
264#
265CONFIG_BINFMT_ELF=y
266# CONFIG_BINFMT_AOUT is not set
267# CONFIG_BINFMT_MISC is not set
268
269#
270# Power management options
271#
272CONFIG_PM=y
273# CONFIG_PM_LEGACY is not set
274# CONFIG_PM_DEBUG is not set
275CONFIG_PM_SLEEP=y
276CONFIG_SUSPEND_UP_POSSIBLE=y
277CONFIG_SUSPEND=y
278CONFIG_APM_EMULATION=y
279
280#
281# Networking
282#
283CONFIG_NET=y
284
285#
286# Networking options
287#
288CONFIG_PACKET=y
289CONFIG_PACKET_MMAP=y
290CONFIG_UNIX=y
291# CONFIG_NET_KEY is not set
292CONFIG_INET=y
293CONFIG_IP_MULTICAST=y
294# CONFIG_IP_ADVANCED_ROUTER is not set
295CONFIG_IP_FIB_HASH=y
296CONFIG_IP_PNP=y
297# CONFIG_IP_PNP_DHCP is not set
298# CONFIG_IP_PNP_BOOTP is not set
299# CONFIG_IP_PNP_RARP is not set
300# CONFIG_NET_IPIP is not set
301# CONFIG_NET_IPGRE is not set
302# CONFIG_IP_MROUTE is not set
303# CONFIG_ARPD is not set
304# CONFIG_SYN_COOKIES is not set
305# CONFIG_INET_AH is not set
306# CONFIG_INET_ESP is not set
307# CONFIG_INET_IPCOMP is not set
308# CONFIG_INET_XFRM_TUNNEL is not set
309# CONFIG_INET_TUNNEL is not set
310# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
311# CONFIG_INET_XFRM_MODE_TUNNEL is not set
312# CONFIG_INET_XFRM_MODE_BEET is not set
313# CONFIG_INET_LRO is not set
314# CONFIG_INET_DIAG is not set
315# CONFIG_TCP_CONG_ADVANCED is not set
316CONFIG_TCP_CONG_CUBIC=y
317CONFIG_DEFAULT_TCP_CONG="cubic"
318# CONFIG_TCP_MD5SIG is not set
319# CONFIG_IP_VS is not set
320# CONFIG_IPV6 is not set
321# CONFIG_INET6_XFRM_TUNNEL is not set
322# CONFIG_INET6_TUNNEL is not set
323# CONFIG_NETWORK_SECMARK is not set
324CONFIG_NETFILTER=y
325# CONFIG_NETFILTER_DEBUG is not set
326
327#
328# Core Netfilter Configuration
329#
330# CONFIG_NETFILTER_NETLINK is not set
331# CONFIG_NF_CONNTRACK_ENABLED is not set
332# CONFIG_NF_CONNTRACK is not set
333# CONFIG_NETFILTER_XTABLES is not set
334
335#
336# IP: Netfilter Configuration
337#
338# CONFIG_IP_NF_QUEUE is not set
339# CONFIG_IP_NF_IPTABLES is not set
340# CONFIG_IP_NF_ARPTABLES is not set
341# CONFIG_IP_DCCP is not set
342# CONFIG_IP_SCTP is not set
343# CONFIG_TIPC is not set
344# CONFIG_ATM is not set
345# CONFIG_BRIDGE is not set
346# CONFIG_VLAN_8021Q is not set
347# CONFIG_DECNET is not set
348# CONFIG_LLC2 is not set
349# CONFIG_IPX is not set
350# CONFIG_ATALK is not set
351# CONFIG_X25 is not set
352# CONFIG_LAPB is not set
353# CONFIG_ECONET is not set
354# CONFIG_WAN_ROUTER is not set
355# CONFIG_NET_SCHED is not set
356
357#
358# Network testing
359#
360# CONFIG_NET_PKTGEN is not set
361# CONFIG_HAMRADIO is not set
362# CONFIG_CAN is not set
363CONFIG_IRDA=m
364
365#
366# IrDA protocols
367#
368CONFIG_IRLAN=m
369# CONFIG_IRNET is not set
370CONFIG_IRCOMM=m
371CONFIG_IRDA_ULTRA=y
372
373#
374# IrDA options
375#
376CONFIG_IRDA_CACHE_LAST_LSAP=y
377CONFIG_IRDA_FAST_RR=y
378CONFIG_IRDA_DEBUG=y
379
380#
381# Infrared-port device drivers
382#
383
384#
385# SIR device drivers
386#
387CONFIG_IRTTY_SIR=m
388
389#
390# Dongle support
391#
392# CONFIG_DONGLE is not set
393
394#
395# Old SIR device drivers
396#
397# CONFIG_IRPORT_SIR is not set
398
399#
400# Old Serial dongle support
401#
402
403#
404# FIR device drivers
405#
406CONFIG_PXA_FICP=m
407CONFIG_BT=m
408CONFIG_BT_L2CAP=m
409CONFIG_BT_SCO=m
410CONFIG_BT_RFCOMM=m
411CONFIG_BT_RFCOMM_TTY=y
412CONFIG_BT_BNEP=m
413CONFIG_BT_BNEP_MC_FILTER=y
414CONFIG_BT_BNEP_PROTO_FILTER=y
415CONFIG_BT_HIDP=m
416
417#
418# Bluetooth device drivers
419#
420# CONFIG_BT_HCIUART is not set
421# CONFIG_BT_HCIVHCI is not set
422# CONFIG_AF_RXRPC is not set
423
424#
425# Wireless
426#
427# CONFIG_CFG80211 is not set
428# CONFIG_WIRELESS_EXT is not set
429# CONFIG_MAC80211 is not set
430# CONFIG_IEEE80211 is not set
431# CONFIG_RFKILL is not set
432# CONFIG_NET_9P is not set
433
434#
435# Device Drivers
436#
437
438#
439# Generic Driver Options
440#
441CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
442CONFIG_STANDALONE=y
443CONFIG_PREVENT_FIRMWARE_BUILD=y
444CONFIG_FW_LOADER=y
445# CONFIG_DEBUG_DRIVER is not set
446# CONFIG_DEBUG_DEVRES is not set
447# CONFIG_SYS_HYPERVISOR is not set
448# CONFIG_CONNECTOR is not set
449CONFIG_MTD=y
450CONFIG_MTD_DEBUG=y
451CONFIG_MTD_DEBUG_VERBOSE=0
452# CONFIG_MTD_CONCAT is not set
453CONFIG_MTD_PARTITIONS=y
454# CONFIG_MTD_REDBOOT_PARTS is not set
455CONFIG_MTD_CMDLINE_PARTS=y
456# CONFIG_MTD_AFS_PARTS is not set
457
458#
459# User Modules And Translation Layers
460#
461CONFIG_MTD_CHAR=m
462CONFIG_MTD_BLKDEVS=m
463CONFIG_MTD_BLOCK=m
464# CONFIG_FTL is not set
465# CONFIG_NFTL is not set
466# CONFIG_INFTL is not set
467# CONFIG_RFD_FTL is not set
468# CONFIG_SSFDC is not set
469# CONFIG_MTD_OOPS is not set
470
471#
472# RAM/ROM/Flash chip drivers
473#
474CONFIG_MTD_CFI=y
475# CONFIG_MTD_JEDECPROBE is not set
476# CONFIG_MTD_CFI_ADV_OPTIONS is not set
477CONFIG_MTD_MAP_BANK_WIDTH_1=y
478CONFIG_MTD_MAP_BANK_WIDTH_2=y
479CONFIG_MTD_MAP_BANK_WIDTH_4=y
480# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
481# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
482# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
483CONFIG_MTD_CFI_I1=y
484CONFIG_MTD_CFI_I2=y
485# CONFIG_MTD_CFI_I4 is not set
486# CONFIG_MTD_CFI_I8 is not set
487CONFIG_MTD_CFI_INTELEXT=y
488# CONFIG_MTD_CFI_AMDSTD is not set
489# CONFIG_MTD_CFI_STAA is not set
490# CONFIG_MTD_RAM is not set
491# CONFIG_MTD_ROM is not set
492# CONFIG_MTD_ABSENT is not set
493# CONFIG_MTD_XIP is not set
494
495#
496# Mapping drivers for chip access
497#
498# CONFIG_MTD_COMPLEX_MAPPINGS is not set
499CONFIG_MTD_PHYSMAP=y
500CONFIG_MTD_PHYSMAP_START=0x00000000
501CONFIG_MTD_PHYSMAP_LEN=0x04000000
502CONFIG_MTD_PHYSMAP_BANKWIDTH=4
503# CONFIG_MTD_PXA2XX is not set
504# CONFIG_MTD_ARM_INTEGRATOR is not set
505# CONFIG_MTD_SHARP_SL is not set
506# CONFIG_MTD_PLATRAM is not set
507
508#
509# Self-contained MTD device drivers
510#
511# CONFIG_MTD_SLRAM is not set
512# CONFIG_MTD_PHRAM is not set
513# CONFIG_MTD_MTDRAM is not set
514# CONFIG_MTD_BLOCK2MTD is not set
515
516#
517# Disk-On-Chip Device Drivers
518#
519# CONFIG_MTD_DOC2000 is not set
520# CONFIG_MTD_DOC2001 is not set
521# CONFIG_MTD_DOC2001PLUS is not set
522# CONFIG_MTD_NAND is not set
523# CONFIG_MTD_ONENAND is not set
524
525#
526# UBI - Unsorted block images
527#
528# CONFIG_MTD_UBI is not set
529# CONFIG_PARPORT is not set
530CONFIG_BLK_DEV=y
531# CONFIG_BLK_DEV_COW_COMMON is not set
532# CONFIG_BLK_DEV_LOOP is not set
533# CONFIG_BLK_DEV_NBD is not set
534# CONFIG_BLK_DEV_RAM is not set
535# CONFIG_CDROM_PKTCDVD is not set
536# CONFIG_ATA_OVER_ETH is not set
537# CONFIG_MISC_DEVICES is not set
538# CONFIG_IDE is not set
539
540#
541# SCSI device support
542#
543# CONFIG_RAID_ATTRS is not set
544# CONFIG_SCSI is not set
545# CONFIG_SCSI_DMA is not set
546# CONFIG_SCSI_NETLINK is not set
547# CONFIG_ATA is not set
548# CONFIG_MD is not set
549CONFIG_NETDEVICES=y
550# CONFIG_NETDEVICES_MULTIQUEUE is not set
551# CONFIG_DUMMY is not set
552# CONFIG_BONDING is not set
553# CONFIG_MACVLAN is not set
554# CONFIG_EQUALIZER is not set
555# CONFIG_TUN is not set
556# CONFIG_VETH is not set
557# CONFIG_NET_ETHERNET is not set
558# CONFIG_NETDEV_1000 is not set
559# CONFIG_NETDEV_10000 is not set
560
561#
562# Wireless LAN
563#
564# CONFIG_WLAN_PRE80211 is not set
565# CONFIG_WLAN_80211 is not set
566# CONFIG_WAN is not set
567CONFIG_PPP=m
568# CONFIG_PPP_MULTILINK is not set
569# CONFIG_PPP_FILTER is not set
570CONFIG_PPP_ASYNC=m
571# CONFIG_PPP_SYNC_TTY is not set
572CONFIG_PPP_DEFLATE=m
573CONFIG_PPP_BSDCOMP=m
574CONFIG_PPP_MPPE=m
575# CONFIG_PPPOE is not set
576# CONFIG_PPPOL2TP is not set
577# CONFIG_SLIP is not set
578CONFIG_SLHC=m
579# CONFIG_NETCONSOLE is not set
580# CONFIG_NETPOLL is not set
581# CONFIG_NET_POLL_CONTROLLER is not set
582# CONFIG_ISDN is not set
583
584#
585# Input device support
586#
587CONFIG_INPUT=y
588# CONFIG_INPUT_FF_MEMLESS is not set
589# CONFIG_INPUT_POLLDEV is not set
590
591#
592# Userland interfaces
593#
594# CONFIG_INPUT_MOUSEDEV is not set
595# CONFIG_INPUT_JOYDEV is not set
596CONFIG_INPUT_EVDEV=y
597# CONFIG_INPUT_EVBUG is not set
598
599#
600# Input Device Drivers
601#
602CONFIG_INPUT_KEYBOARD=y
603# CONFIG_KEYBOARD_ATKBD is not set
604# CONFIG_KEYBOARD_SUNKBD is not set
605# CONFIG_KEYBOARD_LKKBD is not set
606# CONFIG_KEYBOARD_XTKBD is not set
607# CONFIG_KEYBOARD_NEWTON is not set
608# CONFIG_KEYBOARD_STOWAWAY is not set
609# CONFIG_KEYBOARD_PXA27x is not set
610CONFIG_KEYBOARD_GPIO=y
611# CONFIG_INPUT_MOUSE is not set
612# CONFIG_INPUT_JOYSTICK is not set
613# CONFIG_INPUT_TABLET is not set
614CONFIG_INPUT_TOUCHSCREEN=y
615CONFIG_INPUT_MISC=y
616CONFIG_INPUT_UINPUT=m
617
618#
619# Hardware I/O ports
620#
621# CONFIG_SERIO is not set
622# CONFIG_GAMEPORT is not set
623
624#
625# Character devices
626#
627CONFIG_VT=y
628CONFIG_VT_CONSOLE=y
629CONFIG_HW_CONSOLE=y
630# CONFIG_VT_HW_CONSOLE_BINDING is not set
631# CONFIG_SERIAL_NONSTANDARD is not set
632
633#
634# Serial drivers
635#
636# CONFIG_SERIAL_8250 is not set
637
638#
639# Non-8250 serial port support
640#
641CONFIG_SERIAL_PXA=y
642# CONFIG_SERIAL_PXA_CONSOLE is not set
643CONFIG_SERIAL_CORE=y
644CONFIG_UNIX98_PTYS=y
645# CONFIG_LEGACY_PTYS is not set
646# CONFIG_IPMI_HANDLER is not set
647# CONFIG_HW_RANDOM is not set
648# CONFIG_NVRAM is not set
649# CONFIG_R3964 is not set
650# CONFIG_RAW_DRIVER is not set
651# CONFIG_TCG_TPM is not set
652CONFIG_I2C=m
653CONFIG_I2C_BOARDINFO=y
654CONFIG_I2C_CHARDEV=m
655
656#
657# I2C Algorithms
658#
659# CONFIG_I2C_ALGOBIT is not set
660# CONFIG_I2C_ALGOPCF is not set
661# CONFIG_I2C_ALGOPCA is not set
662
663#
664# I2C Hardware Bus support
665#
666# CONFIG_I2C_GPIO is not set
667CONFIG_I2C_PXA=m
668# CONFIG_I2C_PXA_SLAVE is not set
669# CONFIG_I2C_OCORES is not set
670# CONFIG_I2C_PARPORT_LIGHT is not set
671# CONFIG_I2C_SIMTEC is not set
672# CONFIG_I2C_TAOS_EVM is not set
673# CONFIG_I2C_STUB is not set
674
675#
676# Miscellaneous I2C Chip support
677#
678# CONFIG_SENSORS_DS1337 is not set
679# CONFIG_SENSORS_DS1374 is not set
680# CONFIG_DS1682 is not set
681# CONFIG_SENSORS_EEPROM is not set
682# CONFIG_SENSORS_PCF8574 is not set
683# CONFIG_SENSORS_PCA9539 is not set
684# CONFIG_SENSORS_PCF8591 is not set
685# CONFIG_SENSORS_MAX6875 is not set
686# CONFIG_SENSORS_TSL2550 is not set
687# CONFIG_I2C_DEBUG_CORE is not set
688# CONFIG_I2C_DEBUG_ALGO is not set
689# CONFIG_I2C_DEBUG_BUS is not set
690# CONFIG_I2C_DEBUG_CHIP is not set
691
692#
693# SPI support
694#
695# CONFIG_SPI is not set
696# CONFIG_SPI_MASTER is not set
697CONFIG_W1=y
698
699#
700# 1-wire Bus Masters
701#
702# CONFIG_W1_MASTER_DS2482 is not set
703CONFIG_W1_MASTER_DS1WM=y
704
705#
706# 1-wire Slaves
707#
708# CONFIG_W1_SLAVE_THERM is not set
709# CONFIG_W1_SLAVE_SMEM is not set
710# CONFIG_W1_SLAVE_DS2433 is not set
711CONFIG_W1_SLAVE_DS2760=y
712CONFIG_POWER_SUPPLY=y
713# CONFIG_POWER_SUPPLY_DEBUG is not set
714CONFIG_PDA_POWER=y
715# CONFIG_APM_POWER is not set
716CONFIG_BATTERY_DS2760=y
717# CONFIG_HWMON is not set
718# CONFIG_WATCHDOG is not set
719
720#
721# Sonics Silicon Backplane
722#
723CONFIG_SSB_POSSIBLE=y
724# CONFIG_SSB is not set
725
726#
727# Multifunction device drivers
728#
729# CONFIG_MFD_SM501 is not set
730CONFIG_HTC_EGPIO=y
731CONFIG_HTC_PASIC3=y
732
733#
734# Multimedia devices
735#
736# CONFIG_VIDEO_DEV is not set
737# CONFIG_DVB_CORE is not set
738# CONFIG_DAB is not set
739
740#
741# Graphics support
742#
743# CONFIG_VGASTATE is not set
744# CONFIG_VIDEO_OUTPUT_CONTROL is not set
745CONFIG_FB=y
746# CONFIG_FIRMWARE_EDID is not set
747# CONFIG_FB_DDC is not set
748CONFIG_FB_CFB_FILLRECT=y
749CONFIG_FB_CFB_COPYAREA=y
750CONFIG_FB_CFB_IMAGEBLIT=y
751# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set
752# CONFIG_FB_SYS_FILLRECT is not set
753# CONFIG_FB_SYS_COPYAREA is not set
754# CONFIG_FB_SYS_IMAGEBLIT is not set
755# CONFIG_FB_SYS_FOPS is not set
756CONFIG_FB_DEFERRED_IO=y
757# CONFIG_FB_SVGALIB is not set
758# CONFIG_FB_MACMODES is not set
759# CONFIG_FB_BACKLIGHT is not set
760# CONFIG_FB_MODE_HELPERS is not set
761# CONFIG_FB_TILEBLITTING is not set
762
763#
764# Frame buffer hardware drivers
765#
766# CONFIG_FB_S1D13XXX is not set
767CONFIG_FB_PXA=y
768# CONFIG_FB_PXA_PARAMETERS is not set
769# CONFIG_FB_MBX is not set
770# CONFIG_FB_VIRTUAL is not set
771CONFIG_BACKLIGHT_LCD_SUPPORT=y
772CONFIG_LCD_CLASS_DEVICE=y
773CONFIG_BACKLIGHT_CLASS_DEVICE=y
774CONFIG_BACKLIGHT_CORGI=y
775
776#
777# Display device support
778#
779CONFIG_DISPLAY_SUPPORT=y
780
781#
782# Display hardware drivers
783#
784
785#
786# Console display driver support
787#
788# CONFIG_VGA_CONSOLE is not set
789CONFIG_DUMMY_CONSOLE=y
790CONFIG_FRAMEBUFFER_CONSOLE=y
791# CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY is not set
792CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y
793CONFIG_FONTS=y
794# CONFIG_FONT_8x8 is not set
795# CONFIG_FONT_8x16 is not set
796# CONFIG_FONT_6x11 is not set
797# CONFIG_FONT_7x14 is not set
798# CONFIG_FONT_PEARL_8x8 is not set
799# CONFIG_FONT_ACORN_8x8 is not set
800CONFIG_FONT_MINI_4x6=y
801# CONFIG_FONT_SUN8x16 is not set
802# CONFIG_FONT_SUN12x22 is not set
803# CONFIG_FONT_10x18 is not set
804# CONFIG_LOGO is not set
805
806#
807# Sound
808#
809CONFIG_SOUND=y
810
811#
812# Advanced Linux Sound Architecture
813#
814CONFIG_SND=m
815CONFIG_SND_TIMER=m
816CONFIG_SND_PCM=m
817# CONFIG_SND_SEQUENCER is not set
818CONFIG_SND_OSSEMUL=y
819CONFIG_SND_MIXER_OSS=m
820CONFIG_SND_PCM_OSS=m
821CONFIG_SND_PCM_OSS_PLUGINS=y
822# CONFIG_SND_DYNAMIC_MINORS is not set
823CONFIG_SND_SUPPORT_OLD_API=y
824CONFIG_SND_VERBOSE_PROCFS=y
825# CONFIG_SND_VERBOSE_PRINTK is not set
826# CONFIG_SND_DEBUG is not set
827
828#
829# Generic devices
830#
831# CONFIG_SND_DUMMY is not set
832# CONFIG_SND_MTPAV is not set
833# CONFIG_SND_SERIAL_U16550 is not set
834# CONFIG_SND_MPU401 is not set
835
836#
837# ALSA ARM devices
838#
839# CONFIG_SND_PXA2XX_AC97 is not set
840
841#
842# System on Chip audio support
843#
844CONFIG_SND_SOC=m
845CONFIG_SND_PXA2XX_SOC=m
846
847#
848# SoC Audio support for SuperH
849#
850
851#
852# Open Sound System
853#
854# CONFIG_SOUND_PRIME is not set
855# CONFIG_HID_SUPPORT is not set
856CONFIG_HID=m
857# CONFIG_USB_SUPPORT is not set
858CONFIG_MMC=y
859# CONFIG_MMC_DEBUG is not set
860# CONFIG_MMC_UNSAFE_RESUME is not set
861
862#
863# MMC/SD Card Drivers
864#
865CONFIG_MMC_BLOCK=y
866CONFIG_MMC_BLOCK_BOUNCE=y
867CONFIG_SDIO_UART=m
868
869#
870# MMC/SD Host Controller Drivers
871#
872CONFIG_MMC_PXA=y
873CONFIG_NEW_LEDS=y
874CONFIG_RTC_LIB=y
875CONFIG_RTC_CLASS=y
876CONFIG_RTC_HCTOSYS=y
877CONFIG_RTC_HCTOSYS_DEVICE="rtc0"
878CONFIG_RTC_DEBUG=y
879
880#
881# RTC interfaces
882#
883CONFIG_RTC_INTF_SYSFS=y
884CONFIG_RTC_INTF_PROC=y
885CONFIG_RTC_INTF_DEV=y
886# CONFIG_RTC_INTF_DEV_UIE_EMUL is not set
887# CONFIG_RTC_DRV_TEST is not set
888
889#
890# I2C RTC drivers
891#
892# CONFIG_RTC_DRV_DS1307 is not set
893# CONFIG_RTC_DRV_DS1374 is not set
894# CONFIG_RTC_DRV_DS1672 is not set
895# CONFIG_RTC_DRV_MAX6900 is not set
896# CONFIG_RTC_DRV_RS5C372 is not set
897# CONFIG_RTC_DRV_ISL1208 is not set
898# CONFIG_RTC_DRV_X1205 is not set
899# CONFIG_RTC_DRV_PCF8563 is not set
900# CONFIG_RTC_DRV_PCF8583 is not set
901# CONFIG_RTC_DRV_M41T80 is not set
902
903#
904# SPI RTC drivers
905#
906
907#
908# Platform RTC drivers
909#
910# CONFIG_RTC_DRV_CMOS is not set
911# CONFIG_RTC_DRV_DS1553 is not set
912# CONFIG_RTC_DRV_STK17TA8 is not set
913# CONFIG_RTC_DRV_DS1742 is not set
914# CONFIG_RTC_DRV_M48T86 is not set
915# CONFIG_RTC_DRV_M48T59 is not set
916# CONFIG_RTC_DRV_V3020 is not set
917
918#
919# on-CPU RTC drivers
920#
921CONFIG_RTC_DRV_SA1100=y
922
923#
924# File systems
925#
926CONFIG_EXT2_FS=y
927# CONFIG_EXT2_FS_XATTR is not set
928# CONFIG_EXT2_FS_XIP is not set
929# CONFIG_EXT3_FS is not set
930# CONFIG_EXT4DEV_FS is not set
931# CONFIG_REISERFS_FS is not set
932# CONFIG_JFS_FS is not set
933# CONFIG_FS_POSIX_ACL is not set
934# CONFIG_XFS_FS is not set
935# CONFIG_GFS2_FS is not set
936# CONFIG_OCFS2_FS is not set
937# CONFIG_MINIX_FS is not set
938# CONFIG_ROMFS_FS is not set
939CONFIG_INOTIFY=y
940CONFIG_INOTIFY_USER=y
941# CONFIG_QUOTA is not set
942CONFIG_DNOTIFY=y
943# CONFIG_AUTOFS_FS is not set
944# CONFIG_AUTOFS4_FS is not set
945# CONFIG_FUSE_FS is not set
946
947#
948# CD-ROM/DVD Filesystems
949#
950# CONFIG_ISO9660_FS is not set
951# CONFIG_UDF_FS is not set
952
953#
954# DOS/FAT/NT Filesystems
955#
956CONFIG_FAT_FS=m
957CONFIG_MSDOS_FS=m
958CONFIG_VFAT_FS=m
959CONFIG_FAT_DEFAULT_CODEPAGE=437
960CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
961# CONFIG_NTFS_FS is not set
962
963#
964# Pseudo filesystems
965#
966CONFIG_PROC_FS=y
967CONFIG_PROC_SYSCTL=y
968CONFIG_SYSFS=y
969CONFIG_TMPFS=y
970# CONFIG_TMPFS_POSIX_ACL is not set
971# CONFIG_HUGETLB_PAGE is not set
972# CONFIG_CONFIGFS_FS is not set
973
974#
975# Miscellaneous filesystems
976#
977# CONFIG_ADFS_FS is not set
978# CONFIG_AFFS_FS is not set
979# CONFIG_HFS_FS is not set
980# CONFIG_HFSPLUS_FS is not set
981# CONFIG_BEFS_FS is not set
982# CONFIG_BFS_FS is not set
983# CONFIG_EFS_FS is not set
984CONFIG_JFFS2_FS=y
985CONFIG_JFFS2_FS_DEBUG=0
986CONFIG_JFFS2_FS_WRITEBUFFER=y
987# CONFIG_JFFS2_FS_WBUF_VERIFY is not set
988# CONFIG_JFFS2_SUMMARY is not set
989# CONFIG_JFFS2_FS_XATTR is not set
990CONFIG_JFFS2_COMPRESSION_OPTIONS=y
991CONFIG_JFFS2_ZLIB=y
992CONFIG_JFFS2_LZO=y
993CONFIG_JFFS2_RTIME=y
994# CONFIG_JFFS2_RUBIN is not set
995# CONFIG_JFFS2_CMODE_NONE is not set
996CONFIG_JFFS2_CMODE_PRIORITY=y
997# CONFIG_JFFS2_CMODE_SIZE is not set
998# CONFIG_JFFS2_CMODE_FAVOURLZO is not set
999# CONFIG_CRAMFS is not set
1000# CONFIG_VXFS_FS is not set
1001# CONFIG_HPFS_FS is not set
1002# CONFIG_QNX4FS_FS is not set
1003# CONFIG_SYSV_FS is not set
1004# CONFIG_UFS_FS is not set
1005CONFIG_NETWORK_FILESYSTEMS=y
1006CONFIG_NFS_FS=y
1007CONFIG_NFS_V3=y
1008# CONFIG_NFS_V3_ACL is not set
1009# CONFIG_NFS_V4 is not set
1010# CONFIG_NFS_DIRECTIO is not set
1011# CONFIG_NFSD is not set
1012CONFIG_ROOT_NFS=y
1013CONFIG_LOCKD=y
1014CONFIG_LOCKD_V4=y
1015CONFIG_NFS_COMMON=y
1016CONFIG_SUNRPC=y
1017# CONFIG_SUNRPC_BIND34 is not set
1018# CONFIG_RPCSEC_GSS_KRB5 is not set
1019# CONFIG_RPCSEC_GSS_SPKM3 is not set
1020# CONFIG_SMB_FS is not set
1021# CONFIG_CIFS is not set
1022# CONFIG_NCP_FS is not set
1023# CONFIG_CODA_FS is not set
1024# CONFIG_AFS_FS is not set
1025
1026#
1027# Partition Types
1028#
1029# CONFIG_PARTITION_ADVANCED is not set
1030CONFIG_MSDOS_PARTITION=y
1031CONFIG_NLS=y
1032CONFIG_NLS_DEFAULT="utf8"
1033CONFIG_NLS_CODEPAGE_437=y
1034# CONFIG_NLS_CODEPAGE_737 is not set
1035# CONFIG_NLS_CODEPAGE_775 is not set
1036# CONFIG_NLS_CODEPAGE_850 is not set
1037# CONFIG_NLS_CODEPAGE_852 is not set
1038# CONFIG_NLS_CODEPAGE_855 is not set
1039# CONFIG_NLS_CODEPAGE_857 is not set
1040# CONFIG_NLS_CODEPAGE_860 is not set
1041# CONFIG_NLS_CODEPAGE_861 is not set
1042# CONFIG_NLS_CODEPAGE_862 is not set
1043# CONFIG_NLS_CODEPAGE_863 is not set
1044# CONFIG_NLS_CODEPAGE_864 is not set
1045# CONFIG_NLS_CODEPAGE_865 is not set
1046# CONFIG_NLS_CODEPAGE_866 is not set
1047# CONFIG_NLS_CODEPAGE_869 is not set
1048# CONFIG_NLS_CODEPAGE_936 is not set
1049# CONFIG_NLS_CODEPAGE_950 is not set
1050# CONFIG_NLS_CODEPAGE_932 is not set
1051# CONFIG_NLS_CODEPAGE_949 is not set
1052# CONFIG_NLS_CODEPAGE_874 is not set
1053# CONFIG_NLS_ISO8859_8 is not set
1054# CONFIG_NLS_CODEPAGE_1250 is not set
1055CONFIG_NLS_CODEPAGE_1251=m
1056# CONFIG_NLS_ASCII is not set
1057CONFIG_NLS_ISO8859_1=y
1058# CONFIG_NLS_ISO8859_2 is not set
1059# CONFIG_NLS_ISO8859_3 is not set
1060# CONFIG_NLS_ISO8859_4 is not set
1061# CONFIG_NLS_ISO8859_5 is not set
1062# CONFIG_NLS_ISO8859_6 is not set
1063# CONFIG_NLS_ISO8859_7 is not set
1064# CONFIG_NLS_ISO8859_9 is not set
1065# CONFIG_NLS_ISO8859_13 is not set
1066# CONFIG_NLS_ISO8859_14 is not set
1067# CONFIG_NLS_ISO8859_15 is not set
1068# CONFIG_NLS_KOI8_R is not set
1069# CONFIG_NLS_KOI8_U is not set
1070CONFIG_NLS_UTF8=y
1071# CONFIG_DLM is not set
1072
1073#
1074# Kernel hacking
1075#
1076CONFIG_PRINTK_TIME=y
1077CONFIG_ENABLE_WARN_DEPRECATED=y
1078CONFIG_ENABLE_MUST_CHECK=y
1079# CONFIG_MAGIC_SYSRQ is not set
1080# CONFIG_UNUSED_SYMBOLS is not set
1081# CONFIG_DEBUG_FS is not set
1082# CONFIG_HEADERS_CHECK is not set
1083CONFIG_DEBUG_KERNEL=y
1084# CONFIG_DEBUG_SHIRQ is not set
1085CONFIG_DETECT_SOFTLOCKUP=y
1086# CONFIG_SCHED_DEBUG is not set
1087# CONFIG_SCHEDSTATS is not set
1088CONFIG_TIMER_STATS=y
1089# CONFIG_DEBUG_SLAB is not set
1090CONFIG_DEBUG_PREEMPT=y
1091# CONFIG_DEBUG_RT_MUTEXES is not set
1092# CONFIG_RT_MUTEX_TESTER is not set
1093# CONFIG_DEBUG_SPINLOCK is not set
1094CONFIG_DEBUG_MUTEXES=y
1095# CONFIG_DEBUG_LOCK_ALLOC is not set
1096# CONFIG_PROVE_LOCKING is not set
1097# CONFIG_LOCK_STAT is not set
1098# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
1099# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
1100# CONFIG_DEBUG_KOBJECT is not set
1101CONFIG_DEBUG_BUGVERBOSE=y
1102# CONFIG_DEBUG_INFO is not set
1103CONFIG_DEBUG_VM=y
1104# CONFIG_DEBUG_LIST is not set
1105# CONFIG_DEBUG_SG is not set
1106CONFIG_FRAME_POINTER=y
1107CONFIG_FORCED_INLINING=y
1108# CONFIG_BOOT_PRINTK_DELAY is not set
1109# CONFIG_RCU_TORTURE_TEST is not set
1110# CONFIG_FAULT_INJECTION is not set
1111# CONFIG_SAMPLES is not set
1112CONFIG_DEBUG_USER=y
1113CONFIG_DEBUG_ERRORS=y
1114CONFIG_DEBUG_LL=y
1115# CONFIG_DEBUG_ICEDCC is not set
1116
1117#
1118# Security options
1119#
1120# CONFIG_KEYS is not set
1121# CONFIG_SECURITY is not set
1122# CONFIG_SECURITY_FILE_CAPABILITIES is not set
1123CONFIG_CRYPTO=y
1124CONFIG_CRYPTO_ALGAPI=m
1125CONFIG_CRYPTO_BLKCIPHER=m
1126CONFIG_CRYPTO_MANAGER=m
1127# CONFIG_CRYPTO_HMAC is not set
1128# CONFIG_CRYPTO_XCBC is not set
1129# CONFIG_CRYPTO_NULL is not set
1130# CONFIG_CRYPTO_MD4 is not set
1131# CONFIG_CRYPTO_MD5 is not set
1132CONFIG_CRYPTO_SHA1=m
1133# CONFIG_CRYPTO_SHA256 is not set
1134# CONFIG_CRYPTO_SHA512 is not set
1135# CONFIG_CRYPTO_WP512 is not set
1136# CONFIG_CRYPTO_TGR192 is not set
1137# CONFIG_CRYPTO_GF128MUL is not set
1138CONFIG_CRYPTO_ECB=m
1139# CONFIG_CRYPTO_CBC is not set
1140CONFIG_CRYPTO_PCBC=m
1141# CONFIG_CRYPTO_LRW is not set
1142# CONFIG_CRYPTO_XTS is not set
1143# CONFIG_CRYPTO_CRYPTD is not set
1144# CONFIG_CRYPTO_DES is not set
1145# CONFIG_CRYPTO_FCRYPT is not set
1146# CONFIG_CRYPTO_BLOWFISH is not set
1147# CONFIG_CRYPTO_TWOFISH is not set
1148# CONFIG_CRYPTO_SERPENT is not set
1149# CONFIG_CRYPTO_AES is not set
1150# CONFIG_CRYPTO_CAST5 is not set
1151# CONFIG_CRYPTO_CAST6 is not set
1152# CONFIG_CRYPTO_TEA is not set
1153CONFIG_CRYPTO_ARC4=m
1154# CONFIG_CRYPTO_KHAZAD is not set
1155# CONFIG_CRYPTO_ANUBIS is not set
1156# CONFIG_CRYPTO_SEED is not set
1157# CONFIG_CRYPTO_DEFLATE is not set
1158# CONFIG_CRYPTO_MICHAEL_MIC is not set
1159# CONFIG_CRYPTO_CRC32C is not set
1160# CONFIG_CRYPTO_CAMELLIA is not set
1161# CONFIG_CRYPTO_TEST is not set
1162# CONFIG_CRYPTO_AUTHENC is not set
1163# CONFIG_CRYPTO_HW is not set
1164
1165#
1166# Library routines
1167#
1168CONFIG_BITREVERSE=y
1169CONFIG_CRC_CCITT=y
1170# CONFIG_CRC16 is not set
1171# CONFIG_CRC_ITU_T is not set
1172CONFIG_CRC32=y
1173# CONFIG_CRC7 is not set
1174# CONFIG_LIBCRC32C is not set
1175CONFIG_ZLIB_INFLATE=y
1176CONFIG_ZLIB_DEFLATE=y
1177CONFIG_LZO_COMPRESS=y
1178CONFIG_LZO_DECOMPRESS=y
1179CONFIG_PLIST=y
1180CONFIG_HAS_IOMEM=y
1181CONFIG_HAS_IOPORT=y
1182CONFIG_HAS_DMA=y
diff --git a/arch/arm/configs/ns9xxx_defconfig b/arch/arm/configs/ns9xxx_defconfig
index 0e5794c6a48e..7dc1580e4d99 100644
--- a/arch/arm/configs/ns9xxx_defconfig
+++ b/arch/arm/configs/ns9xxx_defconfig
@@ -1,621 +1,79 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.20
4# Thu Feb 15 20:51:47 2007
5#
6CONFIG_ARM=y
7# CONFIG_GENERIC_TIME is not set
8CONFIG_MMU=y
9CONFIG_GENERIC_HARDIRQS=y
10CONFIG_TRACE_IRQFLAGS_SUPPORT=y
11CONFIG_HARDIRQS_SW_RESEND=y
12CONFIG_GENERIC_IRQ_PROBE=y
13CONFIG_RWSEM_GENERIC_SPINLOCK=y
14# CONFIG_ARCH_HAS_ILOG2_U32 is not set
15# CONFIG_ARCH_HAS_ILOG2_U64 is not set
16CONFIG_GENERIC_HWEIGHT=y
17CONFIG_GENERIC_CALIBRATE_DELAY=y
18CONFIG_VECTORS_BASE=0xffff0000
19CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
20
21#
22# Code maturity level options
23#
24CONFIG_EXPERIMENTAL=y
25CONFIG_BROKEN_ON_SMP=y
26CONFIG_INIT_ENV_ARG_LIMIT=32
27
28#
29# General setup
30#
31CONFIG_LOCALVERSION=""
32CONFIG_LOCALVERSION_AUTO=y
33CONFIG_SWAP=y
34CONFIG_SYSVIPC=y
35# CONFIG_IPC_NS is not set
36# CONFIG_BSD_PROCESS_ACCT is not set
37# CONFIG_UTS_NS is not set
38CONFIG_IKCONFIG=y 1CONFIG_IKCONFIG=y
39CONFIG_IKCONFIG_PROC=y 2CONFIG_IKCONFIG_PROC=y
40CONFIG_SYSFS_DEPRECATED=y 3CONFIG_BLK_DEV_INITRD=y
41# CONFIG_RELAY is not set
42CONFIG_INITRAMFS_SOURCE=""
43# CONFIG_CC_OPTIMIZE_FOR_SIZE is not set
44CONFIG_SYSCTL=y
45CONFIG_EMBEDDED=y
46CONFIG_UID16=y
47# CONFIG_SYSCTL_SYSCALL is not set
48CONFIG_KALLSYMS=y
49# CONFIG_KALLSYMS_ALL is not set
50# CONFIG_KALLSYMS_EXTRA_PASS is not set
51CONFIG_HOTPLUG=y
52CONFIG_PRINTK=y
53CONFIG_BUG=y
54CONFIG_ELF_CORE=y
55CONFIG_BASE_FULL=y
56CONFIG_FUTEX=y
57CONFIG_EPOLL=y
58CONFIG_SHMEM=y
59CONFIG_SLAB=y
60# CONFIG_VM_EVENT_COUNTERS is not set
61CONFIG_RT_MUTEXES=y
62# CONFIG_TINY_SHMEM is not set
63CONFIG_BASE_SMALL=0
64# CONFIG_SLOB is not set
65
66#
67# Loadable module support
68#
69CONFIG_MODULES=y 4CONFIG_MODULES=y
70CONFIG_MODULE_UNLOAD=y 5CONFIG_MODULE_UNLOAD=y
71CONFIG_MODULE_FORCE_UNLOAD=y
72CONFIG_MODVERSIONS=y
73CONFIG_MODULE_SRCVERSION_ALL=y
74CONFIG_KMOD=y
75
76#
77# Block layer
78#
79CONFIG_BLOCK=y
80# CONFIG_LBD is not set
81# CONFIG_BLK_DEV_IO_TRACE is not set
82# CONFIG_LSF is not set
83
84#
85# IO Schedulers
86#
87CONFIG_IOSCHED_NOOP=y
88# CONFIG_IOSCHED_AS is not set 6# CONFIG_IOSCHED_AS is not set
89# CONFIG_IOSCHED_DEADLINE is not set 7# CONFIG_IOSCHED_DEADLINE is not set
90# CONFIG_IOSCHED_CFQ is not set 8# CONFIG_IOSCHED_CFQ is not set
91# CONFIG_DEFAULT_AS is not set
92# CONFIG_DEFAULT_DEADLINE is not set
93# CONFIG_DEFAULT_CFQ is not set
94CONFIG_DEFAULT_NOOP=y
95CONFIG_DEFAULT_IOSCHED="noop"
96
97#
98# System Type
99#
100# CONFIG_ARCH_AAEC2000 is not set
101# CONFIG_ARCH_INTEGRATOR is not set
102# CONFIG_ARCH_REALVIEW is not set
103# CONFIG_ARCH_VERSATILE is not set
104# CONFIG_ARCH_AT91 is not set
105# CONFIG_ARCH_CLPS7500 is not set
106# CONFIG_ARCH_CLPS711X is not set
107# CONFIG_ARCH_CO285 is not set
108# CONFIG_ARCH_EBSA110 is not set
109# CONFIG_ARCH_EP93XX is not set
110# CONFIG_ARCH_FOOTBRIDGE is not set
111# CONFIG_ARCH_NETX is not set
112# CONFIG_ARCH_H720X is not set
113# CONFIG_ARCH_IMX is not set
114# CONFIG_ARCH_IOP32X is not set
115# CONFIG_ARCH_IOP33X is not set
116# CONFIG_ARCH_IOP13XX is not set
117# CONFIG_ARCH_IXP4XX is not set
118# CONFIG_ARCH_IXP2000 is not set
119# CONFIG_ARCH_IXP23XX is not set
120# CONFIG_ARCH_L7200 is not set
121CONFIG_ARCH_NS9XXX=y 9CONFIG_ARCH_NS9XXX=y
122# CONFIG_ARCH_PNX4008 is not set 10CONFIG_MACH_A9M9360=y
123# CONFIG_ARCH_PXA is not set 11CONFIG_MACH_A9M9750=y
124# CONFIG_ARCH_RPC is not set 12CONFIG_MACH_CC7UCAMRY=y
125# CONFIG_ARCH_SA1100 is not set 13CONFIG_MACH_CC9C=y
126# CONFIG_ARCH_S3C2410 is not set 14CONFIG_MACH_CC9P9210=y
127# CONFIG_ARCH_SHARK is not set 15CONFIG_MACH_CC9P9210JS=y
128# CONFIG_ARCH_LH7A40X is not set 16CONFIG_MACH_CC9P9215=y
129# CONFIG_ARCH_OMAP is not set 17CONFIG_MACH_CC9P9215JS=y
130
131#
132# NS9xxx Implementations
133#
134CONFIG_MACH_CC9P9360DEV=y 18CONFIG_MACH_CC9P9360DEV=y
135CONFIG_PROCESSOR_NS9360=y 19CONFIG_MACH_CC9P9360JS=y
136CONFIG_BOARD_A9M9750DEV=y 20CONFIG_MACH_CC9P9360VAL=y
137 21CONFIG_MACH_CC9P9750DEV=y
138# 22CONFIG_MACH_CC9P9750VAL=y
139# Processor Type 23CONFIG_MACH_CCW9C=y
140# 24CONFIG_MACH_INC20OTTER=y
141CONFIG_CPU_32=y 25CONFIG_MACH_OTTER=y
142CONFIG_CPU_ARM926T=y 26CONFIG_NO_HZ=y
143CONFIG_CPU_32v5=y 27CONFIG_HIGH_RES_TIMERS=y
144CONFIG_CPU_ABRT_EV5TJ=y
145CONFIG_CPU_CACHE_VIVT=y
146CONFIG_CPU_COPY_V4WB=y
147CONFIG_CPU_TLB_V4WBI=y
148CONFIG_CPU_CP15=y
149CONFIG_CPU_CP15_MMU=y
150
151#
152# Processor Features
153#
154# CONFIG_ARM_THUMB is not set
155# CONFIG_CPU_ICACHE_DISABLE is not set
156# CONFIG_CPU_DCACHE_DISABLE is not set
157# CONFIG_CPU_DCACHE_WRITETHROUGH is not set
158# CONFIG_CPU_CACHE_ROUND_ROBIN is not set
159
160#
161# Bus support
162#
163
164#
165# PCCARD (PCMCIA/CardBus) support
166#
167# CONFIG_PCCARD is not set
168
169#
170# Kernel Features
171#
172# CONFIG_PREEMPT is not set
173# CONFIG_NO_IDLE_HZ is not set
174CONFIG_HZ=100
175# CONFIG_AEABI is not set
176# CONFIG_ARCH_DISCONTIGMEM_ENABLE is not set
177CONFIG_SELECT_MEMORY_MODEL=y
178CONFIG_FLATMEM_MANUAL=y
179# CONFIG_DISCONTIGMEM_MANUAL is not set
180# CONFIG_SPARSEMEM_MANUAL is not set
181CONFIG_FLATMEM=y
182CONFIG_FLAT_NODE_MEM_MAP=y
183# CONFIG_SPARSEMEM_STATIC is not set
184CONFIG_SPLIT_PTLOCK_CPUS=4096
185# CONFIG_RESOURCES_64BIT is not set
186CONFIG_ALIGNMENT_TRAP=y
187
188#
189# Boot options
190#
191CONFIG_ZBOOT_ROM_TEXT=0x0
192CONFIG_ZBOOT_ROM_BSS=0x0
193CONFIG_CMDLINE=""
194# CONFIG_XIP_KERNEL is not set
195
196#
197# Floating point emulation
198#
199
200#
201# At least one emulation must be selected
202#
203CONFIG_FPE_NWFPE=y 28CONFIG_FPE_NWFPE=y
204# CONFIG_FPE_NWFPE_XP is not set 29CONFIG_NET=y
205# CONFIG_FPE_FASTFPE is not set 30CONFIG_PACKET=m
206# CONFIG_VFP is not set 31CONFIG_INET=y
207 32CONFIG_IP_PNP=y
208# 33CONFIG_SYN_COOKIES=y
209# Userspace binary formats 34CONFIG_MTD=m
210# 35CONFIG_MTD_CONCAT=m
211CONFIG_BINFMT_ELF=y 36CONFIG_MTD_CHAR=m
212# CONFIG_BINFMT_AOUT is not set 37CONFIG_MTD_BLOCK=m
213# CONFIG_BINFMT_MISC is not set 38CONFIG_MTD_CFI=m
214# CONFIG_ARTHUR is not set 39CONFIG_MTD_JEDECPROBE=m
215 40CONFIG_MTD_CFI_AMDSTD=m
216# 41CONFIG_MTD_PHYSMAP=m
217# Power management options 42CONFIG_MTD_PHYSMAP_START=0x0
218# 43CONFIG_BLK_DEV_LOOP=m
219# CONFIG_PM is not set 44CONFIG_NETDEVICES=y
220# CONFIG_APM is not set 45CONFIG_NET_ETHERNET=y
221 46CONFIG_NS9XXX_ETH=y
222#
223# Networking
224#
225# CONFIG_NET is not set
226
227#
228# Device Drivers
229#
230
231#
232# Generic Driver Options
233#
234CONFIG_STANDALONE=y
235CONFIG_PREVENT_FIRMWARE_BUILD=y
236# CONFIG_FW_LOADER is not set
237# CONFIG_DEBUG_DRIVER is not set
238# CONFIG_SYS_HYPERVISOR is not set
239
240#
241# Connector - unified userspace <-> kernelspace linker
242#
243
244#
245# Memory Technology Devices (MTD)
246#
247# CONFIG_MTD is not set
248
249#
250# Parallel port support
251#
252# CONFIG_PARPORT is not set
253
254#
255# Plug and Play support
256#
257
258#
259# Block devices
260#
261# CONFIG_BLK_DEV_COW_COMMON is not set
262# CONFIG_BLK_DEV_LOOP is not set
263CONFIG_BLK_DEV_RAM=y
264CONFIG_BLK_DEV_RAM_COUNT=16
265CONFIG_BLK_DEV_RAM_SIZE=4096
266CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
267CONFIG_BLK_DEV_INITRD=y
268# CONFIG_CDROM_PKTCDVD is not set
269
270#
271# SCSI device support
272#
273# CONFIG_RAID_ATTRS is not set
274# CONFIG_SCSI is not set
275# CONFIG_SCSI_NETLINK is not set
276
277#
278# Serial ATA (prod) and Parallel ATA (experimental) drivers
279#
280# CONFIG_ATA is not set
281
282#
283# Multi-device support (RAID and LVM)
284#
285# CONFIG_MD is not set
286
287#
288# Fusion MPT device support
289#
290# CONFIG_FUSION is not set
291
292#
293# IEEE 1394 (FireWire) support
294#
295
296#
297# I2O device support
298#
299
300#
301# ISDN subsystem
302#
303
304#
305# Input device support
306#
307CONFIG_INPUT=y
308# CONFIG_INPUT_FF_MEMLESS is not set
309
310#
311# Userland interfaces
312#
313# CONFIG_INPUT_MOUSEDEV is not set
314# CONFIG_INPUT_JOYDEV is not set
315# CONFIG_INPUT_TSDEV is not set
316# CONFIG_INPUT_EVDEV is not set
317# CONFIG_INPUT_EVBUG is not set
318
319#
320# Input Device Drivers
321#
322# CONFIG_INPUT_KEYBOARD is not set
323# CONFIG_INPUT_MOUSE is not set
324# CONFIG_INPUT_JOYSTICK is not set
325# CONFIG_INPUT_TOUCHSCREEN is not set
326# CONFIG_INPUT_MISC is not set
327
328#
329# Hardware I/O ports
330#
331CONFIG_SERIO=y
332# CONFIG_SERIO_SERPORT is not set 47# CONFIG_SERIO_SERPORT is not set
333CONFIG_SERIO_LIBPS2=y
334# CONFIG_SERIO_RAW is not set
335# CONFIG_GAMEPORT is not set
336
337#
338# Character devices
339#
340CONFIG_VT=y
341CONFIG_VT_CONSOLE=y
342CONFIG_HW_CONSOLE=y
343# CONFIG_VT_HW_CONSOLE_BINDING is not set
344# CONFIG_SERIAL_NONSTANDARD is not set
345
346#
347# Serial drivers
348#
349CONFIG_SERIAL_8250=y 48CONFIG_SERIAL_8250=y
350CONFIG_SERIAL_8250_CONSOLE=y 49CONFIG_SERIAL_8250_CONSOLE=y
351CONFIG_SERIAL_8250_NR_UARTS=4 50CONFIG_SERIAL_NS921X=y
352CONFIG_SERIAL_8250_RUNTIME_UARTS=4 51CONFIG_SERIAL_NS921X_CONSOLE=y
353CONFIG_SERIAL_8250_EXTENDED=y
354# CONFIG_SERIAL_8250_MANY_PORTS is not set
355# CONFIG_SERIAL_8250_SHARE_IRQ is not set
356# CONFIG_SERIAL_8250_DETECT_IRQ is not set
357# CONFIG_SERIAL_8250_RSA is not set
358
359#
360# Non-8250 serial port support
361#
362CONFIG_SERIAL_CORE=y
363CONFIG_SERIAL_CORE_CONSOLE=y
364CONFIG_UNIX98_PTYS=y
365# CONFIG_LEGACY_PTYS is not set 52# CONFIG_LEGACY_PTYS is not set
366
367#
368# IPMI
369#
370# CONFIG_IPMI_HANDLER is not set
371
372#
373# Watchdog Cards
374#
375# CONFIG_WATCHDOG is not set
376# CONFIG_HW_RANDOM is not set 53# CONFIG_HW_RANDOM is not set
377# CONFIG_NVRAM is not set 54CONFIG_ADC_NS9215=m
378# CONFIG_DTLK is not set 55CONFIG_I2C=m
379# CONFIG_R3964 is not set 56CONFIG_I2C_GPIO=m
380# CONFIG_RAW_DRIVER is not set
381
382#
383# TPM devices
384#
385# CONFIG_TCG_TPM is not set
386
387#
388# I2C support
389#
390# CONFIG_I2C is not set
391
392#
393# SPI support
394#
395# CONFIG_SPI is not set
396# CONFIG_SPI_MASTER is not set
397
398#
399# Dallas's 1-wire bus
400#
401# CONFIG_W1 is not set
402
403#
404# Hardware Monitoring support
405#
406# CONFIG_HWMON is not set 57# CONFIG_HWMON is not set
407# CONFIG_HWMON_VID is not set
408
409#
410# Misc devices
411#
412# CONFIG_TIFM_CORE is not set
413
414#
415# LED devices
416#
417# CONFIG_NEW_LEDS is not set
418
419#
420# LED drivers
421#
422
423#
424# LED Triggers
425#
426
427#
428# Multimedia devices
429#
430# CONFIG_VIDEO_DEV is not set
431
432#
433# Digital Video Broadcasting Devices
434#
435
436#
437# Graphics support
438#
439# CONFIG_FIRMWARE_EDID is not set
440# CONFIG_FB is not set
441
442#
443# Console display driver support
444#
445# CONFIG_VGA_CONSOLE is not set 58# CONFIG_VGA_CONSOLE is not set
446CONFIG_DUMMY_CONSOLE=y 59# CONFIG_HID_DEBUG is not set
447# CONFIG_BACKLIGHT_LCD_SUPPORT is not set 60# CONFIG_USB_SUPPORT is not set
448 61CONFIG_NEW_LEDS=y
449# 62CONFIG_LEDS_CLASS=m
450# Sound 63CONFIG_LEDS_GPIO=m
451# 64CONFIG_LEDS_TRIGGERS=y
452# CONFIG_SOUND is not set 65CONFIG_LEDS_TRIGGER_TIMER=m
453 66CONFIG_LEDS_TRIGGER_HEARTBEAT=m
454# 67CONFIG_RTC_CLASS=m
455# HID Devices 68CONFIG_RTC_DRV_NS9215=m
456# 69CONFIG_EXT2_FS=m
457CONFIG_HID=y
458
459#
460# USB support
461#
462CONFIG_USB_ARCH_HAS_HCD=y
463# CONFIG_USB_ARCH_HAS_OHCI is not set
464# CONFIG_USB_ARCH_HAS_EHCI is not set
465# CONFIG_USB is not set
466
467#
468# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
469#
470
471#
472# USB Gadget Support
473#
474# CONFIG_USB_GADGET is not set
475
476#
477# MMC/SD Card support
478#
479# CONFIG_MMC is not set
480
481#
482# Real Time Clock
483#
484CONFIG_RTC_LIB=y
485# CONFIG_RTC_CLASS is not set
486
487#
488# File systems
489#
490CONFIG_EXT2_FS=y
491# CONFIG_EXT2_FS_XATTR is not set
492# CONFIG_EXT2_FS_XIP is not set
493# CONFIG_EXT3_FS is not set
494# CONFIG_EXT4DEV_FS is not set
495# CONFIG_REISERFS_FS is not set
496# CONFIG_JFS_FS is not set
497# CONFIG_FS_POSIX_ACL is not set
498# CONFIG_XFS_FS is not set
499# CONFIG_GFS2_FS is not set
500# CONFIG_MINIX_FS is not set
501# CONFIG_ROMFS_FS is not set
502CONFIG_INOTIFY=y
503CONFIG_INOTIFY_USER=y
504# CONFIG_QUOTA is not set
505# CONFIG_DNOTIFY is not set
506# CONFIG_AUTOFS_FS is not set
507# CONFIG_AUTOFS4_FS is not set
508# CONFIG_FUSE_FS is not set
509
510#
511# CD-ROM/DVD Filesystems
512#
513# CONFIG_ISO9660_FS is not set
514# CONFIG_UDF_FS is not set
515
516#
517# DOS/FAT/NT Filesystems
518#
519# CONFIG_MSDOS_FS is not set
520# CONFIG_VFAT_FS is not set
521# CONFIG_NTFS_FS is not set
522
523#
524# Pseudo filesystems
525#
526CONFIG_PROC_FS=y
527CONFIG_PROC_SYSCTL=y
528CONFIG_SYSFS=y
529CONFIG_TMPFS=y 70CONFIG_TMPFS=y
530# CONFIG_TMPFS_POSIX_ACL is not set 71CONFIG_JFFS2_FS=m
531# CONFIG_HUGETLB_PAGE is not set 72CONFIG_NFS_FS=y
532CONFIG_RAMFS=y 73CONFIG_ROOT_NFS=y
533# CONFIG_CONFIGFS_FS is not set
534
535#
536# Miscellaneous filesystems
537#
538# CONFIG_ADFS_FS is not set
539# CONFIG_AFFS_FS is not set
540# CONFIG_HFS_FS is not set
541# CONFIG_HFSPLUS_FS is not set
542# CONFIG_BEFS_FS is not set
543# CONFIG_BFS_FS is not set
544# CONFIG_EFS_FS is not set
545# CONFIG_CRAMFS is not set
546# CONFIG_VXFS_FS is not set
547# CONFIG_HPFS_FS is not set
548# CONFIG_QNX4FS_FS is not set
549# CONFIG_SYSV_FS is not set
550# CONFIG_UFS_FS is not set
551
552#
553# Partition Types
554#
555# CONFIG_PARTITION_ADVANCED is not set
556CONFIG_MSDOS_PARTITION=y
557
558#
559# Native Language Support
560#
561# CONFIG_NLS is not set
562
563#
564# Profiling support
565#
566# CONFIG_PROFILING is not set
567
568#
569# Kernel hacking
570#
571# CONFIG_PRINTK_TIME is not set
572# CONFIG_ENABLE_MUST_CHECK is not set 74# CONFIG_ENABLE_MUST_CHECK is not set
573# CONFIG_MAGIC_SYSRQ is not set
574# CONFIG_UNUSED_SYMBOLS is not set
575# CONFIG_DEBUG_FS is not set
576# CONFIG_HEADERS_CHECK is not set
577CONFIG_DEBUG_KERNEL=y 75CONFIG_DEBUG_KERNEL=y
578CONFIG_LOG_BUF_SHIFT=14
579# CONFIG_DETECT_SOFTLOCKUP is not set
580# CONFIG_SCHEDSTATS is not set
581# CONFIG_DEBUG_SLAB is not set
582# CONFIG_DEBUG_RT_MUTEXES is not set
583# CONFIG_RT_MUTEX_TESTER is not set
584# CONFIG_DEBUG_SPINLOCK is not set
585# CONFIG_DEBUG_MUTEXES is not set
586# CONFIG_DEBUG_RWSEMS is not set
587# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
588# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
589# CONFIG_DEBUG_KOBJECT is not set
590CONFIG_DEBUG_BUGVERBOSE=y 76CONFIG_DEBUG_BUGVERBOSE=y
591CONFIG_DEBUG_INFO=y 77CONFIG_DEBUG_INFO=y
592# CONFIG_DEBUG_VM is not set
593# CONFIG_DEBUG_LIST is not set
594CONFIG_FRAME_POINTER=y
595CONFIG_FORCED_INLINING=y
596# CONFIG_RCU_TORTURE_TEST is not set
597CONFIG_DEBUG_USER=y 78CONFIG_DEBUG_USER=y
598CONFIG_DEBUG_ERRORS=y 79CONFIG_DEBUG_ERRORS=y
599CONFIG_DEBUG_LL=y
600CONFIG_DEBUG_ICEDCC=y
601
602#
603# Security options
604#
605# CONFIG_KEYS is not set
606# CONFIG_SECURITY is not set
607
608#
609# Cryptographic options
610#
611# CONFIG_CRYPTO is not set
612
613#
614# Library routines
615#
616# CONFIG_CRC_CCITT is not set
617# CONFIG_CRC16 is not set
618# CONFIG_CRC32 is not set
619# CONFIG_LIBCRC32C is not set
620CONFIG_PLIST=y
621CONFIG_IOMAP_COPY=y
diff --git a/arch/arm/configs/orion_defconfig b/arch/arm/configs/orion5x_defconfig
index 1e5aaa645fcd..52cd99bd52fb 100644
--- a/arch/arm/configs/orion_defconfig
+++ b/arch/arm/configs/orion5x_defconfig
@@ -140,7 +140,7 @@ CONFIG_CLASSIC_RCU=y
140# CONFIG_ARCH_KS8695 is not set 140# CONFIG_ARCH_KS8695 is not set
141# CONFIG_ARCH_NS9XXX is not set 141# CONFIG_ARCH_NS9XXX is not set
142# CONFIG_ARCH_MXC is not set 142# CONFIG_ARCH_MXC is not set
143CONFIG_ARCH_ORION=y 143CONFIG_ARCH_ORION5X=y
144# CONFIG_ARCH_PNX4008 is not set 144# CONFIG_ARCH_PNX4008 is not set
145# CONFIG_ARCH_PXA is not set 145# CONFIG_ARCH_PXA is not set
146# CONFIG_ARCH_RPC is not set 146# CONFIG_ARCH_RPC is not set
diff --git a/arch/arm/configs/tct_hammer_defconfig b/arch/arm/configs/tct_hammer_defconfig
new file mode 100644
index 000000000000..576b8339f0d6
--- /dev/null
+++ b/arch/arm/configs/tct_hammer_defconfig
@@ -0,0 +1,886 @@
1#
2# Automatically generated make config: don't edit
3# Linux kernel version: 2.6.25-rc7-hammer
4# Thu Mar 27 16:39:48 2008
5#
6CONFIG_ARM=y
7CONFIG_SYS_SUPPORTS_APM_EMULATION=y
8CONFIG_GENERIC_GPIO=y
9# CONFIG_GENERIC_TIME is not set
10# CONFIG_GENERIC_CLOCKEVENTS is not set
11CONFIG_MMU=y
12CONFIG_NO_IOPORT=y
13CONFIG_GENERIC_HARDIRQS=y
14CONFIG_STACKTRACE_SUPPORT=y
15CONFIG_LOCKDEP_SUPPORT=y
16CONFIG_TRACE_IRQFLAGS_SUPPORT=y
17CONFIG_HARDIRQS_SW_RESEND=y
18CONFIG_GENERIC_IRQ_PROBE=y
19CONFIG_RWSEM_GENERIC_SPINLOCK=y
20# CONFIG_ARCH_HAS_ILOG2_U32 is not set
21# CONFIG_ARCH_HAS_ILOG2_U64 is not set
22CONFIG_GENERIC_HWEIGHT=y
23CONFIG_GENERIC_CALIBRATE_DELAY=y
24CONFIG_ARCH_SUPPORTS_AOUT=y
25CONFIG_ZONE_DMA=y
26CONFIG_VECTORS_BASE=0xffff0000
27CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
28
29#
30# General setup
31#
32CONFIG_EXPERIMENTAL=y
33CONFIG_BROKEN_ON_SMP=y
34CONFIG_INIT_ENV_ARG_LIMIT=32
35CONFIG_LOCALVERSION=""
36# CONFIG_LOCALVERSION_AUTO is not set
37# CONFIG_SWAP is not set
38CONFIG_SYSVIPC=y
39CONFIG_SYSVIPC_SYSCTL=y
40# CONFIG_POSIX_MQUEUE is not set
41# CONFIG_BSD_PROCESS_ACCT is not set
42# CONFIG_TASKSTATS is not set
43# CONFIG_AUDIT is not set
44# CONFIG_IKCONFIG is not set
45CONFIG_LOG_BUF_SHIFT=14
46# CONFIG_CGROUPS is not set
47CONFIG_GROUP_SCHED=y
48CONFIG_FAIR_GROUP_SCHED=y
49# CONFIG_RT_GROUP_SCHED is not set
50CONFIG_USER_SCHED=y
51# CONFIG_CGROUP_SCHED is not set
52CONFIG_SYSFS_DEPRECATED=y
53CONFIG_SYSFS_DEPRECATED_V2=y
54# CONFIG_RELAY is not set
55# CONFIG_NAMESPACES is not set
56CONFIG_BLK_DEV_INITRD=y
57CONFIG_INITRAMFS_SOURCE=""
58CONFIG_CC_OPTIMIZE_FOR_SIZE=y
59CONFIG_SYSCTL=y
60CONFIG_EMBEDDED=y
61CONFIG_UID16=y
62CONFIG_SYSCTL_SYSCALL=y
63# CONFIG_KALLSYMS is not set
64CONFIG_HOTPLUG=y
65CONFIG_PRINTK=y
66# CONFIG_BUG is not set
67# CONFIG_ELF_CORE is not set
68CONFIG_COMPAT_BRK=y
69CONFIG_BASE_FULL=y
70CONFIG_FUTEX=y
71CONFIG_ANON_INODES=y
72CONFIG_EPOLL=y
73CONFIG_SIGNALFD=y
74CONFIG_TIMERFD=y
75CONFIG_EVENTFD=y
76# CONFIG_SHMEM is not set
77CONFIG_VM_EVENT_COUNTERS=y
78# CONFIG_SLAB is not set
79# CONFIG_SLUB is not set
80CONFIG_SLOB=y
81# CONFIG_PROFILING is not set
82# CONFIG_MARKERS is not set
83CONFIG_HAVE_OPROFILE=y
84CONFIG_HAVE_KPROBES=y
85CONFIG_HAVE_KRETPROBES=y
86CONFIG_PROC_PAGE_MONITOR=y
87CONFIG_RT_MUTEXES=y
88CONFIG_TINY_SHMEM=y
89CONFIG_BASE_SMALL=0
90CONFIG_MODULES=y
91CONFIG_MODULE_UNLOAD=y
92# CONFIG_MODULE_FORCE_UNLOAD is not set
93# CONFIG_MODVERSIONS is not set
94# CONFIG_MODULE_SRCVERSION_ALL is not set
95# CONFIG_KMOD is not set
96CONFIG_BLOCK=y
97# CONFIG_LBD is not set
98# CONFIG_BLK_DEV_IO_TRACE is not set
99# CONFIG_LSF is not set
100# CONFIG_BLK_DEV_BSG is not set
101
102#
103# IO Schedulers
104#
105CONFIG_IOSCHED_NOOP=y
106CONFIG_IOSCHED_AS=y
107CONFIG_IOSCHED_DEADLINE=y
108CONFIG_IOSCHED_CFQ=y
109CONFIG_DEFAULT_AS=y
110# CONFIG_DEFAULT_DEADLINE is not set
111# CONFIG_DEFAULT_CFQ is not set
112# CONFIG_DEFAULT_NOOP is not set
113CONFIG_DEFAULT_IOSCHED="anticipatory"
114CONFIG_CLASSIC_RCU=y
115
116#
117# System Type
118#
119# CONFIG_ARCH_AAEC2000 is not set
120# CONFIG_ARCH_INTEGRATOR is not set
121# CONFIG_ARCH_REALVIEW is not set
122# CONFIG_ARCH_VERSATILE is not set
123# CONFIG_ARCH_AT91 is not set
124# CONFIG_ARCH_CLPS7500 is not set
125# CONFIG_ARCH_CLPS711X is not set
126# CONFIG_ARCH_CO285 is not set
127# CONFIG_ARCH_EBSA110 is not set
128# CONFIG_ARCH_EP93XX is not set
129# CONFIG_ARCH_FOOTBRIDGE is not set
130# CONFIG_ARCH_NETX is not set
131# CONFIG_ARCH_H720X is not set
132# CONFIG_ARCH_IMX is not set
133# CONFIG_ARCH_IOP13XX is not set
134# CONFIG_ARCH_IOP32X is not set
135# CONFIG_ARCH_IOP33X is not set
136# CONFIG_ARCH_IXP23XX is not set
137# CONFIG_ARCH_IXP2000 is not set
138# CONFIG_ARCH_IXP4XX is not set
139# CONFIG_ARCH_L7200 is not set
140# CONFIG_ARCH_KS8695 is not set
141# CONFIG_ARCH_NS9XXX is not set
142# CONFIG_ARCH_MXC is not set
143# CONFIG_ARCH_ORION is not set
144# CONFIG_ARCH_PNX4008 is not set
145# CONFIG_ARCH_PXA is not set
146# CONFIG_ARCH_RPC is not set
147# CONFIG_ARCH_SA1100 is not set
148CONFIG_ARCH_S3C2410=y
149# CONFIG_ARCH_SHARK is not set
150# CONFIG_ARCH_LH7A40X is not set
151# CONFIG_ARCH_DAVINCI is not set
152# CONFIG_ARCH_OMAP is not set
153# CONFIG_ARCH_MSM7X00A is not set
154CONFIG_PLAT_S3C24XX=y
155# CONFIG_S3C2410_DMA is not set
156CONFIG_PLAT_S3C=y
157CONFIG_CPU_LLSERIAL_S3C2410_ONLY=y
158CONFIG_CPU_LLSERIAL_S3C2410=y
159
160#
161# Boot options
162#
163# CONFIG_S3C_BOOT_ERROR_RESET is not set
164
165#
166# Power management
167#
168CONFIG_S3C_LOWLEVEL_UART_PORT=0
169
170#
171# S3C2400 Machines
172#
173CONFIG_CPU_S3C2410=y
174CONFIG_S3C2410_GPIO=y
175CONFIG_S3C2410_CLOCK=y
176
177#
178# S3C2410 Machines
179#
180# CONFIG_ARCH_SMDK2410 is not set
181# CONFIG_ARCH_H1940 is not set
182# CONFIG_MACH_N30 is not set
183# CONFIG_ARCH_BAST is not set
184# CONFIG_MACH_OTOM is not set
185# CONFIG_MACH_AML_M5900 is not set
186CONFIG_MACH_TCT_HAMMER=y
187# CONFIG_MACH_VR1000 is not set
188# CONFIG_MACH_QT2410 is not set
189
190#
191# S3C2412 Machines
192#
193# CONFIG_MACH_SMDK2413 is not set
194# CONFIG_MACH_SMDK2412 is not set
195# CONFIG_MACH_VSTMS is not set
196
197#
198# S3C2440 Machines
199#
200# CONFIG_MACH_ANUBIS is not set
201# CONFIG_MACH_OSIRIS is not set
202# CONFIG_MACH_RX3715 is not set
203# CONFIG_ARCH_S3C2440 is not set
204# CONFIG_MACH_NEXCODER_2440 is not set
205
206#
207# S3C2442 Machines
208#
209
210#
211# S3C2443 Machines
212#
213# CONFIG_MACH_SMDK2443 is not set
214
215#
216# Processor Type
217#
218CONFIG_CPU_32=y
219CONFIG_CPU_ARM920T=y
220CONFIG_CPU_32v4T=y
221CONFIG_CPU_ABRT_EV4T=y
222CONFIG_CPU_CACHE_V4WT=y
223CONFIG_CPU_CACHE_VIVT=y
224CONFIG_CPU_COPY_V4WB=y
225CONFIG_CPU_TLB_V4WBI=y
226CONFIG_CPU_CP15=y
227CONFIG_CPU_CP15_MMU=y
228
229#
230# Processor Features
231#
232CONFIG_ARM_THUMB=y
233# CONFIG_CPU_ICACHE_DISABLE is not set
234# CONFIG_CPU_DCACHE_DISABLE is not set
235# CONFIG_CPU_DCACHE_WRITETHROUGH is not set
236# CONFIG_OUTER_CACHE is not set
237
238#
239# Bus support
240#
241# CONFIG_PCI_SYSCALL is not set
242# CONFIG_ARCH_SUPPORTS_MSI is not set
243# CONFIG_PCCARD is not set
244
245#
246# Kernel Features
247#
248# CONFIG_TICK_ONESHOT is not set
249# CONFIG_PREEMPT is not set
250# CONFIG_NO_IDLE_HZ is not set
251CONFIG_HZ=200
252# CONFIG_AEABI is not set
253# CONFIG_ARCH_DISCONTIGMEM_ENABLE is not set
254CONFIG_SELECT_MEMORY_MODEL=y
255CONFIG_FLATMEM_MANUAL=y
256# CONFIG_DISCONTIGMEM_MANUAL is not set
257# CONFIG_SPARSEMEM_MANUAL is not set
258CONFIG_FLATMEM=y
259CONFIG_FLAT_NODE_MEM_MAP=y
260# CONFIG_SPARSEMEM_STATIC is not set
261# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set
262CONFIG_SPLIT_PTLOCK_CPUS=4096
263# CONFIG_RESOURCES_64BIT is not set
264CONFIG_ZONE_DMA_FLAG=1
265CONFIG_BOUNCE=y
266CONFIG_VIRT_TO_BUS=y
267CONFIG_ALIGNMENT_TRAP=y
268
269#
270# Boot options
271#
272CONFIG_ZBOOT_ROM_TEXT=0x0
273CONFIG_ZBOOT_ROM_BSS=0x0
274CONFIG_CMDLINE="mem=64M root=/dev/ram0 init=/linuxrc rw"
275# CONFIG_XIP_KERNEL is not set
276# CONFIG_KEXEC is not set
277
278#
279# Floating point emulation
280#
281
282#
283# At least one emulation must be selected
284#
285CONFIG_FPE_NWFPE=y
286# CONFIG_FPE_NWFPE_XP is not set
287# CONFIG_FPE_FASTFPE is not set
288
289#
290# Userspace binary formats
291#
292CONFIG_BINFMT_ELF=y
293# CONFIG_BINFMT_AOUT is not set
294# CONFIG_BINFMT_MISC is not set
295# CONFIG_ARTHUR is not set
296
297#
298# Power management options
299#
300# CONFIG_PM is not set
301CONFIG_ARCH_SUSPEND_POSSIBLE=y
302
303#
304# Networking
305#
306CONFIG_NET=y
307
308#
309# Networking options
310#
311CONFIG_PACKET=y
312# CONFIG_PACKET_MMAP is not set
313CONFIG_UNIX=y
314# CONFIG_NET_KEY is not set
315# CONFIG_INET is not set
316# CONFIG_NETWORK_SECMARK is not set
317# CONFIG_NETFILTER is not set
318# CONFIG_ATM is not set
319# CONFIG_BRIDGE is not set
320# CONFIG_VLAN_8021Q is not set
321# CONFIG_DECNET is not set
322# CONFIG_LLC2 is not set
323# CONFIG_IPX is not set
324# CONFIG_ATALK is not set
325# CONFIG_X25 is not set
326# CONFIG_LAPB is not set
327# CONFIG_WAN_ROUTER is not set
328# CONFIG_NET_SCHED is not set
329
330#
331# Network testing
332#
333# CONFIG_NET_PKTGEN is not set
334# CONFIG_HAMRADIO is not set
335# CONFIG_CAN is not set
336# CONFIG_IRDA is not set
337# CONFIG_BT is not set
338
339#
340# Wireless
341#
342# CONFIG_CFG80211 is not set
343# CONFIG_WIRELESS_EXT is not set
344# CONFIG_MAC80211 is not set
345# CONFIG_IEEE80211 is not set
346# CONFIG_RFKILL is not set
347# CONFIG_NET_9P is not set
348
349#
350# Device Drivers
351#
352
353#
354# Generic Driver Options
355#
356CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
357CONFIG_STANDALONE=y
358# CONFIG_PREVENT_FIRMWARE_BUILD is not set
359CONFIG_FW_LOADER=y
360# CONFIG_DEBUG_DRIVER is not set
361# CONFIG_DEBUG_DEVRES is not set
362# CONFIG_SYS_HYPERVISOR is not set
363# CONFIG_CONNECTOR is not set
364CONFIG_MTD=y
365# CONFIG_MTD_DEBUG is not set
366# CONFIG_MTD_CONCAT is not set
367CONFIG_MTD_PARTITIONS=y
368# CONFIG_MTD_REDBOOT_PARTS is not set
369# CONFIG_MTD_CMDLINE_PARTS is not set
370# CONFIG_MTD_AFS_PARTS is not set
371
372#
373# User Modules And Translation Layers
374#
375CONFIG_MTD_CHAR=y
376CONFIG_MTD_BLKDEVS=y
377CONFIG_MTD_BLOCK=y
378# CONFIG_FTL is not set
379# CONFIG_NFTL is not set
380# CONFIG_INFTL is not set
381# CONFIG_RFD_FTL is not set
382# CONFIG_SSFDC is not set
383# CONFIG_MTD_OOPS is not set
384
385#
386# RAM/ROM/Flash chip drivers
387#
388CONFIG_MTD_CFI=y
389# CONFIG_MTD_JEDECPROBE is not set
390CONFIG_MTD_GEN_PROBE=y
391CONFIG_MTD_CFI_ADV_OPTIONS=y
392CONFIG_MTD_CFI_NOSWAP=y
393# CONFIG_MTD_CFI_BE_BYTE_SWAP is not set
394# CONFIG_MTD_CFI_LE_BYTE_SWAP is not set
395CONFIG_MTD_CFI_GEOMETRY=y
396CONFIG_MTD_MAP_BANK_WIDTH_1=y
397CONFIG_MTD_MAP_BANK_WIDTH_2=y
398CONFIG_MTD_MAP_BANK_WIDTH_4=y
399# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set
400# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set
401# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set
402CONFIG_MTD_CFI_I1=y
403CONFIG_MTD_CFI_I2=y
404# CONFIG_MTD_CFI_I4 is not set
405# CONFIG_MTD_CFI_I8 is not set
406# CONFIG_MTD_OTP is not set
407CONFIG_MTD_CFI_INTELEXT=y
408# CONFIG_MTD_CFI_AMDSTD is not set
409# CONFIG_MTD_CFI_STAA is not set
410CONFIG_MTD_CFI_UTIL=y
411# CONFIG_MTD_RAM is not set
412# CONFIG_MTD_ROM is not set
413# CONFIG_MTD_ABSENT is not set
414
415#
416# Mapping drivers for chip access
417#
418# CONFIG_MTD_COMPLEX_MAPPINGS is not set
419CONFIG_MTD_PHYSMAP=y
420CONFIG_MTD_PHYSMAP_START=0x00000000
421CONFIG_MTD_PHYSMAP_LEN=0x0
422CONFIG_MTD_PHYSMAP_BANKWIDTH=2
423# CONFIG_MTD_ARM_INTEGRATOR is not set
424# CONFIG_MTD_PLATRAM is not set
425
426#
427# Self-contained MTD device drivers
428#
429# CONFIG_MTD_SLRAM is not set
430# CONFIG_MTD_PHRAM is not set
431# CONFIG_MTD_MTDRAM is not set
432# CONFIG_MTD_BLOCK2MTD is not set
433
434#
435# Disk-On-Chip Device Drivers
436#
437# CONFIG_MTD_DOC2000 is not set
438# CONFIG_MTD_DOC2001 is not set
439# CONFIG_MTD_DOC2001PLUS is not set
440# CONFIG_MTD_NAND is not set
441# CONFIG_MTD_ONENAND is not set
442
443#
444# UBI - Unsorted block images
445#
446# CONFIG_MTD_UBI is not set
447# CONFIG_PARPORT is not set
448CONFIG_BLK_DEV=y
449# CONFIG_BLK_DEV_COW_COMMON is not set
450# CONFIG_BLK_DEV_LOOP is not set
451# CONFIG_BLK_DEV_NBD is not set
452# CONFIG_BLK_DEV_UB is not set
453CONFIG_BLK_DEV_RAM=y
454CONFIG_BLK_DEV_RAM_COUNT=16
455CONFIG_BLK_DEV_RAM_SIZE=10240
456# CONFIG_BLK_DEV_XIP is not set
457# CONFIG_CDROM_PKTCDVD is not set
458# CONFIG_ATA_OVER_ETH is not set
459# CONFIG_MISC_DEVICES is not set
460CONFIG_HAVE_IDE=y
461# CONFIG_IDE is not set
462
463#
464# SCSI device support
465#
466# CONFIG_RAID_ATTRS is not set
467# CONFIG_SCSI is not set
468# CONFIG_SCSI_DMA is not set
469# CONFIG_SCSI_NETLINK is not set
470# CONFIG_ATA is not set
471# CONFIG_MD is not set
472# CONFIG_NETDEVICES is not set
473# CONFIG_ISDN is not set
474
475#
476# Input device support
477#
478CONFIG_INPUT=y
479# CONFIG_INPUT_FF_MEMLESS is not set
480# CONFIG_INPUT_POLLDEV is not set
481
482#
483# Userland interfaces
484#
485# CONFIG_INPUT_MOUSEDEV is not set
486# CONFIG_INPUT_JOYDEV is not set
487# CONFIG_INPUT_EVDEV is not set
488# CONFIG_INPUT_EVBUG is not set
489
490#
491# Input Device Drivers
492#
493# CONFIG_INPUT_KEYBOARD is not set
494# CONFIG_INPUT_MOUSE is not set
495# CONFIG_INPUT_JOYSTICK is not set
496# CONFIG_INPUT_TABLET is not set
497# CONFIG_INPUT_TOUCHSCREEN is not set
498# CONFIG_INPUT_MISC is not set
499
500#
501# Hardware I/O ports
502#
503# CONFIG_SERIO is not set
504# CONFIG_GAMEPORT is not set
505
506#
507# Character devices
508#
509CONFIG_VT=y
510# CONFIG_VT_CONSOLE is not set
511CONFIG_HW_CONSOLE=y
512# CONFIG_VT_HW_CONSOLE_BINDING is not set
513# CONFIG_SERIAL_NONSTANDARD is not set
514
515#
516# Serial drivers
517#
518# CONFIG_SERIAL_8250 is not set
519
520#
521# Non-8250 serial port support
522#
523CONFIG_SERIAL_S3C2410=y
524CONFIG_SERIAL_S3C2410_CONSOLE=y
525CONFIG_SERIAL_CORE=y
526CONFIG_SERIAL_CORE_CONSOLE=y
527CONFIG_UNIX98_PTYS=y
528CONFIG_LEGACY_PTYS=y
529CONFIG_LEGACY_PTY_COUNT=256
530# CONFIG_IPMI_HANDLER is not set
531# CONFIG_HW_RANDOM is not set
532# CONFIG_NVRAM is not set
533# CONFIG_R3964 is not set
534# CONFIG_RAW_DRIVER is not set
535# CONFIG_TCG_TPM is not set
536# CONFIG_I2C is not set
537
538#
539# SPI support
540#
541# CONFIG_SPI is not set
542# CONFIG_SPI_MASTER is not set
543# CONFIG_W1 is not set
544# CONFIG_POWER_SUPPLY is not set
545# CONFIG_HWMON is not set
546# CONFIG_WATCHDOG is not set
547
548#
549# Sonics Silicon Backplane
550#
551CONFIG_SSB_POSSIBLE=y
552# CONFIG_SSB is not set
553
554#
555# Multifunction device drivers
556#
557# CONFIG_MFD_SM501 is not set
558# CONFIG_MFD_ASIC3 is not set
559
560#
561# Multimedia devices
562#
563# CONFIG_VIDEO_DEV is not set
564# CONFIG_DAB is not set
565
566#
567# Graphics support
568#
569# CONFIG_VGASTATE is not set
570# CONFIG_VIDEO_OUTPUT_CONTROL is not set
571# CONFIG_FB is not set
572# CONFIG_BACKLIGHT_LCD_SUPPORT is not set
573
574#
575# Display device support
576#
577# CONFIG_DISPLAY_SUPPORT is not set
578
579#
580# Console display driver support
581#
582# CONFIG_VGA_CONSOLE is not set
583CONFIG_DUMMY_CONSOLE=y
584
585#
586# Sound
587#
588# CONFIG_SOUND is not set
589# CONFIG_HID_SUPPORT is not set
590CONFIG_USB_SUPPORT=y
591CONFIG_USB_ARCH_HAS_HCD=y
592CONFIG_USB_ARCH_HAS_OHCI=y
593# CONFIG_USB_ARCH_HAS_EHCI is not set
594CONFIG_USB=y
595CONFIG_USB_DEBUG=y
596# CONFIG_USB_ANNOUNCE_NEW_DEVICES is not set
597
598#
599# Miscellaneous USB options
600#
601# CONFIG_USB_DEVICEFS is not set
602# CONFIG_USB_DEVICE_CLASS is not set
603# CONFIG_USB_DYNAMIC_MINORS is not set
604# CONFIG_USB_OTG is not set
605
606#
607# USB Host Controller Drivers
608#
609# CONFIG_USB_ISP116X_HCD is not set
610CONFIG_USB_OHCI_HCD=y
611# CONFIG_USB_OHCI_BIG_ENDIAN_DESC is not set
612# CONFIG_USB_OHCI_BIG_ENDIAN_MMIO is not set
613CONFIG_USB_OHCI_LITTLE_ENDIAN=y
614# CONFIG_USB_SL811_HCD is not set
615# CONFIG_USB_R8A66597_HCD is not set
616
617#
618# USB Device Class drivers
619#
620# CONFIG_USB_ACM is not set
621# CONFIG_USB_PRINTER is not set
622
623#
624# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support'
625#
626
627#
628# may also be needed; see USB_STORAGE Help for more information
629#
630# CONFIG_USB_LIBUSUAL is not set
631
632#
633# USB Imaging devices
634#
635# CONFIG_USB_MDC800 is not set
636CONFIG_USB_MON=y
637
638#
639# USB port drivers
640#
641# CONFIG_USB_SERIAL is not set
642
643#
644# USB Miscellaneous drivers
645#
646# CONFIG_USB_EMI62 is not set
647# CONFIG_USB_EMI26 is not set
648# CONFIG_USB_ADUTUX is not set
649# CONFIG_USB_AUERSWALD is not set
650# CONFIG_USB_RIO500 is not set
651# CONFIG_USB_LEGOTOWER is not set
652# CONFIG_USB_LCD is not set
653# CONFIG_USB_BERRY_CHARGE is not set
654# CONFIG_USB_LED is not set
655# CONFIG_USB_CYPRESS_CY7C63 is not set
656# CONFIG_USB_CYTHERM is not set
657# CONFIG_USB_PHIDGET is not set
658# CONFIG_USB_IDMOUSE is not set
659# CONFIG_USB_FTDI_ELAN is not set
660# CONFIG_USB_APPLEDISPLAY is not set
661# CONFIG_USB_LD is not set
662# CONFIG_USB_TRANCEVIBRATOR is not set
663# CONFIG_USB_IOWARRIOR is not set
664CONFIG_USB_GADGET=y
665# CONFIG_USB_GADGET_DEBUG is not set
666# CONFIG_USB_GADGET_DEBUG_FILES is not set
667CONFIG_USB_GADGET_SELECTED=y
668# CONFIG_USB_GADGET_AMD5536UDC is not set
669# CONFIG_USB_GADGET_ATMEL_USBA is not set
670# CONFIG_USB_GADGET_FSL_USB2 is not set
671# CONFIG_USB_GADGET_NET2280 is not set
672# CONFIG_USB_GADGET_PXA2XX is not set
673# CONFIG_USB_GADGET_M66592 is not set
674# CONFIG_USB_GADGET_GOKU is not set
675# CONFIG_USB_GADGET_LH7A40X is not set
676# CONFIG_USB_GADGET_OMAP is not set
677CONFIG_USB_GADGET_S3C2410=y
678CONFIG_USB_S3C2410=y
679# CONFIG_USB_S3C2410_DEBUG is not set
680# CONFIG_USB_GADGET_AT91 is not set
681# CONFIG_USB_GADGET_DUMMY_HCD is not set
682# CONFIG_USB_GADGET_DUALSPEED is not set
683# CONFIG_USB_ZERO is not set
684CONFIG_USB_ETH=y
685CONFIG_USB_ETH_RNDIS=y
686# CONFIG_USB_GADGETFS is not set
687# CONFIG_USB_FILE_STORAGE is not set
688# CONFIG_USB_G_SERIAL is not set
689# CONFIG_USB_MIDI_GADGET is not set
690# CONFIG_USB_G_PRINTER is not set
691# CONFIG_MMC is not set
692# CONFIG_NEW_LEDS is not set
693CONFIG_RTC_LIB=y
694# CONFIG_RTC_CLASS is not set
695
696#
697# File systems
698#
699CONFIG_EXT2_FS=y
700# CONFIG_EXT2_FS_XATTR is not set
701# CONFIG_EXT2_FS_XIP is not set
702# CONFIG_EXT3_FS is not set
703# CONFIG_EXT4DEV_FS is not set
704# CONFIG_REISERFS_FS is not set
705# CONFIG_JFS_FS is not set
706# CONFIG_FS_POSIX_ACL is not set
707# CONFIG_XFS_FS is not set
708# CONFIG_GFS2_FS is not set
709# CONFIG_OCFS2_FS is not set
710# CONFIG_DNOTIFY is not set
711# CONFIG_INOTIFY is not set
712# CONFIG_QUOTA is not set
713# CONFIG_AUTOFS_FS is not set
714# CONFIG_AUTOFS4_FS is not set
715# CONFIG_FUSE_FS is not set
716
717#
718# CD-ROM/DVD Filesystems
719#
720# CONFIG_ISO9660_FS is not set
721# CONFIG_UDF_FS is not set
722
723#
724# DOS/FAT/NT Filesystems
725#
726CONFIG_FAT_FS=y
727CONFIG_MSDOS_FS=y
728CONFIG_VFAT_FS=y
729CONFIG_FAT_DEFAULT_CODEPAGE=437
730CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1"
731# CONFIG_NTFS_FS is not set
732
733#
734# Pseudo filesystems
735#
736CONFIG_PROC_FS=y
737# CONFIG_PROC_SYSCTL is not set
738CONFIG_SYSFS=y
739# CONFIG_TMPFS is not set
740# CONFIG_HUGETLB_PAGE is not set
741# CONFIG_CONFIGFS_FS is not set
742
743#
744# Miscellaneous filesystems
745#
746# CONFIG_ADFS_FS is not set
747# CONFIG_AFFS_FS is not set
748# CONFIG_HFS_FS is not set
749# CONFIG_HFSPLUS_FS is not set
750# CONFIG_BEFS_FS is not set
751# CONFIG_BFS_FS is not set
752# CONFIG_EFS_FS is not set
753CONFIG_JFFS2_FS=y
754CONFIG_JFFS2_FS_DEBUG=0
755CONFIG_JFFS2_FS_WRITEBUFFER=y
756# CONFIG_JFFS2_FS_WBUF_VERIFY is not set
757# CONFIG_JFFS2_SUMMARY is not set
758# CONFIG_JFFS2_FS_XATTR is not set
759# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set
760CONFIG_JFFS2_ZLIB=y
761# CONFIG_JFFS2_LZO is not set
762CONFIG_JFFS2_RTIME=y
763# CONFIG_JFFS2_RUBIN is not set
764# CONFIG_CRAMFS is not set
765# CONFIG_VXFS_FS is not set
766# CONFIG_MINIX_FS is not set
767# CONFIG_HPFS_FS is not set
768# CONFIG_QNX4FS_FS is not set
769# CONFIG_ROMFS_FS is not set
770# CONFIG_SYSV_FS is not set
771# CONFIG_UFS_FS is not set
772CONFIG_NETWORK_FILESYSTEMS=y
773
774#
775# Partition Types
776#
777# CONFIG_PARTITION_ADVANCED is not set
778CONFIG_MSDOS_PARTITION=y
779CONFIG_NLS=y
780CONFIG_NLS_DEFAULT="iso8859-1"
781CONFIG_NLS_CODEPAGE_437=y
782# CONFIG_NLS_CODEPAGE_737 is not set
783# CONFIG_NLS_CODEPAGE_775 is not set
784# CONFIG_NLS_CODEPAGE_850 is not set
785# CONFIG_NLS_CODEPAGE_852 is not set
786# CONFIG_NLS_CODEPAGE_855 is not set
787# CONFIG_NLS_CODEPAGE_857 is not set
788# CONFIG_NLS_CODEPAGE_860 is not set
789# CONFIG_NLS_CODEPAGE_861 is not set
790# CONFIG_NLS_CODEPAGE_862 is not set
791# CONFIG_NLS_CODEPAGE_863 is not set
792# CONFIG_NLS_CODEPAGE_864 is not set
793# CONFIG_NLS_CODEPAGE_865 is not set
794# CONFIG_NLS_CODEPAGE_866 is not set
795# CONFIG_NLS_CODEPAGE_869 is not set
796# CONFIG_NLS_CODEPAGE_936 is not set
797# CONFIG_NLS_CODEPAGE_950 is not set
798# CONFIG_NLS_CODEPAGE_932 is not set
799# CONFIG_NLS_CODEPAGE_949 is not set
800# CONFIG_NLS_CODEPAGE_874 is not set
801# CONFIG_NLS_ISO8859_8 is not set
802# CONFIG_NLS_CODEPAGE_1250 is not set
803# CONFIG_NLS_CODEPAGE_1251 is not set
804# CONFIG_NLS_ASCII is not set
805CONFIG_NLS_ISO8859_1=y
806# CONFIG_NLS_ISO8859_2 is not set
807# CONFIG_NLS_ISO8859_3 is not set
808# CONFIG_NLS_ISO8859_4 is not set
809# CONFIG_NLS_ISO8859_5 is not set
810# CONFIG_NLS_ISO8859_6 is not set
811# CONFIG_NLS_ISO8859_7 is not set
812# CONFIG_NLS_ISO8859_9 is not set
813# CONFIG_NLS_ISO8859_13 is not set
814# CONFIG_NLS_ISO8859_14 is not set
815# CONFIG_NLS_ISO8859_15 is not set
816# CONFIG_NLS_KOI8_R is not set
817# CONFIG_NLS_KOI8_U is not set
818# CONFIG_NLS_UTF8 is not set
819
820#
821# Kernel hacking
822#
823# CONFIG_PRINTK_TIME is not set
824CONFIG_ENABLE_WARN_DEPRECATED=y
825# CONFIG_ENABLE_MUST_CHECK is not set
826# CONFIG_MAGIC_SYSRQ is not set
827# CONFIG_UNUSED_SYMBOLS is not set
828# CONFIG_DEBUG_FS is not set
829# CONFIG_HEADERS_CHECK is not set
830CONFIG_DEBUG_KERNEL=y
831# CONFIG_DEBUG_SHIRQ is not set
832# CONFIG_DETECT_SOFTLOCKUP is not set
833CONFIG_SCHED_DEBUG=y
834# CONFIG_SCHEDSTATS is not set
835# CONFIG_TIMER_STATS is not set
836# CONFIG_DEBUG_RT_MUTEXES is not set
837# CONFIG_RT_MUTEX_TESTER is not set
838# CONFIG_DEBUG_SPINLOCK is not set
839# CONFIG_DEBUG_MUTEXES is not set
840# CONFIG_DEBUG_LOCK_ALLOC is not set
841# CONFIG_PROVE_LOCKING is not set
842# CONFIG_LOCK_STAT is not set
843# CONFIG_DEBUG_SPINLOCK_SLEEP is not set
844# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
845# CONFIG_DEBUG_KOBJECT is not set
846# CONFIG_DEBUG_INFO is not set
847# CONFIG_DEBUG_VM is not set
848# CONFIG_DEBUG_LIST is not set
849# CONFIG_DEBUG_SG is not set
850CONFIG_FRAME_POINTER=y
851# CONFIG_BOOT_PRINTK_DELAY is not set
852# CONFIG_RCU_TORTURE_TEST is not set
853# CONFIG_BACKTRACE_SELF_TEST is not set
854# CONFIG_FAULT_INJECTION is not set
855# CONFIG_SAMPLES is not set
856# CONFIG_DEBUG_USER is not set
857CONFIG_DEBUG_ERRORS=y
858# CONFIG_DEBUG_STACK_USAGE is not set
859CONFIG_DEBUG_LL=y
860# CONFIG_DEBUG_ICEDCC is not set
861# CONFIG_DEBUG_S3C_PORT is not set
862CONFIG_DEBUG_S3C_UART=0
863
864#
865# Security options
866#
867# CONFIG_KEYS is not set
868# CONFIG_SECURITY is not set
869# CONFIG_SECURITY_FILE_CAPABILITIES is not set
870# CONFIG_CRYPTO is not set
871
872#
873# Library routines
874#
875CONFIG_BITREVERSE=y
876CONFIG_CRC_CCITT=y
877# CONFIG_CRC16 is not set
878# CONFIG_CRC_ITU_T is not set
879CONFIG_CRC32=y
880# CONFIG_CRC7 is not set
881# CONFIG_LIBCRC32C is not set
882CONFIG_ZLIB_INFLATE=y
883CONFIG_ZLIB_DEFLATE=y
884CONFIG_PLIST=y
885CONFIG_HAS_IOMEM=y
886CONFIG_HAS_DMA=y
diff --git a/arch/arm/kernel/Makefile b/arch/arm/kernel/Makefile
index 00d44c6fbfe9..d5be3f7ac0e3 100644
--- a/arch/arm/kernel/Makefile
+++ b/arch/arm/kernel/Makefile
@@ -22,6 +22,7 @@ obj-$(CONFIG_KEXEC) += machine_kexec.o relocate_kernel.o
22obj-$(CONFIG_KPROBES) += kprobes.o kprobes-decode.o 22obj-$(CONFIG_KPROBES) += kprobes.o kprobes-decode.o
23obj-$(CONFIG_ATAGS_PROC) += atags.o 23obj-$(CONFIG_ATAGS_PROC) += atags.o
24obj-$(CONFIG_OABI_COMPAT) += sys_oabi-compat.o 24obj-$(CONFIG_OABI_COMPAT) += sys_oabi-compat.o
25obj-$(CONFIG_ARM_THUMBEE) += thumbee.o
25 26
26obj-$(CONFIG_CRUNCH) += crunch.o crunch-bits.o 27obj-$(CONFIG_CRUNCH) += crunch.o crunch-bits.o
27AFLAGS_crunch-bits.o := -Wa,-mcpu=ep9312 28AFLAGS_crunch-bits.o := -Wa,-mcpu=ep9312
diff --git a/arch/arm/kernel/asm-offsets.c b/arch/arm/kernel/asm-offsets.c
index 3278e713c32a..0a0d2479274b 100644
--- a/arch/arm/kernel/asm-offsets.c
+++ b/arch/arm/kernel/asm-offsets.c
@@ -58,6 +58,9 @@ int main(void)
58 DEFINE(TI_TP_VALUE, offsetof(struct thread_info, tp_value)); 58 DEFINE(TI_TP_VALUE, offsetof(struct thread_info, tp_value));
59 DEFINE(TI_FPSTATE, offsetof(struct thread_info, fpstate)); 59 DEFINE(TI_FPSTATE, offsetof(struct thread_info, fpstate));
60 DEFINE(TI_VFPSTATE, offsetof(struct thread_info, vfpstate)); 60 DEFINE(TI_VFPSTATE, offsetof(struct thread_info, vfpstate));
61#ifdef CONFIG_ARM_THUMBEE
62 DEFINE(TI_THUMBEE_STATE, offsetof(struct thread_info, thumbee_state));
63#endif
61#ifdef CONFIG_IWMMXT 64#ifdef CONFIG_IWMMXT
62 DEFINE(TI_IWMMXT_STATE, offsetof(struct thread_info, fpstate.iwmmxt)); 65 DEFINE(TI_IWMMXT_STATE, offsetof(struct thread_info, fpstate.iwmmxt));
63#endif 66#endif
@@ -108,5 +111,12 @@ int main(void)
108 DEFINE(PROCINFO_INITFUNC, offsetof(struct proc_info_list, __cpu_flush)); 111 DEFINE(PROCINFO_INITFUNC, offsetof(struct proc_info_list, __cpu_flush));
109 DEFINE(PROCINFO_MM_MMUFLAGS, offsetof(struct proc_info_list, __cpu_mm_mmu_flags)); 112 DEFINE(PROCINFO_MM_MMUFLAGS, offsetof(struct proc_info_list, __cpu_mm_mmu_flags));
110 DEFINE(PROCINFO_IO_MMUFLAGS, offsetof(struct proc_info_list, __cpu_io_mmu_flags)); 113 DEFINE(PROCINFO_IO_MMUFLAGS, offsetof(struct proc_info_list, __cpu_io_mmu_flags));
114 BLANK();
115#ifdef MULTI_DABORT
116 DEFINE(PROCESSOR_DABT_FUNC, offsetof(struct processor, _data_abort));
117#endif
118#ifdef MULTI_PABORT
119 DEFINE(PROCESSOR_PABT_FUNC, offsetof(struct processor, _prefetch_abort));
120#endif
111 return 0; 121 return 0;
112} 122}
diff --git a/arch/arm/kernel/calls.S b/arch/arm/kernel/calls.S
index 283e14fff993..95f1c121cb30 100644
--- a/arch/arm/kernel/calls.S
+++ b/arch/arm/kernel/calls.S
@@ -359,9 +359,11 @@
359 CALL(sys_kexec_load) 359 CALL(sys_kexec_load)
360 CALL(sys_utimensat) 360 CALL(sys_utimensat)
361 CALL(sys_signalfd) 361 CALL(sys_signalfd)
362/* 350 */ CALL(sys_ni_syscall) 362/* 350 */ CALL(sys_timerfd_create)
363 CALL(sys_eventfd) 363 CALL(sys_eventfd)
364 CALL(sys_fallocate) 364 CALL(sys_fallocate)
365 CALL(sys_timerfd_settime)
366 CALL(sys_timerfd_gettime)
365#ifndef syscalls_counted 367#ifndef syscalls_counted
366.equ syscalls_padding, ((NR_syscalls + 3) & ~3) - NR_syscalls 368.equ syscalls_padding, ((NR_syscalls + 3) & ~3) - NR_syscalls
367#define syscalls_counted 369#define syscalls_counted
diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S
index a46d5b456765..7dca225752c1 100644
--- a/arch/arm/kernel/entry-armv.S
+++ b/arch/arm/kernel/entry-armv.S
@@ -166,12 +166,12 @@ __dabt_svc:
166 @ The abort handler must return the aborted address in r0, and 166 @ The abort handler must return the aborted address in r0, and
167 @ the fault status register in r1. r9 must be preserved. 167 @ the fault status register in r1. r9 must be preserved.
168 @ 168 @
169#ifdef MULTI_ABORT 169#ifdef MULTI_DABORT
170 ldr r4, .LCprocfns 170 ldr r4, .LCprocfns
171 mov lr, pc 171 mov lr, pc
172 ldr pc, [r4] 172 ldr pc, [r4, #PROCESSOR_DABT_FUNC]
173#else 173#else
174 bl CPU_ABORT_HANDLER 174 bl CPU_DABORT_HANDLER
175#endif 175#endif
176 176
177 @ 177 @
@@ -209,14 +209,12 @@ __irq_svc:
209 209
210 irq_handler 210 irq_handler
211#ifdef CONFIG_PREEMPT 211#ifdef CONFIG_PREEMPT
212 str r8, [tsk, #TI_PREEMPT] @ restore preempt count
212 ldr r0, [tsk, #TI_FLAGS] @ get flags 213 ldr r0, [tsk, #TI_FLAGS] @ get flags
214 teq r8, #0 @ if preempt count != 0
215 movne r0, #0 @ force flags to 0
213 tst r0, #_TIF_NEED_RESCHED 216 tst r0, #_TIF_NEED_RESCHED
214 blne svc_preempt 217 blne svc_preempt
215preempt_return:
216 ldr r0, [tsk, #TI_PREEMPT] @ read preempt value
217 str r8, [tsk, #TI_PREEMPT] @ restore preempt count
218 teq r0, r7
219 strne r0, [r0, -r0] @ bug()
220#endif 218#endif
221 ldr r0, [sp, #S_PSR] @ irqs are already disabled 219 ldr r0, [sp, #S_PSR] @ irqs are already disabled
222 msr spsr_cxsf, r0 220 msr spsr_cxsf, r0
@@ -230,19 +228,11 @@ preempt_return:
230 228
231#ifdef CONFIG_PREEMPT 229#ifdef CONFIG_PREEMPT
232svc_preempt: 230svc_preempt:
233 teq r8, #0 @ was preempt count = 0 231 mov r8, lr
234 ldreq r6, .LCirq_stat
235 movne pc, lr @ no
236 ldr r0, [r6, #4] @ local_irq_count
237 ldr r1, [r6, #8] @ local_bh_count
238 adds r0, r0, r1
239 movne pc, lr
240 mov r7, #0 @ preempt_schedule_irq
241 str r7, [tsk, #TI_PREEMPT] @ expects preempt_count == 0
2421: bl preempt_schedule_irq @ irq en/disable is done inside 2321: bl preempt_schedule_irq @ irq en/disable is done inside
243 ldr r0, [tsk, #TI_FLAGS] @ get new tasks TI_FLAGS 233 ldr r0, [tsk, #TI_FLAGS] @ get new tasks TI_FLAGS
244 tst r0, #_TIF_NEED_RESCHED 234 tst r0, #_TIF_NEED_RESCHED
245 beq preempt_return @ go again 235 moveq pc, r8 @ go again
246 b 1b 236 b 1b
247#endif 237#endif
248 238
@@ -293,7 +283,6 @@ __pabt_svc:
293 mrs r9, cpsr 283 mrs r9, cpsr
294 tst r3, #PSR_I_BIT 284 tst r3, #PSR_I_BIT
295 biceq r9, r9, #PSR_I_BIT 285 biceq r9, r9, #PSR_I_BIT
296 msr cpsr_c, r9
297 286
298 @ 287 @
299 @ set args, then call main handler 288 @ set args, then call main handler
@@ -301,7 +290,15 @@ __pabt_svc:
301 @ r0 - address of faulting instruction 290 @ r0 - address of faulting instruction
302 @ r1 - pointer to registers on stack 291 @ r1 - pointer to registers on stack
303 @ 292 @
304 mov r0, r2 @ address (pc) 293#ifdef MULTI_PABORT
294 mov r0, r2 @ pass address of aborted instruction.
295 ldr r4, .LCprocfns
296 mov lr, pc
297 ldr pc, [r4, #PROCESSOR_PABT_FUNC]
298#else
299 CPU_PABORT_HANDLER(r0, r2)
300#endif
301 msr cpsr_c, r9 @ Maybe enable interrupts
305 mov r1, sp @ regs 302 mov r1, sp @ regs
306 bl do_PrefetchAbort @ call abort handler 303 bl do_PrefetchAbort @ call abort handler
307 304
@@ -320,16 +317,12 @@ __pabt_svc:
320 .align 5 317 .align 5
321.LCcralign: 318.LCcralign:
322 .word cr_alignment 319 .word cr_alignment
323#ifdef MULTI_ABORT 320#ifdef MULTI_DABORT
324.LCprocfns: 321.LCprocfns:
325 .word processor 322 .word processor
326#endif 323#endif
327.LCfp: 324.LCfp:
328 .word fp_enter 325 .word fp_enter
329#ifdef CONFIG_PREEMPT
330.LCirq_stat:
331 .word irq_stat
332#endif
333 326
334/* 327/*
335 * User mode handlers 328 * User mode handlers
@@ -404,12 +397,12 @@ __dabt_usr:
404 @ The abort handler must return the aborted address in r0, and 397 @ The abort handler must return the aborted address in r0, and
405 @ the fault status register in r1. 398 @ the fault status register in r1.
406 @ 399 @
407#ifdef MULTI_ABORT 400#ifdef MULTI_DABORT
408 ldr r4, .LCprocfns 401 ldr r4, .LCprocfns
409 mov lr, pc 402 mov lr, pc
410 ldr pc, [r4] 403 ldr pc, [r4, #PROCESSOR_DABT_FUNC]
411#else 404#else
412 bl CPU_ABORT_HANDLER 405 bl CPU_DABORT_HANDLER
413#endif 406#endif
414 407
415 @ 408 @
@@ -455,10 +448,6 @@ __irq_usr:
455__und_usr: 448__und_usr:
456 usr_entry 449 usr_entry
457 450
458 tst r3, #PSR_T_BIT @ Thumb mode?
459 bne __und_usr_unknown @ ignore FP
460 sub r4, r2, #4
461
462 @ 451 @
463 @ fall through to the emulation code, which returns using r9 if 452 @ fall through to the emulation code, which returns using r9 if
464 @ it has emulated the instruction, or the more conventional lr 453 @ it has emulated the instruction, or the more conventional lr
@@ -468,7 +457,24 @@ __und_usr:
468 @ 457 @
469 adr r9, ret_from_exception 458 adr r9, ret_from_exception
470 adr lr, __und_usr_unknown 459 adr lr, __und_usr_unknown
4711: ldrt r0, [r4] 460 tst r3, #PSR_T_BIT @ Thumb mode?
461 subeq r4, r2, #4 @ ARM instr at LR - 4
462 subne r4, r2, #2 @ Thumb instr at LR - 2
4631: ldreqt r0, [r4]
464 beq call_fpe
465 @ Thumb instruction
466#if __LINUX_ARM_ARCH__ >= 7
4672: ldrht r5, [r4], #2
468 and r0, r5, #0xf800 @ mask bits 111x x... .... ....
469 cmp r0, #0xe800 @ 32bit instruction if xx != 0
470 blo __und_usr_unknown
4713: ldrht r0, [r4]
472 add r2, r2, #2 @ r2 is PC + 2, make it PC + 4
473 orr r0, r0, r5, lsl #16
474#else
475 b __und_usr_unknown
476#endif
477
472 @ 478 @
473 @ fallthrough to call_fpe 479 @ fallthrough to call_fpe
474 @ 480 @
@@ -477,10 +483,14 @@ __und_usr:
477 * The out of line fixup for the ldrt above. 483 * The out of line fixup for the ldrt above.
478 */ 484 */
479 .section .fixup, "ax" 485 .section .fixup, "ax"
4802: mov pc, r9 4864: mov pc, r9
481 .previous 487 .previous
482 .section __ex_table,"a" 488 .section __ex_table,"a"
483 .long 1b, 2b 489 .long 1b, 4b
490#if __LINUX_ARM_ARCH__ >= 7
491 .long 2b, 4b
492 .long 3b, 4b
493#endif
484 .previous 494 .previous
485 495
486/* 496/*
@@ -507,9 +517,16 @@ __und_usr:
507 * r10 = this threads thread_info structure. 517 * r10 = this threads thread_info structure.
508 * lr = unrecognised instruction return address 518 * lr = unrecognised instruction return address
509 */ 519 */
520 @
521 @ Fall-through from Thumb-2 __und_usr
522 @
523#ifdef CONFIG_NEON
524 adr r6, .LCneon_thumb_opcodes
525 b 2f
526#endif
510call_fpe: 527call_fpe:
511#ifdef CONFIG_NEON 528#ifdef CONFIG_NEON
512 adr r6, .LCneon_opcodes 529 adr r6, .LCneon_arm_opcodes
5132: 5302:
514 ldr r7, [r6], #4 @ mask value 531 ldr r7, [r6], #4 @ mask value
515 cmp r7, #0 @ end mask? 532 cmp r7, #0 @ end mask?
@@ -526,6 +543,7 @@ call_fpe:
5261: 5431:
527#endif 544#endif
528 tst r0, #0x08000000 @ only CDP/CPRT/LDC/STC have bit 27 545 tst r0, #0x08000000 @ only CDP/CPRT/LDC/STC have bit 27
546 tstne r0, #0x04000000 @ bit 26 set on both ARM and Thumb-2
529#if defined(CONFIG_CPU_ARM610) || defined(CONFIG_CPU_ARM710) 547#if defined(CONFIG_CPU_ARM610) || defined(CONFIG_CPU_ARM710)
530 and r8, r0, #0x0f000000 @ mask out op-code bits 548 and r8, r0, #0x0f000000 @ mask out op-code bits
531 teqne r8, #0x0f000000 @ SWI (ARM6/7 bug)? 549 teqne r8, #0x0f000000 @ SWI (ARM6/7 bug)?
@@ -577,7 +595,7 @@ call_fpe:
577#ifdef CONFIG_NEON 595#ifdef CONFIG_NEON
578 .align 6 596 .align 6
579 597
580.LCneon_opcodes: 598.LCneon_arm_opcodes:
581 .word 0xfe000000 @ mask 599 .word 0xfe000000 @ mask
582 .word 0xf2000000 @ opcode 600 .word 0xf2000000 @ opcode
583 601
@@ -586,6 +604,16 @@ call_fpe:
586 604
587 .word 0x00000000 @ mask 605 .word 0x00000000 @ mask
588 .word 0x00000000 @ opcode 606 .word 0x00000000 @ opcode
607
608.LCneon_thumb_opcodes:
609 .word 0xef000000 @ mask
610 .word 0xef000000 @ opcode
611
612 .word 0xff100000 @ mask
613 .word 0xf9000000 @ opcode
614
615 .word 0x00000000 @ mask
616 .word 0x00000000 @ opcode
589#endif 617#endif
590 618
591do_fpe: 619do_fpe:
@@ -619,8 +647,15 @@ __und_usr_unknown:
619__pabt_usr: 647__pabt_usr:
620 usr_entry 648 usr_entry
621 649
650#ifdef MULTI_PABORT
651 mov r0, r2 @ pass address of aborted instruction.
652 ldr r4, .LCprocfns
653 mov lr, pc
654 ldr pc, [r4, #PROCESSOR_PABT_FUNC]
655#else
656 CPU_PABORT_HANDLER(r0, r2)
657#endif
622 enable_irq @ Enable interrupts 658 enable_irq @ Enable interrupts
623 mov r0, r2 @ address (pc)
624 mov r1, sp @ regs 659 mov r1, sp @ regs
625 bl do_PrefetchAbort @ call abort handler 660 bl do_PrefetchAbort @ call abort handler
626 /* fall through */ 661 /* fall through */
diff --git a/arch/arm/kernel/entry-common.S b/arch/arm/kernel/entry-common.S
index 6c90c50a9ee3..597ed00a08d8 100644
--- a/arch/arm/kernel/entry-common.S
+++ b/arch/arm/kernel/entry-common.S
@@ -352,6 +352,11 @@ sys_mmap2:
352 b do_mmap2 352 b do_mmap2
353#endif 353#endif
354 354
355ENTRY(pabort_ifar)
356 mrc p15, 0, r0, cr6, cr0, 2
357ENTRY(pabort_noifar)
358 mov pc, lr
359
355#ifdef CONFIG_OABI_COMPAT 360#ifdef CONFIG_OABI_COMPAT
356 361
357/* 362/*
diff --git a/arch/arm/kernel/head-common.S b/arch/arm/kernel/head-common.S
index 50f667febe29..7e9c00a8a412 100644
--- a/arch/arm/kernel/head-common.S
+++ b/arch/arm/kernel/head-common.S
@@ -75,8 +75,13 @@ __error_p:
75#ifdef CONFIG_DEBUG_LL 75#ifdef CONFIG_DEBUG_LL
76 adr r0, str_p1 76 adr r0, str_p1
77 bl printascii 77 bl printascii
78 mov r0, r9
79 bl printhex8
80 adr r0, str_p2
81 bl printascii
78 b __error 82 b __error
79str_p1: .asciz "\nError: unrecognized/unsupported processor variant.\n" 83str_p1: .asciz "\nError: unrecognized/unsupported processor variant (0x"
84str_p2: .asciz ").\n"
80 .align 85 .align
81#endif 86#endif
82 87
diff --git a/arch/arm/kernel/thumbee.c b/arch/arm/kernel/thumbee.c
new file mode 100644
index 000000000000..df3f6b7ebcea
--- /dev/null
+++ b/arch/arm/kernel/thumbee.c
@@ -0,0 +1,81 @@
1/*
2 * arch/arm/kernel/thumbee.c
3 *
4 * Copyright (C) 2008 ARM Limited
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 program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */
19
20#include <linux/kernel.h>
21#include <linux/init.h>
22
23#include <asm/thread_notify.h>
24
25/*
26 * Access to the ThumbEE Handler Base register
27 */
28static inline unsigned long teehbr_read()
29{
30 unsigned long v;
31 asm("mrc p14, 6, %0, c1, c0, 0\n" : "=r" (v));
32 return v;
33}
34
35static inline void teehbr_write(unsigned long v)
36{
37 asm("mcr p14, 6, %0, c1, c0, 0\n" : : "r" (v));
38}
39
40static int thumbee_notifier(struct notifier_block *self, unsigned long cmd, void *t)
41{
42 struct thread_info *thread = t;
43
44 switch (cmd) {
45 case THREAD_NOTIFY_FLUSH:
46 thread->thumbee_state = 0;
47 break;
48 case THREAD_NOTIFY_SWITCH:
49 current_thread_info()->thumbee_state = teehbr_read();
50 teehbr_write(thread->thumbee_state);
51 break;
52 }
53
54 return NOTIFY_DONE;
55}
56
57static struct notifier_block thumbee_notifier_block = {
58 .notifier_call = thumbee_notifier,
59};
60
61static int __init thumbee_init(void)
62{
63 unsigned long pfr0;
64 unsigned int cpu_arch = cpu_architecture();
65
66 if (cpu_arch < CPU_ARCH_ARMv7)
67 return 0;
68
69 /* processor feature register 0 */
70 asm("mrc p15, 0, %0, c0, c1, 0\n" : "=r" (pfr0));
71 if ((pfr0 & 0x0000f000) != 0x00001000)
72 return 0;
73
74 printk(KERN_INFO "ThumbEE CPU extension supported.\n");
75 elf_hwcap |= HWCAP_THUMBEE;
76 thread_register_notifier(&thumbee_notifier_block);
77
78 return 0;
79}
80
81late_initcall(thumbee_init);
diff --git a/arch/arm/mach-clps711x/Kconfig b/arch/arm/mach-clps711x/Kconfig
index 0e2b641268ad..dbaae5f746a1 100644
--- a/arch/arm/mach-clps711x/Kconfig
+++ b/arch/arm/mach-clps711x/Kconfig
@@ -31,6 +31,8 @@ config ARCH_EDB7211
31 bool "EDB7211" 31 bool "EDB7211"
32 select ISA 32 select ISA
33 select ARCH_DISCONTIGMEM_ENABLE 33 select ARCH_DISCONTIGMEM_ENABLE
34 select ARCH_SPARSEMEM_ENABLE
35 select ARCH_SELECT_MEMORY_MODEL
34 help 36 help
35 Say Y here if you intend to run this kernel on a Cirrus Logic EDB-7211 37 Say Y here if you intend to run this kernel on a Cirrus Logic EDB-7211
36 evaluation board. 38 evaluation board.
diff --git a/arch/arm/mach-ep93xx/Makefile b/arch/arm/mach-ep93xx/Makefile
index 0ecf99761feb..c1252ca9648e 100644
--- a/arch/arm/mach-ep93xx/Makefile
+++ b/arch/arm/mach-ep93xx/Makefile
@@ -1,7 +1,7 @@
1# 1#
2# Makefile for the linux kernel. 2# Makefile for the linux kernel.
3# 3#
4obj-y := core.o clock.o 4obj-y := core.o clock.o gpio.o
5obj-m := 5obj-m :=
6obj-n := 6obj-n :=
7obj- := 7obj- :=
diff --git a/arch/arm/mach-ep93xx/core.c b/arch/arm/mach-ep93xx/core.c
index 91f6a07a51d5..8bc187240542 100644
--- a/arch/arm/mach-ep93xx/core.c
+++ b/arch/arm/mach-ep93xx/core.c
@@ -159,7 +159,7 @@ static const u8 int_type2_register_offset[3] = { 0x94, 0xb0, 0x50 };
159static const u8 eoi_register_offset[3] = { 0x98, 0xb4, 0x54 }; 159static const u8 eoi_register_offset[3] = { 0x98, 0xb4, 0x54 };
160static const u8 int_en_register_offset[3] = { 0x9c, 0xb8, 0x5c }; 160static const u8 int_en_register_offset[3] = { 0x9c, 0xb8, 0x5c };
161 161
162static void update_gpio_int_params(unsigned port) 162void ep93xx_gpio_update_int_params(unsigned port)
163{ 163{
164 BUG_ON(port > 2); 164 BUG_ON(port > 2);
165 165
@@ -175,98 +175,10 @@ static void update_gpio_int_params(unsigned port)
175 EP93XX_GPIO_REG(int_en_register_offset[port])); 175 EP93XX_GPIO_REG(int_en_register_offset[port]));
176} 176}
177 177
178/* Port ordering is: A B F D E C G H */ 178void ep93xx_gpio_int_mask(unsigned line)
179static const u8 data_register_offset[8] = {
180 0x00, 0x04, 0x30, 0x0c, 0x20, 0x08, 0x38, 0x40,
181};
182
183static const u8 data_direction_register_offset[8] = {
184 0x10, 0x14, 0x34, 0x1c, 0x24, 0x18, 0x3c, 0x44,
185};
186
187#define GPIO_IN 0
188#define GPIO_OUT 1
189
190static void ep93xx_gpio_set_direction(unsigned line, int direction)
191{
192 unsigned int data_direction_register;
193 unsigned long flags;
194 unsigned char v;
195
196 data_direction_register =
197 EP93XX_GPIO_REG(data_direction_register_offset[line >> 3]);
198
199 local_irq_save(flags);
200 if (direction == GPIO_OUT) {
201 if (line >= 0 && line <= EP93XX_GPIO_LINE_MAX_IRQ) {
202 /* Port A/B/F */
203 gpio_int_unmasked[line >> 3] &= ~(1 << (line & 7));
204 update_gpio_int_params(line >> 3);
205 }
206
207 v = __raw_readb(data_direction_register);
208 v |= 1 << (line & 7);
209 __raw_writeb(v, data_direction_register);
210 } else if (direction == GPIO_IN) {
211 v = __raw_readb(data_direction_register);
212 v &= ~(1 << (line & 7));
213 __raw_writeb(v, data_direction_register);
214 }
215 local_irq_restore(flags);
216}
217
218int gpio_direction_input(unsigned gpio)
219{
220 if (gpio > EP93XX_GPIO_LINE_MAX)
221 return -EINVAL;
222
223 ep93xx_gpio_set_direction(gpio, GPIO_IN);
224
225 return 0;
226}
227EXPORT_SYMBOL(gpio_direction_input);
228
229int gpio_direction_output(unsigned gpio, int value)
230{
231 if (gpio > EP93XX_GPIO_LINE_MAX)
232 return -EINVAL;
233
234 gpio_set_value(gpio, value);
235 ep93xx_gpio_set_direction(gpio, GPIO_OUT);
236
237 return 0;
238}
239EXPORT_SYMBOL(gpio_direction_output);
240
241int gpio_get_value(unsigned gpio)
242{
243 unsigned int data_register;
244
245 data_register = EP93XX_GPIO_REG(data_register_offset[gpio >> 3]);
246
247 return !!(__raw_readb(data_register) & (1 << (gpio & 7)));
248}
249EXPORT_SYMBOL(gpio_get_value);
250
251void gpio_set_value(unsigned gpio, int value)
252{ 179{
253 unsigned int data_register; 180 gpio_int_unmasked[line >> 3] &= ~(1 << (line & 7));
254 unsigned long flags;
255 unsigned char v;
256
257 data_register = EP93XX_GPIO_REG(data_register_offset[gpio >> 3]);
258
259 local_irq_save(flags);
260 v = __raw_readb(data_register);
261 if (value)
262 v |= 1 << (gpio & 7);
263 else
264 v &= ~(1 << (gpio & 7));
265 __raw_writeb(v, data_register);
266 local_irq_restore(flags);
267} 181}
268EXPORT_SYMBOL(gpio_set_value);
269
270 182
271/************************************************************************* 183/*************************************************************************
272 * EP93xx IRQ handling 184 * EP93xx IRQ handling
@@ -316,7 +228,7 @@ static void ep93xx_gpio_irq_ack(unsigned int irq)
316 228
317 if ((irq_desc[irq].status & IRQ_TYPE_SENSE_MASK) == IRQT_BOTHEDGE) { 229 if ((irq_desc[irq].status & IRQ_TYPE_SENSE_MASK) == IRQT_BOTHEDGE) {
318 gpio_int_type2[port] ^= port_mask; /* switch edge direction */ 230 gpio_int_type2[port] ^= port_mask; /* switch edge direction */
319 update_gpio_int_params(port); 231 ep93xx_gpio_update_int_params(port);
320 } 232 }
321 233
322 __raw_writeb(port_mask, EP93XX_GPIO_REG(eoi_register_offset[port])); 234 __raw_writeb(port_mask, EP93XX_GPIO_REG(eoi_register_offset[port]));
@@ -332,7 +244,7 @@ static void ep93xx_gpio_irq_mask_ack(unsigned int irq)
332 gpio_int_type2[port] ^= port_mask; /* switch edge direction */ 244 gpio_int_type2[port] ^= port_mask; /* switch edge direction */
333 245
334 gpio_int_unmasked[port] &= ~port_mask; 246 gpio_int_unmasked[port] &= ~port_mask;
335 update_gpio_int_params(port); 247 ep93xx_gpio_update_int_params(port);
336 248
337 __raw_writeb(port_mask, EP93XX_GPIO_REG(eoi_register_offset[port])); 249 __raw_writeb(port_mask, EP93XX_GPIO_REG(eoi_register_offset[port]));
338} 250}
@@ -343,7 +255,7 @@ static void ep93xx_gpio_irq_mask(unsigned int irq)
343 int port = line >> 3; 255 int port = line >> 3;
344 256
345 gpio_int_unmasked[port] &= ~(1 << (line & 7)); 257 gpio_int_unmasked[port] &= ~(1 << (line & 7));
346 update_gpio_int_params(port); 258 ep93xx_gpio_update_int_params(port);
347} 259}
348 260
349static void ep93xx_gpio_irq_unmask(unsigned int irq) 261static void ep93xx_gpio_irq_unmask(unsigned int irq)
@@ -352,7 +264,7 @@ static void ep93xx_gpio_irq_unmask(unsigned int irq)
352 int port = line >> 3; 264 int port = line >> 3;
353 265
354 gpio_int_unmasked[port] |= 1 << (line & 7); 266 gpio_int_unmasked[port] |= 1 << (line & 7);
355 update_gpio_int_params(port); 267 ep93xx_gpio_update_int_params(port);
356} 268}
357 269
358 270
@@ -368,7 +280,7 @@ static int ep93xx_gpio_irq_type(unsigned int irq, unsigned int type)
368 const int port = gpio >> 3; 280 const int port = gpio >> 3;
369 const int port_mask = 1 << (gpio & 7); 281 const int port_mask = 1 << (gpio & 7);
370 282
371 ep93xx_gpio_set_direction(gpio, GPIO_IN); 283 gpio_direction_output(gpio, gpio_get_value(gpio));
372 284
373 switch (type) { 285 switch (type) {
374 case IRQT_RISING: 286 case IRQT_RISING:
@@ -411,7 +323,7 @@ static int ep93xx_gpio_irq_type(unsigned int irq, unsigned int type)
411 desc->status &= ~IRQ_TYPE_SENSE_MASK; 323 desc->status &= ~IRQ_TYPE_SENSE_MASK;
412 desc->status |= type & IRQ_TYPE_SENSE_MASK; 324 desc->status |= type & IRQ_TYPE_SENSE_MASK;
413 325
414 update_gpio_int_params(port); 326 ep93xx_gpio_update_int_params(port);
415 327
416 return 0; 328 return 0;
417} 329}
@@ -549,6 +461,7 @@ static struct platform_device ep93xx_ohci_device = {
549 .resource = ep93xx_ohci_resources, 461 .resource = ep93xx_ohci_resources,
550}; 462};
551 463
464extern void ep93xx_gpio_init(void);
552 465
553void __init ep93xx_init_devices(void) 466void __init ep93xx_init_devices(void)
554{ 467{
@@ -562,6 +475,8 @@ void __init ep93xx_init_devices(void)
562 __raw_writel(0xaa, EP93XX_SYSCON_SWLOCK); 475 __raw_writel(0xaa, EP93XX_SYSCON_SWLOCK);
563 __raw_writel(v, EP93XX_SYSCON_DEVICE_CONFIG); 476 __raw_writel(v, EP93XX_SYSCON_DEVICE_CONFIG);
564 477
478 ep93xx_gpio_init();
479
565 amba_device_register(&uart1_device, &iomem_resource); 480 amba_device_register(&uart1_device, &iomem_resource);
566 amba_device_register(&uart2_device, &iomem_resource); 481 amba_device_register(&uart2_device, &iomem_resource);
567 amba_device_register(&uart3_device, &iomem_resource); 482 amba_device_register(&uart3_device, &iomem_resource);
diff --git a/arch/arm/mach-ep93xx/gpio.c b/arch/arm/mach-ep93xx/gpio.c
new file mode 100644
index 000000000000..dc2e4c00d989
--- /dev/null
+++ b/arch/arm/mach-ep93xx/gpio.c
@@ -0,0 +1,158 @@
1/*
2 * linux/arch/arm/mach-ep93xx/gpio.c
3 *
4 * Generic EP93xx GPIO handling
5 *
6 * Copyright (c) 2008 Ryan Mallon <ryan@bluewatersys.com>
7 *
8 * Based on code originally from:
9 * linux/arch/arm/mach-ep93xx/core.c
10 *
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License version 2 as
13 * published by the Free Software Foundation.
14 */
15
16#include <linux/init.h>
17#include <linux/module.h>
18#include <linux/seq_file.h>
19
20#include <asm/arch/ep93xx-regs.h>
21#include <asm/io.h>
22#include <asm/gpio.h>
23
24struct ep93xx_gpio_chip {
25 struct gpio_chip chip;
26
27 unsigned int data_reg;
28 unsigned int data_dir_reg;
29};
30
31#define to_ep93xx_gpio_chip(c) container_of(c, struct ep93xx_gpio_chip, chip)
32
33/* From core.c */
34extern void ep93xx_gpio_int_mask(unsigned line);
35extern void ep93xx_gpio_update_int_params(unsigned port);
36
37static int ep93xx_gpio_direction_input(struct gpio_chip *chip, unsigned offset)
38{
39 struct ep93xx_gpio_chip *ep93xx_chip = to_ep93xx_gpio_chip(chip);
40 unsigned long flags;
41 u8 v;
42
43 local_irq_save(flags);
44 v = __raw_readb(ep93xx_chip->data_dir_reg);
45 v &= ~(1 << offset);
46 __raw_writeb(v, ep93xx_chip->data_dir_reg);
47 local_irq_restore(flags);
48
49 return 0;
50}
51
52static int ep93xx_gpio_direction_output(struct gpio_chip *chip,
53 unsigned offset, int val)
54{
55 struct ep93xx_gpio_chip *ep93xx_chip = to_ep93xx_gpio_chip(chip);
56 unsigned long flags;
57 int line;
58 u8 v;
59
60 local_irq_save(flags);
61
62 /* Set the value */
63 v = __raw_readb(ep93xx_chip->data_reg);
64 if (val)
65 v |= (1 << offset);
66 else
67 v &= ~(1 << offset);
68 __raw_writeb(v, ep93xx_chip->data_reg);
69
70 /* Drive as an output */
71 line = chip->base + offset;
72 if (line <= EP93XX_GPIO_LINE_MAX_IRQ) {
73 /* Ports A/B/F */
74 ep93xx_gpio_int_mask(line);
75 ep93xx_gpio_update_int_params(line >> 3);
76 }
77
78 v = __raw_readb(ep93xx_chip->data_dir_reg);
79 v |= (1 << offset);
80 __raw_writeb(v, ep93xx_chip->data_dir_reg);
81
82 local_irq_restore(flags);
83
84 return 0;
85}
86
87static int ep93xx_gpio_get(struct gpio_chip *chip, unsigned offset)
88{
89 struct ep93xx_gpio_chip *ep93xx_chip = to_ep93xx_gpio_chip(chip);
90
91 return !!(__raw_readb(ep93xx_chip->data_reg) & (1 << offset));
92}
93
94static void ep93xx_gpio_set(struct gpio_chip *chip, unsigned offset, int val)
95{
96 struct ep93xx_gpio_chip *ep93xx_chip = to_ep93xx_gpio_chip(chip);
97 unsigned long flags;
98 u8 v;
99
100 local_irq_save(flags);
101 v = __raw_readb(ep93xx_chip->data_reg);
102 if (val)
103 v |= (1 << offset);
104 else
105 v &= ~(1 << offset);
106 __raw_writeb(v, ep93xx_chip->data_reg);
107 local_irq_restore(flags);
108}
109
110static void ep93xx_gpio_dbg_show(struct seq_file *s, struct gpio_chip *chip)
111{
112 struct ep93xx_gpio_chip *ep93xx_chip = to_ep93xx_gpio_chip(chip);
113 u8 data_reg, data_dir_reg;
114 int i;
115
116 data_reg = __raw_readb(ep93xx_chip->data_reg);
117 data_dir_reg = __raw_readb(ep93xx_chip->data_dir_reg);
118
119 for (i = 0; i < chip->ngpio; i++)
120 seq_printf(s, "GPIO %s%d: %s %s\n", chip->label, i,
121 (data_reg & (1 << i)) ? "set" : "clear",
122 (data_dir_reg & (1 << i)) ? "out" : "in");
123}
124
125#define EP93XX_GPIO_BANK(name, dr, ddr, base_gpio) \
126 { \
127 .chip = { \
128 .label = name, \
129 .direction_input = ep93xx_gpio_direction_input, \
130 .direction_output = ep93xx_gpio_direction_output, \
131 .get = ep93xx_gpio_get, \
132 .set = ep93xx_gpio_set, \
133 .dbg_show = ep93xx_gpio_dbg_show, \
134 .base = base_gpio, \
135 .ngpio = 8, \
136 }, \
137 .data_reg = EP93XX_GPIO_REG(dr), \
138 .data_dir_reg = EP93XX_GPIO_REG(ddr), \
139 }
140
141static struct ep93xx_gpio_chip ep93xx_gpio_banks[] = {
142 EP93XX_GPIO_BANK("A", 0x00, 0x10, 0),
143 EP93XX_GPIO_BANK("B", 0x04, 0x14, 8),
144 EP93XX_GPIO_BANK("C", 0x30, 0x34, 40),
145 EP93XX_GPIO_BANK("D", 0x0c, 0x1c, 24),
146 EP93XX_GPIO_BANK("E", 0x20, 0x24, 32),
147 EP93XX_GPIO_BANK("F", 0x08, 0x18, 16),
148 EP93XX_GPIO_BANK("G", 0x38, 0x3c, 48),
149 EP93XX_GPIO_BANK("H", 0x40, 0x44, 56),
150};
151
152void __init ep93xx_gpio_init(void)
153{
154 int i;
155
156 for (i = 0; i < ARRAY_SIZE(ep93xx_gpio_banks); i++)
157 gpiochip_add(&ep93xx_gpio_banks[i].chip);
158}
diff --git a/arch/arm/mach-iop32x/Kconfig b/arch/arm/mach-iop32x/Kconfig
index dbe07c9472ed..5e8c6f7dfabb 100644
--- a/arch/arm/mach-iop32x/Kconfig
+++ b/arch/arm/mach-iop32x/Kconfig
@@ -34,14 +34,6 @@ 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
45config MACH_EM7210 37config MACH_EM7210
46 bool "Enable support for the Lanner EM7210" 38 bool "Enable support for the Lanner EM7210"
47 help 39 help
diff --git a/arch/arm/mach-iop32x/iq31244.c b/arch/arm/mach-iop32x/iq31244.c
index 98cfa1cd6bdb..4a89823bcebb 100644
--- a/arch/arm/mach-iop32x/iq31244.c
+++ b/arch/arm/mach-iop32x/iq31244.c
@@ -178,10 +178,9 @@ 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 if (iop3xx_get_init_atu() == IOP3XX_INIT_ATU_ENABLE) 182 pci_common_init(&ep80219_pci);
183 pci_common_init(&ep80219_pci); 183 else if (machine_is_iq31244()) {
184 } else if (machine_is_iq31244()) {
185 if (is_80219()) { 184 if (is_80219()) {
186 printk("note: iq31244 board type has been selected\n"); 185 printk("note: iq31244 board type has been selected\n");
187 printk("note: to select ep80219 operation:\n"); 186 printk("note: to select ep80219 operation:\n");
@@ -190,9 +189,7 @@ static int __init iq31244_pci_init(void)
190 printk("\t2/ update boot loader to pass" 189 printk("\t2/ update boot loader to pass"
191 " the ep80219 id: %d\n", MACH_TYPE_EP80219); 190 " the ep80219 id: %d\n", MACH_TYPE_EP80219);
192 } 191 }
193 192 pci_common_init(&iq31244_pci);
194 if (iop3xx_get_init_atu() == IOP3XX_INIT_ATU_ENABLE)
195 pci_common_init(&iq31244_pci);
196 } 193 }
197 194
198 return 0; 195 return 0;
diff --git a/arch/arm/mach-iop32x/iq80321.c b/arch/arm/mach-iop32x/iq80321.c
index 18ad29f213b2..1da3c911edd3 100644
--- a/arch/arm/mach-iop32x/iq80321.c
+++ b/arch/arm/mach-iop32x/iq80321.c
@@ -106,7 +106,7 @@ static struct hw_pci iq80321_pci __initdata = {
106 .swizzle = pci_std_swizzle, 106 .swizzle = pci_std_swizzle,
107 .nr_controllers = 1, 107 .nr_controllers = 1,
108 .setup = iop3xx_pci_setup, 108 .setup = iop3xx_pci_setup,
109 .preinit = iop3xx_pci_preinit, 109 .preinit = iop3xx_pci_preinit_cond,
110 .scan = iop3xx_pci_scan_bus, 110 .scan = iop3xx_pci_scan_bus,
111 .map_irq = iq80321_pci_map_irq, 111 .map_irq = iq80321_pci_map_irq,
112}; 112};
diff --git a/arch/arm/mach-iop33x/Kconfig b/arch/arm/mach-iop33x/Kconfig
index 45598e096898..9aa016bb18f9 100644
--- a/arch/arm/mach-iop33x/Kconfig
+++ b/arch/arm/mach-iop33x/Kconfig
@@ -16,14 +16,6 @@ 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
27endmenu 19endmenu
28 20
29endif 21endif
diff --git a/arch/arm/mach-iop33x/iq80331.c b/arch/arm/mach-iop33x/iq80331.c
index 433188ebff2a..de39fd778579 100644
--- a/arch/arm/mach-iop33x/iq80331.c
+++ b/arch/arm/mach-iop33x/iq80331.c
@@ -89,7 +89,7 @@ static struct hw_pci iq80331_pci __initdata = {
89 .swizzle = pci_std_swizzle, 89 .swizzle = pci_std_swizzle,
90 .nr_controllers = 1, 90 .nr_controllers = 1,
91 .setup = iop3xx_pci_setup, 91 .setup = iop3xx_pci_setup,
92 .preinit = iop3xx_pci_preinit, 92 .preinit = iop3xx_pci_preinit_cond,
93 .scan = iop3xx_pci_scan_bus, 93 .scan = iop3xx_pci_scan_bus,
94 .map_irq = iq80331_pci_map_irq, 94 .map_irq = iq80331_pci_map_irq,
95}; 95};
diff --git a/arch/arm/mach-iop33x/iq80332.c b/arch/arm/mach-iop33x/iq80332.c
index 416c09564cc6..4904fd78445f 100644
--- a/arch/arm/mach-iop33x/iq80332.c
+++ b/arch/arm/mach-iop33x/iq80332.c
@@ -89,7 +89,7 @@ static struct hw_pci iq80332_pci __initdata = {
89 .swizzle = pci_std_swizzle, 89 .swizzle = pci_std_swizzle,
90 .nr_controllers = 1, 90 .nr_controllers = 1,
91 .setup = iop3xx_pci_setup, 91 .setup = iop3xx_pci_setup,
92 .preinit = iop3xx_pci_preinit, 92 .preinit = iop3xx_pci_preinit_cond,
93 .scan = iop3xx_pci_scan_bus, 93 .scan = iop3xx_pci_scan_bus,
94 .map_irq = iq80332_pci_map_irq, 94 .map_irq = iq80332_pci_map_irq,
95}; 95};
diff --git a/arch/arm/mach-ks8695/Makefile b/arch/arm/mach-ks8695/Makefile
index 730a3af12c98..ade42b73afbb 100644
--- a/arch/arm/mach-ks8695/Makefile
+++ b/arch/arm/mach-ks8695/Makefile
@@ -11,5 +11,8 @@ obj- :=
11# PCI support is optional 11# PCI support is optional
12obj-$(CONFIG_PCI) += pci.o 12obj-$(CONFIG_PCI) += pci.o
13 13
14# LEDs
15obj-$(CONFIG_LEDS) += leds.o
16
14# Board-specific support 17# Board-specific support
15obj-$(CONFIG_MACH_KS8695) += board-micrel.o 18obj-$(CONFIG_MACH_KS8695) += board-micrel.o
diff --git a/arch/arm/mach-ks8695/devices.c b/arch/arm/mach-ks8695/devices.c
index 386593f8ac65..3db2ec61d06f 100644
--- a/arch/arm/mach-ks8695/devices.c
+++ b/arch/arm/mach-ks8695/devices.c
@@ -176,6 +176,27 @@ static void __init ks8695_add_device_watchdog(void) {}
176#endif 176#endif
177 177
178 178
179/* --------------------------------------------------------------------
180 * LEDs
181 * -------------------------------------------------------------------- */
182
183#if defined(CONFIG_LEDS)
184short ks8695_leds_cpu = -1;
185short ks8695_leds_timer = -1;
186
187void __init ks8695_init_leds(u8 cpu_led, u8 timer_led)
188{
189 /* Enable GPIO to access the LEDs */
190 gpio_direction_output(cpu_led, 1);
191 gpio_direction_output(timer_led, 1);
192
193 ks8695_leds_cpu = cpu_led;
194 ks8695_leds_timer = timer_led;
195}
196#else
197void __init ks8695_init_leds(u8 cpu_led, u8 timer_led) {}
198#endif
199
179/* -------------------------------------------------------------------- */ 200/* -------------------------------------------------------------------- */
180 201
181/* 202/*
diff --git a/arch/arm/mach-ks8695/leds.c b/arch/arm/mach-ks8695/leds.c
new file mode 100644
index 000000000000..d61762ae50d8
--- /dev/null
+++ b/arch/arm/mach-ks8695/leds.c
@@ -0,0 +1,94 @@
1/*
2 * LED driver for KS8695-based boards.
3 *
4 * Copyright (C) Andrew Victor
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#include <linux/kernel.h>
12#include <linux/module.h>
13#include <linux/init.h>
14
15#include <asm/mach-types.h>
16#include <asm/leds.h>
17#include <asm/arch/devices.h>
18#include <asm/arch/gpio.h>
19
20
21static inline void ks8695_led_on(unsigned int led)
22{
23 gpio_set_value(led, 0);
24}
25
26static inline void ks8695_led_off(unsigned int led)
27{
28 gpio_set_value(led, 1);
29}
30
31static inline void ks8695_led_toggle(unsigned int led)
32{
33 unsigned long is_off = gpio_get_value(led);
34 if (is_off)
35 ks8695_led_on(led);
36 else
37 ks8695_led_off(led);
38}
39
40
41/*
42 * Handle LED events.
43 */
44static void ks8695_leds_event(led_event_t evt)
45{
46 unsigned long flags;
47
48 local_irq_save(flags);
49
50 switch(evt) {
51 case led_start: /* System startup */
52 ks8695_led_on(ks8695_leds_cpu);
53 break;
54
55 case led_stop: /* System stop / suspend */
56 ks8695_led_off(ks8695_leds_cpu);
57 break;
58
59#ifdef CONFIG_LEDS_TIMER
60 case led_timer: /* Every 50 timer ticks */
61 ks8695_led_toggle(ks8695_leds_timer);
62 break;
63#endif
64
65#ifdef CONFIG_LEDS_CPU
66 case led_idle_start: /* Entering idle state */
67 ks8695_led_off(ks8695_leds_cpu);
68 break;
69
70 case led_idle_end: /* Exit idle state */
71 ks8695_led_on(ks8695_leds_cpu);
72 break;
73#endif
74
75 default:
76 break;
77 }
78
79 local_irq_restore(flags);
80}
81
82
83static int __init leds_init(void)
84{
85 if ((ks8695_leds_timer == -1) || (ks8695_leds_cpu == -1))
86 return -ENODEV;
87
88 leds_event = ks8695_leds_event;
89
90 leds_event(led_start);
91 return 0;
92}
93
94__initcall(leds_init);
diff --git a/arch/arm/mach-ns9xxx/Kconfig b/arch/arm/mach-ns9xxx/Kconfig
index 8584ed107991..dd0cd5ac4b8b 100644
--- a/arch/arm/mach-ns9xxx/Kconfig
+++ b/arch/arm/mach-ns9xxx/Kconfig
@@ -2,9 +2,26 @@ if ARCH_NS9XXX
2 2
3menu "NS9xxx Implementations" 3menu "NS9xxx Implementations"
4 4
5config NS9XXX_HAVE_SERIAL8250
6 bool
7
8config PROCESSOR_NS9360
9 bool
10
11config MODULE_CC9P9360
12 bool
13 select PROCESSOR_NS9360
14
15config BOARD_A9M9750DEV
16 select NS9XXX_HAVE_SERIAL8250
17 bool
18
19config BOARD_JSCC9P9360
20 bool
21
5config MACH_CC9P9360DEV 22config MACH_CC9P9360DEV
6 bool "ConnectCore 9P 9360 on an A9M9750 Devboard" 23 bool "ConnectCore 9P 9360 on an A9M9750 Devboard"
7 select PROCESSOR_NS9360 24 select MODULE_CC9P9360
8 select BOARD_A9M9750DEV 25 select BOARD_A9M9750DEV
9 help 26 help
10 Say Y here if you are using the Digi ConnectCore 9P 9360 27 Say Y here if you are using the Digi ConnectCore 9P 9360
@@ -12,21 +29,12 @@ config MACH_CC9P9360DEV
12 29
13config MACH_CC9P9360JS 30config MACH_CC9P9360JS
14 bool "ConnectCore 9P 9360 on a JSCC9P9360 Devboard" 31 bool "ConnectCore 9P 9360 on a JSCC9P9360 Devboard"
15 select PROCESSOR_NS9360 32 select MODULE_CC9P9360
16 select BOARD_JSCC9P9360 33 select BOARD_JSCC9P9360
17 help 34 help
18 Say Y here if you are using the Digi ConnectCore 9P 9360 35 Say Y here if you are using the Digi ConnectCore 9P 9360
19 on an JSCC9P9360 Development Board. 36 on an JSCC9P9360 Development Board.
20 37
21config PROCESSOR_NS9360
22 bool
23
24config BOARD_A9M9750DEV
25 bool
26
27config BOARD_JSCC9P9360
28 bool
29
30endmenu 38endmenu
31 39
32endif 40endif
diff --git a/arch/arm/mach-ns9xxx/Makefile b/arch/arm/mach-ns9xxx/Makefile
index 6fb82b855a55..41efaf9ad50b 100644
--- a/arch/arm/mach-ns9xxx/Makefile
+++ b/arch/arm/mach-ns9xxx/Makefile
@@ -1,7 +1,12 @@
1obj-y := irq.o time.o generic.o gpio.o 1obj-y := clock.o generic.o gpio.o irq.o
2 2
3obj-$(CONFIG_MACH_CC9P9360DEV) += mach-cc9p9360dev.o 3obj-$(CONFIG_MACH_CC9P9360DEV) += mach-cc9p9360dev.o
4obj-$(CONFIG_MACH_CC9P9360JS) += mach-cc9p9360js.o 4obj-$(CONFIG_MACH_CC9P9360JS) += mach-cc9p9360js.o
5 5
6obj-$(CONFIG_PROCESSOR_NS9360) += gpio-ns9360.o processor-ns9360.o time-ns9360.o
7
6obj-$(CONFIG_BOARD_A9M9750DEV) += board-a9m9750dev.o 8obj-$(CONFIG_BOARD_A9M9750DEV) += board-a9m9750dev.o
7obj-$(CONFIG_BOARD_JSCC9P9360) += board-jscc9p9360.o 9obj-$(CONFIG_BOARD_JSCC9P9360) += board-jscc9p9360.o
10
11# platform devices
12obj-$(CONFIG_NS9XXX_HAVE_SERIAL8250) += plat-serial8250.o
diff --git a/arch/arm/mach-ns9xxx/Makefile.boot b/arch/arm/mach-ns9xxx/Makefile.boot
index 75ed64e90fa4..54654919229b 100644
--- a/arch/arm/mach-ns9xxx/Makefile.boot
+++ b/arch/arm/mach-ns9xxx/Makefile.boot
@@ -1,2 +1,2 @@
1zreladdr-y := 0x108000 1zreladdr-y := 0x8000
2params_phys-y := 0x100 2params_phys-y := 0x100
diff --git a/arch/arm/mach-ns9xxx/board-a9m9750dev.c b/arch/arm/mach-ns9xxx/board-a9m9750dev.c
index 0f65177f9e5f..a494b71c0195 100644
--- a/arch/arm/mach-ns9xxx/board-a9m9750dev.c
+++ b/arch/arm/mach-ns9xxx/board-a9m9750dev.c
@@ -8,15 +8,14 @@
8 * under the terms of the GNU General Public License version 2 as published by 8 * under the terms of the GNU General Public License version 2 as published by
9 * the Free Software Foundation. 9 * the Free Software Foundation.
10 */ 10 */
11#include <linux/platform_device.h>
12#include <linux/serial_8250.h>
13#include <linux/irq.h> 11#include <linux/irq.h>
14 12
15#include <asm/mach/map.h> 13#include <asm/mach/map.h>
16#include <asm/gpio.h> 14#include <asm/gpio.h>
17 15
18#include <asm/arch-ns9xxx/board.h> 16#include <asm/arch-ns9xxx/board.h>
19#include <asm/arch-ns9xxx/regs-sys.h> 17#include <asm/arch-ns9xxx/processor-ns9360.h>
18#include <asm/arch-ns9xxx/regs-sys-ns9360.h>
20#include <asm/arch-ns9xxx/regs-mem.h> 19#include <asm/arch-ns9xxx/regs-mem.h>
21#include <asm/arch-ns9xxx/regs-bbu.h> 20#include <asm/arch-ns9xxx/regs-bbu.h>
22#include <asm/arch-ns9xxx/regs-board-a9m9750dev.h> 21#include <asm/arch-ns9xxx/regs-board-a9m9750dev.h>
@@ -105,9 +104,9 @@ void __init board_a9m9750dev_init_irq(void)
105 int i; 104 int i;
106 105
107 if (gpio_request(11, "board a9m9750dev extirq2") == 0) 106 if (gpio_request(11, "board a9m9750dev extirq2") == 0)
108 ns9xxx_gpio_configure(11, 0, 1); 107 ns9360_gpio_configure(11, 0, 1);
109 else 108 else
110 printk(KERN_ERR "%s: cannot get gpio 11 for IRQ_EXT2\n", 109 printk(KERN_ERR "%s: cannot get gpio 11 for IRQ_NS9XXX_EXT2\n",
111 __func__); 110 __func__);
112 111
113 for (i = FPGA_IRQ(0); i <= FPGA_IRQ(7); ++i) { 112 for (i = FPGA_IRQ(0); i <= FPGA_IRQ(7); ++i) {
@@ -116,69 +115,16 @@ void __init board_a9m9750dev_init_irq(void)
116 set_irq_flags(i, IRQF_VALID); 115 set_irq_flags(i, IRQF_VALID);
117 } 116 }
118 117
119 /* IRQ_EXT2: level sensitive + active low */ 118 /* IRQ_NS9XXX_EXT2: level sensitive + active low */
120 eic = __raw_readl(SYS_EIC(2)); 119 eic = __raw_readl(SYS_EIC(2));
121 REGSET(eic, SYS_EIC, PLTY, AL); 120 REGSET(eic, SYS_EIC, PLTY, AL);
122 REGSET(eic, SYS_EIC, LVEDG, LEVEL); 121 REGSET(eic, SYS_EIC, LVEDG, LEVEL);
123 __raw_writel(eic, SYS_EIC(2)); 122 __raw_writel(eic, SYS_EIC(2));
124 123
125 set_irq_chained_handler(IRQ_EXT2, 124 set_irq_chained_handler(IRQ_NS9XXX_EXT2,
126 a9m9750dev_fpga_demux_handler); 125 a9m9750dev_fpga_demux_handler);
127} 126}
128 127
129static struct plat_serial8250_port board_a9m9750dev_serial8250_port[] = {
130 {
131 .iobase = FPGA_UARTA_BASE,
132 .membase = (unsigned char*)FPGA_UARTA_BASE,
133 .mapbase = FPGA_UARTA_BASE,
134 .irq = IRQ_FPGA_UARTA,
135 .iotype = UPIO_MEM,
136 .uartclk = 18432000,
137 .regshift = 0,
138 .flags = UPF_BOOT_AUTOCONF | UPF_SHARE_IRQ,
139 }, {
140 .iobase = FPGA_UARTB_BASE,
141 .membase = (unsigned char*)FPGA_UARTB_BASE,
142 .mapbase = FPGA_UARTB_BASE,
143 .irq = IRQ_FPGA_UARTB,
144 .iotype = UPIO_MEM,
145 .uartclk = 18432000,
146 .regshift = 0,
147 .flags = UPF_BOOT_AUTOCONF | UPF_SHARE_IRQ,
148 }, {
149 .iobase = FPGA_UARTC_BASE,
150 .membase = (unsigned char*)FPGA_UARTC_BASE,
151 .mapbase = FPGA_UARTC_BASE,
152 .irq = IRQ_FPGA_UARTC,
153 .iotype = UPIO_MEM,
154 .uartclk = 18432000,
155 .regshift = 0,
156 .flags = UPF_BOOT_AUTOCONF | UPF_SHARE_IRQ,
157 }, {
158 .iobase = FPGA_UARTD_BASE,
159 .membase = (unsigned char*)FPGA_UARTD_BASE,
160 .mapbase = FPGA_UARTD_BASE,
161 .irq = IRQ_FPGA_UARTD,
162 .iotype = UPIO_MEM,
163 .uartclk = 18432000,
164 .regshift = 0,
165 .flags = UPF_BOOT_AUTOCONF | UPF_SHARE_IRQ,
166 }, {
167 /* end marker */
168 },
169};
170
171static struct platform_device board_a9m9750dev_serial_device = {
172 .name = "serial8250",
173 .dev = {
174 .platform_data = board_a9m9750dev_serial8250_port,
175 },
176};
177
178static struct platform_device *board_a9m9750dev_devices[] __initdata = {
179 &board_a9m9750dev_serial_device,
180};
181
182void __init board_a9m9750dev_init_machine(void) 128void __init board_a9m9750dev_init_machine(void)
183{ 129{
184 u32 reg; 130 u32 reg;
@@ -210,7 +156,4 @@ void __init board_a9m9750dev_init_machine(void)
210 __raw_writel(0x2, MEM_SMOED(0)); 156 __raw_writel(0x2, MEM_SMOED(0));
211 __raw_writel(0x6, MEM_SMRD(0)); 157 __raw_writel(0x6, MEM_SMRD(0));
212 __raw_writel(0x6, MEM_SMWD(0)); 158 __raw_writel(0x6, MEM_SMWD(0));
213
214 platform_add_devices(board_a9m9750dev_devices,
215 ARRAY_SIZE(board_a9m9750dev_devices));
216} 159}
diff --git a/arch/arm/mach-ns9xxx/clock.c b/arch/arm/mach-ns9xxx/clock.c
new file mode 100644
index 000000000000..f8639161068f
--- /dev/null
+++ b/arch/arm/mach-ns9xxx/clock.c
@@ -0,0 +1,215 @@
1/*
2 * arch/arm/mach-ns9xxx/clock.c
3 *
4 * Copyright (C) 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 <linux/err.h>
12#include <linux/module.h>
13#include <linux/list.h>
14#include <linux/clk.h>
15#include <linux/string.h>
16#include <linux/platform_device.h>
17
18#include <asm/semaphore.h>
19#include "clock.h"
20
21static LIST_HEAD(clocks);
22static DEFINE_SPINLOCK(clk_lock);
23
24struct clk *clk_get(struct device *dev, const char *id)
25{
26 struct clk *p, *ret = NULL, *retgen = NULL;
27 unsigned long flags;
28 int idno;
29
30 if (dev == NULL || dev->bus != &platform_bus_type)
31 idno = -1;
32 else
33 idno = to_platform_device(dev)->id;
34
35 spin_lock_irqsave(&clk_lock, flags);
36 list_for_each_entry(p, &clocks, node) {
37 if (strcmp(id, p->name) == 0) {
38 if (p->id == idno) {
39 if (!try_module_get(p->owner))
40 continue;
41 ret = p;
42 break;
43 } else if (p->id == -1)
44 /* remember match with id == -1 in case there is
45 * no clock for idno */
46 retgen = p;
47 }
48 }
49
50 if (!ret && retgen && try_module_get(retgen->owner))
51 ret = retgen;
52
53 if (ret)
54 ++ret->refcount;
55
56 spin_unlock_irqrestore(&clk_lock, flags);
57
58 return ret ? ret : ERR_PTR(-ENOENT);
59}
60EXPORT_SYMBOL(clk_get);
61
62void clk_put(struct clk *clk)
63{
64 module_put(clk->owner);
65 --clk->refcount;
66}
67EXPORT_SYMBOL(clk_put);
68
69static int clk_enable_unlocked(struct clk *clk)
70{
71 int ret = 0;
72 if (clk->parent) {
73 ret = clk_enable_unlocked(clk->parent);
74 if (ret)
75 return ret;
76 }
77
78 if (clk->usage++ == 0 && clk->endisable)
79 ret = clk->endisable(clk, 1);
80
81 return ret;
82}
83
84int clk_enable(struct clk *clk)
85{
86 int ret;
87 unsigned long flags;
88
89 spin_lock_irqsave(&clk_lock, flags);
90
91 ret = clk_enable_unlocked(clk);
92
93 spin_unlock_irqrestore(&clk_lock, flags);
94
95 return ret;
96}
97EXPORT_SYMBOL(clk_enable);
98
99static void clk_disable_unlocked(struct clk *clk)
100{
101 if (--clk->usage == 0 && clk->endisable)
102 clk->endisable(clk, 0);
103
104 if (clk->parent)
105 clk_disable_unlocked(clk->parent);
106}
107
108void clk_disable(struct clk *clk)
109{
110 unsigned long flags;
111
112 spin_lock_irqsave(&clk_lock, flags);
113
114 clk_disable_unlocked(clk);
115
116 spin_unlock_irqrestore(&clk_lock, flags);
117}
118EXPORT_SYMBOL(clk_disable);
119
120unsigned long clk_get_rate(struct clk *clk)
121{
122 if (clk->get_rate)
123 return clk->get_rate(clk);
124
125 if (clk->rate)
126 return clk->rate;
127
128 if (clk->parent)
129 return clk_get_rate(clk->parent);
130
131 return 0;
132}
133EXPORT_SYMBOL(clk_get_rate);
134
135int clk_register(struct clk *clk)
136{
137 unsigned long flags;
138
139 spin_lock_irqsave(&clk_lock, flags);
140
141 list_add(&clk->node, &clocks);
142
143 if (clk->parent)
144 ++clk->parent->refcount;
145
146 spin_unlock_irqrestore(&clk_lock, flags);
147
148 return 0;
149}
150
151int clk_unregister(struct clk *clk)
152{
153 int ret = 0;
154 unsigned long flags;
155
156 spin_lock_irqsave(&clk_lock, flags);
157
158 if (clk->usage || clk->refcount)
159 ret = -EBUSY;
160 else
161 list_del(&clk->node);
162
163 if (clk->parent)
164 --clk->parent->refcount;
165
166 spin_unlock_irqrestore(&clk_lock, flags);
167
168 return ret;
169}
170
171#if defined CONFIG_DEBUG_FS
172
173#include <linux/debugfs.h>
174#include <linux/seq_file.h>
175
176static int clk_debugfs_show(struct seq_file *s, void *null)
177{
178 unsigned long flags;
179 struct clk *p;
180
181 spin_lock_irqsave(&clk_lock, flags);
182
183 list_for_each_entry(p, &clocks, node)
184 seq_printf(s, "%s.%d: usage=%lu refcount=%lu rate=%lu\n",
185 p->name, p->id, p->usage, p->refcount,
186 p->usage ? clk_get_rate(p) : 0);
187
188 spin_unlock_irqrestore(&clk_lock, flags);
189
190 return 0;
191}
192
193static int clk_debugfs_open(struct inode *inode, struct file *file)
194{
195 return single_open(file, clk_debugfs_show, NULL);
196}
197
198static struct file_operations clk_debugfs_operations = {
199 .open = clk_debugfs_open,
200 .read = seq_read,
201 .llseek = seq_lseek,
202 .release = single_release,
203};
204
205static int __init clk_debugfs_init(void)
206{
207 struct dentry *dentry;
208
209 dentry = debugfs_create_file("clk", S_IFREG | S_IRUGO, NULL, NULL,
210 &clk_debugfs_operations);
211 return IS_ERR(dentry) ? PTR_ERR(dentry) : 0;
212}
213subsys_initcall(clk_debugfs_init);
214
215#endif /* if defined CONFIG_DEBUG_FS */
diff --git a/arch/arm/mach-ns9xxx/clock.h b/arch/arm/mach-ns9xxx/clock.h
new file mode 100644
index 000000000000..b86c30dd79eb
--- /dev/null
+++ b/arch/arm/mach-ns9xxx/clock.h
@@ -0,0 +1,35 @@
1/*
2 * arch/arm/mach-ns9xxx/clock.h
3 *
4 * Copyright (C) 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#ifndef __NS9XXX_CLOCK_H
12#define __NS9XXX_CLOCK_H
13
14#include <linux/list.h>
15
16struct clk {
17 struct module *owner;
18 const char *name;
19 int id;
20
21 struct clk *parent;
22
23 unsigned long rate;
24 int (*endisable)(struct clk *, int enable);
25 unsigned long (*get_rate)(struct clk *);
26
27 struct list_head node;
28 unsigned long refcount;
29 unsigned long usage;
30};
31
32int clk_register(struct clk *clk);
33int clk_unregister(struct clk *clk);
34
35#endif /* ifndef __NS9XXX_CLOCK_H */
diff --git a/arch/arm/mach-ns9xxx/generic.c b/arch/arm/mach-ns9xxx/generic.c
index d742c921e34d..1e0f467879cc 100644
--- a/arch/arm/mach-ns9xxx/generic.c
+++ b/arch/arm/mach-ns9xxx/generic.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * arch/arm/mach-ns9xxx/generic.c 2 * arch/arm/mach-ns9xxx/generic.c
3 * 3 *
4 * Copyright (C) 2006 by Digi International Inc. 4 * Copyright (C) 2006,2007 by Digi International Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify it 7 * This program is free software; you can redistribute it and/or modify it
@@ -11,34 +11,9 @@
11#include <linux/kernel.h> 11#include <linux/kernel.h>
12#include <linux/init.h> 12#include <linux/init.h>
13#include <asm/memory.h> 13#include <asm/memory.h>
14#include <asm/page.h>
15#include <asm/mach-types.h>
16#include <asm/mach/map.h>
17#include <asm/arch-ns9xxx/regs-sys.h>
18#include <asm/arch-ns9xxx/regs-mem.h>
19#include <asm/arch-ns9xxx/board.h>
20 14
21#include "generic.h" 15#include "generic.h"
22 16
23static struct map_desc standard_io_desc[] __initdata = {
24 { /* BBus */
25 .virtual = io_p2v(0x90000000),
26 .pfn = __phys_to_pfn(0x90000000),
27 .length = 0x00700000,
28 .type = MT_DEVICE,
29 }, { /* AHB */
30 .virtual = io_p2v(0xa0100000),
31 .pfn = __phys_to_pfn(0xa0100000),
32 .length = 0x00900000,
33 .type = MT_DEVICE,
34 },
35};
36
37void __init ns9xxx_map_io(void)
38{
39 iotable_init(standard_io_desc, ARRAY_SIZE(standard_io_desc));
40}
41
42void __init ns9xxx_init_machine(void) 17void __init ns9xxx_init_machine(void)
43{ 18{
44} 19}
diff --git a/arch/arm/mach-ns9xxx/generic.h b/arch/arm/mach-ns9xxx/generic.h
index 687e291773f4..82493191aad6 100644
--- a/arch/arm/mach-ns9xxx/generic.h
+++ b/arch/arm/mach-ns9xxx/generic.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * arch/arm/mach-ns9xxx/generic.h 2 * arch/arm/mach-ns9xxx/generic.h
3 * 3 *
4 * Copyright (C) 2006 by Digi International Inc. 4 * Copyright (C) 2006,2007 by Digi International Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify it 7 * This program is free software; you can redistribute it and/or modify it
@@ -13,7 +13,4 @@
13#include <linux/init.h> 13#include <linux/init.h>
14 14
15void __init ns9xxx_init_irq(void); 15void __init ns9xxx_init_irq(void);
16void __init ns9xxx_map_io(void);
17void __init ns9xxx_init_machine(void); 16void __init ns9xxx_init_machine(void);
18
19extern struct sys_timer ns9xxx_timer;
diff --git a/arch/arm/mach-ns9xxx/gpio-ns9360.c b/arch/arm/mach-ns9xxx/gpio-ns9360.c
new file mode 100644
index 000000000000..cabfb879dda9
--- /dev/null
+++ b/arch/arm/mach-ns9xxx/gpio-ns9360.c
@@ -0,0 +1,118 @@
1/*
2 * arch/arm/mach-ns9xxx/gpio-ns9360.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 <linux/bug.h>
12#include <linux/errno.h>
13#include <linux/io.h>
14#include <linux/kernel.h>
15#include <linux/module.h>
16
17#include <asm/arch-ns9xxx/regs-bbu.h>
18#include <asm/arch-ns9xxx/processor-ns9360.h>
19
20#include "gpio-ns9360.h"
21
22static inline int ns9360_valid_gpio(unsigned gpio)
23{
24 return gpio <= 72;
25}
26
27static inline void __iomem *ns9360_gpio_get_gconfaddr(unsigned gpio)
28{
29 if (gpio < 56)
30 return BBU_GCONFb1(gpio / 8);
31 else
32 /*
33 * this could be optimised away on
34 * ns9750 only builds, but it isn't ...
35 */
36 return BBU_GCONFb2((gpio - 56) / 8);
37}
38
39static inline void __iomem *ns9360_gpio_get_gctrladdr(unsigned gpio)
40{
41 if (gpio < 32)
42 return BBU_GCTRL1;
43 else if (gpio < 64)
44 return BBU_GCTRL2;
45 else
46 /* this could be optimised away on ns9750 only builds */
47 return BBU_GCTRL3;
48}
49
50static inline void __iomem *ns9360_gpio_get_gstataddr(unsigned gpio)
51{
52 if (gpio < 32)
53 return BBU_GSTAT1;
54 else if (gpio < 64)
55 return BBU_GSTAT2;
56 else
57 /* this could be optimised away on ns9750 only builds */
58 return BBU_GSTAT3;
59}
60
61/*
62 * each gpio can serve for 4 different purposes [0..3]. These are called
63 * "functions" and passed in the parameter func. Functions 0-2 are always some
64 * special things, function 3 is GPIO. If func == 3 dir specifies input or
65 * output, and with inv you can enable an inverter (independent of func).
66 */
67int __ns9360_gpio_configure(unsigned gpio, int dir, int inv, int func)
68{
69 void __iomem *conf = ns9360_gpio_get_gconfaddr(gpio);
70 u32 confval;
71
72 confval = __raw_readl(conf);
73 REGSETIM_IDX(confval, BBU_GCONFx, DIR, gpio & 7, dir);
74 REGSETIM_IDX(confval, BBU_GCONFx, INV, gpio & 7, inv);
75 REGSETIM_IDX(confval, BBU_GCONFx, FUNC, gpio & 7, func);
76 __raw_writel(confval, conf);
77
78 return 0;
79}
80
81int ns9360_gpio_configure(unsigned gpio, int inv, int func)
82{
83 if (likely(ns9360_valid_gpio(gpio))) {
84 if (func == 3) {
85 printk(KERN_WARNING "use gpio_direction_input "
86 "or gpio_direction_output\n");
87 return -EINVAL;
88 } else
89 return __ns9360_gpio_configure(gpio, 0, inv, func);
90 } else
91 return -EINVAL;
92}
93EXPORT_SYMBOL(ns9360_gpio_configure);
94
95int ns9360_gpio_get_value(unsigned gpio)
96{
97 void __iomem *stat = ns9360_gpio_get_gstataddr(gpio);
98 int ret;
99
100 ret = 1 & (__raw_readl(stat) >> (gpio & 31));
101
102 return ret;
103}
104
105void ns9360_gpio_set_value(unsigned gpio, int value)
106{
107 void __iomem *ctrl = ns9360_gpio_get_gctrladdr(gpio);
108 u32 ctrlval;
109
110 ctrlval = __raw_readl(ctrl);
111
112 if (value)
113 ctrlval |= 1 << (gpio & 31);
114 else
115 ctrlval &= ~(1 << (gpio & 31));
116
117 __raw_writel(ctrlval, ctrl);
118}
diff --git a/arch/arm/mach-ns9xxx/gpio-ns9360.h b/arch/arm/mach-ns9xxx/gpio-ns9360.h
new file mode 100644
index 000000000000..131cd1715caa
--- /dev/null
+++ b/arch/arm/mach-ns9xxx/gpio-ns9360.h
@@ -0,0 +1,13 @@
1/*
2 * arch/arm/mach-ns9xxx/gpio-ns9360.h
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 */
11int __ns9360_gpio_configure(unsigned gpio, int dir, int inv, int func);
12int ns9360_gpio_get_value(unsigned gpio);
13void ns9360_gpio_set_value(unsigned gpio, int value);
diff --git a/arch/arm/mach-ns9xxx/gpio.c b/arch/arm/mach-ns9xxx/gpio.c
index 5286e9fc1d30..b3c963b0c8f5 100644
--- a/arch/arm/mach-ns9xxx/gpio.c
+++ b/arch/arm/mach-ns9xxx/gpio.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * arch/arm/mach-ns9xxx/gpio.c 2 * arch/arm/mach-ns9xxx/gpio.c
3 * 3 *
4 * Copyright (C) 2006 by Digi International Inc. 4 * Copyright (C) 2006,2007 by Digi International Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify it 7 * This program is free software; you can redistribute it and/or modify it
@@ -15,12 +15,13 @@
15 15
16#include <asm/arch-ns9xxx/gpio.h> 16#include <asm/arch-ns9xxx/gpio.h>
17#include <asm/arch-ns9xxx/processor.h> 17#include <asm/arch-ns9xxx/processor.h>
18#include <asm/arch-ns9xxx/regs-bbu.h> 18#include <asm/arch-ns9xxx/processor-ns9360.h>
19#include <asm/io.h>
20#include <asm/bug.h> 19#include <asm/bug.h>
21#include <asm/types.h> 20#include <asm/types.h>
22#include <asm/bitops.h> 21#include <asm/bitops.h>
23 22
23#include "gpio-ns9360.h"
24
24#if defined(CONFIG_PROCESSOR_NS9360) 25#if defined(CONFIG_PROCESSOR_NS9360)
25#define GPIO_MAX 72 26#define GPIO_MAX 72
26#elif defined(CONFIG_PROCESSOR_NS9750) 27#elif defined(CONFIG_PROCESSOR_NS9750)
@@ -45,41 +46,10 @@ static inline int ns9xxx_valid_gpio(unsigned gpio)
45 return gpio <= 49; 46 return gpio <= 49;
46 else 47 else
47#endif 48#endif
49 {
48 BUG(); 50 BUG();
49} 51 return 0;
50 52 }
51static inline void __iomem *ns9xxx_gpio_get_gconfaddr(unsigned gpio)
52{
53 if (gpio < 56)
54 return BBU_GCONFb1(gpio / 8);
55 else
56 /*
57 * this could be optimised away on
58 * ns9750 only builds, but it isn't ...
59 */
60 return BBU_GCONFb2((gpio - 56) / 8);
61}
62
63static inline void __iomem *ns9xxx_gpio_get_gctrladdr(unsigned gpio)
64{
65 if (gpio < 32)
66 return BBU_GCTRL1;
67 else if (gpio < 64)
68 return BBU_GCTRL2;
69 else
70 /* this could be optimised away on ns9750 only builds */
71 return BBU_GCTRL3;
72}
73
74static inline void __iomem *ns9xxx_gpio_get_gstataddr(unsigned gpio)
75{
76 if (gpio < 32)
77 return BBU_GSTAT1;
78 else if (gpio < 64)
79 return BBU_GSTAT2;
80 else
81 /* this could be optimised away on ns9750 only builds */
82 return BBU_GSTAT3;
83} 53}
84 54
85int gpio_request(unsigned gpio, const char *label) 55int gpio_request(unsigned gpio, const char *label)
@@ -98,49 +68,24 @@ void gpio_free(unsigned gpio)
98} 68}
99EXPORT_SYMBOL(gpio_free); 69EXPORT_SYMBOL(gpio_free);
100 70
101/* 71int gpio_direction_input(unsigned gpio)
102 * each gpio can serve for 4 different purposes [0..3]. These are called
103 * "functions" and passed in the parameter func. Functions 0-2 are always some
104 * special things, function 3 is GPIO. If func == 3 dir specifies input or
105 * output, and with inv you can enable an inverter (independent of func).
106 */
107static int __ns9xxx_gpio_configure(unsigned gpio, int dir, int inv, int func)
108{ 72{
109 void __iomem *conf = ns9xxx_gpio_get_gconfaddr(gpio); 73 if (likely(ns9xxx_valid_gpio(gpio))) {
110 u32 confval; 74 int ret = -EINVAL;
111 unsigned long flags; 75 unsigned long flags;
112
113 spin_lock_irqsave(&gpio_lock, flags);
114
115 confval = __raw_readl(conf);
116 REGSETIM_IDX(confval, BBU_GCONFx, DIR, gpio & 7, dir);
117 REGSETIM_IDX(confval, BBU_GCONFx, INV, gpio & 7, inv);
118 REGSETIM_IDX(confval, BBU_GCONFx, FUNC, gpio & 7, func);
119 __raw_writel(confval, conf);
120 76
121 spin_unlock_irqrestore(&gpio_lock, flags); 77 spin_lock_irqsave(&gpio_lock, flags);
78#if defined(CONFIG_PROCESSOR_NS9360)
79 if (processor_is_ns9360())
80 ret = __ns9360_gpio_configure(gpio, 0, 0, 3);
81 else
82#endif
83 BUG();
122 84
123 return 0; 85 spin_unlock_irqrestore(&gpio_lock, flags);
124}
125 86
126int ns9xxx_gpio_configure(unsigned gpio, int inv, int func) 87 return ret;
127{
128 if (likely(ns9xxx_valid_gpio(gpio))) {
129 if (func == 3) {
130 printk(KERN_WARNING "use gpio_direction_input "
131 "or gpio_direction_output\n");
132 return -EINVAL;
133 } else
134 return __ns9xxx_gpio_configure(gpio, 0, inv, func);
135 } else
136 return -EINVAL;
137}
138EXPORT_SYMBOL(ns9xxx_gpio_configure);
139 88
140int gpio_direction_input(unsigned gpio)
141{
142 if (likely(ns9xxx_valid_gpio(gpio))) {
143 return __ns9xxx_gpio_configure(gpio, 0, 0, 3);
144 } else 89 } else
145 return -EINVAL; 90 return -EINVAL;
146} 91}
@@ -149,9 +94,22 @@ EXPORT_SYMBOL(gpio_direction_input);
149int gpio_direction_output(unsigned gpio, int value) 94int gpio_direction_output(unsigned gpio, int value)
150{ 95{
151 if (likely(ns9xxx_valid_gpio(gpio))) { 96 if (likely(ns9xxx_valid_gpio(gpio))) {
97 int ret = -EINVAL;
98 unsigned long flags;
99
152 gpio_set_value(gpio, value); 100 gpio_set_value(gpio, value);
153 101
154 return __ns9xxx_gpio_configure(gpio, 1, 0, 3); 102 spin_lock_irqsave(&gpio_lock, flags);
103#if defined(CONFIG_PROCESSOR_NS9360)
104 if (processor_is_ns9360())
105 ret = __ns9360_gpio_configure(gpio, 1, 0, 3);
106 else
107#endif
108 BUG();
109
110 spin_unlock_irqrestore(&gpio_lock, flags);
111
112 return ret;
155 } else 113 } else
156 return -EINVAL; 114 return -EINVAL;
157} 115}
@@ -159,31 +117,28 @@ EXPORT_SYMBOL(gpio_direction_output);
159 117
160int gpio_get_value(unsigned gpio) 118int gpio_get_value(unsigned gpio)
161{ 119{
162 void __iomem *stat = ns9xxx_gpio_get_gstataddr(gpio); 120#if defined(CONFIG_PROCESSOR_NS9360)
163 int ret; 121 if (processor_is_ns9360())
164 122 return ns9360_gpio_get_value(gpio);
165 ret = 1 & (__raw_readl(stat) >> (gpio & 31)); 123 else
166 124#endif
167 return ret; 125 {
126 BUG();
127 return -EINVAL;
128 }
168} 129}
169EXPORT_SYMBOL(gpio_get_value); 130EXPORT_SYMBOL(gpio_get_value);
170 131
171void gpio_set_value(unsigned gpio, int value) 132void gpio_set_value(unsigned gpio, int value)
172{ 133{
173 void __iomem *ctrl = ns9xxx_gpio_get_gctrladdr(gpio);
174 u32 ctrlval;
175 unsigned long flags; 134 unsigned long flags;
176
177 spin_lock_irqsave(&gpio_lock, flags); 135 spin_lock_irqsave(&gpio_lock, flags);
178 136#if defined(CONFIG_PROCESSOR_NS9360)
179 ctrlval = __raw_readl(ctrl); 137 if (processor_is_ns9360())
180 138 ns9360_gpio_set_value(gpio, value);
181 if (value)
182 ctrlval |= 1 << (gpio & 31);
183 else 139 else
184 ctrlval &= ~(1 << (gpio & 31)); 140#endif
185 141 BUG();
186 __raw_writel(ctrlval, ctrl);
187 142
188 spin_unlock_irqrestore(&gpio_lock, flags); 143 spin_unlock_irqrestore(&gpio_lock, flags);
189} 144}
diff --git a/arch/arm/mach-ns9xxx/irq.c b/arch/arm/mach-ns9xxx/irq.c
index 00001b874e97..36e5835e6097 100644
--- a/arch/arm/mach-ns9xxx/irq.c
+++ b/arch/arm/mach-ns9xxx/irq.c
@@ -9,21 +9,27 @@
9 * the Free Software Foundation. 9 * the Free Software Foundation.
10 */ 10 */
11#include <linux/interrupt.h> 11#include <linux/interrupt.h>
12#include <linux/kernel_stat.h>
12#include <asm/io.h> 13#include <asm/io.h>
13#include <asm/mach/irq.h> 14#include <asm/mach/irq.h>
14#include <asm/mach-types.h> 15#include <asm/mach-types.h>
15#include <asm/arch-ns9xxx/regs-sys.h> 16#include <asm/arch-ns9xxx/regs-sys-common.h>
16#include <asm/arch-ns9xxx/irqs.h> 17#include <asm/arch-ns9xxx/irqs.h>
17#include <asm/arch-ns9xxx/board.h> 18#include <asm/arch-ns9xxx/board.h>
18 19
19#include "generic.h" 20#include "generic.h"
20 21
22/* simple interrupt prio table: prio(x) < prio(y) <=> x < y */
23#define irq2prio(i) (i)
24#define prio2irq(p) (p)
25
21static void ns9xxx_mask_irq(unsigned int irq) 26static void ns9xxx_mask_irq(unsigned int irq)
22{ 27{
23 /* XXX: better use cpp symbols */ 28 /* XXX: better use cpp symbols */
24 u32 ic = __raw_readl(SYS_IC(irq / 4)); 29 int prio = irq2prio(irq);
25 ic &= ~(1 << (7 + 8 * (3 - (irq & 3)))); 30 u32 ic = __raw_readl(SYS_IC(prio / 4));
26 __raw_writel(ic, SYS_IC(irq / 4)); 31 ic &= ~(1 << (7 + 8 * (3 - (prio & 3))));
32 __raw_writel(ic, SYS_IC(prio / 4));
27} 33}
28 34
29static void ns9xxx_ack_irq(unsigned int irq) 35static void ns9xxx_ack_irq(unsigned int irq)
@@ -40,9 +46,10 @@ static void ns9xxx_maskack_irq(unsigned int irq)
40static void ns9xxx_unmask_irq(unsigned int irq) 46static void ns9xxx_unmask_irq(unsigned int irq)
41{ 47{
42 /* XXX: better use cpp symbols */ 48 /* XXX: better use cpp symbols */
43 u32 ic = __raw_readl(SYS_IC(irq / 4)); 49 int prio = irq2prio(irq);
44 ic |= 1 << (7 + 8 * (3 - (irq & 3))); 50 u32 ic = __raw_readl(SYS_IC(prio / 4));
45 __raw_writel(ic, SYS_IC(irq / 4)); 51 ic |= 1 << (7 + 8 * (3 - (prio & 3)));
52 __raw_writel(ic, SYS_IC(prio / 4));
46} 53}
47 54
48static struct irq_chip ns9xxx_chip = { 55static struct irq_chip ns9xxx_chip = {
@@ -52,24 +59,61 @@ static struct irq_chip ns9xxx_chip = {
52 .unmask = ns9xxx_unmask_irq, 59 .unmask = ns9xxx_unmask_irq,
53}; 60};
54 61
62#if 0
63#define handle_irq handle_level_irq
64#else
65void handle_prio_irq(unsigned int irq, struct irq_desc *desc)
66{
67 unsigned int cpu = smp_processor_id();
68 struct irqaction *action;
69 irqreturn_t action_ret;
70
71 spin_lock(&desc->lock);
72
73 if (unlikely(desc->status & IRQ_INPROGRESS))
74 goto out_unlock;
75
76 desc->status &= ~(IRQ_REPLAY | IRQ_WAITING);
77 kstat_cpu(cpu).irqs[irq]++;
78
79 action = desc->action;
80 if (unlikely(!action || (desc->status & IRQ_DISABLED)))
81 goto out_unlock;
82
83 desc->status |= IRQ_INPROGRESS;
84 spin_unlock(&desc->lock);
85
86 action_ret = handle_IRQ_event(irq, action);
87
88 spin_lock(&desc->lock);
89 desc->status &= ~IRQ_INPROGRESS;
90 if (!(desc->status & IRQ_DISABLED) && desc->chip->ack)
91 desc->chip->ack(irq);
92
93out_unlock:
94 spin_unlock(&desc->lock);
95}
96#define handle_irq handle_prio_irq
97#endif
98
55void __init ns9xxx_init_irq(void) 99void __init ns9xxx_init_irq(void)
56{ 100{
57 int i; 101 int i;
58 102
59 /* disable all IRQs */ 103 /* disable all IRQs */
60 for (i = 0; i < 8; ++i) 104 for (i = 0; i < 8; ++i)
61 __raw_writel((4 * i) << 24 | (4 * i + 1) << 16 | 105 __raw_writel(prio2irq(4 * i) << 24 |
62 (4 * i + 2) << 8 | (4 * i + 3), SYS_IC(i)); 106 prio2irq(4 * i + 1) << 16 |
107 prio2irq(4 * i + 2) << 8 |
108 prio2irq(4 * i + 3),
109 SYS_IC(i));
63 110
64 /* simple interrupt prio table:
65 * prio(x) < prio(y) <=> x < y
66 */
67 for (i = 0; i < 32; ++i) 111 for (i = 0; i < 32; ++i)
68 __raw_writel(i, SYS_IVA(i)); 112 __raw_writel(prio2irq(i), SYS_IVA(i));
69 113
70 for (i = IRQ_WATCHDOG; i <= IRQ_EXT3; ++i) { 114 for (i = 0; i <= 31; ++i) {
71 set_irq_chip(i, &ns9xxx_chip); 115 set_irq_chip(i, &ns9xxx_chip);
72 set_irq_handler(i, handle_level_irq); 116 set_irq_handler(i, handle_irq);
73 set_irq_flags(i, IRQF_VALID); 117 set_irq_flags(i, IRQF_VALID);
74 } 118 }
75} 119}
diff --git a/arch/arm/mach-ns9xxx/mach-cc9p9360dev.c b/arch/arm/mach-ns9xxx/mach-cc9p9360dev.c
index 760c9d0db7c3..9623fff6b3bc 100644
--- a/arch/arm/mach-ns9xxx/mach-cc9p9360dev.c
+++ b/arch/arm/mach-ns9xxx/mach-cc9p9360dev.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * arch/arm/mach-ns9xxx/mach-cc9p9360dev.c 2 * arch/arm/mach-ns9xxx/mach-cc9p9360dev.c
3 * 3 *
4 * Copyright (C) 2006 by Digi International Inc. 4 * Copyright (C) 2006,2007 by Digi International Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify it 7 * This program is free software; you can redistribute it and/or modify it
@@ -11,12 +11,14 @@
11#include <asm/mach/arch.h> 11#include <asm/mach/arch.h>
12#include <asm/mach-types.h> 12#include <asm/mach-types.h>
13 13
14#include <asm/arch-ns9xxx/processor-ns9360.h>
15
14#include "board-a9m9750dev.h" 16#include "board-a9m9750dev.h"
15#include "generic.h" 17#include "generic.h"
16 18
17static void __init mach_cc9p9360dev_map_io(void) 19static void __init mach_cc9p9360dev_map_io(void)
18{ 20{
19 ns9xxx_map_io(); 21 ns9360_map_io();
20 board_a9m9750dev_map_io(); 22 board_a9m9750dev_map_io();
21} 23}
22 24
@@ -36,6 +38,6 @@ MACHINE_START(CC9P9360DEV, "Digi ConnectCore 9P 9360 on an A9M9750 Devboard")
36 .map_io = mach_cc9p9360dev_map_io, 38 .map_io = mach_cc9p9360dev_map_io,
37 .init_irq = mach_cc9p9360dev_init_irq, 39 .init_irq = mach_cc9p9360dev_init_irq,
38 .init_machine = mach_cc9p9360dev_init_machine, 40 .init_machine = mach_cc9p9360dev_init_machine,
39 .timer = &ns9xxx_timer, 41 .timer = &ns9360_timer,
40 .boot_params = 0x100, 42 .boot_params = 0x100,
41MACHINE_END 43MACHINE_END
diff --git a/arch/arm/mach-ns9xxx/mach-cc9p9360js.c b/arch/arm/mach-ns9xxx/mach-cc9p9360js.c
index 85c8b41105c9..fcc815bdd291 100644
--- a/arch/arm/mach-ns9xxx/mach-cc9p9360js.c
+++ b/arch/arm/mach-ns9xxx/mach-cc9p9360js.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * arch/arm/mach-ns9xxx/mach-cc9p9360js.c 2 * arch/arm/mach-ns9xxx/mach-cc9p9360js.c
3 * 3 *
4 * Copyright (C) 2006 by Digi International Inc. 4 * Copyright (C) 2006,2007 by Digi International Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify it 7 * This program is free software; you can redistribute it and/or modify it
@@ -11,6 +11,8 @@
11#include <asm/mach/arch.h> 11#include <asm/mach/arch.h>
12#include <asm/mach-types.h> 12#include <asm/mach-types.h>
13 13
14#include <asm/arch-ns9xxx/processor-ns9360.h>
15
14#include "board-jscc9p9360.h" 16#include "board-jscc9p9360.h"
15#include "generic.h" 17#include "generic.h"
16 18
@@ -21,9 +23,9 @@ static void __init mach_cc9p9360js_init_machine(void)
21} 23}
22 24
23MACHINE_START(CC9P9360JS, "Digi ConnectCore 9P 9360 on an JSCC9P9360 Devboard") 25MACHINE_START(CC9P9360JS, "Digi ConnectCore 9P 9360 on an JSCC9P9360 Devboard")
24 .map_io = ns9xxx_map_io, 26 .map_io = ns9360_map_io,
25 .init_irq = ns9xxx_init_irq, 27 .init_irq = ns9xxx_init_irq,
26 .init_machine = mach_cc9p9360js_init_machine, 28 .init_machine = mach_cc9p9360js_init_machine,
27 .timer = &ns9xxx_timer, 29 .timer = &ns9360_timer,
28 .boot_params = 0x100, 30 .boot_params = 0x100,
29MACHINE_END 31MACHINE_END
diff --git a/arch/arm/mach-ns9xxx/plat-serial8250.c b/arch/arm/mach-ns9xxx/plat-serial8250.c
new file mode 100644
index 000000000000..5aa5d9baf8c8
--- /dev/null
+++ b/arch/arm/mach-ns9xxx/plat-serial8250.c
@@ -0,0 +1,69 @@
1/*
2 * arch/arm/mach-ns9xxx/plat-serial8250.c
3 *
4 * Copyright (C) 2008 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/platform_device.h>
12#include <linux/serial_8250.h>
13
14#include <asm/arch-ns9xxx/regs-board-a9m9750dev.h>
15#include <asm/arch-ns9xxx/board.h>
16
17#define DRIVER_NAME "serial8250"
18
19static int __init ns9xxx_plat_serial8250_init(void)
20{
21 struct plat_serial8250_port *pdata;
22 struct platform_device *pdev;
23 int ret = -ENOMEM;
24 int i;
25
26 if (!board_is_a9m9750dev())
27 return -ENODEV;
28
29 pdev = platform_device_alloc(DRIVER_NAME, 0);
30 if (!pdev)
31 goto err;
32
33 pdata = kzalloc(5 * sizeof(*pdata), GFP_KERNEL);
34 if (!pdata)
35 goto err;
36
37 pdev->dev.platform_data = pdata;
38
39 pdata[0].iobase = FPGA_UARTA_BASE;
40 pdata[1].iobase = FPGA_UARTB_BASE;
41 pdata[2].iobase = FPGA_UARTC_BASE;
42 pdata[3].iobase = FPGA_UARTD_BASE;
43
44 for (i = 0; i < 4; ++i) {
45 pdata[i].membase = (void __iomem *)pdata[i].iobase;
46 pdata[i].mapbase = pdata[i].iobase;
47 pdata[i].iotype = UPIO_MEM;
48 pdata[i].uartclk = 18432000;
49 pdata[i].flags = UPF_BOOT_AUTOCONF | UPF_SHARE_IRQ;
50 }
51
52 pdata[0].irq = IRQ_FPGA_UARTA;
53 pdata[1].irq = IRQ_FPGA_UARTB;
54 pdata[2].irq = IRQ_FPGA_UARTC;
55 pdata[3].irq = IRQ_FPGA_UARTD;
56
57 ret = platform_device_add(pdev);
58 if (ret) {
59err:
60 platform_device_put(pdev);
61
62 printk(KERN_WARNING "Could not add %s (errno=%d)\n",
63 DRIVER_NAME, ret);
64 }
65
66 return 0;
67}
68
69arch_initcall(ns9xxx_plat_serial8250_init);
diff --git a/arch/arm/mach-ns9xxx/processor-ns9360.c b/arch/arm/mach-ns9xxx/processor-ns9360.c
new file mode 100644
index 000000000000..2bee0b7fccbb
--- /dev/null
+++ b/arch/arm/mach-ns9xxx/processor-ns9360.c
@@ -0,0 +1,54 @@
1/*
2 * arch/arm/mach-ns9xxx/processor-ns9360.c
3 *
4 * Copyright (C) 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 <linux/io.h>
12#include <linux/kernel.h>
13#include <linux/slab.h>
14
15#include <asm/page.h>
16#include <asm/mach/map.h>
17#include <asm/arch-ns9xxx/processor-ns9360.h>
18#include <asm/arch-ns9xxx/regs-sys-ns9360.h>
19
20void ns9360_reset(char mode)
21{
22 u32 reg;
23
24 reg = __raw_readl(SYS_PLL) >> 16;
25 REGSET(reg, SYS_PLL, SWC, YES);
26 __raw_writel(reg, SYS_PLL);
27}
28
29#define CRYSTAL 29491200 /* Hz */
30unsigned long ns9360_systemclock(void)
31{
32 u32 pll = __raw_readl(SYS_PLL);
33 return CRYSTAL * (REGGETIM(pll, SYS_PLL, ND) + 1)
34 >> REGGETIM(pll, SYS_PLL, FS);
35}
36
37static struct map_desc ns9360_io_desc[] __initdata = {
38 { /* BBus */
39 .virtual = io_p2v(0x90000000),
40 .pfn = __phys_to_pfn(0x90000000),
41 .length = 0x00700000,
42 .type = MT_DEVICE,
43 }, { /* AHB */
44 .virtual = io_p2v(0xa0100000),
45 .pfn = __phys_to_pfn(0xa0100000),
46 .length = 0x00900000,
47 .type = MT_DEVICE,
48 },
49};
50
51void __init ns9360_map_io(void)
52{
53 iotable_init(ns9360_io_desc, ARRAY_SIZE(ns9360_io_desc));
54}
diff --git a/arch/arm/mach-ns9xxx/time.c b/arch/arm/mach-ns9xxx/time-ns9360.c
index c3dd1f4acb99..4d573c9793ed 100644
--- a/arch/arm/mach-ns9xxx/time.c
+++ b/arch/arm/mach-ns9xxx/time-ns9360.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * arch/arm/mach-ns9xxx/time.c 2 * arch/arm/mach-ns9xxx/time-ns9360.c
3 * 3 *
4 * Copyright (C) 2006 by Digi International Inc. 4 * Copyright (C) 2006,2007 by Digi International Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify it 7 * This program is free software; you can redistribute it and/or modify it
@@ -15,8 +15,8 @@
15#include <linux/clocksource.h> 15#include <linux/clocksource.h>
16#include <linux/clockchips.h> 16#include <linux/clockchips.h>
17 17
18#include <asm/arch-ns9xxx/regs-sys.h> 18#include <asm/arch-ns9xxx/processor-ns9360.h>
19#include <asm/arch-ns9xxx/clock.h> 19#include <asm/arch-ns9xxx/regs-sys-ns9360.h>
20#include <asm/arch-ns9xxx/irqs.h> 20#include <asm/arch-ns9xxx/irqs.h>
21#include <asm/arch/system.h> 21#include <asm/arch/system.h>
22#include "generic.h" 22#include "generic.h"
@@ -25,26 +25,26 @@
25#define TIMER_CLOCKEVENT 1 25#define TIMER_CLOCKEVENT 1
26static u32 latch; 26static u32 latch;
27 27
28static cycle_t ns9xxx_clocksource_read(void) 28static cycle_t ns9360_clocksource_read(void)
29{ 29{
30 return __raw_readl(SYS_TR(TIMER_CLOCKSOURCE)); 30 return __raw_readl(SYS_TR(TIMER_CLOCKSOURCE));
31} 31}
32 32
33static struct clocksource ns9xxx_clocksource = { 33static struct clocksource ns9360_clocksource = {
34 .name = "ns9xxx-timer" __stringify(TIMER_CLOCKSOURCE), 34 .name = "ns9360-timer" __stringify(TIMER_CLOCKSOURCE),
35 .rating = 300, 35 .rating = 300,
36 .read = ns9xxx_clocksource_read, 36 .read = ns9360_clocksource_read,
37 .mask = CLOCKSOURCE_MASK(32), 37 .mask = CLOCKSOURCE_MASK(32),
38 .shift = 20, 38 .shift = 20,
39 .flags = CLOCK_SOURCE_IS_CONTINUOUS, 39 .flags = CLOCK_SOURCE_IS_CONTINUOUS,
40}; 40};
41 41
42static void ns9xxx_clockevent_setmode(enum clock_event_mode mode, 42static void ns9360_clockevent_setmode(enum clock_event_mode mode,
43 struct clock_event_device *clk) 43 struct clock_event_device *clk)
44{ 44{
45 u32 tc = __raw_readl(SYS_TC(TIMER_CLOCKEVENT)); 45 u32 tc = __raw_readl(SYS_TC(TIMER_CLOCKEVENT));
46 46
47 switch(mode) { 47 switch (mode) {
48 case CLOCK_EVT_MODE_PERIODIC: 48 case CLOCK_EVT_MODE_PERIODIC:
49 __raw_writel(latch, SYS_TRC(TIMER_CLOCKEVENT)); 49 __raw_writel(latch, SYS_TRC(TIMER_CLOCKEVENT));
50 REGSET(tc, SYS_TCx, REN, EN); 50 REGSET(tc, SYS_TCx, REN, EN);
@@ -69,7 +69,7 @@ static void ns9xxx_clockevent_setmode(enum clock_event_mode mode,
69 __raw_writel(tc, SYS_TC(TIMER_CLOCKEVENT)); 69 __raw_writel(tc, SYS_TC(TIMER_CLOCKEVENT));
70} 70}
71 71
72static int ns9xxx_clockevent_setnextevent(unsigned long evt, 72static int ns9360_clockevent_setnextevent(unsigned long evt,
73 struct clock_event_device *clk) 73 struct clock_event_device *clk)
74{ 74{
75 u32 tc = __raw_readl(SYS_TC(TIMER_CLOCKEVENT)); 75 u32 tc = __raw_readl(SYS_TC(TIMER_CLOCKEVENT));
@@ -88,20 +88,20 @@ static int ns9xxx_clockevent_setnextevent(unsigned long evt,
88 return 0; 88 return 0;
89} 89}
90 90
91static struct clock_event_device ns9xxx_clockevent_device = { 91static struct clock_event_device ns9360_clockevent_device = {
92 .name = "ns9xxx-timer" __stringify(TIMER_CLOCKEVENT), 92 .name = "ns9360-timer" __stringify(TIMER_CLOCKEVENT),
93 .shift = 20, 93 .shift = 20,
94 .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT, 94 .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT,
95 .set_mode = ns9xxx_clockevent_setmode, 95 .set_mode = ns9360_clockevent_setmode,
96 .set_next_event = ns9xxx_clockevent_setnextevent, 96 .set_next_event = ns9360_clockevent_setnextevent,
97}; 97};
98 98
99static irqreturn_t ns9xxx_clockevent_handler(int irq, void *dev_id) 99static irqreturn_t ns9360_clockevent_handler(int irq, void *dev_id)
100{ 100{
101 int timerno = irq - IRQ_TIMER0; 101 int timerno = irq - IRQ_NS9360_TIMER0;
102 u32 tc; 102 u32 tc;
103 103
104 struct clock_event_device *evt = &ns9xxx_clockevent_device; 104 struct clock_event_device *evt = &ns9360_clockevent_device;
105 105
106 /* clear irq */ 106 /* clear irq */
107 tc = __raw_readl(SYS_TC(timerno)); 107 tc = __raw_readl(SYS_TC(timerno));
@@ -119,13 +119,13 @@ static irqreturn_t ns9xxx_clockevent_handler(int irq, void *dev_id)
119 return IRQ_HANDLED; 119 return IRQ_HANDLED;
120} 120}
121 121
122static struct irqaction ns9xxx_clockevent_action = { 122static struct irqaction ns9360_clockevent_action = {
123 .name = "ns9xxx-timer" __stringify(TIMER_CLOCKEVENT), 123 .name = "ns9360-timer" __stringify(TIMER_CLOCKEVENT),
124 .flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL, 124 .flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL,
125 .handler = ns9xxx_clockevent_handler, 125 .handler = ns9360_clockevent_handler,
126}; 126};
127 127
128static void __init ns9xxx_timer_init(void) 128static void __init ns9360_timer_init(void)
129{ 129{
130 int tc; 130 int tc;
131 131
@@ -148,12 +148,12 @@ static void __init ns9xxx_timer_init(void)
148 148
149 __raw_writel(tc, SYS_TC(TIMER_CLOCKSOURCE)); 149 __raw_writel(tc, SYS_TC(TIMER_CLOCKSOURCE));
150 150
151 ns9xxx_clocksource.mult = clocksource_hz2mult(ns9xxx_cpuclock(), 151 ns9360_clocksource.mult = clocksource_hz2mult(ns9360_cpuclock(),
152 ns9xxx_clocksource.shift); 152 ns9360_clocksource.shift);
153 153
154 clocksource_register(&ns9xxx_clocksource); 154 clocksource_register(&ns9360_clocksource);
155 155
156 latch = SH_DIV(ns9xxx_cpuclock(), HZ, 0); 156 latch = SH_DIV(ns9360_cpuclock(), HZ, 0);
157 157
158 tc = __raw_readl(SYS_TC(TIMER_CLOCKEVENT)); 158 tc = __raw_readl(SYS_TC(TIMER_CLOCKEVENT));
159 REGSET(tc, SYS_TCx, TEN, DIS); 159 REGSET(tc, SYS_TCx, TEN, DIS);
@@ -166,19 +166,20 @@ static void __init ns9xxx_timer_init(void)
166 REGSET(tc, SYS_TCx, REN, EN); 166 REGSET(tc, SYS_TCx, REN, EN);
167 __raw_writel(tc, SYS_TC(TIMER_CLOCKEVENT)); 167 __raw_writel(tc, SYS_TC(TIMER_CLOCKEVENT));
168 168
169 ns9xxx_clockevent_device.mult = div_sc(ns9xxx_cpuclock(), 169 ns9360_clockevent_device.mult = div_sc(ns9360_cpuclock(),
170 NSEC_PER_SEC, ns9xxx_clockevent_device.shift); 170 NSEC_PER_SEC, ns9360_clockevent_device.shift);
171 ns9xxx_clockevent_device.max_delta_ns = 171 ns9360_clockevent_device.max_delta_ns =
172 clockevent_delta2ns(-1, &ns9xxx_clockevent_device); 172 clockevent_delta2ns(-1, &ns9360_clockevent_device);
173 ns9xxx_clockevent_device.min_delta_ns = 173 ns9360_clockevent_device.min_delta_ns =
174 clockevent_delta2ns(1, &ns9xxx_clockevent_device); 174 clockevent_delta2ns(1, &ns9360_clockevent_device);
175 175
176 ns9xxx_clockevent_device.cpumask = cpumask_of_cpu(0); 176 ns9360_clockevent_device.cpumask = cpumask_of_cpu(0);
177 clockevents_register_device(&ns9xxx_clockevent_device); 177 clockevents_register_device(&ns9360_clockevent_device);
178 178
179 setup_irq(IRQ_TIMER0 + TIMER_CLOCKEVENT, &ns9xxx_clockevent_action); 179 setup_irq(IRQ_NS9360_TIMER0 + TIMER_CLOCKEVENT,
180 &ns9360_clockevent_action);
180} 181}
181 182
182struct sys_timer ns9xxx_timer = { 183struct sys_timer ns9360_timer = {
183 .init = ns9xxx_timer_init, 184 .init = ns9360_timer_init,
184}; 185};
diff --git a/arch/arm/mach-orion/addr-map.c b/arch/arm/mach-orion/addr-map.c
deleted file mode 100644
index 58cc3c0333b6..000000000000
--- a/arch/arm/mach-orion/addr-map.c
+++ /dev/null
@@ -1,490 +0,0 @@
1/*
2 * arch/arm/mach-orion/addr-map.c
3 *
4 * Address map functions for Marvell Orion System On Chip
5 *
6 * Maintainer: Tzachi Perelstein <tzachi@marvell.com>
7 *
8 * This file is licensed under the terms of the GNU General Public
9 * License version 2. This program is licensed "as is" without any
10 * warranty of any kind, whether express or implied.
11 */
12
13#include <linux/kernel.h>
14#include <linux/init.h>
15#include <asm/hardware.h>
16#include "common.h"
17
18/*
19 * The Orion has fully programable address map. There's a separate address
20 * map for each of the device _master_ interfaces, e.g. CPU, PCI, PCIE, USB,
21 * Gigabit Ethernet, DMA/XOR engines, etc. Each interface has its own
22 * address decode windows that allow it to access any of the Orion resources.
23 *
24 * CPU address decoding --
25 * Linux assumes that it is the boot loader that already setup the access to
26 * DDR and internal registers.
27 * Setup access to PCI and PCI-E IO/MEM space is issued by core.c.
28 * Setup access to various devices located on the device bus interface (e.g.
29 * flashes, RTC, etc) should be issued by machine-setup.c according to
30 * specific board population (by using orion_setup_cpu_win()).
31 *
32 * Non-CPU Masters address decoding --
33 * Unlike the CPU, we setup the access from Orion's master interfaces to DDR
34 * banks only (the typical use case).
35 * Setup access for each master to DDR is issued by common.c.
36 *
37 * Note: although orion_setbits() and orion_clrbits() are not atomic
38 * no locking is necessary here since code in this file is only called
39 * at boot time when there is no concurrency issues.
40 */
41
42/*
43 * Generic Address Decode Windows bit settings
44 */
45#define TARGET_DDR 0
46#define TARGET_PCI 3
47#define TARGET_PCIE 4
48#define TARGET_DEV_BUS 1
49#define ATTR_DDR_CS(n) (((n) ==0) ? 0xe : \
50 ((n) == 1) ? 0xd : \
51 ((n) == 2) ? 0xb : \
52 ((n) == 3) ? 0x7 : 0xf)
53#define ATTR_PCIE_MEM 0x59
54#define ATTR_PCIE_IO 0x51
55#define ATTR_PCI_MEM 0x59
56#define ATTR_PCI_IO 0x51
57#define ATTR_DEV_CS0 0x1e
58#define ATTR_DEV_CS1 0x1d
59#define ATTR_DEV_CS2 0x1b
60#define ATTR_DEV_BOOT 0xf
61#define WIN_EN 1
62
63/*
64 * Helpers to get DDR banks info
65 */
66#define DDR_BASE_CS(n) ORION_DDR_REG(0x1500 + ((n) * 8))
67#define DDR_SIZE_CS(n) ORION_DDR_REG(0x1504 + ((n) * 8))
68#define DDR_MAX_CS 4
69#define DDR_REG_TO_SIZE(reg) (((reg) | 0xffffff) + 1)
70#define DDR_REG_TO_BASE(reg) ((reg) & 0xff000000)
71#define DDR_BANK_EN 1
72
73/*
74 * CPU Address Decode Windows registers
75 */
76#define CPU_WIN_CTRL(n) ORION_BRIDGE_REG(0x000 | ((n) << 4))
77#define CPU_WIN_BASE(n) ORION_BRIDGE_REG(0x004 | ((n) << 4))
78#define CPU_WIN_REMAP_LO(n) ORION_BRIDGE_REG(0x008 | ((n) << 4))
79#define CPU_WIN_REMAP_HI(n) ORION_BRIDGE_REG(0x00c | ((n) << 4))
80#define CPU_MAX_WIN 8
81
82/*
83 * Use this CPU address decode windows allocation
84 */
85#define CPU_WIN_PCIE_IO 0
86#define CPU_WIN_PCI_IO 1
87#define CPU_WIN_PCIE_MEM 2
88#define CPU_WIN_PCI_MEM 3
89#define CPU_WIN_DEV_BOOT 4
90#define CPU_WIN_DEV_CS0 5
91#define CPU_WIN_DEV_CS1 6
92#define CPU_WIN_DEV_CS2 7
93
94/*
95 * PCIE Address Decode Windows registers
96 */
97#define PCIE_BAR_CTRL(n) ORION_PCIE_REG(0x1804 + ((n - 1) * 4))
98#define PCIE_BAR_LO(n) ORION_PCIE_REG(0x0010 + ((n) * 8))
99#define PCIE_BAR_HI(n) ORION_PCIE_REG(0x0014 + ((n) * 8))
100#define PCIE_WIN_CTRL(n) (((n) < 5) ? \
101 ORION_PCIE_REG(0x1820 + ((n) << 4)) : \
102 ORION_PCIE_REG(0x1880))
103#define PCIE_WIN_BASE(n) (((n) < 5) ? \
104 ORION_PCIE_REG(0x1824 + ((n) << 4)) : \
105 ORION_PCIE_REG(0x1884))
106#define PCIE_WIN_REMAP(n) (((n) < 5) ? \
107 ORION_PCIE_REG(0x182c + ((n) << 4)) : \
108 ORION_PCIE_REG(0x188c))
109#define PCIE_DEFWIN_CTRL ORION_PCIE_REG(0x18b0)
110#define PCIE_EXPROM_WIN_CTRL ORION_PCIE_REG(0x18c0)
111#define PCIE_EXPROM_WIN_REMP ORION_PCIE_REG(0x18c4)
112#define PCIE_MAX_BARS 3
113#define PCIE_MAX_WINS 6
114
115/*
116 * Use PCIE BAR '1' for all DDR banks
117 */
118#define PCIE_DRAM_BAR 1
119
120/*
121 * PCI Address Decode Windows registers
122 */
123#define PCI_BAR_SIZE_DDR_CS(n) (((n) == 0) ? ORION_PCI_REG(0xc08) : \
124 ((n) == 1) ? ORION_PCI_REG(0xd08) : \
125 ((n) == 2) ? ORION_PCI_REG(0xc0c) : \
126 ((n) == 3) ? ORION_PCI_REG(0xd0c) : 0)
127#define PCI_BAR_REMAP_DDR_CS(n) (((n) ==0) ? ORION_PCI_REG(0xc48) : \
128 ((n) == 1) ? ORION_PCI_REG(0xd48) : \
129 ((n) == 2) ? ORION_PCI_REG(0xc4c) : \
130 ((n) == 3) ? ORION_PCI_REG(0xd4c) : 0)
131#define PCI_BAR_ENABLE ORION_PCI_REG(0xc3c)
132#define PCI_CTRL_BASE_LO(n) ORION_PCI_REG(0x1e00 | ((n) << 4))
133#define PCI_CTRL_BASE_HI(n) ORION_PCI_REG(0x1e04 | ((n) << 4))
134#define PCI_CTRL_SIZE(n) ORION_PCI_REG(0x1e08 | ((n) << 4))
135#define PCI_ADDR_DECODE_CTRL ORION_PCI_REG(0xd3c)
136
137/*
138 * PCI configuration heleprs for BAR settings
139 */
140#define PCI_CONF_FUNC_BAR_CS(n) ((n) >> 1)
141#define PCI_CONF_REG_BAR_LO_CS(n) (((n) & 1) ? 0x18 : 0x10)
142#define PCI_CONF_REG_BAR_HI_CS(n) (((n) & 1) ? 0x1c : 0x14)
143
144/*
145 * Gigabit Ethernet Address Decode Windows registers
146 */
147#define ETH_WIN_BASE(win) ORION_ETH_REG(0x200 + ((win) * 8))
148#define ETH_WIN_SIZE(win) ORION_ETH_REG(0x204 + ((win) * 8))
149#define ETH_WIN_REMAP(win) ORION_ETH_REG(0x280 + ((win) * 4))
150#define ETH_WIN_EN ORION_ETH_REG(0x290)
151#define ETH_WIN_PROT ORION_ETH_REG(0x294)
152#define ETH_MAX_WIN 6
153#define ETH_MAX_REMAP_WIN 4
154
155/*
156 * USB Address Decode Windows registers
157 */
158#define USB_WIN_CTRL(i, w) ((i == 0) ? ORION_USB0_REG(0x320 + ((w) << 4)) \
159 : ORION_USB1_REG(0x320 + ((w) << 4)))
160#define USB_WIN_BASE(i, w) ((i == 0) ? ORION_USB0_REG(0x324 + ((w) << 4)) \
161 : ORION_USB1_REG(0x324 + ((w) << 4)))
162#define USB_MAX_WIN 4
163
164/*
165 * SATA Address Decode Windows registers
166 */
167#define SATA_WIN_CTRL(win) ORION_SATA_REG(0x30 + ((win) * 0x10))
168#define SATA_WIN_BASE(win) ORION_SATA_REG(0x34 + ((win) * 0x10))
169#define SATA_MAX_WIN 4
170
171static int __init orion_cpu_win_can_remap(u32 win)
172{
173 u32 dev, rev;
174
175 orion_pcie_id(&dev, &rev);
176 if ((dev == MV88F5281_DEV_ID && win < 4)
177 || (dev == MV88F5182_DEV_ID && win < 2)
178 || (dev == MV88F5181_DEV_ID && win < 2))
179 return 1;
180
181 return 0;
182}
183
184void __init orion_setup_cpu_win(enum orion_target target, u32 base, u32 size, int remap)
185{
186 u32 win, attr, ctrl;
187
188 switch (target) {
189 case ORION_PCIE_IO:
190 target = TARGET_PCIE;
191 attr = ATTR_PCIE_IO;
192 win = CPU_WIN_PCIE_IO;
193 break;
194 case ORION_PCI_IO:
195 target = TARGET_PCI;
196 attr = ATTR_PCI_IO;
197 win = CPU_WIN_PCI_IO;
198 break;
199 case ORION_PCIE_MEM:
200 target = TARGET_PCIE;
201 attr = ATTR_PCIE_MEM;
202 win = CPU_WIN_PCIE_MEM;
203 break;
204 case ORION_PCI_MEM:
205 target = TARGET_PCI;
206 attr = ATTR_PCI_MEM;
207 win = CPU_WIN_PCI_MEM;
208 break;
209 case ORION_DEV_BOOT:
210 target = TARGET_DEV_BUS;
211 attr = ATTR_DEV_BOOT;
212 win = CPU_WIN_DEV_BOOT;
213 break;
214 case ORION_DEV0:
215 target = TARGET_DEV_BUS;
216 attr = ATTR_DEV_CS0;
217 win = CPU_WIN_DEV_CS0;
218 break;
219 case ORION_DEV1:
220 target = TARGET_DEV_BUS;
221 attr = ATTR_DEV_CS1;
222 win = CPU_WIN_DEV_CS1;
223 break;
224 case ORION_DEV2:
225 target = TARGET_DEV_BUS;
226 attr = ATTR_DEV_CS2;
227 win = CPU_WIN_DEV_CS2;
228 break;
229 case ORION_DDR:
230 case ORION_REGS:
231 /*
232 * Must be mapped by bootloader.
233 */
234 default:
235 target = attr = win = -1;
236 BUG();
237 }
238
239 base &= 0xffff0000;
240 ctrl = (((size - 1) & 0xffff0000) | (attr << 8) |
241 (target << 4) | WIN_EN);
242
243 orion_write(CPU_WIN_BASE(win), base);
244 orion_write(CPU_WIN_CTRL(win), ctrl);
245
246 if (orion_cpu_win_can_remap(win)) {
247 if (remap >= 0) {
248 orion_write(CPU_WIN_REMAP_LO(win), remap & 0xffff0000);
249 orion_write(CPU_WIN_REMAP_HI(win), 0);
250 } else {
251 orion_write(CPU_WIN_REMAP_LO(win), base);
252 orion_write(CPU_WIN_REMAP_HI(win), 0);
253 }
254 }
255}
256
257void __init orion_setup_cpu_wins(void)
258{
259 int i;
260
261 /*
262 * First, disable and clear windows
263 */
264 for (i = 0; i < CPU_MAX_WIN; i++) {
265 orion_write(CPU_WIN_BASE(i), 0);
266 orion_write(CPU_WIN_CTRL(i), 0);
267 if (orion_cpu_win_can_remap(i)) {
268 orion_write(CPU_WIN_REMAP_LO(i), 0);
269 orion_write(CPU_WIN_REMAP_HI(i), 0);
270 }
271 }
272
273 /*
274 * Setup windows for PCI+PCIe IO+MEM space.
275 */
276 orion_setup_cpu_win(ORION_PCIE_IO, ORION_PCIE_IO_PHYS_BASE,
277 ORION_PCIE_IO_SIZE, ORION_PCIE_IO_BUS_BASE);
278 orion_setup_cpu_win(ORION_PCI_IO, ORION_PCI_IO_PHYS_BASE,
279 ORION_PCI_IO_SIZE, ORION_PCI_IO_BUS_BASE);
280 orion_setup_cpu_win(ORION_PCIE_MEM, ORION_PCIE_MEM_PHYS_BASE,
281 ORION_PCIE_MEM_SIZE, -1);
282 orion_setup_cpu_win(ORION_PCI_MEM, ORION_PCI_MEM_PHYS_BASE,
283 ORION_PCI_MEM_SIZE, -1);
284}
285
286/*
287 * Setup PCIE BARs and Address Decode Wins:
288 * BAR[0,2] -> disabled, BAR[1] -> covers all DRAM banks
289 * WIN[0-3] -> DRAM bank[0-3]
290 */
291void __init orion_setup_pcie_wins(void)
292{
293 u32 base, size, i;
294
295 /*
296 * First, disable and clear BARs and windows
297 */
298 for (i = 1; i < PCIE_MAX_BARS; i++) {
299 orion_write(PCIE_BAR_CTRL(i), 0);
300 orion_write(PCIE_BAR_LO(i), 0);
301 orion_write(PCIE_BAR_HI(i), 0);
302 }
303
304 for (i = 0; i < PCIE_MAX_WINS; i++) {
305 orion_write(PCIE_WIN_CTRL(i), 0);
306 orion_write(PCIE_WIN_BASE(i), 0);
307 orion_write(PCIE_WIN_REMAP(i), 0);
308 }
309
310 /*
311 * Setup windows for DDR banks. Count total DDR size on the fly.
312 */
313 base = DDR_REG_TO_BASE(orion_read(DDR_BASE_CS(0)));
314 size = 0;
315 for (i = 0; i < DDR_MAX_CS; i++) {
316 u32 bank_base, bank_size;
317 bank_size = orion_read(DDR_SIZE_CS(i));
318 bank_base = orion_read(DDR_BASE_CS(i));
319 if (bank_size & DDR_BANK_EN) {
320 bank_size = DDR_REG_TO_SIZE(bank_size);
321 bank_base = DDR_REG_TO_BASE(bank_base);
322 orion_write(PCIE_WIN_BASE(i), bank_base & 0xffff0000);
323 orion_write(PCIE_WIN_REMAP(i), 0);
324 orion_write(PCIE_WIN_CTRL(i),
325 ((bank_size-1) & 0xffff0000) |
326 (ATTR_DDR_CS(i) << 8) |
327 (TARGET_DDR << 4) |
328 (PCIE_DRAM_BAR << 1) | WIN_EN);
329 size += bank_size;
330 }
331 }
332
333 /*
334 * Setup BAR[1] to all DRAM banks
335 */
336 orion_write(PCIE_BAR_LO(PCIE_DRAM_BAR), base & 0xffff0000);
337 orion_write(PCIE_BAR_HI(PCIE_DRAM_BAR), 0);
338 orion_write(PCIE_BAR_CTRL(PCIE_DRAM_BAR),
339 ((size - 1) & 0xffff0000) | WIN_EN);
340}
341
342void __init orion_setup_pci_wins(void)
343{
344 u32 base, size, i;
345
346 /*
347 * First, disable windows
348 */
349 orion_write(PCI_BAR_ENABLE, 0xffffffff);
350
351 /*
352 * Setup windows for DDR banks.
353 */
354 for (i = 0; i < DDR_MAX_CS; i++) {
355 base = orion_read(DDR_BASE_CS(i));
356 size = orion_read(DDR_SIZE_CS(i));
357 if (size & DDR_BANK_EN) {
358 u32 bus, dev, func, reg, val;
359 size = DDR_REG_TO_SIZE(size);
360 base = DDR_REG_TO_BASE(base);
361 bus = orion_pci_local_bus_nr();
362 dev = orion_pci_local_dev_nr();
363 func = PCI_CONF_FUNC_BAR_CS(i);
364 reg = PCI_CONF_REG_BAR_LO_CS(i);
365 orion_pci_hw_rd_conf(bus, dev, func, reg, 4, &val);
366 orion_pci_hw_wr_conf(bus, dev, func, reg, 4,
367 (base & 0xfffff000) | (val & 0xfff));
368 reg = PCI_CONF_REG_BAR_HI_CS(i);
369 orion_pci_hw_wr_conf(bus, dev, func, reg, 4, 0);
370 orion_write(PCI_BAR_SIZE_DDR_CS(i),
371 (size - 1) & 0xfffff000);
372 orion_write(PCI_BAR_REMAP_DDR_CS(i),
373 base & 0xfffff000);
374 orion_clrbits(PCI_BAR_ENABLE, (1 << i));
375 }
376 }
377
378 /*
379 * Disable automatic update of address remaping when writing to BARs
380 */
381 orion_setbits(PCI_ADDR_DECODE_CTRL, 1);
382}
383
384void __init orion_setup_usb_wins(void)
385{
386 int i;
387 u32 usb_if, dev, rev;
388 u32 max_usb_if = 1;
389
390 orion_pcie_id(&dev, &rev);
391 if (dev == MV88F5182_DEV_ID)
392 max_usb_if = 2;
393
394 for (usb_if = 0; usb_if < max_usb_if; usb_if++) {
395 /*
396 * First, disable and clear windows
397 */
398 for (i = 0; i < USB_MAX_WIN; i++) {
399 orion_write(USB_WIN_BASE(usb_if, i), 0);
400 orion_write(USB_WIN_CTRL(usb_if, i), 0);
401 }
402
403 /*
404 * Setup windows for DDR banks.
405 */
406 for (i = 0; i < DDR_MAX_CS; i++) {
407 u32 base, size;
408 size = orion_read(DDR_SIZE_CS(i));
409 base = orion_read(DDR_BASE_CS(i));
410 if (size & DDR_BANK_EN) {
411 base = DDR_REG_TO_BASE(base);
412 size = DDR_REG_TO_SIZE(size);
413 orion_write(USB_WIN_CTRL(usb_if, i),
414 ((size-1) & 0xffff0000) |
415 (ATTR_DDR_CS(i) << 8) |
416 (TARGET_DDR << 4) | WIN_EN);
417 orion_write(USB_WIN_BASE(usb_if, i),
418 base & 0xffff0000);
419 }
420 }
421 }
422}
423
424void __init orion_setup_eth_wins(void)
425{
426 int i;
427
428 /*
429 * First, disable and clear windows
430 */
431 for (i = 0; i < ETH_MAX_WIN; i++) {
432 orion_write(ETH_WIN_BASE(i), 0);
433 orion_write(ETH_WIN_SIZE(i), 0);
434 orion_setbits(ETH_WIN_EN, 1 << i);
435 orion_clrbits(ETH_WIN_PROT, 0x3 << (i * 2));
436 if (i < ETH_MAX_REMAP_WIN)
437 orion_write(ETH_WIN_REMAP(i), 0);
438 }
439
440 /*
441 * Setup windows for DDR banks.
442 */
443 for (i = 0; i < DDR_MAX_CS; i++) {
444 u32 base, size;
445 size = orion_read(DDR_SIZE_CS(i));
446 base = orion_read(DDR_BASE_CS(i));
447 if (size & DDR_BANK_EN) {
448 base = DDR_REG_TO_BASE(base);
449 size = DDR_REG_TO_SIZE(size);
450 orion_write(ETH_WIN_SIZE(i), (size-1) & 0xffff0000);
451 orion_write(ETH_WIN_BASE(i), (base & 0xffff0000) |
452 (ATTR_DDR_CS(i) << 8) |
453 TARGET_DDR);
454 orion_clrbits(ETH_WIN_EN, 1 << i);
455 orion_setbits(ETH_WIN_PROT, 0x3 << (i * 2));
456 }
457 }
458}
459
460void __init orion_setup_sata_wins(void)
461{
462 int i;
463
464 /*
465 * First, disable and clear windows
466 */
467 for (i = 0; i < SATA_MAX_WIN; i++) {
468 orion_write(SATA_WIN_BASE(i), 0);
469 orion_write(SATA_WIN_CTRL(i), 0);
470 }
471
472 /*
473 * Setup windows for DDR banks.
474 */
475 for (i = 0; i < DDR_MAX_CS; i++) {
476 u32 base, size;
477 size = orion_read(DDR_SIZE_CS(i));
478 base = orion_read(DDR_BASE_CS(i));
479 if (size & DDR_BANK_EN) {
480 base = DDR_REG_TO_BASE(base);
481 size = DDR_REG_TO_SIZE(size);
482 orion_write(SATA_WIN_CTRL(i),
483 ((size-1) & 0xffff0000) |
484 (ATTR_DDR_CS(i) << 8) |
485 (TARGET_DDR << 4) | WIN_EN);
486 orion_write(SATA_WIN_BASE(i),
487 base & 0xffff0000);
488 }
489 }
490}
diff --git a/arch/arm/mach-orion/common.h b/arch/arm/mach-orion/common.h
deleted file mode 100644
index 501497cc2c4d..000000000000
--- a/arch/arm/mach-orion/common.h
+++ /dev/null
@@ -1,92 +0,0 @@
1#ifndef __ARCH_ORION_COMMON_H__
2#define __ARCH_ORION_COMMON_H__
3
4/*
5 * Basic Orion init functions used early by machine-setup.
6 */
7
8void __init orion_map_io(void);
9void __init orion_init_irq(void);
10void __init orion_init(void);
11
12/*
13 * Enumerations and functions for Orion windows mapping. Used by Orion core
14 * functions to map its interfaces and by the machine-setup to map its on-
15 * board devices. Details in /mach-orion/addr-map.c
16 */
17
18enum orion_target {
19 ORION_DEV_BOOT = 0,
20 ORION_DEV0,
21 ORION_DEV1,
22 ORION_DEV2,
23 ORION_PCIE_MEM,
24 ORION_PCIE_IO,
25 ORION_PCI_MEM,
26 ORION_PCI_IO,
27 ORION_DDR,
28 ORION_REGS,
29 ORION_MAX_TARGETS
30};
31
32void orion_setup_cpu_win(enum orion_target target, u32 base, u32 size, int remap);
33void orion_setup_cpu_wins(void);
34void orion_setup_eth_wins(void);
35void orion_setup_usb_wins(void);
36void orion_setup_pci_wins(void);
37void orion_setup_pcie_wins(void);
38void orion_setup_sata_wins(void);
39
40/*
41 * Shared code used internally by other Orion core functions.
42 * (/mach-orion/pci.c)
43 */
44
45struct pci_sys_data;
46struct pci_bus;
47
48void orion_pcie_id(u32 *dev, u32 *rev);
49u32 orion_pcie_local_bus_nr(void);
50u32 orion_pci_local_bus_nr(void);
51u32 orion_pci_local_dev_nr(void);
52int orion_pci_sys_setup(int nr, struct pci_sys_data *sys);
53struct pci_bus *orion_pci_sys_scan_bus(int nr, struct pci_sys_data *sys);
54int orion_pci_hw_rd_conf(u32 bus, u32 dev, u32 func, u32 where, u32 size, u32 *val);
55int orion_pci_hw_wr_conf(u32 bus, u32 dev, u32 func, u32 where, u32 size, u32 val);
56
57/*
58 * Valid GPIO pins according to MPP setup, used by machine-setup.
59 * (/mach-orion/gpio.c).
60 */
61
62void __init orion_gpio_set_valid_pins(u32 pins);
63void gpio_display(void); /* debug */
64
65/*
66 * Orion system timer (clocksource + clockevnt, /mach-orion/time.c)
67 */
68extern struct sys_timer orion_timer;
69
70/*
71 * Pull in Orion Ethernet platform_data, used by machine-setup
72 */
73
74struct mv643xx_eth_platform_data;
75
76void __init orion_eth_init(struct mv643xx_eth_platform_data *eth_data);
77
78/*
79 * Orion Sata platform_data, used by machine-setup
80 */
81
82struct mv_sata_platform_data;
83
84void __init orion_sata_init(struct mv_sata_platform_data *sata_data);
85
86struct machine_desc;
87struct meminfo;
88struct tag;
89extern void __init tag_fixup_mem32(struct machine_desc *, struct tag *,
90 char **, struct meminfo *);
91
92#endif /* __ARCH_ORION_COMMON_H__ */
diff --git a/arch/arm/mach-orion/pci.c b/arch/arm/mach-orion/pci.c
deleted file mode 100644
index b109bb46681e..000000000000
--- a/arch/arm/mach-orion/pci.c
+++ /dev/null
@@ -1,557 +0,0 @@
1/*
2 * arch/arm/mach-orion/pci.c
3 *
4 * PCI and PCIE functions for Marvell Orion System On Chip
5 *
6 * Maintainer: Tzachi Perelstein <tzachi@marvell.com>
7 *
8 * This file is licensed under the terms of the GNU General Public
9 * License version 2. This program is licensed "as is" without any
10 * warranty of any kind, whether express or implied.
11 */
12
13#include <linux/kernel.h>
14#include <linux/pci.h>
15#include <asm/mach/pci.h>
16#include "common.h"
17
18/*****************************************************************************
19 * Orion has one PCIE controller and one PCI controller.
20 *
21 * Note1: The local PCIE bus number is '0'. The local PCI bus number
22 * follows the scanned PCIE bridged busses, if any.
23 *
24 * Note2: It is possible for PCI/PCIE agents to access many subsystem's
25 * space, by configuring BARs and Address Decode Windows, e.g. flashes on
26 * device bus, Orion registers, etc. However this code only enable the
27 * access to DDR banks.
28 ****************************************************************************/
29
30
31/*****************************************************************************
32 * PCIE controller
33 ****************************************************************************/
34#define PCIE_CTRL ORION_PCIE_REG(0x1a00)
35#define PCIE_STAT ORION_PCIE_REG(0x1a04)
36#define PCIE_DEV_ID ORION_PCIE_REG(0x0000)
37#define PCIE_CMD_STAT ORION_PCIE_REG(0x0004)
38#define PCIE_DEV_REV ORION_PCIE_REG(0x0008)
39#define PCIE_MASK ORION_PCIE_REG(0x1910)
40#define PCIE_CONF_ADDR ORION_PCIE_REG(0x18f8)
41#define PCIE_CONF_DATA ORION_PCIE_REG(0x18fc)
42
43/*
44 * PCIE_STAT bits
45 */
46#define PCIE_STAT_LINK_DOWN 1
47#define PCIE_STAT_BUS_OFFS 8
48#define PCIE_STAT_BUS_MASK (0xff << PCIE_STAT_BUS_OFFS)
49#define PCIE_STAT_DEV_OFFS 20
50#define PCIE_STAT_DEV_MASK (0x1f << PCIE_STAT_DEV_OFFS)
51
52/*
53 * PCIE_CONF_ADDR bits
54 */
55#define PCIE_CONF_REG(r) ((((r) & 0xf00) << 24) | ((r) & 0xfc))
56#define PCIE_CONF_FUNC(f) (((f) & 0x3) << 8)
57#define PCIE_CONF_DEV(d) (((d) & 0x1f) << 11)
58#define PCIE_CONF_BUS(b) (((b) & 0xff) << 16)
59#define PCIE_CONF_ADDR_EN (1 << 31)
60
61/*
62 * PCIE config cycles are done by programming the PCIE_CONF_ADDR register
63 * and then reading the PCIE_CONF_DATA register. Need to make sure these
64 * transactions are atomic.
65 */
66static DEFINE_SPINLOCK(orion_pcie_lock);
67
68void orion_pcie_id(u32 *dev, u32 *rev)
69{
70 *dev = orion_read(PCIE_DEV_ID) >> 16;
71 *rev = orion_read(PCIE_DEV_REV) & 0xff;
72}
73
74u32 orion_pcie_local_bus_nr(void)
75{
76 u32 stat = orion_read(PCIE_STAT);
77 return((stat & PCIE_STAT_BUS_MASK) >> PCIE_STAT_BUS_OFFS);
78}
79
80static u32 orion_pcie_local_dev_nr(void)
81{
82 u32 stat = orion_read(PCIE_STAT);
83 return((stat & PCIE_STAT_DEV_MASK) >> PCIE_STAT_DEV_OFFS);
84}
85
86static u32 orion_pcie_no_link(void)
87{
88 u32 stat = orion_read(PCIE_STAT);
89 return(stat & PCIE_STAT_LINK_DOWN);
90}
91
92static void orion_pcie_set_bus_nr(int nr)
93{
94 orion_clrbits(PCIE_STAT, PCIE_STAT_BUS_MASK);
95 orion_setbits(PCIE_STAT, nr << PCIE_STAT_BUS_OFFS);
96}
97
98static void orion_pcie_master_slave_enable(void)
99{
100 orion_setbits(PCIE_CMD_STAT, PCI_COMMAND_MASTER |
101 PCI_COMMAND_IO |
102 PCI_COMMAND_MEMORY);
103}
104
105static void orion_pcie_enable_interrupts(void)
106{
107 /*
108 * Enable interrupts lines
109 * INTA[24] INTB[25] INTC[26] INTD[27]
110 */
111 orion_setbits(PCIE_MASK, 0xf<<24);
112}
113
114static int orion_pcie_valid_config(u32 bus, u32 dev)
115{
116 /*
117 * Don't go out when trying to access --
118 * 1. our own device
119 * 2. where there's no device connected (no link)
120 * 3. nonexisting devices on local bus
121 */
122
123 if ((orion_pcie_local_bus_nr() == bus) &&
124 (orion_pcie_local_dev_nr() == dev))
125 return 0;
126
127 if (orion_pcie_no_link())
128 return 0;
129
130 if (bus == orion_pcie_local_bus_nr())
131 if (((orion_pcie_local_dev_nr() == 0) && (dev != 1)) ||
132 ((orion_pcie_local_dev_nr() != 0) && (dev != 0)))
133 return 0;
134
135 return 1;
136}
137
138static int orion_pcie_rd_conf(struct pci_bus *bus, u32 devfn, int where,
139 int size, u32 *val)
140{
141 unsigned long flags;
142 unsigned int dev, rev, pcie_addr;
143
144 if (orion_pcie_valid_config(bus->number, PCI_SLOT(devfn)) == 0) {
145 *val = 0xffffffff;
146 return PCIBIOS_DEVICE_NOT_FOUND;
147 }
148
149 spin_lock_irqsave(&orion_pcie_lock, flags);
150
151 orion_write(PCIE_CONF_ADDR, PCIE_CONF_BUS(bus->number) |
152 PCIE_CONF_DEV(PCI_SLOT(devfn)) |
153 PCIE_CONF_FUNC(PCI_FUNC(devfn)) |
154 PCIE_CONF_REG(where) | PCIE_CONF_ADDR_EN);
155
156 orion_pcie_id(&dev, &rev);
157 if (dev == MV88F5181_DEV_ID || dev == MV88F5182_DEV_ID) {
158 /* extended register space */
159 pcie_addr = ORION_PCIE_WA_VIRT_BASE;
160 pcie_addr |= PCIE_CONF_BUS(bus->number) |
161 PCIE_CONF_DEV(PCI_SLOT(devfn)) |
162 PCIE_CONF_FUNC(PCI_FUNC(devfn)) |
163 PCIE_CONF_REG(where);
164 *val = orion_read(pcie_addr);
165 } else
166 *val = orion_read(PCIE_CONF_DATA);
167
168 if (size == 1)
169 *val = (*val >> (8*(where & 0x3))) & 0xff;
170 else if (size == 2)
171 *val = (*val >> (8*(where & 0x3))) & 0xffff;
172
173 spin_unlock_irqrestore(&orion_pcie_lock, flags);
174
175 return PCIBIOS_SUCCESSFUL;
176}
177
178
179static int orion_pcie_wr_conf(struct pci_bus *bus, u32 devfn, int where,
180 int size, u32 val)
181{
182 unsigned long flags;
183 int ret;
184
185 if (orion_pcie_valid_config(bus->number, PCI_SLOT(devfn)) == 0)
186 return PCIBIOS_DEVICE_NOT_FOUND;
187
188 spin_lock_irqsave(&orion_pcie_lock, flags);
189
190 ret = PCIBIOS_SUCCESSFUL;
191
192 orion_write(PCIE_CONF_ADDR, PCIE_CONF_BUS(bus->number) |
193 PCIE_CONF_DEV(PCI_SLOT(devfn)) |
194 PCIE_CONF_FUNC(PCI_FUNC(devfn)) |
195 PCIE_CONF_REG(where) | PCIE_CONF_ADDR_EN);
196
197 if (size == 4) {
198 __raw_writel(val, PCIE_CONF_DATA);
199 } else if (size == 2) {
200 __raw_writew(val, PCIE_CONF_DATA + (where & 0x3));
201 } else if (size == 1) {
202 __raw_writeb(val, PCIE_CONF_DATA + (where & 0x3));
203 } else {
204 ret = PCIBIOS_BAD_REGISTER_NUMBER;
205 }
206
207 spin_unlock_irqrestore(&orion_pcie_lock, flags);
208
209 return ret;
210}
211
212struct pci_ops orion_pcie_ops = {
213 .read = orion_pcie_rd_conf,
214 .write = orion_pcie_wr_conf,
215};
216
217
218static int orion_pcie_setup(struct pci_sys_data *sys)
219{
220 struct resource *res;
221
222 /*
223 * Master + Slave enable
224 */
225 orion_pcie_master_slave_enable();
226
227 /*
228 * Enable interrupts lines A-D
229 */
230 orion_pcie_enable_interrupts();
231
232 /*
233 * Request resource
234 */
235 res = kzalloc(sizeof(struct resource) * 2, GFP_KERNEL);
236 if (!res)
237 panic("orion_pci_setup unable to alloc resources");
238
239 /*
240 * IORESOURCE_IO
241 */
242 res[0].name = "PCI-EX I/O Space";
243 res[0].flags = IORESOURCE_IO;
244 res[0].start = ORION_PCIE_IO_BUS_BASE;
245 res[0].end = res[0].start + ORION_PCIE_IO_SIZE - 1;
246 if (request_resource(&ioport_resource, &res[0]))
247 panic("Request PCIE IO resource failed\n");
248 sys->resource[0] = &res[0];
249
250 /*
251 * IORESOURCE_MEM
252 */
253 res[1].name = "PCI-EX Memory Space";
254 res[1].flags = IORESOURCE_MEM;
255 res[1].start = ORION_PCIE_MEM_PHYS_BASE;
256 res[1].end = res[1].start + ORION_PCIE_MEM_SIZE - 1;
257 if (request_resource(&iomem_resource, &res[1]))
258 panic("Request PCIE Memory resource failed\n");
259 sys->resource[1] = &res[1];
260
261 sys->resource[2] = NULL;
262 sys->io_offset = 0;
263
264 return 1;
265}
266
267/*****************************************************************************
268 * PCI controller
269 ****************************************************************************/
270#define PCI_MODE ORION_PCI_REG(0xd00)
271#define PCI_CMD ORION_PCI_REG(0xc00)
272#define PCI_P2P_CONF ORION_PCI_REG(0x1d14)
273#define PCI_CONF_ADDR ORION_PCI_REG(0xc78)
274#define PCI_CONF_DATA ORION_PCI_REG(0xc7c)
275
276/*
277 * PCI_MODE bits
278 */
279#define PCI_MODE_64BIT (1 << 2)
280#define PCI_MODE_PCIX ((1 << 4) | (1 << 5))
281
282/*
283 * PCI_CMD bits
284 */
285#define PCI_CMD_HOST_REORDER (1 << 29)
286
287/*
288 * PCI_P2P_CONF bits
289 */
290#define PCI_P2P_BUS_OFFS 16
291#define PCI_P2P_BUS_MASK (0xff << PCI_P2P_BUS_OFFS)
292#define PCI_P2P_DEV_OFFS 24
293#define PCI_P2P_DEV_MASK (0x1f << PCI_P2P_DEV_OFFS)
294
295/*
296 * PCI_CONF_ADDR bits
297 */
298#define PCI_CONF_REG(reg) ((reg) & 0xfc)
299#define PCI_CONF_FUNC(func) (((func) & 0x3) << 8)
300#define PCI_CONF_DEV(dev) (((dev) & 0x1f) << 11)
301#define PCI_CONF_BUS(bus) (((bus) & 0xff) << 16)
302#define PCI_CONF_ADDR_EN (1 << 31)
303
304/*
305 * Internal configuration space
306 */
307#define PCI_CONF_FUNC_STAT_CMD 0
308#define PCI_CONF_REG_STAT_CMD 4
309#define PCIX_STAT 0x64
310#define PCIX_STAT_BUS_OFFS 8
311#define PCIX_STAT_BUS_MASK (0xff << PCIX_STAT_BUS_OFFS)
312
313/*
314 * PCI config cycles are done by programming the PCI_CONF_ADDR register
315 * and then reading the PCI_CONF_DATA register. Need to make sure these
316 * transactions are atomic.
317 */
318static DEFINE_SPINLOCK(orion_pci_lock);
319
320u32 orion_pci_local_bus_nr(void)
321{
322 u32 conf = orion_read(PCI_P2P_CONF);
323 return((conf & PCI_P2P_BUS_MASK) >> PCI_P2P_BUS_OFFS);
324}
325
326u32 orion_pci_local_dev_nr(void)
327{
328 u32 conf = orion_read(PCI_P2P_CONF);
329 return((conf & PCI_P2P_DEV_MASK) >> PCI_P2P_DEV_OFFS);
330}
331
332int orion_pci_hw_rd_conf(u32 bus, u32 dev, u32 func,
333 u32 where, u32 size, u32 *val)
334{
335 unsigned long flags;
336 spin_lock_irqsave(&orion_pci_lock, flags);
337
338 orion_write(PCI_CONF_ADDR, PCI_CONF_BUS(bus) |
339 PCI_CONF_DEV(dev) | PCI_CONF_REG(where) |
340 PCI_CONF_FUNC(func) | PCI_CONF_ADDR_EN);
341
342 *val = orion_read(PCI_CONF_DATA);
343
344 if (size == 1)
345 *val = (*val >> (8*(where & 0x3))) & 0xff;
346 else if (size == 2)
347 *val = (*val >> (8*(where & 0x3))) & 0xffff;
348
349 spin_unlock_irqrestore(&orion_pci_lock, flags);
350
351 return PCIBIOS_SUCCESSFUL;
352}
353
354int orion_pci_hw_wr_conf(u32 bus, u32 dev, u32 func,
355 u32 where, u32 size, u32 val)
356{
357 unsigned long flags;
358 int ret = PCIBIOS_SUCCESSFUL;
359
360 spin_lock_irqsave(&orion_pci_lock, flags);
361
362 orion_write(PCI_CONF_ADDR, PCI_CONF_BUS(bus) |
363 PCI_CONF_DEV(dev) | PCI_CONF_REG(where) |
364 PCI_CONF_FUNC(func) | PCI_CONF_ADDR_EN);
365
366 if (size == 4) {
367 __raw_writel(val, PCI_CONF_DATA);
368 } else if (size == 2) {
369 __raw_writew(val, PCI_CONF_DATA + (where & 0x3));
370 } else if (size == 1) {
371 __raw_writeb(val, PCI_CONF_DATA + (where & 0x3));
372 } else {
373 ret = PCIBIOS_BAD_REGISTER_NUMBER;
374 }
375
376 spin_unlock_irqrestore(&orion_pci_lock, flags);
377
378 return ret;
379}
380
381static int orion_pci_rd_conf(struct pci_bus *bus, u32 devfn,
382 int where, int size, u32 *val)
383{
384 /*
385 * Don't go out for local device
386 */
387 if ((orion_pci_local_bus_nr() == bus->number) &&
388 (orion_pci_local_dev_nr() == PCI_SLOT(devfn))) {
389 *val = 0xffffffff;
390 return PCIBIOS_DEVICE_NOT_FOUND;
391 }
392
393 return orion_pci_hw_rd_conf(bus->number, PCI_SLOT(devfn),
394 PCI_FUNC(devfn), where, size, val);
395}
396
397static int orion_pci_wr_conf(struct pci_bus *bus, u32 devfn,
398 int where, int size, u32 val)
399{
400 /*
401 * Don't go out for local device
402 */
403 if ((orion_pci_local_bus_nr() == bus->number) &&
404 (orion_pci_local_dev_nr() == PCI_SLOT(devfn)))
405 return PCIBIOS_DEVICE_NOT_FOUND;
406
407 return orion_pci_hw_wr_conf(bus->number, PCI_SLOT(devfn),
408 PCI_FUNC(devfn), where, size, val);
409}
410
411struct pci_ops orion_pci_ops = {
412 .read = orion_pci_rd_conf,
413 .write = orion_pci_wr_conf,
414};
415
416static void orion_pci_set_bus_nr(int nr)
417{
418 u32 p2p = orion_read(PCI_P2P_CONF);
419
420 if (orion_read(PCI_MODE) & PCI_MODE_PCIX) {
421 /*
422 * PCI-X mode
423 */
424 u32 pcix_status, bus, dev;
425 bus = (p2p & PCI_P2P_BUS_MASK) >> PCI_P2P_BUS_OFFS;
426 dev = (p2p & PCI_P2P_DEV_MASK) >> PCI_P2P_DEV_OFFS;
427 orion_pci_hw_rd_conf(bus, dev, 0, PCIX_STAT, 4, &pcix_status);
428 pcix_status &= ~PCIX_STAT_BUS_MASK;
429 pcix_status |= (nr << PCIX_STAT_BUS_OFFS);
430 orion_pci_hw_wr_conf(bus, dev, 0, PCIX_STAT, 4, pcix_status);
431 } else {
432 /*
433 * PCI Conventional mode
434 */
435 p2p &= ~PCI_P2P_BUS_MASK;
436 p2p |= (nr << PCI_P2P_BUS_OFFS);
437 orion_write(PCI_P2P_CONF, p2p);
438 }
439}
440
441static void orion_pci_master_slave_enable(void)
442{
443 u32 bus_nr, dev_nr, func, reg, val;
444
445 bus_nr = orion_pci_local_bus_nr();
446 dev_nr = orion_pci_local_dev_nr();
447 func = PCI_CONF_FUNC_STAT_CMD;
448 reg = PCI_CONF_REG_STAT_CMD;
449 orion_pci_hw_rd_conf(bus_nr, dev_nr, func, reg, 4, &val);
450 val |= (PCI_COMMAND_IO | PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER);
451 orion_pci_hw_wr_conf(bus_nr, dev_nr, func, reg, 4, val | 0x7);
452}
453
454static int orion_pci_setup(struct pci_sys_data *sys)
455{
456 struct resource *res;
457
458 /*
459 * Master + Slave enable
460 */
461 orion_pci_master_slave_enable();
462
463 /*
464 * Force ordering
465 */
466 orion_setbits(PCI_CMD, PCI_CMD_HOST_REORDER);
467
468 /*
469 * Request resources
470 */
471 res = kzalloc(sizeof(struct resource) * 2, GFP_KERNEL);
472 if (!res)
473 panic("orion_pci_setup unable to alloc resources");
474
475 /*
476 * IORESOURCE_IO
477 */
478 res[0].name = "PCI I/O Space";
479 res[0].flags = IORESOURCE_IO;
480 res[0].start = ORION_PCI_IO_BUS_BASE;
481 res[0].end = res[0].start + ORION_PCI_IO_SIZE - 1;
482 if (request_resource(&ioport_resource, &res[0]))
483 panic("Request PCI IO resource failed\n");
484 sys->resource[0] = &res[0];
485
486 /*
487 * IORESOURCE_MEM
488 */
489 res[1].name = "PCI Memory Space";
490 res[1].flags = IORESOURCE_MEM;
491 res[1].start = ORION_PCI_MEM_PHYS_BASE;
492 res[1].end = res[1].start + ORION_PCI_MEM_SIZE - 1;
493 if (request_resource(&iomem_resource, &res[1]))
494 panic("Request PCI Memory resource failed\n");
495 sys->resource[1] = &res[1];
496
497 sys->resource[2] = NULL;
498 sys->io_offset = 0;
499
500 return 1;
501}
502
503
504/*****************************************************************************
505 * General PCIE + PCI
506 ****************************************************************************/
507int orion_pci_sys_setup(int nr, struct pci_sys_data *sys)
508{
509 int ret = 0;
510
511 if (nr == 0) {
512 /*
513 * PCIE setup
514 */
515 orion_pcie_set_bus_nr(0);
516 ret = orion_pcie_setup(sys);
517 } else if (nr == 1) {
518 /*
519 * PCI setup
520 */
521 ret = orion_pci_setup(sys);
522 }
523
524 return ret;
525}
526
527struct pci_bus *orion_pci_sys_scan_bus(int nr, struct pci_sys_data *sys)
528{
529 struct pci_ops *ops;
530 struct pci_bus *bus;
531
532
533 if (nr == 0) {
534 u32 pci_bus;
535 /*
536 * PCIE scan
537 */
538 ops = &orion_pcie_ops;
539 bus = pci_scan_bus(sys->busnr, ops, sys);
540 /*
541 * Set local PCI bus number to follow PCIE bridges (if any)
542 */
543 pci_bus = bus->number + bus->subordinate - bus->secondary + 1;
544 orion_pci_set_bus_nr(pci_bus);
545 } else if (nr == 1) {
546 /*
547 * PCI scan
548 */
549 ops = &orion_pci_ops;
550 bus = pci_scan_bus(sys->busnr, ops, sys);
551 } else {
552 BUG();
553 bus = NULL;
554 }
555
556 return bus;
557}
diff --git a/arch/arm/mach-orion/time.c b/arch/arm/mach-orion/time.c
deleted file mode 100644
index bd4262da4f40..000000000000
--- a/arch/arm/mach-orion/time.c
+++ /dev/null
@@ -1,181 +0,0 @@
1/*
2 * arch/arm/mach-orion/time.c
3 *
4 * Core time functions for Marvell Orion System On Chip
5 *
6 * Maintainer: Tzachi Perelstein <tzachi@marvell.com>
7 *
8 * This file is licensed under the terms of the GNU General Public
9 * License version 2. This program is licensed "as is" without any
10 * warranty of any kind, whether express or implied.
11 */
12
13#include <linux/kernel.h>
14#include <linux/clockchips.h>
15#include <linux/interrupt.h>
16#include <linux/irq.h>
17#include <asm/mach/time.h>
18#include <asm/arch/orion.h>
19#include "common.h"
20
21/*
22 * Timer0: clock_event_device, Tick.
23 * Timer1: clocksource, Free running.
24 * WatchDog: Not used.
25 *
26 * Timers are counting down.
27 */
28#define CLOCKEVENT 0
29#define CLOCKSOURCE 1
30
31/*
32 * Timers bits
33 */
34#define BRIDGE_INT_TIMER(x) (1 << ((x) + 1))
35#define TIMER_EN(x) (1 << ((x) * 2))
36#define TIMER_RELOAD_EN(x) (1 << (((x) * 2) + 1))
37#define BRIDGE_INT_TIMER_WD (1 << 3)
38#define TIMER_WD_EN (1 << 4)
39#define TIMER_WD_RELOAD_EN (1 << 5)
40
41static cycle_t orion_clksrc_read(void)
42{
43 return (0xffffffff - orion_read(TIMER_VAL(CLOCKSOURCE)));
44}
45
46static struct clocksource orion_clksrc = {
47 .name = "orion_clocksource",
48 .shift = 20,
49 .rating = 300,
50 .read = orion_clksrc_read,
51 .mask = CLOCKSOURCE_MASK(32),
52 .flags = CLOCK_SOURCE_IS_CONTINUOUS,
53};
54
55static int
56orion_clkevt_next_event(unsigned long delta, struct clock_event_device *dev)
57{
58 unsigned long flags;
59
60 if (delta == 0)
61 return -ETIME;
62
63 local_irq_save(flags);
64
65 /*
66 * Clear and enable timer interrupt bit
67 */
68 orion_write(BRIDGE_CAUSE, ~BRIDGE_INT_TIMER(CLOCKEVENT));
69 orion_setbits(BRIDGE_MASK, BRIDGE_INT_TIMER(CLOCKEVENT));
70
71 /*
72 * Setup new timer value
73 */
74 orion_write(TIMER_VAL(CLOCKEVENT), delta);
75
76 /*
77 * Disable auto reload and kickoff the timer
78 */
79 orion_clrbits(TIMER_CTRL, TIMER_RELOAD_EN(CLOCKEVENT));
80 orion_setbits(TIMER_CTRL, TIMER_EN(CLOCKEVENT));
81
82 local_irq_restore(flags);
83
84 return 0;
85}
86
87static void
88orion_clkevt_mode(enum clock_event_mode mode, struct clock_event_device *dev)
89{
90 unsigned long flags;
91
92 local_irq_save(flags);
93
94 if (mode == CLOCK_EVT_MODE_PERIODIC) {
95 /*
96 * Setup latch cycles in timer and enable reload interrupt.
97 */
98 orion_write(TIMER_VAL_RELOAD(CLOCKEVENT), LATCH);
99 orion_write(TIMER_VAL(CLOCKEVENT), LATCH);
100 orion_setbits(BRIDGE_MASK, BRIDGE_INT_TIMER(CLOCKEVENT));
101 orion_setbits(TIMER_CTRL, TIMER_RELOAD_EN(CLOCKEVENT) |
102 TIMER_EN(CLOCKEVENT));
103 } else {
104 /*
105 * Disable timer and interrupt
106 */
107 orion_clrbits(BRIDGE_MASK, BRIDGE_INT_TIMER(CLOCKEVENT));
108 orion_write(BRIDGE_CAUSE, ~BRIDGE_INT_TIMER(CLOCKEVENT));
109 orion_clrbits(TIMER_CTRL, TIMER_RELOAD_EN(CLOCKEVENT) |
110 TIMER_EN(CLOCKEVENT));
111 }
112
113 local_irq_restore(flags);
114}
115
116static struct clock_event_device orion_clkevt = {
117 .name = "orion_tick",
118 .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT,
119 .shift = 32,
120 .rating = 300,
121 .cpumask = CPU_MASK_CPU0,
122 .set_next_event = orion_clkevt_next_event,
123 .set_mode = orion_clkevt_mode,
124};
125
126static irqreturn_t orion_timer_interrupt(int irq, void *dev_id)
127{
128 /*
129 * Clear cause bit and do event
130 */
131 orion_write(BRIDGE_CAUSE, ~BRIDGE_INT_TIMER(CLOCKEVENT));
132 orion_clkevt.event_handler(&orion_clkevt);
133 return IRQ_HANDLED;
134}
135
136static struct irqaction orion_timer_irq = {
137 .name = "orion_tick",
138 .flags = IRQF_DISABLED | IRQF_TIMER,
139 .handler = orion_timer_interrupt
140};
141
142static void orion_timer_init(void)
143{
144 /*
145 * Setup clocksource free running timer (no interrupt on reload)
146 */
147 orion_write(TIMER_VAL(CLOCKSOURCE), 0xffffffff);
148 orion_write(TIMER_VAL_RELOAD(CLOCKSOURCE), 0xffffffff);
149 orion_clrbits(BRIDGE_MASK, BRIDGE_INT_TIMER(CLOCKSOURCE));
150 orion_setbits(TIMER_CTRL, TIMER_RELOAD_EN(CLOCKSOURCE) |
151 TIMER_EN(CLOCKSOURCE));
152
153 /*
154 * Register clocksource
155 */
156 orion_clksrc.mult =
157 clocksource_hz2mult(CLOCK_TICK_RATE, orion_clksrc.shift);
158
159 clocksource_register(&orion_clksrc);
160
161 /*
162 * Connect and enable tick handler
163 */
164 setup_irq(IRQ_ORION_BRIDGE, &orion_timer_irq);
165
166 /*
167 * Register clockevent
168 */
169 orion_clkevt.mult =
170 div_sc(CLOCK_TICK_RATE, NSEC_PER_SEC, orion_clkevt.shift);
171 orion_clkevt.max_delta_ns =
172 clockevent_delta2ns(0xfffffffe, &orion_clkevt);
173 orion_clkevt.min_delta_ns =
174 clockevent_delta2ns(1, &orion_clkevt);
175
176 clockevents_register_device(&orion_clkevt);
177}
178
179struct sys_timer orion_timer = {
180 .init = orion_timer_init,
181};
diff --git a/arch/arm/mach-orion/Kconfig b/arch/arm/mach-orion5x/Kconfig
index 1dcbb6ac5a30..93debf336155 100644
--- a/arch/arm/mach-orion/Kconfig
+++ b/arch/arm/mach-orion5x/Kconfig
@@ -1,4 +1,4 @@
1if ARCH_ORION 1if ARCH_ORION5X
2 2
3menu "Orion Implementations" 3menu "Orion Implementations"
4 4
@@ -36,6 +36,14 @@ config MACH_TS209
36 Say 'Y' here if you want your kernel to support the 36 Say 'Y' here if you want your kernel to support the
37 QNAP TS-109/TS-209 platform. 37 QNAP TS-109/TS-209 platform.
38 38
39config MACH_LINKSTATION_PRO
40 bool "Buffalo Linkstation Pro/Live"
41 select I2C_BOARDINFO
42 help
43 Say 'Y' here if you want your kernel to support the
44 Buffalo Linkstation Pro/Live platform. Both v1 and
45 v2 devices are supported.
46
39endmenu 47endmenu
40 48
41endif 49endif
diff --git a/arch/arm/mach-orion/Makefile b/arch/arm/mach-orion5x/Makefile
index f91d937a73e8..9301bf55910b 100644
--- a/arch/arm/mach-orion/Makefile
+++ b/arch/arm/mach-orion5x/Makefile
@@ -1,6 +1,7 @@
1obj-y += common.o addr-map.o pci.o gpio.o irq.o time.o 1obj-y += common.o addr-map.o pci.o gpio.o irq.o
2obj-$(CONFIG_MACH_DB88F5281) += db88f5281-setup.o 2obj-$(CONFIG_MACH_DB88F5281) += db88f5281-setup.o
3obj-$(CONFIG_MACH_RD88F5182) += rd88f5182-setup.o 3obj-$(CONFIG_MACH_RD88F5182) += rd88f5182-setup.o
4obj-$(CONFIG_MACH_KUROBOX_PRO) += kurobox_pro-setup.o 4obj-$(CONFIG_MACH_KUROBOX_PRO) += kurobox_pro-setup.o
5obj-$(CONFIG_MACH_LINKSTATION_PRO) += kurobox_pro-setup.o
5obj-$(CONFIG_MACH_DNS323) += dns323-setup.o 6obj-$(CONFIG_MACH_DNS323) += dns323-setup.o
6obj-$(CONFIG_MACH_TS209) += ts209-setup.o 7obj-$(CONFIG_MACH_TS209) += ts209-setup.o
diff --git a/arch/arm/mach-orion/Makefile.boot b/arch/arm/mach-orion5x/Makefile.boot
index 67039c3e0c48..67039c3e0c48 100644
--- a/arch/arm/mach-orion/Makefile.boot
+++ b/arch/arm/mach-orion5x/Makefile.boot
diff --git a/arch/arm/mach-orion5x/addr-map.c b/arch/arm/mach-orion5x/addr-map.c
new file mode 100644
index 000000000000..6b179371e0a2
--- /dev/null
+++ b/arch/arm/mach-orion5x/addr-map.c
@@ -0,0 +1,240 @@
1/*
2 * arch/arm/mach-orion5x/addr-map.c
3 *
4 * Address map functions for Marvell Orion 5x SoCs
5 *
6 * Maintainer: Tzachi Perelstein <tzachi@marvell.com>
7 *
8 * This file is licensed under the terms of the GNU General Public
9 * License version 2. This program is licensed "as is" without any
10 * warranty of any kind, whether express or implied.
11 */
12
13#include <linux/kernel.h>
14#include <linux/init.h>
15#include <linux/mbus.h>
16#include <asm/hardware.h>
17#include <asm/io.h>
18#include "common.h"
19
20/*
21 * The Orion has fully programable address map. There's a separate address
22 * map for each of the device _master_ interfaces, e.g. CPU, PCI, PCIE, USB,
23 * Gigabit Ethernet, DMA/XOR engines, etc. Each interface has its own
24 * address decode windows that allow it to access any of the Orion resources.
25 *
26 * CPU address decoding --
27 * Linux assumes that it is the boot loader that already setup the access to
28 * DDR and internal registers.
29 * Setup access to PCI and PCI-E IO/MEM space is issued by this file.
30 * Setup access to various devices located on the device bus interface (e.g.
31 * flashes, RTC, etc) should be issued by machine-setup.c according to
32 * specific board population (by using orion5x_setup_*_win()).
33 *
34 * Non-CPU Masters address decoding --
35 * Unlike the CPU, we setup the access from Orion's master interfaces to DDR
36 * banks only (the typical use case).
37 * Setup access for each master to DDR is issued by common.c.
38 *
39 * Note: although orion_setbits() and orion_clrbits() are not atomic
40 * no locking is necessary here since code in this file is only called
41 * at boot time when there is no concurrency issues.
42 */
43
44/*
45 * Generic Address Decode Windows bit settings
46 */
47#define TARGET_DDR 0
48#define TARGET_DEV_BUS 1
49#define TARGET_PCI 3
50#define TARGET_PCIE 4
51#define ATTR_DDR_CS(n) (((n) ==0) ? 0xe : \
52 ((n) == 1) ? 0xd : \
53 ((n) == 2) ? 0xb : \
54 ((n) == 3) ? 0x7 : 0xf)
55#define ATTR_PCIE_MEM 0x59
56#define ATTR_PCIE_IO 0x51
57#define ATTR_PCIE_WA 0x79
58#define ATTR_PCI_MEM 0x59
59#define ATTR_PCI_IO 0x51
60#define ATTR_DEV_CS0 0x1e
61#define ATTR_DEV_CS1 0x1d
62#define ATTR_DEV_CS2 0x1b
63#define ATTR_DEV_BOOT 0xf
64#define WIN_EN 1
65
66/*
67 * Helpers to get DDR bank info
68 */
69#define DDR_BASE_CS(n) ORION5X_DDR_REG(0x1500 + ((n) * 8))
70#define DDR_SIZE_CS(n) ORION5X_DDR_REG(0x1504 + ((n) * 8))
71#define DDR_MAX_CS 4
72#define DDR_REG_TO_SIZE(reg) (((reg) | 0xffffff) + 1)
73#define DDR_REG_TO_BASE(reg) ((reg) & 0xff000000)
74#define DDR_BANK_EN 1
75
76/*
77 * CPU Address Decode Windows registers
78 */
79#define CPU_WIN_CTRL(n) ORION5X_BRIDGE_REG(0x000 | ((n) << 4))
80#define CPU_WIN_BASE(n) ORION5X_BRIDGE_REG(0x004 | ((n) << 4))
81#define CPU_WIN_REMAP_LO(n) ORION5X_BRIDGE_REG(0x008 | ((n) << 4))
82#define CPU_WIN_REMAP_HI(n) ORION5X_BRIDGE_REG(0x00c | ((n) << 4))
83
84/*
85 * Gigabit Ethernet Address Decode Windows registers
86 */
87#define ETH_WIN_BASE(win) ORION5X_ETH_REG(0x200 + ((win) * 8))
88#define ETH_WIN_SIZE(win) ORION5X_ETH_REG(0x204 + ((win) * 8))
89#define ETH_WIN_REMAP(win) ORION5X_ETH_REG(0x280 + ((win) * 4))
90#define ETH_WIN_EN ORION5X_ETH_REG(0x290)
91#define ETH_WIN_PROT ORION5X_ETH_REG(0x294)
92#define ETH_MAX_WIN 6
93#define ETH_MAX_REMAP_WIN 4
94
95
96struct mbus_dram_target_info orion5x_mbus_dram_info;
97
98static int __init orion5x_cpu_win_can_remap(int win)
99{
100 u32 dev, rev;
101
102 orion5x_pcie_id(&dev, &rev);
103 if ((dev == MV88F5281_DEV_ID && win < 4)
104 || (dev == MV88F5182_DEV_ID && win < 2)
105 || (dev == MV88F5181_DEV_ID && win < 2))
106 return 1;
107
108 return 0;
109}
110
111static void __init setup_cpu_win(int win, u32 base, u32 size,
112 u8 target, u8 attr, int remap)
113{
114 orion5x_write(CPU_WIN_BASE(win), base & 0xffff0000);
115 orion5x_write(CPU_WIN_CTRL(win),
116 ((size - 1) & 0xffff0000) | (attr << 8) | (target << 4) | 1);
117
118 if (orion5x_cpu_win_can_remap(win)) {
119 if (remap < 0)
120 remap = base;
121
122 orion5x_write(CPU_WIN_REMAP_LO(win), remap & 0xffff0000);
123 orion5x_write(CPU_WIN_REMAP_HI(win), 0);
124 }
125}
126
127void __init orion5x_setup_cpu_mbus_bridge(void)
128{
129 int i;
130 int cs;
131
132 /*
133 * First, disable and clear windows.
134 */
135 for (i = 0; i < 8; i++) {
136 orion5x_write(CPU_WIN_BASE(i), 0);
137 orion5x_write(CPU_WIN_CTRL(i), 0);
138 if (orion5x_cpu_win_can_remap(i)) {
139 orion5x_write(CPU_WIN_REMAP_LO(i), 0);
140 orion5x_write(CPU_WIN_REMAP_HI(i), 0);
141 }
142 }
143
144 /*
145 * Setup windows for PCI+PCIe IO+MEM space.
146 */
147 setup_cpu_win(0, ORION5X_PCIE_IO_PHYS_BASE, ORION5X_PCIE_IO_SIZE,
148 TARGET_PCIE, ATTR_PCIE_IO, ORION5X_PCIE_IO_BUS_BASE);
149 setup_cpu_win(1, ORION5X_PCI_IO_PHYS_BASE, ORION5X_PCI_IO_SIZE,
150 TARGET_PCI, ATTR_PCI_IO, ORION5X_PCI_IO_BUS_BASE);
151 setup_cpu_win(2, ORION5X_PCIE_MEM_PHYS_BASE, ORION5X_PCIE_MEM_SIZE,
152 TARGET_PCIE, ATTR_PCIE_MEM, -1);
153 setup_cpu_win(3, ORION5X_PCI_MEM_PHYS_BASE, ORION5X_PCI_MEM_SIZE,
154 TARGET_PCI, ATTR_PCI_MEM, -1);
155
156 /*
157 * Setup MBUS dram target info.
158 */
159 orion5x_mbus_dram_info.mbus_dram_target_id = TARGET_DDR;
160
161 for (i = 0, cs = 0; i < 4; i++) {
162 u32 base = readl(DDR_BASE_CS(i));
163 u32 size = readl(DDR_SIZE_CS(i));
164
165 /*
166 * Chip select enabled?
167 */
168 if (size & 1) {
169 struct mbus_dram_window *w;
170
171 w = &orion5x_mbus_dram_info.cs[cs++];
172 w->cs_index = i;
173 w->mbus_attr = 0xf & ~(1 << i);
174 w->base = base & 0xff000000;
175 w->size = (size | 0x00ffffff) + 1;
176 }
177 }
178 orion5x_mbus_dram_info.num_cs = cs;
179}
180
181void __init orion5x_setup_dev_boot_win(u32 base, u32 size)
182{
183 setup_cpu_win(4, base, size, TARGET_DEV_BUS, ATTR_DEV_BOOT, -1);
184}
185
186void __init orion5x_setup_dev0_win(u32 base, u32 size)
187{
188 setup_cpu_win(5, base, size, TARGET_DEV_BUS, ATTR_DEV_CS0, -1);
189}
190
191void __init orion5x_setup_dev1_win(u32 base, u32 size)
192{
193 setup_cpu_win(6, base, size, TARGET_DEV_BUS, ATTR_DEV_CS1, -1);
194}
195
196void __init orion5x_setup_dev2_win(u32 base, u32 size)
197{
198 setup_cpu_win(7, base, size, TARGET_DEV_BUS, ATTR_DEV_CS2, -1);
199}
200
201void __init orion5x_setup_pcie_wa_win(u32 base, u32 size)
202{
203 setup_cpu_win(7, base, size, TARGET_PCIE, ATTR_PCIE_WA, -1);
204}
205
206void __init orion5x_setup_eth_wins(void)
207{
208 int i;
209
210 /*
211 * First, disable and clear windows
212 */
213 for (i = 0; i < ETH_MAX_WIN; i++) {
214 orion5x_write(ETH_WIN_BASE(i), 0);
215 orion5x_write(ETH_WIN_SIZE(i), 0);
216 orion5x_setbits(ETH_WIN_EN, 1 << i);
217 orion5x_clrbits(ETH_WIN_PROT, 0x3 << (i * 2));
218 if (i < ETH_MAX_REMAP_WIN)
219 orion5x_write(ETH_WIN_REMAP(i), 0);
220 }
221
222 /*
223 * Setup windows for DDR banks.
224 */
225 for (i = 0; i < DDR_MAX_CS; i++) {
226 u32 base, size;
227 size = orion5x_read(DDR_SIZE_CS(i));
228 base = orion5x_read(DDR_BASE_CS(i));
229 if (size & DDR_BANK_EN) {
230 base = DDR_REG_TO_BASE(base);
231 size = DDR_REG_TO_SIZE(size);
232 orion5x_write(ETH_WIN_SIZE(i), (size-1) & 0xffff0000);
233 orion5x_write(ETH_WIN_BASE(i), (base & 0xffff0000) |
234 (ATTR_DDR_CS(i) << 8) |
235 TARGET_DDR);
236 orion5x_clrbits(ETH_WIN_EN, 1 << i);
237 orion5x_setbits(ETH_WIN_PROT, 0x3 << (i * 2));
238 }
239 }
240}
diff --git a/arch/arm/mach-orion/common.c b/arch/arm/mach-orion5x/common.c
index bbc2b4ec932c..439c7784af02 100644
--- a/arch/arm/mach-orion/common.c
+++ b/arch/arm/mach-orion5x/common.c
@@ -1,12 +1,12 @@
1/* 1/*
2 * arch/arm/mach-orion/common.c 2 * arch/arm/mach-orion5x/common.c
3 * 3 *
4 * Core functions for Marvell Orion System On Chip 4 * Core functions for Marvell Orion 5x SoCs
5 * 5 *
6 * Maintainer: Tzachi Perelstein <tzachi@marvell.com> 6 * Maintainer: Tzachi Perelstein <tzachi@marvell.com>
7 * 7 *
8 * This file is licensed under the terms of the GNU General Public 8 * This file is licensed under the terms of the GNU General Public
9 * License version 2. This program is licensed "as is" without any 9 * License version 2. This program is licensed "as is" without any
10 * warranty of any kind, whether express or implied. 10 * warranty of any kind, whether express or implied.
11 */ 11 */
12 12
@@ -14,64 +14,71 @@
14#include <linux/init.h> 14#include <linux/init.h>
15#include <linux/platform_device.h> 15#include <linux/platform_device.h>
16#include <linux/serial_8250.h> 16#include <linux/serial_8250.h>
17#include <linux/mbus.h>
17#include <linux/mv643xx_eth.h> 18#include <linux/mv643xx_eth.h>
18#include <linux/mv643xx_i2c.h> 19#include <linux/mv643xx_i2c.h>
20#include <linux/ata_platform.h>
19#include <asm/page.h> 21#include <asm/page.h>
20#include <asm/setup.h> 22#include <asm/setup.h>
21#include <asm/timex.h> 23#include <asm/timex.h>
22#include <asm/mach/arch.h> 24#include <asm/mach/arch.h>
23#include <asm/mach/map.h> 25#include <asm/mach/map.h>
26#include <asm/mach/time.h>
24#include <asm/arch/hardware.h> 27#include <asm/arch/hardware.h>
28#include <asm/arch/orion5x.h>
29#include <asm/plat-orion/ehci-orion.h>
30#include <asm/plat-orion/orion_nand.h>
31#include <asm/plat-orion/time.h>
25#include "common.h" 32#include "common.h"
26 33
27/***************************************************************************** 34/*****************************************************************************
28 * I/O Address Mapping 35 * I/O Address Mapping
29 ****************************************************************************/ 36 ****************************************************************************/
30static struct map_desc orion_io_desc[] __initdata = { 37static struct map_desc orion5x_io_desc[] __initdata = {
31 { 38 {
32 .virtual = ORION_REGS_VIRT_BASE, 39 .virtual = ORION5X_REGS_VIRT_BASE,
33 .pfn = __phys_to_pfn(ORION_REGS_PHYS_BASE), 40 .pfn = __phys_to_pfn(ORION5X_REGS_PHYS_BASE),
34 .length = ORION_REGS_SIZE, 41 .length = ORION5X_REGS_SIZE,
35 .type = MT_DEVICE 42 .type = MT_DEVICE
36 }, 43 },
37 { 44 {
38 .virtual = ORION_PCIE_IO_VIRT_BASE, 45 .virtual = ORION5X_PCIE_IO_VIRT_BASE,
39 .pfn = __phys_to_pfn(ORION_PCIE_IO_PHYS_BASE), 46 .pfn = __phys_to_pfn(ORION5X_PCIE_IO_PHYS_BASE),
40 .length = ORION_PCIE_IO_SIZE, 47 .length = ORION5X_PCIE_IO_SIZE,
41 .type = MT_DEVICE 48 .type = MT_DEVICE
42 }, 49 },
43 { 50 {
44 .virtual = ORION_PCI_IO_VIRT_BASE, 51 .virtual = ORION5X_PCI_IO_VIRT_BASE,
45 .pfn = __phys_to_pfn(ORION_PCI_IO_PHYS_BASE), 52 .pfn = __phys_to_pfn(ORION5X_PCI_IO_PHYS_BASE),
46 .length = ORION_PCI_IO_SIZE, 53 .length = ORION5X_PCI_IO_SIZE,
47 .type = MT_DEVICE 54 .type = MT_DEVICE
48 }, 55 },
49 { 56 {
50 .virtual = ORION_PCIE_WA_VIRT_BASE, 57 .virtual = ORION5X_PCIE_WA_VIRT_BASE,
51 .pfn = __phys_to_pfn(ORION_PCIE_WA_PHYS_BASE), 58 .pfn = __phys_to_pfn(ORION5X_PCIE_WA_PHYS_BASE),
52 .length = ORION_PCIE_WA_SIZE, 59 .length = ORION5X_PCIE_WA_SIZE,
53 .type = MT_DEVICE 60 .type = MT_DEVICE
54 }, 61 },
55}; 62};
56 63
57void __init orion_map_io(void) 64void __init orion5x_map_io(void)
58{ 65{
59 iotable_init(orion_io_desc, ARRAY_SIZE(orion_io_desc)); 66 iotable_init(orion5x_io_desc, ARRAY_SIZE(orion5x_io_desc));
60} 67}
61 68
62/***************************************************************************** 69/*****************************************************************************
63 * UART 70 * UART
64 ****************************************************************************/ 71 ****************************************************************************/
65 72
66static struct resource orion_uart_resources[] = { 73static struct resource orion5x_uart_resources[] = {
67 { 74 {
68 .start = UART0_PHYS_BASE, 75 .start = UART0_PHYS_BASE,
69 .end = UART0_PHYS_BASE + 0xff, 76 .end = UART0_PHYS_BASE + 0xff,
70 .flags = IORESOURCE_MEM, 77 .flags = IORESOURCE_MEM,
71 }, 78 },
72 { 79 {
73 .start = IRQ_ORION_UART0, 80 .start = IRQ_ORION5X_UART0,
74 .end = IRQ_ORION_UART0, 81 .end = IRQ_ORION5X_UART0,
75 .flags = IORESOURCE_IRQ, 82 .flags = IORESOURCE_IRQ,
76 }, 83 },
77 { 84 {
@@ -80,96 +87,102 @@ static struct resource orion_uart_resources[] = {
80 .flags = IORESOURCE_MEM, 87 .flags = IORESOURCE_MEM,
81 }, 88 },
82 { 89 {
83 .start = IRQ_ORION_UART1, 90 .start = IRQ_ORION5X_UART1,
84 .end = IRQ_ORION_UART1, 91 .end = IRQ_ORION5X_UART1,
85 .flags = IORESOURCE_IRQ, 92 .flags = IORESOURCE_IRQ,
86 }, 93 },
87}; 94};
88 95
89static struct plat_serial8250_port orion_uart_data[] = { 96static struct plat_serial8250_port orion5x_uart_data[] = {
90 { 97 {
91 .mapbase = UART0_PHYS_BASE, 98 .mapbase = UART0_PHYS_BASE,
92 .membase = (char *)UART0_VIRT_BASE, 99 .membase = (char *)UART0_VIRT_BASE,
93 .irq = IRQ_ORION_UART0, 100 .irq = IRQ_ORION5X_UART0,
94 .flags = UPF_SKIP_TEST | UPF_BOOT_AUTOCONF, 101 .flags = UPF_SKIP_TEST | UPF_BOOT_AUTOCONF,
95 .iotype = UPIO_MEM, 102 .iotype = UPIO_MEM,
96 .regshift = 2, 103 .regshift = 2,
97 .uartclk = ORION_TCLK, 104 .uartclk = ORION5X_TCLK,
98 }, 105 },
99 { 106 {
100 .mapbase = UART1_PHYS_BASE, 107 .mapbase = UART1_PHYS_BASE,
101 .membase = (char *)UART1_VIRT_BASE, 108 .membase = (char *)UART1_VIRT_BASE,
102 .irq = IRQ_ORION_UART1, 109 .irq = IRQ_ORION5X_UART1,
103 .flags = UPF_SKIP_TEST | UPF_BOOT_AUTOCONF, 110 .flags = UPF_SKIP_TEST | UPF_BOOT_AUTOCONF,
104 .iotype = UPIO_MEM, 111 .iotype = UPIO_MEM,
105 .regshift = 2, 112 .regshift = 2,
106 .uartclk = ORION_TCLK, 113 .uartclk = ORION5X_TCLK,
107 }, 114 },
108 { }, 115 { },
109}; 116};
110 117
111static struct platform_device orion_uart = { 118static struct platform_device orion5x_uart = {
112 .name = "serial8250", 119 .name = "serial8250",
113 .id = PLAT8250_DEV_PLATFORM, 120 .id = PLAT8250_DEV_PLATFORM,
114 .dev = { 121 .dev = {
115 .platform_data = orion_uart_data, 122 .platform_data = orion5x_uart_data,
116 }, 123 },
117 .resource = orion_uart_resources, 124 .resource = orion5x_uart_resources,
118 .num_resources = ARRAY_SIZE(orion_uart_resources), 125 .num_resources = ARRAY_SIZE(orion5x_uart_resources),
119}; 126};
120 127
121/******************************************************************************* 128/*******************************************************************************
122 * USB Controller - 2 interfaces 129 * USB Controller - 2 interfaces
123 ******************************************************************************/ 130 ******************************************************************************/
124 131
125static struct resource orion_ehci0_resources[] = { 132static struct resource orion5x_ehci0_resources[] = {
126 { 133 {
127 .start = ORION_USB0_PHYS_BASE, 134 .start = ORION5X_USB0_PHYS_BASE,
128 .end = ORION_USB0_PHYS_BASE + SZ_4K, 135 .end = ORION5X_USB0_PHYS_BASE + SZ_4K,
129 .flags = IORESOURCE_MEM, 136 .flags = IORESOURCE_MEM,
130 }, 137 },
131 { 138 {
132 .start = IRQ_ORION_USB0_CTRL, 139 .start = IRQ_ORION5X_USB0_CTRL,
133 .end = IRQ_ORION_USB0_CTRL, 140 .end = IRQ_ORION5X_USB0_CTRL,
134 .flags = IORESOURCE_IRQ, 141 .flags = IORESOURCE_IRQ,
135 }, 142 },
136}; 143};
137 144
138static struct resource orion_ehci1_resources[] = { 145static struct resource orion5x_ehci1_resources[] = {
139 { 146 {
140 .start = ORION_USB1_PHYS_BASE, 147 .start = ORION5X_USB1_PHYS_BASE,
141 .end = ORION_USB1_PHYS_BASE + SZ_4K, 148 .end = ORION5X_USB1_PHYS_BASE + SZ_4K,
142 .flags = IORESOURCE_MEM, 149 .flags = IORESOURCE_MEM,
143 }, 150 },
144 { 151 {
145 .start = IRQ_ORION_USB1_CTRL, 152 .start = IRQ_ORION5X_USB1_CTRL,
146 .end = IRQ_ORION_USB1_CTRL, 153 .end = IRQ_ORION5X_USB1_CTRL,
147 .flags = IORESOURCE_IRQ, 154 .flags = IORESOURCE_IRQ,
148 }, 155 },
149}; 156};
150 157
158static struct orion_ehci_data orion5x_ehci_data = {
159 .dram = &orion5x_mbus_dram_info,
160};
161
151static u64 ehci_dmamask = 0xffffffffUL; 162static u64 ehci_dmamask = 0xffffffffUL;
152 163
153static struct platform_device orion_ehci0 = { 164static struct platform_device orion5x_ehci0 = {
154 .name = "orion-ehci", 165 .name = "orion-ehci",
155 .id = 0, 166 .id = 0,
156 .dev = { 167 .dev = {
157 .dma_mask = &ehci_dmamask, 168 .dma_mask = &ehci_dmamask,
158 .coherent_dma_mask = 0xffffffff, 169 .coherent_dma_mask = 0xffffffff,
170 .platform_data = &orion5x_ehci_data,
159 }, 171 },
160 .resource = orion_ehci0_resources, 172 .resource = orion5x_ehci0_resources,
161 .num_resources = ARRAY_SIZE(orion_ehci0_resources), 173 .num_resources = ARRAY_SIZE(orion5x_ehci0_resources),
162}; 174};
163 175
164static struct platform_device orion_ehci1 = { 176static struct platform_device orion5x_ehci1 = {
165 .name = "orion-ehci", 177 .name = "orion-ehci",
166 .id = 1, 178 .id = 1,
167 .dev = { 179 .dev = {
168 .dma_mask = &ehci_dmamask, 180 .dma_mask = &ehci_dmamask,
169 .coherent_dma_mask = 0xffffffff, 181 .coherent_dma_mask = 0xffffffff,
182 .platform_data = &orion5x_ehci_data,
170 }, 183 },
171 .resource = orion_ehci1_resources, 184 .resource = orion5x_ehci1_resources,
172 .num_resources = ARRAY_SIZE(orion_ehci1_resources), 185 .num_resources = ARRAY_SIZE(orion5x_ehci1_resources),
173}; 186};
174 187
175/***************************************************************************** 188/*****************************************************************************
@@ -177,42 +190,42 @@ static struct platform_device orion_ehci1 = {
177 * (The Orion and Discovery (MV643xx) families use the same Ethernet driver) 190 * (The Orion and Discovery (MV643xx) families use the same Ethernet driver)
178 ****************************************************************************/ 191 ****************************************************************************/
179 192
180static struct resource orion_eth_shared_resources[] = { 193static struct resource orion5x_eth_shared_resources[] = {
181 { 194 {
182 .start = ORION_ETH_PHYS_BASE + 0x2000, 195 .start = ORION5X_ETH_PHYS_BASE + 0x2000,
183 .end = ORION_ETH_PHYS_BASE + 0x3fff, 196 .end = ORION5X_ETH_PHYS_BASE + 0x3fff,
184 .flags = IORESOURCE_MEM, 197 .flags = IORESOURCE_MEM,
185 }, 198 },
186}; 199};
187 200
188static struct platform_device orion_eth_shared = { 201static struct platform_device orion5x_eth_shared = {
189 .name = MV643XX_ETH_SHARED_NAME, 202 .name = MV643XX_ETH_SHARED_NAME,
190 .id = 0, 203 .id = 0,
191 .num_resources = 1, 204 .num_resources = 1,
192 .resource = orion_eth_shared_resources, 205 .resource = orion5x_eth_shared_resources,
193}; 206};
194 207
195static struct resource orion_eth_resources[] = { 208static struct resource orion5x_eth_resources[] = {
196 { 209 {
197 .name = "eth irq", 210 .name = "eth irq",
198 .start = IRQ_ORION_ETH_SUM, 211 .start = IRQ_ORION5X_ETH_SUM,
199 .end = IRQ_ORION_ETH_SUM, 212 .end = IRQ_ORION5X_ETH_SUM,
200 .flags = IORESOURCE_IRQ, 213 .flags = IORESOURCE_IRQ,
201 } 214 }
202}; 215};
203 216
204static struct platform_device orion_eth = { 217static struct platform_device orion5x_eth = {
205 .name = MV643XX_ETH_NAME, 218 .name = MV643XX_ETH_NAME,
206 .id = 0, 219 .id = 0,
207 .num_resources = 1, 220 .num_resources = 1,
208 .resource = orion_eth_resources, 221 .resource = orion5x_eth_resources,
209}; 222};
210 223
211void __init orion_eth_init(struct mv643xx_eth_platform_data *eth_data) 224void __init orion5x_eth_init(struct mv643xx_eth_platform_data *eth_data)
212{ 225{
213 orion_eth.dev.platform_data = eth_data; 226 orion5x_eth.dev.platform_data = eth_data;
214 platform_device_register(&orion_eth_shared); 227 platform_device_register(&orion5x_eth_shared);
215 platform_device_register(&orion_eth); 228 platform_device_register(&orion5x_eth);
216} 229}
217 230
218/***************************************************************************** 231/*****************************************************************************
@@ -220,13 +233,13 @@ void __init orion_eth_init(struct mv643xx_eth_platform_data *eth_data)
220 * (The Orion and Discovery (MV643xx) families share the same I2C controller) 233 * (The Orion and Discovery (MV643xx) families share the same I2C controller)
221 ****************************************************************************/ 234 ****************************************************************************/
222 235
223static struct mv64xxx_i2c_pdata orion_i2c_pdata = { 236static struct mv64xxx_i2c_pdata orion5x_i2c_pdata = {
224 .freq_m = 8, /* assumes 166 MHz TCLK */ 237 .freq_m = 8, /* assumes 166 MHz TCLK */
225 .freq_n = 3, 238 .freq_n = 3,
226 .timeout = 1000, /* Default timeout of 1 second */ 239 .timeout = 1000, /* Default timeout of 1 second */
227}; 240};
228 241
229static struct resource orion_i2c_resources[] = { 242static struct resource orion5x_i2c_resources[] = {
230 { 243 {
231 .name = "i2c base", 244 .name = "i2c base",
232 .start = I2C_PHYS_BASE, 245 .start = I2C_PHYS_BASE,
@@ -235,66 +248,80 @@ static struct resource orion_i2c_resources[] = {
235 }, 248 },
236 { 249 {
237 .name = "i2c irq", 250 .name = "i2c irq",
238 .start = IRQ_ORION_I2C, 251 .start = IRQ_ORION5X_I2C,
239 .end = IRQ_ORION_I2C, 252 .end = IRQ_ORION5X_I2C,
240 .flags = IORESOURCE_IRQ, 253 .flags = IORESOURCE_IRQ,
241 }, 254 },
242}; 255};
243 256
244static struct platform_device orion_i2c = { 257static struct platform_device orion5x_i2c = {
245 .name = MV64XXX_I2C_CTLR_NAME, 258 .name = MV64XXX_I2C_CTLR_NAME,
246 .id = 0, 259 .id = 0,
247 .num_resources = ARRAY_SIZE(orion_i2c_resources), 260 .num_resources = ARRAY_SIZE(orion5x_i2c_resources),
248 .resource = orion_i2c_resources, 261 .resource = orion5x_i2c_resources,
249 .dev = { 262 .dev = {
250 .platform_data = &orion_i2c_pdata, 263 .platform_data = &orion5x_i2c_pdata,
251 }, 264 },
252}; 265};
253 266
254/***************************************************************************** 267/*****************************************************************************
255 * Sata port 268 * Sata port
256 ****************************************************************************/ 269 ****************************************************************************/
257static struct resource orion_sata_resources[] = { 270static struct resource orion5x_sata_resources[] = {
258 { 271 {
259 .name = "sata base", 272 .name = "sata base",
260 .start = ORION_SATA_PHYS_BASE, 273 .start = ORION5X_SATA_PHYS_BASE,
261 .end = ORION_SATA_PHYS_BASE + 0x5000 - 1, 274 .end = ORION5X_SATA_PHYS_BASE + 0x5000 - 1,
262 .flags = IORESOURCE_MEM, 275 .flags = IORESOURCE_MEM,
263 }, 276 },
264 { 277 {
265 .name = "sata irq", 278 .name = "sata irq",
266 .start = IRQ_ORION_SATA, 279 .start = IRQ_ORION5X_SATA,
267 .end = IRQ_ORION_SATA, 280 .end = IRQ_ORION5X_SATA,
268 .flags = IORESOURCE_IRQ, 281 .flags = IORESOURCE_IRQ,
269 }, 282 },
270}; 283};
271 284
272static struct platform_device orion_sata = { 285static struct platform_device orion5x_sata = {
273 .name = "sata_mv", 286 .name = "sata_mv",
274 .id = 0, 287 .id = 0,
275 .dev = { 288 .dev = {
276 .coherent_dma_mask = 0xffffffff, 289 .coherent_dma_mask = 0xffffffff,
277 }, 290 },
278 .num_resources = ARRAY_SIZE(orion_sata_resources), 291 .num_resources = ARRAY_SIZE(orion5x_sata_resources),
279 .resource = orion_sata_resources, 292 .resource = orion5x_sata_resources,
280}; 293};
281 294
282void __init orion_sata_init(struct mv_sata_platform_data *sata_data) 295void __init orion5x_sata_init(struct mv_sata_platform_data *sata_data)
283{ 296{
284 orion_sata.dev.platform_data = sata_data; 297 sata_data->dram = &orion5x_mbus_dram_info;
285 platform_device_register(&orion_sata); 298 orion5x_sata.dev.platform_data = sata_data;
299 platform_device_register(&orion5x_sata);
286} 300}
287 301
288/***************************************************************************** 302/*****************************************************************************
303 * Time handling
304 ****************************************************************************/
305
306static void orion5x_timer_init(void)
307{
308 orion_time_init(IRQ_ORION5X_BRIDGE, ORION5X_TCLK);
309}
310
311struct sys_timer orion5x_timer = {
312 .init = orion5x_timer_init,
313};
314
315/*****************************************************************************
289 * General 316 * General
290 ****************************************************************************/ 317 ****************************************************************************/
291 318
292/* 319/*
293 * Identify device ID and rev from PCIE configuration header space '0'. 320 * Identify device ID and rev from PCIE configuration header space '0'.
294 */ 321 */
295static void orion_id(u32 *dev, u32 *rev, char **dev_name) 322static void __init orion5x_id(u32 *dev, u32 *rev, char **dev_name)
296{ 323{
297 orion_pcie_id(dev, rev); 324 orion5x_pcie_id(dev, rev);
298 325
299 if (*dev == MV88F5281_DEV_ID) { 326 if (*dev == MV88F5281_DEV_ID) {
300 if (*rev == MV88F5281_REV_D2) { 327 if (*rev == MV88F5281_REV_D2) {
@@ -321,33 +348,28 @@ static void orion_id(u32 *dev, u32 *rev, char **dev_name)
321 } 348 }
322} 349}
323 350
324void __init orion_init(void) 351void __init orion5x_init(void)
325{ 352{
326 char *dev_name; 353 char *dev_name;
327 u32 dev, rev; 354 u32 dev, rev;
328 355
329 orion_id(&dev, &rev, &dev_name); 356 orion5x_id(&dev, &rev, &dev_name);
330 printk(KERN_INFO "Orion ID: %s. TCLK=%d.\n", dev_name, ORION_TCLK); 357 printk(KERN_INFO "Orion ID: %s. TCLK=%d.\n", dev_name, ORION5X_TCLK);
331 358
332 /* 359 /*
333 * Setup Orion address map 360 * Setup Orion address map
334 */ 361 */
335 orion_setup_cpu_wins(); 362 orion5x_setup_cpu_mbus_bridge();
336 orion_setup_usb_wins(); 363 orion5x_setup_eth_wins();
337 orion_setup_eth_wins();
338 orion_setup_pci_wins();
339 orion_setup_pcie_wins();
340 if (dev == MV88F5182_DEV_ID)
341 orion_setup_sata_wins();
342 364
343 /* 365 /*
344 * REgister devices 366 * Register devices.
345 */ 367 */
346 platform_device_register(&orion_uart); 368 platform_device_register(&orion5x_uart);
347 platform_device_register(&orion_ehci0); 369 platform_device_register(&orion5x_ehci0);
348 if (dev == MV88F5182_DEV_ID) 370 if (dev == MV88F5182_DEV_ID)
349 platform_device_register(&orion_ehci1); 371 platform_device_register(&orion5x_ehci1);
350 platform_device_register(&orion_i2c); 372 platform_device_register(&orion5x_i2c);
351} 373}
352 374
353/* 375/*
diff --git a/arch/arm/mach-orion5x/common.h b/arch/arm/mach-orion5x/common.h
new file mode 100644
index 000000000000..f4c4c9a72a7c
--- /dev/null
+++ b/arch/arm/mach-orion5x/common.h
@@ -0,0 +1,72 @@
1#ifndef __ARCH_ORION5X_COMMON_H
2#define __ARCH_ORION5X_COMMON_H
3
4/*
5 * Basic Orion init functions used early by machine-setup.
6 */
7
8void orion5x_map_io(void);
9void orion5x_init_irq(void);
10void orion5x_init(void);
11extern struct sys_timer orion5x_timer;
12
13/*
14 * Enumerations and functions for Orion windows mapping. Used by Orion core
15 * functions to map its interfaces and by the machine-setup to map its on-
16 * board devices. Details in /mach-orion/addr-map.c
17 */
18extern struct mbus_dram_target_info orion5x_mbus_dram_info;
19void orion5x_setup_cpu_mbus_bridge(void);
20void orion5x_setup_dev_boot_win(u32 base, u32 size);
21void orion5x_setup_dev0_win(u32 base, u32 size);
22void orion5x_setup_dev1_win(u32 base, u32 size);
23void orion5x_setup_dev2_win(u32 base, u32 size);
24void orion5x_setup_pcie_wa_win(u32 base, u32 size);
25void orion5x_setup_eth_wins(void);
26
27/*
28 * Shared code used internally by other Orion core functions.
29 * (/mach-orion/pci.c)
30 */
31
32struct pci_sys_data;
33struct pci_bus;
34
35void orion5x_pcie_id(u32 *dev, u32 *rev);
36int orion5x_pcie_local_bus_nr(void);
37int orion5x_pci_local_bus_nr(void);
38int orion5x_pci_sys_setup(int nr, struct pci_sys_data *sys);
39struct pci_bus *orion5x_pci_sys_scan_bus(int nr, struct pci_sys_data *sys);
40
41/*
42 * Valid GPIO pins according to MPP setup, used by machine-setup.
43 * (/mach-orion/gpio.c).
44 */
45
46void orion5x_gpio_set_valid_pins(u32 pins);
47void gpio_display(void); /* debug */
48
49/*
50 * Pull in Orion Ethernet platform_data, used by machine-setup
51 */
52
53struct mv643xx_eth_platform_data;
54
55void orion5x_eth_init(struct mv643xx_eth_platform_data *eth_data);
56
57/*
58 * Orion Sata platform_data, used by machine-setup
59 */
60
61struct mv_sata_platform_data;
62
63void orion5x_sata_init(struct mv_sata_platform_data *sata_data);
64
65struct machine_desc;
66struct meminfo;
67struct tag;
68extern void __init tag_fixup_mem32(struct machine_desc *, struct tag *,
69 char **, struct meminfo *);
70
71
72#endif
diff --git a/arch/arm/mach-orion/db88f5281-setup.c b/arch/arm/mach-orion5x/db88f5281-setup.c
index 5ef44e1a2d36..872aed372327 100644
--- a/arch/arm/mach-orion/db88f5281-setup.c
+++ b/arch/arm/mach-orion5x/db88f5281-setup.c
@@ -1,12 +1,12 @@
1/* 1/*
2 * arch/arm/mach-orion/db88f5281-setup.c 2 * arch/arm/mach-orion5x/db88f5281-setup.c
3 * 3 *
4 * Marvell Orion-2 Development Board Setup 4 * Marvell Orion-2 Development Board Setup
5 * 5 *
6 * Maintainer: Tzachi Perelstein <tzachi@marvell.com> 6 * Maintainer: Tzachi Perelstein <tzachi@marvell.com>
7 * 7 *
8 * This file is licensed under the terms of the GNU General Public 8 * This file is licensed under the terms of the GNU General Public
9 * License version 2. This program is licensed "as is" without any 9 * License version 2. This program is licensed "as is" without any
10 * warranty of any kind, whether express or implied. 10 * warranty of any kind, whether express or implied.
11 */ 11 */
12 12
@@ -24,8 +24,8 @@
24#include <asm/gpio.h> 24#include <asm/gpio.h>
25#include <asm/mach/arch.h> 25#include <asm/mach/arch.h>
26#include <asm/mach/pci.h> 26#include <asm/mach/pci.h>
27#include <asm/arch/orion.h> 27#include <asm/arch/orion5x.h>
28#include <asm/arch/platform.h> 28#include <asm/plat-orion/orion_nand.h>
29#include "common.h" 29#include "common.h"
30 30
31/***************************************************************************** 31/*****************************************************************************
@@ -244,8 +244,8 @@ static int __init db88f5281_pci_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
244 /* 244 /*
245 * PCIE IRQ is connected internally (not GPIO) 245 * PCIE IRQ is connected internally (not GPIO)
246 */ 246 */
247 if (dev->bus->number == orion_pcie_local_bus_nr()) 247 if (dev->bus->number == orion5x_pcie_local_bus_nr())
248 return IRQ_ORION_PCIE0_INT; 248 return IRQ_ORION5X_PCIE0_INT;
249 249
250 /* 250 /*
251 * PCI IRQs are connected via GPIOs 251 * PCI IRQs are connected via GPIOs
@@ -265,8 +265,8 @@ static struct hw_pci db88f5281_pci __initdata = {
265 .nr_controllers = 2, 265 .nr_controllers = 2,
266 .preinit = db88f5281_pci_preinit, 266 .preinit = db88f5281_pci_preinit,
267 .swizzle = pci_std_swizzle, 267 .swizzle = pci_std_swizzle,
268 .setup = orion_pci_sys_setup, 268 .setup = orion5x_pci_sys_setup,
269 .scan = orion_pci_sys_scan_bus, 269 .scan = orion5x_pci_sys_scan_bus,
270 .map_irq = db88f5281_pci_map_irq, 270 .map_irq = db88f5281_pci_map_irq,
271}; 271};
272 272
@@ -312,19 +312,16 @@ static void __init db88f5281_init(void)
312 /* 312 /*
313 * Basic Orion setup. Need to be called early. 313 * Basic Orion setup. Need to be called early.
314 */ 314 */
315 orion_init(); 315 orion5x_init();
316 316
317 /* 317 /*
318 * Setup the CPU address decode windows for our on-board devices 318 * Setup the CPU address decode windows for our on-board devices
319 */ 319 */
320 orion_setup_cpu_win(ORION_DEV_BOOT, DB88F5281_NOR_BOOT_BASE, 320 orion5x_setup_dev_boot_win(DB88F5281_NOR_BOOT_BASE,
321 DB88F5281_NOR_BOOT_SIZE, -1); 321 DB88F5281_NOR_BOOT_SIZE);
322 orion_setup_cpu_win(ORION_DEV0, DB88F5281_7SEG_BASE, 322 orion5x_setup_dev0_win(DB88F5281_7SEG_BASE, DB88F5281_7SEG_SIZE);
323 DB88F5281_7SEG_SIZE, -1); 323 orion5x_setup_dev1_win(DB88F5281_NOR_BASE, DB88F5281_NOR_SIZE);
324 orion_setup_cpu_win(ORION_DEV1, DB88F5281_NOR_BASE, 324 orion5x_setup_dev2_win(DB88F5281_NAND_BASE, DB88F5281_NAND_SIZE);
325 DB88F5281_NOR_SIZE, -1);
326 orion_setup_cpu_win(ORION_DEV2, DB88F5281_NAND_BASE,
327 DB88F5281_NAND_SIZE, -1);
328 325
329 /* 326 /*
330 * Setup Multiplexing Pins: 327 * Setup Multiplexing Pins:
@@ -340,25 +337,25 @@ static void __init db88f5281_init(void)
340 * MPP18: UART1_CTS MPP19: UART1_RTS 337 * MPP18: UART1_CTS MPP19: UART1_RTS
341 * MPP-DEV: DEV_D[16:31] 338 * MPP-DEV: DEV_D[16:31]
342 */ 339 */
343 orion_write(MPP_0_7_CTRL, 0x00222203); 340 orion5x_write(MPP_0_7_CTRL, 0x00222203);
344 orion_write(MPP_8_15_CTRL, 0x44000000); 341 orion5x_write(MPP_8_15_CTRL, 0x44000000);
345 orion_write(MPP_16_19_CTRL, 0); 342 orion5x_write(MPP_16_19_CTRL, 0);
346 orion_write(MPP_DEV_CTRL, 0); 343 orion5x_write(MPP_DEV_CTRL, 0);
347 344
348 orion_gpio_set_valid_pins(0x00003fc3); 345 orion5x_gpio_set_valid_pins(0x00003fc3);
349 346
350 platform_add_devices(db88f5281_devs, ARRAY_SIZE(db88f5281_devs)); 347 platform_add_devices(db88f5281_devs, ARRAY_SIZE(db88f5281_devs));
351 i2c_register_board_info(0, &db88f5281_i2c_rtc, 1); 348 i2c_register_board_info(0, &db88f5281_i2c_rtc, 1);
352 orion_eth_init(&db88f5281_eth_data); 349 orion5x_eth_init(&db88f5281_eth_data);
353} 350}
354 351
355MACHINE_START(DB88F5281, "Marvell Orion-2 Development Board") 352MACHINE_START(DB88F5281, "Marvell Orion-2 Development Board")
356 /* Maintainer: Tzachi Perelstein <tzachi@marvell.com> */ 353 /* Maintainer: Tzachi Perelstein <tzachi@marvell.com> */
357 .phys_io = ORION_REGS_PHYS_BASE, 354 .phys_io = ORION5X_REGS_PHYS_BASE,
358 .io_pg_offst = ((ORION_REGS_VIRT_BASE) >> 18) & 0xfffc, 355 .io_pg_offst = ((ORION5X_REGS_VIRT_BASE) >> 18) & 0xfffc,
359 .boot_params = 0x00000100, 356 .boot_params = 0x00000100,
360 .init_machine = db88f5281_init, 357 .init_machine = db88f5281_init,
361 .map_io = orion_map_io, 358 .map_io = orion5x_map_io,
362 .init_irq = orion_init_irq, 359 .init_irq = orion5x_init_irq,
363 .timer = &orion_timer, 360 .timer = &orion5x_timer,
364MACHINE_END 361MACHINE_END
diff --git a/arch/arm/mach-orion/dns323-setup.c b/arch/arm/mach-orion5x/dns323-setup.c
index 076e155ad510..d67790ef236e 100644
--- a/arch/arm/mach-orion/dns323-setup.c
+++ b/arch/arm/mach-orion5x/dns323-setup.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * arch/arm/mach-orion/dns323-setup.c 2 * arch/arm/mach-orion5x/dns323-setup.c
3 * 3 *
4 * Copyright (C) 2007 Herbert Valerio Riedel <hvr@gnu.org> 4 * Copyright (C) 2007 Herbert Valerio Riedel <hvr@gnu.org>
5 * 5 *
@@ -25,8 +25,7 @@
25#include <asm/gpio.h> 25#include <asm/gpio.h>
26#include <asm/mach/arch.h> 26#include <asm/mach/arch.h>
27#include <asm/mach/pci.h> 27#include <asm/mach/pci.h>
28#include <asm/arch/orion.h> 28#include <asm/arch/orion5x.h>
29#include <asm/arch/platform.h>
30#include "common.h" 29#include "common.h"
31 30
32#define DNS323_GPIO_LED_RIGHT_AMBER 1 31#define DNS323_GPIO_LED_RIGHT_AMBER 1
@@ -45,8 +44,8 @@
45static int __init dns323_pci_map_irq(struct pci_dev *dev, u8 slot, u8 pin) 44static int __init dns323_pci_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
46{ 45{
47 /* PCI-E */ 46 /* PCI-E */
48 if (dev->bus->number == orion_pcie_local_bus_nr()) 47 if (dev->bus->number == orion5x_pcie_local_bus_nr())
49 return IRQ_ORION_PCIE0_INT; 48 return IRQ_ORION5X_PCIE0_INT;
50 49
51 pr_err("%s: requested mapping for unknown bus\n", __func__); 50 pr_err("%s: requested mapping for unknown bus\n", __func__);
52 51
@@ -56,8 +55,8 @@ static int __init dns323_pci_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
56static struct hw_pci dns323_pci __initdata = { 55static struct hw_pci dns323_pci __initdata = {
57 .nr_controllers = 1, 56 .nr_controllers = 1,
58 .swizzle = pci_std_swizzle, 57 .swizzle = pci_std_swizzle,
59 .setup = orion_pci_sys_setup, 58 .setup = orion5x_pci_sys_setup,
60 .scan = orion_pci_sys_scan_bus, 59 .scan = orion5x_pci_sys_scan_bus,
61 .map_irq = dns323_pci_map_irq, 60 .map_irq = dns323_pci_map_irq,
62}; 61};
63 62
@@ -247,27 +246,25 @@ static void dns323_power_off(void)
247static void __init dns323_init(void) 246static void __init dns323_init(void)
248{ 247{
249 /* Setup basic Orion functions. Need to be called early. */ 248 /* Setup basic Orion functions. Need to be called early. */
250 orion_init(); 249 orion5x_init();
251 250
252 /* setup flash mapping 251 /* setup flash mapping
253 * CS3 holds a 8 MB Spansion S29GL064M90TFIR4 252 * CS3 holds a 8 MB Spansion S29GL064M90TFIR4
254 */ 253 */
255 orion_setup_cpu_win(ORION_DEV_BOOT, DNS323_NOR_BOOT_BASE, 254 orion5x_setup_dev_boot_win(DNS323_NOR_BOOT_BASE, DNS323_NOR_BOOT_SIZE);
256 DNS323_NOR_BOOT_SIZE, -1);
257 255
258 /* DNS-323 has a Marvell 88X7042 SATA controller attached via PCIE 256 /* DNS-323 has a Marvell 88X7042 SATA controller attached via PCIE
259 * 257 *
260 * Open a special address decode windows for the PCIE WA. 258 * Open a special address decode windows for the PCIE WA.
261 */ 259 */
262 orion_write(ORION_REGS_VIRT_BASE | 0x20074, ORION_PCIE_WA_PHYS_BASE); 260 orion5x_setup_pcie_wa_win(ORION5X_PCIE_WA_PHYS_BASE,
263 orion_write(ORION_REGS_VIRT_BASE | 0x20070, 261 ORION5X_PCIE_WA_SIZE);
264 (0x7941 | (((ORION_PCIE_WA_SIZE >> 16) - 1)) << 16));
265 262
266 /* set MPP to 0 as D-Link's 2.6.12.6 kernel did */ 263 /* set MPP to 0 as D-Link's 2.6.12.6 kernel did */
267 orion_write(MPP_0_7_CTRL, 0); 264 orion5x_write(MPP_0_7_CTRL, 0);
268 orion_write(MPP_8_15_CTRL, 0); 265 orion5x_write(MPP_8_15_CTRL, 0);
269 orion_write(MPP_16_19_CTRL, 0); 266 orion5x_write(MPP_16_19_CTRL, 0);
270 orion_write(MPP_DEV_CTRL, 0); 267 orion5x_write(MPP_DEV_CTRL, 0);
271 268
272 /* Define used GPIO pins 269 /* Define used GPIO pins
273 270
@@ -290,7 +287,7 @@ static void __init dns323_init(void)
290 | 14 | Out | //unknown// 287 | 14 | Out | //unknown//
291 | 15 | Out | //unknown// 288 | 15 | Out | //unknown//
292 */ 289 */
293 orion_gpio_set_valid_pins(0x07f6); 290 orion5x_gpio_set_valid_pins(0x07f6);
294 291
295 /* register dns323 specific power-off method */ 292 /* register dns323 specific power-off method */
296 if ((gpio_request(DNS323_GPIO_POWER_OFF, "POWEROFF") != 0) 293 if ((gpio_request(DNS323_GPIO_POWER_OFF, "POWEROFF") != 0)
@@ -306,18 +303,18 @@ static void __init dns323_init(void)
306 i2c_register_board_info(0, dns323_i2c_devices, 303 i2c_register_board_info(0, dns323_i2c_devices,
307 ARRAY_SIZE(dns323_i2c_devices)); 304 ARRAY_SIZE(dns323_i2c_devices));
308 305
309 orion_eth_init(&dns323_eth_data); 306 orion5x_eth_init(&dns323_eth_data);
310} 307}
311 308
312/* Warning: D-Link uses a wrong mach-type (=526) in their bootloader */ 309/* Warning: D-Link uses a wrong mach-type (=526) in their bootloader */
313MACHINE_START(DNS323, "D-Link DNS-323") 310MACHINE_START(DNS323, "D-Link DNS-323")
314 /* Maintainer: Herbert Valerio Riedel <hvr@gnu.org> */ 311 /* Maintainer: Herbert Valerio Riedel <hvr@gnu.org> */
315 .phys_io = ORION_REGS_PHYS_BASE, 312 .phys_io = ORION5X_REGS_PHYS_BASE,
316 .io_pg_offst = ((ORION_REGS_VIRT_BASE) >> 18) & 0xFFFC, 313 .io_pg_offst = ((ORION5X_REGS_VIRT_BASE) >> 18) & 0xFFFC,
317 .boot_params = 0x00000100, 314 .boot_params = 0x00000100,
318 .init_machine = dns323_init, 315 .init_machine = dns323_init,
319 .map_io = orion_map_io, 316 .map_io = orion5x_map_io,
320 .init_irq = orion_init_irq, 317 .init_irq = orion5x_init_irq,
321 .timer = &orion_timer, 318 .timer = &orion5x_timer,
322 .fixup = tag_fixup_mem32, 319 .fixup = tag_fixup_mem32,
323MACHINE_END 320MACHINE_END
diff --git a/arch/arm/mach-orion/gpio.c b/arch/arm/mach-orion5x/gpio.c
index f713818c66a3..8108c316c426 100644
--- a/arch/arm/mach-orion/gpio.c
+++ b/arch/arm/mach-orion5x/gpio.c
@@ -1,12 +1,12 @@
1/* 1/*
2 * arch/arm/mach-orion/gpio.c 2 * arch/arm/mach-orion5x/gpio.c
3 * 3 *
4 * GPIO functions for Marvell Orion System On Chip 4 * GPIO functions for Marvell Orion System On Chip
5 * 5 *
6 * Maintainer: Tzachi Perelstein <tzachi@marvell.com> 6 * Maintainer: Tzachi Perelstein <tzachi@marvell.com>
7 * 7 *
8 * This file is licensed under the terms of the GNU General Public 8 * This file is licensed under the terms of the GNU General Public
9 * License version 2. This program is licensed "as is" without any 9 * License version 2. This program is licensed "as is" without any
10 * warranty of any kind, whether express or implied. 10 * warranty of any kind, whether express or implied.
11 */ 11 */
12 12
@@ -16,14 +16,15 @@
16#include <linux/spinlock.h> 16#include <linux/spinlock.h>
17#include <linux/bitops.h> 17#include <linux/bitops.h>
18#include <asm/gpio.h> 18#include <asm/gpio.h>
19#include <asm/arch/orion.h> 19#include <asm/io.h>
20#include <asm/arch/orion5x.h>
20#include "common.h" 21#include "common.h"
21 22
22static DEFINE_SPINLOCK(gpio_lock); 23static DEFINE_SPINLOCK(gpio_lock);
23static unsigned long gpio_valid[BITS_TO_LONGS(GPIO_MAX)]; 24static unsigned long gpio_valid[BITS_TO_LONGS(GPIO_MAX)];
24static const char *gpio_label[GPIO_MAX]; /* non null for allocated GPIOs */ 25static const char *gpio_label[GPIO_MAX]; /* non null for allocated GPIOs */
25 26
26void __init orion_gpio_set_valid_pins(u32 pins) 27void __init orion5x_gpio_set_valid_pins(u32 pins)
27{ 28{
28 gpio_valid[0] = pins; 29 gpio_valid[0] = pins;
29} 30}
@@ -49,7 +50,7 @@ int gpio_direction_input(unsigned pin)
49 if (!gpio_label[pin]) 50 if (!gpio_label[pin])
50 gpio_label[pin] = "?"; 51 gpio_label[pin] = "?";
51 52
52 orion_setbits(GPIO_IO_CONF, 1 << pin); 53 orion5x_setbits(GPIO_IO_CONF, 1 << pin);
53 54
54 spin_unlock_irqrestore(&gpio_lock, flags); 55 spin_unlock_irqrestore(&gpio_lock, flags);
55 return 0; 56 return 0;
@@ -76,12 +77,12 @@ int gpio_direction_output(unsigned pin, int value)
76 gpio_label[pin] = "?"; 77 gpio_label[pin] = "?";
77 78
78 mask = 1 << pin; 79 mask = 1 << pin;
79 orion_clrbits(GPIO_BLINK_EN, mask); 80 orion5x_clrbits(GPIO_BLINK_EN, mask);
80 if (value) 81 if (value)
81 orion_setbits(GPIO_OUT, mask); 82 orion5x_setbits(GPIO_OUT, mask);
82 else 83 else
83 orion_clrbits(GPIO_OUT, mask); 84 orion5x_clrbits(GPIO_OUT, mask);
84 orion_clrbits(GPIO_IO_CONF, mask); 85 orion5x_clrbits(GPIO_IO_CONF, mask);
85 86
86 spin_unlock_irqrestore(&gpio_lock, flags); 87 spin_unlock_irqrestore(&gpio_lock, flags);
87 return 0; 88 return 0;
@@ -92,10 +93,10 @@ int gpio_get_value(unsigned pin)
92{ 93{
93 int val, mask = 1 << pin; 94 int val, mask = 1 << pin;
94 95
95 if (orion_read(GPIO_IO_CONF) & mask) 96 if (orion5x_read(GPIO_IO_CONF) & mask)
96 val = orion_read(GPIO_DATA_IN) ^ orion_read(GPIO_IN_POL); 97 val = orion5x_read(GPIO_DATA_IN) ^ orion5x_read(GPIO_IN_POL);
97 else 98 else
98 val = orion_read(GPIO_OUT); 99 val = orion5x_read(GPIO_OUT);
99 100
100 return val & mask; 101 return val & mask;
101} 102}
@@ -108,32 +109,32 @@ void gpio_set_value(unsigned pin, int value)
108 109
109 spin_lock_irqsave(&gpio_lock, flags); 110 spin_lock_irqsave(&gpio_lock, flags);
110 111
111 orion_clrbits(GPIO_BLINK_EN, mask); 112 orion5x_clrbits(GPIO_BLINK_EN, mask);
112 if (value) 113 if (value)
113 orion_setbits(GPIO_OUT, mask); 114 orion5x_setbits(GPIO_OUT, mask);
114 else 115 else
115 orion_clrbits(GPIO_OUT, mask); 116 orion5x_clrbits(GPIO_OUT, mask);
116 117
117 spin_unlock_irqrestore(&gpio_lock, flags); 118 spin_unlock_irqrestore(&gpio_lock, flags);
118} 119}
119EXPORT_SYMBOL(gpio_set_value); 120EXPORT_SYMBOL(gpio_set_value);
120 121
121void orion_gpio_set_blink(unsigned pin, int blink) 122void orion5x_gpio_set_blink(unsigned pin, int blink)
122{ 123{
123 unsigned long flags; 124 unsigned long flags;
124 int mask = 1 << pin; 125 int mask = 1 << pin;
125 126
126 spin_lock_irqsave(&gpio_lock, flags); 127 spin_lock_irqsave(&gpio_lock, flags);
127 128
128 orion_clrbits(GPIO_OUT, mask); 129 orion5x_clrbits(GPIO_OUT, mask);
129 if (blink) 130 if (blink)
130 orion_setbits(GPIO_BLINK_EN, mask); 131 orion5x_setbits(GPIO_BLINK_EN, mask);
131 else 132 else
132 orion_clrbits(GPIO_BLINK_EN, mask); 133 orion5x_clrbits(GPIO_BLINK_EN, mask);
133 134
134 spin_unlock_irqrestore(&gpio_lock, flags); 135 spin_unlock_irqrestore(&gpio_lock, flags);
135} 136}
136EXPORT_SYMBOL(orion_gpio_set_blink); 137EXPORT_SYMBOL(orion5x_gpio_set_blink);
137 138
138int gpio_request(unsigned pin, const char *label) 139int gpio_request(unsigned pin, const char *label)
139{ 140{
@@ -187,39 +188,39 @@ void gpio_display(void)
187 printk("GPIO, free\n"); 188 printk("GPIO, free\n");
188 } else { 189 } else {
189 printk("GPIO, used by %s, ", gpio_label[i]); 190 printk("GPIO, used by %s, ", gpio_label[i]);
190 if (orion_read(GPIO_IO_CONF) & (1 << i)) { 191 if (orion5x_read(GPIO_IO_CONF) & (1 << i)) {
191 printk("input, active %s, level %s, edge %s\n", 192 printk("input, active %s, level %s, edge %s\n",
192 ((orion_read(GPIO_IN_POL) >> i) & 1) ? "low" : "high", 193 ((orion5x_read(GPIO_IN_POL) >> i) & 1) ? "low" : "high",
193 ((orion_read(GPIO_LEVEL_MASK) >> i) & 1) ? "enabled" : "masked", 194 ((orion5x_read(GPIO_LEVEL_MASK) >> i) & 1) ? "enabled" : "masked",
194 ((orion_read(GPIO_EDGE_MASK) >> i) & 1) ? "enabled" : "masked"); 195 ((orion5x_read(GPIO_EDGE_MASK) >> i) & 1) ? "enabled" : "masked");
195 } else { 196 } else {
196 printk("output, val=%d\n", (orion_read(GPIO_OUT) >> i) & 1); 197 printk("output, val=%d\n", (orion5x_read(GPIO_OUT) >> i) & 1);
197 } 198 }
198 } 199 }
199 } 200 }
200 201
201 printk(KERN_DEBUG "MPP_0_7_CTRL (0x%08x) = 0x%08x\n", 202 printk(KERN_DEBUG "MPP_0_7_CTRL (0x%08x) = 0x%08x\n",
202 MPP_0_7_CTRL, orion_read(MPP_0_7_CTRL)); 203 MPP_0_7_CTRL, orion5x_read(MPP_0_7_CTRL));
203 printk(KERN_DEBUG "MPP_8_15_CTRL (0x%08x) = 0x%08x\n", 204 printk(KERN_DEBUG "MPP_8_15_CTRL (0x%08x) = 0x%08x\n",
204 MPP_8_15_CTRL, orion_read(MPP_8_15_CTRL)); 205 MPP_8_15_CTRL, orion5x_read(MPP_8_15_CTRL));
205 printk(KERN_DEBUG "MPP_16_19_CTRL (0x%08x) = 0x%08x\n", 206 printk(KERN_DEBUG "MPP_16_19_CTRL (0x%08x) = 0x%08x\n",
206 MPP_16_19_CTRL, orion_read(MPP_16_19_CTRL)); 207 MPP_16_19_CTRL, orion5x_read(MPP_16_19_CTRL));
207 printk(KERN_DEBUG "MPP_DEV_CTRL (0x%08x) = 0x%08x\n", 208 printk(KERN_DEBUG "MPP_DEV_CTRL (0x%08x) = 0x%08x\n",
208 MPP_DEV_CTRL, orion_read(MPP_DEV_CTRL)); 209 MPP_DEV_CTRL, orion5x_read(MPP_DEV_CTRL));
209 printk(KERN_DEBUG "GPIO_OUT (0x%08x) = 0x%08x\n", 210 printk(KERN_DEBUG "GPIO_OUT (0x%08x) = 0x%08x\n",
210 GPIO_OUT, orion_read(GPIO_OUT)); 211 GPIO_OUT, orion5x_read(GPIO_OUT));
211 printk(KERN_DEBUG "GPIO_IO_CONF (0x%08x) = 0x%08x\n", 212 printk(KERN_DEBUG "GPIO_IO_CONF (0x%08x) = 0x%08x\n",
212 GPIO_IO_CONF, orion_read(GPIO_IO_CONF)); 213 GPIO_IO_CONF, orion5x_read(GPIO_IO_CONF));
213 printk(KERN_DEBUG "GPIO_BLINK_EN (0x%08x) = 0x%08x\n", 214 printk(KERN_DEBUG "GPIO_BLINK_EN (0x%08x) = 0x%08x\n",
214 GPIO_BLINK_EN, orion_read(GPIO_BLINK_EN)); 215 GPIO_BLINK_EN, orion5x_read(GPIO_BLINK_EN));
215 printk(KERN_DEBUG "GPIO_IN_POL (0x%08x) = 0x%08x\n", 216 printk(KERN_DEBUG "GPIO_IN_POL (0x%08x) = 0x%08x\n",
216 GPIO_IN_POL, orion_read(GPIO_IN_POL)); 217 GPIO_IN_POL, orion5x_read(GPIO_IN_POL));
217 printk(KERN_DEBUG "GPIO_DATA_IN (0x%08x) = 0x%08x\n", 218 printk(KERN_DEBUG "GPIO_DATA_IN (0x%08x) = 0x%08x\n",
218 GPIO_DATA_IN, orion_read(GPIO_DATA_IN)); 219 GPIO_DATA_IN, orion5x_read(GPIO_DATA_IN));
219 printk(KERN_DEBUG "GPIO_LEVEL_MASK (0x%08x) = 0x%08x\n", 220 printk(KERN_DEBUG "GPIO_LEVEL_MASK (0x%08x) = 0x%08x\n",
220 GPIO_LEVEL_MASK, orion_read(GPIO_LEVEL_MASK)); 221 GPIO_LEVEL_MASK, orion5x_read(GPIO_LEVEL_MASK));
221 printk(KERN_DEBUG "GPIO_EDGE_CAUSE (0x%08x) = 0x%08x\n", 222 printk(KERN_DEBUG "GPIO_EDGE_CAUSE (0x%08x) = 0x%08x\n",
222 GPIO_EDGE_CAUSE, orion_read(GPIO_EDGE_CAUSE)); 223 GPIO_EDGE_CAUSE, orion5x_read(GPIO_EDGE_CAUSE));
223 printk(KERN_DEBUG "GPIO_EDGE_MASK (0x%08x) = 0x%08x\n", 224 printk(KERN_DEBUG "GPIO_EDGE_MASK (0x%08x) = 0x%08x\n",
224 GPIO_EDGE_MASK, orion_read(GPIO_EDGE_MASK)); 225 GPIO_EDGE_MASK, orion5x_read(GPIO_EDGE_MASK));
225} 226}
diff --git a/arch/arm/mach-orion/irq.c b/arch/arm/mach-orion5x/irq.c
index df7e12ad378b..dd21f38c5d37 100644
--- a/arch/arm/mach-orion/irq.c
+++ b/arch/arm/mach-orion5x/irq.c
@@ -1,12 +1,12 @@
1/* 1/*
2 * arch/arm/mach-orion/irq.c 2 * arch/arm/mach-orion5x/irq.c
3 * 3 *
4 * Core IRQ functions for Marvell Orion System On Chip 4 * Core IRQ functions for Marvell Orion System On Chip
5 * 5 *
6 * Maintainer: Tzachi Perelstein <tzachi@marvell.com> 6 * Maintainer: Tzachi Perelstein <tzachi@marvell.com>
7 * 7 *
8 * This file is licensed under the terms of the GNU General Public 8 * This file is licensed under the terms of the GNU General Public
9 * License version 2. This program is licensed "as is" without any 9 * License version 2. This program is licensed "as is" without any
10 * warranty of any kind, whether express or implied. 10 * warranty of any kind, whether express or implied.
11 */ 11 */
12 12
@@ -14,7 +14,9 @@
14#include <linux/init.h> 14#include <linux/init.h>
15#include <linux/irq.h> 15#include <linux/irq.h>
16#include <asm/gpio.h> 16#include <asm/gpio.h>
17#include <asm/arch/orion.h> 17#include <asm/io.h>
18#include <asm/arch/orion5x.h>
19#include <asm/plat-orion/irq.h>
18#include "common.h" 20#include "common.h"
19 21
20/***************************************************************************** 22/*****************************************************************************
@@ -42,46 +44,46 @@
42 * polarity LEVEL mask 44 * polarity LEVEL mask
43 * 45 *
44 ****************************************************************************/ 46 ****************************************************************************/
45static void orion_gpio_irq_ack(u32 irq) 47static void orion5x_gpio_irq_ack(u32 irq)
46{ 48{
47 int pin = irq_to_gpio(irq); 49 int pin = irq_to_gpio(irq);
48 if (irq_desc[irq].status & IRQ_LEVEL) 50 if (irq_desc[irq].status & IRQ_LEVEL)
49 /* 51 /*
50 * Mask bit for level interrupt 52 * Mask bit for level interrupt
51 */ 53 */
52 orion_clrbits(GPIO_LEVEL_MASK, 1 << pin); 54 orion5x_clrbits(GPIO_LEVEL_MASK, 1 << pin);
53 else 55 else
54 /* 56 /*
55 * Clear casue bit for egde interrupt 57 * Clear casue bit for egde interrupt
56 */ 58 */
57 orion_clrbits(GPIO_EDGE_CAUSE, 1 << pin); 59 orion5x_clrbits(GPIO_EDGE_CAUSE, 1 << pin);
58} 60}
59 61
60static void orion_gpio_irq_mask(u32 irq) 62static void orion5x_gpio_irq_mask(u32 irq)
61{ 63{
62 int pin = irq_to_gpio(irq); 64 int pin = irq_to_gpio(irq);
63 if (irq_desc[irq].status & IRQ_LEVEL) 65 if (irq_desc[irq].status & IRQ_LEVEL)
64 orion_clrbits(GPIO_LEVEL_MASK, 1 << pin); 66 orion5x_clrbits(GPIO_LEVEL_MASK, 1 << pin);
65 else 67 else
66 orion_clrbits(GPIO_EDGE_MASK, 1 << pin); 68 orion5x_clrbits(GPIO_EDGE_MASK, 1 << pin);
67} 69}
68 70
69static void orion_gpio_irq_unmask(u32 irq) 71static void orion5x_gpio_irq_unmask(u32 irq)
70{ 72{
71 int pin = irq_to_gpio(irq); 73 int pin = irq_to_gpio(irq);
72 if (irq_desc[irq].status & IRQ_LEVEL) 74 if (irq_desc[irq].status & IRQ_LEVEL)
73 orion_setbits(GPIO_LEVEL_MASK, 1 << pin); 75 orion5x_setbits(GPIO_LEVEL_MASK, 1 << pin);
74 else 76 else
75 orion_setbits(GPIO_EDGE_MASK, 1 << pin); 77 orion5x_setbits(GPIO_EDGE_MASK, 1 << pin);
76} 78}
77 79
78static int orion_gpio_set_irq_type(u32 irq, u32 type) 80static int orion5x_gpio_set_irq_type(u32 irq, u32 type)
79{ 81{
80 int pin = irq_to_gpio(irq); 82 int pin = irq_to_gpio(irq);
81 struct irq_desc *desc; 83 struct irq_desc *desc;
82 84
83 if ((orion_read(GPIO_IO_CONF) & (1 << pin)) == 0) { 85 if ((orion5x_read(GPIO_IO_CONF) & (1 << pin)) == 0) {
84 printk(KERN_ERR "orion_gpio_set_irq_type failed " 86 printk(KERN_ERR "orion5x_gpio_set_irq_type failed "
85 "(irq %d, pin %d).\n", irq, pin); 87 "(irq %d, pin %d).\n", irq, pin);
86 return -EINVAL; 88 return -EINVAL;
87 } 89 }
@@ -92,22 +94,22 @@ static int orion_gpio_set_irq_type(u32 irq, u32 type)
92 case IRQT_HIGH: 94 case IRQT_HIGH:
93 desc->handle_irq = handle_level_irq; 95 desc->handle_irq = handle_level_irq;
94 desc->status |= IRQ_LEVEL; 96 desc->status |= IRQ_LEVEL;
95 orion_clrbits(GPIO_IN_POL, (1 << pin)); 97 orion5x_clrbits(GPIO_IN_POL, (1 << pin));
96 break; 98 break;
97 case IRQT_LOW: 99 case IRQT_LOW:
98 desc->handle_irq = handle_level_irq; 100 desc->handle_irq = handle_level_irq;
99 desc->status |= IRQ_LEVEL; 101 desc->status |= IRQ_LEVEL;
100 orion_setbits(GPIO_IN_POL, (1 << pin)); 102 orion5x_setbits(GPIO_IN_POL, (1 << pin));
101 break; 103 break;
102 case IRQT_RISING: 104 case IRQT_RISING:
103 desc->handle_irq = handle_edge_irq; 105 desc->handle_irq = handle_edge_irq;
104 desc->status &= ~IRQ_LEVEL; 106 desc->status &= ~IRQ_LEVEL;
105 orion_clrbits(GPIO_IN_POL, (1 << pin)); 107 orion5x_clrbits(GPIO_IN_POL, (1 << pin));
106 break; 108 break;
107 case IRQT_FALLING: 109 case IRQT_FALLING:
108 desc->handle_irq = handle_edge_irq; 110 desc->handle_irq = handle_edge_irq;
109 desc->status &= ~IRQ_LEVEL; 111 desc->status &= ~IRQ_LEVEL;
110 orion_setbits(GPIO_IN_POL, (1 << pin)); 112 orion5x_setbits(GPIO_IN_POL, (1 << pin));
111 break; 113 break;
112 case IRQT_BOTHEDGE: 114 case IRQT_BOTHEDGE:
113 desc->handle_irq = handle_edge_irq; 115 desc->handle_irq = handle_edge_irq;
@@ -115,11 +117,11 @@ static int orion_gpio_set_irq_type(u32 irq, u32 type)
115 /* 117 /*
116 * set initial polarity based on current input level 118 * set initial polarity based on current input level
117 */ 119 */
118 if ((orion_read(GPIO_IN_POL) ^ orion_read(GPIO_DATA_IN)) 120 if ((orion5x_read(GPIO_IN_POL) ^ orion5x_read(GPIO_DATA_IN))
119 & (1 << pin)) 121 & (1 << pin))
120 orion_setbits(GPIO_IN_POL, (1 << pin)); /* falling */ 122 orion5x_setbits(GPIO_IN_POL, (1 << pin)); /* falling */
121 else 123 else
122 orion_clrbits(GPIO_IN_POL, (1 << pin)); /* rising */ 124 orion5x_clrbits(GPIO_IN_POL, (1 << pin)); /* rising */
123 125
124 break; 126 break;
125 default: 127 default:
@@ -133,22 +135,22 @@ static int orion_gpio_set_irq_type(u32 irq, u32 type)
133 return 0; 135 return 0;
134} 136}
135 137
136static struct irq_chip orion_gpio_irq_chip = { 138static struct irq_chip orion5x_gpio_irq_chip = {
137 .name = "Orion-IRQ-GPIO", 139 .name = "Orion-IRQ-GPIO",
138 .ack = orion_gpio_irq_ack, 140 .ack = orion5x_gpio_irq_ack,
139 .mask = orion_gpio_irq_mask, 141 .mask = orion5x_gpio_irq_mask,
140 .unmask = orion_gpio_irq_unmask, 142 .unmask = orion5x_gpio_irq_unmask,
141 .set_type = orion_gpio_set_irq_type, 143 .set_type = orion5x_gpio_set_irq_type,
142}; 144};
143 145
144static void orion_gpio_irq_handler(unsigned int irq, struct irq_desc *desc) 146static void orion5x_gpio_irq_handler(unsigned int irq, struct irq_desc *desc)
145{ 147{
146 u32 cause, offs, pin; 148 u32 cause, offs, pin;
147 149
148 BUG_ON(irq < IRQ_ORION_GPIO_0_7 || irq > IRQ_ORION_GPIO_24_31); 150 BUG_ON(irq < IRQ_ORION5X_GPIO_0_7 || irq > IRQ_ORION5X_GPIO_24_31);
149 offs = (irq - IRQ_ORION_GPIO_0_7) * 8; 151 offs = (irq - IRQ_ORION5X_GPIO_0_7) * 8;
150 cause = (orion_read(GPIO_DATA_IN) & orion_read(GPIO_LEVEL_MASK)) | 152 cause = (orion5x_read(GPIO_DATA_IN) & orion5x_read(GPIO_LEVEL_MASK)) |
151 (orion_read(GPIO_EDGE_CAUSE) & orion_read(GPIO_EDGE_MASK)); 153 (orion5x_read(GPIO_EDGE_CAUSE) & orion5x_read(GPIO_EDGE_MASK));
152 154
153 for (pin = offs; pin < offs + 8; pin++) { 155 for (pin = offs; pin < offs + 8; pin++) {
154 if (cause & (1 << pin)) { 156 if (cause & (1 << pin)) {
@@ -156,16 +158,16 @@ static void orion_gpio_irq_handler(unsigned int irq, struct irq_desc *desc)
156 desc = irq_desc + irq; 158 desc = irq_desc + irq;
157 if ((desc->status & IRQ_TYPE_SENSE_MASK) == IRQT_BOTHEDGE) { 159 if ((desc->status & IRQ_TYPE_SENSE_MASK) == IRQT_BOTHEDGE) {
158 /* Swap polarity (race with GPIO line) */ 160 /* Swap polarity (race with GPIO line) */
159 u32 polarity = orion_read(GPIO_IN_POL); 161 u32 polarity = orion5x_read(GPIO_IN_POL);
160 polarity ^= 1 << pin; 162 polarity ^= 1 << pin;
161 orion_write(GPIO_IN_POL, polarity); 163 orion5x_write(GPIO_IN_POL, polarity);
162 } 164 }
163 desc_handle_irq(irq, desc); 165 desc_handle_irq(irq, desc);
164 } 166 }
165 } 167 }
166} 168}
167 169
168static void __init orion_init_gpio_irq(void) 170static void __init orion5x_init_gpio_irq(void)
169{ 171{
170 int i; 172 int i;
171 struct irq_desc *desc; 173 struct irq_desc *desc;
@@ -173,69 +175,37 @@ static void __init orion_init_gpio_irq(void)
173 /* 175 /*
174 * Mask and clear GPIO IRQ interrupts 176 * Mask and clear GPIO IRQ interrupts
175 */ 177 */
176 orion_write(GPIO_LEVEL_MASK, 0x0); 178 orion5x_write(GPIO_LEVEL_MASK, 0x0);
177 orion_write(GPIO_EDGE_MASK, 0x0); 179 orion5x_write(GPIO_EDGE_MASK, 0x0);
178 orion_write(GPIO_EDGE_CAUSE, 0x0); 180 orion5x_write(GPIO_EDGE_CAUSE, 0x0);
179 181
180 /* 182 /*
181 * Register chained level handlers for GPIO IRQs by default. 183 * Register chained level handlers for GPIO IRQs by default.
182 * User can use set_type() if he wants to use edge types handlers. 184 * User can use set_type() if he wants to use edge types handlers.
183 */ 185 */
184 for (i = IRQ_ORION_GPIO_START; i < NR_IRQS; i++) { 186 for (i = IRQ_ORION5X_GPIO_START; i < NR_IRQS; i++) {
185 set_irq_chip(i, &orion_gpio_irq_chip); 187 set_irq_chip(i, &orion5x_gpio_irq_chip);
186 set_irq_handler(i, handle_level_irq); 188 set_irq_handler(i, handle_level_irq);
187 desc = irq_desc + i; 189 desc = irq_desc + i;
188 desc->status |= IRQ_LEVEL; 190 desc->status |= IRQ_LEVEL;
189 set_irq_flags(i, IRQF_VALID); 191 set_irq_flags(i, IRQF_VALID);
190 } 192 }
191 set_irq_chained_handler(IRQ_ORION_GPIO_0_7, orion_gpio_irq_handler); 193 set_irq_chained_handler(IRQ_ORION5X_GPIO_0_7, orion5x_gpio_irq_handler);
192 set_irq_chained_handler(IRQ_ORION_GPIO_8_15, orion_gpio_irq_handler); 194 set_irq_chained_handler(IRQ_ORION5X_GPIO_8_15, orion5x_gpio_irq_handler);
193 set_irq_chained_handler(IRQ_ORION_GPIO_16_23, orion_gpio_irq_handler); 195 set_irq_chained_handler(IRQ_ORION5X_GPIO_16_23, orion5x_gpio_irq_handler);
194 set_irq_chained_handler(IRQ_ORION_GPIO_24_31, orion_gpio_irq_handler); 196 set_irq_chained_handler(IRQ_ORION5X_GPIO_24_31, orion5x_gpio_irq_handler);
195} 197}
196 198
197/***************************************************************************** 199/*****************************************************************************
198 * Orion Main IRQ 200 * Orion Main IRQ
199 ****************************************************************************/ 201 ****************************************************************************/
200static void orion_main_irq_mask(u32 irq) 202static void __init orion5x_init_main_irq(void)
201{ 203{
202 orion_clrbits(MAIN_IRQ_MASK, 1 << irq); 204 orion_irq_init(0, (void __iomem *)MAIN_IRQ_MASK);
203} 205}
204 206
205static void orion_main_irq_unmask(u32 irq) 207void __init orion5x_init_irq(void)
206{ 208{
207 orion_setbits(MAIN_IRQ_MASK, 1 << irq); 209 orion5x_init_main_irq();
208} 210 orion5x_init_gpio_irq();
209
210static struct irq_chip orion_main_irq_chip = {
211 .name = "Orion-IRQ-Main",
212 .ack = orion_main_irq_mask,
213 .mask = orion_main_irq_mask,
214 .unmask = orion_main_irq_unmask,
215};
216
217static void __init orion_init_main_irq(void)
218{
219 int i;
220
221 /*
222 * Mask and clear Main IRQ interrupts
223 */
224 orion_write(MAIN_IRQ_MASK, 0x0);
225 orion_write(MAIN_IRQ_CAUSE, 0x0);
226
227 /*
228 * Register level handler for Main IRQs
229 */
230 for (i = 0; i < IRQ_ORION_GPIO_START; i++) {
231 set_irq_chip(i, &orion_main_irq_chip);
232 set_irq_handler(i, handle_level_irq);
233 set_irq_flags(i, IRQF_VALID);
234 }
235}
236
237void __init orion_init_irq(void)
238{
239 orion_init_main_irq();
240 orion_init_gpio_irq();
241} 211}
diff --git a/arch/arm/mach-orion/kurobox_pro-setup.c b/arch/arm/mach-orion5x/kurobox_pro-setup.c
index 785a07bdf1e2..91413455beba 100644
--- a/arch/arm/mach-orion/kurobox_pro-setup.c
+++ b/arch/arm/mach-orion5x/kurobox_pro-setup.c
@@ -1,10 +1,10 @@
1/* 1/*
2 * arch/arm/mach-orion/kurobox_pro-setup.c 2 * arch/arm/mach-orion5x/kurobox_pro-setup.c
3 * 3 *
4 * Maintainer: Ronen Shitrit <rshitrit@marvell.com> 4 * Maintainer: Ronen Shitrit <rshitrit@marvell.com>
5 * 5 *
6 * This file is licensed under the terms of the GNU General Public 6 * This file is licensed under the terms of the GNU General Public
7 * License version 2. This program is licensed "as is" without any 7 * License version 2. This program is licensed "as is" without any
8 * warranty of any kind, whether express or implied. 8 * warranty of any kind, whether express or implied.
9 */ 9 */
10 10
@@ -22,8 +22,8 @@
22#include <asm/gpio.h> 22#include <asm/gpio.h>
23#include <asm/mach/arch.h> 23#include <asm/mach/arch.h>
24#include <asm/mach/pci.h> 24#include <asm/mach/pci.h>
25#include <asm/arch/orion.h> 25#include <asm/arch/orion5x.h>
26#include <asm/arch/platform.h> 26#include <asm/plat-orion/orion_nand.h>
27#include "common.h" 27#include "common.h"
28 28
29/***************************************************************************** 29/*****************************************************************************
@@ -123,8 +123,8 @@ static int __init kurobox_pro_pci_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
123 /* 123 /*
124 * PCI isn't used on the Kuro 124 * PCI isn't used on the Kuro
125 */ 125 */
126 if (dev->bus->number == orion_pcie_local_bus_nr()) 126 if (dev->bus->number == orion5x_pcie_local_bus_nr())
127 return IRQ_ORION_PCIE0_INT; 127 return IRQ_ORION5X_PCIE0_INT;
128 else 128 else
129 printk(KERN_ERR "kurobox_pro_pci_map_irq failed, unknown bus\n"); 129 printk(KERN_ERR "kurobox_pro_pci_map_irq failed, unknown bus\n");
130 130
@@ -134,8 +134,8 @@ static int __init kurobox_pro_pci_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
134static struct hw_pci kurobox_pro_pci __initdata = { 134static struct hw_pci kurobox_pro_pci __initdata = {
135 .nr_controllers = 1, 135 .nr_controllers = 1,
136 .swizzle = pci_std_swizzle, 136 .swizzle = pci_std_swizzle,
137 .setup = orion_pci_sys_setup, 137 .setup = orion5x_pci_sys_setup,
138 .scan = orion_pci_sys_scan_bus, 138 .scan = orion5x_pci_sys_scan_bus,
139 .map_irq = kurobox_pro_pci_map_irq, 139 .map_irq = kurobox_pro_pci_map_irq,
140}; 140};
141 141
@@ -178,31 +178,25 @@ static struct mv_sata_platform_data kurobox_pro_sata_data = {
178 * General Setup 178 * General Setup
179 ****************************************************************************/ 179 ****************************************************************************/
180 180
181static struct platform_device *kurobox_pro_devices[] __initdata = {
182 &kurobox_pro_nor_flash,
183 &kurobox_pro_nand_flash,
184};
185
186static void __init kurobox_pro_init(void) 181static void __init kurobox_pro_init(void)
187{ 182{
188 /* 183 /*
189 * Setup basic Orion functions. Need to be called early. 184 * Setup basic Orion functions. Need to be called early.
190 */ 185 */
191 orion_init(); 186 orion5x_init();
192 187
193 /* 188 /*
194 * Setup the CPU address decode windows for our devices 189 * Setup the CPU address decode windows for our devices
195 */ 190 */
196 orion_setup_cpu_win(ORION_DEV_BOOT, KUROBOX_PRO_NOR_BOOT_BASE, 191 orion5x_setup_dev_boot_win(KUROBOX_PRO_NOR_BOOT_BASE,
197 KUROBOX_PRO_NOR_BOOT_SIZE, -1); 192 KUROBOX_PRO_NOR_BOOT_SIZE);
198 orion_setup_cpu_win(ORION_DEV0, KUROBOX_PRO_NAND_BASE, 193 orion5x_setup_dev0_win(KUROBOX_PRO_NAND_BASE, KUROBOX_PRO_NAND_SIZE);
199 KUROBOX_PRO_NAND_SIZE, -1); 194
200 /* 195 /*
201 * Open a special address decode windows for the PCIE WA. 196 * Open a special address decode windows for the PCIE WA.
202 */ 197 */
203 orion_write(ORION_REGS_VIRT_BASE | 0x20074, ORION_PCIE_WA_PHYS_BASE); 198 orion5x_setup_pcie_wa_win(ORION5X_PCIE_WA_PHYS_BASE,
204 orion_write(ORION_REGS_VIRT_BASE | 0x20070, (0x7941 | 199 ORION5X_PCIE_WA_SIZE);
205 (((ORION_PCIE_WA_SIZE >> 16) - 1)) << 16));
206 200
207 /* 201 /*
208 * Setup Multiplexing Pins -- 202 * Setup Multiplexing Pins --
@@ -219,26 +213,44 @@ static void __init kurobox_pro_init(void)
219 * MPP[15] SATA 1 active indication 213 * MPP[15] SATA 1 active indication
220 * MPP[16-19] Not used 214 * MPP[16-19] Not used
221 */ 215 */
222 orion_write(MPP_0_7_CTRL, 0x44220003); 216 orion5x_write(MPP_0_7_CTRL, 0x44220003);
223 orion_write(MPP_8_15_CTRL, 0x55550000); 217 orion5x_write(MPP_8_15_CTRL, 0x55550000);
224 orion_write(MPP_16_19_CTRL, 0x0); 218 orion5x_write(MPP_16_19_CTRL, 0x0);
225 219
226 orion_gpio_set_valid_pins(0x0000000c); 220 orion5x_gpio_set_valid_pins(0x0000000c);
227 221
228 platform_add_devices(kurobox_pro_devices, ARRAY_SIZE(kurobox_pro_devices)); 222 platform_device_register(&kurobox_pro_nor_flash);
223 if (machine_is_kurobox_pro())
224 platform_device_register(&kurobox_pro_nand_flash);
229 i2c_register_board_info(0, &kurobox_pro_i2c_rtc, 1); 225 i2c_register_board_info(0, &kurobox_pro_i2c_rtc, 1);
230 orion_eth_init(&kurobox_pro_eth_data); 226 orion5x_eth_init(&kurobox_pro_eth_data);
231 orion_sata_init(&kurobox_pro_sata_data); 227 orion5x_sata_init(&kurobox_pro_sata_data);
232} 228}
233 229
230#ifdef CONFIG_MACH_KUROBOX_PRO
234MACHINE_START(KUROBOX_PRO, "Buffalo/Revogear Kurobox Pro") 231MACHINE_START(KUROBOX_PRO, "Buffalo/Revogear Kurobox Pro")
235 /* Maintainer: Ronen Shitrit <rshitrit@marvell.com> */ 232 /* Maintainer: Ronen Shitrit <rshitrit@marvell.com> */
236 .phys_io = ORION_REGS_PHYS_BASE, 233 .phys_io = ORION5X_REGS_PHYS_BASE,
237 .io_pg_offst = ((ORION_REGS_VIRT_BASE) >> 18) & 0xFFFC, 234 .io_pg_offst = ((ORION5X_REGS_VIRT_BASE) >> 18) & 0xFFFC,
235 .boot_params = 0x00000100,
236 .init_machine = kurobox_pro_init,
237 .map_io = orion5x_map_io,
238 .init_irq = orion5x_init_irq,
239 .timer = &orion5x_timer,
240 .fixup = tag_fixup_mem32,
241MACHINE_END
242#endif
243
244#ifdef CONFIG_MACH_LINKSTATION_PRO
245MACHINE_START(LINKSTATION_PRO, "Buffalo Linkstation Pro/Live")
246 /* Maintainer: Byron Bradley <byron.bbradley@gmail.com> */
247 .phys_io = ORION5X_REGS_PHYS_BASE,
248 .io_pg_offst = ((ORION5X_REGS_VIRT_BASE) >> 18) & 0xFFFC,
238 .boot_params = 0x00000100, 249 .boot_params = 0x00000100,
239 .init_machine = kurobox_pro_init, 250 .init_machine = kurobox_pro_init,
240 .map_io = orion_map_io, 251 .map_io = orion5x_map_io,
241 .init_irq = orion_init_irq, 252 .init_irq = orion5x_init_irq,
242 .timer = &orion_timer, 253 .timer = &orion5x_timer,
243 .fixup = tag_fixup_mem32, 254 .fixup = tag_fixup_mem32,
244MACHINE_END 255MACHINE_END
256#endif
diff --git a/arch/arm/mach-orion5x/pci.c b/arch/arm/mach-orion5x/pci.c
new file mode 100644
index 000000000000..fdf99fca85b3
--- /dev/null
+++ b/arch/arm/mach-orion5x/pci.c
@@ -0,0 +1,559 @@
1/*
2 * arch/arm/mach-orion5x/pci.c
3 *
4 * PCI and PCIe functions for Marvell Orion System On Chip
5 *
6 * Maintainer: Tzachi Perelstein <tzachi@marvell.com>
7 *
8 * This file is licensed under the terms of the GNU General Public
9 * License version 2. This program is licensed "as is" without any
10 * warranty of any kind, whether express or implied.
11 */
12
13#include <linux/kernel.h>
14#include <linux/pci.h>
15#include <linux/mbus.h>
16#include <asm/mach/pci.h>
17#include <asm/plat-orion/pcie.h>
18#include "common.h"
19
20/*****************************************************************************
21 * Orion has one PCIe controller and one PCI controller.
22 *
23 * Note1: The local PCIe bus number is '0'. The local PCI bus number
24 * follows the scanned PCIe bridged busses, if any.
25 *
26 * Note2: It is possible for PCI/PCIe agents to access many subsystem's
27 * space, by configuring BARs and Address Decode Windows, e.g. flashes on
28 * device bus, Orion registers, etc. However this code only enable the
29 * access to DDR banks.
30 ****************************************************************************/
31
32
33/*****************************************************************************
34 * PCIe controller
35 ****************************************************************************/
36#define PCIE_BASE ((void __iomem *)ORION5X_PCIE_VIRT_BASE)
37
38void __init orion5x_pcie_id(u32 *dev, u32 *rev)
39{
40 *dev = orion_pcie_dev_id(PCIE_BASE);
41 *rev = orion_pcie_rev(PCIE_BASE);
42}
43
44int __init orion5x_pcie_local_bus_nr(void)
45{
46 return orion_pcie_get_local_bus_nr(PCIE_BASE);
47}
48
49static int pcie_valid_config(int bus, int dev)
50{
51 /*
52 * Don't go out when trying to access --
53 * 1. nonexisting device on local bus
54 * 2. where there's no device connected (no link)
55 */
56 if (bus == 0 && dev == 0)
57 return 1;
58
59 if (!orion_pcie_link_up(PCIE_BASE))
60 return 0;
61
62 if (bus == 0 && dev != 1)
63 return 0;
64
65 return 1;
66}
67
68
69/*
70 * PCIe config cycles are done by programming the PCIE_CONF_ADDR register
71 * and then reading the PCIE_CONF_DATA register. Need to make sure these
72 * transactions are atomic.
73 */
74static DEFINE_SPINLOCK(orion5x_pcie_lock);
75
76static int pcie_rd_conf(struct pci_bus *bus, u32 devfn, int where,
77 int size, u32 *val)
78{
79 unsigned long flags;
80 int ret;
81
82 if (pcie_valid_config(bus->number, PCI_SLOT(devfn)) == 0) {
83 *val = 0xffffffff;
84 return PCIBIOS_DEVICE_NOT_FOUND;
85 }
86
87 spin_lock_irqsave(&orion5x_pcie_lock, flags);
88 ret = orion_pcie_rd_conf(PCIE_BASE, bus, devfn, where, size, val);
89 spin_unlock_irqrestore(&orion5x_pcie_lock, flags);
90
91 return ret;
92}
93
94static int pcie_rd_conf_wa(struct pci_bus *bus, u32 devfn,
95 int where, int size, u32 *val)
96{
97 int ret;
98
99 if (pcie_valid_config(bus->number, PCI_SLOT(devfn)) == 0) {
100 *val = 0xffffffff;
101 return PCIBIOS_DEVICE_NOT_FOUND;
102 }
103
104 /*
105 * We only support access to the non-extended configuration
106 * space when using the WA access method (or we would have to
107 * sacrifice 256M of CPU virtual address space.)
108 */
109 if (where >= 0x100) {
110 *val = 0xffffffff;
111 return PCIBIOS_DEVICE_NOT_FOUND;
112 }
113
114 ret = orion_pcie_rd_conf_wa((void __iomem *)ORION5X_PCIE_WA_VIRT_BASE,
115 bus, devfn, where, size, val);
116
117 return ret;
118}
119
120static int pcie_wr_conf(struct pci_bus *bus, u32 devfn,
121 int where, int size, u32 val)
122{
123 unsigned long flags;
124 int ret;
125
126 if (pcie_valid_config(bus->number, PCI_SLOT(devfn)) == 0)
127 return PCIBIOS_DEVICE_NOT_FOUND;
128
129 spin_lock_irqsave(&orion5x_pcie_lock, flags);
130 ret = orion_pcie_wr_conf(PCIE_BASE, bus, devfn, where, size, val);
131 spin_unlock_irqrestore(&orion5x_pcie_lock, flags);
132
133 return ret;
134}
135
136static struct pci_ops pcie_ops = {
137 .read = pcie_rd_conf,
138 .write = pcie_wr_conf,
139};
140
141
142static int __init pcie_setup(struct pci_sys_data *sys)
143{
144 struct resource *res;
145 int dev;
146
147 /*
148 * Generic PCIe unit setup.
149 */
150 orion_pcie_setup(PCIE_BASE, &orion5x_mbus_dram_info);
151
152 /*
153 * Check whether to apply Orion-1/Orion-NAS PCIe config
154 * read transaction workaround.
155 */
156 dev = orion_pcie_dev_id(PCIE_BASE);
157 if (dev == MV88F5181_DEV_ID || dev == MV88F5182_DEV_ID) {
158 printk(KERN_NOTICE "Applying Orion-1/Orion-NAS PCIe config "
159 "read transaction workaround\n");
160 pcie_ops.read = pcie_rd_conf_wa;
161 }
162
163 /*
164 * Request resources.
165 */
166 res = kzalloc(sizeof(struct resource) * 2, GFP_KERNEL);
167 if (!res)
168 panic("pcie_setup unable to alloc resources");
169
170 /*
171 * IORESOURCE_IO
172 */
173 res[0].name = "PCIe I/O Space";
174 res[0].flags = IORESOURCE_IO;
175 res[0].start = ORION5X_PCIE_IO_BUS_BASE;
176 res[0].end = res[0].start + ORION5X_PCIE_IO_SIZE - 1;
177 if (request_resource(&ioport_resource, &res[0]))
178 panic("Request PCIe IO resource failed\n");
179 sys->resource[0] = &res[0];
180
181 /*
182 * IORESOURCE_MEM
183 */
184 res[1].name = "PCIe Memory Space";
185 res[1].flags = IORESOURCE_MEM;
186 res[1].start = ORION5X_PCIE_MEM_PHYS_BASE;
187 res[1].end = res[1].start + ORION5X_PCIE_MEM_SIZE - 1;
188 if (request_resource(&iomem_resource, &res[1]))
189 panic("Request PCIe Memory resource failed\n");
190 sys->resource[1] = &res[1];
191
192 sys->resource[2] = NULL;
193 sys->io_offset = 0;
194
195 return 1;
196}
197
198/*****************************************************************************
199 * PCI controller
200 ****************************************************************************/
201#define PCI_MODE ORION5X_PCI_REG(0xd00)
202#define PCI_CMD ORION5X_PCI_REG(0xc00)
203#define PCI_P2P_CONF ORION5X_PCI_REG(0x1d14)
204#define PCI_CONF_ADDR ORION5X_PCI_REG(0xc78)
205#define PCI_CONF_DATA ORION5X_PCI_REG(0xc7c)
206
207/*
208 * PCI_MODE bits
209 */
210#define PCI_MODE_64BIT (1 << 2)
211#define PCI_MODE_PCIX ((1 << 4) | (1 << 5))
212
213/*
214 * PCI_CMD bits
215 */
216#define PCI_CMD_HOST_REORDER (1 << 29)
217
218/*
219 * PCI_P2P_CONF bits
220 */
221#define PCI_P2P_BUS_OFFS 16
222#define PCI_P2P_BUS_MASK (0xff << PCI_P2P_BUS_OFFS)
223#define PCI_P2P_DEV_OFFS 24
224#define PCI_P2P_DEV_MASK (0x1f << PCI_P2P_DEV_OFFS)
225
226/*
227 * PCI_CONF_ADDR bits
228 */
229#define PCI_CONF_REG(reg) ((reg) & 0xfc)
230#define PCI_CONF_FUNC(func) (((func) & 0x3) << 8)
231#define PCI_CONF_DEV(dev) (((dev) & 0x1f) << 11)
232#define PCI_CONF_BUS(bus) (((bus) & 0xff) << 16)
233#define PCI_CONF_ADDR_EN (1 << 31)
234
235/*
236 * Internal configuration space
237 */
238#define PCI_CONF_FUNC_STAT_CMD 0
239#define PCI_CONF_REG_STAT_CMD 4
240#define PCIX_STAT 0x64
241#define PCIX_STAT_BUS_OFFS 8
242#define PCIX_STAT_BUS_MASK (0xff << PCIX_STAT_BUS_OFFS)
243
244/*
245 * PCI Address Decode Windows registers
246 */
247#define PCI_BAR_SIZE_DDR_CS(n) (((n) == 0) ? ORION5X_PCI_REG(0xc08) : \
248 ((n) == 1) ? ORION5X_PCI_REG(0xd08) : \
249 ((n) == 2) ? ORION5X_PCI_REG(0xc0c) : \
250 ((n) == 3) ? ORION5X_PCI_REG(0xd0c) : 0)
251#define PCI_BAR_REMAP_DDR_CS(n) (((n) ==0) ? ORION5X_PCI_REG(0xc48) : \
252 ((n) == 1) ? ORION5X_PCI_REG(0xd48) : \
253 ((n) == 2) ? ORION5X_PCI_REG(0xc4c) : \
254 ((n) == 3) ? ORION5X_PCI_REG(0xd4c) : 0)
255#define PCI_BAR_ENABLE ORION5X_PCI_REG(0xc3c)
256#define PCI_ADDR_DECODE_CTRL ORION5X_PCI_REG(0xd3c)
257
258/*
259 * PCI configuration helpers for BAR settings
260 */
261#define PCI_CONF_FUNC_BAR_CS(n) ((n) >> 1)
262#define PCI_CONF_REG_BAR_LO_CS(n) (((n) & 1) ? 0x18 : 0x10)
263#define PCI_CONF_REG_BAR_HI_CS(n) (((n) & 1) ? 0x1c : 0x14)
264
265/*
266 * PCI config cycles are done by programming the PCI_CONF_ADDR register
267 * and then reading the PCI_CONF_DATA register. Need to make sure these
268 * transactions are atomic.
269 */
270static DEFINE_SPINLOCK(orion5x_pci_lock);
271
272int orion5x_pci_local_bus_nr(void)
273{
274 u32 conf = orion5x_read(PCI_P2P_CONF);
275 return((conf & PCI_P2P_BUS_MASK) >> PCI_P2P_BUS_OFFS);
276}
277
278static int orion5x_pci_hw_rd_conf(int bus, int dev, u32 func,
279 u32 where, u32 size, u32 *val)
280{
281 unsigned long flags;
282 spin_lock_irqsave(&orion5x_pci_lock, flags);
283
284 orion5x_write(PCI_CONF_ADDR, PCI_CONF_BUS(bus) |
285 PCI_CONF_DEV(dev) | PCI_CONF_REG(where) |
286 PCI_CONF_FUNC(func) | PCI_CONF_ADDR_EN);
287
288 *val = orion5x_read(PCI_CONF_DATA);
289
290 if (size == 1)
291 *val = (*val >> (8*(where & 0x3))) & 0xff;
292 else if (size == 2)
293 *val = (*val >> (8*(where & 0x3))) & 0xffff;
294
295 spin_unlock_irqrestore(&orion5x_pci_lock, flags);
296
297 return PCIBIOS_SUCCESSFUL;
298}
299
300static int orion5x_pci_hw_wr_conf(int bus, int dev, u32 func,
301 u32 where, u32 size, u32 val)
302{
303 unsigned long flags;
304 int ret = PCIBIOS_SUCCESSFUL;
305
306 spin_lock_irqsave(&orion5x_pci_lock, flags);
307
308 orion5x_write(PCI_CONF_ADDR, PCI_CONF_BUS(bus) |
309 PCI_CONF_DEV(dev) | PCI_CONF_REG(where) |
310 PCI_CONF_FUNC(func) | PCI_CONF_ADDR_EN);
311
312 if (size == 4) {
313 __raw_writel(val, PCI_CONF_DATA);
314 } else if (size == 2) {
315 __raw_writew(val, PCI_CONF_DATA + (where & 0x3));
316 } else if (size == 1) {
317 __raw_writeb(val, PCI_CONF_DATA + (where & 0x3));
318 } else {
319 ret = PCIBIOS_BAD_REGISTER_NUMBER;
320 }
321
322 spin_unlock_irqrestore(&orion5x_pci_lock, flags);
323
324 return ret;
325}
326
327static int orion5x_pci_rd_conf(struct pci_bus *bus, u32 devfn,
328 int where, int size, u32 *val)
329{
330 /*
331 * Don't go out for local device
332 */
333 if (bus->number == orion5x_pci_local_bus_nr() &&
334 PCI_SLOT(devfn) == 0 && PCI_FUNC(devfn) != 0) {
335 *val = 0xffffffff;
336 return PCIBIOS_DEVICE_NOT_FOUND;
337 }
338
339 return orion5x_pci_hw_rd_conf(bus->number, PCI_SLOT(devfn),
340 PCI_FUNC(devfn), where, size, val);
341}
342
343static int orion5x_pci_wr_conf(struct pci_bus *bus, u32 devfn,
344 int where, int size, u32 val)
345{
346 if (bus->number == orion5x_pci_local_bus_nr() &&
347 PCI_SLOT(devfn) == 0 && PCI_FUNC(devfn) != 0)
348 return PCIBIOS_DEVICE_NOT_FOUND;
349
350 return orion5x_pci_hw_wr_conf(bus->number, PCI_SLOT(devfn),
351 PCI_FUNC(devfn), where, size, val);
352}
353
354static struct pci_ops pci_ops = {
355 .read = orion5x_pci_rd_conf,
356 .write = orion5x_pci_wr_conf,
357};
358
359static void __init orion5x_pci_set_bus_nr(int nr)
360{
361 u32 p2p = orion5x_read(PCI_P2P_CONF);
362
363 if (orion5x_read(PCI_MODE) & PCI_MODE_PCIX) {
364 /*
365 * PCI-X mode
366 */
367 u32 pcix_status, bus, dev;
368 bus = (p2p & PCI_P2P_BUS_MASK) >> PCI_P2P_BUS_OFFS;
369 dev = (p2p & PCI_P2P_DEV_MASK) >> PCI_P2P_DEV_OFFS;
370 orion5x_pci_hw_rd_conf(bus, dev, 0, PCIX_STAT, 4, &pcix_status);
371 pcix_status &= ~PCIX_STAT_BUS_MASK;
372 pcix_status |= (nr << PCIX_STAT_BUS_OFFS);
373 orion5x_pci_hw_wr_conf(bus, dev, 0, PCIX_STAT, 4, pcix_status);
374 } else {
375 /*
376 * PCI Conventional mode
377 */
378 p2p &= ~PCI_P2P_BUS_MASK;
379 p2p |= (nr << PCI_P2P_BUS_OFFS);
380 orion5x_write(PCI_P2P_CONF, p2p);
381 }
382}
383
384static void __init orion5x_pci_master_slave_enable(void)
385{
386 int bus_nr, func, reg;
387 u32 val;
388
389 bus_nr = orion5x_pci_local_bus_nr();
390 func = PCI_CONF_FUNC_STAT_CMD;
391 reg = PCI_CONF_REG_STAT_CMD;
392 orion5x_pci_hw_rd_conf(bus_nr, 0, func, reg, 4, &val);
393 val |= (PCI_COMMAND_IO | PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER);
394 orion5x_pci_hw_wr_conf(bus_nr, 0, func, reg, 4, val | 0x7);
395}
396
397static void __init orion5x_setup_pci_wins(struct mbus_dram_target_info *dram)
398{
399 u32 win_enable;
400 int bus;
401 int i;
402
403 /*
404 * First, disable windows.
405 */
406 win_enable = 0xffffffff;
407 orion5x_write(PCI_BAR_ENABLE, win_enable);
408
409 /*
410 * Setup windows for DDR banks.
411 */
412 bus = orion5x_pci_local_bus_nr();
413
414 for (i = 0; i < dram->num_cs; i++) {
415 struct mbus_dram_window *cs = dram->cs + i;
416 u32 func = PCI_CONF_FUNC_BAR_CS(cs->cs_index);
417 u32 reg;
418 u32 val;
419
420 /*
421 * Write DRAM bank base address register.
422 */
423 reg = PCI_CONF_REG_BAR_LO_CS(cs->cs_index);
424 orion5x_pci_hw_rd_conf(bus, 0, func, reg, 4, &val);
425 val = (cs->base & 0xfffff000) | (val & 0xfff);
426 orion5x_pci_hw_wr_conf(bus, 0, func, reg, 4, val);
427
428 /*
429 * Write DRAM bank size register.
430 */
431 reg = PCI_CONF_REG_BAR_HI_CS(cs->cs_index);
432 orion5x_pci_hw_wr_conf(bus, 0, func, reg, 4, 0);
433 orion5x_write(PCI_BAR_SIZE_DDR_CS(cs->cs_index),
434 (cs->size - 1) & 0xfffff000);
435 orion5x_write(PCI_BAR_REMAP_DDR_CS(cs->cs_index),
436 cs->base & 0xfffff000);
437
438 /*
439 * Enable decode window for this chip select.
440 */
441 win_enable &= ~(1 << cs->cs_index);
442 }
443
444 /*
445 * Re-enable decode windows.
446 */
447 orion5x_write(PCI_BAR_ENABLE, win_enable);
448
449 /*
450 * Disable automatic update of address remaping when writing to BARs.
451 */
452 orion5x_setbits(PCI_ADDR_DECODE_CTRL, 1);
453}
454
455static int __init pci_setup(struct pci_sys_data *sys)
456{
457 struct resource *res;
458
459 /*
460 * Point PCI unit MBUS decode windows to DRAM space.
461 */
462 orion5x_setup_pci_wins(&orion5x_mbus_dram_info);
463
464 /*
465 * Master + Slave enable
466 */
467 orion5x_pci_master_slave_enable();
468
469 /*
470 * Force ordering
471 */
472 orion5x_setbits(PCI_CMD, PCI_CMD_HOST_REORDER);
473
474 /*
475 * Request resources
476 */
477 res = kzalloc(sizeof(struct resource) * 2, GFP_KERNEL);
478 if (!res)
479 panic("pci_setup unable to alloc resources");
480
481 /*
482 * IORESOURCE_IO
483 */
484 res[0].name = "PCI I/O Space";
485 res[0].flags = IORESOURCE_IO;
486 res[0].start = ORION5X_PCI_IO_BUS_BASE;
487 res[0].end = res[0].start + ORION5X_PCI_IO_SIZE - 1;
488 if (request_resource(&ioport_resource, &res[0]))
489 panic("Request PCI IO resource failed\n");
490 sys->resource[0] = &res[0];
491
492 /*
493 * IORESOURCE_MEM
494 */
495 res[1].name = "PCI Memory Space";
496 res[1].flags = IORESOURCE_MEM;
497 res[1].start = ORION5X_PCI_MEM_PHYS_BASE;
498 res[1].end = res[1].start + ORION5X_PCI_MEM_SIZE - 1;
499 if (request_resource(&iomem_resource, &res[1]))
500 panic("Request PCI Memory resource failed\n");
501 sys->resource[1] = &res[1];
502
503 sys->resource[2] = NULL;
504 sys->io_offset = 0;
505
506 return 1;
507}
508
509
510/*****************************************************************************
511 * General PCIe + PCI
512 ****************************************************************************/
513static void __devinit rc_pci_fixup(struct pci_dev *dev)
514{
515 /*
516 * Prevent enumeration of root complex.
517 */
518 if (dev->bus->parent == NULL && dev->devfn == 0) {
519 int i;
520
521 for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) {
522 dev->resource[i].start = 0;
523 dev->resource[i].end = 0;
524 dev->resource[i].flags = 0;
525 }
526 }
527}
528DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_MARVELL, PCI_ANY_ID, rc_pci_fixup);
529
530int __init orion5x_pci_sys_setup(int nr, struct pci_sys_data *sys)
531{
532 int ret = 0;
533
534 if (nr == 0) {
535 orion_pcie_set_local_bus_nr(PCIE_BASE, sys->busnr);
536 ret = pcie_setup(sys);
537 } else if (nr == 1) {
538 orion5x_pci_set_bus_nr(sys->busnr);
539 ret = pci_setup(sys);
540 }
541
542 return ret;
543}
544
545struct pci_bus __init *orion5x_pci_sys_scan_bus(int nr, struct pci_sys_data *sys)
546{
547 struct pci_bus *bus;
548
549 if (nr == 0) {
550 bus = pci_scan_bus(sys->busnr, &pcie_ops, sys);
551 } else if (nr == 1) {
552 bus = pci_scan_bus(sys->busnr, &pci_ops, sys);
553 } else {
554 bus = NULL;
555 BUG();
556 }
557
558 return bus;
559}
diff --git a/arch/arm/mach-orion/rd88f5182-setup.c b/arch/arm/mach-orion5x/rd88f5182-setup.c
index e851b8ca5ac6..37e8b2dc3ed5 100644
--- a/arch/arm/mach-orion/rd88f5182-setup.c
+++ b/arch/arm/mach-orion5x/rd88f5182-setup.c
@@ -1,12 +1,12 @@
1/* 1/*
2 * arch/arm/mach-orion/rd88f5182-setup.c 2 * arch/arm/mach-orion5x/rd88f5182-setup.c
3 * 3 *
4 * Marvell Orion-NAS Reference Design Setup 4 * Marvell Orion-NAS Reference Design Setup
5 * 5 *
6 * Maintainer: Ronen Shitrit <rshitrit@marvell.com> 6 * Maintainer: Ronen Shitrit <rshitrit@marvell.com>
7 * 7 *
8 * This file is licensed under the terms of the GNU General Public 8 * This file is licensed under the terms of the GNU General Public
9 * License version 2. This program is licensed "as is" without any 9 * License version 2. This program is licensed "as is" without any
10 * warranty of any kind, whether express or implied. 10 * warranty of any kind, whether express or implied.
11 */ 11 */
12 12
@@ -24,8 +24,7 @@
24#include <asm/leds.h> 24#include <asm/leds.h>
25#include <asm/mach/arch.h> 25#include <asm/mach/arch.h>
26#include <asm/mach/pci.h> 26#include <asm/mach/pci.h>
27#include <asm/arch/orion.h> 27#include <asm/arch/orion5x.h>
28#include <asm/arch/platform.h>
29#include "common.h" 28#include "common.h"
30 29
31/***************************************************************************** 30/*****************************************************************************
@@ -176,8 +175,8 @@ static int __init rd88f5182_pci_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
176 /* 175 /*
177 * PCI-E isn't used on the RD2 176 * PCI-E isn't used on the RD2
178 */ 177 */
179 if (dev->bus->number == orion_pcie_local_bus_nr()) 178 if (dev->bus->number == orion5x_pcie_local_bus_nr())
180 return IRQ_ORION_PCIE0_INT; 179 return IRQ_ORION5X_PCIE0_INT;
181 180
182 /* 181 /*
183 * PCI IRQs are connected via GPIOs 182 * PCI IRQs are connected via GPIOs
@@ -197,8 +196,8 @@ static struct hw_pci rd88f5182_pci __initdata = {
197 .nr_controllers = 2, 196 .nr_controllers = 2,
198 .preinit = rd88f5182_pci_preinit, 197 .preinit = rd88f5182_pci_preinit,
199 .swizzle = pci_std_swizzle, 198 .swizzle = pci_std_swizzle,
200 .setup = orion_pci_sys_setup, 199 .setup = orion5x_pci_sys_setup,
201 .scan = orion_pci_sys_scan_bus, 200 .scan = orion5x_pci_sys_scan_bus,
202 .map_irq = rd88f5182_pci_map_irq, 201 .map_irq = rd88f5182_pci_map_irq,
203}; 202};
204 203
@@ -250,22 +249,20 @@ static void __init rd88f5182_init(void)
250 /* 249 /*
251 * Setup basic Orion functions. Need to be called early. 250 * Setup basic Orion functions. Need to be called early.
252 */ 251 */
253 orion_init(); 252 orion5x_init();
254 253
255 /* 254 /*
256 * Setup the CPU address decode windows for our devices 255 * Setup the CPU address decode windows for our devices
257 */ 256 */
258 orion_setup_cpu_win(ORION_DEV_BOOT, RD88F5182_NOR_BOOT_BASE, 257 orion5x_setup_dev_boot_win(RD88F5182_NOR_BOOT_BASE,
259 RD88F5182_NOR_BOOT_SIZE, -1); 258 RD88F5182_NOR_BOOT_SIZE);
260 orion_setup_cpu_win(ORION_DEV1, RD88F5182_NOR_BASE, 259 orion5x_setup_dev1_win(RD88F5182_NOR_BASE, RD88F5182_NOR_SIZE);
261 RD88F5182_NOR_SIZE, -1);
262 260
263 /* 261 /*
264 * Open a special address decode windows for the PCIE WA. 262 * Open a special address decode windows for the PCIE WA.
265 */ 263 */
266 orion_write(ORION_REGS_VIRT_BASE | 0x20074, ORION_PCIE_WA_PHYS_BASE); 264 orion5x_setup_pcie_wa_win(ORION5X_PCIE_WA_PHYS_BASE,
267 orion_write(ORION_REGS_VIRT_BASE | 0x20070, (0x7941 | 265 ORION5X_PCIE_WA_SIZE);
268 (((ORION_PCIE_WA_SIZE >> 16) - 1)) << 16));
269 266
270 /* 267 /*
271 * Setup Multiplexing Pins -- 268 * Setup Multiplexing Pins --
@@ -291,25 +288,25 @@ static void __init rd88f5182_init(void)
291 * MPP[25] USB 0 over current enable 288 * MPP[25] USB 0 over current enable
292 */ 289 */
293 290
294 orion_write(MPP_0_7_CTRL, 0x00000003); 291 orion5x_write(MPP_0_7_CTRL, 0x00000003);
295 orion_write(MPP_8_15_CTRL, 0x55550000); 292 orion5x_write(MPP_8_15_CTRL, 0x55550000);
296 orion_write(MPP_16_19_CTRL, 0x5555); 293 orion5x_write(MPP_16_19_CTRL, 0x5555);
297 294
298 orion_gpio_set_valid_pins(0x000000fb); 295 orion5x_gpio_set_valid_pins(0x000000fb);
299 296
300 platform_add_devices(rd88f5182_devices, ARRAY_SIZE(rd88f5182_devices)); 297 platform_add_devices(rd88f5182_devices, ARRAY_SIZE(rd88f5182_devices));
301 i2c_register_board_info(0, &rd88f5182_i2c_rtc, 1); 298 i2c_register_board_info(0, &rd88f5182_i2c_rtc, 1);
302 orion_eth_init(&rd88f5182_eth_data); 299 orion5x_eth_init(&rd88f5182_eth_data);
303 orion_sata_init(&rd88f5182_sata_data); 300 orion5x_sata_init(&rd88f5182_sata_data);
304} 301}
305 302
306MACHINE_START(RD88F5182, "Marvell Orion-NAS Reference Design") 303MACHINE_START(RD88F5182, "Marvell Orion-NAS Reference Design")
307 /* Maintainer: Ronen Shitrit <rshitrit@marvell.com> */ 304 /* Maintainer: Ronen Shitrit <rshitrit@marvell.com> */
308 .phys_io = ORION_REGS_PHYS_BASE, 305 .phys_io = ORION5X_REGS_PHYS_BASE,
309 .io_pg_offst = ((ORION_REGS_VIRT_BASE) >> 18) & 0xFFFC, 306 .io_pg_offst = ((ORION5X_REGS_VIRT_BASE) >> 18) & 0xFFFC,
310 .boot_params = 0x00000100, 307 .boot_params = 0x00000100,
311 .init_machine = rd88f5182_init, 308 .init_machine = rd88f5182_init,
312 .map_io = orion_map_io, 309 .map_io = orion5x_map_io,
313 .init_irq = orion_init_irq, 310 .init_irq = orion5x_init_irq,
314 .timer = &orion_timer, 311 .timer = &orion5x_timer,
315MACHINE_END 312MACHINE_END
diff --git a/arch/arm/mach-orion/ts209-setup.c b/arch/arm/mach-orion5x/ts209-setup.c
index 45764dad16d0..fd43863a86f6 100644
--- a/arch/arm/mach-orion/ts209-setup.c
+++ b/arch/arm/mach-orion5x/ts209-setup.c
@@ -26,8 +26,7 @@
26#include <asm/gpio.h> 26#include <asm/gpio.h>
27#include <asm/mach/arch.h> 27#include <asm/mach/arch.h>
28#include <asm/mach/pci.h> 28#include <asm/mach/pci.h>
29#include <asm/arch/orion.h> 29#include <asm/arch/orion5x.h>
30#include <asm/arch/platform.h>
31#include "common.h" 30#include "common.h"
32 31
33#define QNAP_TS209_NOR_BOOT_BASE 0xf4000000 32#define QNAP_TS209_NOR_BOOT_BASE 0xf4000000
@@ -145,8 +144,8 @@ static int __init qnap_ts209_pci_map_irq(struct pci_dev *dev, u8 slot, u8 pin)
145 /* 144 /*
146 * PCIE IRQ is connected internally (not GPIO) 145 * PCIE IRQ is connected internally (not GPIO)
147 */ 146 */
148 if (dev->bus->number == orion_pcie_local_bus_nr()) 147 if (dev->bus->number == orion5x_pcie_local_bus_nr())
149 return IRQ_ORION_PCIE0_INT; 148 return IRQ_ORION5X_PCIE0_INT;
150 149
151 /* 150 /*
152 * PCI IRQs are connected via GPIOs 151 * PCI IRQs are connected via GPIOs
@@ -165,8 +164,8 @@ static struct hw_pci qnap_ts209_pci __initdata = {
165 .nr_controllers = 2, 164 .nr_controllers = 2,
166 .preinit = qnap_ts209_pci_preinit, 165 .preinit = qnap_ts209_pci_preinit,
167 .swizzle = pci_std_swizzle, 166 .swizzle = pci_std_swizzle,
168 .setup = orion_pci_sys_setup, 167 .setup = orion5x_pci_sys_setup,
169 .scan = orion_pci_sys_scan_bus, 168 .scan = orion5x_pci_sys_scan_bus,
170 .map_irq = qnap_ts209_pci_map_irq, 169 .map_irq = qnap_ts209_pci_map_irq,
171}; 170};
172 171
@@ -189,6 +188,87 @@ static struct mv643xx_eth_platform_data qnap_ts209_eth_data = {
189 .force_phy_addr = 1, 188 .force_phy_addr = 1,
190}; 189};
191 190
191static int __init parse_hex_nibble(char n)
192{
193 if (n >= '0' && n <= '9')
194 return n - '0';
195
196 if (n >= 'A' && n <= 'F')
197 return n - 'A' + 10;
198
199 if (n >= 'a' && n <= 'f')
200 return n - 'a' + 10;
201
202 return -1;
203}
204
205static int __init parse_hex_byte(const char *b)
206{
207 int hi;
208 int lo;
209
210 hi = parse_hex_nibble(b[0]);
211 lo = parse_hex_nibble(b[1]);
212
213 if (hi < 0 || lo < 0)
214 return -1;
215
216 return (hi << 4) | lo;
217}
218
219static int __init check_mac_addr(const char *addr_str)
220{
221 u_int8_t addr[6];
222 int i;
223
224 for (i = 0; i < 6; i++) {
225 int byte;
226
227 /*
228 * Enforce "xx:xx:xx:xx:xx:xx\n" format.
229 */
230 if (addr_str[(i * 3) + 2] != ((i < 5) ? ':' : '\n'))
231 return -1;
232
233 byte = parse_hex_byte(addr_str + (i * 3));
234 if (byte < 0)
235 return -1;
236 addr[i] = byte;
237 }
238
239 printk(KERN_INFO "ts209: found ethernet mac address ");
240 for (i = 0; i < 6; i++)
241 printk("%.2x%s", addr[i], (i < 5) ? ":" : ".\n");
242
243 memcpy(qnap_ts209_eth_data.mac_addr, addr, 6);
244
245 return 0;
246}
247
248/*
249 * The 'NAS Config' flash partition has an ext2 filesystem which
250 * contains a file that has the ethernet MAC address in plain text
251 * (format "xx:xx:xx:xx:xx:xx\n".)
252 */
253static void __init ts209_find_mac_addr(void)
254{
255 unsigned long addr;
256
257 for (addr = 0x00700000; addr < 0x00760000; addr += 1024) {
258 char *nor_page;
259 int ret = 0;
260
261 nor_page = ioremap(QNAP_TS209_NOR_BOOT_BASE + addr, 1024);
262 if (nor_page != NULL) {
263 ret = check_mac_addr(nor_page);
264 iounmap(nor_page);
265 }
266
267 if (ret == 0)
268 break;
269 }
270}
271
192/***************************************************************************** 272/*****************************************************************************
193 * RTC S35390A on I2C bus 273 * RTC S35390A on I2C bus
194 ****************************************************************************/ 274 ****************************************************************************/
@@ -262,21 +342,21 @@ static struct platform_device *qnap_ts209_devices[] __initdata = {
262static void qnap_ts209_power_off(void) 342static void qnap_ts209_power_off(void)
263{ 343{
264 /* 19200 baud divisor */ 344 /* 19200 baud divisor */
265 const unsigned divisor = ((ORION_TCLK + (8 * 19200)) / (16 * 19200)); 345 const unsigned divisor = ((ORION5X_TCLK + (8 * 19200)) / (16 * 19200));
266 346
267 pr_info("%s: triggering power-off...\n", __func__); 347 pr_info("%s: triggering power-off...\n", __func__);
268 348
269 /* hijack uart1 and reset into sane state (19200,8n1) */ 349 /* hijack uart1 and reset into sane state (19200,8n1) */
270 orion_write(UART1_REG(LCR), 0x83); 350 orion5x_write(UART1_REG(LCR), 0x83);
271 orion_write(UART1_REG(DLL), divisor & 0xff); 351 orion5x_write(UART1_REG(DLL), divisor & 0xff);
272 orion_write(UART1_REG(DLM), (divisor >> 8) & 0xff); 352 orion5x_write(UART1_REG(DLM), (divisor >> 8) & 0xff);
273 orion_write(UART1_REG(LCR), 0x03); 353 orion5x_write(UART1_REG(LCR), 0x03);
274 orion_write(UART1_REG(IER), 0x00); 354 orion5x_write(UART1_REG(IER), 0x00);
275 orion_write(UART1_REG(FCR), 0x00); 355 orion5x_write(UART1_REG(FCR), 0x00);
276 orion_write(UART1_REG(MCR), 0x00); 356 orion5x_write(UART1_REG(MCR), 0x00);
277 357
278 /* send the power-off command 'A' to PIC */ 358 /* send the power-off command 'A' to PIC */
279 orion_write(UART1_REG(TX), 'A'); 359 orion5x_write(UART1_REG(TX), 'A');
280} 360}
281 361
282static void __init qnap_ts209_init(void) 362static void __init qnap_ts209_init(void)
@@ -284,20 +364,19 @@ static void __init qnap_ts209_init(void)
284 /* 364 /*
285 * Setup basic Orion functions. Need to be called early. 365 * Setup basic Orion functions. Need to be called early.
286 */ 366 */
287 orion_init(); 367 orion5x_init();
288 368
289 /* 369 /*
290 * Setup flash mapping 370 * Setup flash mapping
291 */ 371 */
292 orion_setup_cpu_win(ORION_DEV_BOOT, QNAP_TS209_NOR_BOOT_BASE, 372 orion5x_setup_dev_boot_win(QNAP_TS209_NOR_BOOT_BASE,
293 QNAP_TS209_NOR_BOOT_SIZE, -1); 373 QNAP_TS209_NOR_BOOT_SIZE);
294 374
295 /* 375 /*
296 * Open a special address decode windows for the PCIE WA. 376 * Open a special address decode windows for the PCIE WA.
297 */ 377 */
298 orion_write(ORION_REGS_VIRT_BASE | 0x20074, ORION_PCIE_WA_PHYS_BASE); 378 orion5x_setup_pcie_wa_win(ORION5X_PCIE_WA_PHYS_BASE,
299 orion_write(ORION_REGS_VIRT_BASE | 0x20070, (0x7941 | 379 ORION5X_PCIE_WA_SIZE);
300 (((ORION_PCIE_WA_SIZE >> 16) - 1)) << 16));
301 380
302 /* 381 /*
303 * Setup Multiplexing Pins -- 382 * Setup Multiplexing Pins --
@@ -322,10 +401,10 @@ static void __init qnap_ts209_init(void)
322 * MPP[22] USB 0 over current 401 * MPP[22] USB 0 over current
323 * MPP[23-25] Reserved 402 * MPP[23-25] Reserved
324 */ 403 */
325 orion_write(MPP_0_7_CTRL, 0x3); 404 orion5x_write(MPP_0_7_CTRL, 0x3);
326 orion_write(MPP_8_15_CTRL, 0x55550000); 405 orion5x_write(MPP_8_15_CTRL, 0x55550000);
327 orion_write(MPP_16_19_CTRL, 0x5500); 406 orion5x_write(MPP_16_19_CTRL, 0x5500);
328 orion_gpio_set_valid_pins(0x3cc0fff); 407 orion5x_gpio_set_valid_pins(0x3cc0fff);
329 408
330 /* register ts209 specific power-off method */ 409 /* register ts209 specific power-off method */
331 pm_power_off = qnap_ts209_power_off; 410 pm_power_off = qnap_ts209_power_off;
@@ -344,18 +423,20 @@ static void __init qnap_ts209_init(void)
344 pr_warning("qnap_ts209_init: failed to get RTC IRQ\n"); 423 pr_warning("qnap_ts209_init: failed to get RTC IRQ\n");
345 i2c_register_board_info(0, &qnap_ts209_i2c_rtc, 1); 424 i2c_register_board_info(0, &qnap_ts209_i2c_rtc, 1);
346 425
347 orion_eth_init(&qnap_ts209_eth_data); 426 ts209_find_mac_addr();
348 orion_sata_init(&qnap_ts209_sata_data); 427 orion5x_eth_init(&qnap_ts209_eth_data);
428
429 orion5x_sata_init(&qnap_ts209_sata_data);
349} 430}
350 431
351MACHINE_START(TS209, "QNAP TS-109/TS-209") 432MACHINE_START(TS209, "QNAP TS-109/TS-209")
352 /* Maintainer: Byron Bradley <byron.bbradley@gmail.com> */ 433 /* Maintainer: Byron Bradley <byron.bbradley@gmail.com> */
353 .phys_io = ORION_REGS_PHYS_BASE, 434 .phys_io = ORION5X_REGS_PHYS_BASE,
354 .io_pg_offst = ((ORION_REGS_VIRT_BASE) >> 18) & 0xFFFC, 435 .io_pg_offst = ((ORION5X_REGS_VIRT_BASE) >> 18) & 0xFFFC,
355 .boot_params = 0x00000100, 436 .boot_params = 0x00000100,
356 .init_machine = qnap_ts209_init, 437 .init_machine = qnap_ts209_init,
357 .map_io = orion_map_io, 438 .map_io = orion5x_map_io,
358 .init_irq = orion_init_irq, 439 .init_irq = orion5x_init_irq,
359 .timer = &orion_timer, 440 .timer = &orion5x_timer,
360 .fixup = tag_fixup_mem32, 441 .fixup = tag_fixup_mem32,
361MACHINE_END 442MACHINE_END
diff --git a/arch/arm/mach-pxa/Kconfig b/arch/arm/mach-pxa/Kconfig
index 0908bea0f609..5da7a6820492 100644
--- a/arch/arm/mach-pxa/Kconfig
+++ b/arch/arm/mach-pxa/Kconfig
@@ -23,6 +23,12 @@ endif
23choice 23choice
24 prompt "Select target board" 24 prompt "Select target board"
25 25
26config ARCH_GUMSTIX
27 bool "Gumstix XScale boards"
28 help
29 Say Y here if you intend to run this kernel on a
30 Gumstix Full Function Minature Computer.
31
26config ARCH_LUBBOCK 32config ARCH_LUBBOCK
27 bool "Intel DBPXA250 Development Platform" 33 bool "Intel DBPXA250 Development Platform"
28 select PXA25x 34 select PXA25x
@@ -160,6 +166,20 @@ endchoice
160 166
161endif 167endif
162 168
169if ARCH_GUMSTIX
170
171choice
172 prompt "Select target Gumstix board"
173
174config MACH_GUMSTIX_F
175 bool "Basix, Connex, ws-200ax, ws-400ax systems"
176 select PXA25x
177
178endchoice
179
180endif
181
182
163if MACH_TRIZEPS4 183if MACH_TRIZEPS4
164 184
165choice 185choice
diff --git a/arch/arm/mach-pxa/Makefile b/arch/arm/mach-pxa/Makefile
index 6e0c4f5b5ae6..7cdcb459ea9d 100644
--- a/arch/arm/mach-pxa/Makefile
+++ b/arch/arm/mach-pxa/Makefile
@@ -5,13 +5,14 @@
5# Common support (must be linked before board specific support) 5# Common support (must be linked before board specific support)
6obj-y += clock.o devices.o generic.o irq.o dma.o \ 6obj-y += clock.o devices.o generic.o irq.o dma.o \
7 time.o gpio.o 7 time.o gpio.o
8obj-$(CONFIG_PXA25x) += pxa25x.o 8obj-$(CONFIG_PXA25x) += pxa25x.o mfp-pxa2xx.o
9obj-$(CONFIG_PXA27x) += pxa27x.o 9obj-$(CONFIG_PXA27x) += pxa27x.o mfp-pxa2xx.o
10obj-$(CONFIG_PXA3xx) += pxa3xx.o mfp.o smemc.o 10obj-$(CONFIG_PXA3xx) += pxa3xx.o mfp-pxa3xx.o smemc.o
11obj-$(CONFIG_CPU_PXA300) += pxa300.o 11obj-$(CONFIG_CPU_PXA300) += pxa300.o
12obj-$(CONFIG_CPU_PXA320) += pxa320.o 12obj-$(CONFIG_CPU_PXA320) += pxa320.o
13 13
14# Specific board support 14# Specific board support
15obj-$(CONFIG_ARCH_GUMSTIX) += gumstix.o
15obj-$(CONFIG_ARCH_LUBBOCK) += lubbock.o 16obj-$(CONFIG_ARCH_LUBBOCK) += lubbock.o
16obj-$(CONFIG_MACH_LOGICPD_PXA270) += lpd270.o 17obj-$(CONFIG_MACH_LOGICPD_PXA270) += lpd270.o
17obj-$(CONFIG_MACH_MAINSTONE) += mainstone.o 18obj-$(CONFIG_MACH_MAINSTONE) += mainstone.o
diff --git a/arch/arm/mach-pxa/clock.c b/arch/arm/mach-pxa/clock.c
index df5ae2710ab1..e97dc59813c8 100644
--- a/arch/arm/mach-pxa/clock.c
+++ b/arch/arm/mach-pxa/clock.c
@@ -13,6 +13,7 @@
13#include <linux/delay.h> 13#include <linux/delay.h>
14 14
15#include <asm/arch/pxa-regs.h> 15#include <asm/arch/pxa-regs.h>
16#include <asm/arch/pxa2xx-gpio.h>
16#include <asm/hardware.h> 17#include <asm/hardware.h>
17 18
18#include "devices.h" 19#include "devices.h"
diff --git a/arch/arm/mach-pxa/cm-x270-pci.c b/arch/arm/mach-pxa/cm-x270-pci.c
index fcda7d5cb693..ac7f05f9f3eb 100644
--- a/arch/arm/mach-pxa/cm-x270-pci.c
+++ b/arch/arm/mach-pxa/cm-x270-pci.c
@@ -23,6 +23,7 @@
23#include <asm/mach/pci.h> 23#include <asm/mach/pci.h>
24#include <asm/arch/cm-x270.h> 24#include <asm/arch/cm-x270.h>
25#include <asm/arch/pxa-regs.h> 25#include <asm/arch/pxa-regs.h>
26#include <asm/arch/pxa2xx-gpio.h>
26#include <asm/mach-types.h> 27#include <asm/mach-types.h>
27 28
28#include <asm/hardware/it8152.h> 29#include <asm/hardware/it8152.h>
diff --git a/arch/arm/mach-pxa/cm-x270.c b/arch/arm/mach-pxa/cm-x270.c
index ecdbc96a4de1..6d4416a4f378 100644
--- a/arch/arm/mach-pxa/cm-x270.c
+++ b/arch/arm/mach-pxa/cm-x270.c
@@ -30,6 +30,7 @@
30 30
31#include <asm/arch/pxa-regs.h> 31#include <asm/arch/pxa-regs.h>
32#include <asm/arch/pxa2xx-regs.h> 32#include <asm/arch/pxa2xx-regs.h>
33#include <asm/arch/pxa2xx-gpio.h>
33#include <asm/arch/pxafb.h> 34#include <asm/arch/pxafb.h>
34#include <asm/arch/ohci.h> 35#include <asm/arch/ohci.h>
35#include <asm/arch/mmc.h> 36#include <asm/arch/mmc.h>
diff --git a/arch/arm/mach-pxa/colibri.c b/arch/arm/mach-pxa/colibri.c
index 6db54e31c397..43bf5a183e90 100644
--- a/arch/arm/mach-pxa/colibri.c
+++ b/arch/arm/mach-pxa/colibri.c
@@ -29,6 +29,7 @@
29#include <asm/mach/irq.h> 29#include <asm/mach/irq.h>
30#include <asm/mach/flash.h> 30#include <asm/mach/flash.h>
31#include <asm/arch/pxa-regs.h> 31#include <asm/arch/pxa-regs.h>
32#include <asm/arch/pxa2xx-gpio.h>
32#include <asm/arch/colibri.h> 33#include <asm/arch/colibri.h>
33 34
34#include "generic.h" 35#include "generic.h"
diff --git a/arch/arm/mach-pxa/corgi.c b/arch/arm/mach-pxa/corgi.c
index 9292576b83b3..259ca821e464 100644
--- a/arch/arm/mach-pxa/corgi.c
+++ b/arch/arm/mach-pxa/corgi.c
@@ -36,6 +36,7 @@
36#include <asm/mach/irq.h> 36#include <asm/mach/irq.h>
37 37
38#include <asm/arch/pxa-regs.h> 38#include <asm/arch/pxa-regs.h>
39#include <asm/arch/pxa2xx-gpio.h>
39#include <asm/arch/irda.h> 40#include <asm/arch/irda.h>
40#include <asm/arch/mmc.h> 41#include <asm/arch/mmc.h>
41#include <asm/arch/udc.h> 42#include <asm/arch/udc.h>
diff --git a/arch/arm/mach-pxa/corgi_pm.c b/arch/arm/mach-pxa/corgi_pm.c
index 392c38717362..0a85f706e887 100644
--- a/arch/arm/mach-pxa/corgi_pm.c
+++ b/arch/arm/mach-pxa/corgi_pm.c
@@ -26,6 +26,7 @@
26#include <asm/arch/sharpsl.h> 26#include <asm/arch/sharpsl.h>
27#include <asm/arch/corgi.h> 27#include <asm/arch/corgi.h>
28#include <asm/arch/pxa-regs.h> 28#include <asm/arch/pxa-regs.h>
29#include <asm/arch/pxa2xx-gpio.h>
29#include "sharpsl.h" 30#include "sharpsl.h"
30 31
31#define SHARPSL_CHARGE_ON_VOLT 0x99 /* 2.9V */ 32#define SHARPSL_CHARGE_ON_VOLT 0x99 /* 2.9V */
diff --git a/arch/arm/mach-pxa/corgi_ssp.c b/arch/arm/mach-pxa/corgi_ssp.c
index 31706224a04c..eccc45d21f75 100644
--- a/arch/arm/mach-pxa/corgi_ssp.c
+++ b/arch/arm/mach-pxa/corgi_ssp.c
@@ -21,6 +21,7 @@
21 21
22#include <asm/arch/ssp.h> 22#include <asm/arch/ssp.h>
23#include <asm/arch/pxa-regs.h> 23#include <asm/arch/pxa-regs.h>
24#include <asm/arch/pxa2xx-gpio.h>
24#include <asm/arch/regs-ssp.h> 25#include <asm/arch/regs-ssp.h>
25#include "sharpsl.h" 26#include "sharpsl.h"
26 27
diff --git a/arch/arm/mach-pxa/devices.c b/arch/arm/mach-pxa/devices.c
index bfccb80ac8ef..d6c05b6eab35 100644
--- a/arch/arm/mach-pxa/devices.c
+++ b/arch/arm/mach-pxa/devices.c
@@ -11,6 +11,8 @@
11#include <asm/arch/irda.h> 11#include <asm/arch/irda.h>
12#include <asm/arch/i2c.h> 12#include <asm/arch/i2c.h>
13#include <asm/arch/ohci.h> 13#include <asm/arch/ohci.h>
14#include <asm/arch/pxa27x_keypad.h>
15#include <asm/arch/camera.h>
14 16
15#include "devices.h" 17#include "devices.h"
16 18
@@ -396,6 +398,31 @@ struct platform_device pxa25x_device_assp = {
396 398
397#if defined(CONFIG_PXA27x) || defined(CONFIG_PXA3xx) 399#if defined(CONFIG_PXA27x) || defined(CONFIG_PXA3xx)
398 400
401static struct resource pxa27x_resource_keypad[] = {
402 [0] = {
403 .start = 0x41500000,
404 .end = 0x4150004c,
405 .flags = IORESOURCE_MEM,
406 },
407 [1] = {
408 .start = IRQ_KEYPAD,
409 .end = IRQ_KEYPAD,
410 .flags = IORESOURCE_IRQ,
411 },
412};
413
414struct platform_device pxa27x_device_keypad = {
415 .name = "pxa27x-keypad",
416 .id = -1,
417 .resource = pxa27x_resource_keypad,
418 .num_resources = ARRAY_SIZE(pxa27x_resource_keypad),
419};
420
421void __init pxa_set_keypad_info(struct pxa27x_keypad_platform_data *info)
422{
423 pxa_register_device(&pxa27x_device_keypad, info);
424}
425
399static u64 pxa27x_ohci_dma_mask = DMA_BIT_MASK(32); 426static u64 pxa27x_ohci_dma_mask = DMA_BIT_MASK(32);
400 427
401static struct resource pxa27x_resource_ohci[] = { 428static struct resource pxa27x_resource_ohci[] = {
@@ -540,6 +567,37 @@ struct platform_device pxa27x_device_ssp3 = {
540 .resource = pxa27x_resource_ssp3, 567 .resource = pxa27x_resource_ssp3,
541 .num_resources = ARRAY_SIZE(pxa27x_resource_ssp3), 568 .num_resources = ARRAY_SIZE(pxa27x_resource_ssp3),
542}; 569};
570
571static struct resource pxa27x_resource_camera[] = {
572 [0] = {
573 .start = 0x50000000,
574 .end = 0x50000fff,
575 .flags = IORESOURCE_MEM,
576 },
577 [1] = {
578 .start = IRQ_CAMERA,
579 .end = IRQ_CAMERA,
580 .flags = IORESOURCE_IRQ,
581 },
582};
583
584static u64 pxa27x_dma_mask_camera = DMA_BIT_MASK(32);
585
586static struct platform_device pxa27x_device_camera = {
587 .name = "pxa27x-camera",
588 .id = 0, /* This is used to put cameras on this interface */
589 .dev = {
590 .dma_mask = &pxa27x_dma_mask_camera,
591 .coherent_dma_mask = 0xffffffff,
592 },
593 .num_resources = ARRAY_SIZE(pxa27x_resource_camera),
594 .resource = pxa27x_resource_camera,
595};
596
597void __init pxa_set_camera_info(struct pxacamera_platform_data *info)
598{
599 pxa_register_device(&pxa27x_device_camera, info);
600}
543#endif /* CONFIG_PXA27x || CONFIG_PXA3xx */ 601#endif /* CONFIG_PXA27x || CONFIG_PXA3xx */
544 602
545#ifdef CONFIG_PXA3xx 603#ifdef CONFIG_PXA3xx
diff --git a/arch/arm/mach-pxa/devices.h b/arch/arm/mach-pxa/devices.h
index 96c7c8909068..fcab017f27ee 100644
--- a/arch/arm/mach-pxa/devices.h
+++ b/arch/arm/mach-pxa/devices.h
@@ -14,6 +14,7 @@ extern struct platform_device pxa_device_rtc;
14 14
15extern struct platform_device pxa27x_device_i2c_power; 15extern struct platform_device pxa27x_device_i2c_power;
16extern struct platform_device pxa27x_device_ohci; 16extern struct platform_device pxa27x_device_ohci;
17extern struct platform_device pxa27x_device_keypad;
17 18
18extern struct platform_device pxa25x_device_ssp; 19extern struct platform_device pxa25x_device_ssp;
19extern struct platform_device pxa25x_device_nssp; 20extern struct platform_device pxa25x_device_nssp;
diff --git a/arch/arm/mach-pxa/em-x270.c b/arch/arm/mach-pxa/em-x270.c
index 3bb31314429a..edc4f07a230d 100644
--- a/arch/arm/mach-pxa/em-x270.c
+++ b/arch/arm/mach-pxa/em-x270.c
@@ -23,6 +23,7 @@
23#include <asm/mach/arch.h> 23#include <asm/mach/arch.h>
24 24
25#include <asm/arch/pxa-regs.h> 25#include <asm/arch/pxa-regs.h>
26#include <asm/arch/pxa2xx-gpio.h>
26#include <asm/arch/pxafb.h> 27#include <asm/arch/pxafb.h>
27#include <asm/arch/ohci.h> 28#include <asm/arch/ohci.h>
28#include <asm/arch/mmc.h> 29#include <asm/arch/mmc.h>
diff --git a/arch/arm/mach-pxa/generic.c b/arch/arm/mach-pxa/generic.c
index 80721c610d41..331f29b2d0cd 100644
--- a/arch/arm/mach-pxa/generic.c
+++ b/arch/arm/mach-pxa/generic.c
@@ -19,14 +19,8 @@
19#include <linux/module.h> 19#include <linux/module.h>
20#include <linux/kernel.h> 20#include <linux/kernel.h>
21#include <linux/init.h> 21#include <linux/init.h>
22#include <linux/delay.h>
23#include <linux/ioport.h>
24#include <linux/pm.h>
25#include <linux/string.h>
26#include <linux/sysdev.h>
27 22
28#include <asm/hardware.h> 23#include <asm/hardware.h>
29#include <asm/irq.h>
30#include <asm/system.h> 24#include <asm/system.h>
31#include <asm/pgtable.h> 25#include <asm/pgtable.h>
32#include <asm/mach/map.h> 26#include <asm/mach/map.h>
@@ -134,59 +128,3 @@ void __init pxa_map_io(void)
134 iotable_init(standard_io_desc, ARRAY_SIZE(standard_io_desc)); 128 iotable_init(standard_io_desc, ARRAY_SIZE(standard_io_desc));
135 get_clk_frequency_khz(1); 129 get_clk_frequency_khz(1);
136} 130}
137
138#ifdef CONFIG_PM
139
140static unsigned long saved_gplr[4];
141static unsigned long saved_gpdr[4];
142static unsigned long saved_grer[4];
143static unsigned long saved_gfer[4];
144
145static int pxa_gpio_suspend(struct sys_device *dev, pm_message_t state)
146{
147 int i, gpio;
148
149 for (gpio = 0, i = 0; gpio < pxa_last_gpio; gpio += 32, i++) {
150 saved_gplr[i] = GPLR(gpio);
151 saved_gpdr[i] = GPDR(gpio);
152 saved_grer[i] = GRER(gpio);
153 saved_gfer[i] = GFER(gpio);
154
155 /* Clear GPIO transition detect bits */
156 GEDR(gpio) = GEDR(gpio);
157 }
158 return 0;
159}
160
161static int pxa_gpio_resume(struct sys_device *dev)
162{
163 int i, gpio;
164
165 for (gpio = 0, i = 0; gpio < pxa_last_gpio; gpio += 32, i++) {
166 /* restore level with set/clear */
167 GPSR(gpio) = saved_gplr[i];
168 GPCR(gpio) = ~saved_gplr[i];
169
170 GRER(gpio) = saved_grer[i];
171 GFER(gpio) = saved_gfer[i];
172 GPDR(gpio) = saved_gpdr[i];
173 }
174 return 0;
175}
176#else
177#define pxa_gpio_suspend NULL
178#define pxa_gpio_resume NULL
179#endif
180
181struct sysdev_class pxa_gpio_sysclass = {
182 .name = "gpio",
183 .suspend = pxa_gpio_suspend,
184 .resume = pxa_gpio_resume,
185};
186
187static int __init pxa_gpio_init(void)
188{
189 return sysdev_class_register(&pxa_gpio_sysclass);
190}
191
192core_initcall(pxa_gpio_init);
diff --git a/arch/arm/mach-pxa/generic.h b/arch/arm/mach-pxa/generic.h
index b3d10b0e52a0..5bb7ae757831 100644
--- a/arch/arm/mach-pxa/generic.h
+++ b/arch/arm/mach-pxa/generic.h
@@ -9,14 +9,13 @@
9 * published by the Free Software Foundation. 9 * published by the Free Software Foundation.
10 */ 10 */
11 11
12typedef int (*set_wake_t)(unsigned int, unsigned int);
13
12struct sys_timer; 14struct sys_timer;
13 15
14extern struct sys_timer pxa_timer; 16extern struct sys_timer pxa_timer;
15extern void __init pxa_init_irq_low(void); 17extern void __init pxa_init_irq(int irq_nr, set_wake_t fn);
16extern void __init pxa_init_irq_high(void); 18extern void __init pxa_init_gpio(int gpio_nr, set_wake_t fn);
17extern void __init pxa_init_irq_gpio(int gpio_nr);
18extern void __init pxa_init_irq_set_wake(int (*set_wake)(unsigned int, unsigned int));
19extern void __init pxa_init_gpio(int gpio_nr);
20extern void __init pxa25x_init_irq(void); 19extern void __init pxa25x_init_irq(void);
21extern void __init pxa27x_init_irq(void); 20extern void __init pxa27x_init_irq(void);
22extern void __init pxa3xx_init_irq(void); 21extern void __init pxa3xx_init_irq(void);
@@ -30,6 +29,8 @@ extern int pxa_last_gpio;
30 mi->bank[__nr].size = (__size), \ 29 mi->bank[__nr].size = (__size), \
31 mi->bank[__nr].node = (((unsigned)(__start) - PHYS_OFFSET) >> 27) 30 mi->bank[__nr].node = (((unsigned)(__start) - PHYS_OFFSET) >> 27)
32 31
32#define ARRAY_AND_SIZE(x) (x), ARRAY_SIZE(x)
33
33#ifdef CONFIG_PXA25x 34#ifdef CONFIG_PXA25x
34extern unsigned pxa25x_get_clk_frequency_khz(int); 35extern unsigned pxa25x_get_clk_frequency_khz(int);
35extern unsigned pxa25x_get_memclk_frequency_10khz(void); 36extern unsigned pxa25x_get_memclk_frequency_10khz(void);
@@ -56,3 +57,4 @@ extern unsigned pxa3xx_get_memclk_frequency_10khz(void);
56 57
57extern struct sysdev_class pxa_irq_sysclass; 58extern struct sysdev_class pxa_irq_sysclass;
58extern struct sysdev_class pxa_gpio_sysclass; 59extern struct sysdev_class pxa_gpio_sysclass;
60extern struct sysdev_class pxa3xx_mfp_sysclass;
diff --git a/arch/arm/mach-pxa/gpio.c b/arch/arm/mach-pxa/gpio.c
index 8638dd7dd076..7d3e16970be0 100644
--- a/arch/arm/mach-pxa/gpio.c
+++ b/arch/arm/mach-pxa/gpio.c
@@ -14,11 +14,14 @@
14 14
15#include <linux/init.h> 15#include <linux/init.h>
16#include <linux/module.h> 16#include <linux/module.h>
17#include <linux/irq.h>
18#include <linux/sysdev.h>
17 19
18#include <asm/gpio.h> 20#include <asm/gpio.h>
19#include <asm/hardware.h> 21#include <asm/hardware.h>
20#include <asm/io.h> 22#include <asm/io.h>
21#include <asm/arch/pxa-regs.h> 23#include <asm/arch/pxa-regs.h>
24#include <asm/arch/pxa2xx-gpio.h>
22 25
23#include "generic.h" 26#include "generic.h"
24 27
@@ -129,69 +132,283 @@ static void pxa_gpio_set(struct gpio_chip *chip, unsigned offset, int value)
129 __raw_writel(mask, pxa->regbase + GPCR_OFFSET); 132 __raw_writel(mask, pxa->regbase + GPCR_OFFSET);
130} 133}
131 134
135#define GPIO_CHIP(_n) \
136 [_n] = { \
137 .regbase = GPIO##_n##_BASE, \
138 .chip = { \
139 .label = "gpio-" #_n, \
140 .direction_input = pxa_gpio_direction_input, \
141 .direction_output = pxa_gpio_direction_output, \
142 .get = pxa_gpio_get, \
143 .set = pxa_gpio_set, \
144 .base = (_n) * 32, \
145 .ngpio = 32, \
146 }, \
147 }
148
132static struct pxa_gpio_chip pxa_gpio_chip[] = { 149static struct pxa_gpio_chip pxa_gpio_chip[] = {
133 [0] = { 150 GPIO_CHIP(0),
134 .regbase = GPIO0_BASE, 151 GPIO_CHIP(1),
135 .chip = { 152 GPIO_CHIP(2),
136 .label = "gpio-0",
137 .direction_input = pxa_gpio_direction_input,
138 .direction_output = pxa_gpio_direction_output,
139 .get = pxa_gpio_get,
140 .set = pxa_gpio_set,
141 .base = 0,
142 .ngpio = 32,
143 },
144 },
145 [1] = {
146 .regbase = GPIO1_BASE,
147 .chip = {
148 .label = "gpio-1",
149 .direction_input = pxa_gpio_direction_input,
150 .direction_output = pxa_gpio_direction_output,
151 .get = pxa_gpio_get,
152 .set = pxa_gpio_set,
153 .base = 32,
154 .ngpio = 32,
155 },
156 },
157 [2] = {
158 .regbase = GPIO2_BASE,
159 .chip = {
160 .label = "gpio-2",
161 .direction_input = pxa_gpio_direction_input,
162 .direction_output = pxa_gpio_direction_output,
163 .get = pxa_gpio_get,
164 .set = pxa_gpio_set,
165 .base = 64,
166 .ngpio = 32, /* 21 for PXA25x */
167 },
168 },
169#if defined(CONFIG_PXA27x) || defined(CONFIG_PXA3xx) 153#if defined(CONFIG_PXA27x) || defined(CONFIG_PXA3xx)
170 [3] = { 154 GPIO_CHIP(3),
171 .regbase = GPIO3_BASE,
172 .chip = {
173 .label = "gpio-3",
174 .direction_input = pxa_gpio_direction_input,
175 .direction_output = pxa_gpio_direction_output,
176 .get = pxa_gpio_get,
177 .set = pxa_gpio_set,
178 .base = 96,
179 .ngpio = 32,
180 },
181 },
182#endif 155#endif
183}; 156};
184 157
185void __init pxa_init_gpio(int gpio_nr) 158/*
159 * PXA GPIO edge detection for IRQs:
160 * IRQs are generated on Falling-Edge, Rising-Edge, or both.
161 * Use this instead of directly setting GRER/GFER.
162 */
163
164static unsigned long GPIO_IRQ_rising_edge[4];
165static unsigned long GPIO_IRQ_falling_edge[4];
166static unsigned long GPIO_IRQ_mask[4];
167
168/*
169 * On PXA25x and PXA27x, GAFRx and GPDRx together decide the alternate
170 * function of a GPIO, and GPDRx cannot be altered once configured. It
171 * is attributed as "occupied" here (I know this terminology isn't
172 * accurate, you are welcome to propose a better one :-)
173 */
174static int __gpio_is_occupied(unsigned gpio)
175{
176 if (cpu_is_pxa25x() || cpu_is_pxa27x())
177 return GAFR(gpio) & (0x3 << (((gpio) & 0xf) * 2));
178 else
179 return 0;
180}
181
182static int pxa_gpio_irq_type(unsigned int irq, unsigned int type)
183{
184 int gpio, idx;
185
186 gpio = IRQ_TO_GPIO(irq);
187 idx = gpio >> 5;
188
189 if (type == IRQ_TYPE_PROBE) {
190 /* Don't mess with enabled GPIOs using preconfigured edges or
191 * GPIOs set to alternate function or to output during probe
192 */
193 if ((GPIO_IRQ_rising_edge[idx] |
194 GPIO_IRQ_falling_edge[idx] |
195 GPDR(gpio)) & GPIO_bit(gpio))
196 return 0;
197
198 if (__gpio_is_occupied(gpio))
199 return 0;
200
201 type = IRQ_TYPE_EDGE_RISING | IRQ_TYPE_EDGE_FALLING;
202 }
203
204 GPDR(gpio) &= ~GPIO_bit(gpio);
205
206 if (type & IRQ_TYPE_EDGE_RISING)
207 __set_bit(gpio, GPIO_IRQ_rising_edge);
208 else
209 __clear_bit(gpio, GPIO_IRQ_rising_edge);
210
211 if (type & IRQ_TYPE_EDGE_FALLING)
212 __set_bit(gpio, GPIO_IRQ_falling_edge);
213 else
214 __clear_bit(gpio, GPIO_IRQ_falling_edge);
215
216 GRER(gpio) = GPIO_IRQ_rising_edge[idx] & GPIO_IRQ_mask[idx];
217 GFER(gpio) = GPIO_IRQ_falling_edge[idx] & GPIO_IRQ_mask[idx];
218
219 pr_debug("%s: IRQ%d (GPIO%d) - edge%s%s\n", __func__, irq, gpio,
220 ((type & IRQ_TYPE_EDGE_RISING) ? " rising" : ""),
221 ((type & IRQ_TYPE_EDGE_FALLING) ? " falling" : ""));
222 return 0;
223}
224
225/*
226 * GPIO IRQs must be acknowledged. This is for GPIO 0 and 1.
227 */
228
229static void pxa_ack_low_gpio(unsigned int irq)
230{
231 GEDR0 = (1 << (irq - IRQ_GPIO0));
232}
233
234static void pxa_mask_low_gpio(unsigned int irq)
235{
236 ICMR &= ~(1 << (irq - PXA_IRQ(0)));
237}
238
239static void pxa_unmask_low_gpio(unsigned int irq)
240{
241 ICMR |= 1 << (irq - PXA_IRQ(0));
242}
243
244static struct irq_chip pxa_low_gpio_chip = {
245 .name = "GPIO-l",
246 .ack = pxa_ack_low_gpio,
247 .mask = pxa_mask_low_gpio,
248 .unmask = pxa_unmask_low_gpio,
249 .set_type = pxa_gpio_irq_type,
250};
251
252/*
253 * Demux handler for GPIO>=2 edge detect interrupts
254 */
255
256#define GEDR_BITS (sizeof(gedr) * BITS_PER_BYTE)
257
258static void pxa_gpio_demux_handler(unsigned int irq, struct irq_desc *desc)
259{
260 int loop, bit, n;
261 unsigned long gedr[4];
262
263 do {
264 gedr[0] = GEDR0 & GPIO_IRQ_mask[0] & ~3;
265 gedr[1] = GEDR1 & GPIO_IRQ_mask[1];
266 gedr[2] = GEDR2 & GPIO_IRQ_mask[2];
267 gedr[3] = GEDR3 & GPIO_IRQ_mask[3];
268
269 GEDR0 = gedr[0]; GEDR1 = gedr[1];
270 GEDR2 = gedr[2]; GEDR3 = gedr[3];
271
272 loop = 0;
273 bit = find_first_bit(gedr, GEDR_BITS);
274 while (bit < GEDR_BITS) {
275 loop = 1;
276
277 n = PXA_GPIO_IRQ_BASE + bit;
278 desc_handle_irq(n, irq_desc + n);
279
280 bit = find_next_bit(gedr, GEDR_BITS, bit + 1);
281 }
282 } while (loop);
283}
284
285static void pxa_ack_muxed_gpio(unsigned int irq)
286{
287 int gpio = irq - IRQ_GPIO(2) + 2;
288 GEDR(gpio) = GPIO_bit(gpio);
289}
290
291static void pxa_mask_muxed_gpio(unsigned int irq)
292{
293 int gpio = irq - IRQ_GPIO(2) + 2;
294 __clear_bit(gpio, GPIO_IRQ_mask);
295 GRER(gpio) &= ~GPIO_bit(gpio);
296 GFER(gpio) &= ~GPIO_bit(gpio);
297}
298
299static void pxa_unmask_muxed_gpio(unsigned int irq)
300{
301 int gpio = irq - IRQ_GPIO(2) + 2;
302 int idx = gpio >> 5;
303 __set_bit(gpio, GPIO_IRQ_mask);
304 GRER(gpio) = GPIO_IRQ_rising_edge[idx] & GPIO_IRQ_mask[idx];
305 GFER(gpio) = GPIO_IRQ_falling_edge[idx] & GPIO_IRQ_mask[idx];
306}
307
308static struct irq_chip pxa_muxed_gpio_chip = {
309 .name = "GPIO",
310 .ack = pxa_ack_muxed_gpio,
311 .mask = pxa_mask_muxed_gpio,
312 .unmask = pxa_unmask_muxed_gpio,
313 .set_type = pxa_gpio_irq_type,
314};
315
316void __init pxa_init_gpio(int gpio_nr, set_wake_t fn)
186{ 317{
187 int i; 318 int irq, i, gpio;
319
320 pxa_last_gpio = gpio_nr - 1;
321
322 /* clear all GPIO edge detects */
323 for (i = 0; i < gpio_nr; i += 32) {
324 GFER(i) = 0;
325 GRER(i) = 0;
326 GEDR(i) = GEDR(i);
327 }
328
329 /* GPIO 0 and 1 must have their mask bit always set */
330 GPIO_IRQ_mask[0] = 3;
331
332 for (irq = IRQ_GPIO0; irq <= IRQ_GPIO1; irq++) {
333 set_irq_chip(irq, &pxa_low_gpio_chip);
334 set_irq_handler(irq, handle_edge_irq);
335 set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
336 }
337
338 for (irq = IRQ_GPIO(2); irq < IRQ_GPIO(gpio_nr); irq++) {
339 set_irq_chip(irq, &pxa_muxed_gpio_chip);
340 set_irq_handler(irq, handle_edge_irq);
341 set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
342 }
343
344 /* Install handler for GPIO>=2 edge detect interrupts */
345 set_irq_chained_handler(IRQ_GPIO_2_x, pxa_gpio_demux_handler);
346
347 pxa_low_gpio_chip.set_wake = fn;
348 pxa_muxed_gpio_chip.set_wake = fn;
188 349
189 /* add a GPIO chip for each register bank. 350 /* add a GPIO chip for each register bank.
190 * the last PXA25x register only contains 21 GPIOs 351 * the last PXA25x register only contains 21 GPIOs
191 */ 352 */
192 for (i = 0; i < gpio_nr; i += 32) { 353 for (gpio = 0, i = 0; gpio < gpio_nr; gpio += 32, i++) {
193 if (i+32 > gpio_nr) 354 if (gpio + 32 > gpio_nr)
194 pxa_gpio_chip[i/32].chip.ngpio = gpio_nr - i; 355 pxa_gpio_chip[i].chip.ngpio = gpio_nr - gpio;
195 gpiochip_add(&pxa_gpio_chip[i/32].chip); 356 gpiochip_add(&pxa_gpio_chip[i].chip);
196 } 357 }
197} 358}
359
360#ifdef CONFIG_PM
361
362static unsigned long saved_gplr[4];
363static unsigned long saved_gpdr[4];
364static unsigned long saved_grer[4];
365static unsigned long saved_gfer[4];
366
367static int pxa_gpio_suspend(struct sys_device *dev, pm_message_t state)
368{
369 int i, gpio;
370
371 for (gpio = 0, i = 0; gpio < pxa_last_gpio; gpio += 32, i++) {
372 saved_gplr[i] = GPLR(gpio);
373 saved_gpdr[i] = GPDR(gpio);
374 saved_grer[i] = GRER(gpio);
375 saved_gfer[i] = GFER(gpio);
376
377 /* Clear GPIO transition detect bits */
378 GEDR(gpio) = GEDR(gpio);
379 }
380 return 0;
381}
382
383static int pxa_gpio_resume(struct sys_device *dev)
384{
385 int i, gpio;
386
387 for (gpio = 0, i = 0; gpio < pxa_last_gpio; gpio += 32, i++) {
388 /* restore level with set/clear */
389 GPSR(gpio) = saved_gplr[i];
390 GPCR(gpio) = ~saved_gplr[i];
391
392 GRER(gpio) = saved_grer[i];
393 GFER(gpio) = saved_gfer[i];
394 GPDR(gpio) = saved_gpdr[i];
395 }
396 return 0;
397}
398#else
399#define pxa_gpio_suspend NULL
400#define pxa_gpio_resume NULL
401#endif
402
403struct sysdev_class pxa_gpio_sysclass = {
404 .name = "gpio",
405 .suspend = pxa_gpio_suspend,
406 .resume = pxa_gpio_resume,
407};
408
409static int __init pxa_gpio_init(void)
410{
411 return sysdev_class_register(&pxa_gpio_sysclass);
412}
413
414core_initcall(pxa_gpio_init);
diff --git a/arch/arm/mach-pxa/gumstix.c b/arch/arm/mach-pxa/gumstix.c
new file mode 100644
index 000000000000..f01d18544133
--- /dev/null
+++ b/arch/arm/mach-pxa/gumstix.c
@@ -0,0 +1,147 @@
1/*
2 * linux/arch/arm/mach-pxa/gumstix.c
3 *
4 * Support for the Gumstix motherboards.
5 *
6 * Original Author: Craig Hughes
7 * Created: Feb 14, 2008
8 * Copyright: Craig Hughes
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13 *
14 * Implemented based on lubbock.c by Nicolas Pitre and code from Craig
15 * Hughes
16 */
17
18#include <linux/module.h>
19#include <linux/kernel.h>
20#include <linux/init.h>
21#include <linux/platform_device.h>
22#include <linux/interrupt.h>
23#include <linux/mtd/mtd.h>
24#include <linux/mtd/partitions.h>
25
26#include <asm/setup.h>
27#include <asm/memory.h>
28#include <asm/mach-types.h>
29#include <asm/hardware.h>
30#include <asm/irq.h>
31#include <asm/sizes.h>
32
33#include <asm/mach/arch.h>
34#include <asm/mach/map.h>
35#include <asm/mach/irq.h>
36#include <asm/mach/flash.h>
37#include <asm/arch/mmc.h>
38#include <asm/arch/udc.h>
39#include <asm/arch/gumstix.h>
40
41#include <asm/arch/pxa-regs.h>
42#include <asm/arch/pxa2xx-regs.h>
43
44#include "generic.h"
45
46static struct resource flash_resource = {
47 .start = 0x00000000,
48 .end = SZ_64M - 1,
49 .flags = IORESOURCE_MEM,
50};
51
52static struct mtd_partition gumstix_partitions[] = {
53 {
54 .name = "Bootloader",
55 .size = 0x00040000,
56 .offset = 0,
57 .mask_flags = MTD_WRITEABLE /* force read-only */
58 } , {
59 .name = "rootfs",
60 .size = MTDPART_SIZ_FULL,
61 .offset = MTDPART_OFS_APPEND
62 }
63};
64
65static struct flash_platform_data gumstix_flash_data = {
66 .map_name = "cfi_probe",
67 .parts = gumstix_partitions,
68 .nr_parts = ARRAY_SIZE(gumstix_partitions),
69 .width = 2,
70};
71
72static struct platform_device gumstix_flash_device = {
73 .name = "pxa2xx-flash",
74 .id = 0,
75 .dev = {
76 .platform_data = &gumstix_flash_data,
77 },
78 .resource = &flash_resource,
79 .num_resources = 1,
80};
81
82static struct platform_device *devices[] __initdata = {
83 &gumstix_flash_device,
84};
85
86#ifdef CONFIG_MMC_PXA
87static struct pxamci_platform_data gumstix_mci_platform_data;
88
89static int gumstix_mci_init(struct device *dev, irq_handler_t detect_int,
90 void *data)
91{
92 pxa_gpio_mode(GPIO6_MMCCLK_MD);
93 pxa_gpio_mode(GPIO53_MMCCLK_MD);
94 pxa_gpio_mode(GPIO8_MMCCS0_MD);
95
96 return 0;
97}
98
99static struct pxamci_platform_data gumstix_mci_platform_data = {
100 .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34,
101 .init = gumstix_mci_init,
102};
103
104static void __init gumstix_mmc_init(void)
105{
106 pxa_set_mci_info(&gumstix_mci_platform_data);
107}
108#else
109static void __init gumstix_mmc_init(void)
110{
111 printk(KERN_INFO "Gumstix mmc disabled\n");
112}
113#endif
114
115#ifdef CONFIG_USB_GADGET_PXA2XX
116static struct pxa2xx_udc_mach_info gumstix_udc_info __initdata = {
117 .gpio_vbus = GPIO_GUMSTIX_USB_GPIOn,
118 .gpio_pullup = GPIO_GUMSTIX_USB_GPIOx,
119};
120
121static void __init gumstix_udc_init(void)
122{
123 pxa_set_udc_info(&gumstix_udc_info);
124}
125#else
126static void gumstix_udc_init(void)
127{
128 printk(KERN_INFO "Gumstix udc is disabled\n");
129}
130#endif
131
132static void __init gumstix_init(void)
133{
134 gumstix_udc_init();
135 gumstix_mmc_init();
136 (void) platform_add_devices(devices, ARRAY_SIZE(devices));
137}
138
139MACHINE_START(GUMSTIX, "Gumstix")
140 .phys_io = 0x40000000,
141 .boot_params = 0xa0000100, /* match u-boot bi_boot_params */
142 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
143 .map_io = pxa_map_io,
144 .init_irq = pxa25x_init_irq,
145 .timer = &pxa_timer,
146 .init_machine = gumstix_init,
147MACHINE_END
diff --git a/arch/arm/mach-pxa/idp.c b/arch/arm/mach-pxa/idp.c
index 0a9434432c55..2637633f9166 100644
--- a/arch/arm/mach-pxa/idp.c
+++ b/arch/arm/mach-pxa/idp.c
@@ -32,6 +32,7 @@
32#include <asm/mach/map.h> 32#include <asm/mach/map.h>
33 33
34#include <asm/arch/pxa-regs.h> 34#include <asm/arch/pxa-regs.h>
35#include <asm/arch/pxa2xx-gpio.h>
35#include <asm/arch/idp.h> 36#include <asm/arch/idp.h>
36#include <asm/arch/pxafb.h> 37#include <asm/arch/pxafb.h>
37#include <asm/arch/bitfield.h> 38#include <asm/arch/bitfield.h>
diff --git a/arch/arm/mach-pxa/irq.c b/arch/arm/mach-pxa/irq.c
index 36c6a68beca2..a9a0c3fab159 100644
--- a/arch/arm/mach-pxa/irq.c
+++ b/arch/arm/mach-pxa/irq.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * linux/arch/arm/mach-pxa/irq.c 2 * linux/arch/arm/mach-pxa/irq.c
3 * 3 *
4 * Generic PXA IRQ handling, GPIO IRQ demultiplexing, etc. 4 * Generic PXA IRQ handling
5 * 5 *
6 * Author: Nicolas Pitre 6 * Author: Nicolas Pitre
7 * Created: Jun 15, 2001 7 * Created: Jun 15, 2001
@@ -21,308 +21,58 @@
21#include <asm/irq.h> 21#include <asm/irq.h>
22#include <asm/mach/irq.h> 22#include <asm/mach/irq.h>
23#include <asm/arch/pxa-regs.h> 23#include <asm/arch/pxa-regs.h>
24#include <asm/arch/pxa2xx-gpio.h>
24 25
25#include "generic.h" 26#include "generic.h"
26 27
28#define IRQ_BIT(n) (((n) - PXA_IRQ(0)) & 0x1f)
29#define _ICMR(n) (*((((n) - PXA_IRQ(0)) & ~0x1f) ? &ICMR2 : &ICMR))
30#define _ICLR(n) (*((((n) - PXA_IRQ(0)) & ~0x1f) ? &ICLR2 : &ICLR))
27 31
28/* 32/*
29 * This is for peripheral IRQs internal to the PXA chip. 33 * This is for peripheral IRQs internal to the PXA chip.
30 */ 34 */
31 35
32static void pxa_mask_low_irq(unsigned int irq) 36static int pxa_internal_irq_nr;
37
38static void pxa_mask_irq(unsigned int irq)
33{ 39{
34 ICMR &= ~(1 << irq); 40 _ICMR(irq) &= ~(1 << IRQ_BIT(irq));
35} 41}
36 42
37static void pxa_unmask_low_irq(unsigned int irq) 43static void pxa_unmask_irq(unsigned int irq)
38{ 44{
39 ICMR |= (1 << irq); 45 _ICMR(irq) |= 1 << IRQ_BIT(irq);
40} 46}
41 47
42static struct irq_chip pxa_internal_chip_low = { 48static struct irq_chip pxa_internal_irq_chip = {
43 .name = "SC", 49 .name = "SC",
44 .ack = pxa_mask_low_irq, 50 .ack = pxa_mask_irq,
45 .mask = pxa_mask_low_irq, 51 .mask = pxa_mask_irq,
46 .unmask = pxa_unmask_low_irq, 52 .unmask = pxa_unmask_irq,
47}; 53};
48 54
49void __init pxa_init_irq_low(void) 55void __init pxa_init_irq(int irq_nr, set_wake_t fn)
50{ 56{
51 int irq; 57 int irq;
52 58
53 /* disable all IRQs */ 59 pxa_internal_irq_nr = irq_nr;
54 ICMR = 0;
55 60
56 /* all IRQs are IRQ, not FIQ */ 61 for (irq = 0; irq < irq_nr; irq += 32) {
57 ICLR = 0; 62 _ICMR(irq) = 0; /* disable all IRQs */
63 _ICLR(irq) = 0; /* all IRQs are IRQ, not FIQ */
64 }
58 65
59 /* only unmasked interrupts kick us out of idle */ 66 /* only unmasked interrupts kick us out of idle */
60 ICCR = 1; 67 ICCR = 1;
61 68
62 for (irq = PXA_IRQ(0); irq <= PXA_IRQ(31); irq++) { 69 for (irq = PXA_IRQ(0); irq < PXA_IRQ(irq_nr); irq++) {
63 set_irq_chip(irq, &pxa_internal_chip_low); 70 set_irq_chip(irq, &pxa_internal_irq_chip);
64 set_irq_handler(irq, handle_level_irq);
65 set_irq_flags(irq, IRQF_VALID);
66 }
67}
68
69#if defined(CONFIG_PXA27x) || defined(CONFIG_PXA3xx)
70
71/*
72 * This is for the second set of internal IRQs as found on the PXA27x.
73 */
74
75static void pxa_mask_high_irq(unsigned int irq)
76{
77 ICMR2 &= ~(1 << (irq - 32));
78}
79
80static void pxa_unmask_high_irq(unsigned int irq)
81{
82 ICMR2 |= (1 << (irq - 32));
83}
84
85static struct irq_chip pxa_internal_chip_high = {
86 .name = "SC-hi",
87 .ack = pxa_mask_high_irq,
88 .mask = pxa_mask_high_irq,
89 .unmask = pxa_unmask_high_irq,
90};
91
92void __init pxa_init_irq_high(void)
93{
94 int irq;
95
96 ICMR2 = 0;
97 ICLR2 = 0;
98
99 for (irq = PXA_IRQ(32); irq < PXA_IRQ(64); irq++) {
100 set_irq_chip(irq, &pxa_internal_chip_high);
101 set_irq_handler(irq, handle_level_irq); 71 set_irq_handler(irq, handle_level_irq);
102 set_irq_flags(irq, IRQF_VALID); 72 set_irq_flags(irq, IRQF_VALID);
103 } 73 }
104}
105#endif
106
107/*
108 * PXA GPIO edge detection for IRQs:
109 * IRQs are generated on Falling-Edge, Rising-Edge, or both.
110 * Use this instead of directly setting GRER/GFER.
111 */
112
113static long GPIO_IRQ_rising_edge[4];
114static long GPIO_IRQ_falling_edge[4];
115static long GPIO_IRQ_mask[4];
116
117static int pxa_gpio_irq_type(unsigned int irq, unsigned int type)
118{
119 int gpio, idx;
120
121 gpio = IRQ_TO_GPIO(irq);
122 idx = gpio >> 5;
123
124 if (type == IRQT_PROBE) {
125 /* Don't mess with enabled GPIOs using preconfigured edges or
126 GPIOs set to alternate function or to output during probe */
127 if ((GPIO_IRQ_rising_edge[idx] | GPIO_IRQ_falling_edge[idx] | GPDR(gpio)) &
128 GPIO_bit(gpio))
129 return 0;
130 if (GAFR(gpio) & (0x3 << (((gpio) & 0xf)*2)))
131 return 0;
132 type = __IRQT_RISEDGE | __IRQT_FALEDGE;
133 }
134
135 /* printk(KERN_DEBUG "IRQ%d (GPIO%d): ", irq, gpio); */
136
137 pxa_gpio_mode(gpio | GPIO_IN);
138
139 if (type & __IRQT_RISEDGE) {
140 /* printk("rising "); */
141 __set_bit (gpio, GPIO_IRQ_rising_edge);
142 } else {
143 __clear_bit (gpio, GPIO_IRQ_rising_edge);
144 }
145
146 if (type & __IRQT_FALEDGE) {
147 /* printk("falling "); */
148 __set_bit (gpio, GPIO_IRQ_falling_edge);
149 } else {
150 __clear_bit (gpio, GPIO_IRQ_falling_edge);
151 }
152
153 /* printk("edges\n"); */
154
155 GRER(gpio) = GPIO_IRQ_rising_edge[idx] & GPIO_IRQ_mask[idx];
156 GFER(gpio) = GPIO_IRQ_falling_edge[idx] & GPIO_IRQ_mask[idx];
157 return 0;
158}
159
160/*
161 * GPIO IRQs must be acknowledged. This is for GPIO 0 and 1.
162 */
163
164static void pxa_ack_low_gpio(unsigned int irq)
165{
166 GEDR0 = (1 << (irq - IRQ_GPIO0));
167}
168
169static struct irq_chip pxa_low_gpio_chip = {
170 .name = "GPIO-l",
171 .ack = pxa_ack_low_gpio,
172 .mask = pxa_mask_low_irq,
173 .unmask = pxa_unmask_low_irq,
174 .set_type = pxa_gpio_irq_type,
175};
176
177/*
178 * Demux handler for GPIO>=2 edge detect interrupts
179 */
180
181static void pxa_gpio_demux_handler(unsigned int irq, struct irq_desc *desc)
182{
183 unsigned int mask;
184 int loop;
185
186 do {
187 loop = 0;
188
189 mask = GEDR0 & GPIO_IRQ_mask[0] & ~3;
190 if (mask) {
191 GEDR0 = mask;
192 irq = IRQ_GPIO(2);
193 desc = irq_desc + irq;
194 mask >>= 2;
195 do {
196 if (mask & 1)
197 desc_handle_irq(irq, desc);
198 irq++;
199 desc++;
200 mask >>= 1;
201 } while (mask);
202 loop = 1;
203 }
204
205 mask = GEDR1 & GPIO_IRQ_mask[1];
206 if (mask) {
207 GEDR1 = mask;
208 irq = IRQ_GPIO(32);
209 desc = irq_desc + irq;
210 do {
211 if (mask & 1)
212 desc_handle_irq(irq, desc);
213 irq++;
214 desc++;
215 mask >>= 1;
216 } while (mask);
217 loop = 1;
218 }
219
220 mask = GEDR2 & GPIO_IRQ_mask[2];
221 if (mask) {
222 GEDR2 = mask;
223 irq = IRQ_GPIO(64);
224 desc = irq_desc + irq;
225 do {
226 if (mask & 1)
227 desc_handle_irq(irq, desc);
228 irq++;
229 desc++;
230 mask >>= 1;
231 } while (mask);
232 loop = 1;
233 }
234
235 mask = GEDR3 & GPIO_IRQ_mask[3];
236 if (mask) {
237 GEDR3 = mask;
238 irq = IRQ_GPIO(96);
239 desc = irq_desc + irq;
240 do {
241 if (mask & 1)
242 desc_handle_irq(irq, desc);
243 irq++;
244 desc++;
245 mask >>= 1;
246 } while (mask);
247 loop = 1;
248 }
249 } while (loop);
250}
251
252static void pxa_ack_muxed_gpio(unsigned int irq)
253{
254 int gpio = irq - IRQ_GPIO(2) + 2;
255 GEDR(gpio) = GPIO_bit(gpio);
256}
257
258static void pxa_mask_muxed_gpio(unsigned int irq)
259{
260 int gpio = irq - IRQ_GPIO(2) + 2;
261 __clear_bit(gpio, GPIO_IRQ_mask);
262 GRER(gpio) &= ~GPIO_bit(gpio);
263 GFER(gpio) &= ~GPIO_bit(gpio);
264}
265
266static void pxa_unmask_muxed_gpio(unsigned int irq)
267{
268 int gpio = irq - IRQ_GPIO(2) + 2;
269 int idx = gpio >> 5;
270 __set_bit(gpio, GPIO_IRQ_mask);
271 GRER(gpio) = GPIO_IRQ_rising_edge[idx] & GPIO_IRQ_mask[idx];
272 GFER(gpio) = GPIO_IRQ_falling_edge[idx] & GPIO_IRQ_mask[idx];
273}
274
275static struct irq_chip pxa_muxed_gpio_chip = {
276 .name = "GPIO",
277 .ack = pxa_ack_muxed_gpio,
278 .mask = pxa_mask_muxed_gpio,
279 .unmask = pxa_unmask_muxed_gpio,
280 .set_type = pxa_gpio_irq_type,
281};
282
283void __init pxa_init_irq_gpio(int gpio_nr)
284{
285 int irq, i;
286
287 pxa_last_gpio = gpio_nr - 1;
288
289 /* clear all GPIO edge detects */
290 for (i = 0; i < gpio_nr; i += 32) {
291 GFER(i) = 0;
292 GRER(i) = 0;
293 GEDR(i) = GEDR(i);
294 }
295
296 /* GPIO 0 and 1 must have their mask bit always set */
297 GPIO_IRQ_mask[0] = 3;
298
299 for (irq = IRQ_GPIO0; irq <= IRQ_GPIO1; irq++) {
300 set_irq_chip(irq, &pxa_low_gpio_chip);
301 set_irq_handler(irq, handle_edge_irq);
302 set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
303 }
304 74
305 for (irq = IRQ_GPIO(2); irq < IRQ_GPIO(gpio_nr); irq++) { 75 pxa_internal_irq_chip.set_wake = fn;
306 set_irq_chip(irq, &pxa_muxed_gpio_chip);
307 set_irq_handler(irq, handle_edge_irq);
308 set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
309 }
310
311 /* Install handler for GPIO>=2 edge detect interrupts */
312 set_irq_chip(IRQ_GPIO_2_x, &pxa_internal_chip_low);
313 set_irq_chained_handler(IRQ_GPIO_2_x, pxa_gpio_demux_handler);
314
315 pxa_init_gpio(gpio_nr);
316}
317
318void __init pxa_init_irq_set_wake(int (*set_wake)(unsigned int, unsigned int))
319{
320 pxa_internal_chip_low.set_wake = set_wake;
321#ifdef CONFIG_PXA27x
322 pxa_internal_chip_high.set_wake = set_wake;
323#endif
324 pxa_low_gpio_chip.set_wake = set_wake;
325 pxa_muxed_gpio_chip.set_wake = set_wake;
326} 76}
327 77
328#ifdef CONFIG_PM 78#ifdef CONFIG_PM
@@ -330,19 +80,11 @@ static unsigned long saved_icmr[2];
330 80
331static int pxa_irq_suspend(struct sys_device *dev, pm_message_t state) 81static int pxa_irq_suspend(struct sys_device *dev, pm_message_t state)
332{ 82{
333 switch (dev->id) { 83 int i, irq = PXA_IRQ(0);
334 case 0: 84
335 saved_icmr[0] = ICMR; 85 for (i = 0; irq < PXA_IRQ(pxa_internal_irq_nr); i++, irq += 32) {
336 ICMR = 0; 86 saved_icmr[i] = _ICMR(irq);
337 break; 87 _ICMR(irq) = 0;
338#if defined(CONFIG_PXA27x) || defined(CONFIG_PXA3xx)
339 case 1:
340 saved_icmr[1] = ICMR2;
341 ICMR2 = 0;
342 break;
343#endif
344 default:
345 return -EINVAL;
346 } 88 }
347 89
348 return 0; 90 return 0;
@@ -350,22 +92,14 @@ static int pxa_irq_suspend(struct sys_device *dev, pm_message_t state)
350 92
351static int pxa_irq_resume(struct sys_device *dev) 93static int pxa_irq_resume(struct sys_device *dev)
352{ 94{
353 switch (dev->id) { 95 int i, irq = PXA_IRQ(0);
354 case 0: 96
355 ICMR = saved_icmr[0]; 97 for (i = 0; irq < PXA_IRQ(pxa_internal_irq_nr); i++, irq += 32) {
356 ICLR = 0; 98 _ICMR(irq) = saved_icmr[i];
357 ICCR = 1; 99 _ICLR(irq) = 0;
358 break;
359#if defined(CONFIG_PXA27x) || defined(CONFIG_PXA3xx)
360 case 1:
361 ICMR2 = saved_icmr[1];
362 ICLR2 = 0;
363 break;
364#endif
365 default:
366 return -EINVAL;
367 } 100 }
368 101
102 ICCR = 1;
369 return 0; 103 return 0;
370} 104}
371#else 105#else
diff --git a/arch/arm/mach-pxa/leds-trizeps4.c b/arch/arm/mach-pxa/leds-trizeps4.c
index 2271d20ffeda..21880daabafe 100644
--- a/arch/arm/mach-pxa/leds-trizeps4.c
+++ b/arch/arm/mach-pxa/leds-trizeps4.c
@@ -18,6 +18,7 @@
18#include <asm/leds.h> 18#include <asm/leds.h>
19 19
20#include <asm/arch/pxa-regs.h> 20#include <asm/arch/pxa-regs.h>
21#include <asm/arch/pxa2xx-gpio.h>
21#include <asm/arch/trizeps4.h> 22#include <asm/arch/trizeps4.h>
22 23
23#include "leds.h" 24#include "leds.h"
diff --git a/arch/arm/mach-pxa/littleton.c b/arch/arm/mach-pxa/littleton.c
index 0a4b54c21314..03396063b561 100644
--- a/arch/arm/mach-pxa/littleton.c
+++ b/arch/arm/mach-pxa/littleton.c
@@ -37,12 +37,11 @@
37#include <asm/arch/gpio.h> 37#include <asm/arch/gpio.h>
38#include <asm/arch/pxafb.h> 38#include <asm/arch/pxafb.h>
39#include <asm/arch/ssp.h> 39#include <asm/arch/ssp.h>
40#include <asm/arch/pxa27x_keypad.h>
40#include <asm/arch/littleton.h> 41#include <asm/arch/littleton.h>
41 42
42#include "generic.h" 43#include "generic.h"
43 44
44#define ARRAY_AND_SIZE(x) (x), ARRAY_SIZE(x)
45
46/* Littleton MFP configurations */ 45/* Littleton MFP configurations */
47static mfp_cfg_t littleton_mfp_cfg[] __initdata = { 46static mfp_cfg_t littleton_mfp_cfg[] __initdata = {
48 /* LCD */ 47 /* LCD */
@@ -76,6 +75,21 @@ static mfp_cfg_t littleton_mfp_cfg[] __initdata = {
76 75
77 /* Debug Ethernet */ 76 /* Debug Ethernet */
78 GPIO90_GPIO, 77 GPIO90_GPIO,
78
79 /* Keypad */
80 GPIO107_KP_DKIN_0,
81 GPIO108_KP_DKIN_1,
82 GPIO115_KP_MKIN_0,
83 GPIO116_KP_MKIN_1,
84 GPIO117_KP_MKIN_2,
85 GPIO118_KP_MKIN_3,
86 GPIO119_KP_MKIN_4,
87 GPIO120_KP_MKIN_5,
88 GPIO121_KP_MKOUT_0,
89 GPIO122_KP_MKOUT_1,
90 GPIO123_KP_MKOUT_2,
91 GPIO124_KP_MKOUT_3,
92 GPIO125_KP_MKOUT_4,
79}; 93};
80 94
81static struct resource smc91x_resources[] = { 95static struct resource smc91x_resources[] = {
@@ -300,6 +314,54 @@ static void littleton_init_lcd(void)
300static inline void littleton_init_lcd(void) {}; 314static inline void littleton_init_lcd(void) {};
301#endif /* CONFIG_FB_PXA || CONFIG_FB_PXA_MODULES */ 315#endif /* CONFIG_FB_PXA || CONFIG_FB_PXA_MODULES */
302 316
317#if defined(CONFIG_KEYBOARD_PXA27x) || defined(CONFIG_KEYBOARD_PXA27x_MODULES)
318static unsigned int littleton_matrix_key_map[] = {
319 /* KEY(row, col, key_code) */
320 KEY(1, 3, KEY_0), KEY(0, 0, KEY_1), KEY(1, 0, KEY_2), KEY(2, 0, KEY_3),
321 KEY(0, 1, KEY_4), KEY(1, 1, KEY_5), KEY(2, 1, KEY_6), KEY(0, 2, KEY_7),
322 KEY(1, 2, KEY_8), KEY(2, 2, KEY_9),
323
324 KEY(0, 3, KEY_KPASTERISK), /* * */
325 KEY(2, 3, KEY_KPDOT), /* # */
326
327 KEY(5, 4, KEY_ENTER),
328
329 KEY(5, 0, KEY_UP),
330 KEY(5, 1, KEY_DOWN),
331 KEY(5, 2, KEY_LEFT),
332 KEY(5, 3, KEY_RIGHT),
333 KEY(3, 2, KEY_HOME),
334 KEY(4, 1, KEY_END),
335 KEY(3, 3, KEY_BACK),
336
337 KEY(4, 0, KEY_SEND),
338 KEY(4, 2, KEY_VOLUMEUP),
339 KEY(4, 3, KEY_VOLUMEDOWN),
340
341 KEY(3, 0, KEY_F22), /* soft1 */
342 KEY(3, 1, KEY_F23), /* soft2 */
343};
344
345static struct pxa27x_keypad_platform_data littleton_keypad_info = {
346 .matrix_key_rows = 6,
347 .matrix_key_cols = 5,
348 .matrix_key_map = littleton_matrix_key_map,
349 .matrix_key_map_size = ARRAY_SIZE(littleton_matrix_key_map),
350
351 .enable_rotary0 = 1,
352 .rotary0_up_key = KEY_UP,
353 .rotary0_down_key = KEY_DOWN,
354
355 .debounce_interval = 30,
356};
357static void __init littleton_init_keypad(void)
358{
359 pxa_set_keypad_info(&littleton_keypad_info);
360}
361#else
362static inline void littleton_init_keypad(void) {}
363#endif
364
303static void __init littleton_init(void) 365static void __init littleton_init(void)
304{ 366{
305 /* initialize MFP configurations */ 367 /* initialize MFP configurations */
@@ -312,6 +374,7 @@ static void __init littleton_init(void)
312 platform_device_register(&smc91x_device); 374 platform_device_register(&smc91x_device);
313 375
314 littleton_init_lcd(); 376 littleton_init_lcd();
377 littleton_init_keypad();
315} 378}
316 379
317MACHINE_START(LITTLETON, "Marvell Form Factor Development Platform (aka Littleton)") 380MACHINE_START(LITTLETON, "Marvell Form Factor Development Platform (aka Littleton)")
diff --git a/arch/arm/mach-pxa/lpd270.c b/arch/arm/mach-pxa/lpd270.c
index afa62ffe3ad5..a20e4b1649d6 100644
--- a/arch/arm/mach-pxa/lpd270.c
+++ b/arch/arm/mach-pxa/lpd270.c
@@ -39,6 +39,7 @@
39 39
40#include <asm/arch/pxa-regs.h> 40#include <asm/arch/pxa-regs.h>
41#include <asm/arch/pxa2xx-regs.h> 41#include <asm/arch/pxa2xx-regs.h>
42#include <asm/arch/pxa2xx-gpio.h>
42#include <asm/arch/lpd270.h> 43#include <asm/arch/lpd270.h>
43#include <asm/arch/audio.h> 44#include <asm/arch/audio.h>
44#include <asm/arch/pxafb.h> 45#include <asm/arch/pxafb.h>
diff --git a/arch/arm/mach-pxa/lubbock.c b/arch/arm/mach-pxa/lubbock.c
index e7ae4bb3e361..ca209c443f34 100644
--- a/arch/arm/mach-pxa/lubbock.c
+++ b/arch/arm/mach-pxa/lubbock.c
@@ -42,6 +42,7 @@
42 42
43#include <asm/arch/pxa-regs.h> 43#include <asm/arch/pxa-regs.h>
44#include <asm/arch/pxa2xx-regs.h> 44#include <asm/arch/pxa2xx-regs.h>
45#include <asm/arch/mfp-pxa25x.h>
45#include <asm/arch/lubbock.h> 46#include <asm/arch/lubbock.h>
46#include <asm/arch/udc.h> 47#include <asm/arch/udc.h>
47#include <asm/arch/irda.h> 48#include <asm/arch/irda.h>
@@ -51,6 +52,40 @@
51#include "generic.h" 52#include "generic.h"
52#include "devices.h" 53#include "devices.h"
53 54
55static unsigned long lubbock_pin_config[] __initdata = {
56 GPIO15_nCS_1, /* CS1 - Flash */
57 GPIO79_nCS_3, /* CS3 - SMC ethernet */
58
59 /* SSP data pins */
60 GPIO23_SSP1_SCLK,
61 GPIO25_SSP1_TXD,
62 GPIO26_SSP1_RXD,
63
64 /* BTUART */
65 GPIO42_BTUART_RXD,
66 GPIO43_BTUART_TXD,
67 GPIO44_BTUART_CTS,
68 GPIO45_BTUART_RTS,
69
70 /* PC Card */
71 GPIO48_nPOE,
72 GPIO49_nPWE,
73 GPIO50_nPIOR,
74 GPIO51_nPIOW,
75 GPIO52_nPCE_1,
76 GPIO53_nPCE_2,
77 GPIO54_nPSKTSEL,
78 GPIO55_nPREG,
79 GPIO56_nPWAIT,
80 GPIO57_nIOIS16,
81
82 /* MMC */
83 GPIO6_MMC_CLK,
84 GPIO8_MMC_CS0,
85
86 /* wakeup */
87 GPIO1_GPIO | WAKEUP_ON_EDGE_RISE,
88};
54 89
55#define LUB_MISC_WR __LUB_REG(LUBBOCK_FPGA_PHYS + 0x080) 90#define LUB_MISC_WR __LUB_REG(LUBBOCK_FPGA_PHYS + 0x080)
56 91
@@ -186,26 +221,6 @@ static struct platform_device sa1111_device = {
186 .resource = sa1111_resources, 221 .resource = sa1111_resources,
187}; 222};
188 223
189static struct resource smc91x_resources[] = {
190 [0] = {
191 .name = "smc91x-regs",
192 .start = 0x0c000c00,
193 .end = 0x0c0fffff,
194 .flags = IORESOURCE_MEM,
195 },
196 [1] = {
197 .start = LUBBOCK_ETH_IRQ,
198 .end = LUBBOCK_ETH_IRQ,
199 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE,
200 },
201 [2] = {
202 .name = "smc91x-attrib",
203 .start = 0x0e000000,
204 .end = 0x0e0fffff,
205 .flags = IORESOURCE_MEM,
206 },
207};
208
209/* ADS7846 is connected through SSP ... and if your board has J5 populated, 224/* ADS7846 is connected through SSP ... and if your board has J5 populated,
210 * you can select it to replace the ucb1400 by switching the touchscreen cable 225 * you can select it to replace the ucb1400 by switching the touchscreen cable
211 * (to J5) and poking board registers (as done below). Else it's only useful 226 * (to J5) and poking board registers (as done below). Else it's only useful
@@ -261,6 +276,26 @@ static struct spi_board_info spi_board_info[] __initdata = { {
261}, 276},
262}; 277};
263 278
279static struct resource smc91x_resources[] = {
280 [0] = {
281 .name = "smc91x-regs",
282 .start = 0x0c000c00,
283 .end = 0x0c0fffff,
284 .flags = IORESOURCE_MEM,
285 },
286 [1] = {
287 .start = LUBBOCK_ETH_IRQ,
288 .end = LUBBOCK_ETH_IRQ,
289 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE,
290 },
291 [2] = {
292 .name = "smc91x-attrib",
293 .start = 0x0e000000,
294 .end = 0x0e0fffff,
295 .flags = IORESOURCE_MEM,
296 },
297};
298
264static struct platform_device smc91x_device = { 299static struct platform_device smc91x_device = {
265 .name = "smc91x", 300 .name = "smc91x",
266 .id = -1, 301 .id = -1,
@@ -404,10 +439,6 @@ static int lubbock_mci_init(struct device *dev,
404 irq_handler_t detect_int, 439 irq_handler_t detect_int,
405 void *data) 440 void *data)
406{ 441{
407 /* setup GPIO for PXA25x MMC controller */
408 pxa_gpio_mode(GPIO6_MMCCLK_MD);
409 pxa_gpio_mode(GPIO8_MMCCS0_MD);
410
411 /* detect card insert/eject */ 442 /* detect card insert/eject */
412 mmc_detect_int = detect_int; 443 mmc_detect_int = detect_int;
413 init_timer(&mmc_timer); 444 init_timer(&mmc_timer);
@@ -457,6 +488,8 @@ static void __init lubbock_init(void)
457{ 488{
458 int flashboot = (LUB_CONF_SWITCHES & 1); 489 int flashboot = (LUB_CONF_SWITCHES & 1);
459 490
491 pxa2xx_mfp_config(ARRAY_AND_SIZE(lubbock_pin_config));
492
460 pxa_set_udc_info(&udc_info); 493 pxa_set_udc_info(&udc_info);
461 set_pxa_fb_info(&sharp_lm8v31); 494 set_pxa_fb_info(&sharp_lm8v31);
462 pxa_set_mci_info(&lubbock_mci_platform_data); 495 pxa_set_mci_info(&lubbock_mci_platform_data);
@@ -489,46 +522,6 @@ static void __init lubbock_map_io(void)
489 pxa_map_io(); 522 pxa_map_io();
490 iotable_init(lubbock_io_desc, ARRAY_SIZE(lubbock_io_desc)); 523 iotable_init(lubbock_io_desc, ARRAY_SIZE(lubbock_io_desc));
491 524
492 /* SSP data pins */
493 pxa_gpio_mode(GPIO23_SCLK_MD);
494 pxa_gpio_mode(GPIO25_STXD_MD);
495 pxa_gpio_mode(GPIO26_SRXD_MD);
496
497 /* This enables the BTUART */
498 pxa_gpio_mode(GPIO42_BTRXD_MD);
499 pxa_gpio_mode(GPIO43_BTTXD_MD);
500 pxa_gpio_mode(GPIO44_BTCTS_MD);
501 pxa_gpio_mode(GPIO45_BTRTS_MD);
502
503 GPSR(GPIO48_nPOE) =
504 GPIO_bit(GPIO48_nPOE) |
505 GPIO_bit(GPIO49_nPWE) |
506 GPIO_bit(GPIO50_nPIOR) |
507 GPIO_bit(GPIO51_nPIOW) |
508 GPIO_bit(GPIO52_nPCE_1) |
509 GPIO_bit(GPIO53_nPCE_2);
510
511 pxa_gpio_mode(GPIO48_nPOE_MD);
512 pxa_gpio_mode(GPIO49_nPWE_MD);
513 pxa_gpio_mode(GPIO50_nPIOR_MD);
514 pxa_gpio_mode(GPIO51_nPIOW_MD);
515 pxa_gpio_mode(GPIO52_nPCE_1_MD);
516 pxa_gpio_mode(GPIO53_nPCE_2_MD);
517 pxa_gpio_mode(GPIO54_pSKTSEL_MD);
518 pxa_gpio_mode(GPIO55_nPREG_MD);
519 pxa_gpio_mode(GPIO56_nPWAIT_MD);
520 pxa_gpio_mode(GPIO57_nIOIS16_MD);
521
522 /* This is for the SMC chip select */
523 pxa_gpio_mode(GPIO79_nCS_3_MD);
524
525 /* setup sleep mode values */
526 PWER = 0x00000002;
527 PFER = 0x00000000;
528 PRER = 0x00000002;
529 PGSR0 = 0x00008000;
530 PGSR1 = 0x003F0202;
531 PGSR2 = 0x0001C000;
532 PCFR |= PCFR_OPDE; 525 PCFR |= PCFR_OPDE;
533} 526}
534 527
diff --git a/arch/arm/mach-pxa/magician.c b/arch/arm/mach-pxa/magician.c
index d98ef7ada2f8..d70be75bd199 100644
--- a/arch/arm/mach-pxa/magician.c
+++ b/arch/arm/mach-pxa/magician.c
@@ -16,24 +16,106 @@
16#include <linux/kernel.h> 16#include <linux/kernel.h>
17#include <linux/init.h> 17#include <linux/init.h>
18#include <linux/platform_device.h> 18#include <linux/platform_device.h>
19#include <linux/delay.h>
19#include <linux/gpio_keys.h> 20#include <linux/gpio_keys.h>
20#include <linux/input.h> 21#include <linux/input.h>
22#include <linux/mfd/htc-egpio.h>
23#include <linux/mfd/htc-pasic3.h>
21#include <linux/mtd/mtd.h> 24#include <linux/mtd/mtd.h>
22#include <linux/mtd/map.h> 25#include <linux/mtd/map.h>
23#include <linux/mtd/physmap.h> 26#include <linux/mtd/physmap.h>
27#include <linux/pda_power.h>
24 28
25#include <asm/gpio.h> 29#include <asm/gpio.h>
26#include <asm/hardware.h> 30#include <asm/hardware.h>
27#include <asm/mach-types.h> 31#include <asm/mach-types.h>
28#include <asm/mach/arch.h> 32#include <asm/mach/arch.h>
29#include <asm/arch/magician.h> 33#include <asm/arch/magician.h>
34#include <asm/arch/mfp-pxa27x.h>
30#include <asm/arch/pxa-regs.h> 35#include <asm/arch/pxa-regs.h>
31#include <asm/arch/pxafb.h> 36#include <asm/arch/pxafb.h>
37#include <asm/arch/i2c.h>
38#include <asm/arch/mmc.h>
32#include <asm/arch/irda.h> 39#include <asm/arch/irda.h>
33#include <asm/arch/ohci.h> 40#include <asm/arch/ohci.h>
34 41
35#include "generic.h" 42#include "generic.h"
36 43
44static unsigned long magician_pin_config[] = {
45
46 /* SDRAM and Static Memory I/O Signals */
47 GPIO20_nSDCS_2,
48 GPIO21_nSDCS_3,
49 GPIO15_nCS_1,
50 GPIO78_nCS_2, /* PASIC3 */
51 GPIO79_nCS_3, /* EGPIO CPLD */
52 GPIO80_nCS_4,
53 GPIO33_nCS_5,
54
55 /* I2C */
56 GPIO117_I2C_SCL,
57 GPIO118_I2C_SDA,
58
59 /* PWM 0 */
60 GPIO16_PWM0_OUT,
61
62 /* I2S */
63 GPIO28_I2S_BITCLK_OUT,
64 GPIO29_I2S_SDATA_IN,
65 GPIO31_I2S_SYNC,
66 GPIO113_I2S_SYSCLK,
67
68 /* SSP 2 */
69 GPIO19_SSP2_SCLK,
70 GPIO14_SSP2_SFRM,
71 GPIO89_SSP2_TXD,
72 GPIO88_SSP2_RXD,
73
74 /* MMC */
75 GPIO32_MMC_CLK,
76 GPIO92_MMC_DAT_0,
77 GPIO109_MMC_DAT_1,
78 GPIO110_MMC_DAT_2,
79 GPIO111_MMC_DAT_3,
80 GPIO112_MMC_CMD,
81
82 /* LCD */
83 GPIO58_LCD_LDD_0,
84 GPIO59_LCD_LDD_1,
85 GPIO60_LCD_LDD_2,
86 GPIO61_LCD_LDD_3,
87 GPIO62_LCD_LDD_4,
88 GPIO63_LCD_LDD_5,
89 GPIO64_LCD_LDD_6,
90 GPIO65_LCD_LDD_7,
91 GPIO66_LCD_LDD_8,
92 GPIO67_LCD_LDD_9,
93 GPIO68_LCD_LDD_10,
94 GPIO69_LCD_LDD_11,
95 GPIO70_LCD_LDD_12,
96 GPIO71_LCD_LDD_13,
97 GPIO72_LCD_LDD_14,
98 GPIO73_LCD_LDD_15,
99 GPIO74_LCD_FCLK,
100 GPIO75_LCD_LCLK,
101 GPIO76_LCD_PCLK,
102 GPIO77_LCD_BIAS,
103
104 /* QCI */
105 GPIO12_CIF_DD_7,
106 GPIO17_CIF_DD_6,
107 GPIO50_CIF_DD_3,
108 GPIO51_CIF_DD_2,
109 GPIO52_CIF_DD_4,
110 GPIO53_CIF_MCLK,
111 GPIO54_CIF_PCLK,
112 GPIO55_CIF_DD_1,
113 GPIO81_CIF_DD_0,
114 GPIO82_CIF_DD_5,
115 GPIO84_CIF_FV,
116 GPIO85_CIF_LV,
117};
118
37/* 119/*
38 * IRDA 120 * IRDA
39 */ 121 */
@@ -83,8 +165,64 @@ static struct platform_device gpio_keys = {
83 .id = -1, 165 .id = -1,
84}; 166};
85 167
168
169/*
170 * EGPIO (Xilinx CPLD)
171 *
172 * 7 32-bit aligned 8-bit registers: 3x output, 1x irq, 3x input
173 */
174
175static struct resource egpio_resources[] = {
176 [0] = {
177 .start = PXA_CS3_PHYS,
178 .end = PXA_CS3_PHYS + 0x20,
179 .flags = IORESOURCE_MEM,
180 },
181 [1] = {
182 .start = gpio_to_irq(GPIO13_MAGICIAN_CPLD_IRQ),
183 .end = gpio_to_irq(GPIO13_MAGICIAN_CPLD_IRQ),
184 .flags = IORESOURCE_IRQ,
185 },
186};
187
188static struct htc_egpio_chip egpio_chips[] = {
189 [0] = {
190 .reg_start = 0,
191 .gpio_base = MAGICIAN_EGPIO(0, 0),
192 .num_gpios = 24,
193 .direction = HTC_EGPIO_OUTPUT,
194 .initial_values = 0x40, /* EGPIO_MAGICIAN_GSM_RESET */
195 },
196 [1] = {
197 .reg_start = 4,
198 .gpio_base = MAGICIAN_EGPIO(4, 0),
199 .num_gpios = 24,
200 .direction = HTC_EGPIO_INPUT,
201 },
202};
203
204static struct htc_egpio_platform_data egpio_info = {
205 .reg_width = 8,
206 .bus_width = 32,
207 .irq_base = IRQ_BOARD_START,
208 .num_irqs = 4,
209 .ack_register = 3,
210 .chip = egpio_chips,
211 .num_chips = ARRAY_SIZE(egpio_chips),
212};
213
214static struct platform_device egpio = {
215 .name = "htc-egpio",
216 .id = -1,
217 .resource = egpio_resources,
218 .num_resources = ARRAY_SIZE(egpio_resources),
219 .dev = {
220 .platform_data = &egpio_info,
221 },
222};
223
86/* 224/*
87 * LCD - Toppoly TD028STEB1 225 * LCD - Toppoly TD028STEB1 or Samsung LTP280QV
88 */ 226 */
89 227
90static struct pxafb_mode_info toppoly_modes[] = { 228static struct pxafb_mode_info toppoly_modes[] = {
@@ -103,12 +241,99 @@ static struct pxafb_mode_info toppoly_modes[] = {
103 }, 241 },
104}; 242};
105 243
244static struct pxafb_mode_info samsung_modes[] = {
245 {
246 .pixclock = 96153,
247 .bpp = 16,
248 .xres = 240,
249 .yres = 320,
250 .hsync_len = 8,
251 .vsync_len = 4,
252 .left_margin = 9,
253 .upper_margin = 4,
254 .right_margin = 9,
255 .lower_margin = 4,
256 .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
257 },
258};
259
260static void toppoly_lcd_power(int on, struct fb_var_screeninfo *si)
261{
262 pr_debug("Toppoly LCD power\n");
263
264 if (on) {
265 pr_debug("on\n");
266 gpio_set_value(EGPIO_MAGICIAN_TOPPOLY_POWER, 1);
267 gpio_set_value(GPIO106_MAGICIAN_LCD_POWER_3, 1);
268 udelay(2000);
269 gpio_set_value(EGPIO_MAGICIAN_LCD_POWER, 1);
270 udelay(2000);
271 /* FIXME: enable LCDC here */
272 udelay(2000);
273 gpio_set_value(GPIO104_MAGICIAN_LCD_POWER_1, 1);
274 udelay(2000);
275 gpio_set_value(GPIO105_MAGICIAN_LCD_POWER_2, 1);
276 } else {
277 pr_debug("off\n");
278 msleep(15);
279 gpio_set_value(GPIO105_MAGICIAN_LCD_POWER_2, 0);
280 udelay(500);
281 gpio_set_value(GPIO104_MAGICIAN_LCD_POWER_1, 0);
282 udelay(1000);
283 gpio_set_value(GPIO106_MAGICIAN_LCD_POWER_3, 0);
284 gpio_set_value(EGPIO_MAGICIAN_LCD_POWER, 0);
285 }
286}
287
288static void samsung_lcd_power(int on, struct fb_var_screeninfo *si)
289{
290 pr_debug("Samsung LCD power\n");
291
292 if (on) {
293 pr_debug("on\n");
294 if (system_rev < 3)
295 gpio_set_value(GPIO75_MAGICIAN_SAMSUNG_POWER, 1);
296 else
297 gpio_set_value(EGPIO_MAGICIAN_LCD_POWER, 1);
298 mdelay(10);
299 gpio_set_value(GPIO106_MAGICIAN_LCD_POWER_3, 1);
300 mdelay(10);
301 gpio_set_value(GPIO104_MAGICIAN_LCD_POWER_1, 1);
302 mdelay(30);
303 gpio_set_value(GPIO105_MAGICIAN_LCD_POWER_2, 1);
304 mdelay(10);
305 } else {
306 pr_debug("off\n");
307 mdelay(10);
308 gpio_set_value(GPIO105_MAGICIAN_LCD_POWER_2, 0);
309 mdelay(30);
310 gpio_set_value(GPIO104_MAGICIAN_LCD_POWER_1, 0);
311 mdelay(10);
312 gpio_set_value(GPIO106_MAGICIAN_LCD_POWER_3, 0);
313 mdelay(10);
314 if (system_rev < 3)
315 gpio_set_value(GPIO75_MAGICIAN_SAMSUNG_POWER, 0);
316 else
317 gpio_set_value(EGPIO_MAGICIAN_LCD_POWER, 0);
318 }
319}
320
106static struct pxafb_mach_info toppoly_info = { 321static struct pxafb_mach_info toppoly_info = {
107 .modes = toppoly_modes, 322 .modes = toppoly_modes,
108 .num_modes = 1, 323 .num_modes = 1,
109 .fixed_modes = 1, 324 .fixed_modes = 1,
110 .lccr0 = LCCR0_Color | LCCR0_Sngl | LCCR0_Act, 325 .lccr0 = LCCR0_Color | LCCR0_Sngl | LCCR0_Act,
111 .lccr3 = LCCR3_PixRsEdg, 326 .lccr3 = LCCR3_PixRsEdg,
327 .pxafb_lcd_power = toppoly_lcd_power,
328};
329
330static struct pxafb_mach_info samsung_info = {
331 .modes = samsung_modes,
332 .num_modes = 1,
333 .fixed_modes = 1,
334 .lccr0 = LCCR0_LDDALT | LCCR0_Color | LCCR0_Sngl | LCCR0_Act,
335 .lccr3 = LCCR3_PixFlEdg,
336 .pxafb_lcd_power = samsung_lcd_power,
112}; 337};
113 338
114/* 339/*
@@ -120,9 +345,18 @@ static void magician_set_bl_intensity(int intensity)
120 if (intensity) { 345 if (intensity) {
121 PWM_CTRL0 = 1; 346 PWM_CTRL0 = 1;
122 PWM_PERVAL0 = 0xc8; 347 PWM_PERVAL0 = 0xc8;
123 PWM_PWDUTY0 = intensity; 348 if (intensity > 0xc7) {
349 PWM_PWDUTY0 = intensity - 0x48;
350 gpio_set_value(EGPIO_MAGICIAN_BL_POWER2, 1);
351 } else {
352 PWM_PWDUTY0 = intensity;
353 gpio_set_value(EGPIO_MAGICIAN_BL_POWER2, 0);
354 }
355 gpio_set_value(EGPIO_MAGICIAN_BL_POWER, 1);
124 pxa_set_cken(CKEN_PWM0, 1); 356 pxa_set_cken(CKEN_PWM0, 1);
125 } else { 357 } else {
358 /* PWM_PWDUTY0 = intensity; */
359 gpio_set_value(EGPIO_MAGICIAN_BL_POWER, 0);
126 pxa_set_cken(CKEN_PWM0, 0); 360 pxa_set_cken(CKEN_PWM0, 0);
127 } 361 }
128} 362}
@@ -130,18 +364,215 @@ static void magician_set_bl_intensity(int intensity)
130static struct generic_bl_info backlight_info = { 364static struct generic_bl_info backlight_info = {
131 .default_intensity = 0x64, 365 .default_intensity = 0x64,
132 .limit_mask = 0x0b, 366 .limit_mask = 0x0b,
133 .max_intensity = 0xc7, 367 .max_intensity = 0xc7+0x48,
134 .set_bl_intensity = magician_set_bl_intensity, 368 .set_bl_intensity = magician_set_bl_intensity,
135}; 369};
136 370
137static struct platform_device backlight = { 371static struct platform_device backlight = {
138 .name = "corgi-bl", 372 .name = "generic-bl",
139 .dev = { 373 .dev = {
140 .platform_data = &backlight_info, 374 .platform_data = &backlight_info,
141 }, 375 },
142 .id = -1, 376 .id = -1,
143}; 377};
144 378
379/*
380 * LEDs
381 */
382
383struct gpio_led gpio_leds[] = {
384 {
385 .name = "magician::vibra",
386 .default_trigger = "none",
387 .gpio = GPIO22_MAGICIAN_VIBRA_EN,
388 },
389 {
390 .name = "magician::phone_bl",
391 .default_trigger = "none",
392 .gpio = GPIO103_MAGICIAN_LED_KP,
393 },
394};
395
396static struct gpio_led_platform_data gpio_led_info = {
397 .leds = gpio_leds,
398 .num_leds = ARRAY_SIZE(gpio_leds),
399};
400
401static struct platform_device leds_gpio = {
402 .name = "leds-gpio",
403 .id = -1,
404 .dev = {
405 .platform_data = &gpio_led_info,
406 },
407};
408
409static struct pasic3_led pasic3_leds[] = {
410 {
411 .led = {
412 .name = "magician:red",
413 .default_trigger = "ds2760-battery.0-charging",
414 },
415 .hw_num = 0,
416 .bit2 = PASIC3_BIT2_LED0,
417 .mask = PASIC3_MASK_LED0,
418 },
419 {
420 .led = {
421 .name = "magician:green",
422 .default_trigger = "ds2760-battery.0-charging-or-full",
423 },
424 .hw_num = 1,
425 .bit2 = PASIC3_BIT2_LED1,
426 .mask = PASIC3_MASK_LED1,
427 },
428 {
429 .led = {
430 .name = "magician:blue",
431 .default_trigger = "bluetooth",
432 },
433 .hw_num = 2,
434 .bit2 = PASIC3_BIT2_LED2,
435 .mask = PASIC3_MASK_LED2,
436 },
437};
438
439static struct platform_device pasic3;
440
441static struct pasic3_leds_machinfo __devinit pasic3_leds_info = {
442 .num_leds = ARRAY_SIZE(pasic3_leds),
443 .power_gpio = EGPIO_MAGICIAN_LED_POWER,
444 .leds = pasic3_leds,
445};
446
447/*
448 * PASIC3 with DS1WM
449 */
450
451static struct resource pasic3_resources[] = {
452 [0] = {
453 .start = PXA_CS2_PHYS,
454 .end = PXA_CS2_PHYS + 0x1b,
455 .flags = IORESOURCE_MEM,
456 },
457 /* No IRQ handler in the PASIC3, DS1WM needs an external IRQ */
458 [1] = {
459 .start = gpio_to_irq(GPIO107_MAGICIAN_DS1WM_IRQ),
460 .end = gpio_to_irq(GPIO107_MAGICIAN_DS1WM_IRQ),
461 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHEDGE,
462 }
463};
464
465static struct pasic3_platform_data pasic3_platform_data = {
466 .bus_shift = 2,
467 .led_pdata = &pasic3_leds_info,
468 .clock_rate = 4000000,
469};
470
471static struct platform_device pasic3 = {
472 .name = "pasic3",
473 .id = -1,
474 .num_resources = ARRAY_SIZE(pasic3_resources),
475 .resource = pasic3_resources,
476 .dev = {
477 .platform_data = &pasic3_platform_data,
478 },
479};
480
481/*
482 * External power
483 */
484
485static int magician_is_ac_online(void)
486{
487 return gpio_get_value(EGPIO_MAGICIAN_CABLE_STATE_AC);
488}
489
490static int magician_is_usb_online(void)
491{
492 return gpio_get_value(EGPIO_MAGICIAN_CABLE_STATE_USB);
493}
494
495static void magician_set_charge(int flags)
496{
497 gpio_set_value(GPIO30_MAGICIAN_nCHARGE_EN, !flags);
498 gpio_set_value(EGPIO_MAGICIAN_CHARGE_EN, flags);
499}
500
501static char *magician_supplicants[] = {
502 "ds2760-battery.0", "backup-battery"
503};
504
505static struct pda_power_pdata power_supply_info = {
506 .is_ac_online = magician_is_ac_online,
507 .is_usb_online = magician_is_usb_online,
508 .set_charge = magician_set_charge,
509 .supplied_to = magician_supplicants,
510 .num_supplicants = ARRAY_SIZE(magician_supplicants),
511};
512
513static struct resource power_supply_resources[] = {
514 [0] = {
515 .name = "ac",
516 .flags = IORESOURCE_IRQ,
517 .start = IRQ_MAGICIAN_AC,
518 .end = IRQ_MAGICIAN_AC,
519 },
520 [1] = {
521 .name = "usb",
522 .flags = IORESOURCE_IRQ,
523 .start = IRQ_MAGICIAN_AC,
524 .end = IRQ_MAGICIAN_AC,
525 },
526};
527
528static struct platform_device power_supply = {
529 .name = "pda-power",
530 .id = -1,
531 .dev = {
532 .platform_data = &power_supply_info,
533 },
534 .resource = power_supply_resources,
535 .num_resources = ARRAY_SIZE(power_supply_resources),
536};
537
538
539/*
540 * MMC/SD
541 */
542
543static int magician_mci_init(struct device *dev,
544 irq_handler_t detect_irq, void *data)
545{
546 return request_irq(IRQ_MAGICIAN_SD, detect_irq,
547 IRQF_DISABLED | IRQF_SAMPLE_RANDOM,
548 "MMC card detect", data);
549}
550
551static void magician_mci_setpower(struct device *dev, unsigned int vdd)
552{
553 struct pxamci_platform_data *pdata = dev->platform_data;
554
555 gpio_set_value(EGPIO_MAGICIAN_SD_POWER, (1 << vdd) & pdata->ocr_mask);
556}
557
558static int magician_mci_get_ro(struct device *dev)
559{
560 return (!gpio_get_value(EGPIO_MAGICIAN_nSD_READONLY));
561}
562
563static void magician_mci_exit(struct device *dev, void *data)
564{
565 free_irq(IRQ_MAGICIAN_SD, data);
566}
567
568static struct pxamci_platform_data magician_mci_info = {
569 .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34,
570 .init = magician_mci_init,
571 .get_ro = magician_mci_get_ro,
572 .setpower = magician_mci_setpower,
573 .exit = magician_mci_exit,
574};
575
145 576
146/* 577/*
147 * USB OHCI 578 * USB OHCI
@@ -166,6 +597,11 @@ static struct pxaohci_platform_data magician_ohci_info = {
166 * StrataFlash 597 * StrataFlash
167 */ 598 */
168 599
600static void magician_set_vpp(struct map_info *map, int vpp)
601{
602 gpio_set_value(EGPIO_MAGICIAN_FLASH_VPP, vpp);
603}
604
169#define PXA_CS_SIZE 0x04000000 605#define PXA_CS_SIZE 0x04000000
170 606
171static struct resource strataflash_resource = { 607static struct resource strataflash_resource = {
@@ -176,13 +612,14 @@ static struct resource strataflash_resource = {
176 612
177static struct physmap_flash_data strataflash_data = { 613static struct physmap_flash_data strataflash_data = {
178 .width = 4, 614 .width = 4,
615 .set_vpp = magician_set_vpp,
179}; 616};
180 617
181static struct platform_device strataflash = { 618static struct platform_device strataflash = {
182 .name = "physmap-flash", 619 .name = "physmap-flash",
183 .id = -1, 620 .id = -1,
184 .num_resources = 1,
185 .resource = &strataflash_resource, 621 .resource = &strataflash_resource,
622 .num_resources = 1,
186 .dev = { 623 .dev = {
187 .platform_data = &strataflash_data, 624 .platform_data = &strataflash_data,
188 }, 625 },
@@ -194,16 +631,43 @@ static struct platform_device strataflash = {
194 631
195static struct platform_device *devices[] __initdata = { 632static struct platform_device *devices[] __initdata = {
196 &gpio_keys, 633 &gpio_keys,
634 &egpio,
197 &backlight, 635 &backlight,
636 &pasic3,
637 &power_supply,
198 &strataflash, 638 &strataflash,
639 &leds_gpio,
199}; 640};
200 641
201static void __init magician_init(void) 642static void __init magician_init(void)
202{ 643{
644 void __iomem *cpld;
645 int lcd_select;
646
647 pxa2xx_mfp_config(ARRAY_AND_SIZE(magician_pin_config));
648
203 platform_add_devices(devices, ARRAY_SIZE(devices)); 649 platform_add_devices(devices, ARRAY_SIZE(devices));
650 pxa_set_i2c_info(NULL);
651 pxa_set_mci_info(&magician_mci_info);
204 pxa_set_ohci_info(&magician_ohci_info); 652 pxa_set_ohci_info(&magician_ohci_info);
205 pxa_set_ficp_info(&magician_ficp_info); 653 pxa_set_ficp_info(&magician_ficp_info);
206 set_pxa_fb_info(&toppoly_info); 654
655 /* Check LCD type we have */
656 cpld = ioremap_nocache(PXA_CS3_PHYS, 0x1000);
657 if (cpld) {
658 u8 board_id = __raw_readb(cpld+0x14);
659 system_rev = board_id & 0x7;
660 lcd_select = board_id & 0x8;
661 iounmap(cpld);
662 pr_info("LCD type: %s\n", lcd_select ? "Samsung" : "Toppoly");
663 if (lcd_select && (system_rev < 3))
664 pxa_gpio_mode(GPIO75_MAGICIAN_SAMSUNG_POWER_MD);
665 pxa_gpio_mode(GPIO104_MAGICIAN_LCD_POWER_1_MD);
666 pxa_gpio_mode(GPIO105_MAGICIAN_LCD_POWER_2_MD);
667 pxa_gpio_mode(GPIO106_MAGICIAN_LCD_POWER_3_MD);
668 set_pxa_fb_info(lcd_select ? &samsung_info : &toppoly_info);
669 } else
670 pr_err("LCD detection: CPLD mapping failed\n");
207} 671}
208 672
209 673
diff --git a/arch/arm/mach-pxa/mainstone.c b/arch/arm/mach-pxa/mainstone.c
index 72a436fb9a29..18d47cfa2a18 100644
--- a/arch/arm/mach-pxa/mainstone.c
+++ b/arch/arm/mach-pxa/mainstone.c
@@ -24,6 +24,8 @@
24#include <linux/mtd/mtd.h> 24#include <linux/mtd/mtd.h>
25#include <linux/mtd/partitions.h> 25#include <linux/mtd/partitions.h>
26#include <linux/backlight.h> 26#include <linux/backlight.h>
27#include <linux/input.h>
28#include <linux/gpio_keys.h>
27 29
28#include <asm/types.h> 30#include <asm/types.h>
29#include <asm/setup.h> 31#include <asm/setup.h>
@@ -40,16 +42,94 @@
40 42
41#include <asm/arch/pxa-regs.h> 43#include <asm/arch/pxa-regs.h>
42#include <asm/arch/pxa2xx-regs.h> 44#include <asm/arch/pxa2xx-regs.h>
45#include <asm/arch/mfp-pxa27x.h>
43#include <asm/arch/mainstone.h> 46#include <asm/arch/mainstone.h>
44#include <asm/arch/audio.h> 47#include <asm/arch/audio.h>
45#include <asm/arch/pxafb.h> 48#include <asm/arch/pxafb.h>
49#include <asm/arch/i2c.h>
46#include <asm/arch/mmc.h> 50#include <asm/arch/mmc.h>
47#include <asm/arch/irda.h> 51#include <asm/arch/irda.h>
48#include <asm/arch/ohci.h> 52#include <asm/arch/ohci.h>
53#include <asm/arch/pxa27x_keypad.h>
49 54
50#include "generic.h" 55#include "generic.h"
51#include "devices.h" 56#include "devices.h"
52 57
58static unsigned long mainstone_pin_config[] = {
59 /* Chip Select */
60 GPIO15_nCS_1,
61
62 /* LCD - 16bpp Active TFT */
63 GPIO58_LCD_LDD_0,
64 GPIO59_LCD_LDD_1,
65 GPIO60_LCD_LDD_2,
66 GPIO61_LCD_LDD_3,
67 GPIO62_LCD_LDD_4,
68 GPIO63_LCD_LDD_5,
69 GPIO64_LCD_LDD_6,
70 GPIO65_LCD_LDD_7,
71 GPIO66_LCD_LDD_8,
72 GPIO67_LCD_LDD_9,
73 GPIO68_LCD_LDD_10,
74 GPIO69_LCD_LDD_11,
75 GPIO70_LCD_LDD_12,
76 GPIO71_LCD_LDD_13,
77 GPIO72_LCD_LDD_14,
78 GPIO73_LCD_LDD_15,
79 GPIO74_LCD_FCLK,
80 GPIO75_LCD_LCLK,
81 GPIO76_LCD_PCLK,
82 GPIO77_LCD_BIAS,
83 GPIO16_PWM0_OUT, /* Backlight */
84
85 /* MMC */
86 GPIO32_MMC_CLK,
87 GPIO112_MMC_CMD,
88 GPIO92_MMC_DAT_0,
89 GPIO109_MMC_DAT_1,
90 GPIO110_MMC_DAT_2,
91 GPIO111_MMC_DAT_3,
92
93 /* USB Host Port 1 */
94 GPIO88_USBH1_PWR,
95 GPIO89_USBH1_PEN,
96
97 /* PC Card */
98 GPIO48_nPOE,
99 GPIO49_nPWE,
100 GPIO50_nPIOR,
101 GPIO51_nPIOW,
102 GPIO85_nPCE_1,
103 GPIO54_nPCE_2,
104 GPIO79_PSKTSEL,
105 GPIO55_nPREG,
106 GPIO56_nPWAIT,
107 GPIO57_nIOIS16,
108
109 /* AC97 */
110 GPIO45_AC97_SYSCLK,
111
112 /* Keypad */
113 GPIO93_KP_DKIN_0 | WAKEUP_ON_LEVEL_HIGH,
114 GPIO94_KP_DKIN_1 | WAKEUP_ON_LEVEL_HIGH,
115 GPIO95_KP_DKIN_2 | WAKEUP_ON_LEVEL_HIGH,
116 GPIO100_KP_MKIN_0 | WAKEUP_ON_LEVEL_HIGH,
117 GPIO101_KP_MKIN_1 | WAKEUP_ON_LEVEL_HIGH,
118 GPIO102_KP_MKIN_2 | WAKEUP_ON_LEVEL_HIGH,
119 GPIO97_KP_MKIN_3 | WAKEUP_ON_LEVEL_HIGH,
120 GPIO98_KP_MKIN_4 | WAKEUP_ON_LEVEL_HIGH,
121 GPIO99_KP_MKIN_5 | WAKEUP_ON_LEVEL_HIGH,
122 GPIO103_KP_MKOUT_0,
123 GPIO104_KP_MKOUT_1,
124 GPIO105_KP_MKOUT_2,
125 GPIO106_KP_MKOUT_3,
126 GPIO107_KP_MKOUT_4,
127 GPIO108_KP_MKOUT_5,
128 GPIO96_KP_MKOUT_6,
129
130 /* GPIO */
131 GPIO1_GPIO | WAKEUP_ON_EDGE_BOTH,
132};
53 133
54static unsigned long mainstone_irq_enabled; 134static unsigned long mainstone_irq_enabled;
55 135
@@ -278,13 +358,13 @@ static int mainstone_backlight_update_status(struct backlight_device *bl)
278 bl->props.fb_blank != FB_BLANK_UNBLANK) 358 bl->props.fb_blank != FB_BLANK_UNBLANK)
279 brightness = 0; 359 brightness = 0;
280 360
281 if (brightness != 0) { 361 if (brightness != 0)
282 pxa_gpio_mode(GPIO16_PWM0_MD);
283 pxa_set_cken(CKEN_PWM0, 1); 362 pxa_set_cken(CKEN_PWM0, 1);
284 } 363
285 PWM_CTRL0 = 0; 364 PWM_CTRL0 = 0;
286 PWM_PWDUTY0 = brightness; 365 PWM_PWDUTY0 = brightness;
287 PWM_PERVAL0 = bl->props.max_brightness; 366 PWM_PERVAL0 = bl->props.max_brightness;
367
288 if (brightness == 0) 368 if (brightness == 0)
289 pxa_set_cken(CKEN_PWM0, 0); 369 pxa_set_cken(CKEN_PWM0, 0);
290 return 0; /* pointless return value */ 370 return 0; /* pointless return value */
@@ -362,16 +442,6 @@ static int mainstone_mci_init(struct device *dev, irq_handler_t mstone_detect_in
362{ 442{
363 int err; 443 int err;
364 444
365 /*
366 * setup GPIO for PXA27x MMC controller
367 */
368 pxa_gpio_mode(GPIO32_MMCCLK_MD);
369 pxa_gpio_mode(GPIO112_MMCCMD_MD);
370 pxa_gpio_mode(GPIO92_MMCDAT0_MD);
371 pxa_gpio_mode(GPIO109_MMCDAT1_MD);
372 pxa_gpio_mode(GPIO110_MMCDAT2_MD);
373 pxa_gpio_mode(GPIO111_MMCDAT3_MD);
374
375 /* make sure SD/Memory Stick multiplexer's signals 445 /* make sure SD/Memory Stick multiplexer's signals
376 * are routed to MMC controller 446 * are routed to MMC controller
377 */ 447 */
@@ -434,19 +504,39 @@ static struct pxaficp_platform_data mainstone_ficp_platform_data = {
434 .transceiver_mode = mainstone_irda_transceiver_mode, 504 .transceiver_mode = mainstone_irda_transceiver_mode,
435}; 505};
436 506
507static struct gpio_keys_button gpio_keys_button[] = {
508 [0] = {
509 .desc = "wakeup",
510 .code = KEY_SUSPEND,
511 .type = EV_KEY,
512 .gpio = 1,
513 .wakeup = 1,
514 },
515};
516
517static struct gpio_keys_platform_data mainstone_gpio_keys = {
518 .buttons = gpio_keys_button,
519 .nbuttons = 1,
520};
521
522static struct platform_device mst_gpio_keys_device = {
523 .name = "gpio-keys",
524 .id = -1,
525 .dev = {
526 .platform_data = &mainstone_gpio_keys,
527 },
528};
529
437static struct platform_device *platform_devices[] __initdata = { 530static struct platform_device *platform_devices[] __initdata = {
438 &smc91x_device, 531 &smc91x_device,
439 &mst_audio_device, 532 &mst_audio_device,
440 &mst_flash_device[0], 533 &mst_flash_device[0],
441 &mst_flash_device[1], 534 &mst_flash_device[1],
535 &mst_gpio_keys_device,
442}; 536};
443 537
444static int mainstone_ohci_init(struct device *dev) 538static int mainstone_ohci_init(struct device *dev)
445{ 539{
446 /* setup Port1 GPIO pin. */
447 pxa_gpio_mode( 88 | GPIO_ALT_FN_1_IN); /* USBHPWR1 */
448 pxa_gpio_mode( 89 | GPIO_ALT_FN_2_OUT); /* USBHPEN1 */
449
450 /* Set the Power Control Polarity Low and Power Sense 540 /* Set the Power Control Polarity Low and Power Sense
451 Polarity Low to active low. */ 541 Polarity Low to active low. */
452 UHCHR = (UHCHR | UHCHR_PCPL | UHCHR_PSPL) & 542 UHCHR = (UHCHR | UHCHR_PCPL | UHCHR_PSPL) &
@@ -460,10 +550,63 @@ static struct pxaohci_platform_data mainstone_ohci_platform_data = {
460 .init = mainstone_ohci_init, 550 .init = mainstone_ohci_init,
461}; 551};
462 552
553#if defined(CONFIG_KEYBOARD_PXA27x) || defined(CONFIG_KEYBOARD_PXA27x_MODULES)
554static unsigned int mainstone_matrix_keys[] = {
555 KEY(0, 0, KEY_A), KEY(1, 0, KEY_B), KEY(2, 0, KEY_C),
556 KEY(3, 0, KEY_D), KEY(4, 0, KEY_E), KEY(5, 0, KEY_F),
557 KEY(0, 1, KEY_G), KEY(1, 1, KEY_H), KEY(2, 1, KEY_I),
558 KEY(3, 1, KEY_J), KEY(4, 1, KEY_K), KEY(5, 1, KEY_L),
559 KEY(0, 2, KEY_M), KEY(1, 2, KEY_N), KEY(2, 2, KEY_O),
560 KEY(3, 2, KEY_P), KEY(4, 2, KEY_Q), KEY(5, 2, KEY_R),
561 KEY(0, 3, KEY_S), KEY(1, 3, KEY_T), KEY(2, 3, KEY_U),
562 KEY(3, 3, KEY_V), KEY(4, 3, KEY_W), KEY(5, 3, KEY_X),
563 KEY(2, 4, KEY_Y), KEY(3, 4, KEY_Z),
564
565 KEY(0, 4, KEY_DOT), /* . */
566 KEY(1, 4, KEY_CLOSE), /* @ */
567 KEY(4, 4, KEY_SLASH),
568 KEY(5, 4, KEY_BACKSLASH),
569 KEY(0, 5, KEY_HOME),
570 KEY(1, 5, KEY_LEFTSHIFT),
571 KEY(2, 5, KEY_SPACE),
572 KEY(3, 5, KEY_SPACE),
573 KEY(4, 5, KEY_ENTER),
574 KEY(5, 5, KEY_BACKSPACE),
575
576 KEY(0, 6, KEY_UP),
577 KEY(1, 6, KEY_DOWN),
578 KEY(2, 6, KEY_LEFT),
579 KEY(3, 6, KEY_RIGHT),
580 KEY(4, 6, KEY_SELECT),
581};
582
583struct pxa27x_keypad_platform_data mainstone_keypad_info = {
584 .matrix_key_rows = 6,
585 .matrix_key_cols = 7,
586 .matrix_key_map = mainstone_matrix_keys,
587 .matrix_key_map_size = ARRAY_SIZE(mainstone_matrix_keys),
588
589 .enable_rotary0 = 1,
590 .rotary0_up_key = KEY_UP,
591 .rotary0_down_key = KEY_DOWN,
592
593 .debounce_interval = 30,
594};
595
596static void __init mainstone_init_keypad(void)
597{
598 pxa_set_keypad_info(&mainstone_keypad_info);
599}
600#else
601static inline void mainstone_init_keypad(void) {}
602#endif
603
463static void __init mainstone_init(void) 604static void __init mainstone_init(void)
464{ 605{
465 int SW7 = 0; /* FIXME: get from SCR (Mst doc section 3.2.1.1) */ 606 int SW7 = 0; /* FIXME: get from SCR (Mst doc section 3.2.1.1) */
466 607
608 pxa2xx_mfp_config(ARRAY_AND_SIZE(mainstone_pin_config));
609
467 mst_flash_data[0].width = (BOOT_DEF & 1) ? 2 : 4; 610 mst_flash_data[0].width = (BOOT_DEF & 1) ? 2 : 4;
468 mst_flash_data[1].width = 4; 611 mst_flash_data[1].width = 4;
469 612
@@ -480,31 +623,6 @@ static void __init mainstone_init(void)
480 */ 623 */
481 ARB_CNTRL = ARB_CORE_PARK | 0x234; 624 ARB_CNTRL = ARB_CORE_PARK | 0x234;
482 625
483 /*
484 * On Mainstone, we route AC97_SYSCLK via GPIO45 to
485 * the audio daughter card
486 */
487 pxa_gpio_mode(GPIO45_SYSCLK_AC97_MD);
488
489 GPSR(GPIO48_nPOE) =
490 GPIO_bit(GPIO48_nPOE) |
491 GPIO_bit(GPIO49_nPWE) |
492 GPIO_bit(GPIO50_nPIOR) |
493 GPIO_bit(GPIO51_nPIOW) |
494 GPIO_bit(GPIO85_nPCE_1) |
495 GPIO_bit(GPIO54_nPCE_2);
496
497 pxa_gpio_mode(GPIO48_nPOE_MD);
498 pxa_gpio_mode(GPIO49_nPWE_MD);
499 pxa_gpio_mode(GPIO50_nPIOR_MD);
500 pxa_gpio_mode(GPIO51_nPIOW_MD);
501 pxa_gpio_mode(GPIO85_nPCE_1_MD);
502 pxa_gpio_mode(GPIO54_nPCE_2_MD);
503 pxa_gpio_mode(GPIO79_pSKTSEL_MD);
504 pxa_gpio_mode(GPIO55_nPREG_MD);
505 pxa_gpio_mode(GPIO56_nPWAIT_MD);
506 pxa_gpio_mode(GPIO57_nIOIS16_MD);
507
508 platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices)); 626 platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices));
509 627
510 /* reading Mainstone's "Virtual Configuration Register" 628 /* reading Mainstone's "Virtual Configuration Register"
@@ -520,6 +638,9 @@ static void __init mainstone_init(void)
520 pxa_set_mci_info(&mainstone_mci_platform_data); 638 pxa_set_mci_info(&mainstone_mci_platform_data);
521 pxa_set_ficp_info(&mainstone_ficp_platform_data); 639 pxa_set_ficp_info(&mainstone_ficp_platform_data);
522 pxa_set_ohci_info(&mainstone_ohci_platform_data); 640 pxa_set_ohci_info(&mainstone_ohci_platform_data);
641 pxa_set_i2c_info(NULL);
642
643 mainstone_init_keypad();
523} 644}
524 645
525 646
@@ -537,23 +658,9 @@ static void __init mainstone_map_io(void)
537 pxa_map_io(); 658 pxa_map_io();
538 iotable_init(mainstone_io_desc, ARRAY_SIZE(mainstone_io_desc)); 659 iotable_init(mainstone_io_desc, ARRAY_SIZE(mainstone_io_desc));
539 660
540 /* initialize sleep mode regs (wake-up sources, etc) */
541 PGSR0 = 0x00008800;
542 PGSR1 = 0x00000002;
543 PGSR2 = 0x0001FC00;
544 PGSR3 = 0x00001F81;
545 PWER = 0xC0000002;
546 PRER = 0x00000002;
547 PFER = 0x00000002;
548 /* for use I SRAM as framebuffer. */ 661 /* for use I SRAM as framebuffer. */
549 PSLR |= 0xF04; 662 PSLR |= 0xF04;
550 PCFR = 0x66; 663 PCFR = 0x66;
551 /* For Keypad wakeup. */
552 KPC &=~KPC_ASACT;
553 KPC |=KPC_AS;
554 PKWR = 0x000FD000;
555 /* Need read PKWR back after set it. */
556 PKWR;
557} 664}
558 665
559MACHINE_START(MAINSTONE, "Intel HCDDBBVA0 Development Platform (aka Mainstone)") 666MACHINE_START(MAINSTONE, "Intel HCDDBBVA0 Development Platform (aka Mainstone)")
diff --git a/arch/arm/mach-pxa/mfp-pxa2xx.c b/arch/arm/mach-pxa/mfp-pxa2xx.c
new file mode 100644
index 000000000000..22097a1707cc
--- /dev/null
+++ b/arch/arm/mach-pxa/mfp-pxa2xx.c
@@ -0,0 +1,245 @@
1/*
2 * linux/arch/arm/mach-pxa/mfp-pxa2xx.c
3 *
4 * PXA2xx pin mux configuration support
5 *
6 * The GPIOs on PXA2xx can be configured as one of many alternate
7 * functions, this is by concept samilar to the MFP configuration
8 * on PXA3xx, what's more important, the low power pin state and
9 * wakeup detection are also supported by the same framework.
10 *
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License version 2 as
13 * published by the Free Software Foundation.
14 */
15
16#include <linux/module.h>
17#include <linux/kernel.h>
18#include <linux/init.h>
19#include <linux/sysdev.h>
20
21#include <asm/arch/hardware.h>
22#include <asm/arch/pxa-regs.h>
23#include <asm/arch/mfp-pxa2xx.h>
24
25#include "generic.h"
26
27#define PGSR(x) __REG2(0x40F00020, ((x) & 0x60) >> 3)
28
29#define PWER_WE35 (1 << 24)
30
31struct gpio_desc {
32 unsigned valid : 1;
33 unsigned can_wakeup : 1;
34 unsigned keypad_gpio : 1;
35 unsigned int mask; /* bit mask in PWER or PKWR */
36 unsigned long config;
37};
38
39static struct gpio_desc gpio_desc[MFP_PIN_GPIO127 + 1];
40
41static int __mfp_config_gpio(unsigned gpio, unsigned long c)
42{
43 unsigned long gafr, mask = GPIO_bit(gpio);
44 int fn;
45
46 fn = MFP_AF(c);
47 if (fn > 3)
48 return -EINVAL;
49
50 /* alternate function and direction */
51 gafr = GAFR(gpio) & ~(0x3 << ((gpio & 0xf) * 2));
52 GAFR(gpio) = gafr | (fn << ((gpio & 0xf) * 2));
53
54 if (c & MFP_DIR_OUT)
55 GPDR(gpio) |= mask;
56 else
57 GPDR(gpio) &= ~mask;
58
59 /* low power state */
60 switch (c & MFP_LPM_STATE_MASK) {
61 case MFP_LPM_DRIVE_HIGH:
62 PGSR(gpio) |= mask;
63 break;
64 case MFP_LPM_DRIVE_LOW:
65 PGSR(gpio) &= ~mask;
66 break;
67 case MFP_LPM_INPUT:
68 break;
69 default:
70 pr_warning("%s: invalid low power state for GPIO%d\n",
71 __func__, gpio);
72 return -EINVAL;
73 }
74
75 /* give early warning if MFP_LPM_CAN_WAKEUP is set on the
76 * configurations of those pins not able to wakeup
77 */
78 if ((c & MFP_LPM_CAN_WAKEUP) && !gpio_desc[gpio].can_wakeup) {
79 pr_warning("%s: GPIO%d unable to wakeup\n",
80 __func__, gpio);
81 return -EINVAL;
82 }
83
84 if ((c & MFP_LPM_CAN_WAKEUP) && (c & MFP_DIR_OUT)) {
85 pr_warning("%s: output GPIO%d unable to wakeup\n",
86 __func__, gpio);
87 return -EINVAL;
88 }
89
90 return 0;
91}
92
93void pxa2xx_mfp_config(unsigned long *mfp_cfgs, int num)
94{
95 unsigned long flags;
96 unsigned long *c;
97 int i, gpio;
98
99 for (i = 0, c = mfp_cfgs; i < num; i++, c++) {
100
101 gpio = mfp_to_gpio(MFP_PIN(*c));
102
103 if (!gpio_desc[gpio].valid) {
104 pr_warning("%s: GPIO%d is invalid pin\n",
105 __func__, gpio);
106 continue;
107 }
108
109 local_irq_save(flags);
110
111 gpio_desc[gpio].config = *c;
112 __mfp_config_gpio(gpio, *c);
113
114 local_irq_restore(flags);
115 }
116}
117
118int gpio_set_wake(unsigned int gpio, unsigned int on)
119{
120 struct gpio_desc *d;
121 unsigned long c;
122
123 if (gpio > mfp_to_gpio(MFP_PIN_GPIO127))
124 return -EINVAL;
125
126 d = &gpio_desc[gpio];
127 c = d->config;
128
129 if (!d->valid)
130 return -EINVAL;
131
132 if (d->keypad_gpio)
133 return -EINVAL;
134
135 if (d->can_wakeup && (c & MFP_LPM_CAN_WAKEUP)) {
136 if (on) {
137 PWER |= d->mask;
138
139 if (c & MFP_LPM_EDGE_RISE)
140 PRER |= d->mask;
141 else
142 PRER &= ~d->mask;
143
144 if (c & MFP_LPM_EDGE_FALL)
145 PFER |= d->mask;
146 else
147 PFER &= ~d->mask;
148 } else {
149 PWER &= ~d->mask;
150 PRER &= ~d->mask;
151 PFER &= ~d->mask;
152 }
153 }
154 return 0;
155}
156
157#ifdef CONFIG_PXA25x
158static int __init pxa25x_mfp_init(void)
159{
160 int i;
161
162 if (cpu_is_pxa25x()) {
163 for (i = 0; i <= 84; i++)
164 gpio_desc[i].valid = 1;
165
166 for (i = 0; i <= 15; i++) {
167 gpio_desc[i].can_wakeup = 1;
168 gpio_desc[i].mask = GPIO_bit(i);
169 }
170 }
171
172 return 0;
173}
174postcore_initcall(pxa25x_mfp_init);
175#endif /* CONFIG_PXA25x */
176
177#ifdef CONFIG_PXA27x
178static int pxa27x_pkwr_gpio[] = {
179 13, 16, 17, 34, 36, 37, 38, 39, 90, 91, 93, 94,
180 95, 96, 97, 98, 99, 100, 101, 102
181};
182
183int keypad_set_wake(unsigned int on)
184{
185 unsigned int i, gpio, mask = 0;
186
187 if (!on) {
188 PKWR = 0;
189 return 0;
190 }
191
192 for (i = 0; i < ARRAY_SIZE(pxa27x_pkwr_gpio); i++) {
193
194 gpio = pxa27x_pkwr_gpio[i];
195
196 if (gpio_desc[gpio].config & MFP_LPM_CAN_WAKEUP)
197 mask |= gpio_desc[gpio].mask;
198 }
199
200 PKWR = mask;
201 return 0;
202}
203
204static int __init pxa27x_mfp_init(void)
205{
206 int i, gpio;
207
208 if (cpu_is_pxa27x()) {
209 for (i = 0; i <= 120; i++) {
210 /* skip GPIO2, 5, 6, 7, 8, they are not
211 * valid pins allow configuration
212 */
213 if (i == 2 || i == 5 || i == 6 ||
214 i == 7 || i == 8)
215 continue;
216
217 gpio_desc[i].valid = 1;
218 }
219
220 /* Keypad GPIOs */
221 for (i = 0; i < ARRAY_SIZE(pxa27x_pkwr_gpio); i++) {
222 gpio = pxa27x_pkwr_gpio[i];
223 gpio_desc[gpio].can_wakeup = 1;
224 gpio_desc[gpio].keypad_gpio = 1;
225 gpio_desc[gpio].mask = 1 << i;
226 }
227
228 /* Overwrite GPIO13 as a PWER wakeup source */
229 for (i = 0; i <= 15; i++) {
230 /* skip GPIO2, 5, 6, 7, 8 */
231 if (GPIO_bit(i) & 0x1e4)
232 continue;
233
234 gpio_desc[i].can_wakeup = 1;
235 gpio_desc[i].mask = GPIO_bit(i);
236 }
237
238 gpio_desc[35].can_wakeup = 1;
239 gpio_desc[35].mask = PWER_WE35;
240 }
241
242 return 0;
243}
244postcore_initcall(pxa27x_mfp_init);
245#endif /* CONFIG_PXA27x */
diff --git a/arch/arm/mach-pxa/mfp.c b/arch/arm/mach-pxa/mfp-pxa3xx.c
index f5809adce298..b84c3ba7a8d6 100644
--- a/arch/arm/mach-pxa/mfp.c
+++ b/arch/arm/mach-pxa/mfp-pxa3xx.c
@@ -234,22 +234,22 @@ static int pxa3xx_mfp_resume(struct sys_device *d)
234 234
235 return 0; 235 return 0;
236} 236}
237#else
238#define pxa3xx_mfp_suspend NULL
239#define pxa3xx_mfp_resume NULL
240#endif
237 241
238static struct sysdev_class mfp_sysclass = { 242struct sysdev_class pxa3xx_mfp_sysclass = {
239 .name = "mfp", 243 .name = "mfp",
240 .suspend = pxa3xx_mfp_suspend, 244 .suspend = pxa3xx_mfp_suspend,
241 .resume = pxa3xx_mfp_resume, 245 .resume = pxa3xx_mfp_resume,
242}; 246};
243 247
244static struct sys_device mfp_device = {
245 .id = 0,
246 .cls = &mfp_sysclass,
247};
248
249static int __init mfp_init_devicefs(void) 248static int __init mfp_init_devicefs(void)
250{ 249{
251 sysdev_class_register(&mfp_sysclass); 250 if (cpu_is_pxa3xx())
252 return sysdev_register(&mfp_device); 251 return sysdev_class_register(&pxa3xx_mfp_sysclass);
252
253 return 0;
253} 254}
254device_initcall(mfp_init_devicefs); 255postcore_initcall(mfp_init_devicefs);
255#endif
diff --git a/arch/arm/mach-pxa/pcm027.c b/arch/arm/mach-pxa/pcm027.c
index c14696b9979d..3b945eb0aee3 100644
--- a/arch/arm/mach-pxa/pcm027.c
+++ b/arch/arm/mach-pxa/pcm027.c
@@ -29,6 +29,7 @@
29#include <asm/mach/arch.h> 29#include <asm/mach/arch.h>
30#include <asm/arch/hardware.h> 30#include <asm/arch/hardware.h>
31#include <asm/arch/pxa-regs.h> 31#include <asm/arch/pxa-regs.h>
32#include <asm/arch/pxa2xx-gpio.h>
32#include <asm/arch/pxa2xx-regs.h> 33#include <asm/arch/pxa2xx-regs.h>
33#include <asm/arch/pxa2xx_spi.h> 34#include <asm/arch/pxa2xx_spi.h>
34#include <asm/arch/pcm027.h> 35#include <asm/arch/pcm027.h>
diff --git a/arch/arm/mach-pxa/pcm990-baseboard.c b/arch/arm/mach-pxa/pcm990-baseboard.c
index 3dda16a20049..e6be9d0aeccf 100644
--- a/arch/arm/mach-pxa/pcm990-baseboard.c
+++ b/arch/arm/mach-pxa/pcm990-baseboard.c
@@ -23,8 +23,16 @@
23#include <linux/irq.h> 23#include <linux/irq.h>
24#include <linux/platform_device.h> 24#include <linux/platform_device.h>
25#include <linux/ide.h> 25#include <linux/ide.h>
26#include <linux/i2c.h>
27
28#include <media/soc_camera.h>
29
30#include <asm/gpio.h>
31#include <asm/arch/i2c.h>
32#include <asm/arch/camera.h>
26#include <asm/mach/map.h> 33#include <asm/mach/map.h>
27#include <asm/arch/pxa-regs.h> 34#include <asm/arch/pxa-regs.h>
35#include <asm/arch/pxa2xx-gpio.h>
28#include <asm/arch/mmc.h> 36#include <asm/arch/mmc.h>
29#include <asm/arch/ohci.h> 37#include <asm/arch/ohci.h>
30#include <asm/arch/pcm990_baseboard.h> 38#include <asm/arch/pcm990_baseboard.h>
@@ -258,6 +266,76 @@ static struct pxaohci_platform_data pcm990_ohci_platform_data = {
258}; 266};
259 267
260/* 268/*
269 * PXA27x Camera specific stuff
270 */
271#if defined(CONFIG_VIDEO_PXA27x) || defined(CONFIG_VIDEO_PXA27x_MODULE)
272static int pcm990_pxacamera_init(struct device *dev)
273{
274 pxa_gpio_mode(GPIO98_CIF_DD_0_MD);
275 pxa_gpio_mode(GPIO105_CIF_DD_1_MD);
276 pxa_gpio_mode(GPIO104_CIF_DD_2_MD);
277 pxa_gpio_mode(GPIO103_CIF_DD_3_MD);
278 pxa_gpio_mode(GPIO95_CIF_DD_4_MD);
279 pxa_gpio_mode(GPIO94_CIF_DD_5_MD);
280 pxa_gpio_mode(GPIO93_CIF_DD_6_MD);
281 pxa_gpio_mode(GPIO108_CIF_DD_7_MD);
282 pxa_gpio_mode(GPIO107_CIF_DD_8_MD);
283 pxa_gpio_mode(GPIO106_CIF_DD_9_MD);
284 pxa_gpio_mode(GPIO42_CIF_MCLK_MD);
285 pxa_gpio_mode(GPIO45_CIF_PCLK_MD);
286 pxa_gpio_mode(GPIO43_CIF_FV_MD);
287 pxa_gpio_mode(GPIO44_CIF_LV_MD);
288
289 return 0;
290}
291
292/*
293 * CICR4: PCLK_EN: Pixel clock is supplied by the sensor
294 * MCLK_EN: Master clock is generated by PXA
295 * PCP: Data sampled on the falling edge of pixel clock
296 */
297struct pxacamera_platform_data pcm990_pxacamera_platform_data = {
298 .init = pcm990_pxacamera_init,
299 .flags = PXA_CAMERA_MASTER | PXA_CAMERA_DATAWIDTH_8 | PXA_CAMERA_DATAWIDTH_10 |
300 PXA_CAMERA_PCLK_EN | PXA_CAMERA_MCLK_EN/* | PXA_CAMERA_PCP*/,
301 .mclk_10khz = 1000,
302};
303
304#include <linux/i2c/pca953x.h>
305
306static struct pca953x_platform_data pca9536_data = {
307 .gpio_base = NR_BUILTIN_GPIO + 1,
308};
309
310static struct soc_camera_link iclink[] = {
311 {
312 .bus_id = 0, /* Must match with the camera ID above */
313 .gpio = NR_BUILTIN_GPIO + 1,
314 }, {
315 .bus_id = 0, /* Must match with the camera ID above */
316 }
317};
318
319/* Board I2C devices. */
320static struct i2c_board_info __initdata pcm990_i2c_devices[] = {
321 {
322 /* Must initialize before the camera(s) */
323 I2C_BOARD_INFO("pca953x", 0x41),
324 .type = "pca9536",
325 .platform_data = &pca9536_data,
326 }, {
327 I2C_BOARD_INFO("mt9v022", 0x48),
328 .type = "mt9v022",
329 .platform_data = &iclink[0], /* With extender */
330 }, {
331 I2C_BOARD_INFO("mt9m001", 0x5d),
332 .type = "mt9m001",
333 .platform_data = &iclink[0], /* With extender */
334 },
335};
336#endif /* CONFIG_VIDEO_PXA27x ||CONFIG_VIDEO_PXA27x_MODULE */
337
338/*
261 * AC97 support 339 * AC97 support
262 * Note: The connected AC97 mixer also reports interrupts at PCM990_AC97_IRQ 340 * Note: The connected AC97 mixer also reports interrupts at PCM990_AC97_IRQ
263 */ 341 */
@@ -326,5 +404,14 @@ void __init pcm990_baseboard_init(void)
326 /* USB host */ 404 /* USB host */
327 pxa_set_ohci_info(&pcm990_ohci_platform_data); 405 pxa_set_ohci_info(&pcm990_ohci_platform_data);
328 406
407 pxa_set_i2c_info(NULL);
408
409#if defined(CONFIG_VIDEO_PXA27x) || defined(CONFIG_VIDEO_PXA27x_MODULE)
410 pxa_set_camera_info(&pcm990_pxacamera_platform_data);
411
412 i2c_register_board_info(0, pcm990_i2c_devices,
413 ARRAY_SIZE(pcm990_i2c_devices));
414#endif
415
329 printk(KERN_INFO"PCM-990 Evaluation baseboard initialized\n"); 416 printk(KERN_INFO"PCM-990 Evaluation baseboard initialized\n");
330} 417}
diff --git a/arch/arm/mach-pxa/poodle.c b/arch/arm/mach-pxa/poodle.c
index 209eabf0ed3e..ca5ac196b47b 100644
--- a/arch/arm/mach-pxa/poodle.c
+++ b/arch/arm/mach-pxa/poodle.c
@@ -32,6 +32,7 @@
32#include <asm/mach/irq.h> 32#include <asm/mach/irq.h>
33 33
34#include <asm/arch/pxa-regs.h> 34#include <asm/arch/pxa-regs.h>
35#include <asm/arch/pxa2xx-gpio.h>
35#include <asm/arch/mmc.h> 36#include <asm/arch/mmc.h>
36#include <asm/arch/udc.h> 37#include <asm/arch/udc.h>
37#include <asm/arch/irda.h> 38#include <asm/arch/irda.h>
diff --git a/arch/arm/mach-pxa/pxa25x.c b/arch/arm/mach-pxa/pxa25x.c
index 599e53fcc2c5..d9b5450aee5b 100644
--- a/arch/arm/mach-pxa/pxa25x.c
+++ b/arch/arm/mach-pxa/pxa25x.c
@@ -26,6 +26,7 @@
26#include <asm/hardware.h> 26#include <asm/hardware.h>
27#include <asm/arch/irqs.h> 27#include <asm/arch/irqs.h>
28#include <asm/arch/pxa-regs.h> 28#include <asm/arch/pxa-regs.h>
29#include <asm/arch/mfp-pxa25x.h>
29#include <asm/arch/pm.h> 30#include <asm/arch/pm.h>
30#include <asm/arch/dma.h> 31#include <asm/arch/dma.h>
31 32
@@ -129,6 +130,8 @@ static struct clk pxa25x_clks[] = {
129 INIT_CKEN("SSPCLK", NSSP, 3686400, 0, &pxa25x_device_nssp.dev), 130 INIT_CKEN("SSPCLK", NSSP, 3686400, 0, &pxa25x_device_nssp.dev),
130 INIT_CKEN("SSPCLK", ASSP, 3686400, 0, &pxa25x_device_assp.dev), 131 INIT_CKEN("SSPCLK", ASSP, 3686400, 0, &pxa25x_device_assp.dev),
131 132
133 INIT_CKEN("AC97CLK", AC97, 24576000, 0, NULL),
134
132 /* 135 /*
133 INIT_CKEN("PWMCLK", PWM0, 3686400, 0, NULL), 136 INIT_CKEN("PWMCLK", PWM0, 3686400, 0, NULL),
134 INIT_CKEN("PWMCLK", PWM0, 3686400, 0, NULL), 137 INIT_CKEN("PWMCLK", PWM0, 3686400, 0, NULL),
@@ -228,24 +231,10 @@ static inline void pxa25x_init_pm(void) {}
228static int pxa25x_set_wake(unsigned int irq, unsigned int on) 231static int pxa25x_set_wake(unsigned int irq, unsigned int on)
229{ 232{
230 int gpio = IRQ_TO_GPIO(irq); 233 int gpio = IRQ_TO_GPIO(irq);
231 uint32_t gpio_bit, mask = 0; 234 uint32_t mask = 0;
232 235
233 if (gpio >= 0 && gpio <= 15) { 236 if (gpio >= 0 && gpio < 85)
234 gpio_bit = GPIO_bit(gpio); 237 return gpio_set_wake(gpio, on);
235 mask = gpio_bit;
236 if (on) {
237 if (GRER(gpio) | gpio_bit)
238 PRER |= gpio_bit;
239 else
240 PRER &= ~gpio_bit;
241
242 if (GFER(gpio) | gpio_bit)
243 PFER |= gpio_bit;
244 else
245 PFER &= ~gpio_bit;
246 }
247 goto set_pwer;
248 }
249 238
250 if (irq == IRQ_RTCAlrm) { 239 if (irq == IRQ_RTCAlrm) {
251 mask = PWER_RTC; 240 mask = PWER_RTC;
@@ -265,9 +254,8 @@ set_pwer:
265 254
266void __init pxa25x_init_irq(void) 255void __init pxa25x_init_irq(void)
267{ 256{
268 pxa_init_irq_low(); 257 pxa_init_irq(32, pxa25x_set_wake);
269 pxa_init_irq_gpio(85); 258 pxa_init_gpio(85, pxa25x_set_wake);
270 pxa_init_irq_set_wake(pxa25x_set_wake);
271} 259}
272 260
273static struct platform_device *pxa25x_devices[] __initdata = { 261static struct platform_device *pxa25x_devices[] __initdata = {
@@ -325,4 +313,4 @@ static int __init pxa25x_init(void)
325 return ret; 313 return ret;
326} 314}
327 315
328subsys_initcall(pxa25x_init); 316postcore_initcall(pxa25x_init);
diff --git a/arch/arm/mach-pxa/pxa27x.c b/arch/arm/mach-pxa/pxa27x.c
index 46a951c3e5a0..7a2449dd0fd4 100644
--- a/arch/arm/mach-pxa/pxa27x.c
+++ b/arch/arm/mach-pxa/pxa27x.c
@@ -23,6 +23,7 @@
23#include <asm/arch/irqs.h> 23#include <asm/arch/irqs.h>
24#include <asm/arch/pxa-regs.h> 24#include <asm/arch/pxa-regs.h>
25#include <asm/arch/pxa2xx-regs.h> 25#include <asm/arch/pxa2xx-regs.h>
26#include <asm/arch/mfp-pxa27x.h>
26#include <asm/arch/ohci.h> 27#include <asm/arch/ohci.h>
27#include <asm/arch/pm.h> 28#include <asm/arch/pm.h>
28#include <asm/arch/dma.h> 29#include <asm/arch/dma.h>
@@ -151,12 +152,15 @@ static struct clk pxa27x_clks[] = {
151 152
152 INIT_CKEN("USBCLK", USBHOST, 48000000, 0, &pxa27x_device_ohci.dev), 153 INIT_CKEN("USBCLK", USBHOST, 48000000, 0, &pxa27x_device_ohci.dev),
153 INIT_CKEN("I2CCLK", PWRI2C, 13000000, 0, &pxa27x_device_i2c_power.dev), 154 INIT_CKEN("I2CCLK", PWRI2C, 13000000, 0, &pxa27x_device_i2c_power.dev),
154 INIT_CKEN("KBDCLK", KEYPAD, 32768, 0, NULL), 155 INIT_CKEN("KBDCLK", KEYPAD, 32768, 0, &pxa27x_device_keypad.dev),
155 156
156 INIT_CKEN("SSPCLK", SSP1, 13000000, 0, &pxa27x_device_ssp1.dev), 157 INIT_CKEN("SSPCLK", SSP1, 13000000, 0, &pxa27x_device_ssp1.dev),
157 INIT_CKEN("SSPCLK", SSP2, 13000000, 0, &pxa27x_device_ssp2.dev), 158 INIT_CKEN("SSPCLK", SSP2, 13000000, 0, &pxa27x_device_ssp2.dev),
158 INIT_CKEN("SSPCLK", SSP3, 13000000, 0, &pxa27x_device_ssp3.dev), 159 INIT_CKEN("SSPCLK", SSP3, 13000000, 0, &pxa27x_device_ssp3.dev),
159 160
161 INIT_CKEN("AC97CLK", AC97, 24576000, 0, NULL),
162 INIT_CKEN("AC97CONFCLK", AC97CONF, 24576000, 0, NULL),
163
160 /* 164 /*
161 INIT_CKEN("PWMCLK", PWM0, 13000000, 0, NULL), 165 INIT_CKEN("PWMCLK", PWM0, 13000000, 0, NULL),
162 INIT_CKEN("MSLCLK", MSL, 48000000, 0, NULL), 166 INIT_CKEN("MSLCLK", MSL, 48000000, 0, NULL),
@@ -283,37 +287,16 @@ static inline void pxa27x_init_pm(void) {}
283/* PXA27x: Various gpios can issue wakeup events. This logic only 287/* PXA27x: Various gpios can issue wakeup events. This logic only
284 * handles the simple cases, not the WEMUX2 and WEMUX3 options 288 * handles the simple cases, not the WEMUX2 and WEMUX3 options
285 */ 289 */
286#define PXA27x_GPIO_NOWAKE_MASK \
287 ((1 << 8) | (1 << 7) | (1 << 6) | (1 << 5) | (1 << 2))
288#define WAKEMASK(gpio) \
289 (((gpio) <= 15) \
290 ? ((1 << (gpio)) & ~PXA27x_GPIO_NOWAKE_MASK) \
291 : ((gpio == 35) ? (1 << 24) : 0))
292
293static int pxa27x_set_wake(unsigned int irq, unsigned int on) 290static int pxa27x_set_wake(unsigned int irq, unsigned int on)
294{ 291{
295 int gpio = IRQ_TO_GPIO(irq); 292 int gpio = IRQ_TO_GPIO(irq);
296 uint32_t mask; 293 uint32_t mask;
297 294
298 if ((gpio >= 0 && gpio <= 15) || (gpio == 35)) { 295 if (gpio >= 0 && gpio < 128)
299 if (WAKEMASK(gpio) == 0) 296 return gpio_set_wake(gpio, on);
300 return -EINVAL;
301
302 mask = WAKEMASK(gpio);
303
304 if (on) {
305 if (GRER(gpio) | GPIO_bit(gpio))
306 PRER |= mask;
307 else
308 PRER &= ~mask;
309 297
310 if (GFER(gpio) | GPIO_bit(gpio)) 298 if (irq == IRQ_KEYPAD)
311 PFER |= mask; 299 return keypad_set_wake(on);
312 else
313 PFER &= ~mask;
314 }
315 goto set_pwer;
316 }
317 300
318 switch (irq) { 301 switch (irq) {
319 case IRQ_RTCAlrm: 302 case IRQ_RTCAlrm:
@@ -326,7 +309,6 @@ static int pxa27x_set_wake(unsigned int irq, unsigned int on)
326 return -EINVAL; 309 return -EINVAL;
327 } 310 }
328 311
329set_pwer:
330 if (on) 312 if (on)
331 PWER |= mask; 313 PWER |= mask;
332 else 314 else
@@ -337,10 +319,8 @@ set_pwer:
337 319
338void __init pxa27x_init_irq(void) 320void __init pxa27x_init_irq(void)
339{ 321{
340 pxa_init_irq_low(); 322 pxa_init_irq(34, pxa27x_set_wake);
341 pxa_init_irq_high(); 323 pxa_init_gpio(128, pxa27x_set_wake);
342 pxa_init_irq_gpio(128);
343 pxa_init_irq_set_wake(pxa27x_set_wake);
344} 324}
345 325
346/* 326/*
@@ -386,10 +366,6 @@ static struct platform_device *devices[] __initdata = {
386 366
387static struct sys_device pxa27x_sysdev[] = { 367static struct sys_device pxa27x_sysdev[] = {
388 { 368 {
389 .id = 0,
390 .cls = &pxa_irq_sysclass,
391 }, {
392 .id = 1,
393 .cls = &pxa_irq_sysclass, 369 .cls = &pxa_irq_sysclass,
394 }, { 370 }, {
395 .cls = &pxa_gpio_sysclass, 371 .cls = &pxa_gpio_sysclass,
@@ -420,4 +396,4 @@ static int __init pxa27x_init(void)
420 return ret; 396 return ret;
421} 397}
422 398
423subsys_initcall(pxa27x_init); 399postcore_initcall(pxa27x_init);
diff --git a/arch/arm/mach-pxa/pxa3xx.c b/arch/arm/mach-pxa/pxa3xx.c
index 35f25fdaeba3..dde355e88fa1 100644
--- a/arch/arm/mach-pxa/pxa3xx.c
+++ b/arch/arm/mach-pxa/pxa3xx.c
@@ -110,6 +110,25 @@ unsigned int pxa3xx_get_memclk_frequency_10khz(void)
110} 110}
111 111
112/* 112/*
113 * Return the current AC97 clock frequency.
114 */
115static unsigned long clk_pxa3xx_ac97_getrate(struct clk *clk)
116{
117 unsigned long rate = 312000000;
118 unsigned long ac97_div;
119
120 ac97_div = AC97_DIV;
121
122 /* This may loose precision for some rates but won't for the
123 * standard 24.576MHz.
124 */
125 rate /= (ac97_div >> 12) & 0x7fff;
126 rate *= (ac97_div & 0xfff);
127
128 return rate;
129}
130
131/*
113 * Return the current HSIO bus clock frequency 132 * Return the current HSIO bus clock frequency
114 */ 133 */
115static unsigned long clk_pxa3xx_hsio_getrate(struct clk *clk) 134static unsigned long clk_pxa3xx_hsio_getrate(struct clk *clk)
@@ -156,6 +175,27 @@ static const struct clkops clk_pxa3xx_hsio_ops = {
156 .getrate = clk_pxa3xx_hsio_getrate, 175 .getrate = clk_pxa3xx_hsio_getrate,
157}; 176};
158 177
178static const struct clkops clk_pxa3xx_ac97_ops = {
179 .enable = clk_pxa3xx_cken_enable,
180 .disable = clk_pxa3xx_cken_disable,
181 .getrate = clk_pxa3xx_ac97_getrate,
182};
183
184static void clk_pout_enable(struct clk *clk)
185{
186 OSCC |= OSCC_PEN;
187}
188
189static void clk_pout_disable(struct clk *clk)
190{
191 OSCC &= ~OSCC_PEN;
192}
193
194static const struct clkops clk_pout_ops = {
195 .enable = clk_pout_enable,
196 .disable = clk_pout_disable,
197};
198
159#define PXA3xx_CKEN(_name, _cken, _rate, _delay, _dev) \ 199#define PXA3xx_CKEN(_name, _cken, _rate, _delay, _dev) \
160 { \ 200 { \
161 .name = _name, \ 201 .name = _name, \
@@ -175,8 +215,16 @@ static const struct clkops clk_pxa3xx_hsio_ops = {
175 } 215 }
176 216
177static struct clk pxa3xx_clks[] = { 217static struct clk pxa3xx_clks[] = {
178 PXA3xx_CK("LCDCLK", LCD, &clk_pxa3xx_hsio_ops, &pxa_device_fb.dev), 218 {
179 PXA3xx_CK("CAMCLK", CAMERA, &clk_pxa3xx_hsio_ops, NULL), 219 .name = "CLK_POUT",
220 .ops = &clk_pout_ops,
221 .rate = 13000000,
222 .delay = 70,
223 },
224
225 PXA3xx_CK("LCDCLK", LCD, &clk_pxa3xx_hsio_ops, &pxa_device_fb.dev),
226 PXA3xx_CK("CAMCLK", CAMERA, &clk_pxa3xx_hsio_ops, NULL),
227 PXA3xx_CK("AC97CLK", AC97, &clk_pxa3xx_ac97_ops, NULL),
180 228
181 PXA3xx_CKEN("UARTCLK", FFUART, 14857000, 1, &pxa_device_ffuart.dev), 229 PXA3xx_CKEN("UARTCLK", FFUART, 14857000, 1, &pxa_device_ffuart.dev),
182 PXA3xx_CKEN("UARTCLK", BTUART, 14857000, 1, &pxa_device_btuart.dev), 230 PXA3xx_CKEN("UARTCLK", BTUART, 14857000, 1, &pxa_device_btuart.dev),
@@ -185,6 +233,7 @@ static struct clk pxa3xx_clks[] = {
185 PXA3xx_CKEN("I2CCLK", I2C, 32842000, 0, &pxa_device_i2c.dev), 233 PXA3xx_CKEN("I2CCLK", I2C, 32842000, 0, &pxa_device_i2c.dev),
186 PXA3xx_CKEN("UDCCLK", UDC, 48000000, 5, &pxa_device_udc.dev), 234 PXA3xx_CKEN("UDCCLK", UDC, 48000000, 5, &pxa_device_udc.dev),
187 PXA3xx_CKEN("USBCLK", USBH, 48000000, 0, &pxa27x_device_ohci.dev), 235 PXA3xx_CKEN("USBCLK", USBH, 48000000, 0, &pxa27x_device_ohci.dev),
236 PXA3xx_CKEN("KBDCLK", KEYPAD, 32768, 0, &pxa27x_device_keypad.dev),
188 237
189 PXA3xx_CKEN("SSPCLK", SSP1, 13000000, 0, &pxa27x_device_ssp1.dev), 238 PXA3xx_CKEN("SSPCLK", SSP1, 13000000, 0, &pxa27x_device_ssp1.dev),
190 PXA3xx_CKEN("SSPCLK", SSP2, 13000000, 0, &pxa27x_device_ssp2.dev), 239 PXA3xx_CKEN("SSPCLK", SSP2, 13000000, 0, &pxa27x_device_ssp2.dev),
@@ -305,8 +354,10 @@ static void pxa3xx_cpu_pm_enter(suspend_state_t state)
305 /* 354 /*
306 * Don't sleep if no wakeup sources are defined 355 * Don't sleep if no wakeup sources are defined
307 */ 356 */
308 if (wakeup_src == 0) 357 if (wakeup_src == 0) {
358 printk(KERN_ERR "Not suspending: no wakeup sources\n");
309 return; 359 return;
360 }
310 361
311 switch (state) { 362 switch (state) {
312 case PM_SUSPEND_STANDBY: 363 case PM_SUSPEND_STANDBY:
@@ -446,15 +497,9 @@ static int pxa3xx_set_wake(unsigned int irq, unsigned int on)
446 497
447 return 0; 498 return 0;
448} 499}
449
450static void pxa3xx_init_irq_pm(void)
451{
452 pxa_init_irq_set_wake(pxa3xx_set_wake);
453}
454
455#else 500#else
456static inline void pxa3xx_init_pm(void) {} 501static inline void pxa3xx_init_pm(void) {}
457static inline void pxa3xx_init_irq_pm(void) {} 502#define pxa3xx_set_wake NULL
458#endif 503#endif
459 504
460void __init pxa3xx_init_irq(void) 505void __init pxa3xx_init_irq(void)
@@ -465,10 +510,8 @@ void __init pxa3xx_init_irq(void)
465 value |= (1 << 6); 510 value |= (1 << 6);
466 __asm__ __volatile__("mcr p15, 0, %0, c15, c1, 0\n": :"r"(value)); 511 __asm__ __volatile__("mcr p15, 0, %0, c15, c1, 0\n": :"r"(value));
467 512
468 pxa_init_irq_low(); 513 pxa_init_irq(56, pxa3xx_set_wake);
469 pxa_init_irq_high(); 514 pxa_init_gpio(128, NULL);
470 pxa_init_irq_gpio(128);
471 pxa3xx_init_irq_pm();
472} 515}
473 516
474/* 517/*
@@ -490,11 +533,9 @@ static struct platform_device *devices[] __initdata = {
490 533
491static struct sys_device pxa3xx_sysdev[] = { 534static struct sys_device pxa3xx_sysdev[] = {
492 { 535 {
493 .id = 0,
494 .cls = &pxa_irq_sysclass, 536 .cls = &pxa_irq_sysclass,
495 }, { 537 }, {
496 .id = 1, 538 .cls = &pxa3xx_mfp_sysclass,
497 .cls = &pxa_irq_sysclass,
498 }, { 539 }, {
499 .cls = &pxa_gpio_sysclass, 540 .cls = &pxa_gpio_sysclass,
500 }, 541 },
@@ -532,4 +573,4 @@ static int __init pxa3xx_init(void)
532 return ret; 573 return ret;
533} 574}
534 575
535subsys_initcall(pxa3xx_init); 576postcore_initcall(pxa3xx_init);
diff --git a/arch/arm/mach-pxa/sharpsl_pm.c b/arch/arm/mach-pxa/sharpsl_pm.c
index f9d1b61e1185..34cd585075b0 100644
--- a/arch/arm/mach-pxa/sharpsl_pm.c
+++ b/arch/arm/mach-pxa/sharpsl_pm.c
@@ -26,6 +26,7 @@
26#include <asm/mach-types.h> 26#include <asm/mach-types.h>
27#include <asm/arch/pm.h> 27#include <asm/arch/pm.h>
28#include <asm/arch/pxa-regs.h> 28#include <asm/arch/pxa-regs.h>
29#include <asm/arch/pxa2xx-gpio.h>
29#include <asm/arch/sharpsl.h> 30#include <asm/arch/sharpsl.h>
30#include "sharpsl.h" 31#include "sharpsl.h"
31 32
diff --git a/arch/arm/mach-pxa/spitz.c b/arch/arm/mach-pxa/spitz.c
index 9e7773fca01c..62a02c3927c5 100644
--- a/arch/arm/mach-pxa/spitz.c
+++ b/arch/arm/mach-pxa/spitz.c
@@ -37,6 +37,7 @@
37 37
38#include <asm/arch/pxa-regs.h> 38#include <asm/arch/pxa-regs.h>
39#include <asm/arch/pxa2xx-regs.h> 39#include <asm/arch/pxa2xx-regs.h>
40#include <asm/arch/pxa2xx-gpio.h>
40#include <asm/arch/irda.h> 41#include <asm/arch/irda.h>
41#include <asm/arch/mmc.h> 42#include <asm/arch/mmc.h>
42#include <asm/arch/ohci.h> 43#include <asm/arch/ohci.h>
diff --git a/arch/arm/mach-pxa/spitz_pm.c b/arch/arm/mach-pxa/spitz_pm.c
index 745a4dc7acdd..7a7f5f947cc5 100644
--- a/arch/arm/mach-pxa/spitz_pm.c
+++ b/arch/arm/mach-pxa/spitz_pm.c
@@ -26,6 +26,7 @@
26#include <asm/arch/sharpsl.h> 26#include <asm/arch/sharpsl.h>
27#include <asm/arch/spitz.h> 27#include <asm/arch/spitz.h>
28#include <asm/arch/pxa-regs.h> 28#include <asm/arch/pxa-regs.h>
29#include <asm/arch/pxa2xx-gpio.h>
29#include "sharpsl.h" 30#include "sharpsl.h"
30 31
31#define SHARPSL_CHARGE_ON_VOLT 0x99 /* 2.9V */ 32#define SHARPSL_CHARGE_ON_VOLT 0x99 /* 2.9V */
diff --git a/arch/arm/mach-pxa/tosa.c b/arch/arm/mach-pxa/tosa.c
index f99112d50b41..6458f6d371d9 100644
--- a/arch/arm/mach-pxa/tosa.c
+++ b/arch/arm/mach-pxa/tosa.c
@@ -23,6 +23,7 @@
23#include <linux/delay.h> 23#include <linux/delay.h>
24#include <linux/gpio_keys.h> 24#include <linux/gpio_keys.h>
25#include <linux/input.h> 25#include <linux/input.h>
26#include <linux/gpio.h>
26 27
27#include <asm/setup.h> 28#include <asm/setup.h>
28#include <asm/memory.h> 29#include <asm/memory.h>
@@ -32,7 +33,9 @@
32#include <asm/system.h> 33#include <asm/system.h>
33#include <asm/arch/pxa-regs.h> 34#include <asm/arch/pxa-regs.h>
34#include <asm/arch/pxa2xx-regs.h> 35#include <asm/arch/pxa2xx-regs.h>
36#include <asm/arch/mfp-pxa25x.h>
35#include <asm/arch/irda.h> 37#include <asm/arch/irda.h>
38#include <asm/arch/i2c.h>
36#include <asm/arch/mmc.h> 39#include <asm/arch/mmc.h>
37#include <asm/arch/udc.h> 40#include <asm/arch/udc.h>
38 41
@@ -47,6 +50,110 @@
47#include "generic.h" 50#include "generic.h"
48#include "devices.h" 51#include "devices.h"
49 52
53static unsigned long tosa_pin_config[] = {
54 GPIO78_nCS_2, /* Scoop */
55 GPIO80_nCS_4, /* tg6393xb */
56 GPIO33_nCS_5, /* Scoop */
57
58 // GPIO76 CARD_VCC_ON1
59
60 GPIO19_GPIO, /* Reset out */
61 GPIO1_RST | WAKEUP_ON_EDGE_FALL,
62
63 GPIO0_GPIO | WAKEUP_ON_EDGE_FALL, /* WAKE_UP */
64 GPIO2_GPIO | WAKEUP_ON_EDGE_BOTH, /* AC_IN */
65 GPIO3_GPIO | WAKEUP_ON_EDGE_FALL, /* RECORD */
66 GPIO4_GPIO | WAKEUP_ON_EDGE_FALL, /* SYNC */
67 GPIO20_GPIO, /* EAR_IN */
68 GPIO22_GPIO, /* On */
69
70 GPIO5_GPIO, /* USB_IN */
71 GPIO32_GPIO, /* Pen IRQ */
72
73 GPIO7_GPIO, /* Jacket Detect */
74 GPIO14_GPIO, /* BAT0_CRG */
75 GPIO12_GPIO, /* BAT1_CRG */
76 GPIO17_GPIO, /* BAT0_LOW */
77 GPIO84_GPIO, /* BAT1_LOW */
78 GPIO38_GPIO, /* BAT_LOCK */
79
80 GPIO11_3_6MHz,
81 GPIO15_GPIO, /* TC6393XB IRQ */
82 GPIO18_RDY,
83 GPIO27_GPIO, /* LCD Sync */
84
85 /* MMC */
86 GPIO6_MMC_CLK,
87 GPIO8_MMC_CS0,
88 GPIO9_GPIO, /* Detect */
89 // GPIO10 nSD_INT
90
91 /* CF */
92 GPIO13_GPIO, /* CD_IRQ */
93 GPIO21_GPIO, /* Main Slot IRQ */
94 GPIO36_GPIO, /* Jacket Slot IRQ */
95 GPIO48_nPOE,
96 GPIO49_nPWE,
97 GPIO50_nPIOR,
98 GPIO51_nPIOW,
99 GPIO52_nPCE_1,
100 GPIO53_nPCE_2,
101 GPIO54_nPSKTSEL,
102 GPIO55_nPREG,
103 GPIO56_nPWAIT,
104 GPIO57_nIOIS16,
105
106 /* AC97 */
107 GPIO31_AC97_SYNC,
108 GPIO30_AC97_SDATA_OUT,
109 GPIO28_AC97_BITCLK,
110 GPIO29_AC97_SDATA_IN_0,
111 // GPIO79 nAUD_IRQ
112
113 /* FFUART */
114 GPIO34_FFUART_RXD,
115 GPIO35_FFUART_CTS,
116 GPIO37_FFUART_DSR,
117 GPIO39_FFUART_TXD,
118 GPIO40_FFUART_DTR,
119 GPIO41_FFUART_RTS,
120
121 /* BTUART */
122 GPIO42_BTUART_RXD,
123 GPIO43_BTUART_TXD,
124 GPIO44_BTUART_CTS,
125 GPIO45_BTUART_RTS,
126
127 /* IrDA */
128 GPIO46_STUART_RXD,
129 GPIO47_STUART_TXD,
130
131 /* Keybd */
132 GPIO58_GPIO,
133 GPIO59_GPIO,
134 GPIO60_GPIO,
135 GPIO61_GPIO,
136 GPIO62_GPIO,
137 GPIO63_GPIO,
138 GPIO64_GPIO,
139 GPIO65_GPIO,
140 GPIO66_GPIO,
141 GPIO67_GPIO,
142 GPIO68_GPIO,
143 GPIO69_GPIO,
144 GPIO70_GPIO,
145 GPIO71_GPIO,
146 GPIO72_GPIO,
147 GPIO73_GPIO,
148 GPIO74_GPIO,
149 GPIO75_GPIO,
150
151 /* SPI */
152 GPIO81_SSP2_CLK_OUT,
153 GPIO82_SSP2_FRM_OUT,
154 GPIO83_SSP2_TXD,
155};
156
50/* 157/*
51 * SCOOP Device 158 * SCOOP Device
52 */ 159 */
@@ -60,11 +167,10 @@ static struct resource tosa_scoop_resources[] = {
60 167
61static struct scoop_config tosa_scoop_setup = { 168static struct scoop_config tosa_scoop_setup = {
62 .io_dir = TOSA_SCOOP_IO_DIR, 169 .io_dir = TOSA_SCOOP_IO_DIR,
63 .io_out = TOSA_SCOOP_IO_OUT, 170 .gpio_base = TOSA_SCOOP_GPIO_BASE,
64
65}; 171};
66 172
67struct platform_device tosascoop_device = { 173static struct platform_device tosascoop_device = {
68 .name = "sharp-scoop", 174 .name = "sharp-scoop",
69 .id = 0, 175 .id = 0,
70 .dev = { 176 .dev = {
@@ -88,10 +194,10 @@ static struct resource tosa_scoop_jc_resources[] = {
88 194
89static struct scoop_config tosa_scoop_jc_setup = { 195static struct scoop_config tosa_scoop_jc_setup = {
90 .io_dir = TOSA_SCOOP_JC_IO_DIR, 196 .io_dir = TOSA_SCOOP_JC_IO_DIR,
91 .io_out = TOSA_SCOOP_JC_IO_OUT, 197 .gpio_base = TOSA_SCOOP_JC_GPIO_BASE,
92}; 198};
93 199
94struct platform_device tosascoop_jc_device = { 200static struct platform_device tosascoop_jc_device = {
95 .name = "sharp-scoop", 201 .name = "sharp-scoop",
96 .id = 1, 202 .id = 1,
97 .dev = { 203 .dev = {
@@ -118,50 +224,16 @@ static struct scoop_pcmcia_dev tosa_pcmcia_scoop[] = {
118}, 224},
119}; 225};
120 226
121static void tosa_pcmcia_init(void)
122{
123 /* Setup default state of GPIO outputs
124 before we enable them as outputs. */
125 GPSR(GPIO48_nPOE) = GPIO_bit(GPIO48_nPOE) |
126 GPIO_bit(GPIO49_nPWE) | GPIO_bit(GPIO50_nPIOR) |
127 GPIO_bit(GPIO51_nPIOW) | GPIO_bit(GPIO52_nPCE_1) |
128 GPIO_bit(GPIO53_nPCE_2);
129
130 pxa_gpio_mode(GPIO48_nPOE_MD);
131 pxa_gpio_mode(GPIO49_nPWE_MD);
132 pxa_gpio_mode(GPIO50_nPIOR_MD);
133 pxa_gpio_mode(GPIO51_nPIOW_MD);
134 pxa_gpio_mode(GPIO55_nPREG_MD);
135 pxa_gpio_mode(GPIO56_nPWAIT_MD);
136 pxa_gpio_mode(GPIO57_nIOIS16_MD);
137 pxa_gpio_mode(GPIO52_nPCE_1_MD);
138 pxa_gpio_mode(GPIO53_nPCE_2_MD);
139 pxa_gpio_mode(GPIO54_pSKTSEL_MD);
140}
141
142static struct scoop_pcmcia_config tosa_pcmcia_config = { 227static struct scoop_pcmcia_config tosa_pcmcia_config = {
143 .devs = &tosa_pcmcia_scoop[0], 228 .devs = &tosa_pcmcia_scoop[0],
144 .num_devs = 2, 229 .num_devs = 2,
145 .pcmcia_init = tosa_pcmcia_init,
146}; 230};
147 231
148/* 232/*
149 * USB Device Controller 233 * USB Device Controller
150 */ 234 */
151static void tosa_udc_command(int cmd)
152{
153 switch(cmd) {
154 case PXA2XX_UDC_CMD_CONNECT:
155 set_scoop_gpio(&tosascoop_jc_device.dev,TOSA_SCOOP_JC_USB_PULLUP);
156 break;
157 case PXA2XX_UDC_CMD_DISCONNECT:
158 reset_scoop_gpio(&tosascoop_jc_device.dev,TOSA_SCOOP_JC_USB_PULLUP);
159 break;
160 }
161}
162
163static struct pxa2xx_udc_mach_info udc_info __initdata = { 235static struct pxa2xx_udc_mach_info udc_info __initdata = {
164 .udc_command = tosa_udc_command, 236 .gpio_pullup = TOSA_GPIO_USB_PULLUP,
165 .gpio_vbus = TOSA_GPIO_USB_IN, 237 .gpio_vbus = TOSA_GPIO_USB_IN,
166 .gpio_vbus_inverted = 1, 238 .gpio_vbus_inverted = 1,
167}; 239};
@@ -175,19 +247,44 @@ static int tosa_mci_init(struct device *dev, irq_handler_t tosa_detect_int, void
175{ 247{
176 int err; 248 int err;
177 249
178 /* setup GPIO for PXA25x MMC controller */
179 pxa_gpio_mode(GPIO6_MMCCLK_MD);
180 pxa_gpio_mode(GPIO8_MMCCS0_MD);
181 pxa_gpio_mode(TOSA_GPIO_nSD_DETECT | GPIO_IN);
182
183 tosa_mci_platform_data.detect_delay = msecs_to_jiffies(250); 250 tosa_mci_platform_data.detect_delay = msecs_to_jiffies(250);
184 251
185 err = request_irq(TOSA_IRQ_GPIO_nSD_DETECT, tosa_detect_int, 252 err = request_irq(TOSA_IRQ_GPIO_nSD_DETECT, tosa_detect_int,
186 IRQF_DISABLED | IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING, 253 IRQF_DISABLED | IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
187 "MMC/SD card detect", data); 254 "MMC/SD card detect", data);
188 if (err) 255 if (err) {
189 printk(KERN_ERR "tosa_mci_init: MMC/SD: can't request MMC card detect IRQ\n"); 256 printk(KERN_ERR "tosa_mci_init: MMC/SD: can't request MMC card detect IRQ\n");
257 goto err_irq;
258 }
190 259
260 err = gpio_request(TOSA_GPIO_SD_WP, "sd_wp");
261 if (err) {
262 printk(KERN_ERR "tosa_mci_init: can't request SD_WP gpio\n");
263 goto err_gpio_wp;
264 }
265 err = gpio_direction_input(TOSA_GPIO_SD_WP);
266 if (err)
267 goto err_gpio_wp_dir;
268
269 err = gpio_request(TOSA_GPIO_PWR_ON, "sd_pwr");
270 if (err) {
271 printk(KERN_ERR "tosa_mci_init: can't request SD_PWR gpio\n");
272 goto err_gpio_pwr;
273 }
274 err = gpio_direction_output(TOSA_GPIO_PWR_ON, 0);
275 if (err)
276 goto err_gpio_pwr_dir;
277
278 return 0;
279
280err_gpio_pwr_dir:
281 gpio_free(TOSA_GPIO_PWR_ON);
282err_gpio_pwr:
283err_gpio_wp_dir:
284 gpio_free(TOSA_GPIO_SD_WP);
285err_gpio_wp:
286 free_irq(TOSA_IRQ_GPIO_nSD_DETECT, data);
287err_irq:
191 return err; 288 return err;
192} 289}
193 290
@@ -196,19 +293,21 @@ static void tosa_mci_setpower(struct device *dev, unsigned int vdd)
196 struct pxamci_platform_data* p_d = dev->platform_data; 293 struct pxamci_platform_data* p_d = dev->platform_data;
197 294
198 if (( 1 << vdd) & p_d->ocr_mask) { 295 if (( 1 << vdd) & p_d->ocr_mask) {
199 set_scoop_gpio(&tosascoop_device.dev,TOSA_SCOOP_PWR_ON); 296 gpio_set_value(TOSA_GPIO_PWR_ON, 1);
200 } else { 297 } else {
201 reset_scoop_gpio(&tosascoop_device.dev,TOSA_SCOOP_PWR_ON); 298 gpio_set_value(TOSA_GPIO_PWR_ON, 0);
202 } 299 }
203} 300}
204 301
205static int tosa_mci_get_ro(struct device *dev) 302static int tosa_mci_get_ro(struct device *dev)
206{ 303{
207 return (read_scoop_reg(&tosascoop_device.dev, SCOOP_GPWR)&TOSA_SCOOP_SD_WP); 304 return gpio_get_value(TOSA_GPIO_SD_WP);
208} 305}
209 306
210static void tosa_mci_exit(struct device *dev, void *data) 307static void tosa_mci_exit(struct device *dev, void *data)
211{ 308{
309 gpio_free(TOSA_GPIO_PWR_ON);
310 gpio_free(TOSA_GPIO_SD_WP);
212 free_irq(TOSA_IRQ_GPIO_nSD_DETECT, data); 311 free_irq(TOSA_IRQ_GPIO_nSD_DETECT, data);
213} 312}
214 313
@@ -223,21 +322,36 @@ static struct pxamci_platform_data tosa_mci_platform_data = {
223/* 322/*
224 * Irda 323 * Irda
225 */ 324 */
226static void tosa_irda_transceiver_mode(struct device *dev, int mode) 325static int tosa_irda_startup(struct device *dev)
227{ 326{
228 if (mode & IR_OFF) { 327 int ret;
229 reset_scoop_gpio(&tosascoop_device.dev,TOSA_SCOOP_IR_POWERDWN); 328
230 pxa_gpio_mode(GPIO47_STTXD|GPIO_DFLT_LOW); 329 ret = gpio_request(TOSA_GPIO_IR_POWERDWN, "IrDA powerdown");
231 pxa_gpio_mode(GPIO47_STTXD|GPIO_OUT); 330 if (ret)
232 } else { 331 return ret;
233 pxa_gpio_mode(GPIO47_STTXD_MD); 332
234 set_scoop_gpio(&tosascoop_device.dev,TOSA_SCOOP_IR_POWERDWN); 333 ret = gpio_direction_output(TOSA_GPIO_IR_POWERDWN, 0);
334 if (ret)
335 gpio_free(TOSA_GPIO_IR_POWERDWN);
336
337 return ret;
235 } 338 }
339
340static void tosa_irda_shutdown(struct device *dev)
341{
342 gpio_free(TOSA_GPIO_IR_POWERDWN);
343}
344
345static void tosa_irda_transceiver_mode(struct device *dev, int mode)
346{
347 gpio_set_value(TOSA_GPIO_IR_POWERDWN, !(mode & IR_OFF));
236} 348}
237 349
238static struct pxaficp_platform_data tosa_ficp_platform_data = { 350static struct pxaficp_platform_data tosa_ficp_platform_data = {
239 .transceiver_cap = IR_SIRMODE | IR_OFF, 351 .transceiver_cap = IR_SIRMODE | IR_OFF,
240 .transceiver_mode = tosa_irda_transceiver_mode, 352 .transceiver_mode = tosa_irda_transceiver_mode,
353 .startup = tosa_irda_startup,
354 .shutdown = tosa_irda_shutdown,
241}; 355};
242 356
243/* 357/*
@@ -249,12 +363,28 @@ static struct platform_device tosakbd_device = {
249}; 363};
250 364
251static struct gpio_keys_button tosa_gpio_keys[] = { 365static struct gpio_keys_button tosa_gpio_keys[] = {
366 /*
367 * Two following keys are directly tied to "ON" button of tosa. Why?
368 * The first one can be used as a wakeup source, the second can't;
369 * also the first one is OR of ac_powered and on_button.
370 */
371 {
372 .type = EV_PWR,
373 .code = KEY_RESERVED,
374 .gpio = TOSA_GPIO_POWERON,
375 .desc = "Poweron",
376 .wakeup = 1,
377 .active_low = 1,
378 },
252 { 379 {
253 .type = EV_PWR, 380 .type = EV_PWR,
254 .code = KEY_SUSPEND, 381 .code = KEY_SUSPEND,
255 .gpio = TOSA_GPIO_ON_KEY, 382 .gpio = TOSA_GPIO_ON_KEY,
256 .desc = "On key", 383 .desc = "On key",
257 .wakeup = 1, 384 /*
385 * can't be used as wakeup
386 * .wakeup = 1,
387 */
258 .active_low = 1, 388 .active_low = 1,
259 }, 389 },
260 { 390 {
@@ -291,9 +421,40 @@ static struct platform_device tosa_gpio_keys_device = {
291/* 421/*
292 * Tosa LEDs 422 * Tosa LEDs
293 */ 423 */
424static struct gpio_led tosa_gpio_leds[] = {
425 {
426 .name = "tosa:amber:charge",
427 .default_trigger = "main-battery-charging",
428 .gpio = TOSA_GPIO_CHRG_ERR_LED,
429 },
430 {
431 .name = "tosa:green:mail",
432 .default_trigger = "nand-disk",
433 .gpio = TOSA_GPIO_NOTE_LED,
434 },
435 {
436 .name = "tosa:dual:wlan",
437 .default_trigger = "none",
438 .gpio = TOSA_GPIO_WLAN_LED,
439 },
440 {
441 .name = "tosa:blue:bluetooth",
442 .default_trigger = "none",
443 .gpio = TOSA_GPIO_BT_LED,
444 },
445};
446
447static struct gpio_led_platform_data tosa_gpio_leds_platform_data = {
448 .leds = tosa_gpio_leds,
449 .num_leds = ARRAY_SIZE(tosa_gpio_leds),
450};
451
294static struct platform_device tosaled_device = { 452static struct platform_device tosaled_device = {
295 .name = "tosa-led", 453 .name = "leds-gpio",
296 .id = -1, 454 .id = -1,
455 .dev = {
456 .platform_data = &tosa_gpio_leds_platform_data,
457 },
297}; 458};
298 459
299static struct platform_device *devices[] __initdata = { 460static struct platform_device *devices[] __initdata = {
@@ -326,20 +487,13 @@ static void tosa_restart(char mode)
326 487
327static void __init tosa_init(void) 488static void __init tosa_init(void)
328{ 489{
490 pxa2xx_mfp_config(ARRAY_AND_SIZE(tosa_pin_config));
491 gpio_set_wake(MFP_PIN_GPIO1, 1);
492 /* We can't pass to gpio-keys since it will drop the Reset altfunc */
493
329 pm_power_off = tosa_poweroff; 494 pm_power_off = tosa_poweroff;
330 arm_pm_restart = tosa_restart; 495 arm_pm_restart = tosa_restart;
331 496
332 pxa_gpio_mode(TOSA_GPIO_ON_RESET | GPIO_IN);
333 pxa_gpio_mode(TOSA_GPIO_TC6393_INT | GPIO_IN);
334 pxa_gpio_mode(TOSA_GPIO_USB_IN | GPIO_IN);
335
336 /* setup sleep mode values */
337 PWER = 0x00000002;
338 PFER = 0x00000000;
339 PRER = 0x00000002;
340 PGSR0 = 0x00000000;
341 PGSR1 = 0x00FF0002;
342 PGSR2 = 0x00014000;
343 PCFR |= PCFR_OPDE; 497 PCFR |= PCFR_OPDE;
344 498
345 /* enable batt_fault */ 499 /* enable batt_fault */
@@ -348,6 +502,7 @@ static void __init tosa_init(void)
348 pxa_set_mci_info(&tosa_mci_platform_data); 502 pxa_set_mci_info(&tosa_mci_platform_data);
349 pxa_set_udc_info(&udc_info); 503 pxa_set_udc_info(&udc_info);
350 pxa_set_ficp_info(&tosa_ficp_platform_data); 504 pxa_set_ficp_info(&tosa_ficp_platform_data);
505 pxa_set_i2c_info(NULL);
351 platform_scoop_config = &tosa_pcmcia_config; 506 platform_scoop_config = &tosa_pcmcia_config;
352 507
353 platform_add_devices(devices, ARRAY_SIZE(devices)); 508 platform_add_devices(devices, ARRAY_SIZE(devices));
diff --git a/arch/arm/mach-pxa/trizeps4.c b/arch/arm/mach-pxa/trizeps4.c
index f207fcd30cd7..931885d86b91 100644
--- a/arch/arm/mach-pxa/trizeps4.c
+++ b/arch/arm/mach-pxa/trizeps4.c
@@ -41,6 +41,7 @@
41#include <asm/mach/flash.h> 41#include <asm/mach/flash.h>
42 42
43#include <asm/arch/pxa-regs.h> 43#include <asm/arch/pxa-regs.h>
44#include <asm/arch/pxa2xx-gpio.h>
44#include <asm/arch/trizeps4.h> 45#include <asm/arch/trizeps4.h>
45#include <asm/arch/audio.h> 46#include <asm/arch/audio.h>
46#include <asm/arch/pxafb.h> 47#include <asm/arch/pxafb.h>
diff --git a/arch/arm/mach-pxa/zylonite.c b/arch/arm/mach-pxa/zylonite.c
index afd2cbfca0d9..dbb546216be1 100644
--- a/arch/arm/mach-pxa/zylonite.c
+++ b/arch/arm/mach-pxa/zylonite.c
@@ -26,6 +26,7 @@
26#include <asm/arch/pxafb.h> 26#include <asm/arch/pxafb.h>
27#include <asm/arch/zylonite.h> 27#include <asm/arch/zylonite.h>
28#include <asm/arch/mmc.h> 28#include <asm/arch/mmc.h>
29#include <asm/arch/pxa27x_keypad.h>
29 30
30#include "generic.h" 31#include "generic.h"
31 32
@@ -35,6 +36,8 @@ struct platform_mmc_slot zylonite_mmc_slot[MAX_SLOTS];
35int gpio_backlight; 36int gpio_backlight;
36int gpio_eth_irq; 37int gpio_eth_irq;
37 38
39int wm9713_irq;
40
38int lcd_id; 41int lcd_id;
39int lcd_orientation; 42int lcd_orientation;
40 43
@@ -249,6 +252,71 @@ static void __init zylonite_init_mmc(void)
249static inline void zylonite_init_mmc(void) {} 252static inline void zylonite_init_mmc(void) {}
250#endif 253#endif
251 254
255#if defined(CONFIG_KEYBOARD_PXA27x) || defined(CONFIG_KEYBOARD_PXA27x_MODULES)
256static unsigned int zylonite_matrix_key_map[] = {
257 /* KEY(row, col, key_code) */
258 KEY(0, 0, KEY_A), KEY(0, 1, KEY_B), KEY(0, 2, KEY_C), KEY(0, 5, KEY_D),
259 KEY(1, 0, KEY_E), KEY(1, 1, KEY_F), KEY(1, 2, KEY_G), KEY(1, 5, KEY_H),
260 KEY(2, 0, KEY_I), KEY(2, 1, KEY_J), KEY(2, 2, KEY_K), KEY(2, 5, KEY_L),
261 KEY(3, 0, KEY_M), KEY(3, 1, KEY_N), KEY(3, 2, KEY_O), KEY(3, 5, KEY_P),
262 KEY(5, 0, KEY_Q), KEY(5, 1, KEY_R), KEY(5, 2, KEY_S), KEY(5, 5, KEY_T),
263 KEY(6, 0, KEY_U), KEY(6, 1, KEY_V), KEY(6, 2, KEY_W), KEY(6, 5, KEY_X),
264 KEY(7, 1, KEY_Y), KEY(7, 2, KEY_Z),
265
266 KEY(4, 4, KEY_0), KEY(1, 3, KEY_1), KEY(4, 1, KEY_2), KEY(1, 4, KEY_3),
267 KEY(2, 3, KEY_4), KEY(4, 2, KEY_5), KEY(2, 4, KEY_6), KEY(3, 3, KEY_7),
268 KEY(4, 3, KEY_8), KEY(3, 4, KEY_9),
269
270 KEY(4, 5, KEY_SPACE),
271 KEY(5, 3, KEY_KPASTERISK), /* * */
272 KEY(5, 4, KEY_KPDOT), /* #" */
273
274 KEY(0, 7, KEY_UP),
275 KEY(1, 7, KEY_DOWN),
276 KEY(2, 7, KEY_LEFT),
277 KEY(3, 7, KEY_RIGHT),
278 KEY(2, 6, KEY_HOME),
279 KEY(3, 6, KEY_END),
280 KEY(6, 4, KEY_DELETE),
281 KEY(6, 6, KEY_BACK),
282 KEY(6, 3, KEY_CAPSLOCK), /* KEY_LEFTSHIFT), */
283
284 KEY(4, 6, KEY_ENTER), /* scroll push */
285 KEY(5, 7, KEY_ENTER), /* keypad action */
286
287 KEY(0, 4, KEY_EMAIL),
288 KEY(5, 6, KEY_SEND),
289 KEY(4, 0, KEY_CALENDAR),
290 KEY(7, 6, KEY_RECORD),
291 KEY(6, 7, KEY_VOLUMEUP),
292 KEY(7, 7, KEY_VOLUMEDOWN),
293
294 KEY(0, 6, KEY_F22), /* soft1 */
295 KEY(1, 6, KEY_F23), /* soft2 */
296 KEY(0, 3, KEY_AUX), /* contact */
297};
298
299static struct pxa27x_keypad_platform_data zylonite_keypad_info = {
300 .matrix_key_rows = 8,
301 .matrix_key_cols = 8,
302 .matrix_key_map = zylonite_matrix_key_map,
303 .matrix_key_map_size = ARRAY_SIZE(zylonite_matrix_key_map),
304
305 .enable_rotary0 = 1,
306 .rotary0_up_key = KEY_UP,
307 .rotary0_down_key = KEY_DOWN,
308
309 .debounce_interval = 30,
310};
311
312static void __init zylonite_init_keypad(void)
313{
314 pxa_set_keypad_info(&zylonite_keypad_info);
315}
316#else
317static inline void zylonite_init_keypad(void) {}
318#endif
319
252static void __init zylonite_init(void) 320static void __init zylonite_init(void)
253{ 321{
254 /* board-processor specific initialization */ 322 /* board-processor specific initialization */
@@ -265,6 +333,7 @@ static void __init zylonite_init(void)
265 333
266 zylonite_init_lcd(); 334 zylonite_init_lcd();
267 zylonite_init_mmc(); 335 zylonite_init_mmc();
336 zylonite_init_keypad();
268} 337}
269 338
270MACHINE_START(ZYLONITE, "PXA3xx Platform Development Kit (aka Zylonite)") 339MACHINE_START(ZYLONITE, "PXA3xx Platform Development Kit (aka Zylonite)")
diff --git a/arch/arm/mach-pxa/zylonite_pxa300.c b/arch/arm/mach-pxa/zylonite_pxa300.c
index 6ac04c09b0e9..324fb9daae28 100644
--- a/arch/arm/mach-pxa/zylonite_pxa300.c
+++ b/arch/arm/mach-pxa/zylonite_pxa300.c
@@ -21,7 +21,7 @@
21#include <asm/arch/mfp-pxa300.h> 21#include <asm/arch/mfp-pxa300.h>
22#include <asm/arch/zylonite.h> 22#include <asm/arch/zylonite.h>
23 23
24#define ARRAY_AND_SIZE(x) (x), ARRAY_SIZE(x) 24#include "generic.h"
25 25
26/* PXA300/PXA310 common configurations */ 26/* PXA300/PXA310 common configurations */
27static mfp_cfg_t common_mfp_cfg[] __initdata = { 27static mfp_cfg_t common_mfp_cfg[] __initdata = {
@@ -69,6 +69,9 @@ static mfp_cfg_t common_mfp_cfg[] __initdata = {
69 GPIO27_AC97_SDATA_OUT, 69 GPIO27_AC97_SDATA_OUT,
70 GPIO28_AC97_SYNC, 70 GPIO28_AC97_SYNC,
71 71
72 /* WM9713 IRQ */
73 GPIO26_GPIO,
74
72 /* Keypad */ 75 /* Keypad */
73 GPIO107_KP_DKIN_0 | MFP_LPM_EDGE_BOTH, 76 GPIO107_KP_DKIN_0 | MFP_LPM_EDGE_BOTH,
74 GPIO108_KP_DKIN_1 | MFP_LPM_EDGE_BOTH, 77 GPIO108_KP_DKIN_1 | MFP_LPM_EDGE_BOTH,
@@ -203,6 +206,9 @@ void __init zylonite_pxa300_init(void)
203 /* MMC card detect & write protect for controller 0 */ 206 /* MMC card detect & write protect for controller 0 */
204 zylonite_mmc_slot[0].gpio_cd = EXT_GPIO(0); 207 zylonite_mmc_slot[0].gpio_cd = EXT_GPIO(0);
205 zylonite_mmc_slot[0].gpio_wp = EXT_GPIO(2); 208 zylonite_mmc_slot[0].gpio_wp = EXT_GPIO(2);
209
210 /* WM9713 IRQ */
211 wm9713_irq = mfp_to_gpio(MFP_PIN_GPIO26);
206 } 212 }
207 213
208 if (cpu_is_pxa300()) { 214 if (cpu_is_pxa300()) {
diff --git a/arch/arm/mach-pxa/zylonite_pxa320.c b/arch/arm/mach-pxa/zylonite_pxa320.c
index dfa79992b8ab..193d07903b06 100644
--- a/arch/arm/mach-pxa/zylonite_pxa320.c
+++ b/arch/arm/mach-pxa/zylonite_pxa320.c
@@ -21,7 +21,7 @@
21#include <asm/arch/mfp-pxa320.h> 21#include <asm/arch/mfp-pxa320.h>
22#include <asm/arch/zylonite.h> 22#include <asm/arch/zylonite.h>
23 23
24#define ARRAY_AND_SIZE(x) (x), ARRAY_SIZE(x) 24#include "generic.h"
25 25
26static mfp_cfg_t mfp_cfg[] __initdata = { 26static mfp_cfg_t mfp_cfg[] __initdata = {
27 /* LCD */ 27 /* LCD */
@@ -68,6 +68,9 @@ static mfp_cfg_t mfp_cfg[] __initdata = {
68 GPIO39_AC97_BITCLK, 68 GPIO39_AC97_BITCLK,
69 GPIO40_AC97_nACRESET, 69 GPIO40_AC97_nACRESET,
70 70
71 /* WM9713 IRQ */
72 GPIO15_GPIO,
73
71 /* I2C */ 74 /* I2C */
72 GPIO32_I2C_SCL, 75 GPIO32_I2C_SCL,
73 GPIO33_I2C_SDA, 76 GPIO33_I2C_SDA,
@@ -190,5 +193,8 @@ void __init zylonite_pxa320_init(void)
190 /* MMC card detect & write protect for controller 0 */ 193 /* MMC card detect & write protect for controller 0 */
191 zylonite_mmc_slot[0].gpio_cd = mfp_to_gpio(MFP_PIN_GPIO1); 194 zylonite_mmc_slot[0].gpio_cd = mfp_to_gpio(MFP_PIN_GPIO1);
192 zylonite_mmc_slot[0].gpio_wp = mfp_to_gpio(MFP_PIN_GPIO5); 195 zylonite_mmc_slot[0].gpio_wp = mfp_to_gpio(MFP_PIN_GPIO5);
196
197 /* WM9713 IRQ */
198 wm9713_irq = mfp_to_gpio(MFP_PIN_GPIO15);
193 } 199 }
194} 200}
diff --git a/arch/arm/mach-realview/Kconfig b/arch/arm/mach-realview/Kconfig
index 39b3bb7f1020..5ccde7cf39e8 100644
--- a/arch/arm/mach-realview/Kconfig
+++ b/arch/arm/mach-realview/Kconfig
@@ -10,7 +10,6 @@ config MACH_REALVIEW_EB
10config REALVIEW_EB_ARM11MP 10config REALVIEW_EB_ARM11MP
11 bool "Support ARM11MPCore tile" 11 bool "Support ARM11MPCore tile"
12 depends on MACH_REALVIEW_EB 12 depends on MACH_REALVIEW_EB
13 select CACHE_L2X0
14 help 13 help
15 Enable support for the ARM11MPCore tile on the Realview platform. 14 Enable support for the ARM11MPCore tile on the Realview platform.
16 15
@@ -24,4 +23,18 @@ config REALVIEW_EB_ARM11MP_REVB
24 kernel built with this option enabled is not compatible with 23 kernel built with this option enabled is not compatible with
25 other revisions of the ARM11MPCore tile. 24 other revisions of the ARM11MPCore tile.
26 25
26config MACH_REALVIEW_PB11MP
27 bool "Support RealView/PB11MPCore platform"
28 select ARM_GIC
29 help
30 Include support for the ARM(R) RealView MPCore Platform Baseboard.
31 PB11MPCore is a platform with an on-board ARM11MPCore and has
32 support for PCI-E and Compact Flash.
33
34config MACH_REALVIEW_PB1176
35 bool "Support RealView/PB1176 platform"
36 select ARM_GIC
37 help
38 Include support for the ARM(R) RealView ARM1176 Platform Baseboard.
39
27endmenu 40endmenu
diff --git a/arch/arm/mach-realview/Makefile b/arch/arm/mach-realview/Makefile
index ca1e390c3c28..d2ae077431dd 100644
--- a/arch/arm/mach-realview/Makefile
+++ b/arch/arm/mach-realview/Makefile
@@ -4,5 +4,7 @@
4 4
5obj-y := core.o clock.o 5obj-y := core.o clock.o
6obj-$(CONFIG_MACH_REALVIEW_EB) += realview_eb.o 6obj-$(CONFIG_MACH_REALVIEW_EB) += realview_eb.o
7obj-$(CONFIG_MACH_REALVIEW_PB11MP) += realview_pb11mp.o
8obj-$(CONFIG_MACH_REALVIEW_PB1176) += realview_pb1176.o
7obj-$(CONFIG_SMP) += platsmp.o headsmp.o localtimer.o 9obj-$(CONFIG_SMP) += platsmp.o headsmp.o localtimer.o
8obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o 10obj-$(CONFIG_HOTPLUG_CPU) += hotplug.o
diff --git a/arch/arm/mach-realview/core.c b/arch/arm/mach-realview/core.c
index 98aefc9f4df3..131990d196f5 100644
--- a/arch/arm/mach-realview/core.c
+++ b/arch/arm/mach-realview/core.c
@@ -109,22 +109,21 @@ static struct flash_platform_data realview_flash_data = {
109 .set_vpp = realview_flash_set_vpp, 109 .set_vpp = realview_flash_set_vpp,
110}; 110};
111 111
112static struct resource realview_flash_resource = {
113 .start = REALVIEW_FLASH_BASE,
114 .end = REALVIEW_FLASH_BASE + REALVIEW_FLASH_SIZE,
115 .flags = IORESOURCE_MEM,
116};
117
118struct platform_device realview_flash_device = { 112struct platform_device realview_flash_device = {
119 .name = "armflash", 113 .name = "armflash",
120 .id = 0, 114 .id = 0,
121 .dev = { 115 .dev = {
122 .platform_data = &realview_flash_data, 116 .platform_data = &realview_flash_data,
123 }, 117 },
124 .num_resources = 1,
125 .resource = &realview_flash_resource,
126}; 118};
127 119
120int realview_flash_register(struct resource *res, u32 num)
121{
122 realview_flash_device.resource = res;
123 realview_flash_device.num_resources = num;
124 return platform_device_register(&realview_flash_device);
125}
126
128static struct resource realview_i2c_resource = { 127static struct resource realview_i2c_resource = {
129 .start = REALVIEW_I2C_BASE, 128 .start = REALVIEW_I2C_BASE,
130 .end = REALVIEW_I2C_BASE + SZ_4K - 1, 129 .end = REALVIEW_I2C_BASE + SZ_4K - 1,
@@ -445,10 +444,10 @@ void realview_leds_event(led_event_t ledevt)
445/* 444/*
446 * Where is the timer (VA)? 445 * Where is the timer (VA)?
447 */ 446 */
448#define TIMER0_VA_BASE __io_address(REALVIEW_TIMER0_1_BASE) 447void __iomem *timer0_va_base;
449#define TIMER1_VA_BASE (__io_address(REALVIEW_TIMER0_1_BASE) + 0x20) 448void __iomem *timer1_va_base;
450#define TIMER2_VA_BASE __io_address(REALVIEW_TIMER2_3_BASE) 449void __iomem *timer2_va_base;
451#define TIMER3_VA_BASE (__io_address(REALVIEW_TIMER2_3_BASE) + 0x20) 450void __iomem *timer3_va_base;
452 451
453/* 452/*
454 * How long is the timer interval? 453 * How long is the timer interval?
@@ -475,7 +474,7 @@ static void timer_set_mode(enum clock_event_mode mode,
475 474
476 switch(mode) { 475 switch(mode) {
477 case CLOCK_EVT_MODE_PERIODIC: 476 case CLOCK_EVT_MODE_PERIODIC:
478 writel(TIMER_RELOAD, TIMER0_VA_BASE + TIMER_LOAD); 477 writel(TIMER_RELOAD, timer0_va_base + TIMER_LOAD);
479 478
480 ctrl = TIMER_CTRL_PERIODIC; 479 ctrl = TIMER_CTRL_PERIODIC;
481 ctrl |= TIMER_CTRL_32BIT | TIMER_CTRL_IE | TIMER_CTRL_ENABLE; 480 ctrl |= TIMER_CTRL_32BIT | TIMER_CTRL_IE | TIMER_CTRL_ENABLE;
@@ -491,16 +490,16 @@ static void timer_set_mode(enum clock_event_mode mode,
491 ctrl = 0; 490 ctrl = 0;
492 } 491 }
493 492
494 writel(ctrl, TIMER0_VA_BASE + TIMER_CTRL); 493 writel(ctrl, timer0_va_base + TIMER_CTRL);
495} 494}
496 495
497static int timer_set_next_event(unsigned long evt, 496static int timer_set_next_event(unsigned long evt,
498 struct clock_event_device *unused) 497 struct clock_event_device *unused)
499{ 498{
500 unsigned long ctrl = readl(TIMER0_VA_BASE + TIMER_CTRL); 499 unsigned long ctrl = readl(timer0_va_base + TIMER_CTRL);
501 500
502 writel(evt, TIMER0_VA_BASE + TIMER_LOAD); 501 writel(evt, timer0_va_base + TIMER_LOAD);
503 writel(ctrl | TIMER_CTRL_ENABLE, TIMER0_VA_BASE + TIMER_CTRL); 502 writel(ctrl | TIMER_CTRL_ENABLE, timer0_va_base + TIMER_CTRL);
504 503
505 return 0; 504 return 0;
506} 505}
@@ -536,7 +535,7 @@ static irqreturn_t realview_timer_interrupt(int irq, void *dev_id)
536 struct clock_event_device *evt = &timer0_clockevent; 535 struct clock_event_device *evt = &timer0_clockevent;
537 536
538 /* clear the interrupt */ 537 /* clear the interrupt */
539 writel(1, TIMER0_VA_BASE + TIMER_INTCLR); 538 writel(1, timer0_va_base + TIMER_INTCLR);
540 539
541 evt->event_handler(evt); 540 evt->event_handler(evt);
542 541
@@ -551,7 +550,7 @@ static struct irqaction realview_timer_irq = {
551 550
552static cycle_t realview_get_cycles(void) 551static cycle_t realview_get_cycles(void)
553{ 552{
554 return ~readl(TIMER3_VA_BASE + TIMER_VALUE); 553 return ~readl(timer3_va_base + TIMER_VALUE);
555} 554}
556 555
557static struct clocksource clocksource_realview = { 556static struct clocksource clocksource_realview = {
@@ -566,11 +565,11 @@ static struct clocksource clocksource_realview = {
566static void __init realview_clocksource_init(void) 565static void __init realview_clocksource_init(void)
567{ 566{
568 /* setup timer 0 as free-running clocksource */ 567 /* setup timer 0 as free-running clocksource */
569 writel(0, TIMER3_VA_BASE + TIMER_CTRL); 568 writel(0, timer3_va_base + TIMER_CTRL);
570 writel(0xffffffff, TIMER3_VA_BASE + TIMER_LOAD); 569 writel(0xffffffff, timer3_va_base + TIMER_LOAD);
571 writel(0xffffffff, TIMER3_VA_BASE + TIMER_VALUE); 570 writel(0xffffffff, timer3_va_base + TIMER_VALUE);
572 writel(TIMER_CTRL_32BIT | TIMER_CTRL_ENABLE | TIMER_CTRL_PERIODIC, 571 writel(TIMER_CTRL_32BIT | TIMER_CTRL_ENABLE | TIMER_CTRL_PERIODIC,
573 TIMER3_VA_BASE + TIMER_CTRL); 572 timer3_va_base + TIMER_CTRL);
574 573
575 clocksource_realview.mult = 574 clocksource_realview.mult =
576 clocksource_khz2mult(1000, clocksource_realview.shift); 575 clocksource_khz2mult(1000, clocksource_realview.shift);
@@ -607,10 +606,10 @@ void __init realview_timer_init(unsigned int timer_irq)
607 /* 606 /*
608 * Initialise to a known state (all timers off) 607 * Initialise to a known state (all timers off)
609 */ 608 */
610 writel(0, TIMER0_VA_BASE + TIMER_CTRL); 609 writel(0, timer0_va_base + TIMER_CTRL);
611 writel(0, TIMER1_VA_BASE + TIMER_CTRL); 610 writel(0, timer1_va_base + TIMER_CTRL);
612 writel(0, TIMER2_VA_BASE + TIMER_CTRL); 611 writel(0, timer2_va_base + TIMER_CTRL);
613 writel(0, TIMER3_VA_BASE + TIMER_CTRL); 612 writel(0, timer3_va_base + TIMER_CTRL);
614 613
615 /* 614 /*
616 * Make irqs happen for the system timer 615 * Make irqs happen for the system timer
diff --git a/arch/arm/mach-realview/core.h b/arch/arm/mach-realview/core.h
index 492a14c0d604..33dbbb41a663 100644
--- a/arch/arm/mach-realview/core.h
+++ b/arch/arm/mach-realview/core.h
@@ -55,8 +55,13 @@ extern void __iomem *gic_cpu_base_addr;
55extern void __iomem *twd_base_addr; 55extern void __iomem *twd_base_addr;
56extern unsigned int twd_size; 56extern unsigned int twd_size;
57#endif 57#endif
58extern void __iomem *timer0_va_base;
59extern void __iomem *timer1_va_base;
60extern void __iomem *timer2_va_base;
61extern void __iomem *timer3_va_base;
58 62
59extern void realview_leds_event(led_event_t ledevt); 63extern void realview_leds_event(led_event_t ledevt);
60extern void realview_timer_init(unsigned int timer_irq); 64extern void realview_timer_init(unsigned int timer_irq);
65extern int realview_flash_register(struct resource *res, u32 num);
61 66
62#endif 67#endif
diff --git a/arch/arm/mach-realview/platsmp.c b/arch/arm/mach-realview/platsmp.c
index de2b7159557d..3e57428affee 100644
--- a/arch/arm/mach-realview/platsmp.c
+++ b/arch/arm/mach-realview/platsmp.c
@@ -15,11 +15,14 @@
15#include <linux/smp.h> 15#include <linux/smp.h>
16 16
17#include <asm/cacheflush.h> 17#include <asm/cacheflush.h>
18#include <asm/hardware/arm_scu.h>
19#include <asm/hardware.h> 18#include <asm/hardware.h>
20#include <asm/io.h> 19#include <asm/io.h>
21#include <asm/mach-types.h> 20#include <asm/mach-types.h>
22 21
22#include <asm/arch/board-eb.h>
23#include <asm/arch/board-pb11mp.h>
24#include <asm/arch/scu.h>
25
23extern void realview_secondary_startup(void); 26extern void realview_secondary_startup(void);
24 27
25/* 28/*
@@ -31,9 +34,15 @@ volatile int __cpuinitdata pen_release = -1;
31static unsigned int __init get_core_count(void) 34static unsigned int __init get_core_count(void)
32{ 35{
33 unsigned int ncores; 36 unsigned int ncores;
37 void __iomem *scu_base = 0;
38
39 if (machine_is_realview_eb() && core_tile_eb11mp())
40 scu_base = __io_address(REALVIEW_EB11MP_SCU_BASE);
41 else if (machine_is_realview_pb11mp())
42 scu_base = __io_address(REALVIEW_TC11MP_SCU_BASE);
34 43
35 if (machine_is_realview_eb() && core_tile_eb11mp()) { 44 if (scu_base) {
36 ncores = __raw_readl(__io_address(REALVIEW_EB11MP_SCU_BASE) + SCU_CONFIG); 45 ncores = __raw_readl(scu_base + SCU_CONFIG);
37 ncores = (ncores & 0x03) + 1; 46 ncores = (ncores & 0x03) + 1;
38 } else 47 } else
39 ncores = 1; 48 ncores = 1;
@@ -41,6 +50,26 @@ static unsigned int __init get_core_count(void)
41 return ncores; 50 return ncores;
42} 51}
43 52
53/*
54 * Setup the SCU
55 */
56static void scu_enable(void)
57{
58 u32 scu_ctrl;
59 void __iomem *scu_base;
60
61 if (machine_is_realview_eb() && core_tile_eb11mp())
62 scu_base = __io_address(REALVIEW_EB11MP_SCU_BASE);
63 else if (machine_is_realview_pb11mp())
64 scu_base = __io_address(REALVIEW_TC11MP_SCU_BASE);
65 else
66 BUG();
67
68 scu_ctrl = __raw_readl(scu_base + SCU_CTRL);
69 scu_ctrl |= 1;
70 __raw_writel(scu_ctrl, scu_base + SCU_CTRL);
71}
72
44static DEFINE_SPINLOCK(boot_lock); 73static DEFINE_SPINLOCK(boot_lock);
45 74
46void __cpuinit platform_secondary_init(unsigned int cpu) 75void __cpuinit platform_secondary_init(unsigned int cpu)
@@ -57,7 +86,10 @@ void __cpuinit platform_secondary_init(unsigned int cpu)
57 * core (e.g. timer irq), then they will not have been enabled 86 * core (e.g. timer irq), then they will not have been enabled
58 * for us: do so 87 * for us: do so
59 */ 88 */
60 gic_cpu_init(0, __io_address(REALVIEW_EB11MP_GIC_CPU_BASE)); 89 if (machine_is_realview_eb() && core_tile_eb11mp())
90 gic_cpu_init(0, __io_address(REALVIEW_EB11MP_GIC_CPU_BASE));
91 else if (machine_is_realview_pb11mp())
92 gic_cpu_init(0, __io_address(REALVIEW_TC11MP_GIC_CPU_BASE));
61 93
62 /* 94 /*
63 * let the primary processor know we're out of the 95 * let the primary processor know we're out of the
@@ -198,7 +230,8 @@ void __init smp_prepare_cpus(unsigned int max_cpus)
198 * dummy (!CONFIG_LOCAL_TIMERS), it was already registers in 230 * dummy (!CONFIG_LOCAL_TIMERS), it was already registers in
199 * realview_timer_init 231 * realview_timer_init
200 */ 232 */
201 if (machine_is_realview_eb() && core_tile_eb11mp()) 233 if ((machine_is_realview_eb() && core_tile_eb11mp()) ||
234 machine_is_realview_pb11mp())
202 local_timer_setup(cpu); 235 local_timer_setup(cpu);
203#endif 236#endif
204 237
@@ -210,11 +243,14 @@ void __init smp_prepare_cpus(unsigned int max_cpus)
210 cpu_set(i, cpu_present_map); 243 cpu_set(i, cpu_present_map);
211 244
212 /* 245 /*
213 * Do we need any more CPUs? If so, then let them know where 246 * Initialise the SCU if there are more than one CPU and let
214 * to start. Note that, on modern versions of MILO, the "poke" 247 * them know where to start. Note that, on modern versions of
215 * doesn't actually do anything until each individual core is 248 * MILO, the "poke" doesn't actually do anything until each
216 * sent a soft interrupt to get it out of WFI 249 * individual core is sent a soft interrupt to get it out of
250 * WFI
217 */ 251 */
218 if (max_cpus > 1) 252 if (max_cpus > 1) {
253 scu_enable();
219 poke_milo(); 254 poke_milo();
255 }
220} 256}
diff --git a/arch/arm/mach-realview/realview_eb.c b/arch/arm/mach-realview/realview_eb.c
index 60d9eb810246..5782d83fd886 100644
--- a/arch/arm/mach-realview/realview_eb.c
+++ b/arch/arm/mach-realview/realview_eb.c
@@ -51,13 +51,13 @@ static struct map_desc realview_eb_io_desc[] __initdata = {
51 .length = SZ_4K, 51 .length = SZ_4K,
52 .type = MT_DEVICE, 52 .type = MT_DEVICE,
53 }, { 53 }, {
54 .virtual = IO_ADDRESS(REALVIEW_GIC_CPU_BASE), 54 .virtual = IO_ADDRESS(REALVIEW_EB_GIC_CPU_BASE),
55 .pfn = __phys_to_pfn(REALVIEW_GIC_CPU_BASE), 55 .pfn = __phys_to_pfn(REALVIEW_EB_GIC_CPU_BASE),
56 .length = SZ_4K, 56 .length = SZ_4K,
57 .type = MT_DEVICE, 57 .type = MT_DEVICE,
58 }, { 58 }, {
59 .virtual = IO_ADDRESS(REALVIEW_GIC_DIST_BASE), 59 .virtual = IO_ADDRESS(REALVIEW_EB_GIC_DIST_BASE),
60 .pfn = __phys_to_pfn(REALVIEW_GIC_DIST_BASE), 60 .pfn = __phys_to_pfn(REALVIEW_EB_GIC_DIST_BASE),
61 .length = SZ_4K, 61 .length = SZ_4K,
62 .type = MT_DEVICE, 62 .type = MT_DEVICE,
63 }, { 63 }, {
@@ -66,20 +66,20 @@ static struct map_desc realview_eb_io_desc[] __initdata = {
66 .length = SZ_4K, 66 .length = SZ_4K,
67 .type = MT_DEVICE, 67 .type = MT_DEVICE,
68 }, { 68 }, {
69 .virtual = IO_ADDRESS(REALVIEW_TIMER0_1_BASE), 69 .virtual = IO_ADDRESS(REALVIEW_EB_TIMER0_1_BASE),
70 .pfn = __phys_to_pfn(REALVIEW_TIMER0_1_BASE), 70 .pfn = __phys_to_pfn(REALVIEW_EB_TIMER0_1_BASE),
71 .length = SZ_4K, 71 .length = SZ_4K,
72 .type = MT_DEVICE, 72 .type = MT_DEVICE,
73 }, { 73 }, {
74 .virtual = IO_ADDRESS(REALVIEW_TIMER2_3_BASE), 74 .virtual = IO_ADDRESS(REALVIEW_EB_TIMER2_3_BASE),
75 .pfn = __phys_to_pfn(REALVIEW_TIMER2_3_BASE), 75 .pfn = __phys_to_pfn(REALVIEW_EB_TIMER2_3_BASE),
76 .length = SZ_4K, 76 .length = SZ_4K,
77 .type = MT_DEVICE, 77 .type = MT_DEVICE,
78 }, 78 },
79#ifdef CONFIG_DEBUG_LL 79#ifdef CONFIG_DEBUG_LL
80 { 80 {
81 .virtual = IO_ADDRESS(REALVIEW_UART0_BASE), 81 .virtual = IO_ADDRESS(REALVIEW_EB_UART0_BASE),
82 .pfn = __phys_to_pfn(REALVIEW_UART0_BASE), 82 .pfn = __phys_to_pfn(REALVIEW_EB_UART0_BASE),
83 .length = SZ_4K, 83 .length = SZ_4K,
84 .type = MT_DEVICE, 84 .type = MT_DEVICE,
85 } 85 }
@@ -136,12 +136,12 @@ static void __init realview_eb_map_io(void)
136/* 136/*
137 * These devices are connected directly to the multi-layer AHB switch 137 * These devices are connected directly to the multi-layer AHB switch
138 */ 138 */
139#define SMC_IRQ { NO_IRQ, NO_IRQ } 139#define EB_SMC_IRQ { NO_IRQ, NO_IRQ }
140#define SMC_DMA { 0, 0 } 140#define EB_SMC_DMA { 0, 0 }
141#define MPMC_IRQ { NO_IRQ, NO_IRQ } 141#define MPMC_IRQ { NO_IRQ, NO_IRQ }
142#define MPMC_DMA { 0, 0 } 142#define MPMC_DMA { 0, 0 }
143#define CLCD_IRQ { IRQ_EB_CLCD, NO_IRQ } 143#define EB_CLCD_IRQ { IRQ_EB_CLCD, NO_IRQ }
144#define CLCD_DMA { 0, 0 } 144#define EB_CLCD_DMA { 0, 0 }
145#define DMAC_IRQ { IRQ_EB_DMA, NO_IRQ } 145#define DMAC_IRQ { IRQ_EB_DMA, NO_IRQ }
146#define DMAC_DMA { 0, 0 } 146#define DMAC_DMA { 0, 0 }
147 147
@@ -150,53 +150,53 @@ static void __init realview_eb_map_io(void)
150 */ 150 */
151#define SCTL_IRQ { NO_IRQ, NO_IRQ } 151#define SCTL_IRQ { NO_IRQ, NO_IRQ }
152#define SCTL_DMA { 0, 0 } 152#define SCTL_DMA { 0, 0 }
153#define WATCHDOG_IRQ { IRQ_EB_WDOG, NO_IRQ } 153#define EB_WATCHDOG_IRQ { IRQ_EB_WDOG, NO_IRQ }
154#define WATCHDOG_DMA { 0, 0 } 154#define EB_WATCHDOG_DMA { 0, 0 }
155#define GPIO0_IRQ { IRQ_EB_GPIO0, NO_IRQ } 155#define EB_GPIO0_IRQ { IRQ_EB_GPIO0, NO_IRQ }
156#define GPIO0_DMA { 0, 0 } 156#define EB_GPIO0_DMA { 0, 0 }
157#define GPIO1_IRQ { IRQ_EB_GPIO1, NO_IRQ } 157#define GPIO1_IRQ { IRQ_EB_GPIO1, NO_IRQ }
158#define GPIO1_DMA { 0, 0 } 158#define GPIO1_DMA { 0, 0 }
159#define RTC_IRQ { IRQ_EB_RTC, NO_IRQ } 159#define EB_RTC_IRQ { IRQ_EB_RTC, NO_IRQ }
160#define RTC_DMA { 0, 0 } 160#define EB_RTC_DMA { 0, 0 }
161 161
162/* 162/*
163 * These devices are connected via the DMA APB bridge 163 * These devices are connected via the DMA APB bridge
164 */ 164 */
165#define SCI_IRQ { IRQ_EB_SCI, NO_IRQ } 165#define SCI_IRQ { IRQ_EB_SCI, NO_IRQ }
166#define SCI_DMA { 7, 6 } 166#define SCI_DMA { 7, 6 }
167#define UART0_IRQ { IRQ_EB_UART0, NO_IRQ } 167#define EB_UART0_IRQ { IRQ_EB_UART0, NO_IRQ }
168#define UART0_DMA { 15, 14 } 168#define EB_UART0_DMA { 15, 14 }
169#define UART1_IRQ { IRQ_EB_UART1, NO_IRQ } 169#define EB_UART1_IRQ { IRQ_EB_UART1, NO_IRQ }
170#define UART1_DMA { 13, 12 } 170#define EB_UART1_DMA { 13, 12 }
171#define UART2_IRQ { IRQ_EB_UART2, NO_IRQ } 171#define EB_UART2_IRQ { IRQ_EB_UART2, NO_IRQ }
172#define UART2_DMA { 11, 10 } 172#define EB_UART2_DMA { 11, 10 }
173#define UART3_IRQ { IRQ_EB_UART3, NO_IRQ } 173#define EB_UART3_IRQ { IRQ_EB_UART3, NO_IRQ }
174#define UART3_DMA { 0x86, 0x87 } 174#define EB_UART3_DMA { 0x86, 0x87 }
175#define SSP_IRQ { IRQ_EB_SSP, NO_IRQ } 175#define EB_SSP_IRQ { IRQ_EB_SSP, NO_IRQ }
176#define SSP_DMA { 9, 8 } 176#define EB_SSP_DMA { 9, 8 }
177 177
178/* FPGA Primecells */ 178/* FPGA Primecells */
179AMBA_DEVICE(aaci, "fpga:04", AACI, NULL); 179AMBA_DEVICE(aaci, "fpga:04", AACI, NULL);
180AMBA_DEVICE(mmc0, "fpga:05", MMCI0, &realview_mmc0_plat_data); 180AMBA_DEVICE(mmc0, "fpga:05", MMCI0, &realview_mmc0_plat_data);
181AMBA_DEVICE(kmi0, "fpga:06", KMI0, NULL); 181AMBA_DEVICE(kmi0, "fpga:06", KMI0, NULL);
182AMBA_DEVICE(kmi1, "fpga:07", KMI1, NULL); 182AMBA_DEVICE(kmi1, "fpga:07", KMI1, NULL);
183AMBA_DEVICE(uart3, "fpga:09", UART3, NULL); 183AMBA_DEVICE(uart3, "fpga:09", EB_UART3, NULL);
184 184
185/* DevChip Primecells */ 185/* DevChip Primecells */
186AMBA_DEVICE(smc, "dev:00", SMC, NULL); 186AMBA_DEVICE(smc, "dev:00", EB_SMC, NULL);
187AMBA_DEVICE(clcd, "dev:20", CLCD, &clcd_plat_data); 187AMBA_DEVICE(clcd, "dev:20", EB_CLCD, &clcd_plat_data);
188AMBA_DEVICE(dmac, "dev:30", DMAC, NULL); 188AMBA_DEVICE(dmac, "dev:30", DMAC, NULL);
189AMBA_DEVICE(sctl, "dev:e0", SCTL, NULL); 189AMBA_DEVICE(sctl, "dev:e0", SCTL, NULL);
190AMBA_DEVICE(wdog, "dev:e1", WATCHDOG, NULL); 190AMBA_DEVICE(wdog, "dev:e1", EB_WATCHDOG, NULL);
191AMBA_DEVICE(gpio0, "dev:e4", GPIO0, NULL); 191AMBA_DEVICE(gpio0, "dev:e4", EB_GPIO0, NULL);
192AMBA_DEVICE(gpio1, "dev:e5", GPIO1, NULL); 192AMBA_DEVICE(gpio1, "dev:e5", GPIO1, NULL);
193AMBA_DEVICE(gpio2, "dev:e6", GPIO2, NULL); 193AMBA_DEVICE(gpio2, "dev:e6", GPIO2, NULL);
194AMBA_DEVICE(rtc, "dev:e8", RTC, NULL); 194AMBA_DEVICE(rtc, "dev:e8", EB_RTC, NULL);
195AMBA_DEVICE(sci0, "dev:f0", SCI, NULL); 195AMBA_DEVICE(sci0, "dev:f0", SCI, NULL);
196AMBA_DEVICE(uart0, "dev:f1", UART0, NULL); 196AMBA_DEVICE(uart0, "dev:f1", EB_UART0, NULL);
197AMBA_DEVICE(uart1, "dev:f2", UART1, NULL); 197AMBA_DEVICE(uart1, "dev:f2", EB_UART1, NULL);
198AMBA_DEVICE(uart2, "dev:f3", UART2, NULL); 198AMBA_DEVICE(uart2, "dev:f3", EB_UART2, NULL);
199AMBA_DEVICE(ssp0, "dev:f4", SSP, NULL); 199AMBA_DEVICE(ssp0, "dev:f4", EB_SSP, NULL);
200 200
201static struct amba_device *amba_devs[] __initdata = { 201static struct amba_device *amba_devs[] __initdata = {
202 &dmac_device, 202 &dmac_device,
@@ -223,11 +223,16 @@ static struct amba_device *amba_devs[] __initdata = {
223/* 223/*
224 * RealView EB platform devices 224 * RealView EB platform devices
225 */ 225 */
226static struct resource realview_eb_flash_resource = {
227 .start = REALVIEW_EB_FLASH_BASE,
228 .end = REALVIEW_EB_FLASH_BASE + REALVIEW_EB_FLASH_SIZE - 1,
229 .flags = IORESOURCE_MEM,
230};
226 231
227static struct resource realview_eb_smc91x_resources[] = { 232static struct resource realview_eb_eth_resources[] = {
228 [0] = { 233 [0] = {
229 .start = REALVIEW_ETH_BASE, 234 .start = REALVIEW_EB_ETH_BASE,
230 .end = REALVIEW_ETH_BASE + SZ_64K - 1, 235 .end = REALVIEW_EB_ETH_BASE + SZ_64K - 1,
231 .flags = IORESOURCE_MEM, 236 .flags = IORESOURCE_MEM,
232 }, 237 },
233 [1] = { 238 [1] = {
@@ -237,13 +242,36 @@ static struct resource realview_eb_smc91x_resources[] = {
237 }, 242 },
238}; 243};
239 244
240static struct platform_device realview_eb_smc91x_device = { 245static struct platform_device realview_eb_eth_device = {
241 .name = "smc91x",
242 .id = 0, 246 .id = 0,
243 .num_resources = ARRAY_SIZE(realview_eb_smc91x_resources), 247 .num_resources = ARRAY_SIZE(realview_eb_eth_resources),
244 .resource = realview_eb_smc91x_resources, 248 .resource = realview_eb_eth_resources,
245}; 249};
246 250
251/*
252 * Detect and register the correct Ethernet device. RealView/EB rev D
253 * platforms use the newer SMSC LAN9118 Ethernet chip
254 */
255static int eth_device_register(void)
256{
257 void __iomem *eth_addr = ioremap(REALVIEW_EB_ETH_BASE, SZ_4K);
258 u32 idrev;
259
260 if (!eth_addr)
261 return -ENOMEM;
262
263 idrev = readl(eth_addr + 0x50);
264 if ((idrev & 0xFFFF0000) == 0x01180000)
265 /* SMSC LAN9118 chip present */
266 realview_eb_eth_device.name = "smc911x";
267 else
268 /* SMSC 91C111 chip present */
269 realview_eb_eth_device.name = "smc91x";
270
271 iounmap(eth_addr);
272 return platform_device_register(&realview_eb_eth_device);
273}
274
247static void __init gic_init_irq(void) 275static void __init gic_init_irq(void)
248{ 276{
249 if (core_tile_eb11mp()) { 277 if (core_tile_eb11mp()) {
@@ -263,14 +291,14 @@ static void __init gic_init_irq(void)
263 291
264#ifndef CONFIG_REALVIEW_EB_ARM11MP_REVB 292#ifndef CONFIG_REALVIEW_EB_ARM11MP_REVB
265 /* board GIC, secondary */ 293 /* board GIC, secondary */
266 gic_dist_init(1, __io_address(REALVIEW_GIC_DIST_BASE), 64); 294 gic_dist_init(1, __io_address(REALVIEW_EB_GIC_DIST_BASE), 64);
267 gic_cpu_init(1, __io_address(REALVIEW_GIC_CPU_BASE)); 295 gic_cpu_init(1, __io_address(REALVIEW_EB_GIC_CPU_BASE));
268 gic_cascade_irq(1, IRQ_EB11MP_EB_IRQ1); 296 gic_cascade_irq(1, IRQ_EB11MP_EB_IRQ1);
269#endif 297#endif
270 } else { 298 } else {
271 /* board GIC, primary */ 299 /* board GIC, primary */
272 gic_cpu_base_addr = __io_address(REALVIEW_GIC_CPU_BASE); 300 gic_cpu_base_addr = __io_address(REALVIEW_EB_GIC_CPU_BASE);
273 gic_dist_init(0, __io_address(REALVIEW_GIC_DIST_BASE), 29); 301 gic_dist_init(0, __io_address(REALVIEW_EB_GIC_DIST_BASE), 29);
274 gic_cpu_init(0, gic_cpu_base_addr); 302 gic_cpu_init(0, gic_cpu_base_addr);
275 } 303 }
276} 304}
@@ -301,14 +329,19 @@ static void realview_eb11mp_fixup(void)
301 kmi1_device.irq[0] = IRQ_EB11MP_KMI1; 329 kmi1_device.irq[0] = IRQ_EB11MP_KMI1;
302 330
303 /* platform devices */ 331 /* platform devices */
304 realview_eb_smc91x_resources[1].start = IRQ_EB11MP_ETH; 332 realview_eb_eth_resources[1].start = IRQ_EB11MP_ETH;
305 realview_eb_smc91x_resources[1].end = IRQ_EB11MP_ETH; 333 realview_eb_eth_resources[1].end = IRQ_EB11MP_ETH;
306} 334}
307 335
308static void __init realview_eb_timer_init(void) 336static void __init realview_eb_timer_init(void)
309{ 337{
310 unsigned int timer_irq; 338 unsigned int timer_irq;
311 339
340 timer0_va_base = __io_address(REALVIEW_EB_TIMER0_1_BASE);
341 timer1_va_base = __io_address(REALVIEW_EB_TIMER0_1_BASE) + 0x20;
342 timer2_va_base = __io_address(REALVIEW_EB_TIMER2_3_BASE);
343 timer3_va_base = __io_address(REALVIEW_EB_TIMER2_3_BASE) + 0x20;
344
312 if (core_tile_eb11mp()) { 345 if (core_tile_eb11mp()) {
313#ifdef CONFIG_LOCAL_TIMERS 346#ifdef CONFIG_LOCAL_TIMERS
314 twd_base_addr = __io_address(REALVIEW_EB11MP_TWD_BASE); 347 twd_base_addr = __io_address(REALVIEW_EB11MP_TWD_BASE);
@@ -332,16 +365,18 @@ static void __init realview_eb_init(void)
332 if (core_tile_eb11mp()) { 365 if (core_tile_eb11mp()) {
333 realview_eb11mp_fixup(); 366 realview_eb11mp_fixup();
334 367
368#ifdef CONFIG_CACHE_L2X0
335 /* 1MB (128KB/way), 8-way associativity, evmon/parity/share enabled 369 /* 1MB (128KB/way), 8-way associativity, evmon/parity/share enabled
336 * Bits: .... ...0 0111 1001 0000 .... .... .... */ 370 * Bits: .... ...0 0111 1001 0000 .... .... .... */
337 l2x0_init(__io_address(REALVIEW_EB11MP_L220_BASE), 0x00790000, 0xfe000fff); 371 l2x0_init(__io_address(REALVIEW_EB11MP_L220_BASE), 0x00790000, 0xfe000fff);
372#endif
338 } 373 }
339 374
340 clk_register(&realview_clcd_clk); 375 clk_register(&realview_clcd_clk);
341 376
342 platform_device_register(&realview_flash_device); 377 realview_flash_register(&realview_eb_flash_resource, 1);
343 platform_device_register(&realview_eb_smc91x_device);
344 platform_device_register(&realview_i2c_device); 378 platform_device_register(&realview_i2c_device);
379 eth_device_register();
345 380
346 for (i = 0; i < ARRAY_SIZE(amba_devs); i++) { 381 for (i = 0; i < ARRAY_SIZE(amba_devs); i++) {
347 struct amba_device *d = amba_devs[i]; 382 struct amba_device *d = amba_devs[i];
@@ -355,8 +390,8 @@ static void __init realview_eb_init(void)
355 390
356MACHINE_START(REALVIEW_EB, "ARM-RealView EB") 391MACHINE_START(REALVIEW_EB, "ARM-RealView EB")
357 /* Maintainer: ARM Ltd/Deep Blue Solutions Ltd */ 392 /* Maintainer: ARM Ltd/Deep Blue Solutions Ltd */
358 .phys_io = REALVIEW_UART0_BASE, 393 .phys_io = REALVIEW_EB_UART0_BASE,
359 .io_pg_offst = (IO_ADDRESS(REALVIEW_UART0_BASE) >> 18) & 0xfffc, 394 .io_pg_offst = (IO_ADDRESS(REALVIEW_EB_UART0_BASE) >> 18) & 0xfffc,
360 .boot_params = 0x00000100, 395 .boot_params = 0x00000100,
361 .map_io = realview_eb_map_io, 396 .map_io = realview_eb_map_io,
362 .init_irq = gic_init_irq, 397 .init_irq = gic_init_irq,
diff --git a/arch/arm/mach-realview/realview_pb1176.c b/arch/arm/mach-realview/realview_pb1176.c
new file mode 100644
index 000000000000..cf7f576a5860
--- /dev/null
+++ b/arch/arm/mach-realview/realview_pb1176.c
@@ -0,0 +1,292 @@
1/*
2 * linux/arch/arm/mach-realview/realview_pb1176.c
3 *
4 * Copyright (C) 2008 ARM Limited
5 * Copyright (C) 2000 Deep Blue Solutions 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 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/init.h>
23#include <linux/platform_device.h>
24#include <linux/sysdev.h>
25#include <linux/amba/bus.h>
26
27#include <asm/hardware.h>
28#include <asm/io.h>
29#include <asm/irq.h>
30#include <asm/leds.h>
31#include <asm/mach-types.h>
32#include <asm/hardware/gic.h>
33#include <asm/hardware/icst307.h>
34#include <asm/hardware/cache-l2x0.h>
35
36#include <asm/mach/arch.h>
37#include <asm/mach/flash.h>
38#include <asm/mach/map.h>
39#include <asm/mach/mmc.h>
40#include <asm/mach/time.h>
41
42#include <asm/arch/board-pb1176.h>
43#include <asm/arch/irqs.h>
44
45#include "core.h"
46#include "clock.h"
47
48static struct map_desc realview_pb1176_io_desc[] __initdata = {
49 {
50 .virtual = IO_ADDRESS(REALVIEW_SYS_BASE),
51 .pfn = __phys_to_pfn(REALVIEW_SYS_BASE),
52 .length = SZ_4K,
53 .type = MT_DEVICE,
54 }, {
55 .virtual = IO_ADDRESS(REALVIEW_PB1176_GIC_CPU_BASE),
56 .pfn = __phys_to_pfn(REALVIEW_PB1176_GIC_CPU_BASE),
57 .length = SZ_4K,
58 .type = MT_DEVICE,
59 }, {
60 .virtual = IO_ADDRESS(REALVIEW_PB1176_GIC_DIST_BASE),
61 .pfn = __phys_to_pfn(REALVIEW_PB1176_GIC_DIST_BASE),
62 .length = SZ_4K,
63 .type = MT_DEVICE,
64 }, {
65 .virtual = IO_ADDRESS(REALVIEW_DC1176_GIC_CPU_BASE),
66 .pfn = __phys_to_pfn(REALVIEW_DC1176_GIC_CPU_BASE),
67 .length = SZ_4K,
68 .type = MT_DEVICE,
69 }, {
70 .virtual = IO_ADDRESS(REALVIEW_DC1176_GIC_DIST_BASE),
71 .pfn = __phys_to_pfn(REALVIEW_DC1176_GIC_DIST_BASE),
72 .length = SZ_4K,
73 .type = MT_DEVICE,
74 }, {
75 .virtual = IO_ADDRESS(REALVIEW_SCTL_BASE),
76 .pfn = __phys_to_pfn(REALVIEW_SCTL_BASE),
77 .length = SZ_4K,
78 .type = MT_DEVICE,
79 }, {
80 .virtual = IO_ADDRESS(REALVIEW_PB1176_TIMER0_1_BASE),
81 .pfn = __phys_to_pfn(REALVIEW_PB1176_TIMER0_1_BASE),
82 .length = SZ_4K,
83 .type = MT_DEVICE,
84 }, {
85 .virtual = IO_ADDRESS(REALVIEW_PB1176_TIMER2_3_BASE),
86 .pfn = __phys_to_pfn(REALVIEW_PB1176_TIMER2_3_BASE),
87 .length = SZ_4K,
88 .type = MT_DEVICE,
89 }, {
90 .virtual = IO_ADDRESS(REALVIEW_PB1176_L220_BASE),
91 .pfn = __phys_to_pfn(REALVIEW_PB1176_L220_BASE),
92 .length = SZ_8K,
93 .type = MT_DEVICE,
94 },
95#ifdef CONFIG_DEBUG_LL
96 {
97 .virtual = IO_ADDRESS(REALVIEW_PB1176_UART0_BASE),
98 .pfn = __phys_to_pfn(REALVIEW_PB1176_UART0_BASE),
99 .length = SZ_4K,
100 .type = MT_DEVICE,
101 },
102#endif
103};
104
105static void __init realview_pb1176_map_io(void)
106{
107 iotable_init(realview_pb1176_io_desc, ARRAY_SIZE(realview_pb1176_io_desc));
108}
109
110/*
111 * RealView PB1176 AMBA devices
112 */
113#define GPIO2_IRQ { IRQ_PB1176_GPIO2, NO_IRQ }
114#define GPIO2_DMA { 0, 0 }
115#define GPIO3_IRQ { IRQ_PB1176_GPIO3, NO_IRQ }
116#define GPIO3_DMA { 0, 0 }
117#define AACI_IRQ { IRQ_PB1176_AACI, NO_IRQ }
118#define AACI_DMA { 0x80, 0x81 }
119#define MMCI0_IRQ { IRQ_PB1176_MMCI0A, IRQ_PB1176_MMCI0B }
120#define MMCI0_DMA { 0x84, 0 }
121#define KMI0_IRQ { IRQ_PB1176_KMI0, NO_IRQ }
122#define KMI0_DMA { 0, 0 }
123#define KMI1_IRQ { IRQ_PB1176_KMI1, NO_IRQ }
124#define KMI1_DMA { 0, 0 }
125#define PB1176_SMC_IRQ { NO_IRQ, NO_IRQ }
126#define PB1176_SMC_DMA { 0, 0 }
127#define MPMC_IRQ { NO_IRQ, NO_IRQ }
128#define MPMC_DMA { 0, 0 }
129#define PB1176_CLCD_IRQ { IRQ_DC1176_CLCD, NO_IRQ }
130#define PB1176_CLCD_DMA { 0, 0 }
131#define DMAC_IRQ { IRQ_PB1176_DMAC, NO_IRQ }
132#define DMAC_DMA { 0, 0 }
133#define SCTL_IRQ { NO_IRQ, NO_IRQ }
134#define SCTL_DMA { 0, 0 }
135#define PB1176_WATCHDOG_IRQ { IRQ_DC1176_WATCHDOG, NO_IRQ }
136#define PB1176_WATCHDOG_DMA { 0, 0 }
137#define PB1176_GPIO0_IRQ { IRQ_PB1176_GPIO0, NO_IRQ }
138#define PB1176_GPIO0_DMA { 0, 0 }
139#define GPIO1_IRQ { IRQ_PB1176_GPIO1, NO_IRQ }
140#define GPIO1_DMA { 0, 0 }
141#define PB1176_RTC_IRQ { IRQ_DC1176_RTC, NO_IRQ }
142#define PB1176_RTC_DMA { 0, 0 }
143#define SCI_IRQ { IRQ_PB1176_SCI, NO_IRQ }
144#define SCI_DMA { 7, 6 }
145#define PB1176_UART0_IRQ { IRQ_DC1176_UART0, NO_IRQ }
146#define PB1176_UART0_DMA { 15, 14 }
147#define PB1176_UART1_IRQ { IRQ_DC1176_UART1, NO_IRQ }
148#define PB1176_UART1_DMA { 13, 12 }
149#define PB1176_UART2_IRQ { IRQ_DC1176_UART2, NO_IRQ }
150#define PB1176_UART2_DMA { 11, 10 }
151#define PB1176_UART3_IRQ { IRQ_DC1176_UART3, NO_IRQ }
152#define PB1176_UART3_DMA { 0x86, 0x87 }
153#define PB1176_SSP_IRQ { IRQ_PB1176_SSP, NO_IRQ }
154#define PB1176_SSP_DMA { 9, 8 }
155
156/* FPGA Primecells */
157AMBA_DEVICE(aaci, "fpga:04", AACI, NULL);
158AMBA_DEVICE(mmc0, "fpga:05", MMCI0, &realview_mmc0_plat_data);
159AMBA_DEVICE(kmi0, "fpga:06", KMI0, NULL);
160AMBA_DEVICE(kmi1, "fpga:07", KMI1, NULL);
161AMBA_DEVICE(uart3, "fpga:09", PB1176_UART3, NULL);
162
163/* DevChip Primecells */
164AMBA_DEVICE(smc, "dev:00", PB1176_SMC, NULL);
165AMBA_DEVICE(sctl, "dev:e0", SCTL, NULL);
166AMBA_DEVICE(wdog, "dev:e1", PB1176_WATCHDOG, NULL);
167AMBA_DEVICE(gpio0, "dev:e4", PB1176_GPIO0, NULL);
168AMBA_DEVICE(gpio1, "dev:e5", GPIO1, NULL);
169AMBA_DEVICE(gpio2, "dev:e6", GPIO2, NULL);
170AMBA_DEVICE(rtc, "dev:e8", PB1176_RTC, NULL);
171AMBA_DEVICE(sci0, "dev:f0", SCI, NULL);
172AMBA_DEVICE(uart0, "dev:f1", PB1176_UART0, NULL);
173AMBA_DEVICE(uart1, "dev:f2", PB1176_UART1, NULL);
174AMBA_DEVICE(uart2, "dev:f3", PB1176_UART2, NULL);
175AMBA_DEVICE(ssp0, "dev:f4", PB1176_SSP, NULL);
176
177/* Primecells on the NEC ISSP chip */
178AMBA_DEVICE(clcd, "issp:20", PB1176_CLCD, &clcd_plat_data);
179//AMBA_DEVICE(dmac, "issp:30", PB1176_DMAC, NULL);
180
181static struct amba_device *amba_devs[] __initdata = {
182// &dmac_device,
183 &uart0_device,
184 &uart1_device,
185 &uart2_device,
186 &uart3_device,
187 &smc_device,
188 &clcd_device,
189 &sctl_device,
190 &wdog_device,
191 &gpio0_device,
192 &gpio1_device,
193 &gpio2_device,
194 &rtc_device,
195 &sci0_device,
196 &ssp0_device,
197 &aaci_device,
198 &mmc0_device,
199 &kmi0_device,
200 &kmi1_device,
201};
202
203/*
204 * RealView PB1176 platform devices
205 */
206static struct resource realview_pb1176_flash_resource = {
207 .start = REALVIEW_PB1176_FLASH_BASE,
208 .end = REALVIEW_PB1176_FLASH_BASE + REALVIEW_PB1176_FLASH_SIZE - 1,
209 .flags = IORESOURCE_MEM,
210};
211
212static struct resource realview_pb1176_smsc911x_resources[] = {
213 [0] = {
214 .start = REALVIEW_PB1176_ETH_BASE,
215 .end = REALVIEW_PB1176_ETH_BASE + SZ_64K - 1,
216 .flags = IORESOURCE_MEM,
217 },
218 [1] = {
219 .start = IRQ_PB1176_ETH,
220 .end = IRQ_PB1176_ETH,
221 .flags = IORESOURCE_IRQ,
222 },
223};
224
225static struct platform_device realview_pb1176_smsc911x_device = {
226 .name = "smc911x",
227 .id = 0,
228 .num_resources = ARRAY_SIZE(realview_pb1176_smsc911x_resources),
229 .resource = realview_pb1176_smsc911x_resources,
230};
231
232static void __init gic_init_irq(void)
233{
234 /* ARM1176 DevChip GIC, primary */
235 gic_cpu_base_addr = __io_address(REALVIEW_DC1176_GIC_CPU_BASE);
236 gic_dist_init(0, __io_address(REALVIEW_DC1176_GIC_DIST_BASE), IRQ_DC1176_GIC_START);
237 gic_cpu_init(0, gic_cpu_base_addr);
238
239 /* board GIC, secondary */
240 gic_dist_init(1, __io_address(REALVIEW_PB1176_GIC_DIST_BASE), IRQ_PB1176_GIC_START);
241 gic_cpu_init(1, __io_address(REALVIEW_PB1176_GIC_CPU_BASE));
242 gic_cascade_irq(1, IRQ_DC1176_PB_IRQ1);
243}
244
245static void __init realview_pb1176_timer_init(void)
246{
247 timer0_va_base = __io_address(REALVIEW_PB1176_TIMER0_1_BASE);
248 timer1_va_base = __io_address(REALVIEW_PB1176_TIMER0_1_BASE) + 0x20;
249 timer2_va_base = __io_address(REALVIEW_PB1176_TIMER2_3_BASE);
250 timer3_va_base = __io_address(REALVIEW_PB1176_TIMER2_3_BASE) + 0x20;
251
252 realview_timer_init(IRQ_DC1176_TIMER0);
253}
254
255static struct sys_timer realview_pb1176_timer = {
256 .init = realview_pb1176_timer_init,
257};
258
259static void __init realview_pb1176_init(void)
260{
261 int i;
262
263#ifdef CONFIG_CACHE_L2X0
264 /* 128Kb (16Kb/way) 8-way associativity. evmon/parity/share enabled. */
265 l2x0_init(__io_address(REALVIEW_PB1176_L220_BASE), 0x00730000, 0xfe000fff);
266#endif
267
268 clk_register(&realview_clcd_clk);
269
270 realview_flash_register(&realview_pb1176_flash_resource, 1);
271 platform_device_register(&realview_pb1176_smsc911x_device);
272
273 for (i = 0; i < ARRAY_SIZE(amba_devs); i++) {
274 struct amba_device *d = amba_devs[i];
275 amba_device_register(d, &iomem_resource);
276 }
277
278#ifdef CONFIG_LEDS
279 leds_event = realview_leds_event;
280#endif
281}
282
283MACHINE_START(REALVIEW_PB1176, "ARM-RealView PB1176")
284 /* Maintainer: ARM Ltd/Deep Blue Solutions Ltd */
285 .phys_io = REALVIEW_PB1176_UART0_BASE,
286 .io_pg_offst = (IO_ADDRESS(REALVIEW_PB1176_UART0_BASE) >> 18) & 0xfffc,
287 .boot_params = 0x00000100,
288 .map_io = realview_pb1176_map_io,
289 .init_irq = gic_init_irq,
290 .timer = &realview_pb1176_timer,
291 .init_machine = realview_pb1176_init,
292MACHINE_END
diff --git a/arch/arm/mach-realview/realview_pb11mp.c b/arch/arm/mach-realview/realview_pb11mp.c
new file mode 100644
index 000000000000..f7ce1c5a178a
--- /dev/null
+++ b/arch/arm/mach-realview/realview_pb11mp.c
@@ -0,0 +1,342 @@
1/*
2 * linux/arch/arm/mach-realview/realview_pb11mp.c
3 *
4 * Copyright (C) 2008 ARM Limited
5 * Copyright (C) 2000 Deep Blue Solutions 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 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/init.h>
23#include <linux/platform_device.h>
24#include <linux/sysdev.h>
25#include <linux/amba/bus.h>
26
27#include <asm/hardware.h>
28#include <asm/io.h>
29#include <asm/irq.h>
30#include <asm/leds.h>
31#include <asm/mach-types.h>
32#include <asm/hardware/gic.h>
33#include <asm/hardware/icst307.h>
34#include <asm/hardware/cache-l2x0.h>
35
36#include <asm/mach/arch.h>
37#include <asm/mach/flash.h>
38#include <asm/mach/map.h>
39#include <asm/mach/mmc.h>
40#include <asm/mach/time.h>
41
42#include <asm/arch/board-pb11mp.h>
43#include <asm/arch/irqs.h>
44
45#include "core.h"
46#include "clock.h"
47
48static struct map_desc realview_pb11mp_io_desc[] __initdata = {
49 {
50 .virtual = IO_ADDRESS(REALVIEW_SYS_BASE),
51 .pfn = __phys_to_pfn(REALVIEW_SYS_BASE),
52 .length = SZ_4K,
53 .type = MT_DEVICE,
54 }, {
55 .virtual = IO_ADDRESS(REALVIEW_PB11MP_GIC_CPU_BASE),
56 .pfn = __phys_to_pfn(REALVIEW_PB11MP_GIC_CPU_BASE),
57 .length = SZ_4K,
58 .type = MT_DEVICE,
59 }, {
60 .virtual = IO_ADDRESS(REALVIEW_PB11MP_GIC_DIST_BASE),
61 .pfn = __phys_to_pfn(REALVIEW_PB11MP_GIC_DIST_BASE),
62 .length = SZ_4K,
63 .type = MT_DEVICE,
64 }, {
65 .virtual = IO_ADDRESS(REALVIEW_TC11MP_GIC_CPU_BASE),
66 .pfn = __phys_to_pfn(REALVIEW_TC11MP_GIC_CPU_BASE),
67 .length = SZ_4K,
68 .type = MT_DEVICE,
69 }, {
70 .virtual = IO_ADDRESS(REALVIEW_TC11MP_GIC_DIST_BASE),
71 .pfn = __phys_to_pfn(REALVIEW_TC11MP_GIC_DIST_BASE),
72 .length = SZ_4K,
73 .type = MT_DEVICE,
74 }, {
75 .virtual = IO_ADDRESS(REALVIEW_SCTL_BASE),
76 .pfn = __phys_to_pfn(REALVIEW_SCTL_BASE),
77 .length = SZ_4K,
78 .type = MT_DEVICE,
79 }, {
80 .virtual = IO_ADDRESS(REALVIEW_PB11MP_TIMER0_1_BASE),
81 .pfn = __phys_to_pfn(REALVIEW_PB11MP_TIMER0_1_BASE),
82 .length = SZ_4K,
83 .type = MT_DEVICE,
84 }, {
85 .virtual = IO_ADDRESS(REALVIEW_PB11MP_TIMER2_3_BASE),
86 .pfn = __phys_to_pfn(REALVIEW_PB11MP_TIMER2_3_BASE),
87 .length = SZ_4K,
88 .type = MT_DEVICE,
89 }, {
90 .virtual = IO_ADDRESS(REALVIEW_TC11MP_L220_BASE),
91 .pfn = __phys_to_pfn(REALVIEW_TC11MP_L220_BASE),
92 .length = SZ_8K,
93 .type = MT_DEVICE,
94 },
95#ifdef CONFIG_DEBUG_LL
96 {
97 .virtual = IO_ADDRESS(REALVIEW_PB11MP_UART0_BASE),
98 .pfn = __phys_to_pfn(REALVIEW_PB11MP_UART0_BASE),
99 .length = SZ_4K,
100 .type = MT_DEVICE,
101 },
102#endif
103};
104
105static void __init realview_pb11mp_map_io(void)
106{
107 iotable_init(realview_pb11mp_io_desc, ARRAY_SIZE(realview_pb11mp_io_desc));
108}
109
110/*
111 * RealView PB11MPCore AMBA devices
112 */
113
114#define GPIO2_IRQ { IRQ_PB11MP_GPIO2, NO_IRQ }
115#define GPIO2_DMA { 0, 0 }
116#define GPIO3_IRQ { IRQ_PB11MP_GPIO3, NO_IRQ }
117#define GPIO3_DMA { 0, 0 }
118#define AACI_IRQ { IRQ_TC11MP_AACI, NO_IRQ }
119#define AACI_DMA { 0x80, 0x81 }
120#define MMCI0_IRQ { IRQ_TC11MP_MMCI0A, IRQ_TC11MP_MMCI0B }
121#define MMCI0_DMA { 0x84, 0 }
122#define KMI0_IRQ { IRQ_TC11MP_KMI0, NO_IRQ }
123#define KMI0_DMA { 0, 0 }
124#define KMI1_IRQ { IRQ_TC11MP_KMI1, NO_IRQ }
125#define KMI1_DMA { 0, 0 }
126#define PB11MP_SMC_IRQ { NO_IRQ, NO_IRQ }
127#define PB11MP_SMC_DMA { 0, 0 }
128#define MPMC_IRQ { NO_IRQ, NO_IRQ }
129#define MPMC_DMA { 0, 0 }
130#define PB11MP_CLCD_IRQ { IRQ_PB11MP_CLCD, NO_IRQ }
131#define PB11MP_CLCD_DMA { 0, 0 }
132#define DMAC_IRQ { IRQ_PB11MP_DMAC, NO_IRQ }
133#define DMAC_DMA { 0, 0 }
134#define SCTL_IRQ { NO_IRQ, NO_IRQ }
135#define SCTL_DMA { 0, 0 }
136#define PB11MP_WATCHDOG_IRQ { IRQ_PB11MP_WATCHDOG, NO_IRQ }
137#define PB11MP_WATCHDOG_DMA { 0, 0 }
138#define PB11MP_GPIO0_IRQ { IRQ_PB11MP_GPIO0, NO_IRQ }
139#define PB11MP_GPIO0_DMA { 0, 0 }
140#define GPIO1_IRQ { IRQ_PB11MP_GPIO1, NO_IRQ }
141#define GPIO1_DMA { 0, 0 }
142#define PB11MP_RTC_IRQ { IRQ_TC11MP_RTC, NO_IRQ }
143#define PB11MP_RTC_DMA { 0, 0 }
144#define SCI_IRQ { IRQ_PB11MP_SCI, NO_IRQ }
145#define SCI_DMA { 7, 6 }
146#define PB11MP_UART0_IRQ { IRQ_TC11MP_UART0, NO_IRQ }
147#define PB11MP_UART0_DMA { 15, 14 }
148#define PB11MP_UART1_IRQ { IRQ_TC11MP_UART1, NO_IRQ }
149#define PB11MP_UART1_DMA { 13, 12 }
150#define PB11MP_UART2_IRQ { IRQ_PB11MP_UART2, NO_IRQ }
151#define PB11MP_UART2_DMA { 11, 10 }
152#define PB11MP_UART3_IRQ { IRQ_PB11MP_UART3, NO_IRQ }
153#define PB11MP_UART3_DMA { 0x86, 0x87 }
154#define PB11MP_SSP_IRQ { IRQ_PB11MP_SSP, NO_IRQ }
155#define PB11MP_SSP_DMA { 9, 8 }
156
157/* FPGA Primecells */
158AMBA_DEVICE(aaci, "fpga:04", AACI, NULL);
159AMBA_DEVICE(mmc0, "fpga:05", MMCI0, &realview_mmc0_plat_data);
160AMBA_DEVICE(kmi0, "fpga:06", KMI0, NULL);
161AMBA_DEVICE(kmi1, "fpga:07", KMI1, NULL);
162AMBA_DEVICE(uart3, "fpga:09", PB11MP_UART3, NULL);
163
164/* DevChip Primecells */
165AMBA_DEVICE(smc, "dev:00", PB11MP_SMC, NULL);
166AMBA_DEVICE(sctl, "dev:e0", SCTL, NULL);
167AMBA_DEVICE(wdog, "dev:e1", PB11MP_WATCHDOG, NULL);
168AMBA_DEVICE(gpio0, "dev:e4", PB11MP_GPIO0, NULL);
169AMBA_DEVICE(gpio1, "dev:e5", GPIO1, NULL);
170AMBA_DEVICE(gpio2, "dev:e6", GPIO2, NULL);
171AMBA_DEVICE(rtc, "dev:e8", PB11MP_RTC, NULL);
172AMBA_DEVICE(sci0, "dev:f0", SCI, NULL);
173AMBA_DEVICE(uart0, "dev:f1", PB11MP_UART0, NULL);
174AMBA_DEVICE(uart1, "dev:f2", PB11MP_UART1, NULL);
175AMBA_DEVICE(uart2, "dev:f3", PB11MP_UART2, NULL);
176AMBA_DEVICE(ssp0, "dev:f4", PB11MP_SSP, NULL);
177
178/* Primecells on the NEC ISSP chip */
179AMBA_DEVICE(clcd, "issp:20", PB11MP_CLCD, &clcd_plat_data);
180AMBA_DEVICE(dmac, "issp:30", DMAC, NULL);
181
182static struct amba_device *amba_devs[] __initdata = {
183 &dmac_device,
184 &uart0_device,
185 &uart1_device,
186 &uart2_device,
187 &uart3_device,
188 &smc_device,
189 &clcd_device,
190 &sctl_device,
191 &wdog_device,
192 &gpio0_device,
193 &gpio1_device,
194 &gpio2_device,
195 &rtc_device,
196 &sci0_device,
197 &ssp0_device,
198 &aaci_device,
199 &mmc0_device,
200 &kmi0_device,
201 &kmi1_device,
202};
203
204/*
205 * RealView PB11MPCore platform devices
206 */
207static struct resource realview_pb11mp_flash_resource[] = {
208 [0] = {
209 .start = REALVIEW_PB11MP_FLASH0_BASE,
210 .end = REALVIEW_PB11MP_FLASH0_BASE + REALVIEW_PB11MP_FLASH0_SIZE - 1,
211 .flags = IORESOURCE_MEM,
212 },
213 [1] = {
214 .start = REALVIEW_PB11MP_FLASH1_BASE,
215 .end = REALVIEW_PB11MP_FLASH1_BASE + REALVIEW_PB11MP_FLASH1_SIZE - 1,
216 .flags = IORESOURCE_MEM,
217 },
218};
219
220static struct resource realview_pb11mp_smsc911x_resources[] = {
221 [0] = {
222 .start = REALVIEW_PB11MP_ETH_BASE,
223 .end = REALVIEW_PB11MP_ETH_BASE + SZ_64K - 1,
224 .flags = IORESOURCE_MEM,
225 },
226 [1] = {
227 .start = IRQ_TC11MP_ETH,
228 .end = IRQ_TC11MP_ETH,
229 .flags = IORESOURCE_IRQ,
230 },
231};
232
233static struct platform_device realview_pb11mp_smsc911x_device = {
234 .name = "smc911x",
235 .id = 0,
236 .num_resources = ARRAY_SIZE(realview_pb11mp_smsc911x_resources),
237 .resource = realview_pb11mp_smsc911x_resources,
238};
239
240struct resource realview_pb11mp_cf_resources[] = {
241 [0] = {
242 .start = REALVIEW_PB11MP_CF_BASE,
243 .end = REALVIEW_PB11MP_CF_BASE + SZ_4K - 1,
244 .flags = IORESOURCE_MEM,
245 },
246 [1] = {
247 .start = REALVIEW_PB11MP_CF_MEM_BASE,
248 .end = REALVIEW_PB11MP_CF_MEM_BASE + SZ_4K - 1,
249 .flags = IORESOURCE_MEM,
250 },
251 [2] = {
252 .start = -1, /* FIXME: Find correct irq */
253 .end = -1,
254 .flags = IORESOURCE_IRQ,
255 },
256};
257
258struct platform_device realview_pb11mp_cf_device = {
259 .name = "compactflash",
260 .id = 0,
261 .num_resources = ARRAY_SIZE(realview_pb11mp_cf_resources),
262 .resource = realview_pb11mp_cf_resources,
263};
264
265static void __init gic_init_irq(void)
266{
267 unsigned int pldctrl;
268
269 /* new irq mode with no DCC */
270 writel(0x0000a05f, __io_address(REALVIEW_SYS_LOCK));
271 pldctrl = readl(__io_address(REALVIEW_SYS_BASE) + REALVIEW_PB11MP_SYS_PLD_CTRL1);
272 pldctrl |= 2 << 22;
273 writel(pldctrl, __io_address(REALVIEW_SYS_BASE) + REALVIEW_PB11MP_SYS_PLD_CTRL1);
274 writel(0x00000000, __io_address(REALVIEW_SYS_LOCK));
275
276 /* ARM11MPCore test chip GIC, primary */
277 gic_cpu_base_addr = __io_address(REALVIEW_TC11MP_GIC_CPU_BASE);
278 gic_dist_init(0, __io_address(REALVIEW_TC11MP_GIC_DIST_BASE), 29);
279 gic_cpu_init(0, gic_cpu_base_addr);
280
281 /* board GIC, secondary */
282 gic_dist_init(1, __io_address(REALVIEW_PB11MP_GIC_DIST_BASE), IRQ_PB11MP_GIC_START);
283 gic_cpu_init(1, __io_address(REALVIEW_PB11MP_GIC_CPU_BASE));
284 gic_cascade_irq(1, IRQ_TC11MP_PB_IRQ1);
285}
286
287static void __init realview_pb11mp_timer_init(void)
288{
289 timer0_va_base = __io_address(REALVIEW_PB11MP_TIMER0_1_BASE);
290 timer1_va_base = __io_address(REALVIEW_PB11MP_TIMER0_1_BASE) + 0x20;
291 timer2_va_base = __io_address(REALVIEW_PB11MP_TIMER2_3_BASE);
292 timer3_va_base = __io_address(REALVIEW_PB11MP_TIMER2_3_BASE) + 0x20;
293
294#ifdef CONFIG_LOCAL_TIMERS
295 twd_base_addr = __io_address(REALVIEW_TC11MP_TWD_BASE);
296 twd_size = REALVIEW_TC11MP_TWD_SIZE;
297#endif
298 realview_timer_init(IRQ_TC11MP_TIMER0_1);
299}
300
301static struct sys_timer realview_pb11mp_timer = {
302 .init = realview_pb11mp_timer_init,
303};
304
305static void __init realview_pb11mp_init(void)
306{
307 int i;
308
309#ifdef CONFIG_CACHE_L2X0
310 /* 1MB (128KB/way), 8-way associativity, evmon/parity/share enabled
311 * Bits: .... ...0 0111 1001 0000 .... .... .... */
312 l2x0_init(__io_address(REALVIEW_TC11MP_L220_BASE), 0x00790000, 0xfe000fff);
313#endif
314
315 clk_register(&realview_clcd_clk);
316
317 realview_flash_register(realview_pb11mp_flash_resource,
318 ARRAY_SIZE(realview_pb11mp_flash_resource));
319 platform_device_register(&realview_pb11mp_smsc911x_device);
320 platform_device_register(&realview_i2c_device);
321 platform_device_register(&realview_pb11mp_cf_device);
322
323 for (i = 0; i < ARRAY_SIZE(amba_devs); i++) {
324 struct amba_device *d = amba_devs[i];
325 amba_device_register(d, &iomem_resource);
326 }
327
328#ifdef CONFIG_LEDS
329 leds_event = realview_leds_event;
330#endif
331}
332
333MACHINE_START(REALVIEW_PB11MP, "ARM-RealView PB11MPCore")
334 /* Maintainer: ARM Ltd/Deep Blue Solutions Ltd */
335 .phys_io = REALVIEW_PB11MP_UART0_BASE,
336 .io_pg_offst = (IO_ADDRESS(REALVIEW_PB11MP_UART0_BASE) >> 18) & 0xfffc,
337 .boot_params = 0x00000100,
338 .map_io = realview_pb11mp_map_io,
339 .init_irq = gic_init_irq,
340 .timer = &realview_pb11mp_timer,
341 .init_machine = realview_pb11mp_init,
342MACHINE_END
diff --git a/arch/arm/mach-s3c2410/Kconfig b/arch/arm/mach-s3c2410/Kconfig
index e2079cf9266f..cd3dc0834b3b 100644
--- a/arch/arm/mach-s3c2410/Kconfig
+++ b/arch/arm/mach-s3c2410/Kconfig
@@ -97,6 +97,13 @@ config BAST_PC104_IRQ
97 Say Y here to enable the PC104 IRQ routing on the 97 Say Y here to enable the PC104 IRQ routing on the
98 Simtec BAST (EB2410ITX) 98 Simtec BAST (EB2410ITX)
99 99
100config MACH_TCT_HAMMER
101 bool "TCT Hammer Board"
102 select CPU_S3C2410
103 help
104 Say Y here if you are using the TinCanTools Hammer Board
105 <http://www.tincantools.com>
106
100config MACH_VR1000 107config MACH_VR1000
101 bool "Thorcom VR1000" 108 bool "Thorcom VR1000"
102 select PM_SIMTEC if PM 109 select PM_SIMTEC if PM
diff --git a/arch/arm/mach-s3c2410/Makefile b/arch/arm/mach-s3c2410/Makefile
index 3e7a85594d9c..cabc13ce09e4 100644
--- a/arch/arm/mach-s3c2410/Makefile
+++ b/arch/arm/mach-s3c2410/Makefile
@@ -27,5 +27,6 @@ obj-$(CONFIG_ARCH_BAST) += mach-bast.o usb-simtec.o
27obj-$(CONFIG_MACH_OTOM) += mach-otom.o 27obj-$(CONFIG_MACH_OTOM) += mach-otom.o
28obj-$(CONFIG_MACH_AML_M5900) += mach-amlm5900.o 28obj-$(CONFIG_MACH_AML_M5900) += mach-amlm5900.o
29obj-$(CONFIG_BAST_PC104_IRQ) += bast-irq.o 29obj-$(CONFIG_BAST_PC104_IRQ) += bast-irq.o
30obj-$(CONFIG_MACH_TCT_HAMMER) += mach-tct_hammer.o
30obj-$(CONFIG_MACH_VR1000) += mach-vr1000.o usb-simtec.o 31obj-$(CONFIG_MACH_VR1000) += mach-vr1000.o usb-simtec.o
31obj-$(CONFIG_MACH_QT2410) += mach-qt2410.o 32obj-$(CONFIG_MACH_QT2410) += mach-qt2410.o
diff --git a/arch/arm/mach-s3c2410/mach-bast.c b/arch/arm/mach-s3c2410/mach-bast.c
index 66175471fff3..661a2358ac22 100644
--- a/arch/arm/mach-s3c2410/mach-bast.c
+++ b/arch/arm/mach-s3c2410/mach-bast.c
@@ -16,6 +16,7 @@
16#include <linux/list.h> 16#include <linux/list.h>
17#include <linux/timer.h> 17#include <linux/timer.h>
18#include <linux/init.h> 18#include <linux/init.h>
19#include <linux/sysdev.h>
19#include <linux/serial_core.h> 20#include <linux/serial_core.h>
20#include <linux/platform_device.h> 21#include <linux/platform_device.h>
21#include <linux/dm9000.h> 22#include <linux/dm9000.h>
@@ -236,6 +237,36 @@ static struct platform_device bast_device_nor = {
236 237
237/* NAND Flash on BAST board */ 238/* NAND Flash on BAST board */
238 239
240#ifdef CONFIG_PM
241static int bast_pm_suspend(struct sys_device *sd, pm_message_t state)
242{
243 /* ensure that an nRESET is not generated on resume. */
244 s3c2410_gpio_setpin(S3C2410_GPA21, 1);
245 s3c2410_gpio_cfgpin(S3C2410_GPA21, S3C2410_GPA21_OUT);
246
247 return 0;
248}
249
250static int bast_pm_resume(struct sys_device *sd)
251{
252 s3c2410_gpio_cfgpin(S3C2410_GPA21, S3C2410_GPA21_nRSTOUT);
253 return 0;
254}
255
256#else
257#define bast_pm_suspend NULL
258#define bast_pm_resume NULL
259#endif
260
261static struct sysdev_class bast_pm_sysclass = {
262 .name = "mach-bast",
263 .suspend = bast_pm_suspend,
264 .resume = bast_pm_resume,
265};
266
267static struct sys_device bast_pm_sysdev = {
268 .cls = &bast_pm_sysclass,
269};
239 270
240static int smartmedia_map[] = { 0 }; 271static int smartmedia_map[] = { 0 };
241static int chip0_map[] = { 1 }; 272static int chip0_map[] = { 1 };
@@ -561,10 +592,10 @@ static void __init bast_map_io(void)
561{ 592{
562 /* initialise the clocks */ 593 /* initialise the clocks */
563 594
564 s3c24xx_dclk0.parent = NULL; 595 s3c24xx_dclk0.parent = &clk_upll;
565 s3c24xx_dclk0.rate = 12*1000*1000; 596 s3c24xx_dclk0.rate = 12*1000*1000;
566 597
567 s3c24xx_dclk1.parent = NULL; 598 s3c24xx_dclk1.parent = &clk_upll;
568 s3c24xx_dclk1.rate = 24*1000*1000; 599 s3c24xx_dclk1.rate = 24*1000*1000;
569 600
570 s3c24xx_clkout0.parent = &s3c24xx_dclk0; 601 s3c24xx_clkout0.parent = &s3c24xx_dclk0;
@@ -586,6 +617,9 @@ static void __init bast_map_io(void)
586 617
587static void __init bast_init(void) 618static void __init bast_init(void)
588{ 619{
620 sysdev_class_register(&bast_pm_sysclass);
621 sysdev_register(&bast_pm_sysdev);
622
589 s3c24xx_fb_set_platdata(&bast_fb_info); 623 s3c24xx_fb_set_platdata(&bast_fb_info);
590 platform_add_devices(bast_devices, ARRAY_SIZE(bast_devices)); 624 platform_add_devices(bast_devices, ARRAY_SIZE(bast_devices));
591} 625}
diff --git a/arch/arm/mach-s3c2410/mach-tct_hammer.c b/arch/arm/mach-s3c2410/mach-tct_hammer.c
new file mode 100644
index 000000000000..d90d445ccfb4
--- /dev/null
+++ b/arch/arm/mach-s3c2410/mach-tct_hammer.c
@@ -0,0 +1,160 @@
1/* linux/arch/arm/mach-s3c2410/mach-tct_hammer.c
2 *
3 * Copyright (c) 2007 TinCanTools
4 * David Anders <danders@amltd.com>
5
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License as
8 * published by the Free Software Foundation; either version 2 of
9 * the License, or (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
19 * MA 02111-1307 USA
20 *
21 * @History:
22 * derived from linux/arch/arm/mach-s3c2410/mach-bast.c, written by
23 * Ben Dooks <ben@simtec.co.uk>
24 *
25 ***********************************************************************/
26
27#include <linux/kernel.h>
28#include <linux/types.h>
29#include <linux/interrupt.h>
30#include <linux/list.h>
31#include <linux/timer.h>
32#include <linux/init.h>
33#include <linux/device.h>
34#include <linux/platform_device.h>
35#include <linux/serial_core.h>
36
37#include <asm/mach/arch.h>
38#include <asm/mach/map.h>
39#include <asm/mach/irq.h>
40#include <asm/mach/flash.h>
41
42#include <asm/hardware.h>
43#include <asm/io.h>
44#include <asm/irq.h>
45#include <asm/mach-types.h>
46
47#include <asm/plat-s3c/regs-serial.h>
48#include <asm/plat-s3c24xx/devs.h>
49#include <asm/plat-s3c24xx/cpu.h>
50
51#ifdef CONFIG_MTD_PARTITIONS
52
53#include <linux/mtd/mtd.h>
54#include <linux/mtd/partitions.h>
55#include <linux/mtd/map.h>
56#include <linux/mtd/physmap.h>
57
58static struct resource tct_hammer_nor_resource = {
59 .start = 0x00000000,
60 .end = 0x01000000 - 1,
61 .flags = IORESOURCE_MEM,
62};
63
64static struct mtd_partition tct_hammer_mtd_partitions[] = {
65 {
66 .name = "System",
67 .size = 0x240000,
68 .offset = 0,
69 .mask_flags = MTD_WRITEABLE, /* force read-only */
70 }, {
71 .name = "JFFS2",
72 .size = MTDPART_SIZ_FULL,
73 .offset = MTDPART_OFS_APPEND,
74 }
75};
76
77static struct physmap_flash_data tct_hammer_flash_data = {
78 .width = 2,
79 .parts = tct_hammer_mtd_partitions,
80 .nr_parts = ARRAY_SIZE(tct_hammer_mtd_partitions),
81};
82
83static struct platform_device tct_hammer_device_nor = {
84 .name = "physmap-flash",
85 .id = 0,
86 .dev = {
87 .platform_data = &tct_hammer_flash_data,
88 },
89 .num_resources = 1,
90 .resource = &tct_hammer_nor_resource,
91};
92
93#endif
94
95static struct map_desc tct_hammer_iodesc[] __initdata = {
96};
97
98#define UCON S3C2410_UCON_DEFAULT
99#define ULCON S3C2410_LCON_CS8 | S3C2410_LCON_PNONE | S3C2410_LCON_STOPB
100#define UFCON S3C2410_UFCON_RXTRIG8 | S3C2410_UFCON_FIFOMODE
101
102static struct s3c2410_uartcfg tct_hammer_uartcfgs[] = {
103 [0] = {
104 .hwport = 0,
105 .flags = 0,
106 .ucon = UCON,
107 .ulcon = ULCON,
108 .ufcon = UFCON,
109 },
110 [1] = {
111 .hwport = 1,
112 .flags = 0,
113 .ucon = UCON,
114 .ulcon = ULCON,
115 .ufcon = UFCON,
116 },
117 [2] = {
118 .hwport = 2,
119 .flags = 0,
120 .ucon = UCON,
121 .ulcon = ULCON,
122 .ufcon = UFCON,
123 }
124};
125
126
127static struct platform_device *tct_hammer_devices[] __initdata = {
128 &s3c_device_adc,
129 &s3c_device_wdt,
130 &s3c_device_i2c,
131 &s3c_device_usb,
132 &s3c_device_rtc,
133 &s3c_device_usbgadget,
134 &s3c_device_sdi,
135#ifdef CONFIG_MTD_PARTITIONS
136 &tct_hammer_device_nor,
137#endif
138};
139
140static void __init tct_hammer_map_io(void)
141{
142 s3c24xx_init_io(tct_hammer_iodesc, ARRAY_SIZE(tct_hammer_iodesc));
143 s3c24xx_init_clocks(0);
144 s3c24xx_init_uarts(tct_hammer_uartcfgs, ARRAY_SIZE(tct_hammer_uartcfgs));
145}
146
147static void __init tct_hammer_init(void)
148{
149 platform_add_devices(tct_hammer_devices, ARRAY_SIZE(tct_hammer_devices));
150}
151
152MACHINE_START(TCT_HAMMER, "TCT_HAMMER")
153 .phys_io = S3C2410_PA_UART,
154 .io_pg_offst = (((u32)S3C24XX_VA_UART) >> 18) & 0xfffc,
155 .boot_params = S3C2410_SDRAM_PA + 0x100,
156 .map_io = tct_hammer_map_io,
157 .init_irq = s3c24xx_init_irq,
158 .init_machine = tct_hammer_init,
159 .timer = &s3c24xx_timer,
160MACHINE_END
diff --git a/arch/arm/mach-s3c2410/mach-vr1000.c b/arch/arm/mach-s3c2410/mach-vr1000.c
index 3aade7b78fe5..c56423373ff3 100644
--- a/arch/arm/mach-s3c2410/mach-vr1000.c
+++ b/arch/arm/mach-s3c2410/mach-vr1000.c
@@ -393,7 +393,7 @@ static void __init vr1000_map_io(void)
393{ 393{
394 /* initialise clock sources */ 394 /* initialise clock sources */
395 395
396 s3c24xx_dclk0.parent = NULL; 396 s3c24xx_dclk0.parent = &clk_upll;
397 s3c24xx_dclk0.rate = 12*1000*1000; 397 s3c24xx_dclk0.rate = 12*1000*1000;
398 398
399 s3c24xx_dclk1.parent = NULL; 399 s3c24xx_dclk1.parent = NULL;
diff --git a/arch/arm/mach-s3c2412/s3c2412.c b/arch/arm/mach-s3c2412/s3c2412.c
index abf1599c9f97..98a0de924c22 100644
--- a/arch/arm/mach-s3c2412/s3c2412.c
+++ b/arch/arm/mach-s3c2412/s3c2412.c
@@ -175,7 +175,7 @@ void __init s3c2412_init_clocks(int xtal)
175 /* work out clock scalings */ 175 /* work out clock scalings */
176 176
177 hclk = fclk / ((tmp & S3C2412_CLKDIVN_HDIVN_MASK) + 1); 177 hclk = fclk / ((tmp & S3C2412_CLKDIVN_HDIVN_MASK) + 1);
178 hclk /= ((tmp & S3C2421_CLKDIVN_ARMDIVN) ? 2 : 1); 178 hclk /= ((tmp & S3C2412_CLKDIVN_ARMDIVN) ? 2 : 1);
179 pclk = hclk / ((tmp & S3C2412_CLKDIVN_PDIVN) ? 2 : 1); 179 pclk = hclk / ((tmp & S3C2412_CLKDIVN_PDIVN) ? 2 : 1);
180 180
181 /* print brieft summary of clocks, etc */ 181 /* print brieft summary of clocks, etc */
diff --git a/arch/arm/mach-s3c2440/mach-anubis.c b/arch/arm/mach-s3c2440/mach-anubis.c
index 3d3dfa95db8e..47258915a2f9 100644
--- a/arch/arm/mach-s3c2440/mach-anubis.c
+++ b/arch/arm/mach-s3c2440/mach-anubis.c
@@ -413,10 +413,10 @@ static void __init anubis_map_io(void)
413{ 413{
414 /* initialise the clocks */ 414 /* initialise the clocks */
415 415
416 s3c24xx_dclk0.parent = NULL; 416 s3c24xx_dclk0.parent = &clk_upll;
417 s3c24xx_dclk0.rate = 12*1000*1000; 417 s3c24xx_dclk0.rate = 12*1000*1000;
418 418
419 s3c24xx_dclk1.parent = NULL; 419 s3c24xx_dclk1.parent = &clk_upll;
420 s3c24xx_dclk1.rate = 24*1000*1000; 420 s3c24xx_dclk1.rate = 24*1000*1000;
421 421
422 s3c24xx_clkout0.parent = &s3c24xx_dclk0; 422 s3c24xx_clkout0.parent = &s3c24xx_dclk0;
diff --git a/arch/arm/mach-s3c2440/mach-osiris.c b/arch/arm/mach-s3c2440/mach-osiris.c
index 78af7664988b..8a8acdbd072d 100644
--- a/arch/arm/mach-s3c2440/mach-osiris.c
+++ b/arch/arm/mach-s3c2440/mach-osiris.c
@@ -18,6 +18,7 @@
18#include <linux/device.h> 18#include <linux/device.h>
19#include <linux/sysdev.h> 19#include <linux/sysdev.h>
20#include <linux/serial_core.h> 20#include <linux/serial_core.h>
21#include <linux/clk.h>
21 22
22#include <asm/mach/arch.h> 23#include <asm/mach/arch.h>
23#include <asm/mach/map.h> 24#include <asm/mach/map.h>
@@ -344,10 +345,10 @@ static void __init osiris_map_io(void)
344 345
345 /* initialise the clocks */ 346 /* initialise the clocks */
346 347
347 s3c24xx_dclk0.parent = NULL; 348 s3c24xx_dclk0.parent = &clk_upll;
348 s3c24xx_dclk0.rate = 12*1000*1000; 349 s3c24xx_dclk0.rate = 12*1000*1000;
349 350
350 s3c24xx_dclk1.parent = NULL; 351 s3c24xx_dclk1.parent = &clk_upll;
351 s3c24xx_dclk1.rate = 24*1000*1000; 352 s3c24xx_dclk1.rate = 24*1000*1000;
352 353
353 s3c24xx_clkout0.parent = &s3c24xx_dclk0; 354 s3c24xx_clkout0.parent = &s3c24xx_dclk0;
diff --git a/arch/arm/mach-sa1100/Makefile b/arch/arm/mach-sa1100/Makefile
index 7a61e8d33ab7..8e0244631d65 100644
--- a/arch/arm/mach-sa1100/Makefile
+++ b/arch/arm/mach-sa1100/Makefile
@@ -3,7 +3,7 @@
3# 3#
4 4
5# Common support 5# Common support
6obj-y := clock.o generic.o irq.o dma.o time.o #nmi-oopser.o 6obj-y := clock.o generic.o gpio.o irq.o dma.o time.o #nmi-oopser.o
7obj-m := 7obj-m :=
8obj-n := 8obj-n :=
9obj- := 9obj- :=
diff --git a/arch/arm/mach-sa1100/generic.c b/arch/arm/mach-sa1100/generic.c
index 5c84c604ed86..0c2fa1c4fb4c 100644
--- a/arch/arm/mach-sa1100/generic.c
+++ b/arch/arm/mach-sa1100/generic.c
@@ -139,37 +139,6 @@ unsigned long long sched_clock(void)
139 return v; 139 return v;
140} 140}
141 141
142int gpio_direction_input(unsigned gpio)
143{
144 unsigned long flags;
145
146 if (gpio > GPIO_MAX)
147 return -EINVAL;
148
149 local_irq_save(flags);
150 GPDR &= ~GPIO_GPIO(gpio);
151 local_irq_restore(flags);
152 return 0;
153}
154
155EXPORT_SYMBOL(gpio_direction_input);
156
157int gpio_direction_output(unsigned gpio, int value)
158{
159 unsigned long flags;
160
161 if (gpio > GPIO_MAX)
162 return -EINVAL;
163
164 local_irq_save(flags);
165 gpio_set_value(gpio, value);
166 GPDR |= GPIO_GPIO(gpio);
167 local_irq_restore(flags);
168 return 0;
169}
170
171EXPORT_SYMBOL(gpio_direction_output);
172
173/* 142/*
174 * Default power-off for SA1100 143 * Default power-off for SA1100
175 */ 144 */
diff --git a/arch/arm/mach-sa1100/generic.h b/arch/arm/mach-sa1100/generic.h
index f085d68e568e..793c2e6c991f 100644
--- a/arch/arm/mach-sa1100/generic.h
+++ b/arch/arm/mach-sa1100/generic.h
@@ -9,6 +9,7 @@ struct sys_timer;
9extern struct sys_timer sa1100_timer; 9extern struct sys_timer sa1100_timer;
10extern void __init sa1100_map_io(void); 10extern void __init sa1100_map_io(void);
11extern void __init sa1100_init_irq(void); 11extern void __init sa1100_init_irq(void);
12extern void __init sa1100_init_gpio(void);
12 13
13#define SET_BANK(__nr,__start,__size) \ 14#define SET_BANK(__nr,__start,__size) \
14 mi->bank[__nr].start = (__start), \ 15 mi->bank[__nr].start = (__start), \
diff --git a/arch/arm/mach-sa1100/gpio.c b/arch/arm/mach-sa1100/gpio.c
new file mode 100644
index 000000000000..372f1f4f54a1
--- /dev/null
+++ b/arch/arm/mach-sa1100/gpio.c
@@ -0,0 +1,65 @@
1/*
2 * linux/arch/arm/mach-sa1100/gpio.c
3 *
4 * Generic SA-1100 GPIO handling
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#include <linux/init.h>
12#include <linux/module.h>
13
14#include <asm/gpio.h>
15#include <asm/hardware.h>
16#include "generic.h"
17
18static int sa1100_gpio_get(struct gpio_chip *chip, unsigned offset)
19{
20 return GPLR & GPIO_GPIO(offset);
21}
22
23static void sa1100_gpio_set(struct gpio_chip *chip, unsigned offset, int value)
24{
25 if (value)
26 GPSR = GPIO_GPIO(offset);
27 else
28 GPCR = GPIO_GPIO(offset);
29}
30
31static int sa1100_direction_input(struct gpio_chip *chip, unsigned offset)
32{
33 unsigned long flags;
34
35 local_irq_save(flags);
36 GPDR &= ~GPIO_GPIO(offset);
37 local_irq_restore(flags);
38 return 0;
39}
40
41static int sa1100_direction_output(struct gpio_chip *chip, unsigned offset, int value)
42{
43 unsigned long flags;
44
45 local_irq_save(flags);
46 sa1100_gpio_set(chip, offset, value);
47 GPDR |= GPIO_GPIO(offset);
48 local_irq_restore(flags);
49 return 0;
50}
51
52static struct gpio_chip sa1100_gpio_chip = {
53 .label = "gpio",
54 .direction_input = sa1100_direction_input,
55 .direction_output = sa1100_direction_output,
56 .set = sa1100_gpio_set,
57 .get = sa1100_gpio_get,
58 .base = 0,
59 .ngpio = GPIO_MAX + 1,
60};
61
62void __init sa1100_init_gpio(void)
63{
64 gpiochip_add(&sa1100_gpio_chip);
65}
diff --git a/arch/arm/mach-sa1100/irq.c b/arch/arm/mach-sa1100/irq.c
index 3dc17d7bf38e..fa0403af7eec 100644
--- a/arch/arm/mach-sa1100/irq.c
+++ b/arch/arm/mach-sa1100/irq.c
@@ -347,4 +347,6 @@ void __init sa1100_init_irq(void)
347 */ 347 */
348 set_irq_chip(IRQ_GPIO11_27, &sa1100_normal_chip); 348 set_irq_chip(IRQ_GPIO11_27, &sa1100_normal_chip);
349 set_irq_chained_handler(IRQ_GPIO11_27, sa1100_high_gpio_handler); 349 set_irq_chained_handler(IRQ_GPIO11_27, sa1100_high_gpio_handler);
350
351 sa1100_init_gpio();
350} 352}
diff --git a/arch/arm/mach-sa1100/time.c b/arch/arm/mach-sa1100/time.c
index c2677368d6af..a9799cb35b74 100644
--- a/arch/arm/mach-sa1100/time.c
+++ b/arch/arm/mach-sa1100/time.c
@@ -13,67 +13,69 @@
13#include <linux/interrupt.h> 13#include <linux/interrupt.h>
14#include <linux/irq.h> 14#include <linux/irq.h>
15#include <linux/timex.h> 15#include <linux/timex.h>
16#include <linux/signal.h> 16#include <linux/clockchips.h>
17#include <linux/clocksource.h>
18 17
19#include <asm/mach/time.h> 18#include <asm/mach/time.h>
20#include <asm/hardware.h> 19#include <asm/hardware.h>
21 20
22#define RTC_DEF_DIVIDER (32768 - 1) 21#define MIN_OSCR_DELTA 2
23#define RTC_DEF_TRIM 0
24 22
25static int sa1100_set_rtc(void) 23static irqreturn_t sa1100_ost0_interrupt(int irq, void *dev_id)
26{ 24{
27 unsigned long current_time = xtime.tv_sec; 25 struct clock_event_device *c = dev_id;
28 26
29 if (RTSR & RTSR_ALE) { 27 /* Disarm the compare/match, signal the event. */
30 /* make sure not to forward the clock over an alarm */ 28 OIER &= ~OIER_E0;
31 unsigned long alarm = RTAR; 29 OSSR = OSSR_M0;
32 if (current_time >= alarm && alarm >= RCNR) 30 c->event_handler(c);
33 return -ERESTARTSYS;
34 }
35 RCNR = current_time;
36 return 0;
37}
38 31
39#ifdef CONFIG_NO_IDLE_HZ 32 return IRQ_HANDLED;
40static unsigned long initial_match; 33}
41static int match_posponed;
42#endif
43 34
44static irqreturn_t 35static int
45sa1100_timer_interrupt(int irq, void *dev_id) 36sa1100_osmr0_set_next_event(unsigned long delta, struct clock_event_device *c)
46{ 37{
47 unsigned int next_match; 38 unsigned long flags, next, oscr;
48 39
49#ifdef CONFIG_NO_IDLE_HZ 40 raw_local_irq_save(flags);
50 if (match_posponed) { 41 OIER |= OIER_E0;
51 match_posponed = 0; 42 next = OSCR + delta;
52 OSMR0 = initial_match; 43 OSMR0 = next;
53 } 44 oscr = OSCR;
54#endif 45 raw_local_irq_restore(flags);
55 46
56 /* 47 return (signed)(next - oscr) <= MIN_OSCR_DELTA ? -ETIME : 0;
57 * Loop until we get ahead of the free running timer. 48}
58 * This ensures an exact clock tick count and time accuracy.
59 * Since IRQs are disabled at this point, coherence between
60 * lost_ticks(updated in do_timer()) and the match reg value is
61 * ensured, hence we can use do_gettimeofday() from interrupt
62 * handlers.
63 */
64 do {
65 timer_tick();
66 OSSR = OSSR_M0; /* Clear match on timer 0 */
67 next_match = (OSMR0 += LATCH);
68 } while ((signed long)(next_match - OSCR) <= 0);
69 49
70 return IRQ_HANDLED; 50static void
51sa1100_osmr0_set_mode(enum clock_event_mode mode, struct clock_event_device *c)
52{
53 unsigned long flags;
54
55 switch (mode) {
56 case CLOCK_EVT_MODE_ONESHOT:
57 case CLOCK_EVT_MODE_UNUSED:
58 case CLOCK_EVT_MODE_SHUTDOWN:
59 raw_local_irq_save(flags);
60 OIER &= ~OIER_E0;
61 OSSR = OSSR_M0;
62 raw_local_irq_restore(flags);
63 break;
64
65 case CLOCK_EVT_MODE_RESUME:
66 case CLOCK_EVT_MODE_PERIODIC:
67 break;
68 }
71} 69}
72 70
73static struct irqaction sa1100_timer_irq = { 71static struct clock_event_device ckevt_sa1100_osmr0 = {
74 .name = "SA11xx Timer Tick", 72 .name = "osmr0",
75 .flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL, 73 .features = CLOCK_EVT_FEAT_ONESHOT,
76 .handler = sa1100_timer_interrupt, 74 .shift = 32,
75 .rating = 200,
76 .cpumask = CPU_MASK_CPU0,
77 .set_next_event = sa1100_osmr0_set_next_event,
78 .set_mode = sa1100_osmr0_set_mode,
77}; 79};
78 80
79static cycle_t sa1100_read_oscr(void) 81static cycle_t sa1100_read_oscr(void)
@@ -90,62 +92,34 @@ static struct clocksource cksrc_sa1100_oscr = {
90 .flags = CLOCK_SOURCE_IS_CONTINUOUS, 92 .flags = CLOCK_SOURCE_IS_CONTINUOUS,
91}; 93};
92 94
95static struct irqaction sa1100_timer_irq = {
96 .name = "ost0",
97 .flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL,
98 .handler = sa1100_ost0_interrupt,
99 .dev_id = &ckevt_sa1100_osmr0,
100};
101
93static void __init sa1100_timer_init(void) 102static void __init sa1100_timer_init(void)
94{ 103{
95 unsigned long flags;
96
97 set_rtc = sa1100_set_rtc;
98
99 OIER = 0; /* disable any timer interrupts */ 104 OIER = 0; /* disable any timer interrupts */
100 OSSR = 0xf; /* clear status on all timers */ 105 OSSR = 0xf; /* clear status on all timers */
101 setup_irq(IRQ_OST0, &sa1100_timer_irq); 106
102 local_irq_save(flags); 107 ckevt_sa1100_osmr0.mult =
103 OIER = OIER_E0; /* enable match on timer 0 to cause interrupts */ 108 div_sc(3686400, NSEC_PER_SEC, ckevt_sa1100_osmr0.shift);
104 OSMR0 = OSCR + LATCH; /* set initial match */ 109 ckevt_sa1100_osmr0.max_delta_ns =
105 local_irq_restore(flags); 110 clockevent_delta2ns(0x7fffffff, &ckevt_sa1100_osmr0);
111 ckevt_sa1100_osmr0.min_delta_ns =
112 clockevent_delta2ns(MIN_OSCR_DELTA * 2, &ckevt_sa1100_osmr0) + 1;
106 113
107 cksrc_sa1100_oscr.mult = 114 cksrc_sa1100_oscr.mult =
108 clocksource_hz2mult(CLOCK_TICK_RATE, cksrc_sa1100_oscr.shift); 115 clocksource_hz2mult(CLOCK_TICK_RATE, cksrc_sa1100_oscr.shift);
109 116
110 clocksource_register(&cksrc_sa1100_oscr); 117 setup_irq(IRQ_OST0, &sa1100_timer_irq);
111}
112
113#ifdef CONFIG_NO_IDLE_HZ
114static int sa1100_dyn_tick_enable_disable(void)
115{
116 /* nothing to do */
117 return 0;
118}
119
120static void sa1100_dyn_tick_reprogram(unsigned long ticks)
121{
122 if (ticks > 1) {
123 initial_match = OSMR0;
124 OSMR0 = initial_match + ticks * LATCH;
125 match_posponed = 1;
126 }
127}
128 118
129static irqreturn_t 119 clocksource_register(&cksrc_sa1100_oscr);
130sa1100_dyn_tick_handler(int irq, void *dev_id) 120 clockevents_register_device(&ckevt_sa1100_osmr0);
131{
132 if (match_posponed) {
133 match_posponed = 0;
134 OSMR0 = initial_match;
135 if ((signed long)(initial_match - OSCR) <= 0)
136 return sa1100_timer_interrupt(irq, dev_id);
137 }
138 return IRQ_NONE;
139} 121}
140 122
141static struct dyn_tick_timer sa1100_dyn_tick = {
142 .enable = sa1100_dyn_tick_enable_disable,
143 .disable = sa1100_dyn_tick_enable_disable,
144 .reprogram = sa1100_dyn_tick_reprogram,
145 .handler = sa1100_dyn_tick_handler,
146};
147#endif
148
149#ifdef CONFIG_PM 123#ifdef CONFIG_PM
150unsigned long osmr[4], oier; 124unsigned long osmr[4], oier;
151 125
@@ -181,7 +155,4 @@ struct sys_timer sa1100_timer = {
181 .init = sa1100_timer_init, 155 .init = sa1100_timer_init,
182 .suspend = sa1100_timer_suspend, 156 .suspend = sa1100_timer_suspend,
183 .resume = sa1100_timer_resume, 157 .resume = sa1100_timer_resume,
184#ifdef CONFIG_NO_IDLE_HZ
185 .dyn_tick = &sa1100_dyn_tick,
186#endif
187}; 158};
diff --git a/arch/arm/mm/Kconfig b/arch/arm/mm/Kconfig
index 76348f060f27..746cbb7c8e95 100644
--- a/arch/arm/mm/Kconfig
+++ b/arch/arm/mm/Kconfig
@@ -18,6 +18,7 @@ config CPU_ARM610
18 select CPU_CP15_MMU 18 select CPU_CP15_MMU
19 select CPU_COPY_V3 if MMU 19 select CPU_COPY_V3 if MMU
20 select CPU_TLB_V3 if MMU 20 select CPU_TLB_V3 if MMU
21 select CPU_PABRT_NOIFAR
21 help 22 help
22 The ARM610 is the successor to the ARM3 processor 23 The ARM610 is the successor to the ARM3 processor
23 and was produced by VLSI Technology Inc. 24 and was produced by VLSI Technology Inc.
@@ -49,6 +50,7 @@ config CPU_ARM710
49 select CPU_CP15_MMU 50 select CPU_CP15_MMU
50 select CPU_COPY_V3 if MMU 51 select CPU_COPY_V3 if MMU
51 select CPU_TLB_V3 if MMU 52 select CPU_TLB_V3 if MMU
53 select CPU_PABRT_NOIFAR
52 help 54 help
53 A 32-bit RISC microprocessor based on the ARM7 processor core 55 A 32-bit RISC microprocessor based on the ARM7 processor core
54 designed by Advanced RISC Machines Ltd. The ARM710 is the 56 designed by Advanced RISC Machines Ltd. The ARM710 is the
@@ -64,6 +66,7 @@ config CPU_ARM720T
64 default y if ARCH_CLPS711X || ARCH_L7200 || ARCH_CDB89712 || ARCH_H720X 66 default y if ARCH_CLPS711X || ARCH_L7200 || ARCH_CDB89712 || ARCH_H720X
65 select CPU_32v4T 67 select CPU_32v4T
66 select CPU_ABRT_LV4T 68 select CPU_ABRT_LV4T
69 select CPU_PABRT_NOIFAR
67 select CPU_CACHE_V4 70 select CPU_CACHE_V4
68 select CPU_CACHE_VIVT 71 select CPU_CACHE_VIVT
69 select CPU_CP15_MMU 72 select CPU_CP15_MMU
@@ -113,6 +116,7 @@ config CPU_ARM920T
113 default y if CPU_S3C2410 || CPU_S3C2440 || CPU_S3C2442 || ARCH_AT91RM9200 116 default y if CPU_S3C2410 || CPU_S3C2440 || CPU_S3C2442 || ARCH_AT91RM9200
114 select CPU_32v4T 117 select CPU_32v4T
115 select CPU_ABRT_EV4T 118 select CPU_ABRT_EV4T
119 select CPU_PABRT_NOIFAR
116 select CPU_CACHE_V4WT 120 select CPU_CACHE_V4WT
117 select CPU_CACHE_VIVT 121 select CPU_CACHE_VIVT
118 select CPU_CP15_MMU 122 select CPU_CP15_MMU
@@ -135,6 +139,7 @@ config CPU_ARM922T
135 default y if ARCH_LH7A40X || ARCH_KS8695 139 default y if ARCH_LH7A40X || ARCH_KS8695
136 select CPU_32v4T 140 select CPU_32v4T
137 select CPU_ABRT_EV4T 141 select CPU_ABRT_EV4T
142 select CPU_PABRT_NOIFAR
138 select CPU_CACHE_V4WT 143 select CPU_CACHE_V4WT
139 select CPU_CACHE_VIVT 144 select CPU_CACHE_VIVT
140 select CPU_CP15_MMU 145 select CPU_CP15_MMU
@@ -155,6 +160,7 @@ config CPU_ARM925T
155 default y if ARCH_OMAP15XX 160 default y if ARCH_OMAP15XX
156 select CPU_32v4T 161 select CPU_32v4T
157 select CPU_ABRT_EV4T 162 select CPU_ABRT_EV4T
163 select CPU_PABRT_NOIFAR
158 select CPU_CACHE_V4WT 164 select CPU_CACHE_V4WT
159 select CPU_CACHE_VIVT 165 select CPU_CACHE_VIVT
160 select CPU_CP15_MMU 166 select CPU_CP15_MMU
@@ -175,6 +181,7 @@ config CPU_ARM926T
175 default y if ARCH_VERSATILE_PB || MACH_VERSATILE_AB || ARCH_OMAP730 || ARCH_OMAP16XX || ARCH_PNX4008 || ARCH_NETX || CPU_S3C2412 || ARCH_AT91SAM9260 || ARCH_AT91SAM9261 || ARCH_AT91SAM9263 || ARCH_AT91SAM9RL || ARCH_AT91CAP9 || ARCH_NS9XXX || ARCH_DAVINCI 181 default y if ARCH_VERSATILE_PB || MACH_VERSATILE_AB || ARCH_OMAP730 || ARCH_OMAP16XX || ARCH_PNX4008 || ARCH_NETX || CPU_S3C2412 || ARCH_AT91SAM9260 || ARCH_AT91SAM9261 || ARCH_AT91SAM9263 || ARCH_AT91SAM9RL || ARCH_AT91CAP9 || ARCH_NS9XXX || ARCH_DAVINCI
176 select CPU_32v5 182 select CPU_32v5
177 select CPU_ABRT_EV5TJ 183 select CPU_ABRT_EV5TJ
184 select CPU_PABRT_NOIFAR
178 select CPU_CACHE_VIVT 185 select CPU_CACHE_VIVT
179 select CPU_CP15_MMU 186 select CPU_CP15_MMU
180 select CPU_COPY_V4WB if MMU 187 select CPU_COPY_V4WB if MMU
@@ -226,6 +233,7 @@ config CPU_ARM1020
226 depends on ARCH_INTEGRATOR 233 depends on ARCH_INTEGRATOR
227 select CPU_32v5 234 select CPU_32v5
228 select CPU_ABRT_EV4T 235 select CPU_ABRT_EV4T
236 select CPU_PABRT_NOIFAR
229 select CPU_CACHE_V4WT 237 select CPU_CACHE_V4WT
230 select CPU_CACHE_VIVT 238 select CPU_CACHE_VIVT
231 select CPU_CP15_MMU 239 select CPU_CP15_MMU
@@ -244,6 +252,7 @@ config CPU_ARM1020E
244 depends on ARCH_INTEGRATOR 252 depends on ARCH_INTEGRATOR
245 select CPU_32v5 253 select CPU_32v5
246 select CPU_ABRT_EV4T 254 select CPU_ABRT_EV4T
255 select CPU_PABRT_NOIFAR
247 select CPU_CACHE_V4WT 256 select CPU_CACHE_V4WT
248 select CPU_CACHE_VIVT 257 select CPU_CACHE_VIVT
249 select CPU_CP15_MMU 258 select CPU_CP15_MMU
@@ -257,6 +266,7 @@ config CPU_ARM1022
257 depends on ARCH_INTEGRATOR 266 depends on ARCH_INTEGRATOR
258 select CPU_32v5 267 select CPU_32v5
259 select CPU_ABRT_EV4T 268 select CPU_ABRT_EV4T
269 select CPU_PABRT_NOIFAR
260 select CPU_CACHE_VIVT 270 select CPU_CACHE_VIVT
261 select CPU_CP15_MMU 271 select CPU_CP15_MMU
262 select CPU_COPY_V4WB if MMU # can probably do better 272 select CPU_COPY_V4WB if MMU # can probably do better
@@ -275,6 +285,7 @@ config CPU_ARM1026
275 depends on ARCH_INTEGRATOR 285 depends on ARCH_INTEGRATOR
276 select CPU_32v5 286 select CPU_32v5
277 select CPU_ABRT_EV5T # But need Jazelle, but EV5TJ ignores bit 10 287 select CPU_ABRT_EV5T # But need Jazelle, but EV5TJ ignores bit 10
288 select CPU_PABRT_NOIFAR
278 select CPU_CACHE_VIVT 289 select CPU_CACHE_VIVT
279 select CPU_CP15_MMU 290 select CPU_CP15_MMU
280 select CPU_COPY_V4WB if MMU # can probably do better 291 select CPU_COPY_V4WB if MMU # can probably do better
@@ -293,6 +304,7 @@ config CPU_SA110
293 select CPU_32v3 if ARCH_RPC 304 select CPU_32v3 if ARCH_RPC
294 select CPU_32v4 if !ARCH_RPC 305 select CPU_32v4 if !ARCH_RPC
295 select CPU_ABRT_EV4 306 select CPU_ABRT_EV4
307 select CPU_PABRT_NOIFAR
296 select CPU_CACHE_V4WB 308 select CPU_CACHE_V4WB
297 select CPU_CACHE_VIVT 309 select CPU_CACHE_VIVT
298 select CPU_CP15_MMU 310 select CPU_CP15_MMU
@@ -314,6 +326,7 @@ config CPU_SA1100
314 default y 326 default y
315 select CPU_32v4 327 select CPU_32v4
316 select CPU_ABRT_EV4 328 select CPU_ABRT_EV4
329 select CPU_PABRT_NOIFAR
317 select CPU_CACHE_V4WB 330 select CPU_CACHE_V4WB
318 select CPU_CACHE_VIVT 331 select CPU_CACHE_VIVT
319 select CPU_CP15_MMU 332 select CPU_CP15_MMU
@@ -326,6 +339,7 @@ config CPU_XSCALE
326 default y 339 default y
327 select CPU_32v5 340 select CPU_32v5
328 select CPU_ABRT_EV5T 341 select CPU_ABRT_EV5T
342 select CPU_PABRT_NOIFAR
329 select CPU_CACHE_VIVT 343 select CPU_CACHE_VIVT
330 select CPU_CP15_MMU 344 select CPU_CP15_MMU
331 select CPU_TLB_V4WBI if MMU 345 select CPU_TLB_V4WBI if MMU
@@ -345,10 +359,11 @@ config CPU_XSC3
345# Feroceon 359# Feroceon
346config CPU_FEROCEON 360config CPU_FEROCEON
347 bool 361 bool
348 depends on ARCH_ORION 362 depends on ARCH_ORION5X
349 default y 363 default y
350 select CPU_32v5 364 select CPU_32v5
351 select CPU_ABRT_EV5T 365 select CPU_ABRT_EV5T
366 select CPU_PABRT_NOIFAR
352 select CPU_CACHE_VIVT 367 select CPU_CACHE_VIVT
353 select CPU_CP15_MMU 368 select CPU_CP15_MMU
354 select CPU_COPY_V4WB if MMU 369 select CPU_COPY_V4WB if MMU
@@ -366,11 +381,12 @@ config CPU_FEROCEON_OLD_ID
366# ARMv6 381# ARMv6
367config CPU_V6 382config CPU_V6
368 bool "Support ARM V6 processor" 383 bool "Support ARM V6 processor"
369 depends on ARCH_INTEGRATOR || MACH_REALVIEW_EB || ARCH_OMAP2 || ARCH_MX3 || ARCH_MSM7X00A 384 depends on ARCH_INTEGRATOR || MACH_REALVIEW_EB || ARCH_OMAP2 || ARCH_MX3 || ARCH_MSM7X00A || MACH_REALVIEW_PB11MP || MACH_REALVIEW_PB1176
370 default y if ARCH_MX3 385 default y if ARCH_MX3
371 default y if ARCH_MSM7X00A 386 default y if ARCH_MSM7X00A
372 select CPU_32v6 387 select CPU_32v6
373 select CPU_ABRT_EV6 388 select CPU_ABRT_EV6
389 select CPU_PABRT_NOIFAR
374 select CPU_CACHE_V6 390 select CPU_CACHE_V6
375 select CPU_CACHE_VIPT 391 select CPU_CACHE_VIPT
376 select CPU_CP15_MMU 392 select CPU_CP15_MMU
@@ -393,10 +409,11 @@ config CPU_32v6K
393# ARMv7 409# ARMv7
394config CPU_V7 410config CPU_V7
395 bool "Support ARM V7 processor" 411 bool "Support ARM V7 processor"
396 depends on ARCH_INTEGRATOR 412 depends on ARCH_INTEGRATOR || MACH_REALVIEW_EB
397 select CPU_32v6K 413 select CPU_32v6K
398 select CPU_32v7 414 select CPU_32v7
399 select CPU_ABRT_EV7 415 select CPU_ABRT_EV7
416 select CPU_PABRT_IFAR
400 select CPU_CACHE_V7 417 select CPU_CACHE_V7
401 select CPU_CACHE_VIPT 418 select CPU_CACHE_VIPT
402 select CPU_CP15_MMU 419 select CPU_CP15_MMU
@@ -458,6 +475,12 @@ config CPU_ABRT_EV6
458config CPU_ABRT_EV7 475config CPU_ABRT_EV7
459 bool 476 bool
460 477
478config CPU_PABRT_IFAR
479 bool
480
481config CPU_PABRT_NOIFAR
482 bool
483
461# The cache model 484# The cache model
462config CPU_CACHE_V3 485config CPU_CACHE_V3
463 bool 486 bool
@@ -572,6 +595,13 @@ config ARM_THUMB
572 595
573 If you don't know what this all is, saying Y is a safe choice. 596 If you don't know what this all is, saying Y is a safe choice.
574 597
598config ARM_THUMBEE
599 bool "Enable ThumbEE CPU extension"
600 depends on CPU_V7
601 help
602 Say Y here if you have a CPU with the ThumbEE extension and code to
603 make use of it. Say N for code that can run on CPUs without ThumbEE.
604
575config CPU_BIG_ENDIAN 605config CPU_BIG_ENDIAN
576 bool "Build big-endian kernel" 606 bool "Build big-endian kernel"
577 depends on ARCH_SUPPORTS_BIG_ENDIAN 607 depends on ARCH_SUPPORTS_BIG_ENDIAN
@@ -671,5 +701,9 @@ config OUTER_CACHE
671 default n 701 default n
672 702
673config CACHE_L2X0 703config CACHE_L2X0
674 bool 704 bool "Enable the L2x0 outer cache controller"
705 depends on REALVIEW_EB_ARM11MP || MACH_REALVIEW_PB11MP || MACH_REALVIEW_PB1176
706 default y
675 select OUTER_CACHE 707 select OUTER_CACHE
708 help
709 This option enables the L2x0 PrimeCell.
diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c
index ec00f26bffa4..b657f1719af0 100644
--- a/arch/arm/mm/init.c
+++ b/arch/arm/mm/init.c
@@ -48,8 +48,6 @@ void show_mem(void)
48 48
49 printk("Mem-info:\n"); 49 printk("Mem-info:\n");
50 show_free_areas(); 50 show_free_areas();
51 printk("Free swap: %6ldkB\n", nr_swap_pages<<(PAGE_SHIFT-10));
52
53 for_each_online_node(node) { 51 for_each_online_node(node) {
54 pg_data_t *n = NODE_DATA(node); 52 pg_data_t *n = NODE_DATA(node);
55 struct page *map = n->node_mem_map - n->node_start_pfn; 53 struct page *map = n->node_mem_map - n->node_start_pfn;
diff --git a/arch/arm/mm/proc-arm1020.S b/arch/arm/mm/proc-arm1020.S
index 700c04d6996e..32fd7ea533f2 100644
--- a/arch/arm/mm/proc-arm1020.S
+++ b/arch/arm/mm/proc-arm1020.S
@@ -478,6 +478,7 @@ arm1020_processor_functions:
478 .word cpu_arm1020_dcache_clean_area 478 .word cpu_arm1020_dcache_clean_area
479 .word cpu_arm1020_switch_mm 479 .word cpu_arm1020_switch_mm
480 .word cpu_arm1020_set_pte_ext 480 .word cpu_arm1020_set_pte_ext
481 .word pabort_noifar
481 .size arm1020_processor_functions, . - arm1020_processor_functions 482 .size arm1020_processor_functions, . - arm1020_processor_functions
482 483
483 .section ".rodata" 484 .section ".rodata"
diff --git a/arch/arm/mm/proc-arm1020e.S b/arch/arm/mm/proc-arm1020e.S
index 1cc206ab5eae..fe2b0ae70274 100644
--- a/arch/arm/mm/proc-arm1020e.S
+++ b/arch/arm/mm/proc-arm1020e.S
@@ -459,6 +459,7 @@ arm1020e_processor_functions:
459 .word cpu_arm1020e_dcache_clean_area 459 .word cpu_arm1020e_dcache_clean_area
460 .word cpu_arm1020e_switch_mm 460 .word cpu_arm1020e_switch_mm
461 .word cpu_arm1020e_set_pte_ext 461 .word cpu_arm1020e_set_pte_ext
462 .word pabort_noifar
462 .size arm1020e_processor_functions, . - arm1020e_processor_functions 463 .size arm1020e_processor_functions, . - arm1020e_processor_functions
463 464
464 .section ".rodata" 465 .section ".rodata"
diff --git a/arch/arm/mm/proc-arm1022.S b/arch/arm/mm/proc-arm1022.S
index aff0ea08e2f8..06dde678e19d 100644
--- a/arch/arm/mm/proc-arm1022.S
+++ b/arch/arm/mm/proc-arm1022.S
@@ -442,6 +442,7 @@ arm1022_processor_functions:
442 .word cpu_arm1022_dcache_clean_area 442 .word cpu_arm1022_dcache_clean_area
443 .word cpu_arm1022_switch_mm 443 .word cpu_arm1022_switch_mm
444 .word cpu_arm1022_set_pte_ext 444 .word cpu_arm1022_set_pte_ext
445 .word pabort_noifar
445 .size arm1022_processor_functions, . - arm1022_processor_functions 446 .size arm1022_processor_functions, . - arm1022_processor_functions
446 447
447 .section ".rodata" 448 .section ".rodata"
diff --git a/arch/arm/mm/proc-arm1026.S b/arch/arm/mm/proc-arm1026.S
index 65e43a109085..f5506e6e681e 100644
--- a/arch/arm/mm/proc-arm1026.S
+++ b/arch/arm/mm/proc-arm1026.S
@@ -437,6 +437,7 @@ arm1026_processor_functions:
437 .word cpu_arm1026_dcache_clean_area 437 .word cpu_arm1026_dcache_clean_area
438 .word cpu_arm1026_switch_mm 438 .word cpu_arm1026_switch_mm
439 .word cpu_arm1026_set_pte_ext 439 .word cpu_arm1026_set_pte_ext
440 .word pabort_noifar
440 .size arm1026_processor_functions, . - arm1026_processor_functions 441 .size arm1026_processor_functions, . - arm1026_processor_functions
441 442
442 .section .rodata 443 .section .rodata
diff --git a/arch/arm/mm/proc-arm6_7.S b/arch/arm/mm/proc-arm6_7.S
index 123a7dc7a433..14b6a95c8d45 100644
--- a/arch/arm/mm/proc-arm6_7.S
+++ b/arch/arm/mm/proc-arm6_7.S
@@ -300,6 +300,7 @@ ENTRY(arm6_processor_functions)
300 .word cpu_arm6_dcache_clean_area 300 .word cpu_arm6_dcache_clean_area
301 .word cpu_arm6_switch_mm 301 .word cpu_arm6_switch_mm
302 .word cpu_arm6_set_pte_ext 302 .word cpu_arm6_set_pte_ext
303 .word pabort_noifar
303 .size arm6_processor_functions, . - arm6_processor_functions 304 .size arm6_processor_functions, . - arm6_processor_functions
304 305
305/* 306/*
@@ -316,6 +317,7 @@ ENTRY(arm7_processor_functions)
316 .word cpu_arm7_dcache_clean_area 317 .word cpu_arm7_dcache_clean_area
317 .word cpu_arm7_switch_mm 318 .word cpu_arm7_switch_mm
318 .word cpu_arm7_set_pte_ext 319 .word cpu_arm7_set_pte_ext
320 .word pabort_noifar
319 .size arm7_processor_functions, . - arm7_processor_functions 321 .size arm7_processor_functions, . - arm7_processor_functions
320 322
321 .section ".rodata" 323 .section ".rodata"
diff --git a/arch/arm/mm/proc-arm720.S b/arch/arm/mm/proc-arm720.S
index dc763be43362..ca5e7aac2da7 100644
--- a/arch/arm/mm/proc-arm720.S
+++ b/arch/arm/mm/proc-arm720.S
@@ -205,6 +205,7 @@ ENTRY(arm720_processor_functions)
205 .word cpu_arm720_dcache_clean_area 205 .word cpu_arm720_dcache_clean_area
206 .word cpu_arm720_switch_mm 206 .word cpu_arm720_switch_mm
207 .word cpu_arm720_set_pte_ext 207 .word cpu_arm720_set_pte_ext
208 .word pabort_noifar
208 .size arm720_processor_functions, . - arm720_processor_functions 209 .size arm720_processor_functions, . - arm720_processor_functions
209 210
210 .section ".rodata" 211 .section ".rodata"
diff --git a/arch/arm/mm/proc-arm920.S b/arch/arm/mm/proc-arm920.S
index 75c945ed6c4d..0170d4f466ea 100644
--- a/arch/arm/mm/proc-arm920.S
+++ b/arch/arm/mm/proc-arm920.S
@@ -424,6 +424,7 @@ arm920_processor_functions:
424 .word cpu_arm920_dcache_clean_area 424 .word cpu_arm920_dcache_clean_area
425 .word cpu_arm920_switch_mm 425 .word cpu_arm920_switch_mm
426 .word cpu_arm920_set_pte_ext 426 .word cpu_arm920_set_pte_ext
427 .word pabort_noifar
427 .size arm920_processor_functions, . - arm920_processor_functions 428 .size arm920_processor_functions, . - arm920_processor_functions
428 429
429 .section ".rodata" 430 .section ".rodata"
diff --git a/arch/arm/mm/proc-arm922.S b/arch/arm/mm/proc-arm922.S
index ffb751b877ff..b7952493d404 100644
--- a/arch/arm/mm/proc-arm922.S
+++ b/arch/arm/mm/proc-arm922.S
@@ -428,6 +428,7 @@ arm922_processor_functions:
428 .word cpu_arm922_dcache_clean_area 428 .word cpu_arm922_dcache_clean_area
429 .word cpu_arm922_switch_mm 429 .word cpu_arm922_switch_mm
430 .word cpu_arm922_set_pte_ext 430 .word cpu_arm922_set_pte_ext
431 .word pabort_noifar
431 .size arm922_processor_functions, . - arm922_processor_functions 432 .size arm922_processor_functions, . - arm922_processor_functions
432 433
433 .section ".rodata" 434 .section ".rodata"
diff --git a/arch/arm/mm/proc-arm925.S b/arch/arm/mm/proc-arm925.S
index 44c2c997819f..e2988eba4cf6 100644
--- a/arch/arm/mm/proc-arm925.S
+++ b/arch/arm/mm/proc-arm925.S
@@ -491,6 +491,7 @@ arm925_processor_functions:
491 .word cpu_arm925_dcache_clean_area 491 .word cpu_arm925_dcache_clean_area
492 .word cpu_arm925_switch_mm 492 .word cpu_arm925_switch_mm
493 .word cpu_arm925_set_pte_ext 493 .word cpu_arm925_set_pte_ext
494 .word pabort_noifar
494 .size arm925_processor_functions, . - arm925_processor_functions 495 .size arm925_processor_functions, . - arm925_processor_functions
495 496
496 .section ".rodata" 497 .section ".rodata"
diff --git a/arch/arm/mm/proc-arm926.S b/arch/arm/mm/proc-arm926.S
index 194ef48968e6..62f7d1dfe016 100644
--- a/arch/arm/mm/proc-arm926.S
+++ b/arch/arm/mm/proc-arm926.S
@@ -444,6 +444,7 @@ arm926_processor_functions:
444 .word cpu_arm926_dcache_clean_area 444 .word cpu_arm926_dcache_clean_area
445 .word cpu_arm926_switch_mm 445 .word cpu_arm926_switch_mm
446 .word cpu_arm926_set_pte_ext 446 .word cpu_arm926_set_pte_ext
447 .word pabort_noifar
447 .size arm926_processor_functions, . - arm926_processor_functions 448 .size arm926_processor_functions, . - arm926_processor_functions
448 449
449 .section ".rodata" 450 .section ".rodata"
diff --git a/arch/arm/mm/proc-feroceon.S b/arch/arm/mm/proc-feroceon.S
index fa0dc7e6f0ea..2f169b28e938 100644
--- a/arch/arm/mm/proc-feroceon.S
+++ b/arch/arm/mm/proc-feroceon.S
@@ -430,6 +430,7 @@ feroceon_processor_functions:
430 .word cpu_feroceon_dcache_clean_area 430 .word cpu_feroceon_dcache_clean_area
431 .word cpu_feroceon_switch_mm 431 .word cpu_feroceon_switch_mm
432 .word cpu_feroceon_set_pte_ext 432 .word cpu_feroceon_set_pte_ext
433 .word pabort_noifar
433 .size feroceon_processor_functions, . - feroceon_processor_functions 434 .size feroceon_processor_functions, . - feroceon_processor_functions
434 435
435 .section ".rodata" 436 .section ".rodata"
diff --git a/arch/arm/mm/proc-sa110.S b/arch/arm/mm/proc-sa110.S
index 6e226e12989f..4db3d6299a2b 100644
--- a/arch/arm/mm/proc-sa110.S
+++ b/arch/arm/mm/proc-sa110.S
@@ -223,6 +223,7 @@ ENTRY(sa110_processor_functions)
223 .word cpu_sa110_dcache_clean_area 223 .word cpu_sa110_dcache_clean_area
224 .word cpu_sa110_switch_mm 224 .word cpu_sa110_switch_mm
225 .word cpu_sa110_set_pte_ext 225 .word cpu_sa110_set_pte_ext
226 .word pabort_noifar
226 .size sa110_processor_functions, . - sa110_processor_functions 227 .size sa110_processor_functions, . - sa110_processor_functions
227 228
228 .section ".rodata" 229 .section ".rodata"
diff --git a/arch/arm/mm/proc-sa1100.S b/arch/arm/mm/proc-sa1100.S
index 9afb11d089fe..3cdef043760f 100644
--- a/arch/arm/mm/proc-sa1100.S
+++ b/arch/arm/mm/proc-sa1100.S
@@ -238,6 +238,7 @@ ENTRY(sa1100_processor_functions)
238 .word cpu_sa1100_dcache_clean_area 238 .word cpu_sa1100_dcache_clean_area
239 .word cpu_sa1100_switch_mm 239 .word cpu_sa1100_switch_mm
240 .word cpu_sa1100_set_pte_ext 240 .word cpu_sa1100_set_pte_ext
241 .word pabort_noifar
241 .size sa1100_processor_functions, . - sa1100_processor_functions 242 .size sa1100_processor_functions, . - sa1100_processor_functions
242 243
243 .section ".rodata" 244 .section ".rodata"
diff --git a/arch/arm/mm/proc-v6.S b/arch/arm/mm/proc-v6.S
index eb42e5b94863..bf760ea2f789 100644
--- a/arch/arm/mm/proc-v6.S
+++ b/arch/arm/mm/proc-v6.S
@@ -17,10 +17,6 @@
17#include <asm/pgtable-hwdef.h> 17#include <asm/pgtable-hwdef.h>
18#include <asm/pgtable.h> 18#include <asm/pgtable.h>
19 19
20#ifdef CONFIG_SMP
21#include <asm/hardware/arm_scu.h>
22#endif
23
24#include "proc-macros.S" 20#include "proc-macros.S"
25 21
26#define D_CACHE_LINE_SIZE 32 22#define D_CACHE_LINE_SIZE 32
@@ -187,20 +183,10 @@ cpu_v6_name:
187 */ 183 */
188__v6_setup: 184__v6_setup:
189#ifdef CONFIG_SMP 185#ifdef CONFIG_SMP
190 /* Set up the SCU on core 0 only */
191 mrc p15, 0, r0, c0, c0, 5 @ CPU core number
192 ands r0, r0, #15
193 ldreq r0, =SCU_BASE
194 ldreq r5, [r0, #SCU_CTRL]
195 orreq r5, r5, #1
196 streq r5, [r0, #SCU_CTRL]
197
198#ifndef CONFIG_CPU_DCACHE_DISABLE
199 mrc p15, 0, r0, c1, c0, 1 @ Enable SMP/nAMP mode 186 mrc p15, 0, r0, c1, c0, 1 @ Enable SMP/nAMP mode
200 orr r0, r0, #0x20 187 orr r0, r0, #0x20
201 mcr p15, 0, r0, c1, c0, 1 188 mcr p15, 0, r0, c1, c0, 1
202#endif 189#endif
203#endif
204 190
205 mov r0, #0 191 mov r0, #0
206 mcr p15, 0, r0, c7, c14, 0 @ clean+invalidate D cache 192 mcr p15, 0, r0, c7, c14, 0 @ clean+invalidate D cache
@@ -240,6 +226,7 @@ ENTRY(v6_processor_functions)
240 .word cpu_v6_dcache_clean_area 226 .word cpu_v6_dcache_clean_area
241 .word cpu_v6_switch_mm 227 .word cpu_v6_switch_mm
242 .word cpu_v6_set_pte_ext 228 .word cpu_v6_set_pte_ext
229 .word pabort_noifar
243 .size v6_processor_functions, . - v6_processor_functions 230 .size v6_processor_functions, . - v6_processor_functions
244 231
245 .type cpu_arch_name, #object 232 .type cpu_arch_name, #object
diff --git a/arch/arm/mm/proc-v7.S b/arch/arm/mm/proc-v7.S
index e0acc5ae6f6f..a1d7331cd64c 100644
--- a/arch/arm/mm/proc-v7.S
+++ b/arch/arm/mm/proc-v7.S
@@ -212,6 +212,7 @@ ENTRY(v7_processor_functions)
212 .word cpu_v7_dcache_clean_area 212 .word cpu_v7_dcache_clean_area
213 .word cpu_v7_switch_mm 213 .word cpu_v7_switch_mm
214 .word cpu_v7_set_pte_ext 214 .word cpu_v7_set_pte_ext
215 .word pabort_ifar
215 .size v7_processor_functions, . - v7_processor_functions 216 .size v7_processor_functions, . - v7_processor_functions
216 217
217 .type cpu_arch_name, #object 218 .type cpu_arch_name, #object
diff --git a/arch/arm/mm/proc-xscale.S b/arch/arm/mm/proc-xscale.S
index 016690b9d564..1a6d89823dff 100644
--- a/arch/arm/mm/proc-xscale.S
+++ b/arch/arm/mm/proc-xscale.S
@@ -534,6 +534,7 @@ ENTRY(xscale_processor_functions)
534 .word cpu_xscale_dcache_clean_area 534 .word cpu_xscale_dcache_clean_area
535 .word cpu_xscale_switch_mm 535 .word cpu_xscale_switch_mm
536 .word cpu_xscale_set_pte_ext 536 .word cpu_xscale_set_pte_ext
537 .word pabort_noifar
537 .size xscale_processor_functions, . - xscale_processor_functions 538 .size xscale_processor_functions, . - xscale_processor_functions
538 539
539 .section ".rodata" 540 .section ".rodata"
diff --git a/arch/arm/plat-iop/pci.c b/arch/arm/plat-iop/pci.c
index 98d01517b563..d9bc15a69e5d 100644
--- a/arch/arm/plat-iop/pci.c
+++ b/arch/arm/plat-iop/pci.c
@@ -24,6 +24,7 @@
24#include <asm/hardware.h> 24#include <asm/hardware.h>
25#include <asm/mach/pci.h> 25#include <asm/mach/pci.h>
26#include <asm/hardware/iop3xx.h> 26#include <asm/hardware/iop3xx.h>
27#include <asm/mach-types.h>
27 28
28// #define DEBUG 29// #define DEBUG
29 30
@@ -209,8 +210,11 @@ int iop3xx_pci_setup(int nr, struct pci_sys_data *sys)
209 res[1].flags = IORESOURCE_MEM; 210 res[1].flags = IORESOURCE_MEM;
210 request_resource(&iomem_resource, &res[1]); 211 request_resource(&iomem_resource, &res[1]);
211 212
212 sys->mem_offset = IOP3XX_PCI_LOWER_MEM_PA - IOP3XX_PCI_LOWER_MEM_BA; 213 /*
213 sys->io_offset = IOP3XX_PCI_LOWER_IO_PA - IOP3XX_PCI_LOWER_IO_BA; 214 * Use whatever translation is already setup.
215 */
216 sys->mem_offset = IOP3XX_PCI_LOWER_MEM_PA - *IOP3XX_OMWTVR0;
217 sys->io_offset = IOP3XX_PCI_LOWER_IO_PA - *IOP3XX_OIOWTVR;
214 218
215 sys->resource[0] = &res[0]; 219 sys->resource[0] = &res[0];
216 sys->resource[1] = &res[1]; 220 sys->resource[1] = &res[1];
@@ -250,11 +254,11 @@ void __init iop3xx_atu_setup(void)
250 *IOP3XX_IATVR2 = PHYS_OFFSET; 254 *IOP3XX_IATVR2 = PHYS_OFFSET;
251 255
252 /* Outbound window 0 */ 256 /* Outbound window 0 */
253 *IOP3XX_OMWTVR0 = IOP3XX_PCI_LOWER_MEM_PA; 257 *IOP3XX_OMWTVR0 = IOP3XX_PCI_LOWER_MEM_BA;
254 *IOP3XX_OUMWTVR0 = 0; 258 *IOP3XX_OUMWTVR0 = 0;
255 259
256 /* Outbound window 1 */ 260 /* Outbound window 1 */
257 *IOP3XX_OMWTVR1 = IOP3XX_PCI_LOWER_MEM_PA + IOP3XX_PCI_MEM_WINDOW_SIZE; 261 *IOP3XX_OMWTVR1 = IOP3XX_PCI_LOWER_MEM_BA + IOP3XX_PCI_MEM_WINDOW_SIZE;
258 *IOP3XX_OUMWTVR1 = 0; 262 *IOP3XX_OUMWTVR1 = 0;
259 263
260 /* BAR 3 ( Disabled ) */ 264 /* BAR 3 ( Disabled ) */
@@ -265,7 +269,7 @@ void __init iop3xx_atu_setup(void)
265 269
266 /* Setup the I/O Bar 270 /* Setup the I/O Bar
267 */ 271 */
268 *IOP3XX_OIOWTVR = IOP3XX_PCI_LOWER_IO_PA;; 272 *IOP3XX_OIOWTVR = IOP3XX_PCI_LOWER_IO_BA;
269 273
270 /* Enable inbound and outbound cycles 274 /* Enable inbound and outbound cycles
271 */ 275 */
@@ -322,34 +326,59 @@ void __init iop3xx_atu_disable(void)
322/* Flag to determine whether the ATU is initialized and the PCI bus scanned */ 326/* Flag to determine whether the ATU is initialized and the PCI bus scanned */
323int init_atu; 327int init_atu;
324 328
325void __init iop3xx_pci_preinit(void) 329int iop3xx_get_init_atu(void) {
330 /* check if default has been overridden */
331 if (init_atu != IOP3XX_INIT_ATU_DEFAULT)
332 return init_atu;
333 else
334 return IOP3XX_INIT_ATU_DISABLE;
335}
336
337static void __init iop3xx_atu_debug(void)
326{ 338{
327 if (iop3xx_get_init_atu() == IOP3XX_INIT_ATU_ENABLE) { 339 DBG("PCI: Intel IOP3xx PCI init.\n");
328 iop3xx_atu_disable(); 340 DBG("PCI: Outbound memory window 0: PCI 0x%08x%08x\n",
329 iop3xx_atu_setup(); 341 *IOP3XX_OUMWTVR0, *IOP3XX_OMWTVR0);
330 } 342 DBG("PCI: Outbound memory window 1: PCI 0x%08x%08x\n",
343 *IOP3XX_OUMWTVR1, *IOP3XX_OMWTVR1);
344 DBG("PCI: Outbound IO window: PCI 0x%08x\n",
345 *IOP3XX_OIOWTVR);
346
347 DBG("PCI: Inbound memory window 0: PCI 0x%08x%08x 0x%08x -> 0x%08x\n",
348 *IOP3XX_IAUBAR0, *IOP3XX_IABAR0, *IOP3XX_IALR0, *IOP3XX_IATVR0);
349 DBG("PCI: Inbound memory window 1: PCI 0x%08x%08x 0x%08x\n",
350 *IOP3XX_IAUBAR1, *IOP3XX_IABAR1, *IOP3XX_IALR1);
351 DBG("PCI: Inbound memory window 2: PCI 0x%08x%08x 0x%08x -> 0x%08x\n",
352 *IOP3XX_IAUBAR2, *IOP3XX_IABAR2, *IOP3XX_IALR2, *IOP3XX_IATVR2);
353 DBG("PCI: Inbound memory window 3: PCI 0x%08x%08x 0x%08x -> 0x%08x\n",
354 *IOP3XX_IAUBAR3, *IOP3XX_IABAR3, *IOP3XX_IALR3, *IOP3XX_IATVR3);
355
356 DBG("PCI: Expansion ROM window: PCI 0x%08x%08x 0x%08x -> 0x%08x\n",
357 0, *IOP3XX_ERBAR, *IOP3XX_ERLR, *IOP3XX_ERTVR);
331 358
332 DBG("PCI: Intel 803xx PCI init code.\n");
333 DBG("ATU: IOP3XX_ATUCMD=0x%04x\n", *IOP3XX_ATUCMD); 359 DBG("ATU: IOP3XX_ATUCMD=0x%04x\n", *IOP3XX_ATUCMD);
334 DBG("ATU: IOP3XX_OMWTVR0=0x%04x, IOP3XX_OIOWTVR=0x%04x\n",
335 *IOP3XX_OMWTVR0,
336 *IOP3XX_OIOWTVR);
337 DBG("ATU: IOP3XX_ATUCR=0x%08x\n", *IOP3XX_ATUCR); 360 DBG("ATU: IOP3XX_ATUCR=0x%08x\n", *IOP3XX_ATUCR);
338 DBG("ATU: IOP3XX_IABAR0=0x%08x IOP3XX_IALR0=0x%08x IOP3XX_IATVR0=%08x\n",
339 *IOP3XX_IABAR0, *IOP3XX_IALR0, *IOP3XX_IATVR0);
340 DBG("ATU: IOP3XX_OMWTVR0=0x%08x\n", *IOP3XX_OMWTVR0);
341 DBG("ATU: IOP3XX_IABAR1=0x%08x IOP3XX_IALR1=0x%08x\n",
342 *IOP3XX_IABAR1, *IOP3XX_IALR1);
343 DBG("ATU: IOP3XX_ERBAR=0x%08x IOP3XX_ERLR=0x%08x IOP3XX_ERTVR=%08x\n",
344 *IOP3XX_ERBAR, *IOP3XX_ERLR, *IOP3XX_ERTVR);
345 DBG("ATU: IOP3XX_IABAR2=0x%08x IOP3XX_IALR2=0x%08x IOP3XX_IATVR2=%08x\n",
346 *IOP3XX_IABAR2, *IOP3XX_IALR2, *IOP3XX_IATVR2);
347 DBG("ATU: IOP3XX_IABAR3=0x%08x IOP3XX_IALR3=0x%08x IOP3XX_IATVR3=%08x\n",
348 *IOP3XX_IABAR3, *IOP3XX_IALR3, *IOP3XX_IATVR3);
349 361
350 hook_fault_code(16+6, iop3xx_pci_abort, SIGBUS, "imprecise external abort"); 362 hook_fault_code(16+6, iop3xx_pci_abort, SIGBUS, "imprecise external abort");
351} 363}
352 364
365/* for platforms that might be host-bus-adapters */
366void __init iop3xx_pci_preinit_cond(void)
367{
368 if (iop3xx_get_init_atu() == IOP3XX_INIT_ATU_ENABLE) {
369 iop3xx_atu_disable();
370 iop3xx_atu_setup();
371 iop3xx_atu_debug();
372 }
373}
374
375void __init iop3xx_pci_preinit(void)
376{
377 iop3xx_atu_disable();
378 iop3xx_atu_setup();
379 iop3xx_atu_debug();
380}
381
353/* allow init_atu to be user overridden */ 382/* allow init_atu to be user overridden */
354static int __init iop3xx_init_atu_setup(char *str) 383static int __init iop3xx_init_atu_setup(char *str)
355{ 384{
diff --git a/arch/arm/plat-mxc/Kconfig b/arch/arm/plat-mxc/Kconfig
index 03a65c0dfb60..bb6e12738fb3 100644
--- a/arch/arm/plat-mxc/Kconfig
+++ b/arch/arm/plat-mxc/Kconfig
@@ -4,7 +4,7 @@ menu "Freescale MXC Implementations"
4 4
5choice 5choice
6 prompt "MXC/iMX System Type" 6 prompt "MXC/iMX System Type"
7 default 0 7 default ARCH_MX3
8 8
9config ARCH_MX3 9config ARCH_MX3
10 bool "MX3-based" 10 bool "MX3-based"
diff --git a/arch/arm/plat-mxc/Makefile b/arch/arm/plat-mxc/Makefile
index 66ad9c2b6d64..f96dc0362068 100644
--- a/arch/arm/plat-mxc/Makefile
+++ b/arch/arm/plat-mxc/Makefile
@@ -4,7 +4,3 @@
4 4
5# Common support 5# Common support
6obj-y := irq.o 6obj-y := irq.o
7
8obj-m :=
9obj-n :=
10obj- :=
diff --git a/arch/arm/plat-mxc/irq.c b/arch/arm/plat-mxc/irq.c
index 87d253bc3d3c..2ad5a6917b3f 100644
--- a/arch/arm/plat-mxc/irq.c
+++ b/arch/arm/plat-mxc/irq.c
@@ -19,21 +19,13 @@
19#include <asm/mach/irq.h> 19#include <asm/mach/irq.h>
20#include <asm/arch/common.h> 20#include <asm/arch/common.h>
21 21
22/*! 22/* Disable interrupt number "irq" in the AVIC */
23 * Disable interrupt number "irq" in the AVIC
24 *
25 * @param irq interrupt source number
26 */
27static void mxc_mask_irq(unsigned int irq) 23static void mxc_mask_irq(unsigned int irq)
28{ 24{
29 __raw_writel(irq, AVIC_INTDISNUM); 25 __raw_writel(irq, AVIC_INTDISNUM);
30} 26}
31 27
32/*! 28/* Enable interrupt number "irq" in the AVIC */
33 * Enable interrupt number "irq" in the AVIC
34 *
35 * @param irq interrupt source number
36 */
37static void mxc_unmask_irq(unsigned int irq) 29static void mxc_unmask_irq(unsigned int irq)
38{ 30{
39 __raw_writel(irq, AVIC_INTENNUM); 31 __raw_writel(irq, AVIC_INTENNUM);
@@ -45,7 +37,7 @@ static struct irq_chip mxc_avic_chip = {
45 .unmask = mxc_unmask_irq, 37 .unmask = mxc_unmask_irq,
46}; 38};
47 39
48/*! 40/*
49 * This function initializes the AVIC hardware and disables all the 41 * This function initializes the AVIC hardware and disables all the
50 * interrupts. It registers the interrupt enable and disable functions 42 * interrupts. It registers the interrupt enable and disable functions
51 * to the kernel for each interrupt source. 43 * to the kernel for each interrupt source.
diff --git a/arch/arm/plat-orion/Makefile b/arch/arm/plat-orion/Makefile
new file mode 100644
index 000000000000..198f3dde2be3
--- /dev/null
+++ b/arch/arm/plat-orion/Makefile
@@ -0,0 +1,8 @@
1#
2# Makefile for the linux kernel.
3#
4
5obj-y := irq.o pcie.o time.o
6obj-m :=
7obj-n :=
8obj- :=
diff --git a/arch/arm/plat-orion/irq.c b/arch/arm/plat-orion/irq.c
new file mode 100644
index 000000000000..c5b669d234bc
--- /dev/null
+++ b/arch/arm/plat-orion/irq.c
@@ -0,0 +1,64 @@
1/*
2 * arch/arm/plat-orion/irq.c
3 *
4 * Marvell Orion SoC IRQ handling.
5 *
6 * This file is licensed under the terms of the GNU General Public
7 * License version 2. This program is licensed "as is" without any
8 * warranty of any kind, whether express or implied.
9 */
10
11#include <linux/kernel.h>
12#include <linux/init.h>
13#include <linux/irq.h>
14#include <linux/io.h>
15#include <asm/plat-orion/irq.h>
16
17static void orion_irq_mask(u32 irq)
18{
19 void __iomem *maskaddr = get_irq_chip_data(irq);
20 u32 mask;
21
22 mask = readl(maskaddr);
23 mask &= ~(1 << (irq & 31));
24 writel(mask, maskaddr);
25}
26
27static void orion_irq_unmask(u32 irq)
28{
29 void __iomem *maskaddr = get_irq_chip_data(irq);
30 u32 mask;
31
32 mask = readl(maskaddr);
33 mask |= 1 << (irq & 31);
34 writel(mask, maskaddr);
35}
36
37static struct irq_chip orion_irq_chip = {
38 .name = "orion_irq",
39 .ack = orion_irq_mask,
40 .mask = orion_irq_mask,
41 .unmask = orion_irq_unmask,
42};
43
44void __init orion_irq_init(unsigned int irq_start, void __iomem *maskaddr)
45{
46 unsigned int i;
47
48 /*
49 * Mask all interrupts initially.
50 */
51 writel(0, maskaddr);
52
53 /*
54 * Register IRQ sources.
55 */
56 for (i = 0; i < 32; i++) {
57 unsigned int irq = irq_start + i;
58
59 set_irq_chip(irq, &orion_irq_chip);
60 set_irq_chip_data(irq, maskaddr);
61 set_irq_handler(irq, handle_level_irq);
62 set_irq_flags(irq, IRQF_VALID);
63 }
64}
diff --git a/arch/arm/plat-orion/pcie.c b/arch/arm/plat-orion/pcie.c
new file mode 100644
index 000000000000..abfda53f1800
--- /dev/null
+++ b/arch/arm/plat-orion/pcie.c
@@ -0,0 +1,245 @@
1/*
2 * arch/arm/plat-orion/pcie.c
3 *
4 * Marvell Orion SoC PCIe handling.
5 *
6 * This file is licensed under the terms of the GNU General Public
7 * License version 2. This program is licensed "as is" without any
8 * warranty of any kind, whether express or implied.
9 */
10
11#include <linux/kernel.h>
12#include <linux/pci.h>
13#include <linux/mbus.h>
14#include <asm/mach/pci.h>
15#include <asm/plat-orion/pcie.h>
16
17/*
18 * PCIe unit register offsets.
19 */
20#define PCIE_DEV_ID_OFF 0x0000
21#define PCIE_CMD_OFF 0x0004
22#define PCIE_DEV_REV_OFF 0x0008
23#define PCIE_BAR_LO_OFF(n) (0x0010 + ((n) << 3))
24#define PCIE_BAR_HI_OFF(n) (0x0014 + ((n) << 3))
25#define PCIE_HEADER_LOG_4_OFF 0x0128
26#define PCIE_BAR_CTRL_OFF(n) (0x1804 + ((n - 1) * 4))
27#define PCIE_WIN04_CTRL_OFF(n) (0x1820 + ((n) << 4))
28#define PCIE_WIN04_BASE_OFF(n) (0x1824 + ((n) << 4))
29#define PCIE_WIN04_REMAP_OFF(n) (0x182c + ((n) << 4))
30#define PCIE_WIN5_CTRL_OFF 0x1880
31#define PCIE_WIN5_BASE_OFF 0x1884
32#define PCIE_WIN5_REMAP_OFF 0x188c
33#define PCIE_CONF_ADDR_OFF 0x18f8
34#define PCIE_CONF_ADDR_EN 0x80000000
35#define PCIE_CONF_REG(r) ((((r) & 0xf00) << 16) | ((r) & 0xfc))
36#define PCIE_CONF_BUS(b) (((b) & 0xff) << 16)
37#define PCIE_CONF_DEV(d) (((d) & 0x1f) << 11)
38#define PCIE_CONF_FUNC(f) (((f) & 0x3) << 8)
39#define PCIE_CONF_DATA_OFF 0x18fc
40#define PCIE_MASK_OFF 0x1910
41#define PCIE_CTRL_OFF 0x1a00
42#define PCIE_STAT_OFF 0x1a04
43#define PCIE_STAT_DEV_OFFS 20
44#define PCIE_STAT_DEV_MASK 0x1f
45#define PCIE_STAT_BUS_OFFS 8
46#define PCIE_STAT_BUS_MASK 0xff
47#define PCIE_STAT_LINK_DOWN 1
48
49
50u32 __init orion_pcie_dev_id(void __iomem *base)
51{
52 return readl(base + PCIE_DEV_ID_OFF) >> 16;
53}
54
55u32 __init orion_pcie_rev(void __iomem *base)
56{
57 return readl(base + PCIE_DEV_REV_OFF) & 0xff;
58}
59
60int orion_pcie_link_up(void __iomem *base)
61{
62 return !(readl(base + PCIE_STAT_OFF) & PCIE_STAT_LINK_DOWN);
63}
64
65int orion_pcie_get_local_bus_nr(void __iomem *base)
66{
67 u32 stat = readl(base + PCIE_STAT_OFF);
68
69 return (stat >> PCIE_STAT_BUS_OFFS) & PCIE_STAT_BUS_MASK;
70}
71
72void __init orion_pcie_set_local_bus_nr(void __iomem *base, int nr)
73{
74 u32 stat;
75
76 stat = readl(base + PCIE_STAT_OFF);
77 stat &= ~(PCIE_STAT_BUS_MASK << PCIE_STAT_BUS_OFFS);
78 stat |= nr << PCIE_STAT_BUS_OFFS;
79 writel(stat, base + PCIE_STAT_OFF);
80}
81
82/*
83 * Setup PCIE BARs and Address Decode Wins:
84 * BAR[0,2] -> disabled, BAR[1] -> covers all DRAM banks
85 * WIN[0-3] -> DRAM bank[0-3]
86 */
87static void __init orion_pcie_setup_wins(void __iomem *base,
88 struct mbus_dram_target_info *dram)
89{
90 u32 size;
91 int i;
92
93 /*
94 * First, disable and clear BARs and windows.
95 */
96 for (i = 1; i <= 2; i++) {
97 writel(0, base + PCIE_BAR_CTRL_OFF(i));
98 writel(0, base + PCIE_BAR_LO_OFF(i));
99 writel(0, base + PCIE_BAR_HI_OFF(i));
100 }
101
102 for (i = 0; i < 5; i++) {
103 writel(0, base + PCIE_WIN04_CTRL_OFF(i));
104 writel(0, base + PCIE_WIN04_BASE_OFF(i));
105 writel(0, base + PCIE_WIN04_REMAP_OFF(i));
106 }
107
108 writel(0, base + PCIE_WIN5_CTRL_OFF);
109 writel(0, base + PCIE_WIN5_BASE_OFF);
110 writel(0, base + PCIE_WIN5_REMAP_OFF);
111
112 /*
113 * Setup windows for DDR banks. Count total DDR size on the fly.
114 */
115 size = 0;
116 for (i = 0; i < dram->num_cs; i++) {
117 struct mbus_dram_window *cs = dram->cs + i;
118
119 writel(cs->base & 0xffff0000, base + PCIE_WIN04_BASE_OFF(i));
120 writel(0, base + PCIE_WIN04_REMAP_OFF(i));
121 writel(((cs->size - 1) & 0xffff0000) |
122 (cs->mbus_attr << 8) |
123 (dram->mbus_dram_target_id << 4) | 1,
124 base + PCIE_WIN04_CTRL_OFF(i));
125
126 size += cs->size;
127 }
128
129 /*
130 * Setup BAR[1] to all DRAM banks.
131 */
132 writel(dram->cs[0].base, base + PCIE_BAR_LO_OFF(1));
133 writel(0, base + PCIE_BAR_HI_OFF(1));
134 writel(((size - 1) & 0xffff0000) | 1, base + PCIE_BAR_CTRL_OFF(1));
135}
136
137void __init orion_pcie_setup(void __iomem *base,
138 struct mbus_dram_target_info *dram)
139{
140 u16 cmd;
141 u32 mask;
142
143 /*
144 * Point PCIe unit MBUS decode windows to DRAM space.
145 */
146 orion_pcie_setup_wins(base, dram);
147
148 /*
149 * Master + slave enable.
150 */
151 cmd = readw(base + PCIE_CMD_OFF);
152 cmd |= PCI_COMMAND_IO;
153 cmd |= PCI_COMMAND_MEMORY;
154 cmd |= PCI_COMMAND_MASTER;
155 writew(cmd, base + PCIE_CMD_OFF);
156
157 /*
158 * Enable interrupt lines A-D.
159 */
160 mask = readl(base + PCIE_MASK_OFF);
161 mask |= 0x0f000000;
162 writel(mask, base + PCIE_MASK_OFF);
163}
164
165int orion_pcie_rd_conf(void __iomem *base, struct pci_bus *bus,
166 u32 devfn, int where, int size, u32 *val)
167{
168 writel(PCIE_CONF_BUS(bus->number) |
169 PCIE_CONF_DEV(PCI_SLOT(devfn)) |
170 PCIE_CONF_FUNC(PCI_FUNC(devfn)) |
171 PCIE_CONF_REG(where) | PCIE_CONF_ADDR_EN,
172 base + PCIE_CONF_ADDR_OFF);
173
174 *val = readl(base + PCIE_CONF_DATA_OFF);
175
176 if (size == 1)
177 *val = (*val >> (8 * (where & 3))) & 0xff;
178 else if (size == 2)
179 *val = (*val >> (8 * (where & 3))) & 0xffff;
180
181 return PCIBIOS_SUCCESSFUL;
182}
183
184int orion_pcie_rd_conf_tlp(void __iomem *base, struct pci_bus *bus,
185 u32 devfn, int where, int size, u32 *val)
186{
187 writel(PCIE_CONF_BUS(bus->number) |
188 PCIE_CONF_DEV(PCI_SLOT(devfn)) |
189 PCIE_CONF_FUNC(PCI_FUNC(devfn)) |
190 PCIE_CONF_REG(where) | PCIE_CONF_ADDR_EN,
191 base + PCIE_CONF_ADDR_OFF);
192
193 *val = readl(base + PCIE_CONF_DATA_OFF);
194
195 if (bus->number != orion_pcie_get_local_bus_nr(base) ||
196 PCI_FUNC(devfn) != 0)
197 *val = readl(base + PCIE_HEADER_LOG_4_OFF);
198
199 if (size == 1)
200 *val = (*val >> (8 * (where & 3))) & 0xff;
201 else if (size == 2)
202 *val = (*val >> (8 * (where & 3))) & 0xffff;
203
204 return PCIBIOS_SUCCESSFUL;
205}
206
207int orion_pcie_rd_conf_wa(void __iomem *wa_base, struct pci_bus *bus,
208 u32 devfn, int where, int size, u32 *val)
209{
210 *val = readl(wa_base + (PCIE_CONF_BUS(bus->number) |
211 PCIE_CONF_DEV(PCI_SLOT(devfn)) |
212 PCIE_CONF_FUNC(PCI_FUNC(devfn)) |
213 PCIE_CONF_REG(where)));
214
215 if (size == 1)
216 *val = (*val >> (8 * (where & 3))) & 0xff;
217 else if (size == 2)
218 *val = (*val >> (8 * (where & 3))) & 0xffff;
219
220 return PCIBIOS_SUCCESSFUL;
221}
222
223int orion_pcie_wr_conf(void __iomem *base, struct pci_bus *bus,
224 u32 devfn, int where, int size, u32 val)
225{
226 int ret = PCIBIOS_SUCCESSFUL;
227
228 writel(PCIE_CONF_BUS(bus->number) |
229 PCIE_CONF_DEV(PCI_SLOT(devfn)) |
230 PCIE_CONF_FUNC(PCI_FUNC(devfn)) |
231 PCIE_CONF_REG(where) | PCIE_CONF_ADDR_EN,
232 base + PCIE_CONF_ADDR_OFF);
233
234 if (size == 4) {
235 writel(val, base + PCIE_CONF_DATA_OFF);
236 } else if (size == 2) {
237 writew(val, base + PCIE_CONF_DATA_OFF + (where & 3));
238 } else if (size == 1) {
239 writeb(val, base + PCIE_CONF_DATA_OFF + (where & 3));
240 } else {
241 ret = PCIBIOS_BAD_REGISTER_NUMBER;
242 }
243
244 return ret;
245}
diff --git a/arch/arm/plat-orion/time.c b/arch/arm/plat-orion/time.c
new file mode 100644
index 000000000000..28b5285446e8
--- /dev/null
+++ b/arch/arm/plat-orion/time.c
@@ -0,0 +1,203 @@
1/*
2 * arch/arm/plat-orion/time.c
3 *
4 * Marvell Orion SoC timer handling.
5 *
6 * This file is licensed under the terms of the GNU General Public
7 * License version 2. This program is licensed "as is" without any
8 * warranty of any kind, whether express or implied.
9 *
10 * Timer 0 is used as free-running clocksource, while timer 1 is
11 * used as clock_event_device.
12 */
13
14#include <linux/kernel.h>
15#include <linux/clockchips.h>
16#include <linux/interrupt.h>
17#include <linux/irq.h>
18#include <asm/mach/time.h>
19#include <asm/arch/hardware.h>
20
21/*
22 * Number of timer ticks per jiffy.
23 */
24static u32 ticks_per_jiffy;
25
26
27/*
28 * Timer block registers.
29 */
30#define TIMER_CTRL (TIMER_VIRT_BASE + 0x0000)
31#define TIMER0_EN 0x0001
32#define TIMER0_RELOAD_EN 0x0002
33#define TIMER1_EN 0x0004
34#define TIMER1_RELOAD_EN 0x0008
35#define TIMER0_RELOAD (TIMER_VIRT_BASE + 0x0010)
36#define TIMER0_VAL (TIMER_VIRT_BASE + 0x0014)
37#define TIMER1_RELOAD (TIMER_VIRT_BASE + 0x0018)
38#define TIMER1_VAL (TIMER_VIRT_BASE + 0x001c)
39
40
41/*
42 * Clocksource handling.
43 */
44static cycle_t orion_clksrc_read(void)
45{
46 return 0xffffffff - readl(TIMER0_VAL);
47}
48
49static struct clocksource orion_clksrc = {
50 .name = "orion_clocksource",
51 .shift = 20,
52 .rating = 300,
53 .read = orion_clksrc_read,
54 .mask = CLOCKSOURCE_MASK(32),
55 .flags = CLOCK_SOURCE_IS_CONTINUOUS,
56};
57
58
59
60/*
61 * Clockevent handling.
62 */
63static int
64orion_clkevt_next_event(unsigned long delta, struct clock_event_device *dev)
65{
66 unsigned long flags;
67 u32 u;
68
69 if (delta == 0)
70 return -ETIME;
71
72 local_irq_save(flags);
73
74 /*
75 * Clear and enable clockevent timer interrupt.
76 */
77 writel(~BRIDGE_INT_TIMER1, BRIDGE_CAUSE);
78
79 u = readl(BRIDGE_MASK);
80 u |= BRIDGE_INT_TIMER1;
81 writel(u, BRIDGE_MASK);
82
83 /*
84 * Setup new clockevent timer value.
85 */
86 writel(delta, TIMER1_VAL);
87
88 /*
89 * Enable the timer.
90 */
91 u = readl(TIMER_CTRL);
92 u = (u & ~TIMER1_RELOAD_EN) | TIMER1_EN;
93 writel(u, TIMER_CTRL);
94
95 local_irq_restore(flags);
96
97 return 0;
98}
99
100static void
101orion_clkevt_mode(enum clock_event_mode mode, struct clock_event_device *dev)
102{
103 unsigned long flags;
104 u32 u;
105
106 local_irq_save(flags);
107 if (mode == CLOCK_EVT_MODE_PERIODIC) {
108 /*
109 * Setup timer to fire at 1/HZ intervals.
110 */
111 writel(ticks_per_jiffy - 1, TIMER1_RELOAD);
112 writel(ticks_per_jiffy - 1, TIMER1_VAL);
113
114 /*
115 * Enable timer interrupt.
116 */
117 u = readl(BRIDGE_MASK);
118 writel(u | BRIDGE_INT_TIMER1, BRIDGE_MASK);
119
120 /*
121 * Enable timer.
122 */
123 u = readl(TIMER_CTRL);
124 writel(u | TIMER1_EN | TIMER1_RELOAD_EN, TIMER_CTRL);
125 } else {
126 /*
127 * Disable timer.
128 */
129 u = readl(TIMER_CTRL);
130 writel(u & ~TIMER1_EN, TIMER_CTRL);
131
132 /*
133 * Disable timer interrupt.
134 */
135 u = readl(BRIDGE_MASK);
136 writel(u & ~BRIDGE_INT_TIMER1, BRIDGE_MASK);
137
138 /*
139 * ACK pending timer interrupt.
140 */
141 writel(~BRIDGE_INT_TIMER1, BRIDGE_CAUSE);
142
143 }
144 local_irq_restore(flags);
145}
146
147static struct clock_event_device orion_clkevt = {
148 .name = "orion_tick",
149 .features = CLOCK_EVT_FEAT_ONESHOT | CLOCK_EVT_FEAT_PERIODIC,
150 .shift = 32,
151 .rating = 300,
152 .cpumask = CPU_MASK_CPU0,
153 .set_next_event = orion_clkevt_next_event,
154 .set_mode = orion_clkevt_mode,
155};
156
157static irqreturn_t orion_timer_interrupt(int irq, void *dev_id)
158{
159 /*
160 * ACK timer interrupt and call event handler.
161 */
162 writel(~BRIDGE_INT_TIMER1, BRIDGE_CAUSE);
163 orion_clkevt.event_handler(&orion_clkevt);
164
165 return IRQ_HANDLED;
166}
167
168static struct irqaction orion_timer_irq = {
169 .name = "orion_tick",
170 .flags = IRQF_DISABLED | IRQF_TIMER,
171 .handler = orion_timer_interrupt
172};
173
174void __init orion_time_init(unsigned int irq, unsigned int tclk)
175{
176 u32 u;
177
178 ticks_per_jiffy = (tclk + HZ/2) / HZ;
179
180
181 /*
182 * Setup free-running clocksource timer (interrupts
183 * disabled.)
184 */
185 writel(0xffffffff, TIMER0_VAL);
186 writel(0xffffffff, TIMER0_RELOAD);
187 u = readl(BRIDGE_MASK);
188 writel(u & ~BRIDGE_INT_TIMER0, BRIDGE_MASK);
189 u = readl(TIMER_CTRL);
190 writel(u | TIMER0_EN | TIMER0_RELOAD_EN, TIMER_CTRL);
191 orion_clksrc.mult = clocksource_hz2mult(tclk, orion_clksrc.shift);
192 clocksource_register(&orion_clksrc);
193
194
195 /*
196 * Setup clockevent timer (interrupt-driven.)
197 */
198 setup_irq(irq, &orion_timer_irq);
199 orion_clkevt.mult = div_sc(tclk, NSEC_PER_SEC, orion_clkevt.shift);
200 orion_clkevt.max_delta_ns = clockevent_delta2ns(0xfffffffe, &orion_clkevt);
201 orion_clkevt.min_delta_ns = clockevent_delta2ns(1, &orion_clkevt);
202 clockevents_register_device(&orion_clkevt);
203}
diff --git a/arch/arm/plat-s3c24xx/clock.c b/arch/arm/plat-s3c24xx/clock.c
index 99a44746f8f2..d84167fb33b1 100644
--- a/arch/arm/plat-s3c24xx/clock.c
+++ b/arch/arm/plat-s3c24xx/clock.c
@@ -332,6 +332,58 @@ static int s3c24xx_dclk_setparent(struct clk *clk, struct clk *parent)
332 return 0; 332 return 0;
333} 333}
334 334
335static unsigned long s3c24xx_calc_div(struct clk *clk, unsigned long rate)
336{
337 unsigned long div;
338
339 if ((rate == 0) || !clk->parent)
340 return 0;
341
342 div = clk_get_rate(clk->parent) / rate;
343 if (div < 2)
344 div = 2;
345 else if (div > 16)
346 div = 16;
347
348 return div;
349}
350
351static unsigned long s3c24xx_round_dclk_rate(struct clk *clk,
352 unsigned long rate)
353{
354 unsigned long div = s3c24xx_calc_div(clk, rate);
355
356 if (div == 0)
357 return 0;
358
359 return clk_get_rate(clk->parent) / div;
360}
361
362static int s3c24xx_set_dclk_rate(struct clk *clk, unsigned long rate)
363{
364 unsigned long mask, data, div = s3c24xx_calc_div(clk, rate);
365
366 if (div == 0)
367 return -EINVAL;
368
369 if (clk == &s3c24xx_dclk0) {
370 mask = S3C2410_DCLKCON_DCLK0_DIV_MASK |
371 S3C2410_DCLKCON_DCLK0_CMP_MASK;
372 data = S3C2410_DCLKCON_DCLK0_DIV(div) |
373 S3C2410_DCLKCON_DCLK0_CMP((div + 1) / 2);
374 } else if (clk == &s3c24xx_dclk1) {
375 mask = S3C2410_DCLKCON_DCLK1_DIV_MASK |
376 S3C2410_DCLKCON_DCLK1_CMP_MASK;
377 data = S3C2410_DCLKCON_DCLK1_DIV(div) |
378 S3C2410_DCLKCON_DCLK1_CMP((div + 1) / 2);
379 } else
380 return -EINVAL;
381
382 clk->rate = clk_get_rate(clk->parent) / div;
383 __raw_writel(((__raw_readl(S3C24XX_DCLKCON) & ~mask) | data),
384 S3C24XX_DCLKCON);
385 return clk->rate;
386}
335 387
336static int s3c24xx_clkout_setparent(struct clk *clk, struct clk *parent) 388static int s3c24xx_clkout_setparent(struct clk *clk, struct clk *parent)
337{ 389{
@@ -378,6 +430,8 @@ struct clk s3c24xx_dclk0 = {
378 .ctrlbit = S3C2410_DCLKCON_DCLK0EN, 430 .ctrlbit = S3C2410_DCLKCON_DCLK0EN,
379 .enable = s3c24xx_dclk_enable, 431 .enable = s3c24xx_dclk_enable,
380 .set_parent = s3c24xx_dclk_setparent, 432 .set_parent = s3c24xx_dclk_setparent,
433 .set_rate = s3c24xx_set_dclk_rate,
434 .round_rate = s3c24xx_round_dclk_rate,
381}; 435};
382 436
383struct clk s3c24xx_dclk1 = { 437struct clk s3c24xx_dclk1 = {
@@ -386,6 +440,8 @@ struct clk s3c24xx_dclk1 = {
386 .ctrlbit = S3C2410_DCLKCON_DCLK0EN, 440 .ctrlbit = S3C2410_DCLKCON_DCLK0EN,
387 .enable = s3c24xx_dclk_enable, 441 .enable = s3c24xx_dclk_enable,
388 .set_parent = s3c24xx_dclk_setparent, 442 .set_parent = s3c24xx_dclk_setparent,
443 .set_rate = s3c24xx_set_dclk_rate,
444 .round_rate = s3c24xx_round_dclk_rate,
389}; 445};
390 446
391struct clk s3c24xx_clkout0 = { 447struct clk s3c24xx_clkout0 = {
diff --git a/arch/arm/plat-s3c24xx/cpu.c b/arch/arm/plat-s3c24xx/cpu.c
index f513ab083b8f..f5699cadb0c3 100644
--- a/arch/arm/plat-s3c24xx/cpu.c
+++ b/arch/arm/plat-s3c24xx/cpu.c
@@ -28,15 +28,19 @@
28#include <linux/ioport.h> 28#include <linux/ioport.h>
29#include <linux/serial_core.h> 29#include <linux/serial_core.h>
30#include <linux/platform_device.h> 30#include <linux/platform_device.h>
31#include <linux/delay.h>
31 32
32#include <asm/hardware.h> 33#include <asm/hardware.h>
33#include <asm/irq.h> 34#include <asm/irq.h>
34#include <asm/io.h> 35#include <asm/io.h>
35#include <asm/delay.h> 36#include <asm/delay.h>
37#include <asm/cacheflush.h>
36 38
37#include <asm/mach/arch.h> 39#include <asm/mach/arch.h>
38#include <asm/mach/map.h> 40#include <asm/mach/map.h>
39 41
42#include <asm/arch/system-reset.h>
43
40#include <asm/arch/regs-gpio.h> 44#include <asm/arch/regs-gpio.h>
41#include <asm/plat-s3c/regs-serial.h> 45#include <asm/plat-s3c/regs-serial.h>
42 46
@@ -203,6 +207,27 @@ static unsigned long s3c24xx_read_idcode_v4(void)
203#endif 207#endif
204} 208}
205 209
210/* Hook for arm_pm_restart to ensure we execute the reset code
211 * with the caches enabled. It seems at least the S3C2440 has a problem
212 * resetting if there is bus activity interrupted by the reset.
213 */
214static void s3c24xx_pm_restart(char mode)
215{
216 if (mode != 's') {
217 unsigned long flags;
218
219 local_irq_save(flags);
220 __cpuc_flush_kern_all();
221 __cpuc_flush_user_all();
222
223 arch_reset(mode);
224 local_irq_restore(flags);
225 }
226
227 /* fallback, or unhandled */
228 arm_machine_restart(mode);
229}
230
206void __init s3c24xx_init_io(struct map_desc *mach_desc, int size) 231void __init s3c24xx_init_io(struct map_desc *mach_desc, int size)
207{ 232{
208 unsigned long idcode = 0x0; 233 unsigned long idcode = 0x0;
@@ -230,6 +255,8 @@ void __init s3c24xx_init_io(struct map_desc *mach_desc, int size)
230 panic("Unsupported S3C24XX CPU"); 255 panic("Unsupported S3C24XX CPU");
231 } 256 }
232 257
258 arm_pm_restart = s3c24xx_pm_restart;
259
233 (cpu->map_io)(mach_desc, size); 260 (cpu->map_io)(mach_desc, size);
234} 261}
235 262
diff --git a/arch/arm/tools/mach-types b/arch/arm/tools/mach-types
index 7ed58c0c24c2..207a8b5a0c4a 100644
--- a/arch/arm/tools/mach-types
+++ b/arch/arm/tools/mach-types
@@ -12,7 +12,7 @@
12# 12#
13# http://www.arm.linux.org.uk/developer/machines/?action=new 13# http://www.arm.linux.org.uk/developer/machines/?action=new
14# 14#
15# Last update: Sat Jan 26 14:45:34 2008 15# Last update: Sat Apr 19 11:23:38 2008
16# 16#
17# machine_is_xxx CONFIG_xxxx MACH_TYPE_xxx number 17# machine_is_xxx CONFIG_xxxx MACH_TYPE_xxx number
18# 18#
@@ -381,13 +381,13 @@ ks8695p ARCH_KS8695P KS8695P 363
381se4000 ARCH_SE4000 SE4000 364 381se4000 ARCH_SE4000 SE4000 364
382quadriceps ARCH_QUADRICEPS QUADRICEPS 365 382quadriceps ARCH_QUADRICEPS QUADRICEPS 365
383bronco ARCH_BRONCO BRONCO 366 383bronco ARCH_BRONCO BRONCO 366
384esl_wireless_tab ARCH_ESL_WIRELESS_TABLETESL_WIRELESS_TABLET 367 384esl_wireless_tab ARCH_ESL_WIRELESS_TAB ESL_WIRELESS_TAB 367
385esl_sofcomp ARCH_ESL_SOFCOMP ESL_SOFCOMP 368 385esl_sofcomp ARCH_ESL_SOFCOMP ESL_SOFCOMP 368
386s5c7375 ARCH_S5C7375 S5C7375 369 386s5c7375 ARCH_S5C7375 S5C7375 369
387spearhead ARCH_SPEARHEAD SPEARHEAD 370 387spearhead ARCH_SPEARHEAD SPEARHEAD 370
388pantera ARCH_PANTERA PANTERA 371 388pantera ARCH_PANTERA PANTERA 371
389prayoglite ARCH_PRAYOGLITE PRAYOGLITE 372 389prayoglite ARCH_PRAYOGLITE PRAYOGLITE 372
390gumstix ARCH_GUMSTIK GUMSTIK 373 390gumstix ARCH_GUMSTIX GUMSTIX 373
391rcube ARCH_RCUBE RCUBE 374 391rcube ARCH_RCUBE RCUBE 374
392rea_olv ARCH_REA_OLV REA_OLV 375 392rea_olv ARCH_REA_OLV REA_OLV 375
393pxa_iphone ARCH_PXA_IPHONE PXA_IPHONE 376 393pxa_iphone ARCH_PXA_IPHONE PXA_IPHONE 376
@@ -1463,7 +1463,7 @@ artemis MACH_ARTEMIS ARTEMIS 1462
1463htctitan MACH_HTCTITAN HTCTITAN 1463 1463htctitan MACH_HTCTITAN HTCTITAN 1463
1464qranium MACH_QRANIUM QRANIUM 1464 1464qranium MACH_QRANIUM QRANIUM 1464
1465adx_wsc2 MACH_ADX_WSC2 ADX_WSC2 1465 1465adx_wsc2 MACH_ADX_WSC2 ADX_WSC2 1465
1466adx_medinet MACH_ADX_MEDINET ADX_MEDINET 1466 1466adx_medcom MACH_ADX_MEDINET ADX_MEDINET 1466
1467bboard MACH_BBOARD BBOARD 1467 1467bboard MACH_BBOARD BBOARD 1467
1468cambria MACH_CAMBRIA CAMBRIA 1468 1468cambria MACH_CAMBRIA CAMBRIA 1468
1469mt7xxx MACH_MT7XXX MT7XXX 1469 1469mt7xxx MACH_MT7XXX MT7XXX 1469
@@ -1611,3 +1611,112 @@ kb9263 MACH_KB9263 KB9263 1612
1611mt7108 MACH_MT7108 MT7108 1613 1611mt7108 MACH_MT7108 MT7108 1613
1612smtr2440 MACH_SMTR2440 SMTR2440 1614 1612smtr2440 MACH_SMTR2440 SMTR2440 1614
1613manao MACH_MANAO MANAO 1615 1613manao MACH_MANAO MANAO 1615
1614cm_x300 MACH_CM_X300 CM_X300 1616
1615gulfstream_kp MACH_GULFSTREAM_KP GULFSTREAM_KP 1617
1616lanreadyfn522 MACH_LANREADYFN522 LANREADYFN522 1618
1617arma37 MACH_ARMA37 ARMA37 1619
1618mendel MACH_MENDEL MENDEL 1620
1619pelco_iliad MACH_PELCO_ILIAD PELCO_ILIAD 1621
1620unit2p MACH_UNIT2P UNIT2P 1622
1621inc20otter MACH_INC20OTTER INC20OTTER 1623
1622at91sam9g20ek MACH_AT91SAM9G20EK AT91SAM9G20EK 1624
1623sc_ge2 MACH_STORCENTER STORCENTER 1625
1624smdk6410 MACH_SMDK6410 SMDK6410 1626
1625u300 MACH_U300 U300 1627
1626u500 MACH_U500 U500 1628
1627ds9260 MACH_DS9260 DS9260 1629
1628riverrock MACH_RIVERROCK RIVERROCK 1630
1629scibath MACH_SCIBATH SCIBATH 1631
1630at91sam7se MACH_AT91SAM7SE512EK AT91SAM7SE512EK 1632
1631wrt350n_v2 MACH_WRT350N_V2 WRT350N_V2 1633
1632multimedia MACH_MULTIMEDIA MULTIMEDIA 1634
1633marvin MACH_MARVIN MARVIN 1635
1634x500 MACH_X500 X500 1636
1635awlug4lcu MACH_AWLUG4LCU AWLUG4LCU 1637
1636palermoc MACH_PALERMOC PALERMOC 1638
1637omap_ldp MACH_OMAP_LDP OMAP_LDP 1639
1638ip500 MACH_IP500 IP500 1640
1639mx35ads MACH_MACH_MX35ADS MACH_MX35ADS 1641
1640ase2 MACH_ASE2 ASE2 1642
1641mx35evb MACH_MX35EVB MX35EVB 1643
1642aml_m8050 MACH_AML_M8050 AML_M8050 1644
1643mx35_3ds MACH_MX35_3DS MX35_3DS 1645
1644mars MACH_MARS MARS 1646
1645ntosd_644xa MACH_NTOSD_644XA NTOSD_644XA 1647
1646badger MACH_BADGER BADGER 1648
1647trizeps4wl MACH_TRIZEPS4WL TRIZEPS4WL 1649
1648trizeps5 MACH_TRIZEPS5 TRIZEPS5 1650
1649marlin MACH_MARLIN MARLIN 1651
1650ts7800 MACH_TS7800 TS7800 1652
1651hpipaq214 MACH_HPIPAQ214 HPIPAQ214 1653
1652at572d940dcm MACH_AT572D940DCM AT572D940DCM 1654
1653ne1board MACH_NE1BOARD NE1BOARD 1655
1654zante MACH_ZANTE ZANTE 1656
1655sffsdr MACH_SFFSDR SFFSDR 1657
1656tw2662 MACH_TW2662 TW2662 1658
1657vf10xx MACH_VF10XX VF10XX 1659
1658zoran43xx MACH_ZORAN43XX ZORAN43XX 1660
1659sonix926 MACH_SONIX926 SONIX926 1661
1660celestialsemi MACH_CELESTIALSEMI CELESTIALSEMI 1662
1661cc9m2443 MACH_CC9M2443 CC9M2443 1663
1662tw5334 MACH_TW5334 TW5334 1664
1663omap_htcartemis MACH_HTCARTEMIS HTCARTEMIS 1665
1664nal_hlite MACH_NAL_HLITE NAL_HLITE 1666
1665htcvogue MACH_HTCVOGUE HTCVOGUE 1667
1666smartweb MACH_SMARTWEB SMARTWEB 1668
1667mv86xx MACH_MV86XX MV86XX 1669
1668mv87xx MACH_MV87XX MV87XX 1670
1669songyoungho MACH_SONGYOUNGHO SONGYOUNGHO 1671
1670younghotema MACH_YOUNGHOTEMA YOUNGHOTEMA 1672
1671pcm037 MACH_PCM037 PCM037 1673
1672mmvp MACH_MMVP MMVP 1674
1673mmap MACH_MMAP MMAP 1675
1674ptid2410 MACH_PTID2410 PTID2410 1676
1675james_926 MACH_JAMES_926 JAMES_926 1677
1676fm6000 MACH_FM6000 FM6000 1678
1677db88f6281_bp MACH_DB88F6281_BP DB88F6281_BP 1680
1678rd88f6192_nas MACH_RD88F6192_NAS RD88F6192_NAS 1681
1679rd88f6281 MACH_RD88F6281 RD88F6281 1682
1680db78x00_bp MACH_DB78X00_BP DB78X00_BP 1683
1681smdk2416 MACH_SMDK2416 SMDK2416 1685
1682oce_spider_si MACH_OCE_SPIDER_SI OCE_SPIDER_SI 1686
1683oce_spider_sk MACH_OCE_SPIDER_SK OCE_SPIDER_SK 1687
1684rovern6 MACH_ROVERN6 ROVERN6 1688
1685pelco_evolution MACH_PELCO_EVOLUTION PELCO_EVOLUTION 1689
1686wbd111 MACH_WBD111 WBD111 1690
1687elaracpe MACH_ELARACPE ELARACPE 1691
1688mabv3 MACH_MABV3 MABV3 1692
1689mv2120 MACH_MV2120 MV2120 1693
1690csb737 MACH_CSB737 CSB737 1695
1691mx51_3ds MACH_MX51_3DS MX51_3DS 1696
1692g900 MACH_G900 G900 1697
1693apf27 MACH_APF27 APF27 1698
1694ggus2000 MACH_GGUS2000 GGUS2000 1699
1695omap_2430_mimic MACH_OMAP_2430_MIMIC OMAP_2430_MIMIC 1700
1696imx27lite MACH_IMX27LITE IMX27LITE 1701
1697almex MACH_ALMEX ALMEX 1702
1698control MACH_CONTROL CONTROL 1703
1699mba2410 MACH_MBA2410 MBA2410 1704
1700volcano MACH_VOLCANO VOLCANO 1705
1701zenith MACH_ZENITH ZENITH 1706
1702muchip MACH_MUCHIP MUCHIP 1707
1703magellan MACH_MAGELLAN MAGELLAN 1708
1704usb_a9260 MACH_USB_A9260 USB_A9260 1709
1705usb_a9263 MACH_USB_A9263 USB_A9263 1710
1706qil_a9260 MACH_QIL_A9260 QIL_A9260 1711
1707cme9210 MACH_CME9210 CME9210 1712
1708hczh4 MACH_HCZH4 HCZH4 1713
1709spearbasic MACH_SPEARBASIC SPEARBASIC 1714
1710dep2440 MACH_DEP2440 DEP2440 1715
1711hdl_gxr MACH_HDL_GXR HDL_GXR 1716
1712hdl_gt MACH_HDL_GT HDL_GT 1717
1713hdl_4g MACH_HDL_4G HDL_4G 1718
1714s3c6000 MACH_S3C6000 S3C6000 1719
1715mmsp2_mdk MACH_MMSP2_MDK MMSP2_MDK 1720
1716mpx220 MACH_MPX220 MPX220 1721
1717kzm_arm11_01 MACH_KZM_ARM11_01 KZM_ARM11_01 1722
1718htc_polaris MACH_HTC_POLARIS HTC_POLARIS 1723
1719htc_kaiser MACH_HTC_KAISER HTC_KAISER 1724
1720lg_ks20 MACH_LG_KS20 LG_KS20 1725
1721hhgps MACH_HHGPS HHGPS 1726
1722nokia_n810_wimax MACH_NOKIA_N810_WIMAX NOKIA_N810_WIMAX 1727