aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-05-22 16:32:53 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-05-22 16:32:53 -0400
commitf6a26ae7699416d86bea8cb68ce413571e9cab3c (patch)
treee91b7a7c7513151fe583721f7435cc9f5cdc4f42 /arch
parentcdd3a354a05b0c33fe33ab11a0fb0838396cad19 (diff)
parent48a5765e5104f1afd22c75c5030af3a6cf24b4c3 (diff)
Merge tag 'boards' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
Pull arm-soc board specific changes from Olof Johansson: "While we generally attempt to get rid of board specific files and replace them with device tree based descriptions, a lot of platforms have not come that far: In shmobile, we add two new board files because their recently started effort to add DT support has not proceeded enough to use it for all of the important hardware. In Kirkwood, we are adding support for new boards with a combination of DT and board file contents in multiple cases. pxa/mmp and imx are extending support for existing board files but not adding new ones." Fix up trivial conflicts in arch/arm/mach-{mmp/ttc_dkb.c,shmobile/{Kconfig,Makefile}} * tag 'boards' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (94 commits) ARM: shmobile: fix smp build ARM: kirkwood: Add support for RaidSonic IB-NAS6210/6220 using devicetree kirkwood: Add iconnect support orion/kirkwood: create a generic function for gpio led blinking kirkwood/orion: fix orion_gpio_set_blink ARM: kirkwood: Define DNS-320/DNS-325 NAND in fdt kirkwood: Allow nand to be configured via. devicetree mtd: Add orion_nand devicetree bindings ARM: kirkwood: Basic support for DNS-320 and DNS-325 ARM: mach-shmobile: Use DT_MACHINE for armadillo 800 eva ARM: mach-shmobile: Use DT_MACHINE for KZM9G ARM: pxa: hx4700: Add Synaptics NavPoint touchpad ARM: pxa: Use REGULATOR_SUPPLY macro ARM: mach-shmobile: kzm9g: enable SMP boot ARM: mach-shmobile: kzm9g: defconfig update ARM: mach-shmobile: kzm9g: add PCF8757 gpio-key ARM: mach-shmobile: kzm9g: add SDHI support ARM: mach-shmobile: kzm9g: add MMCIF support ARM: mach-shmobile: kzm9g: correct screen direction ARM: mach-shmobile: sh73a0.h: add GPIO_NR ...
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/boot/dts/kirkwood-dns320.dts64
-rw-r--r--arch/arm/boot/dts/kirkwood-dns325.dts59
-rw-r--r--arch/arm/boot/dts/kirkwood-ib62x0.dts44
-rw-r--r--arch/arm/boot/dts/kirkwood-iconnect.dts26
-rw-r--r--arch/arm/boot/dts/kirkwood.dtsi15
-rw-r--r--arch/arm/boot/dts/r8a7740-armadillo800eva.dts22
-rw-r--r--arch/arm/boot/dts/sh73a0-kzm9g.dts22
-rw-r--r--arch/arm/configs/armadillo800eva_defconfig142
-rw-r--r--arch/arm/configs/imx_v4_v5_defconfig4
-rw-r--r--arch/arm/configs/kzm9g_defconfig139
-rw-r--r--arch/arm/configs/omap2plus_defconfig2
-rw-r--r--arch/arm/mach-exynos/Kconfig9
-rw-r--r--arch/arm/mach-exynos/mach-nuri.c33
-rw-r--r--arch/arm/mach-exynos/mach-origen.c35
-rw-r--r--arch/arm/mach-exynos/mach-smdk4x12.c16
-rw-r--r--arch/arm/mach-exynos/mach-smdkv310.c30
-rw-r--r--arch/arm/mach-exynos/mach-universal_c210.c33
-rw-r--r--arch/arm/mach-imx/Kconfig35
-rw-r--r--arch/arm/mach-imx/Makefile4
-rw-r--r--arch/arm/mach-imx/eukrea_mbimx51-baseboard.c206
-rw-r--r--arch/arm/mach-imx/eukrea_mbimxsd25-baseboard.c51
-rw-r--r--arch/arm/mach-imx/eukrea_mbimxsd35-baseboard.c42
-rw-r--r--arch/arm/mach-imx/eukrea_mbimxsd51-baseboard.c (renamed from arch/arm/mach-imx/eukrea_mbimxsd-baseboard.c)120
-rw-r--r--arch/arm/mach-imx/mach-cpuimx51.c301
-rw-r--r--arch/arm/mach-imx/mach-cpuimx51sd.c50
-rw-r--r--arch/arm/mach-imx/mach-eukrea_cpuimx25.c2
-rw-r--r--arch/arm/mach-imx/mach-imx27_visstrim_m10.c55
-rw-r--r--arch/arm/mach-imx/mach-mx35_3ds.c193
-rw-r--r--arch/arm/mach-kirkwood/Kconfig22
-rw-r--r--arch/arm/mach-kirkwood/Makefile3
-rw-r--r--arch/arm/mach-kirkwood/Makefile.boot4
-rw-r--r--arch/arm/mach-kirkwood/board-dnskw.c275
-rw-r--r--arch/arm/mach-kirkwood/board-dt.c13
-rw-r--r--arch/arm/mach-kirkwood/board-ib62x0.c143
-rw-r--r--arch/arm/mach-kirkwood/board-iconnect.c165
-rw-r--r--arch/arm/mach-kirkwood/common.c12
-rw-r--r--arch/arm/mach-kirkwood/common.h18
-rw-r--r--arch/arm/mach-mmp/Kconfig7
-rw-r--r--arch/arm/mach-mmp/aspenite.c20
-rw-r--r--arch/arm/mach-mmp/devices.c282
-rw-r--r--arch/arm/mach-mmp/include/mach/devices.h3
-rw-r--r--arch/arm/mach-mmp/include/mach/pxa168.h8
-rw-r--r--arch/arm/mach-mmp/include/mach/pxa910.h3
-rw-r--r--arch/arm/mach-mmp/include/mach/regs-usb.h253
-rw-r--r--arch/arm/mach-mmp/pxa168.c20
-rw-r--r--arch/arm/mach-mmp/pxa910.c2
-rw-r--r--arch/arm/mach-mmp/ttc_dkb.c37
-rw-r--r--arch/arm/mach-omap2/Kconfig1
-rw-r--r--arch/arm/mach-omap2/board-4430sdp.c10
-rw-r--r--arch/arm/mach-omap2/board-am3517crane.c2
-rw-r--r--arch/arm/mach-omap2/board-cm-t35.c5
-rw-r--r--arch/arm/mach-omap2/board-flash.c4
-rw-r--r--arch/arm/mach-omap2/board-flash.h11
-rw-r--r--arch/arm/mach-omap2/board-igep0020.c74
-rw-r--r--arch/arm/mach-omap2/board-omap3beagle.c7
-rw-r--r--arch/arm/mach-omap2/board-omap3logic.c26
-rw-r--r--arch/arm/mach-omap2/board-omap4panda.c24
-rw-r--r--arch/arm/mach-omap2/board-rx51-peripherals.c88
-rw-r--r--arch/arm/mach-omap2/devices.c31
-rw-r--r--arch/arm/mach-omap2/twl-common.c43
-rw-r--r--arch/arm/mach-omap2/twl-common.h2
-rw-r--r--arch/arm/mach-orion5x/dns323-setup.c25
-rw-r--r--arch/arm/mach-pxa/balloon3.c4
-rw-r--r--arch/arm/mach-pxa/cm-x300.c4
-rw-r--r--arch/arm/mach-pxa/em-x270.c5
-rw-r--r--arch/arm/mach-pxa/hx4700.c47
-rw-r--r--arch/arm/mach-pxa/include/mach/mfp-pxa27x.h1
-rw-r--r--arch/arm/mach-pxa/include/mach/mioa701.h3
-rw-r--r--arch/arm/mach-pxa/include/mach/pcm990_baseboard.h68
-rw-r--r--arch/arm/mach-pxa/magician.c8
-rw-r--r--arch/arm/mach-pxa/mioa701.c6
-rw-r--r--arch/arm/mach-pxa/palm27x.c4
-rw-r--r--arch/arm/mach-pxa/pcm990-baseboard.c83
-rw-r--r--arch/arm/mach-pxa/spitz.c4
-rw-r--r--arch/arm/mach-pxa/stargate2.c5
-rw-r--r--arch/arm/mach-pxa/vpac270.c4
-rw-r--r--arch/arm/mach-pxa/z2.c4
-rw-r--r--arch/arm/mach-s3c64xx/mach-crag6410.c18
-rw-r--r--arch/arm/mach-shmobile/Kconfig18
-rw-r--r--arch/arm/mach-shmobile/Makefile2
-rw-r--r--arch/arm/mach-shmobile/board-ap4evb.c2
-rw-r--r--arch/arm/mach-shmobile/board-armadillo800eva.c784
-rw-r--r--arch/arm/mach-shmobile/board-bonito.c2
-rw-r--r--arch/arm/mach-shmobile/board-kzm9g.c460
-rw-r--r--arch/arm/mach-shmobile/board-mackerel.c10
-rw-r--r--arch/arm/mach-shmobile/clock-r8a7740.c3
-rw-r--r--arch/arm/mach-shmobile/include/mach/sh73a0.h3
-rw-r--r--arch/arm/mach-shmobile/pfc-sh73a0.c4
-rw-r--r--arch/arm/mach-shmobile/platsmp.c3
-rw-r--r--arch/arm/mach-shmobile/setup-r8a7740.c7
-rw-r--r--arch/arm/plat-orion/gpio.c27
-rw-r--r--arch/arm/plat-orion/include/plat/gpio.h2
92 files changed, 4173 insertions, 819 deletions
diff --git a/arch/arm/boot/dts/kirkwood-dns320.dts b/arch/arm/boot/dts/kirkwood-dns320.dts
new file mode 100644
index 000000000000..dc09a735b04a
--- /dev/null
+++ b/arch/arm/boot/dts/kirkwood-dns320.dts
@@ -0,0 +1,64 @@
1/dts-v1/;
2
3/include/ "kirkwood.dtsi"
4
5/ {
6 model = "D-Link DNS-320 NAS (Rev A1)";
7 compatible = "dlink,dns-320-a1", "dlink,dns-320", "dlink,dns-kirkwood", "mrvl,kirkwood-88f6281", "mrvl,kirkwood";
8
9 memory {
10 device_type = "memory";
11 reg = <0x00000000 0x8000000>;
12 };
13
14 chosen {
15 bootargs = "console=ttyS0,115200n8 earlyprintk";
16 };
17
18 ocp@f1000000 {
19 serial@12000 {
20 clock-frequency = <166666667>;
21 status = "okay";
22 };
23
24 serial@12100 {
25 clock-frequency = <166666667>;
26 status = "okay";
27 };
28
29 nand@3000000 {
30 status = "okay";
31
32 partition@0 {
33 label = "u-boot";
34 reg = <0x0000000 0x100000>;
35 read-only;
36 };
37
38 partition@100000 {
39 label = "uImage";
40 reg = <0x0100000 0x500000>;
41 };
42
43 partition@600000 {
44 label = "ramdisk";
45 reg = <0x0600000 0x500000>;
46 };
47
48 partition@b00000 {
49 label = "image";
50 reg = <0x0b00000 0x6600000>;
51 };
52
53 partition@7100000 {
54 label = "mini firmware";
55 reg = <0x7100000 0xa00000>;
56 };
57
58 partition@7b00000 {
59 label = "config";
60 reg = <0x7b00000 0x500000>;
61 };
62 };
63 };
64};
diff --git a/arch/arm/boot/dts/kirkwood-dns325.dts b/arch/arm/boot/dts/kirkwood-dns325.dts
new file mode 100644
index 000000000000..c2a5562525d2
--- /dev/null
+++ b/arch/arm/boot/dts/kirkwood-dns325.dts
@@ -0,0 +1,59 @@
1/dts-v1/;
2
3/include/ "kirkwood.dtsi"
4
5/ {
6 model = "D-Link DNS-325 NAS (Rev A1)";
7 compatible = "dlink,dns-325-a1", "dlink,dns-325", "dlink,dns-kirkwood", "mrvl,kirkwood-88f6281", "mrvl,kirkwood";
8
9 memory {
10 device_type = "memory";
11 reg = <0x00000000 0x10000000>;
12 };
13
14 chosen {
15 bootargs = "console=ttyS0,115200n8 earlyprintk";
16 };
17
18 ocp@f1000000 {
19 serial@12000 {
20 clock-frequency = <200000000>;
21 status = "okay";
22 };
23
24 nand@3000000 {
25 status = "okay";
26
27 partition@0 {
28 label = "u-boot";
29 reg = <0x0000000 0x100000>;
30 read-only;
31 };
32
33 partition@100000 {
34 label = "uImage";
35 reg = <0x0100000 0x500000>;
36 };
37
38 partition@600000 {
39 label = "ramdisk";
40 reg = <0x0600000 0x500000>;
41 };
42
43 partition@b00000 {
44 label = "image";
45 reg = <0x0b00000 0x6600000>;
46 };
47
48 partition@7100000 {
49 label = "mini firmware";
50 reg = <0x7100000 0xa00000>;
51 };
52
53 partition@7b00000 {
54 label = "config";
55 reg = <0x7b00000 0x500000>;
56 };
57 };
58 };
59};
diff --git a/arch/arm/boot/dts/kirkwood-ib62x0.dts b/arch/arm/boot/dts/kirkwood-ib62x0.dts
new file mode 100644
index 000000000000..ada0f0c23085
--- /dev/null
+++ b/arch/arm/boot/dts/kirkwood-ib62x0.dts
@@ -0,0 +1,44 @@
1/dts-v1/;
2
3/include/ "kirkwood.dtsi"
4
5/ {
6 model = "RaidSonic ICY BOX IB-NAS62x0 (Rev B)";
7 compatible = "raidsonic,ib-nas6210-b", "raidsonic,ib-nas6220-b", "raidsonic,ib-nas6210", "raidsonic,ib-nas6220", "raidsonic,ib-nas62x0", "mrvl,kirkwood-88f6281", "mrvl,kirkwood";
8
9 memory {
10 device_type = "memory";
11 reg = <0x00000000 0x10000000>;
12 };
13
14 chosen {
15 bootargs = "console=ttyS0,115200n8 earlyprintk";
16 };
17
18 ocp@f1000000 {
19 serial@12000 {
20 clock-frequency = <200000000>;
21 status = "okay";
22 };
23
24 nand@3000000 {
25 status = "okay";
26
27 partition@0 {
28 label = "u-boot";
29 reg = <0x0000000 0x100000>;
30 };
31
32 partition@100000 {
33 label = "uImage";
34 reg = <0x0100000 0x600000>;
35 };
36
37 partition@700000 {
38 label = "root";
39 reg = <0x0700000 0xf900000>;
40 };
41
42 };
43 };
44};
diff --git a/arch/arm/boot/dts/kirkwood-iconnect.dts b/arch/arm/boot/dts/kirkwood-iconnect.dts
new file mode 100644
index 000000000000..1ba75d4adecc
--- /dev/null
+++ b/arch/arm/boot/dts/kirkwood-iconnect.dts
@@ -0,0 +1,26 @@
1/dts-v1/;
2
3/include/ "kirkwood.dtsi"
4
5/ {
6 model = "Iomega Iconnect";
7 compatible = "iom,iconnect-1.1", "iom,iconnect", "mrvl,kirkwood-88f6281", "mrvl,kirkwood";
8
9 memory {
10 device_type = "memory";
11 reg = <0x00000000 0x10000000>;
12 };
13
14 chosen {
15 bootargs = "console=ttyS0,115200n8 earlyprintk mtdparts=orion_nand:0xc0000@0x0(uboot),0x20000@0xa0000(env),0x300000@0x100000(zImage),0x300000@0x540000(initrd),0x1f400000@0x980000(boot)";
16 linux,initrd-start = <0x4500040>;
17 linux,initrd-end = <0x4800000>;
18 };
19
20 ocp@f1000000 {
21 serial@12000 {
22 clock-frequency = <200000000>;
23 status = "ok";
24 };
25 };
26};
diff --git a/arch/arm/boot/dts/kirkwood.dtsi b/arch/arm/boot/dts/kirkwood.dtsi
index 3474ef890945..926528b81baa 100644
--- a/arch/arm/boot/dts/kirkwood.dtsi
+++ b/arch/arm/boot/dts/kirkwood.dtsi
@@ -5,7 +5,7 @@
5 5
6 ocp@f1000000 { 6 ocp@f1000000 {
7 compatible = "simple-bus"; 7 compatible = "simple-bus";
8 ranges = <0 0xf1000000 0x1000000>; 8 ranges = <0 0xf1000000 0x4000000>;
9 #address-cells = <1>; 9 #address-cells = <1>;
10 #size-cells = <1>; 10 #size-cells = <1>;
11 11
@@ -32,5 +32,18 @@
32 reg = <0x10300 0x20>; 32 reg = <0x10300 0x20>;
33 interrupts = <53>; 33 interrupts = <53>;
34 }; 34 };
35
36 nand@3000000 {
37 #address-cells = <1>;
38 #size-cells = <1>;
39 cle = <0>;
40 ale = <1>;
41 bank-width = <1>;
42 compatible = "mrvl,orion-nand";
43 reg = <0x3000000 0x400>;
44 chip-delay = <25>;
45 /* set partition map and/or chip-delay in board dts */
46 status = "disabled";
47 };
35 }; 48 };
36}; 49};
diff --git a/arch/arm/boot/dts/r8a7740-armadillo800eva.dts b/arch/arm/boot/dts/r8a7740-armadillo800eva.dts
new file mode 100644
index 000000000000..a7505a95a3b7
--- /dev/null
+++ b/arch/arm/boot/dts/r8a7740-armadillo800eva.dts
@@ -0,0 +1,22 @@
1/*
2 * Device Tree Source for the armadillo 800 eva board
3 *
4 * Copyright (C) 2012 Renesas Solutions Corp.
5 *
6 * This file is licensed under the terms of the GNU General Public License
7 * version 2. This program is licensed "as is" without any warranty of any
8 * kind, whether express or implied.
9 */
10
11/dts-v1/;
12/include/ "skeleton.dtsi"
13
14/ {
15 model = "armadillo 800 eva";
16 compatible = "renesas,armadillo800eva";
17
18 memory {
19 device_type = "memory";
20 reg = <0x40000000 0x20000000>;
21 };
22};
diff --git a/arch/arm/boot/dts/sh73a0-kzm9g.dts b/arch/arm/boot/dts/sh73a0-kzm9g.dts
new file mode 100644
index 000000000000..bcb911951978
--- /dev/null
+++ b/arch/arm/boot/dts/sh73a0-kzm9g.dts
@@ -0,0 +1,22 @@
1/*
2 * Device Tree Source for the KZM-A9-GT board
3 *
4 * Copyright (C) 2012 Renesas Solutions Corp.
5 *
6 * This file is licensed under the terms of the GNU General Public License
7 * version 2. This program is licensed "as is" without any warranty of any
8 * kind, whether express or implied.
9 */
10
11/dts-v1/;
12/include/ "skeleton.dtsi"
13
14/ {
15 model = "KZM-A9-GT";
16 compatible = "renesas,kzm9g", "renesas,sh73a0";
17
18 memory {
19 device_type = "memory";
20 reg = <0x41000000 0x1e800000>;
21 };
22};
diff --git a/arch/arm/configs/armadillo800eva_defconfig b/arch/arm/configs/armadillo800eva_defconfig
new file mode 100644
index 000000000000..ddc9fe6a78ac
--- /dev/null
+++ b/arch/arm/configs/armadillo800eva_defconfig
@@ -0,0 +1,142 @@
1CONFIG_EXPERIMENTAL=y
2CONFIG_SYSVIPC=y
3CONFIG_IKCONFIG=y
4CONFIG_IKCONFIG_PROC=y
5CONFIG_LOG_BUF_SHIFT=16
6# CONFIG_UTS_NS is not set
7# CONFIG_IPC_NS is not set
8# CONFIG_USER_NS is not set
9# CONFIG_PID_NS is not set
10CONFIG_SYSFS_DEPRECATED=y
11CONFIG_SYSFS_DEPRECATED_V2=y
12CONFIG_CC_OPTIMIZE_FOR_SIZE=y
13CONFIG_SLAB=y
14CONFIG_MODULES=y
15CONFIG_MODULE_UNLOAD=y
16CONFIG_MODULE_FORCE_UNLOAD=y
17# CONFIG_BLK_DEV_BSG is not set
18# CONFIG_IOSCHED_DEADLINE is not set
19# CONFIG_IOSCHED_CFQ is not set
20CONFIG_ARCH_SHMOBILE=y
21CONFIG_ARCH_R8A7740=y
22CONFIG_MACH_ARMADILLO800EVA=y
23# CONFIG_SH_TIMER_TMU is not set
24# CONFIG_ARM_THUMB is not set
25CONFIG_CPU_BPREDICT_DISABLE=y
26# CONFIG_CACHE_L2X0 is not set
27CONFIG_ARM_ERRATA_430973=y
28CONFIG_ARM_ERRATA_458693=y
29CONFIG_ARM_ERRATA_460075=y
30CONFIG_ARM_ERRATA_720789=y
31CONFIG_ARM_ERRATA_743622=y
32CONFIG_ARM_ERRATA_751472=y
33CONFIG_ARM_ERRATA_754322=y
34CONFIG_AEABI=y
35# CONFIG_OABI_COMPAT is not set
36CONFIG_FORCE_MAX_ZONEORDER=13
37CONFIG_ZBOOT_ROM_TEXT=0x0
38CONFIG_ZBOOT_ROM_BSS=0x0
39CONFIG_CMDLINE="console=tty0 console=ttySC1,115200 earlyprintk=sh-sci.1,115200 ignore_loglevel root=/dev/nfs ip=dhcp nfsroot=,rsize=4096,wsize=4096"
40CONFIG_CMDLINE_FORCE=y
41CONFIG_KEXEC=y
42# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
43# CONFIG_SUSPEND is not set
44CONFIG_NET=y
45CONFIG_PACKET=y
46CONFIG_UNIX=y
47CONFIG_INET=y
48CONFIG_IP_PNP=y
49CONFIG_IP_PNP_DHCP=y
50# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
51# CONFIG_INET_XFRM_MODE_TUNNEL is not set
52# CONFIG_INET_XFRM_MODE_BEET is not set
53# CONFIG_INET_LRO is not set
54# CONFIG_INET_DIAG is not set
55# CONFIG_IPV6 is not set
56# CONFIG_WIRELESS is not set
57CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
58CONFIG_SCSI=y
59CONFIG_BLK_DEV_SD=y
60CONFIG_MD=y
61CONFIG_BLK_DEV_DM=y
62CONFIG_NETDEVICES=y
63# CONFIG_NET_VENDOR_BROADCOM is not set
64# CONFIG_NET_VENDOR_CHELSIO is not set
65# CONFIG_NET_VENDOR_CIRRUS is not set
66# CONFIG_NET_VENDOR_FARADAY is not set
67# CONFIG_NET_VENDOR_INTEL is not set
68# CONFIG_NET_VENDOR_MARVELL is not set
69# CONFIG_NET_VENDOR_MICREL is not set
70# CONFIG_NET_VENDOR_NATSEMI is not set
71CONFIG_SH_ETH=y
72# CONFIG_NET_VENDOR_SEEQ is not set
73# CONFIG_NET_VENDOR_SMSC is not set
74# CONFIG_NET_VENDOR_STMICRO is not set
75# CONFIG_WLAN is not set
76# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
77CONFIG_INPUT_EVDEV=y
78# CONFIG_KEYBOARD_ATKBD is not set
79CONFIG_KEYBOARD_GPIO=y
80# CONFIG_INPUT_MOUSE is not set
81CONFIG_INPUT_TOUCHSCREEN=y
82CONFIG_TOUCHSCREEN_ST1232=y
83# CONFIG_SERIO is not set
84# CONFIG_LEGACY_PTYS is not set
85CONFIG_SERIAL_SH_SCI=y
86CONFIG_SERIAL_SH_SCI_NR_UARTS=8
87CONFIG_SERIAL_SH_SCI_CONSOLE=y
88# CONFIG_HW_RANDOM is not set
89CONFIG_I2C=y
90CONFIG_I2C_SH_MOBILE=y
91# CONFIG_HWMON is not set
92CONFIG_FB=y
93CONFIG_FB_MODE_HELPERS=y
94CONFIG_FB_SH_MOBILE_LCDC=y
95CONFIG_LCD_CLASS_DEVICE=y
96CONFIG_FRAMEBUFFER_CONSOLE=y
97CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y
98CONFIG_LOGO=y
99# CONFIG_LOGO_LINUX_MONO is not set
100# CONFIG_LOGO_LINUX_VGA16 is not set
101CONFIG_SOUND=y
102CONFIG_SND=y
103# CONFIG_SND_SUPPORT_OLD_API is not set
104# CONFIG_SND_VERBOSE_PROCFS is not set
105# CONFIG_SND_DRIVERS is not set
106# CONFIG_SND_ARM is not set
107CONFIG_SND_SOC=y
108CONFIG_SND_SOC_SH4_FSI=y
109# CONFIG_HID_SUPPORT is not set
110CONFIG_USB=y
111# CONFIG_USB_DEVICE_CLASS is not set
112CONFIG_USB_RENESAS_USBHS=y
113CONFIG_USB_GADGET=y
114CONFIG_USB_RENESAS_USBHS_UDC=y
115CONFIG_USB_ETH=m
116CONFIG_MMC=y
117CONFIG_MMC_SDHI=y
118CONFIG_MMC_SH_MMCIF=y
119CONFIG_UIO=y
120CONFIG_UIO_PDRV_GENIRQ=y
121# CONFIG_DNOTIFY is not set
122CONFIG_MSDOS_FS=y
123CONFIG_VFAT_FS=y
124CONFIG_TMPFS=y
125# CONFIG_MISC_FILESYSTEMS is not set
126CONFIG_NFS_FS=y
127CONFIG_NFS_V3=y
128CONFIG_NFS_V3_ACL=y
129CONFIG_NFS_V4=y
130CONFIG_NFS_V4_1=y
131CONFIG_ROOT_NFS=y
132CONFIG_NLS_CODEPAGE_437=y
133CONFIG_NLS_ISO8859_1=y
134# CONFIG_ENABLE_WARN_DEPRECATED is not set
135# CONFIG_ENABLE_MUST_CHECK is not set
136# CONFIG_ARM_UNWIND is not set
137CONFIG_CRYPTO=y
138CONFIG_CRYPTO_CBC=y
139CONFIG_CRYPTO_MD5=y
140CONFIG_CRYPTO_DES=y
141CONFIG_CRYPTO_ANSI_CPRNG=y
142CONFIG_XZ_DEC=y
diff --git a/arch/arm/configs/imx_v4_v5_defconfig b/arch/arm/configs/imx_v4_v5_defconfig
index 6b31cb60daab..09a02963cf58 100644
--- a/arch/arm/configs/imx_v4_v5_defconfig
+++ b/arch/arm/configs/imx_v4_v5_defconfig
@@ -92,6 +92,7 @@ CONFIG_INPUT_EVDEV=y
92# CONFIG_INPUT_MOUSE is not set 92# CONFIG_INPUT_MOUSE is not set
93CONFIG_INPUT_TOUCHSCREEN=y 93CONFIG_INPUT_TOUCHSCREEN=y
94CONFIG_TOUCHSCREEN_ADS7846=m 94CONFIG_TOUCHSCREEN_ADS7846=m
95CONFIG_TOUCHSCREEN_MC13783=m
95# CONFIG_SERIO is not set 96# CONFIG_SERIO is not set
96# CONFIG_LEGACY_PTYS is not set 97# CONFIG_LEGACY_PTYS is not set
97CONFIG_SERIAL_8250=m 98CONFIG_SERIAL_8250=m
@@ -107,7 +108,8 @@ CONFIG_SPI_SPIDEV=y
107CONFIG_W1=y 108CONFIG_W1=y
108CONFIG_W1_MASTER_MXC=y 109CONFIG_W1_MASTER_MXC=y
109CONFIG_W1_SLAVE_THERM=y 110CONFIG_W1_SLAVE_THERM=y
110# CONFIG_HWMON is not set 111CONFIG_HWMON=m
112CONFIG_SENSORS_MC13783_ADC=m
111CONFIG_WATCHDOG=y 113CONFIG_WATCHDOG=y
112CONFIG_IMX2_WDT=y 114CONFIG_IMX2_WDT=y
113CONFIG_MFD_MC13XXX=y 115CONFIG_MFD_MC13XXX=y
diff --git a/arch/arm/configs/kzm9g_defconfig b/arch/arm/configs/kzm9g_defconfig
new file mode 100644
index 000000000000..e3ebc20ed0a7
--- /dev/null
+++ b/arch/arm/configs/kzm9g_defconfig
@@ -0,0 +1,139 @@
1# CONFIG_ARM_PATCH_PHYS_VIRT is not set
2CONFIG_EXPERIMENTAL=y
3# CONFIG_LOCALVERSION_AUTO is not set
4CONFIG_SYSVIPC=y
5CONFIG_IKCONFIG=y
6CONFIG_IKCONFIG_PROC=y
7CONFIG_LOG_BUF_SHIFT=16
8CONFIG_NAMESPACES=y
9# CONFIG_UTS_NS is not set
10# CONFIG_IPC_NS is not set
11# CONFIG_USER_NS is not set
12# CONFIG_PID_NS is not set
13# CONFIG_NET_NS is not set
14CONFIG_CC_OPTIMIZE_FOR_SIZE=y
15CONFIG_SYSCTL_SYSCALL=y
16CONFIG_EMBEDDED=y
17CONFIG_SLAB=y
18CONFIG_MODULES=y
19CONFIG_MODULE_FORCE_LOAD=y
20CONFIG_MODULE_UNLOAD=y
21# CONFIG_BLK_DEV_BSG is not set
22# CONFIG_IOSCHED_DEADLINE is not set
23# CONFIG_IOSCHED_CFQ is not set
24CONFIG_ARCH_SHMOBILE=y
25CONFIG_KEYBOARD_GPIO_POLLED=y
26CONFIG_ARCH_SH73A0=y
27CONFIG_MACH_KZM9G=y
28CONFIG_MEMORY_START=0x41000000
29CONFIG_MEMORY_SIZE=0x1f000000
30CONFIG_ARM_ERRATA_743622=y
31CONFIG_ARM_ERRATA_754322=y
32CONFIG_NO_HZ=y
33CONFIG_HIGH_RES_TIMERS=y
34CONFIG_SMP=y
35CONFIG_SCHED_MC=y
36CONFIG_PREEMPT=y
37CONFIG_AEABI=y
38# CONFIG_OABI_COMPAT is not set
39CONFIG_HIGHMEM=y
40CONFIG_ZBOOT_ROM_TEXT=0x0
41CONFIG_ZBOOT_ROM_BSS=0x0
42CONFIG_CMDLINE="console=tty0 console=ttySC4,115200 root=/dev/nfs ip=dhcp ignore_loglevel earlyprintk=sh-sci.4,115200"
43CONFIG_KEXEC=y
44CONFIG_VFP=y
45CONFIG_NEON=y
46# CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
47CONFIG_PM_RUNTIME=y
48CONFIG_NET=y
49CONFIG_PACKET=y
50CONFIG_UNIX=y
51CONFIG_INET=y
52CONFIG_IP_PNP=y
53CONFIG_IP_PNP_DHCP=y
54# CONFIG_INET_XFRM_MODE_TRANSPORT is not set
55# CONFIG_INET_XFRM_MODE_TUNNEL is not set
56# CONFIG_INET_XFRM_MODE_BEET is not set
57# CONFIG_INET_LRO is not set
58# CONFIG_INET_DIAG is not set
59# CONFIG_IPV6 is not set
60CONFIG_IRDA=y
61CONFIG_SH_IRDA=y
62# CONFIG_WIRELESS is not set
63CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
64CONFIG_SCSI=y
65CONFIG_BLK_DEV_SD=y
66CONFIG_NETDEVICES=y
67CONFIG_SMSC911X=y
68# CONFIG_WLAN is not set
69CONFIG_INPUT_SPARSEKMAP=y
70# CONFIG_INPUT_MOUSEDEV is not set
71CONFIG_INPUT_EVDEV=y
72# CONFIG_KEYBOARD_ATKBD is not set
73# CONFIG_INPUT_MOUSE is not set
74CONFIG_INPUT_TOUCHSCREEN=y
75CONFIG_TOUCHSCREEN_ST1232=y
76# CONFIG_LEGACY_PTYS is not set
77CONFIG_SERIAL_SH_SCI=y
78CONFIG_SERIAL_SH_SCI_NR_UARTS=9
79CONFIG_SERIAL_SH_SCI_CONSOLE=y
80# CONFIG_HW_RANDOM is not set
81CONFIG_I2C_CHARDEV=y
82CONFIG_I2C_SH_MOBILE=y
83CONFIG_GPIO_PCF857X=y
84# CONFIG_HWMON is not set
85CONFIG_FB=y
86CONFIG_FB_SH_MOBILE_LCDC=y
87CONFIG_FRAMEBUFFER_CONSOLE=y
88CONFIG_LOGO=y
89CONFIG_FB_SH_MOBILE_MERAM=y
90CONFIG_SOUND=y
91CONFIG_SND=y
92# CONFIG_SND_SUPPORT_OLD_API is not set
93# CONFIG_SND_VERBOSE_PROCFS is not set
94# CONFIG_SND_DRIVERS is not set
95# CONFIG_SND_ARM is not set
96# CONFIG_SND_USB is not set
97CONFIG_SND_SOC=y
98CONFIG_SND_SOC_SH4_FSI=y
99# CONFIG_HID_SUPPORT is not set
100CONFIG_USB=y
101CONFIG_USB_DEVICEFS=y
102CONFIG_USB_R8A66597_HCD=y
103CONFIG_USB_STORAGE=y
104CONFIG_MMC=y
105# CONFIG_MMC_BLOCK_BOUNCE is not set
106CONFIG_MMC_SDHI=y
107CONFIG_MMC_SH_MMCIF=y
108CONFIG_NEW_LEDS=y
109CONFIG_LEDS_CLASS=y
110CONFIG_RTC_CLASS=y
111CONFIG_DMADEVICES=y
112CONFIG_SH_DMAE=y
113CONFIG_ASYNC_TX_DMA=y
114CONFIG_STAGING=y
115# CONFIG_DNOTIFY is not set
116# CONFIG_INOTIFY_USER is not set
117CONFIG_VFAT_FS=y
118CONFIG_TMPFS=y
119# CONFIG_MISC_FILESYSTEMS is not set
120CONFIG_NFS_FS=y
121CONFIG_NFS_V3=y
122CONFIG_NFS_V3_ACL=y
123CONFIG_NFS_V4=y
124CONFIG_NFS_V4_1=y
125CONFIG_ROOT_NFS=y
126CONFIG_NLS_CODEPAGE_437=y
127CONFIG_NLS_ISO8859_1=y
128# CONFIG_ENABLE_WARN_DEPRECATED is not set
129# CONFIG_ENABLE_MUST_CHECK is not set
130# CONFIG_SCHED_DEBUG is not set
131# CONFIG_DEBUG_PREEMPT is not set
132# CONFIG_DEBUG_BUGVERBOSE is not set
133# CONFIG_FTRACE is not set
134# CONFIG_ARM_UNWIND is not set
135CONFIG_CRYPTO=y
136CONFIG_CRYPTO_CBC=y
137CONFIG_CRYPTO_MD5=y
138CONFIG_CRYPTO_DES=y
139CONFIG_CRC16=y
diff --git a/arch/arm/configs/omap2plus_defconfig b/arch/arm/configs/omap2plus_defconfig
index d5f00d7eb075..9854ff4279e0 100644
--- a/arch/arm/configs/omap2plus_defconfig
+++ b/arch/arm/configs/omap2plus_defconfig
@@ -98,6 +98,7 @@ CONFIG_LIBERTAS_USB=m
98CONFIG_LIBERTAS_SDIO=m 98CONFIG_LIBERTAS_SDIO=m
99CONFIG_LIBERTAS_DEBUG=y 99CONFIG_LIBERTAS_DEBUG=y
100CONFIG_USB_USBNET=y 100CONFIG_USB_USBNET=y
101CONFIG_USB_NET_SMSC95XX=y
101CONFIG_USB_ALI_M5632=y 102CONFIG_USB_ALI_M5632=y
102CONFIG_USB_AN2720=y 103CONFIG_USB_AN2720=y
103CONFIG_USB_EPSON2888=y 104CONFIG_USB_EPSON2888=y
@@ -175,6 +176,7 @@ CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
175CONFIG_USB_DEVICEFS=y 176CONFIG_USB_DEVICEFS=y
176CONFIG_USB_SUSPEND=y 177CONFIG_USB_SUSPEND=y
177CONFIG_USB_MON=y 178CONFIG_USB_MON=y
179CONFIG_USB_EHCI_HCD=y
178CONFIG_USB_WDM=y 180CONFIG_USB_WDM=y
179CONFIG_USB_STORAGE=y 181CONFIG_USB_STORAGE=y
180CONFIG_USB_LIBUSUAL=y 182CONFIG_USB_LIBUSUAL=y
diff --git a/arch/arm/mach-exynos/Kconfig b/arch/arm/mach-exynos/Kconfig
index b8df521fb68e..2808e471cdcc 100644
--- a/arch/arm/mach-exynos/Kconfig
+++ b/arch/arm/mach-exynos/Kconfig
@@ -200,6 +200,7 @@ config MACH_SMDKV310
200 select S3C_DEV_HSMMC2 200 select S3C_DEV_HSMMC2
201 select S3C_DEV_HSMMC3 201 select S3C_DEV_HSMMC3
202 select SAMSUNG_DEV_BACKLIGHT 202 select SAMSUNG_DEV_BACKLIGHT
203 select EXYNOS_DEV_DRM
203 select EXYNOS4_DEV_AHCI 204 select EXYNOS4_DEV_AHCI
204 select SAMSUNG_DEV_KEYPAD 205 select SAMSUNG_DEV_KEYPAD
205 select EXYNOS4_DEV_DMA 206 select EXYNOS4_DEV_DMA
@@ -255,6 +256,7 @@ config MACH_UNIVERSAL_C210
255 select S5P_DEV_ONENAND 256 select S5P_DEV_ONENAND
256 select S5P_DEV_TV 257 select S5P_DEV_TV
257 select EXYNOS4_DEV_DMA 258 select EXYNOS4_DEV_DMA
259 select EXYNOS_DEV_DRM
258 select EXYNOS4_SETUP_FIMD0 260 select EXYNOS4_SETUP_FIMD0
259 select EXYNOS4_SETUP_I2C1 261 select EXYNOS4_SETUP_I2C1
260 select EXYNOS4_SETUP_I2C3 262 select EXYNOS4_SETUP_I2C3
@@ -291,6 +293,7 @@ config MACH_NURI
291 select S5P_DEV_USB_EHCI 293 select S5P_DEV_USB_EHCI
292 select S5P_SETUP_MIPIPHY 294 select S5P_SETUP_MIPIPHY
293 select EXYNOS4_DEV_DMA 295 select EXYNOS4_DEV_DMA
296 select EXYNOS_DEV_DRM
294 select EXYNOS4_SETUP_FIMC 297 select EXYNOS4_SETUP_FIMC
295 select EXYNOS4_SETUP_FIMD0 298 select EXYNOS4_SETUP_FIMD0
296 select EXYNOS4_SETUP_I2C1 299 select EXYNOS4_SETUP_I2C1
@@ -325,6 +328,7 @@ config MACH_ORIGEN
325 select S5P_DEV_USB_EHCI 328 select S5P_DEV_USB_EHCI
326 select SAMSUNG_DEV_BACKLIGHT 329 select SAMSUNG_DEV_BACKLIGHT
327 select SAMSUNG_DEV_PWM 330 select SAMSUNG_DEV_PWM
331 select EXYNOS_DEV_DRM
328 select EXYNOS4_DEV_DMA 332 select EXYNOS4_DEV_DMA
329 select EXYNOS4_DEV_USB_OHCI 333 select EXYNOS4_DEV_USB_OHCI
330 select EXYNOS4_SETUP_FIMD0 334 select EXYNOS4_SETUP_FIMD0
@@ -345,6 +349,11 @@ config MACH_SMDK4212
345 select S3C_DEV_I2C7 349 select S3C_DEV_I2C7
346 select S3C_DEV_RTC 350 select S3C_DEV_RTC
347 select S3C_DEV_WDT 351 select S3C_DEV_WDT
352 select S5P_DEV_FIMC0
353 select S5P_DEV_FIMC1
354 select S5P_DEV_FIMC2
355 select S5P_DEV_FIMC3
356 select S5P_DEV_MFC
348 select SAMSUNG_DEV_BACKLIGHT 357 select SAMSUNG_DEV_BACKLIGHT
349 select SAMSUNG_DEV_KEYPAD 358 select SAMSUNG_DEV_KEYPAD
350 select SAMSUNG_DEV_PWM 359 select SAMSUNG_DEV_PWM
diff --git a/arch/arm/mach-exynos/mach-nuri.c b/arch/arm/mach-exynos/mach-nuri.c
index 021dc68e89b5..5784b0abfe9d 100644
--- a/arch/arm/mach-exynos/mach-nuri.c
+++ b/arch/arm/mach-exynos/mach-nuri.c
@@ -25,6 +25,7 @@
25#include <linux/mmc/host.h> 25#include <linux/mmc/host.h>
26#include <linux/fb.h> 26#include <linux/fb.h>
27#include <linux/pwm_backlight.h> 27#include <linux/pwm_backlight.h>
28#include <drm/exynos_drm.h>
28 29
29#include <video/platform_lcd.h> 30#include <video/platform_lcd.h>
30#include <media/m5mols.h> 31#include <media/m5mols.h>
@@ -210,6 +211,29 @@ static struct platform_device nuri_gpio_keys = {
210 }, 211 },
211}; 212};
212 213
214#ifdef CONFIG_DRM_EXYNOS
215static struct exynos_drm_fimd_pdata drm_fimd_pdata = {
216 .panel = {
217 .timing = {
218 .xres = 1024,
219 .yres = 600,
220 .hsync_len = 40,
221 .left_margin = 79,
222 .right_margin = 200,
223 .vsync_len = 10,
224 .upper_margin = 10,
225 .lower_margin = 11,
226 .refresh = 60,
227 },
228 },
229 .vidcon0 = VIDCON0_VIDOUT_RGB | VIDCON0_PNRMODE_RGB |
230 VIDCON0_CLKSEL_LCD,
231 .vidcon1 = VIDCON1_INV_HSYNC | VIDCON1_INV_VSYNC,
232 .default_win = 3,
233 .bpp = 32,
234};
235
236#else
213/* Frame Buffer */ 237/* Frame Buffer */
214static struct s3c_fb_pd_win nuri_fb_win0 = { 238static struct s3c_fb_pd_win nuri_fb_win0 = {
215 .win_mode = { 239 .win_mode = {
@@ -236,6 +260,7 @@ static struct s3c_fb_platdata nuri_fb_pdata __initdata = {
236 .vidcon1 = VIDCON1_INV_HSYNC | VIDCON1_INV_VSYNC, 260 .vidcon1 = VIDCON1_INV_HSYNC | VIDCON1_INV_VSYNC,
237 .setup_gpio = exynos4_fimd0_gpio_setup_24bpp, 261 .setup_gpio = exynos4_fimd0_gpio_setup_24bpp,
238}; 262};
263#endif
239 264
240static void nuri_lcd_power_on(struct plat_lcd_data *pd, unsigned int power) 265static void nuri_lcd_power_on(struct plat_lcd_data *pd, unsigned int power)
241{ 266{
@@ -1299,6 +1324,9 @@ static struct platform_device *nuri_devices[] __initdata = {
1299 &cam_vdda_fixed_rdev, 1324 &cam_vdda_fixed_rdev,
1300 &cam_8m_12v_fixed_rdev, 1325 &cam_8m_12v_fixed_rdev,
1301 &exynos4_bus_devfreq, 1326 &exynos4_bus_devfreq,
1327#ifdef CONFIG_DRM_EXYNOS
1328 &exynos_device_drm,
1329#endif
1302}; 1330};
1303 1331
1304static void __init nuri_map_io(void) 1332static void __init nuri_map_io(void)
@@ -1331,7 +1359,12 @@ static void __init nuri_machine_init(void)
1331 i2c_register_board_info(9, i2c9_devs, ARRAY_SIZE(i2c9_devs)); 1359 i2c_register_board_info(9, i2c9_devs, ARRAY_SIZE(i2c9_devs));
1332 s3c_i2c6_set_platdata(&nuri_i2c6_platdata); 1360 s3c_i2c6_set_platdata(&nuri_i2c6_platdata);
1333 1361
1362#ifdef CONFIG_DRM_EXYNOS
1363 s5p_device_fimd0.dev.platform_data = &drm_fimd_pdata;
1364 exynos4_fimd0_gpio_setup_24bpp();
1365#else
1334 s5p_fimd0_set_platdata(&nuri_fb_pdata); 1366 s5p_fimd0_set_platdata(&nuri_fb_pdata);
1367#endif
1335 1368
1336 nuri_camera_init(); 1369 nuri_camera_init();
1337 1370
diff --git a/arch/arm/mach-exynos/mach-origen.c b/arch/arm/mach-exynos/mach-origen.c
index 827cb990c316..26124a38bcbd 100644
--- a/arch/arm/mach-exynos/mach-origen.c
+++ b/arch/arm/mach-exynos/mach-origen.c
@@ -45,6 +45,7 @@
45#include <mach/ohci.h> 45#include <mach/ohci.h>
46#include <mach/map.h> 46#include <mach/map.h>
47 47
48#include <drm/exynos_drm.h>
48#include "common.h" 49#include "common.h"
49 50
50/* Following are default values for UCON, ULCON and UFCON UART registers */ 51/* Following are default values for UCON, ULCON and UFCON UART registers */
@@ -581,6 +582,27 @@ static struct platform_device origen_lcd_hv070wsa = {
581 .dev.platform_data = &origen_lcd_hv070wsa_data, 582 .dev.platform_data = &origen_lcd_hv070wsa_data,
582}; 583};
583 584
585#ifdef CONFIG_DRM_EXYNOS
586static struct exynos_drm_fimd_pdata drm_fimd_pdata = {
587 .panel = {
588 .timing = {
589 .left_margin = 64,
590 .right_margin = 16,
591 .upper_margin = 64,
592 .lower_margin = 16,
593 .hsync_len = 48,
594 .vsync_len = 3,
595 .xres = 1024,
596 .yres = 600,
597 },
598 },
599 .vidcon0 = VIDCON0_VIDOUT_RGB | VIDCON0_PNRMODE_RGB,
600 .vidcon1 = VIDCON1_INV_HSYNC | VIDCON1_INV_VSYNC |
601 VIDCON1_INV_VCLK,
602 .default_win = 0,
603 .bpp = 32,
604};
605#else
584static struct s3c_fb_pd_win origen_fb_win0 = { 606static struct s3c_fb_pd_win origen_fb_win0 = {
585 .win_mode = { 607 .win_mode = {
586 .left_margin = 64, 608 .left_margin = 64,
@@ -594,6 +616,8 @@ static struct s3c_fb_pd_win origen_fb_win0 = {
594 }, 616 },
595 .max_bpp = 32, 617 .max_bpp = 32,
596 .default_bpp = 24, 618 .default_bpp = 24,
619 .virtual_x = 1024,
620 .virtual_y = 2 * 600,
597}; 621};
598 622
599static struct s3c_fb_platdata origen_lcd_pdata __initdata = { 623static struct s3c_fb_platdata origen_lcd_pdata __initdata = {
@@ -603,9 +627,10 @@ static struct s3c_fb_platdata origen_lcd_pdata __initdata = {
603 VIDCON1_INV_VCLK, 627 VIDCON1_INV_VCLK,
604 .setup_gpio = exynos4_fimd0_gpio_setup_24bpp, 628 .setup_gpio = exynos4_fimd0_gpio_setup_24bpp,
605}; 629};
630#endif
606 631
607/* Bluetooth rfkill gpio platform data */ 632/* Bluetooth rfkill gpio platform data */
608struct rfkill_gpio_platform_data origen_bt_pdata = { 633static struct rfkill_gpio_platform_data origen_bt_pdata = {
609 .reset_gpio = EXYNOS4_GPX2(2), 634 .reset_gpio = EXYNOS4_GPX2(2),
610 .shutdown_gpio = -1, 635 .shutdown_gpio = -1,
611 .type = RFKILL_TYPE_BLUETOOTH, 636 .type = RFKILL_TYPE_BLUETOOTH,
@@ -642,6 +667,9 @@ static struct platform_device *origen_devices[] __initdata = {
642 &s5p_device_mfc_l, 667 &s5p_device_mfc_l,
643 &s5p_device_mfc_r, 668 &s5p_device_mfc_r,
644 &s5p_device_mixer, 669 &s5p_device_mixer,
670#ifdef CONFIG_DRM_EXYNOS
671 &exynos_device_drm,
672#endif
645 &exynos4_device_ohci, 673 &exynos4_device_ohci,
646 &origen_device_gpiokeys, 674 &origen_device_gpiokeys,
647 &origen_lcd_hv070wsa, 675 &origen_lcd_hv070wsa,
@@ -717,7 +745,12 @@ static void __init origen_machine_init(void)
717 s5p_tv_setup(); 745 s5p_tv_setup();
718 s5p_i2c_hdmiphy_set_platdata(NULL); 746 s5p_i2c_hdmiphy_set_platdata(NULL);
719 747
748#ifdef CONFIG_DRM_EXYNOS
749 s5p_device_fimd0.dev.platform_data = &drm_fimd_pdata;
750 exynos4_fimd0_gpio_setup_24bpp();
751#else
720 s5p_fimd0_set_platdata(&origen_lcd_pdata); 752 s5p_fimd0_set_platdata(&origen_lcd_pdata);
753#endif
721 754
722 platform_add_devices(origen_devices, ARRAY_SIZE(origen_devices)); 755 platform_add_devices(origen_devices, ARRAY_SIZE(origen_devices));
723 756
diff --git a/arch/arm/mach-exynos/mach-smdk4x12.c b/arch/arm/mach-exynos/mach-smdk4x12.c
index 4be083acf994..fe772d893cc9 100644
--- a/arch/arm/mach-exynos/mach-smdk4x12.c
+++ b/arch/arm/mach-exynos/mach-smdk4x12.c
@@ -31,6 +31,7 @@
31#include <plat/gpio-cfg.h> 31#include <plat/gpio-cfg.h>
32#include <plat/iic.h> 32#include <plat/iic.h>
33#include <plat/keypad.h> 33#include <plat/keypad.h>
34#include <plat/mfc.h>
34#include <plat/regs-serial.h> 35#include <plat/regs-serial.h>
35#include <plat/sdhci.h> 36#include <plat/sdhci.h>
36 37
@@ -242,6 +243,14 @@ static struct platform_device *smdk4x12_devices[] __initdata = {
242 &s3c_device_i2c7, 243 &s3c_device_i2c7,
243 &s3c_device_rtc, 244 &s3c_device_rtc,
244 &s3c_device_wdt, 245 &s3c_device_wdt,
246 &s5p_device_fimc0,
247 &s5p_device_fimc1,
248 &s5p_device_fimc2,
249 &s5p_device_fimc3,
250 &s5p_device_fimc_md,
251 &s5p_device_mfc,
252 &s5p_device_mfc_l,
253 &s5p_device_mfc_r,
245 &samsung_device_keypad, 254 &samsung_device_keypad,
246}; 255};
247 256
@@ -254,6 +263,11 @@ static void __init smdk4x12_map_io(void)
254 s3c24xx_init_uarts(smdk4x12_uartcfgs, ARRAY_SIZE(smdk4x12_uartcfgs)); 263 s3c24xx_init_uarts(smdk4x12_uartcfgs, ARRAY_SIZE(smdk4x12_uartcfgs));
255} 264}
256 265
266static void __init smdk4x12_reserve(void)
267{
268 s5p_mfc_reserve_mem(0x43000000, 8 << 20, 0x51000000, 8 << 20);
269}
270
257static void __init smdk4x12_machine_init(void) 271static void __init smdk4x12_machine_init(void)
258{ 272{
259 s3c_i2c0_set_platdata(NULL); 273 s3c_i2c0_set_platdata(NULL);
@@ -291,6 +305,7 @@ MACHINE_START(SMDK4212, "SMDK4212")
291 .init_machine = smdk4x12_machine_init, 305 .init_machine = smdk4x12_machine_init,
292 .timer = &exynos4_timer, 306 .timer = &exynos4_timer,
293 .restart = exynos4_restart, 307 .restart = exynos4_restart,
308 .reserve = &smdk4x12_reserve,
294MACHINE_END 309MACHINE_END
295 310
296MACHINE_START(SMDK4412, "SMDK4412") 311MACHINE_START(SMDK4412, "SMDK4412")
@@ -303,4 +318,5 @@ MACHINE_START(SMDK4412, "SMDK4412")
303 .init_machine = smdk4x12_machine_init, 318 .init_machine = smdk4x12_machine_init,
304 .timer = &exynos4_timer, 319 .timer = &exynos4_timer,
305 .restart = exynos4_restart, 320 .restart = exynos4_restart,
321 .reserve = &smdk4x12_reserve,
306MACHINE_END 322MACHINE_END
diff --git a/arch/arm/mach-exynos/mach-smdkv310.c b/arch/arm/mach-exynos/mach-smdkv310.c
index ea39f614f2db..5af96064ca51 100644
--- a/arch/arm/mach-exynos/mach-smdkv310.c
+++ b/arch/arm/mach-exynos/mach-smdkv310.c
@@ -44,6 +44,7 @@
44#include <mach/map.h> 44#include <mach/map.h>
45#include <mach/ohci.h> 45#include <mach/ohci.h>
46 46
47#include <drm/exynos_drm.h>
47#include "common.h" 48#include "common.h"
48 49
49/* Following are default values for UCON, ULCON and UFCON UART registers */ 50/* Following are default values for UCON, ULCON and UFCON UART registers */
@@ -156,6 +157,26 @@ static struct platform_device smdkv310_lcd_lte480wv = {
156 .dev.platform_data = &smdkv310_lcd_lte480wv_data, 157 .dev.platform_data = &smdkv310_lcd_lte480wv_data,
157}; 158};
158 159
160#ifdef CONFIG_DRM_EXYNOS
161static struct exynos_drm_fimd_pdata drm_fimd_pdata = {
162 .panel = {
163 .timing = {
164 .left_margin = 13,
165 .right_margin = 8,
166 .upper_margin = 7,
167 .lower_margin = 5,
168 .hsync_len = 3,
169 .vsync_len = 1,
170 .xres = 800,
171 .yres = 480,
172 },
173 },
174 .vidcon0 = VIDCON0_VIDOUT_RGB | VIDCON0_PNRMODE_RGB,
175 .vidcon1 = VIDCON1_INV_HSYNC | VIDCON1_INV_VSYNC,
176 .default_win = 0,
177 .bpp = 32,
178};
179#else
159static struct s3c_fb_pd_win smdkv310_fb_win0 = { 180static struct s3c_fb_pd_win smdkv310_fb_win0 = {
160 .win_mode = { 181 .win_mode = {
161 .left_margin = 13, 182 .left_margin = 13,
@@ -177,6 +198,7 @@ static struct s3c_fb_platdata smdkv310_lcd0_pdata __initdata = {
177 .vidcon1 = VIDCON1_INV_HSYNC | VIDCON1_INV_VSYNC, 198 .vidcon1 = VIDCON1_INV_HSYNC | VIDCON1_INV_VSYNC,
178 .setup_gpio = exynos4_fimd0_gpio_setup_24bpp, 199 .setup_gpio = exynos4_fimd0_gpio_setup_24bpp,
179}; 200};
201#endif
180 202
181static struct resource smdkv310_smsc911x_resources[] = { 203static struct resource smdkv310_smsc911x_resources[] = {
182 [0] = DEFINE_RES_MEM(EXYNOS4_PA_SROM_BANK(1), SZ_64K), 204 [0] = DEFINE_RES_MEM(EXYNOS4_PA_SROM_BANK(1), SZ_64K),
@@ -262,6 +284,9 @@ static struct platform_device *smdkv310_devices[] __initdata = {
262 &s5p_device_fimc_md, 284 &s5p_device_fimc_md,
263 &s5p_device_g2d, 285 &s5p_device_g2d,
264 &s5p_device_jpeg, 286 &s5p_device_jpeg,
287#ifdef CONFIG_DRM_EXYNOS
288 &exynos_device_drm,
289#endif
265 &exynos4_device_ac97, 290 &exynos4_device_ac97,
266 &exynos4_device_i2s0, 291 &exynos4_device_i2s0,
267 &exynos4_device_ohci, 292 &exynos4_device_ohci,
@@ -353,7 +378,12 @@ static void __init smdkv310_machine_init(void)
353 samsung_keypad_set_platdata(&smdkv310_keypad_data); 378 samsung_keypad_set_platdata(&smdkv310_keypad_data);
354 379
355 samsung_bl_set(&smdkv310_bl_gpio_info, &smdkv310_bl_data); 380 samsung_bl_set(&smdkv310_bl_gpio_info, &smdkv310_bl_data);
381#ifdef CONFIG_DRM_EXYNOS
382 s5p_device_fimd0.dev.platform_data = &drm_fimd_pdata;
383 exynos4_fimd0_gpio_setup_24bpp();
384#else
356 s5p_fimd0_set_platdata(&smdkv310_lcd0_pdata); 385 s5p_fimd0_set_platdata(&smdkv310_lcd0_pdata);
386#endif
357 387
358 smdkv310_ehci_init(); 388 smdkv310_ehci_init();
359 smdkv310_ohci_init(); 389 smdkv310_ohci_init();
diff --git a/arch/arm/mach-exynos/mach-universal_c210.c b/arch/arm/mach-exynos/mach-universal_c210.c
index 57d524e03d63..27fab5389d7e 100644
--- a/arch/arm/mach-exynos/mach-universal_c210.c
+++ b/arch/arm/mach-exynos/mach-universal_c210.c
@@ -23,6 +23,7 @@
23#include <linux/i2c-gpio.h> 23#include <linux/i2c-gpio.h>
24#include <linux/i2c/mcs.h> 24#include <linux/i2c/mcs.h>
25#include <linux/i2c/atmel_mxt_ts.h> 25#include <linux/i2c/atmel_mxt_ts.h>
26#include <drm/exynos_drm.h>
26 27
27#include <asm/mach/arch.h> 28#include <asm/mach/arch.h>
28#include <asm/hardware/gic.h> 29#include <asm/hardware/gic.h>
@@ -811,6 +812,29 @@ static struct i2c_board_info i2c1_devs[] __initdata = {
811 /* Gyro, To be updated */ 812 /* Gyro, To be updated */
812}; 813};
813 814
815#ifdef CONFIG_DRM_EXYNOS
816static struct exynos_drm_fimd_pdata drm_fimd_pdata = {
817 .panel = {
818 .timing = {
819 .left_margin = 16,
820 .right_margin = 16,
821 .upper_margin = 2,
822 .lower_margin = 28,
823 .hsync_len = 2,
824 .vsync_len = 1,
825 .xres = 480,
826 .yres = 800,
827 .refresh = 55,
828 },
829 },
830 .vidcon0 = VIDCON0_VIDOUT_RGB | VIDCON0_PNRMODE_RGB |
831 VIDCON0_CLKSEL_LCD,
832 .vidcon1 = VIDCON1_INV_VCLK | VIDCON1_INV_VDEN
833 | VIDCON1_INV_HSYNC | VIDCON1_INV_VSYNC,
834 .default_win = 3,
835 .bpp = 32,
836};
837#else
814/* Frame Buffer */ 838/* Frame Buffer */
815static struct s3c_fb_pd_win universal_fb_win0 = { 839static struct s3c_fb_pd_win universal_fb_win0 = {
816 .win_mode = { 840 .win_mode = {
@@ -838,6 +862,7 @@ static struct s3c_fb_platdata universal_lcd_pdata __initdata = {
838 | VIDCON1_INV_HSYNC | VIDCON1_INV_VSYNC, 862 | VIDCON1_INV_HSYNC | VIDCON1_INV_VSYNC,
839 .setup_gpio = exynos4_fimd0_gpio_setup_24bpp, 863 .setup_gpio = exynos4_fimd0_gpio_setup_24bpp,
840}; 864};
865#endif
841 866
842static struct regulator_consumer_supply cam_vt_dio_supply = 867static struct regulator_consumer_supply cam_vt_dio_supply =
843 REGULATOR_SUPPLY("vdd_core", "0-003c"); 868 REGULATOR_SUPPLY("vdd_core", "0-003c");
@@ -1047,6 +1072,9 @@ static struct platform_device *universal_devices[] __initdata = {
1047 &s5p_device_onenand, 1072 &s5p_device_onenand,
1048 &s5p_device_fimd0, 1073 &s5p_device_fimd0,
1049 &s5p_device_jpeg, 1074 &s5p_device_jpeg,
1075#ifdef CONFIG_DRM_EXYNOS
1076 &exynos_device_drm,
1077#endif
1050 &s5p_device_mfc, 1078 &s5p_device_mfc,
1051 &s5p_device_mfc_l, 1079 &s5p_device_mfc_l,
1052 &s5p_device_mfc_r, 1080 &s5p_device_mfc_r,
@@ -1094,7 +1122,12 @@ static void __init universal_machine_init(void)
1094 s5p_i2c_hdmiphy_set_platdata(NULL); 1122 s5p_i2c_hdmiphy_set_platdata(NULL);
1095 i2c_register_board_info(5, i2c5_devs, ARRAY_SIZE(i2c5_devs)); 1123 i2c_register_board_info(5, i2c5_devs, ARRAY_SIZE(i2c5_devs));
1096 1124
1125#ifdef CONFIG_DRM_EXYNOS
1126 s5p_device_fimd0.dev.platform_data = &drm_fimd_pdata;
1127 exynos4_fimd0_gpio_setup_24bpp();
1128#else
1097 s5p_fimd0_set_platdata(&universal_lcd_pdata); 1129 s5p_fimd0_set_platdata(&universal_lcd_pdata);
1130#endif
1098 1131
1099 universal_touchkey_init(); 1132 universal_touchkey_init();
1100 i2c_register_board_info(I2C_GPIO_BUS_12, i2c_gpio12_devs, 1133 i2c_register_board_info(I2C_GPIO_BUS_12, i2c_gpio12_devs,
diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig
index c8f83e9e5633..7d6322ce5223 100644
--- a/arch/arm/mach-imx/Kconfig
+++ b/arch/arm/mach-imx/Kconfig
@@ -163,6 +163,7 @@ config MACH_EUKREA_CPUIMX25SD
163 select SOC_IMX25 163 select SOC_IMX25
164 select IMX_HAVE_PLATFORM_FLEXCAN 164 select IMX_HAVE_PLATFORM_FLEXCAN
165 select IMX_HAVE_PLATFORM_FSL_USB2_UDC 165 select IMX_HAVE_PLATFORM_FSL_USB2_UDC
166 select IMX_HAVE_PLATFORM_IMX2_WDT
166 select IMX_HAVE_PLATFORM_IMXDI_RTC 167 select IMX_HAVE_PLATFORM_IMXDI_RTC
167 select IMX_HAVE_PLATFORM_IMX_FB 168 select IMX_HAVE_PLATFORM_IMX_FB
168 select IMX_HAVE_PLATFORM_IMX_I2C 169 select IMX_HAVE_PLATFORM_IMX_I2C
@@ -181,6 +182,7 @@ config MACH_EUKREA_MBIMXSD25_BASEBOARD
181 bool "Eukrea MBIMXSD development board" 182 bool "Eukrea MBIMXSD development board"
182 select IMX_HAVE_PLATFORM_GPIO_KEYS 183 select IMX_HAVE_PLATFORM_GPIO_KEYS
183 select IMX_HAVE_PLATFORM_IMX_SSI 184 select IMX_HAVE_PLATFORM_IMX_SSI
185 select IMX_HAVE_PLATFORM_SPI_IMX
184 select LEDS_GPIO_REGISTER 186 select LEDS_GPIO_REGISTER
185 help 187 help
186 This adds board specific devices that can be found on Eukrea's 188 This adds board specific devices that can be found on Eukrea's
@@ -608,6 +610,7 @@ config MACH_EUKREA_MBIMXSD35_BASEBOARD
608 select IMX_HAVE_PLATFORM_GPIO_KEYS 610 select IMX_HAVE_PLATFORM_GPIO_KEYS
609 select IMX_HAVE_PLATFORM_IMX_SSI 611 select IMX_HAVE_PLATFORM_IMX_SSI
610 select IMX_HAVE_PLATFORM_IPU_CORE 612 select IMX_HAVE_PLATFORM_IPU_CORE
613 select IMX_HAVE_PLATFORM_SPI_IMX
611 select LEDS_GPIO_REGISTER 614 select LEDS_GPIO_REGISTER
612 help 615 help
613 This adds board specific devices that can be found on Eukrea's 616 This adds board specific devices that can be found on Eukrea's
@@ -684,42 +687,13 @@ config MACH_MX51_3DS
684 Include support for MX51PDK (3DS) platform. This includes specific 687 Include support for MX51PDK (3DS) platform. This includes specific
685 configurations for the board and its peripherals. 688 configurations for the board and its peripherals.
686 689
687config MACH_EUKREA_CPUIMX51
688 bool "Support Eukrea CPUIMX51 module"
689 select SOC_IMX51
690 select IMX_HAVE_PLATFORM_FSL_USB2_UDC
691 select IMX_HAVE_PLATFORM_IMX_I2C
692 select IMX_HAVE_PLATFORM_IMX_UART
693 select IMX_HAVE_PLATFORM_MXC_EHCI
694 select IMX_HAVE_PLATFORM_MXC_NAND
695 select IMX_HAVE_PLATFORM_SPI_IMX
696 help
697 Include support for Eukrea CPUIMX51 platform. This includes
698 specific configurations for the module and its peripherals.
699
700choice
701 prompt "Baseboard"
702 depends on MACH_EUKREA_CPUIMX51
703 default MACH_EUKREA_MBIMX51_BASEBOARD
704
705config MACH_EUKREA_MBIMX51_BASEBOARD
706 prompt "Eukrea MBIMX51 development board"
707 bool
708 select IMX_HAVE_PLATFORM_IMX_KEYPAD
709 select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX
710 select LEDS_GPIO_REGISTER
711 help
712 This adds board specific devices that can be found on Eukrea's
713 MBIMX51 evaluation board.
714
715endchoice
716
717config MACH_EUKREA_CPUIMX51SD 690config MACH_EUKREA_CPUIMX51SD
718 bool "Support Eukrea CPUIMX51SD module" 691 bool "Support Eukrea CPUIMX51SD module"
719 select SOC_IMX51 692 select SOC_IMX51
720 select IMX_HAVE_PLATFORM_FSL_USB2_UDC 693 select IMX_HAVE_PLATFORM_FSL_USB2_UDC
721 select IMX_HAVE_PLATFORM_IMX_I2C 694 select IMX_HAVE_PLATFORM_IMX_I2C
722 select IMX_HAVE_PLATFORM_IMX_UART 695 select IMX_HAVE_PLATFORM_IMX_UART
696 select IMX_HAVE_PLATFORM_IMX2_WDT
723 select IMX_HAVE_PLATFORM_MXC_EHCI 697 select IMX_HAVE_PLATFORM_MXC_EHCI
724 select IMX_HAVE_PLATFORM_MXC_NAND 698 select IMX_HAVE_PLATFORM_MXC_NAND
725 select IMX_HAVE_PLATFORM_SPI_IMX 699 select IMX_HAVE_PLATFORM_SPI_IMX
@@ -735,6 +709,7 @@ choice
735config MACH_EUKREA_MBIMXSD51_BASEBOARD 709config MACH_EUKREA_MBIMXSD51_BASEBOARD
736 prompt "Eukrea MBIMXSD development board" 710 prompt "Eukrea MBIMXSD development board"
737 bool 711 bool
712 select IMX_HAVE_PLATFORM_IMX_SSI
738 select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX 713 select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX
739 select LEDS_GPIO_REGISTER 714 select LEDS_GPIO_REGISTER
740 help 715 help
diff --git a/arch/arm/mach-imx/Makefile b/arch/arm/mach-imx/Makefile
index ab939c5046c3..4937c070a57e 100644
--- a/arch/arm/mach-imx/Makefile
+++ b/arch/arm/mach-imx/Makefile
@@ -83,10 +83,8 @@ obj-$(CONFIG_MACH_MX53_EVK) += mach-mx53_evk.o
83obj-$(CONFIG_MACH_MX53_SMD) += mach-mx53_smd.o 83obj-$(CONFIG_MACH_MX53_SMD) += mach-mx53_smd.o
84obj-$(CONFIG_MACH_MX53_LOCO) += mach-mx53_loco.o 84obj-$(CONFIG_MACH_MX53_LOCO) += mach-mx53_loco.o
85obj-$(CONFIG_MACH_MX53_ARD) += mach-mx53_ard.o 85obj-$(CONFIG_MACH_MX53_ARD) += mach-mx53_ard.o
86obj-$(CONFIG_MACH_EUKREA_CPUIMX51) += mach-cpuimx51.o
87obj-$(CONFIG_MACH_EUKREA_MBIMX51_BASEBOARD) += eukrea_mbimx51-baseboard.o
88obj-$(CONFIG_MACH_EUKREA_CPUIMX51SD) += mach-cpuimx51sd.o 86obj-$(CONFIG_MACH_EUKREA_CPUIMX51SD) += mach-cpuimx51sd.o
89obj-$(CONFIG_MACH_EUKREA_MBIMXSD51_BASEBOARD) += eukrea_mbimxsd-baseboard.o 87obj-$(CONFIG_MACH_EUKREA_MBIMXSD51_BASEBOARD) += eukrea_mbimxsd51-baseboard.o
90obj-$(CONFIG_MX51_EFIKA_COMMON) += mx51_efika.o 88obj-$(CONFIG_MX51_EFIKA_COMMON) += mx51_efika.o
91obj-$(CONFIG_MACH_MX51_EFIKAMX) += mach-mx51_efikamx.o 89obj-$(CONFIG_MACH_MX51_EFIKAMX) += mach-mx51_efikamx.o
92obj-$(CONFIG_MACH_MX51_EFIKASB) += mach-mx51_efikasb.o 90obj-$(CONFIG_MACH_MX51_EFIKASB) += mach-mx51_efikasb.o
diff --git a/arch/arm/mach-imx/eukrea_mbimx51-baseboard.c b/arch/arm/mach-imx/eukrea_mbimx51-baseboard.c
deleted file mode 100644
index a6a3ab8f1b1c..000000000000
--- a/arch/arm/mach-imx/eukrea_mbimx51-baseboard.c
+++ /dev/null
@@ -1,206 +0,0 @@
1/*
2 *
3 * Copyright (C) 2010 Eric Bénard <eric@eukrea.com>
4 *
5 * The code contained herein is licensed under the GNU General Public
6 * License. You may obtain a copy of the GNU General Public License
7 * Version 2 or later at the following locations:
8 *
9 * http://www.opensource.org/licenses/gpl-license.html
10 * http://www.gnu.org/copyleft/gpl.html
11 */
12
13#include <linux/init.h>
14#include <linux/platform_device.h>
15#include <linux/serial_8250.h>
16#include <linux/i2c.h>
17#include <linux/gpio.h>
18#include <linux/io.h>
19#include <linux/interrupt.h>
20#include <linux/irq.h>
21#include <linux/i2c/tsc2007.h>
22#include <linux/leds.h>
23
24#include <mach/common.h>
25#include <mach/hardware.h>
26#include <mach/iomux-mx51.h>
27
28#include <asm/mach/arch.h>
29
30#include "devices-imx51.h"
31
32#define MBIMX51_TSC2007_GPIO IMX_GPIO_NR(3, 30)
33#define MBIMX51_LED0 IMX_GPIO_NR(3, 5)
34#define MBIMX51_LED1 IMX_GPIO_NR(3, 6)
35#define MBIMX51_LED2 IMX_GPIO_NR(3, 7)
36#define MBIMX51_LED3 IMX_GPIO_NR(3, 8)
37
38static const struct gpio_led mbimx51_leds[] __initconst = {
39 {
40 .name = "led0",
41 .default_trigger = "heartbeat",
42 .active_low = 1,
43 .gpio = MBIMX51_LED0,
44 },
45 {
46 .name = "led1",
47 .default_trigger = "nand-disk",
48 .active_low = 1,
49 .gpio = MBIMX51_LED1,
50 },
51 {
52 .name = "led2",
53 .default_trigger = "mmc0",
54 .active_low = 1,
55 .gpio = MBIMX51_LED2,
56 },
57 {
58 .name = "led3",
59 .default_trigger = "default-on",
60 .active_low = 1,
61 .gpio = MBIMX51_LED3,
62 },
63};
64
65static const struct gpio_led_platform_data mbimx51_leds_info __initconst = {
66 .leds = mbimx51_leds,
67 .num_leds = ARRAY_SIZE(mbimx51_leds),
68};
69
70static iomux_v3_cfg_t mbimx51_pads[] = {
71 /* UART2 */
72 MX51_PAD_UART2_RXD__UART2_RXD,
73 MX51_PAD_UART2_TXD__UART2_TXD,
74
75 /* UART3 */
76 MX51_PAD_UART3_RXD__UART3_RXD,
77 MX51_PAD_UART3_TXD__UART3_TXD,
78 MX51_PAD_KEY_COL4__UART3_RTS,
79 MX51_PAD_KEY_COL5__UART3_CTS,
80
81 /* TSC2007 IRQ */
82 MX51_PAD_NANDF_D10__GPIO3_30,
83
84 /* LEDS */
85 MX51_PAD_DISPB2_SER_DIN__GPIO3_5,
86 MX51_PAD_DISPB2_SER_DIO__GPIO3_6,
87 MX51_PAD_DISPB2_SER_CLK__GPIO3_7,
88 MX51_PAD_DISPB2_SER_RS__GPIO3_8,
89
90 /* KPP */
91 MX51_PAD_KEY_ROW0__KEY_ROW0,
92 MX51_PAD_KEY_ROW1__KEY_ROW1,
93 MX51_PAD_KEY_ROW2__KEY_ROW2,
94 MX51_PAD_KEY_ROW3__KEY_ROW3,
95 MX51_PAD_KEY_COL0__KEY_COL0,
96 MX51_PAD_KEY_COL1__KEY_COL1,
97 MX51_PAD_KEY_COL2__KEY_COL2,
98 MX51_PAD_KEY_COL3__KEY_COL3,
99
100 /* SD 1 */
101 MX51_PAD_SD1_CMD__SD1_CMD,
102 MX51_PAD_SD1_CLK__SD1_CLK,
103 MX51_PAD_SD1_DATA0__SD1_DATA0,
104 MX51_PAD_SD1_DATA1__SD1_DATA1,
105 MX51_PAD_SD1_DATA2__SD1_DATA2,
106 MX51_PAD_SD1_DATA3__SD1_DATA3,
107
108 /* SD 2 */
109 MX51_PAD_SD2_CMD__SD2_CMD,
110 MX51_PAD_SD2_CLK__SD2_CLK,
111 MX51_PAD_SD2_DATA0__SD2_DATA0,
112 MX51_PAD_SD2_DATA1__SD2_DATA1,
113 MX51_PAD_SD2_DATA2__SD2_DATA2,
114 MX51_PAD_SD2_DATA3__SD2_DATA3,
115};
116
117static const struct imxuart_platform_data uart_pdata __initconst = {
118 .flags = IMXUART_HAVE_RTSCTS,
119};
120
121static int mbimx51_keymap[] = {
122 KEY(0, 0, KEY_1),
123 KEY(0, 1, KEY_2),
124 KEY(0, 2, KEY_3),
125 KEY(0, 3, KEY_UP),
126
127 KEY(1, 0, KEY_4),
128 KEY(1, 1, KEY_5),
129 KEY(1, 2, KEY_6),
130 KEY(1, 3, KEY_LEFT),
131
132 KEY(2, 0, KEY_7),
133 KEY(2, 1, KEY_8),
134 KEY(2, 2, KEY_9),
135 KEY(2, 3, KEY_RIGHT),
136
137 KEY(3, 0, KEY_0),
138 KEY(3, 1, KEY_DOWN),
139 KEY(3, 2, KEY_ESC),
140 KEY(3, 3, KEY_ENTER),
141};
142
143static const struct matrix_keymap_data mbimx51_map_data __initconst = {
144 .keymap = mbimx51_keymap,
145 .keymap_size = ARRAY_SIZE(mbimx51_keymap),
146};
147
148static int tsc2007_get_pendown_state(void)
149{
150 return !gpio_get_value(MBIMX51_TSC2007_GPIO);
151}
152
153struct tsc2007_platform_data tsc2007_data = {
154 .model = 2007,
155 .x_plate_ohms = 180,
156 .get_pendown_state = tsc2007_get_pendown_state,
157};
158
159static struct i2c_board_info mbimx51_i2c_devices[] = {
160 {
161 I2C_BOARD_INFO("tsc2007", 0x49),
162 .irq = IMX_GPIO_TO_IRQ(MBIMX51_TSC2007_GPIO),
163 .platform_data = &tsc2007_data,
164 }, {
165 I2C_BOARD_INFO("tlv320aic23", 0x1a),
166 },
167};
168
169/*
170 * baseboard initialization.
171 */
172void __init eukrea_mbimx51_baseboard_init(void)
173{
174 mxc_iomux_v3_setup_multiple_pads(mbimx51_pads,
175 ARRAY_SIZE(mbimx51_pads));
176
177 imx51_add_imx_uart(1, NULL);
178 imx51_add_imx_uart(2, &uart_pdata);
179
180 gpio_request(MBIMX51_LED0, "LED0");
181 gpio_direction_output(MBIMX51_LED0, 1);
182 gpio_free(MBIMX51_LED0);
183 gpio_request(MBIMX51_LED1, "LED1");
184 gpio_direction_output(MBIMX51_LED1, 1);
185 gpio_free(MBIMX51_LED1);
186 gpio_request(MBIMX51_LED2, "LED2");
187 gpio_direction_output(MBIMX51_LED2, 1);
188 gpio_free(MBIMX51_LED2);
189 gpio_request(MBIMX51_LED3, "LED3");
190 gpio_direction_output(MBIMX51_LED3, 1);
191 gpio_free(MBIMX51_LED3);
192
193 gpio_led_register_device(-1, &mbimx51_leds_info);
194
195 imx51_add_imx_keypad(&mbimx51_map_data);
196
197 gpio_request(MBIMX51_TSC2007_GPIO, "tsc2007_irq");
198 gpio_direction_input(MBIMX51_TSC2007_GPIO);
199 irq_set_irq_type(gpio_to_irq(MBIMX51_TSC2007_GPIO),
200 IRQF_TRIGGER_FALLING);
201 i2c_register_board_info(1, mbimx51_i2c_devices,
202 ARRAY_SIZE(mbimx51_i2c_devices));
203
204 imx51_add_sdhci_esdhc_imx(0, NULL);
205 imx51_add_sdhci_esdhc_imx(1, NULL);
206}
diff --git a/arch/arm/mach-imx/eukrea_mbimxsd25-baseboard.c b/arch/arm/mach-imx/eukrea_mbimxsd25-baseboard.c
index 2cf603e11c4f..dfd2da87c2df 100644
--- a/arch/arm/mach-imx/eukrea_mbimxsd25-baseboard.c
+++ b/arch/arm/mach-imx/eukrea_mbimxsd25-baseboard.c
@@ -23,6 +23,7 @@
23#include <linux/leds.h> 23#include <linux/leds.h>
24#include <linux/platform_device.h> 24#include <linux/platform_device.h>
25#include <linux/input.h> 25#include <linux/input.h>
26#include <linux/spi/spi.h>
26#include <video/platform_lcd.h> 27#include <video/platform_lcd.h>
27 28
28#include <mach/hardware.h> 29#include <mach/hardware.h>
@@ -87,12 +88,22 @@ static iomux_v3_cfg_t eukrea_mbimxsd_pads[] = {
87 /* CAN */ 88 /* CAN */
88 MX25_PAD_GPIO_D__CAN2_RX, 89 MX25_PAD_GPIO_D__CAN2_RX,
89 MX25_PAD_GPIO_C__CAN2_TX, 90 MX25_PAD_GPIO_C__CAN2_TX,
91 /* SPI1 */
92 MX25_PAD_CSPI1_MOSI__CSPI1_MOSI,
93 MX25_PAD_CSPI1_MISO__CSPI1_MISO,
94 MX25_PAD_CSPI1_SS0__GPIO_1_16,
95 MX25_PAD_CSPI1_SS1__GPIO_1_17,
96 MX25_PAD_CSPI1_SCLK__CSPI1_SCLK,
97 MX25_PAD_CSPI1_RDY__GPIO_2_22,
90}; 98};
91 99
92#define GPIO_LED1 83 100#define GPIO_LED1 IMX_GPIO_NR(3, 19)
93#define GPIO_SWITCH1 82 101#define GPIO_SWITCH1 IMX_GPIO_NR(3, 18)
94#define GPIO_SD1CD 52 102#define GPIO_SD1CD IMX_GPIO_NR(2, 20)
95#define GPIO_LCDPWR 26 103#define GPIO_LCDPWR IMX_GPIO_NR(1, 26)
104#define GPIO_SPI1_SS0 IMX_GPIO_NR(1, 16)
105#define GPIO_SPI1_SS1 IMX_GPIO_NR(1, 17)
106#define GPIO_SPI1_IRQ IMX_GPIO_NR(2, 22)
96 107
97static struct imx_fb_videomode eukrea_mximxsd_modes[] = { 108static struct imx_fb_videomode eukrea_mximxsd_modes[] = {
98 { 109 {
@@ -228,6 +239,30 @@ static struct esdhc_platform_data sd1_pdata = {
228 .wp_type = ESDHC_WP_NONE, 239 .wp_type = ESDHC_WP_NONE,
229}; 240};
230 241
242static struct spi_board_info eukrea_mbimxsd25_spi_board_info[] __initdata = {
243 {
244 .modalias = "spidev",
245 .max_speed_hz = 20000000,
246 .bus_num = 0,
247 .chip_select = 0,
248 .mode = SPI_MODE_0,
249 },
250 {
251 .modalias = "spidev",
252 .max_speed_hz = 20000000,
253 .bus_num = 0,
254 .chip_select = 1,
255 .mode = SPI_MODE_0,
256 },
257};
258
259static int eukrea_mbimxsd25_spi_cs[] = {GPIO_SPI1_SS0, GPIO_SPI1_SS1};
260
261static const struct spi_imx_master eukrea_mbimxsd25_spi0_data __initconst = {
262 .chipselect = eukrea_mbimxsd25_spi_cs,
263 .num_chipselect = ARRAY_SIZE(eukrea_mbimxsd25_spi_cs),
264};
265
231/* 266/*
232 * system init for baseboard usage. Will be called by cpuimx25 init. 267 * system init for baseboard usage. Will be called by cpuimx25 init.
233 * 268 *
@@ -257,11 +292,17 @@ void __init eukrea_mbimxsd25_baseboard_init(void)
257 292
258 gpio_request(GPIO_LCDPWR, "LCDPWR"); 293 gpio_request(GPIO_LCDPWR, "LCDPWR");
259 gpio_direction_output(GPIO_LCDPWR, 1); 294 gpio_direction_output(GPIO_LCDPWR, 1);
260 gpio_free(GPIO_SWITCH1);
261 295
262 i2c_register_board_info(0, eukrea_mbimxsd_i2c_devices, 296 i2c_register_board_info(0, eukrea_mbimxsd_i2c_devices,
263 ARRAY_SIZE(eukrea_mbimxsd_i2c_devices)); 297 ARRAY_SIZE(eukrea_mbimxsd_i2c_devices));
264 298
299 gpio_request(GPIO_SPI1_IRQ, "SPI1_IRQ");
300 gpio_direction_input(GPIO_SPI1_IRQ);
301 gpio_free(GPIO_SPI1_IRQ);
302 imx25_add_spi_imx0(&eukrea_mbimxsd25_spi0_data);
303 spi_register_board_info(eukrea_mbimxsd25_spi_board_info,
304 ARRAY_SIZE(eukrea_mbimxsd25_spi_board_info));
305
265 platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices)); 306 platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices));
266 gpio_led_register_device(-1, &eukrea_mbimxsd_led_info); 307 gpio_led_register_device(-1, &eukrea_mbimxsd_led_info);
267 imx_add_gpio_keys(&eukrea_mbimxsd_button_data); 308 imx_add_gpio_keys(&eukrea_mbimxsd_button_data);
diff --git a/arch/arm/mach-imx/eukrea_mbimxsd35-baseboard.c b/arch/arm/mach-imx/eukrea_mbimxsd35-baseboard.c
index fd8bf8a425a7..557f6c486053 100644
--- a/arch/arm/mach-imx/eukrea_mbimxsd35-baseboard.c
+++ b/arch/arm/mach-imx/eukrea_mbimxsd35-baseboard.c
@@ -27,6 +27,7 @@
27#include <linux/leds.h> 27#include <linux/leds.h>
28#include <linux/platform_device.h> 28#include <linux/platform_device.h>
29#include <linux/input.h> 29#include <linux/input.h>
30#include <linux/spi/spi.h>
30#include <video/platform_lcd.h> 31#include <video/platform_lcd.h>
31#include <linux/i2c.h> 32#include <linux/i2c.h>
32 33
@@ -158,12 +159,22 @@ static iomux_v3_cfg_t eukrea_mbimxsd_pads[] = {
158 MX35_PAD_SD1_DATA3__ESDHC1_DAT3, 159 MX35_PAD_SD1_DATA3__ESDHC1_DAT3,
159 /* SD1 CD */ 160 /* SD1 CD */
160 MX35_PAD_LD18__GPIO3_24, 161 MX35_PAD_LD18__GPIO3_24,
162 /* SPI */
163 MX35_PAD_CSPI1_MOSI__CSPI1_MOSI,
164 MX35_PAD_CSPI1_MISO__CSPI1_MISO,
165 MX35_PAD_CSPI1_SS0__GPIO1_18,
166 MX35_PAD_CSPI1_SS1__GPIO1_19,
167 MX35_PAD_CSPI1_SCLK__CSPI1_SCLK,
168 MX35_PAD_CSPI1_SPI_RDY__GPIO3_5,
161}; 169};
162 170
163#define GPIO_LED1 IMX_GPIO_NR(3, 29) 171#define GPIO_LED1 IMX_GPIO_NR(3, 29)
164#define GPIO_SWITCH1 IMX_GPIO_NR(3, 25) 172#define GPIO_SWITCH1 IMX_GPIO_NR(3, 25)
165#define GPIO_LCDPWR IMX_GPIO_NR(1, 4) 173#define GPIO_LCDPWR IMX_GPIO_NR(1, 4)
166#define GPIO_SD1CD IMX_GPIO_NR(3, 24) 174#define GPIO_SD1CD IMX_GPIO_NR(3, 24)
175#define GPIO_SPI1_SS0 IMX_GPIO_NR(1, 18)
176#define GPIO_SPI1_SS1 IMX_GPIO_NR(1, 19)
177#define GPIO_SPI1_IRQ IMX_GPIO_NR(3, 5)
167 178
168static void eukrea_mbimxsd_lcd_power_set(struct plat_lcd_data *pd, 179static void eukrea_mbimxsd_lcd_power_set(struct plat_lcd_data *pd,
169 unsigned int power) 180 unsigned int power)
@@ -239,6 +250,30 @@ static struct esdhc_platform_data sd1_pdata = {
239 .wp_type = ESDHC_WP_NONE, 250 .wp_type = ESDHC_WP_NONE,
240}; 251};
241 252
253static struct spi_board_info eukrea_mbimxsd35_spi_board_info[] __initdata = {
254 {
255 .modalias = "spidev",
256 .max_speed_hz = 20000000,
257 .bus_num = 0,
258 .chip_select = 0,
259 .mode = SPI_MODE_0,
260 },
261 {
262 .modalias = "spidev",
263 .max_speed_hz = 20000000,
264 .bus_num = 0,
265 .chip_select = 1,
266 .mode = SPI_MODE_0,
267 },
268};
269
270static int eukrea_mbimxsd35_spi_cs[] = {GPIO_SPI1_SS0, GPIO_SPI1_SS1};
271
272static const struct spi_imx_master eukrea_mbimxsd35_spi0_data __initconst = {
273 .chipselect = eukrea_mbimxsd35_spi_cs,
274 .num_chipselect = ARRAY_SIZE(eukrea_mbimxsd35_spi_cs),
275};
276
242/* 277/*
243 * system init for baseboard usage. Will be called by cpuimx35 init. 278 * system init for baseboard usage. Will be called by cpuimx35 init.
244 * 279 *
@@ -274,6 +309,13 @@ void __init eukrea_mbimxsd35_baseboard_init(void)
274 i2c_register_board_info(0, eukrea_mbimxsd_i2c_devices, 309 i2c_register_board_info(0, eukrea_mbimxsd_i2c_devices,
275 ARRAY_SIZE(eukrea_mbimxsd_i2c_devices)); 310 ARRAY_SIZE(eukrea_mbimxsd_i2c_devices));
276 311
312 gpio_request(GPIO_SPI1_IRQ, "SPI1_IRQ");
313 gpio_direction_input(GPIO_SPI1_IRQ);
314 gpio_free(GPIO_SPI1_IRQ);
315 imx35_add_spi_imx0(&eukrea_mbimxsd35_spi0_data);
316 spi_register_board_info(eukrea_mbimxsd35_spi_board_info,
317 ARRAY_SIZE(eukrea_mbimxsd35_spi_board_info));
318
277 platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices)); 319 platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices));
278 gpio_led_register_device(-1, &eukrea_mbimxsd_led_info); 320 gpio_led_register_device(-1, &eukrea_mbimxsd_led_info);
279 imx_add_gpio_keys(&eukrea_mbimxsd_button_data); 321 imx_add_gpio_keys(&eukrea_mbimxsd_button_data);
diff --git a/arch/arm/mach-imx/eukrea_mbimxsd-baseboard.c b/arch/arm/mach-imx/eukrea_mbimxsd51-baseboard.c
index aaa592fdb9ce..96a24b73dc23 100644
--- a/arch/arm/mach-imx/eukrea_mbimxsd-baseboard.c
+++ b/arch/arm/mach-imx/eukrea_mbimxsd51-baseboard.c
@@ -28,6 +28,8 @@
28#include <linux/platform_device.h> 28#include <linux/platform_device.h>
29#include <linux/input.h> 29#include <linux/input.h>
30#include <linux/i2c.h> 30#include <linux/i2c.h>
31#include <video/platform_lcd.h>
32#include <linux/backlight.h>
31 33
32#include <asm/mach-types.h> 34#include <asm/mach-types.h>
33#include <asm/mach/arch.h> 35#include <asm/mach/arch.h>
@@ -40,7 +42,7 @@
40 42
41#include "devices-imx51.h" 43#include "devices-imx51.h"
42 44
43static iomux_v3_cfg_t eukrea_mbimxsd_pads[] = { 45static iomux_v3_cfg_t eukrea_mbimxsd51_pads[] = {
44 /* LED */ 46 /* LED */
45 MX51_PAD_NANDF_D10__GPIO3_30, 47 MX51_PAD_NANDF_D10__GPIO3_30,
46 /* SWITCH */ 48 /* SWITCH */
@@ -66,12 +68,64 @@ static iomux_v3_cfg_t eukrea_mbimxsd_pads[] = {
66 NEW_PAD_CTRL(MX51_PAD_GPIO1_0__SD1_CD, PAD_CTL_PUS_22K_UP | 68 NEW_PAD_CTRL(MX51_PAD_GPIO1_0__SD1_CD, PAD_CTL_PUS_22K_UP |
67 PAD_CTL_PKE | PAD_CTL_SRE_FAST | 69 PAD_CTL_PKE | PAD_CTL_SRE_FAST |
68 PAD_CTL_DSE_HIGH | PAD_CTL_PUE | PAD_CTL_HYS), 70 PAD_CTL_DSE_HIGH | PAD_CTL_PUE | PAD_CTL_HYS),
71 /* SSI */
72 MX51_PAD_AUD3_BB_TXD__AUD3_TXD,
73 MX51_PAD_AUD3_BB_RXD__AUD3_RXD,
74 MX51_PAD_AUD3_BB_CK__AUD3_TXC,
75 MX51_PAD_AUD3_BB_FS__AUD3_TXFS,
76 /* LCD Backlight */
77 MX51_PAD_DI1_D1_CS__GPIO3_4,
78 /* LCD RST */
79 MX51_PAD_CSI1_D9__GPIO3_13,
69}; 80};
70 81
71#define GPIO_LED1 IMX_GPIO_NR(3, 30) 82#define GPIO_LED1 IMX_GPIO_NR(3, 30)
72#define GPIO_SWITCH1 IMX_GPIO_NR(3, 31) 83#define GPIO_SWITCH1 IMX_GPIO_NR(3, 31)
84#define GPIO_LCDRST IMX_GPIO_NR(3, 13)
85#define GPIO_LCDBL IMX_GPIO_NR(3, 4)
73 86
74static const struct gpio_led eukrea_mbimxsd_leds[] __initconst = { 87static void eukrea_mbimxsd51_lcd_power_set(struct plat_lcd_data *pd,
88 unsigned int power)
89{
90 if (power)
91 gpio_direction_output(GPIO_LCDRST, 1);
92 else
93 gpio_direction_output(GPIO_LCDRST, 0);
94}
95
96static struct plat_lcd_data eukrea_mbimxsd51_lcd_power_data = {
97 .set_power = eukrea_mbimxsd51_lcd_power_set,
98};
99
100static struct platform_device eukrea_mbimxsd51_lcd_powerdev = {
101 .name = "platform-lcd",
102 .dev.platform_data = &eukrea_mbimxsd51_lcd_power_data,
103};
104
105static void eukrea_mbimxsd51_bl_set_intensity(int intensity)
106{
107 if (intensity)
108 gpio_direction_output(GPIO_LCDBL, 1);
109 else
110 gpio_direction_output(GPIO_LCDBL, 0);
111}
112
113static struct generic_bl_info eukrea_mbimxsd51_bl_info = {
114 .name = "eukrea_mbimxsd51-bl",
115 .max_intensity = 0xff,
116 .default_intensity = 0xff,
117 .set_bl_intensity = eukrea_mbimxsd51_bl_set_intensity,
118};
119
120static struct platform_device eukrea_mbimxsd51_bl_dev = {
121 .name = "generic-bl",
122 .id = 1,
123 .dev = {
124 .platform_data = &eukrea_mbimxsd51_bl_info,
125 },
126};
127
128static const struct gpio_led eukrea_mbimxsd51_leds[] __initconst = {
75 { 129 {
76 .name = "led1", 130 .name = "led1",
77 .default_trigger = "heartbeat", 131 .default_trigger = "heartbeat",
@@ -81,12 +135,12 @@ static const struct gpio_led eukrea_mbimxsd_leds[] __initconst = {
81}; 135};
82 136
83static const struct gpio_led_platform_data 137static const struct gpio_led_platform_data
84 eukrea_mbimxsd_led_info __initconst = { 138 eukrea_mbimxsd51_led_info __initconst = {
85 .leds = eukrea_mbimxsd_leds, 139 .leds = eukrea_mbimxsd51_leds,
86 .num_leds = ARRAY_SIZE(eukrea_mbimxsd_leds), 140 .num_leds = ARRAY_SIZE(eukrea_mbimxsd51_leds),
87}; 141};
88 142
89static struct gpio_keys_button eukrea_mbimxsd_gpio_buttons[] = { 143static struct gpio_keys_button eukrea_mbimxsd51_gpio_buttons[] = {
90 { 144 {
91 .gpio = GPIO_SWITCH1, 145 .gpio = GPIO_SWITCH1,
92 .code = BTN_0, 146 .code = BTN_0,
@@ -97,21 +151,39 @@ static struct gpio_keys_button eukrea_mbimxsd_gpio_buttons[] = {
97}; 151};
98 152
99static const struct gpio_keys_platform_data 153static const struct gpio_keys_platform_data
100 eukrea_mbimxsd_button_data __initconst = { 154 eukrea_mbimxsd51_button_data __initconst = {
101 .buttons = eukrea_mbimxsd_gpio_buttons, 155 .buttons = eukrea_mbimxsd51_gpio_buttons,
102 .nbuttons = ARRAY_SIZE(eukrea_mbimxsd_gpio_buttons), 156 .nbuttons = ARRAY_SIZE(eukrea_mbimxsd51_gpio_buttons),
103}; 157};
104 158
105static const struct imxuart_platform_data uart_pdata __initconst = { 159static const struct imxuart_platform_data uart_pdata __initconst = {
106 .flags = IMXUART_HAVE_RTSCTS, 160 .flags = IMXUART_HAVE_RTSCTS,
107}; 161};
108 162
109static struct i2c_board_info eukrea_mbimxsd_i2c_devices[] = { 163static struct i2c_board_info eukrea_mbimxsd51_i2c_devices[] = {
110 { 164 {
111 I2C_BOARD_INFO("tlv320aic23", 0x1a), 165 I2C_BOARD_INFO("tlv320aic23", 0x1a),
112 }, 166 },
113}; 167};
114 168
169static const
170struct imx_ssi_platform_data eukrea_mbimxsd51_ssi_pdata __initconst = {
171 .flags = IMX_SSI_SYN | IMX_SSI_NET | IMX_SSI_USE_I2S_SLAVE,
172};
173
174static int screen_type;
175
176static int __init eukrea_mbimxsd51_screen_type(char *options)
177{
178 if (!strcmp(options, "dvi"))
179 screen_type = 1;
180 else if (!strcmp(options, "tft"))
181 screen_type = 0;
182
183 return 0;
184}
185__setup("screen_type=", eukrea_mbimxsd51_screen_type);
186
115/* 187/*
116 * system init for baseboard usage. Will be called by cpuimx51sd init. 188 * system init for baseboard usage. Will be called by cpuimx51sd init.
117 * 189 *
@@ -120,8 +192,8 @@ static struct i2c_board_info eukrea_mbimxsd_i2c_devices[] = {
120 */ 192 */
121void __init eukrea_mbimxsd51_baseboard_init(void) 193void __init eukrea_mbimxsd51_baseboard_init(void)
122{ 194{
123 if (mxc_iomux_v3_setup_multiple_pads(eukrea_mbimxsd_pads, 195 if (mxc_iomux_v3_setup_multiple_pads(eukrea_mbimxsd51_pads,
124 ARRAY_SIZE(eukrea_mbimxsd_pads))) 196 ARRAY_SIZE(eukrea_mbimxsd51_pads)))
125 printk(KERN_ERR "error setting mbimxsd pads !\n"); 197 printk(KERN_ERR "error setting mbimxsd pads !\n");
126 198
127 imx51_add_imx_uart(1, NULL); 199 imx51_add_imx_uart(1, NULL);
@@ -129,6 +201,8 @@ void __init eukrea_mbimxsd51_baseboard_init(void)
129 201
130 imx51_add_sdhci_esdhc_imx(0, NULL); 202 imx51_add_sdhci_esdhc_imx(0, NULL);
131 203
204 imx51_add_imx_ssi(0, &eukrea_mbimxsd51_ssi_pdata);
205
132 gpio_request(GPIO_LED1, "LED1"); 206 gpio_request(GPIO_LED1, "LED1");
133 gpio_direction_output(GPIO_LED1, 1); 207 gpio_direction_output(GPIO_LED1, 1);
134 gpio_free(GPIO_LED1); 208 gpio_free(GPIO_LED1);
@@ -137,9 +211,21 @@ void __init eukrea_mbimxsd51_baseboard_init(void)
137 gpio_direction_input(GPIO_SWITCH1); 211 gpio_direction_input(GPIO_SWITCH1);
138 gpio_free(GPIO_SWITCH1); 212 gpio_free(GPIO_SWITCH1);
139 213
140 i2c_register_board_info(0, eukrea_mbimxsd_i2c_devices, 214 gpio_request(GPIO_LCDRST, "LCDRST");
141 ARRAY_SIZE(eukrea_mbimxsd_i2c_devices)); 215 gpio_direction_output(GPIO_LCDRST, 0);
142 216 gpio_request(GPIO_LCDBL, "LCDBL");
143 gpio_led_register_device(-1, &eukrea_mbimxsd_led_info); 217 gpio_direction_output(GPIO_LCDBL, 0);
144 imx_add_gpio_keys(&eukrea_mbimxsd_button_data); 218 if (!screen_type) {
219 platform_device_register(&eukrea_mbimxsd51_bl_dev);
220 platform_device_register(&eukrea_mbimxsd51_lcd_powerdev);
221 } else {
222 gpio_free(GPIO_LCDRST);
223 gpio_free(GPIO_LCDBL);
224 }
225
226 i2c_register_board_info(0, eukrea_mbimxsd51_i2c_devices,
227 ARRAY_SIZE(eukrea_mbimxsd51_i2c_devices));
228
229 gpio_led_register_device(-1, &eukrea_mbimxsd51_led_info);
230 imx_add_gpio_keys(&eukrea_mbimxsd51_button_data);
145} 231}
diff --git a/arch/arm/mach-imx/mach-cpuimx51.c b/arch/arm/mach-imx/mach-cpuimx51.c
deleted file mode 100644
index 944025da8333..000000000000
--- a/arch/arm/mach-imx/mach-cpuimx51.c
+++ /dev/null
@@ -1,301 +0,0 @@
1/*
2 *
3 * Copyright (C) 2010 Eric Bénard <eric@eukrea.com>
4 *
5 * based on board-mx51_babbage.c which is
6 * Copyright 2009 Freescale Semiconductor, Inc. All Rights Reserved.
7 * Copyright (C) 2009-2010 Amit Kucheria <amit.kucheria@canonical.com>
8 *
9 * The code contained herein is licensed under the GNU General Public
10 * License. You may obtain a copy of the GNU General Public License
11 * Version 2 or later at the following locations:
12 *
13 * http://www.opensource.org/licenses/gpl-license.html
14 * http://www.gnu.org/copyleft/gpl.html
15 */
16
17#include <linux/init.h>
18#include <linux/platform_device.h>
19#include <linux/serial_8250.h>
20#include <linux/i2c.h>
21#include <linux/gpio.h>
22#include <linux/delay.h>
23#include <linux/io.h>
24#include <linux/interrupt.h>
25
26#include <mach/eukrea-baseboards.h>
27#include <mach/common.h>
28#include <mach/hardware.h>
29#include <mach/iomux-mx51.h>
30
31#include <asm/setup.h>
32#include <asm/mach-types.h>
33#include <asm/mach/arch.h>
34#include <asm/mach/time.h>
35
36#include "devices-imx51.h"
37
38#define CPUIMX51_USBH1_STP IMX_GPIO_NR(1, 27)
39#define CPUIMX51_QUARTA_GPIO IMX_GPIO_NR(3, 28)
40#define CPUIMX51_QUARTB_GPIO IMX_GPIO_NR(3, 25)
41#define CPUIMX51_QUARTC_GPIO IMX_GPIO_NR(3, 26)
42#define CPUIMX51_QUARTD_GPIO IMX_GPIO_NR(3, 27)
43#define CPUIMX51_QUART_XTAL 14745600
44#define CPUIMX51_QUART_REGSHIFT 17
45
46/* USB_CTRL_1 */
47#define MX51_USB_CTRL_1_OFFSET 0x10
48#define MX51_USB_CTRL_UH1_EXT_CLK_EN (1 << 25)
49
50#define MX51_USB_PLLDIV_12_MHZ 0x00
51#define MX51_USB_PLL_DIV_19_2_MHZ 0x01
52#define MX51_USB_PLL_DIV_24_MHZ 0x02
53
54static struct plat_serial8250_port serial_platform_data[] = {
55 {
56 .mapbase = (unsigned long)(MX51_CS1_BASE_ADDR + 0x400000),
57 .irq = IMX_GPIO_TO_IRQ(CPUIMX51_QUARTA_GPIO),
58 .irqflags = IRQF_TRIGGER_HIGH,
59 .uartclk = CPUIMX51_QUART_XTAL,
60 .regshift = CPUIMX51_QUART_REGSHIFT,
61 .iotype = UPIO_MEM,
62 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | UPF_IOREMAP,
63 }, {
64 .mapbase = (unsigned long)(MX51_CS1_BASE_ADDR + 0x800000),
65 .irq = IMX_GPIO_TO_IRQ(CPUIMX51_QUARTB_GPIO),
66 .irqflags = IRQF_TRIGGER_HIGH,
67 .uartclk = CPUIMX51_QUART_XTAL,
68 .regshift = CPUIMX51_QUART_REGSHIFT,
69 .iotype = UPIO_MEM,
70 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | UPF_IOREMAP,
71 }, {
72 .mapbase = (unsigned long)(MX51_CS1_BASE_ADDR + 0x1000000),
73 .irq = IMX_GPIO_TO_IRQ(CPUIMX51_QUARTC_GPIO),
74 .irqflags = IRQF_TRIGGER_HIGH,
75 .uartclk = CPUIMX51_QUART_XTAL,
76 .regshift = CPUIMX51_QUART_REGSHIFT,
77 .iotype = UPIO_MEM,
78 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | UPF_IOREMAP,
79 }, {
80 .mapbase = (unsigned long)(MX51_CS1_BASE_ADDR + 0x2000000),
81 .irq = IMX_GPIO_TO_IRQ(CPUIMX51_QUARTD_GPIO),
82 .irqflags = IRQF_TRIGGER_HIGH,
83 .uartclk = CPUIMX51_QUART_XTAL,
84 .regshift = CPUIMX51_QUART_REGSHIFT,
85 .iotype = UPIO_MEM,
86 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | UPF_IOREMAP,
87 }, {
88 }
89};
90
91static struct platform_device serial_device = {
92 .name = "serial8250",
93 .id = 0,
94 .dev = {
95 .platform_data = serial_platform_data,
96 },
97};
98
99static struct platform_device *devices[] __initdata = {
100 &serial_device,
101};
102
103static iomux_v3_cfg_t eukrea_cpuimx51_pads[] = {
104 /* UART1 */
105 MX51_PAD_UART1_RXD__UART1_RXD,
106 MX51_PAD_UART1_TXD__UART1_TXD,
107 MX51_PAD_UART1_RTS__UART1_RTS,
108 MX51_PAD_UART1_CTS__UART1_CTS,
109
110 /* I2C2 */
111 MX51_PAD_GPIO1_2__I2C2_SCL,
112 MX51_PAD_GPIO1_3__I2C2_SDA,
113 MX51_PAD_NANDF_D10__GPIO3_30,
114
115 /* QUART IRQ */
116 MX51_PAD_NANDF_D15__GPIO3_25,
117 MX51_PAD_NANDF_D14__GPIO3_26,
118 MX51_PAD_NANDF_D13__GPIO3_27,
119 MX51_PAD_NANDF_D12__GPIO3_28,
120
121 /* USB HOST1 */
122 MX51_PAD_USBH1_CLK__USBH1_CLK,
123 MX51_PAD_USBH1_DIR__USBH1_DIR,
124 MX51_PAD_USBH1_NXT__USBH1_NXT,
125 MX51_PAD_USBH1_DATA0__USBH1_DATA0,
126 MX51_PAD_USBH1_DATA1__USBH1_DATA1,
127 MX51_PAD_USBH1_DATA2__USBH1_DATA2,
128 MX51_PAD_USBH1_DATA3__USBH1_DATA3,
129 MX51_PAD_USBH1_DATA4__USBH1_DATA4,
130 MX51_PAD_USBH1_DATA5__USBH1_DATA5,
131 MX51_PAD_USBH1_DATA6__USBH1_DATA6,
132 MX51_PAD_USBH1_DATA7__USBH1_DATA7,
133 MX51_PAD_USBH1_STP__USBH1_STP,
134};
135
136static const struct mxc_nand_platform_data
137 eukrea_cpuimx51_nand_board_info __initconst = {
138 .width = 1,
139 .hw_ecc = 1,
140 .flash_bbt = 1,
141};
142
143static const struct imxuart_platform_data uart_pdata __initconst = {
144 .flags = IMXUART_HAVE_RTSCTS,
145};
146
147static const
148struct imxi2c_platform_data eukrea_cpuimx51_i2c_data __initconst = {
149 .bitrate = 100000,
150};
151
152static struct i2c_board_info eukrea_cpuimx51_i2c_devices[] = {
153 {
154 I2C_BOARD_INFO("pcf8563", 0x51),
155 },
156};
157
158/* This function is board specific as the bit mask for the plldiv will also
159be different for other Freescale SoCs, thus a common bitmask is not
160possible and cannot get place in /plat-mxc/ehci.c.*/
161static int initialize_otg_port(struct platform_device *pdev)
162{
163 u32 v;
164 void __iomem *usb_base;
165 void __iomem *usbother_base;
166
167 usb_base = ioremap(MX51_USB_OTG_BASE_ADDR, SZ_4K);
168 if (!usb_base)
169 return -ENOMEM;
170 usbother_base = usb_base + MX5_USBOTHER_REGS_OFFSET;
171
172 /* Set the PHY clock to 19.2MHz */
173 v = __raw_readl(usbother_base + MXC_USB_PHY_CTR_FUNC2_OFFSET);
174 v &= ~MX5_USB_UTMI_PHYCTRL1_PLLDIV_MASK;
175 v |= MX51_USB_PLL_DIV_19_2_MHZ;
176 __raw_writel(v, usbother_base + MXC_USB_PHY_CTR_FUNC2_OFFSET);
177 iounmap(usb_base);
178
179 mdelay(10);
180
181 return mx51_initialize_usb_hw(0, MXC_EHCI_INTERNAL_PHY);
182}
183
184static int initialize_usbh1_port(struct platform_device *pdev)
185{
186 u32 v;
187 void __iomem *usb_base;
188 void __iomem *usbother_base;
189
190 usb_base = ioremap(MX51_USB_OTG_BASE_ADDR, SZ_4K);
191 if (!usb_base)
192 return -ENOMEM;
193 usbother_base = usb_base + MX5_USBOTHER_REGS_OFFSET;
194
195 /* The clock for the USBH1 ULPI port will come externally from the PHY. */
196 v = __raw_readl(usbother_base + MX51_USB_CTRL_1_OFFSET);
197 __raw_writel(v | MX51_USB_CTRL_UH1_EXT_CLK_EN, usbother_base + MX51_USB_CTRL_1_OFFSET);
198 iounmap(usb_base);
199
200 mdelay(10);
201
202 return mx51_initialize_usb_hw(1, MXC_EHCI_POWER_PINS_ENABLED |
203 MXC_EHCI_ITC_NO_THRESHOLD);
204}
205
206static const struct mxc_usbh_platform_data dr_utmi_config __initconst = {
207 .init = initialize_otg_port,
208 .portsc = MXC_EHCI_UTMI_16BIT,
209};
210
211static const struct fsl_usb2_platform_data usb_pdata __initconst = {
212 .operating_mode = FSL_USB2_DR_DEVICE,
213 .phy_mode = FSL_USB2_PHY_UTMI_WIDE,
214};
215
216static const struct mxc_usbh_platform_data usbh1_config __initconst = {
217 .init = initialize_usbh1_port,
218 .portsc = MXC_EHCI_MODE_ULPI,
219};
220
221static int otg_mode_host;
222
223static int __init eukrea_cpuimx51_otg_mode(char *options)
224{
225 if (!strcmp(options, "host"))
226 otg_mode_host = 1;
227 else if (!strcmp(options, "device"))
228 otg_mode_host = 0;
229 else
230 pr_info("otg_mode neither \"host\" nor \"device\". "
231 "Defaulting to device\n");
232 return 0;
233}
234__setup("otg_mode=", eukrea_cpuimx51_otg_mode);
235
236/*
237 * Board specific initialization.
238 */
239static void __init eukrea_cpuimx51_init(void)
240{
241 imx51_soc_init();
242
243 mxc_iomux_v3_setup_multiple_pads(eukrea_cpuimx51_pads,
244 ARRAY_SIZE(eukrea_cpuimx51_pads));
245
246 imx51_add_imx_uart(0, &uart_pdata);
247 imx51_add_mxc_nand(&eukrea_cpuimx51_nand_board_info);
248
249 gpio_request(CPUIMX51_QUARTA_GPIO, "quarta_irq");
250 gpio_direction_input(CPUIMX51_QUARTA_GPIO);
251 gpio_free(CPUIMX51_QUARTA_GPIO);
252 gpio_request(CPUIMX51_QUARTB_GPIO, "quartb_irq");
253 gpio_direction_input(CPUIMX51_QUARTB_GPIO);
254 gpio_free(CPUIMX51_QUARTB_GPIO);
255 gpio_request(CPUIMX51_QUARTC_GPIO, "quartc_irq");
256 gpio_direction_input(CPUIMX51_QUARTC_GPIO);
257 gpio_free(CPUIMX51_QUARTC_GPIO);
258 gpio_request(CPUIMX51_QUARTD_GPIO, "quartd_irq");
259 gpio_direction_input(CPUIMX51_QUARTD_GPIO);
260 gpio_free(CPUIMX51_QUARTD_GPIO);
261
262 imx51_add_fec(NULL);
263 platform_add_devices(devices, ARRAY_SIZE(devices));
264
265 imx51_add_imx_i2c(1, &eukrea_cpuimx51_i2c_data);
266 i2c_register_board_info(1, eukrea_cpuimx51_i2c_devices,
267 ARRAY_SIZE(eukrea_cpuimx51_i2c_devices));
268
269 if (otg_mode_host)
270 imx51_add_mxc_ehci_otg(&dr_utmi_config);
271 else {
272 initialize_otg_port(NULL);
273 imx51_add_fsl_usb2_udc(&usb_pdata);
274 }
275 imx51_add_mxc_ehci_hs(1, &usbh1_config);
276
277#ifdef CONFIG_MACH_EUKREA_MBIMX51_BASEBOARD
278 eukrea_mbimx51_baseboard_init();
279#endif
280}
281
282static void __init eukrea_cpuimx51_timer_init(void)
283{
284 mx51_clocks_init(32768, 24000000, 22579200, 0);
285}
286
287static struct sys_timer mxc_timer = {
288 .init = eukrea_cpuimx51_timer_init,
289};
290
291MACHINE_START(EUKREA_CPUIMX51, "Eukrea CPUIMX51 Module")
292 /* Maintainer: Eric Bénard <eric@eukrea.com> */
293 .atag_offset = 0x100,
294 .map_io = mx51_map_io,
295 .init_early = imx51_init_early,
296 .init_irq = mx51_init_irq,
297 .handle_irq = imx51_handle_irq,
298 .timer = &mxc_timer,
299 .init_machine = eukrea_cpuimx51_init,
300 .restart = mxc_restart,
301MACHINE_END
diff --git a/arch/arm/mach-imx/mach-cpuimx51sd.c b/arch/arm/mach-imx/mach-cpuimx51sd.c
index 9fbe923c8b08..ce341a6874fc 100644
--- a/arch/arm/mach-imx/mach-cpuimx51sd.c
+++ b/arch/arm/mach-imx/mach-cpuimx51sd.c
@@ -41,11 +41,13 @@
41 41
42#define USBH1_RST IMX_GPIO_NR(2, 28) 42#define USBH1_RST IMX_GPIO_NR(2, 28)
43#define ETH_RST IMX_GPIO_NR(2, 31) 43#define ETH_RST IMX_GPIO_NR(2, 31)
44#define TSC2007_IRQGPIO IMX_GPIO_NR(3, 12) 44#define TSC2007_IRQGPIO_REV2 IMX_GPIO_NR(3, 12)
45#define TSC2007_IRQGPIO_REV3 IMX_GPIO_NR(4, 0)
45#define CAN_IRQGPIO IMX_GPIO_NR(1, 1) 46#define CAN_IRQGPIO IMX_GPIO_NR(1, 1)
46#define CAN_RST IMX_GPIO_NR(4, 15) 47#define CAN_RST IMX_GPIO_NR(4, 15)
47#define CAN_NCS IMX_GPIO_NR(4, 24) 48#define CAN_NCS IMX_GPIO_NR(4, 24)
48#define CAN_RXOBF IMX_GPIO_NR(1, 4) 49#define CAN_RXOBF_REV2 IMX_GPIO_NR(1, 4)
50#define CAN_RXOBF_REV3 IMX_GPIO_NR(3, 12)
49#define CAN_RX1BF IMX_GPIO_NR(1, 6) 51#define CAN_RX1BF IMX_GPIO_NR(1, 6)
50#define CAN_TXORTS IMX_GPIO_NR(1, 7) 52#define CAN_TXORTS IMX_GPIO_NR(1, 7)
51#define CAN_TX1RTS IMX_GPIO_NR(1, 8) 53#define CAN_TX1RTS IMX_GPIO_NR(1, 8)
@@ -90,6 +92,10 @@ static iomux_v3_cfg_t eukrea_cpuimx51sd_pads[] = {
90 MX51_PAD_I2C1_CLK__GPIO4_16, 92 MX51_PAD_I2C1_CLK__GPIO4_16,
91 MX51_PAD_I2C1_DAT__GPIO4_17, 93 MX51_PAD_I2C1_DAT__GPIO4_17,
92 94
95 /* I2C1 */
96 MX51_PAD_SD2_CMD__I2C1_SCL,
97 MX51_PAD_SD2_CLK__I2C1_SDA,
98
93 /* CAN */ 99 /* CAN */
94 MX51_PAD_CSPI1_MOSI__ECSPI1_MOSI, 100 MX51_PAD_CSPI1_MOSI__ECSPI1_MOSI,
95 MX51_PAD_CSPI1_MISO__ECSPI1_MISO, 101 MX51_PAD_CSPI1_MISO__ECSPI1_MISO,
@@ -108,15 +114,27 @@ static iomux_v3_cfg_t eukrea_cpuimx51sd_pads[] = {
108 NEW_PAD_CTRL(MX51_PAD_GPIO_NAND__GPIO_NAND, PAD_CTL_PUS_22K_UP | 114 NEW_PAD_CTRL(MX51_PAD_GPIO_NAND__GPIO_NAND, PAD_CTL_PUS_22K_UP |
109 PAD_CTL_PKE | PAD_CTL_SRE_FAST | 115 PAD_CTL_PKE | PAD_CTL_SRE_FAST |
110 PAD_CTL_DSE_HIGH | PAD_CTL_PUE | PAD_CTL_HYS), 116 PAD_CTL_DSE_HIGH | PAD_CTL_PUE | PAD_CTL_HYS),
117 NEW_PAD_CTRL(MX51_PAD_NANDF_D8__GPIO4_0, PAD_CTL_PUS_22K_UP |
118 PAD_CTL_PKE | PAD_CTL_SRE_FAST |
119 PAD_CTL_DSE_HIGH | PAD_CTL_PUE | PAD_CTL_HYS),
111}; 120};
112 121
113static const struct imxuart_platform_data uart_pdata __initconst = { 122static const struct imxuart_platform_data uart_pdata __initconst = {
114 .flags = IMXUART_HAVE_RTSCTS, 123 .flags = IMXUART_HAVE_RTSCTS,
115}; 124};
116 125
126static int tsc2007_get_pendown_state(void)
127{
128 if (mx51_revision() < IMX_CHIP_REVISION_3_0)
129 return !gpio_get_value(TSC2007_IRQGPIO_REV2);
130 else
131 return !gpio_get_value(TSC2007_IRQGPIO_REV3);
132}
133
117static struct tsc2007_platform_data tsc2007_info = { 134static struct tsc2007_platform_data tsc2007_info = {
118 .model = 2007, 135 .model = 2007,
119 .x_plate_ohms = 180, 136 .x_plate_ohms = 180,
137 .get_pendown_state = tsc2007_get_pendown_state,
120}; 138};
121 139
122static struct i2c_board_info eukrea_cpuimx51sd_i2c_devices[] = { 140static struct i2c_board_info eukrea_cpuimx51sd_i2c_devices[] = {
@@ -126,7 +144,6 @@ static struct i2c_board_info eukrea_cpuimx51sd_i2c_devices[] = {
126 I2C_BOARD_INFO("tsc2007", 0x49), 144 I2C_BOARD_INFO("tsc2007", 0x49),
127 .type = "tsc2007", 145 .type = "tsc2007",
128 .platform_data = &tsc2007_info, 146 .platform_data = &tsc2007_info,
129 .irq = IMX_GPIO_TO_IRQ(TSC2007_IRQGPIO),
130 }, 147 },
131}; 148};
132 149
@@ -255,10 +272,14 @@ static const struct spi_imx_master cpuimx51sd_ecspi1_pdata __initconst = {
255 .num_chipselect = ARRAY_SIZE(cpuimx51sd_spi1_cs), 272 .num_chipselect = ARRAY_SIZE(cpuimx51sd_spi1_cs),
256}; 273};
257 274
258static struct platform_device *platform_devices[] __initdata = { 275static struct platform_device *rev2_platform_devices[] __initdata = {
259 &hsi2c_gpio_device, 276 &hsi2c_gpio_device,
260}; 277};
261 278
279static const struct imxi2c_platform_data cpuimx51sd_i2c_data __initconst = {
280 .bitrate = 100000,
281};
282
262static void __init eukrea_cpuimx51sd_init(void) 283static void __init eukrea_cpuimx51sd_init(void)
263{ 284{
264 imx51_soc_init(); 285 imx51_soc_init();
@@ -272,6 +293,7 @@ static void __init eukrea_cpuimx51sd_init(void)
272 293
273 imx51_add_imx_uart(0, &uart_pdata); 294 imx51_add_imx_uart(0, &uart_pdata);
274 imx51_add_mxc_nand(&eukrea_cpuimx51sd_nand_board_info); 295 imx51_add_mxc_nand(&eukrea_cpuimx51sd_nand_board_info);
296 imx51_add_imx2_wdt(0, NULL);
275 297
276 gpio_request(ETH_RST, "eth_rst"); 298 gpio_request(ETH_RST, "eth_rst");
277 gpio_set_value(ETH_RST, 1); 299 gpio_set_value(ETH_RST, 1);
@@ -291,13 +313,25 @@ static void __init eukrea_cpuimx51sd_init(void)
291 spi_register_board_info(cpuimx51sd_spi_device, 313 spi_register_board_info(cpuimx51sd_spi_device,
292 ARRAY_SIZE(cpuimx51sd_spi_device)); 314 ARRAY_SIZE(cpuimx51sd_spi_device));
293 315
294 gpio_request(TSC2007_IRQGPIO, "tsc2007_irq"); 316 if (mx51_revision() < IMX_CHIP_REVISION_3_0) {
295 gpio_direction_input(TSC2007_IRQGPIO); 317 eukrea_cpuimx51sd_i2c_devices[1].irq =
296 gpio_free(TSC2007_IRQGPIO); 318 gpio_to_irq(TSC2007_IRQGPIO_REV2),
319 platform_add_devices(rev2_platform_devices,
320 ARRAY_SIZE(rev2_platform_devices));
321 gpio_request(TSC2007_IRQGPIO_REV2, "tsc2007_irq");
322 gpio_direction_input(TSC2007_IRQGPIO_REV2);
323 gpio_free(TSC2007_IRQGPIO_REV2);
324 } else {
325 eukrea_cpuimx51sd_i2c_devices[1].irq =
326 gpio_to_irq(TSC2007_IRQGPIO_REV3),
327 imx51_add_imx_i2c(0, &cpuimx51sd_i2c_data);
328 gpio_request(TSC2007_IRQGPIO_REV3, "tsc2007_irq");
329 gpio_direction_input(TSC2007_IRQGPIO_REV3);
330 gpio_free(TSC2007_IRQGPIO_REV3);
331 }
297 332
298 i2c_register_board_info(0, eukrea_cpuimx51sd_i2c_devices, 333 i2c_register_board_info(0, eukrea_cpuimx51sd_i2c_devices,
299 ARRAY_SIZE(eukrea_cpuimx51sd_i2c_devices)); 334 ARRAY_SIZE(eukrea_cpuimx51sd_i2c_devices));
300 platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices));
301 335
302 if (otg_mode_host) 336 if (otg_mode_host)
303 imx51_add_mxc_ehci_otg(&dr_utmi_config); 337 imx51_add_mxc_ehci_otg(&dr_utmi_config);
diff --git a/arch/arm/mach-imx/mach-eukrea_cpuimx25.c b/arch/arm/mach-imx/mach-eukrea_cpuimx25.c
index 76a97a598b9e..d1e04e676e33 100644
--- a/arch/arm/mach-imx/mach-eukrea_cpuimx25.c
+++ b/arch/arm/mach-imx/mach-eukrea_cpuimx25.c
@@ -106,6 +106,7 @@ static const struct mxc_usbh_platform_data usbh2_pdata __initconst = {
106static const struct fsl_usb2_platform_data otg_device_pdata __initconst = { 106static const struct fsl_usb2_platform_data otg_device_pdata __initconst = {
107 .operating_mode = FSL_USB2_DR_DEVICE, 107 .operating_mode = FSL_USB2_DR_DEVICE,
108 .phy_mode = FSL_USB2_PHY_UTMI, 108 .phy_mode = FSL_USB2_PHY_UTMI,
109 .workaround = FLS_USB2_WORKAROUND_ENGCM09152,
109}; 110};
110 111
111static int otg_mode_host; 112static int otg_mode_host;
@@ -135,6 +136,7 @@ static void __init eukrea_cpuimx25_init(void)
135 imx25_add_mxc_nand(&eukrea_cpuimx25_nand_board_info); 136 imx25_add_mxc_nand(&eukrea_cpuimx25_nand_board_info);
136 imx25_add_imxdi_rtc(NULL); 137 imx25_add_imxdi_rtc(NULL);
137 imx25_add_fec(&mx25_fec_pdata); 138 imx25_add_fec(&mx25_fec_pdata);
139 imx25_add_imx2_wdt(NULL);
138 140
139 i2c_register_board_info(0, eukrea_cpuimx25_i2c_devices, 141 i2c_register_board_info(0, eukrea_cpuimx25_i2c_devices,
140 ARRAY_SIZE(eukrea_cpuimx25_i2c_devices)); 142 ARRAY_SIZE(eukrea_cpuimx25_i2c_devices));
diff --git a/arch/arm/mach-imx/mach-imx27_visstrim_m10.c b/arch/arm/mach-imx/mach-imx27_visstrim_m10.c
index f7b074f496f0..748ba2e311b5 100644
--- a/arch/arm/mach-imx/mach-imx27_visstrim_m10.c
+++ b/arch/arm/mach-imx/mach-imx27_visstrim_m10.c
@@ -38,6 +38,7 @@
38#include <asm/mach-types.h> 38#include <asm/mach-types.h>
39#include <asm/mach/arch.h> 39#include <asm/mach/arch.h>
40#include <asm/mach/time.h> 40#include <asm/mach/time.h>
41#include <asm/system.h>
41#include <mach/common.h> 42#include <mach/common.h>
42#include <mach/iomux-mx27.h> 43#include <mach/iomux-mx27.h>
43 44
@@ -48,6 +49,14 @@
48#define OTG_PHY_CS_GPIO (GPIO_PORTF + 17) 49#define OTG_PHY_CS_GPIO (GPIO_PORTF + 17)
49#define SDHC1_IRQ IRQ_GPIOB(25) 50#define SDHC1_IRQ IRQ_GPIOB(25)
50 51
52#define MOTHERBOARD_BIT2 (GPIO_PORTD + 31)
53#define MOTHERBOARD_BIT1 (GPIO_PORTD + 30)
54#define MOTHERBOARD_BIT0 (GPIO_PORTD + 29)
55
56#define EXPBOARD_BIT2 (GPIO_PORTD + 25)
57#define EXPBOARD_BIT1 (GPIO_PORTD + 27)
58#define EXPBOARD_BIT0 (GPIO_PORTD + 28)
59
51static const int visstrim_m10_pins[] __initconst = { 60static const int visstrim_m10_pins[] __initconst = {
52 /* UART1 (console) */ 61 /* UART1 (console) */
53 PE12_PF_UART1_TXD, 62 PE12_PF_UART1_TXD,
@@ -119,6 +128,23 @@ static const int visstrim_m10_pins[] __initconst = {
119 PB19_PF_CSI_D7, 128 PB19_PF_CSI_D7,
120 PB20_PF_CSI_VSYNC, 129 PB20_PF_CSI_VSYNC,
121 PB21_PF_CSI_HSYNC, 130 PB21_PF_CSI_HSYNC,
131 /* mother board version */
132 MOTHERBOARD_BIT2 | GPIO_GPIO | GPIO_IN | GPIO_PUEN,
133 MOTHERBOARD_BIT1 | GPIO_GPIO | GPIO_IN | GPIO_PUEN,
134 MOTHERBOARD_BIT0 | GPIO_GPIO | GPIO_IN | GPIO_PUEN,
135 /* expansion board version */
136 EXPBOARD_BIT2 | GPIO_GPIO | GPIO_IN | GPIO_PUEN,
137 EXPBOARD_BIT1 | GPIO_GPIO | GPIO_IN | GPIO_PUEN,
138 EXPBOARD_BIT0 | GPIO_GPIO | GPIO_IN | GPIO_PUEN,
139};
140
141static struct gpio visstrim_m10_version_gpios[] = {
142 { EXPBOARD_BIT0, GPIOF_IN, "exp-version-0" },
143 { EXPBOARD_BIT1, GPIOF_IN, "exp-version-1" },
144 { EXPBOARD_BIT2, GPIOF_IN, "exp-version-2" },
145 { MOTHERBOARD_BIT0, GPIOF_IN, "mother-version-0" },
146 { MOTHERBOARD_BIT1, GPIOF_IN, "mother-version-1" },
147 { MOTHERBOARD_BIT2, GPIOF_IN, "mother-version-2" },
122}; 148};
123 149
124/* Camera */ 150/* Camera */
@@ -369,11 +395,40 @@ static const struct imx_ssi_platform_data visstrim_m10_ssi_pdata __initconst = {
369 .flags = IMX_SSI_DMA | IMX_SSI_SYN, 395 .flags = IMX_SSI_DMA | IMX_SSI_SYN,
370}; 396};
371 397
398static void __init visstrim_m10_revision(void)
399{
400 int exp_version = 0;
401 int mo_version = 0;
402 int ret;
403
404 ret = gpio_request_array(visstrim_m10_version_gpios,
405 ARRAY_SIZE(visstrim_m10_version_gpios));
406 if (ret) {
407 pr_err("Failed to request version gpios");
408 return;
409 }
410
411 /* Get expansion board version (negative logic) */
412 exp_version |= !gpio_get_value(EXPBOARD_BIT2) << 2;
413 exp_version |= !gpio_get_value(EXPBOARD_BIT1) << 1;
414 exp_version |= !gpio_get_value(EXPBOARD_BIT0);
415
416 /* Get mother board version (negative logic) */
417 mo_version |= !gpio_get_value(MOTHERBOARD_BIT2) << 2;
418 mo_version |= !gpio_get_value(MOTHERBOARD_BIT1) << 1;
419 mo_version |= !gpio_get_value(MOTHERBOARD_BIT0);
420
421 system_rev = 0x27000;
422 system_rev |= (mo_version << 4);
423 system_rev |= exp_version;
424}
425
372static void __init visstrim_m10_board_init(void) 426static void __init visstrim_m10_board_init(void)
373{ 427{
374 int ret; 428 int ret;
375 429
376 imx27_soc_init(); 430 imx27_soc_init();
431 visstrim_m10_revision();
377 432
378 ret = mxc_gpio_setup_multiple_pins(visstrim_m10_pins, 433 ret = mxc_gpio_setup_multiple_pins(visstrim_m10_pins,
379 ARRAY_SIZE(visstrim_m10_pins), "VISSTRIM_M10"); 434 ARRAY_SIZE(visstrim_m10_pins), "VISSTRIM_M10");
diff --git a/arch/arm/mach-imx/mach-mx35_3ds.c b/arch/arm/mach-imx/mach-mx35_3ds.c
index c433187988a2..86284bba46d3 100644
--- a/arch/arm/mach-imx/mach-mx35_3ds.c
+++ b/arch/arm/mach-imx/mach-mx35_3ds.c
@@ -34,6 +34,8 @@
34#include <linux/usb/otg.h> 34#include <linux/usb/otg.h>
35 35
36#include <linux/mtd/physmap.h> 36#include <linux/mtd/physmap.h>
37#include <linux/mfd/mc13892.h>
38#include <linux/regulator/machine.h>
37 39
38#include <asm/mach-types.h> 40#include <asm/mach-types.h>
39#include <asm/mach/arch.h> 41#include <asm/mach/arch.h>
@@ -253,6 +255,8 @@ static iomux_v3_cfg_t mx35pdk_pads[] = {
253 MX35_PAD_CSI_MCLK__IPU_CSI_MCLK, 255 MX35_PAD_CSI_MCLK__IPU_CSI_MCLK,
254 MX35_PAD_CSI_PIXCLK__IPU_CSI_PIXCLK, 256 MX35_PAD_CSI_PIXCLK__IPU_CSI_PIXCLK,
255 MX35_PAD_CSI_VSYNC__IPU_CSI_VSYNC, 257 MX35_PAD_CSI_VSYNC__IPU_CSI_VSYNC,
258 /*PMIC IRQ*/
259 MX35_PAD_GPIO2_0__GPIO2_0,
256}; 260};
257 261
258/* 262/*
@@ -317,6 +321,193 @@ static struct platform_device mx35_3ds_ov2640 = {
317 }, 321 },
318}; 322};
319 323
324static struct regulator_consumer_supply sw1_consumers[] = {
325 {
326 .supply = "cpu_vcc",
327 }
328};
329
330static struct regulator_consumer_supply vcam_consumers[] = {
331 /* sgtl5000 */
332 REGULATOR_SUPPLY("VDDA", "0-000a"),
333};
334
335static struct regulator_consumer_supply vaudio_consumers[] = {
336 REGULATOR_SUPPLY("cmos_vio", "soc-camera-pdrv.0"),
337};
338
339static struct regulator_init_data sw1_init = {
340 .constraints = {
341 .name = "SW1",
342 .min_uV = 600000,
343 .max_uV = 1375000,
344 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE,
345 .valid_modes_mask = 0,
346 .always_on = 1,
347 .boot_on = 1,
348 },
349 .num_consumer_supplies = ARRAY_SIZE(sw1_consumers),
350 .consumer_supplies = sw1_consumers,
351};
352
353static struct regulator_init_data sw2_init = {
354 .constraints = {
355 .name = "SW2",
356 .always_on = 1,
357 .boot_on = 1,
358 }
359};
360
361static struct regulator_init_data sw3_init = {
362 .constraints = {
363 .name = "SW3",
364 .always_on = 1,
365 .boot_on = 1,
366 }
367};
368
369static struct regulator_init_data sw4_init = {
370 .constraints = {
371 .name = "SW4",
372 .always_on = 1,
373 .boot_on = 1,
374 }
375};
376
377static struct regulator_init_data viohi_init = {
378 .constraints = {
379 .name = "VIOHI",
380 .boot_on = 1,
381 }
382};
383
384static struct regulator_init_data vusb_init = {
385 .constraints = {
386 .name = "VUSB",
387 .boot_on = 1,
388 }
389};
390
391static struct regulator_init_data vdig_init = {
392 .constraints = {
393 .name = "VDIG",
394 .boot_on = 1,
395 }
396};
397
398static struct regulator_init_data vpll_init = {
399 .constraints = {
400 .name = "VPLL",
401 .boot_on = 1,
402 }
403};
404
405static struct regulator_init_data vusb2_init = {
406 .constraints = {
407 .name = "VUSB2",
408 .boot_on = 1,
409 }
410};
411
412static struct regulator_init_data vvideo_init = {
413 .constraints = {
414 .name = "VVIDEO",
415 .boot_on = 1
416 }
417};
418
419static struct regulator_init_data vaudio_init = {
420 .constraints = {
421 .name = "VAUDIO",
422 .min_uV = 2300000,
423 .max_uV = 3000000,
424 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE,
425 .boot_on = 1
426 },
427 .num_consumer_supplies = ARRAY_SIZE(vaudio_consumers),
428 .consumer_supplies = vaudio_consumers,
429};
430
431static struct regulator_init_data vcam_init = {
432 .constraints = {
433 .name = "VCAM",
434 .min_uV = 2500000,
435 .max_uV = 3000000,
436 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE |
437 REGULATOR_CHANGE_MODE,
438 .valid_modes_mask = REGULATOR_MODE_FAST | REGULATOR_MODE_NORMAL,
439 .boot_on = 1
440 },
441 .num_consumer_supplies = ARRAY_SIZE(vcam_consumers),
442 .consumer_supplies = vcam_consumers,
443};
444
445static struct regulator_init_data vgen1_init = {
446 .constraints = {
447 .name = "VGEN1",
448 }
449};
450
451static struct regulator_init_data vgen2_init = {
452 .constraints = {
453 .name = "VGEN2",
454 .boot_on = 1,
455 }
456};
457
458static struct regulator_init_data vgen3_init = {
459 .constraints = {
460 .name = "VGEN3",
461 }
462};
463
464static struct mc13xxx_regulator_init_data mx35_3ds_regulators[] = {
465 { .id = MC13892_SW1, .init_data = &sw1_init },
466 { .id = MC13892_SW2, .init_data = &sw2_init },
467 { .id = MC13892_SW3, .init_data = &sw3_init },
468 { .id = MC13892_SW4, .init_data = &sw4_init },
469 { .id = MC13892_VIOHI, .init_data = &viohi_init },
470 { .id = MC13892_VPLL, .init_data = &vpll_init },
471 { .id = MC13892_VDIG, .init_data = &vdig_init },
472 { .id = MC13892_VUSB2, .init_data = &vusb2_init },
473 { .id = MC13892_VVIDEO, .init_data = &vvideo_init },
474 { .id = MC13892_VAUDIO, .init_data = &vaudio_init },
475 { .id = MC13892_VCAM, .init_data = &vcam_init },
476 { .id = MC13892_VGEN1, .init_data = &vgen1_init },
477 { .id = MC13892_VGEN2, .init_data = &vgen2_init },
478 { .id = MC13892_VGEN3, .init_data = &vgen3_init },
479 { .id = MC13892_VUSB, .init_data = &vusb_init },
480};
481
482static struct mc13xxx_platform_data mx35_3ds_mc13892_data = {
483 .flags = MC13XXX_USE_RTC | MC13XXX_USE_TOUCHSCREEN,
484 .regulators = {
485 .num_regulators = ARRAY_SIZE(mx35_3ds_regulators),
486 .regulators = mx35_3ds_regulators,
487 },
488};
489
490#define GPIO_PMIC_INT IMX_GPIO_NR(2, 0)
491
492static struct i2c_board_info mx35_3ds_i2c_mc13892 = {
493
494 I2C_BOARD_INFO("mc13892", 0x08),
495 .platform_data = &mx35_3ds_mc13892_data,
496 .irq = IMX_GPIO_TO_IRQ(GPIO_PMIC_INT),
497};
498
499static void __init imx35_3ds_init_mc13892(void)
500{
501 int ret = gpio_request_one(GPIO_PMIC_INT, GPIOF_DIR_IN, "pmic irq");
502
503 if (ret) {
504 pr_err("failed to get pmic irq: %d\n", ret);
505 return;
506 }
507
508 i2c_register_board_info(0, &mx35_3ds_i2c_mc13892, 1);
509}
510
320static int mx35_3ds_otg_init(struct platform_device *pdev) 511static int mx35_3ds_otg_init(struct platform_device *pdev)
321{ 512{
322 return mx35_initialize_usb_hw(pdev->id, MXC_EHCI_INTERNAL_PHY); 513 return mx35_initialize_usb_hw(pdev->id, MXC_EHCI_INTERNAL_PHY);
@@ -412,6 +603,8 @@ static void __init mx35_3ds_init(void)
412 imx35_fb_pdev = imx35_add_mx3_sdc_fb(&mx3fb_pdata); 603 imx35_fb_pdev = imx35_add_mx3_sdc_fb(&mx3fb_pdata);
413 mx35_3ds_lcd.dev.parent = &imx35_fb_pdev->dev; 604 mx35_3ds_lcd.dev.parent = &imx35_fb_pdev->dev;
414 platform_device_register(&mx35_3ds_lcd); 605 platform_device_register(&mx35_3ds_lcd);
606
607 imx35_3ds_init_mc13892();
415} 608}
416 609
417static void __init mx35pdk_timer_init(void) 610static void __init mx35pdk_timer_init(void)
diff --git a/arch/arm/mach-kirkwood/Kconfig b/arch/arm/mach-kirkwood/Kconfig
index 90ceab761929..199764fe0fb0 100644
--- a/arch/arm/mach-kirkwood/Kconfig
+++ b/arch/arm/mach-kirkwood/Kconfig
@@ -58,6 +58,28 @@ config MACH_DREAMPLUG_DT
58 Say 'Y' here if you want your kernel to support the 58 Say 'Y' here if you want your kernel to support the
59 Marvell DreamPlug (Flattened Device Tree). 59 Marvell DreamPlug (Flattened Device Tree).
60 60
61config MACH_ICONNECT_DT
62 bool "Iomega Iconnect (Flattened Device Tree)"
63 select ARCH_KIRKWOOD_DT
64 help
65 Say 'Y' here to enable Iomega Iconnect support.
66
67config MACH_DLINK_KIRKWOOD_DT
68 bool "D-Link Kirkwood-based NAS (Flattened Device Tree)"
69 select ARCH_KIRKWOOD_DT
70 help
71 Say 'Y' here if you want your kernel to support the
72 Kirkwood-based D-Link NASes such as DNS-320 & DNS-325,
73 using Flattened Device Tree.
74
75config MACH_IB62X0_DT
76 bool "RaidSonic IB-NAS6210, IB-NAS6220 (Flattened Device Tree)"
77 select ARCH_KIRKWOOD_DT
78 help
79 Say 'Y' here if you want your kernel to support the
80 RaidSonic IB-NAS6210 & IB-NAS6220 devices, using
81 Flattened Device Tree.
82
61config MACH_TS219 83config MACH_TS219
62 bool "QNAP TS-110, TS-119, TS-119P+, TS-210, TS-219, TS-219P and TS-219P+ Turbo NAS" 84 bool "QNAP TS-110, TS-119, TS-119P+, TS-210, TS-219, TS-219P and TS-219P+ Turbo NAS"
63 help 85 help
diff --git a/arch/arm/mach-kirkwood/Makefile b/arch/arm/mach-kirkwood/Makefile
index e299a9576bf0..d2b05907b10e 100644
--- a/arch/arm/mach-kirkwood/Makefile
+++ b/arch/arm/mach-kirkwood/Makefile
@@ -22,3 +22,6 @@ obj-$(CONFIG_MACH_T5325) += t5325-setup.o
22obj-$(CONFIG_CPU_IDLE) += cpuidle.o 22obj-$(CONFIG_CPU_IDLE) += cpuidle.o
23obj-$(CONFIG_ARCH_KIRKWOOD_DT) += board-dt.o 23obj-$(CONFIG_ARCH_KIRKWOOD_DT) += board-dt.o
24obj-$(CONFIG_MACH_DREAMPLUG_DT) += board-dreamplug.o 24obj-$(CONFIG_MACH_DREAMPLUG_DT) += board-dreamplug.o
25obj-$(CONFIG_MACH_ICONNECT_DT) += board-iconnect.o
26obj-$(CONFIG_MACH_DLINK_KIRKWOOD_DT) += board-dnskw.o
27obj-$(CONFIG_MACH_IB62X0_DT) += board-ib62x0.o
diff --git a/arch/arm/mach-kirkwood/Makefile.boot b/arch/arm/mach-kirkwood/Makefile.boot
index 16f938522304..02edbdf5b065 100644
--- a/arch/arm/mach-kirkwood/Makefile.boot
+++ b/arch/arm/mach-kirkwood/Makefile.boot
@@ -3,3 +3,7 @@ params_phys-y := 0x00000100
3initrd_phys-y := 0x00800000 3initrd_phys-y := 0x00800000
4 4
5dtb-$(CONFIG_MACH_DREAMPLUG_DT) += kirkwood-dreamplug.dtb 5dtb-$(CONFIG_MACH_DREAMPLUG_DT) += kirkwood-dreamplug.dtb
6dtb-$(CONFIG_MACH_DLINK_KIRKWOOD_DT) += kirkwood-dns320.dtb
7dtb-$(CONFIG_MACH_DLINK_KIRKWOOD_DT) += kirkwood-dns325.dtb
8dtb-$(CONFIG_MACH_ICONNECT_DT) += kirkwood-iconnect.dtb
9dtb-$(CONFIG_MACH_IB62X0_DT) += kirkwood-ib62x0.dtb
diff --git a/arch/arm/mach-kirkwood/board-dnskw.c b/arch/arm/mach-kirkwood/board-dnskw.c
new file mode 100644
index 000000000000..58c2d68f9443
--- /dev/null
+++ b/arch/arm/mach-kirkwood/board-dnskw.c
@@ -0,0 +1,275 @@
1/*
2 * Copyright 2012 (C), Jamie Lentin <jm@lentin.co.uk>
3 *
4 * arch/arm/mach-kirkwood/board-dnskw.c
5 *
6 * D-link DNS-320 & DNS-325 NAS Init for drivers not converted to
7 * flattened device tree yet.
8 *
9 * This file is licensed under the terms of the GNU General Public
10 * License version 2. This program is licensed "as is" without any
11 * warranty of any kind, whether express or implied.
12 */
13
14#include <linux/kernel.h>
15#include <linux/init.h>
16#include <linux/platform_device.h>
17#include <linux/i2c.h>
18#include <linux/ata_platform.h>
19#include <linux/mv643xx_eth.h>
20#include <linux/of.h>
21#include <linux/gpio.h>
22#include <linux/input.h>
23#include <linux/gpio_keys.h>
24#include <linux/gpio-fan.h>
25#include <linux/leds.h>
26#include <asm/mach-types.h>
27#include <asm/mach/arch.h>
28#include <asm/mach/map.h>
29#include <mach/kirkwood.h>
30#include <mach/bridge-regs.h>
31#include "common.h"
32#include "mpp.h"
33
34static struct mv643xx_eth_platform_data dnskw_ge00_data = {
35 .phy_addr = MV643XX_ETH_PHY_ADDR(8),
36};
37
38static struct mv_sata_platform_data dnskw_sata_data = {
39 .n_ports = 2,
40};
41
42static unsigned int dnskw_mpp_config[] __initdata = {
43 MPP13_UART1_TXD, /* Custom ... */
44 MPP14_UART1_RXD, /* ... Controller (DNS-320 only) */
45 MPP20_SATA1_ACTn, /* LED: White Right HDD */
46 MPP21_SATA0_ACTn, /* LED: White Left HDD */
47 MPP24_GPIO,
48 MPP25_GPIO,
49 MPP26_GPIO, /* LED: Power */
50 MPP27_GPIO, /* LED: Red Right HDD */
51 MPP28_GPIO, /* LED: Red Left HDD */
52 MPP29_GPIO, /* LED: Red USB (DNS-325 only) */
53 MPP30_GPIO,
54 MPP31_GPIO,
55 MPP32_GPIO,
56 MPP33_GPO,
57 MPP34_GPIO, /* Button: Front power */
58 MPP35_GPIO, /* LED: Red USB (DNS-320 only) */
59 MPP36_GPIO, /* Power: Turn off board */
60 MPP37_GPIO, /* Power: Turn back on after power failure */
61 MPP38_GPIO,
62 MPP39_GPIO, /* Power: SATA0 */
63 MPP40_GPIO, /* Power: SATA1 */
64 MPP41_GPIO, /* SATA0 present */
65 MPP42_GPIO, /* SATA1 present */
66 MPP43_GPIO, /* LED: White USB */
67 MPP44_GPIO, /* Fan: Tachometer Pin */
68 MPP45_GPIO, /* Fan: high speed */
69 MPP46_GPIO, /* Fan: low speed */
70 MPP47_GPIO, /* Button: Back unmount */
71 MPP48_GPIO, /* Button: Back reset */
72 MPP49_GPIO, /* Temp Alarm (DNS-325) Pin of U5 (DNS-320) */
73 0
74};
75
76static struct gpio_led dns325_led_pins[] = {
77 {
78 .name = "dns325:white:power",
79 .gpio = 26,
80 .active_low = 1,
81 .default_trigger = "default-on",
82 },
83 {
84 .name = "dns325:white:usb",
85 .gpio = 43,
86 .active_low = 1,
87 },
88 {
89 .name = "dns325:red:l_hdd",
90 .gpio = 28,
91 .active_low = 1,
92 },
93 {
94 .name = "dns325:red:r_hdd",
95 .gpio = 27,
96 .active_low = 1,
97 },
98 {
99 .name = "dns325:red:usb",
100 .gpio = 29,
101 .active_low = 1,
102 },
103};
104
105static struct gpio_led_platform_data dns325_led_data = {
106 .num_leds = ARRAY_SIZE(dns325_led_pins),
107 .leds = dns325_led_pins,
108};
109
110static struct platform_device dns325_led_device = {
111 .name = "leds-gpio",
112 .id = -1,
113 .dev = {
114 .platform_data = &dns325_led_data,
115 },
116};
117
118static struct gpio_led dns320_led_pins[] = {
119 {
120 .name = "dns320:blue:power",
121 .gpio = 26,
122 .active_low = 1,
123 .default_trigger = "default-on",
124 },
125 {
126 .name = "dns320:blue:usb",
127 .gpio = 43,
128 .active_low = 1,
129 },
130 {
131 .name = "dns320:orange:l_hdd",
132 .gpio = 28,
133 .active_low = 1,
134 },
135 {
136 .name = "dns320:orange:r_hdd",
137 .gpio = 27,
138 .active_low = 1,
139 },
140 {
141 .name = "dns320:orange:usb",
142 .gpio = 35,
143 .active_low = 1,
144 },
145};
146
147static struct gpio_led_platform_data dns320_led_data = {
148 .num_leds = ARRAY_SIZE(dns320_led_pins),
149 .leds = dns320_led_pins,
150};
151
152static struct platform_device dns320_led_device = {
153 .name = "leds-gpio",
154 .id = -1,
155 .dev = {
156 .platform_data = &dns320_led_data,
157 },
158};
159
160static struct i2c_board_info dns325_i2c_board_info[] __initdata = {
161 {
162 I2C_BOARD_INFO("lm75", 0x48),
163 },
164 /* Something at 0x0c also */
165};
166
167static struct gpio_keys_button dnskw_button_pins[] = {
168 {
169 .code = KEY_POWER,
170 .gpio = 34,
171 .desc = "Power button",
172 .active_low = 1,
173 },
174 {
175 .code = KEY_EJECTCD,
176 .gpio = 47,
177 .desc = "USB unmount button",
178 .active_low = 1,
179 },
180 {
181 .code = KEY_RESTART,
182 .gpio = 48,
183 .desc = "Reset button",
184 .active_low = 1,
185 },
186};
187
188static struct gpio_keys_platform_data dnskw_button_data = {
189 .buttons = dnskw_button_pins,
190 .nbuttons = ARRAY_SIZE(dnskw_button_pins),
191};
192
193static struct platform_device dnskw_button_device = {
194 .name = "gpio-keys",
195 .id = -1,
196 .num_resources = 0,
197 .dev = {
198 .platform_data = &dnskw_button_data,
199 }
200};
201
202/* Fan: ADDA AD045HB-G73 40mm 6000rpm@5v */
203static struct gpio_fan_speed dnskw_fan_speed[] = {
204 { 0, 0 },
205 { 3000, 1 },
206 { 6000, 2 },
207};
208static unsigned dnskw_fan_pins[] = {46, 45};
209
210static struct gpio_fan_platform_data dnskw_fan_data = {
211 .num_ctrl = ARRAY_SIZE(dnskw_fan_pins),
212 .ctrl = dnskw_fan_pins,
213 .num_speed = ARRAY_SIZE(dnskw_fan_speed),
214 .speed = dnskw_fan_speed,
215};
216
217static struct platform_device dnskw_fan_device = {
218 .name = "gpio-fan",
219 .id = -1,
220 .dev = {
221 .platform_data = &dnskw_fan_data,
222 },
223};
224
225static void dnskw_power_off(void)
226{
227 gpio_set_value(36, 1);
228}
229
230/* Register any GPIO for output and set the value */
231static void __init dnskw_gpio_register(unsigned gpio, char *name, int def)
232{
233 if (gpio_request(gpio, name) == 0 &&
234 gpio_direction_output(gpio, 0) == 0) {
235 gpio_set_value(gpio, def);
236 if (gpio_export(gpio, 0) != 0)
237 pr_err("dnskw: Failed to export GPIO %s\n", name);
238 } else
239 pr_err("dnskw: Failed to register %s\n", name);
240}
241
242void __init dnskw_init(void)
243{
244 kirkwood_mpp_conf(dnskw_mpp_config);
245
246 kirkwood_ehci_init();
247 kirkwood_ge00_init(&dnskw_ge00_data);
248 kirkwood_sata_init(&dnskw_sata_data);
249 kirkwood_i2c_init();
250
251 platform_device_register(&dnskw_button_device);
252 platform_device_register(&dnskw_fan_device);
253
254 if (of_machine_is_compatible("dlink,dns-325")) {
255 i2c_register_board_info(0, dns325_i2c_board_info,
256 ARRAY_SIZE(dns325_i2c_board_info));
257 platform_device_register(&dns325_led_device);
258
259 } else if (of_machine_is_compatible("dlink,dns-320"))
260 platform_device_register(&dns320_led_device);
261
262 /* Register power-off GPIO. */
263 if (gpio_request(36, "dnskw:power:off") == 0
264 && gpio_direction_output(36, 0) == 0)
265 pm_power_off = dnskw_power_off;
266 else
267 pr_err("dnskw: failed to configure power-off GPIO\n");
268
269 /* Ensure power is supplied to both HDDs */
270 dnskw_gpio_register(39, "dnskw:power:sata0", 1);
271 dnskw_gpio_register(40, "dnskw:power:sata1", 1);
272
273 /* Set NAS to turn back on after a power failure */
274 dnskw_gpio_register(37, "dnskw:power:recover", 1);
275}
diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
index f7fe1b9f3170..10d1969b9e3a 100644
--- a/arch/arm/mach-kirkwood/board-dt.c
+++ b/arch/arm/mach-kirkwood/board-dt.c
@@ -56,11 +56,24 @@ static void __init kirkwood_dt_init(void)
56 if (of_machine_is_compatible("globalscale,dreamplug")) 56 if (of_machine_is_compatible("globalscale,dreamplug"))
57 dreamplug_init(); 57 dreamplug_init();
58 58
59 if (of_machine_is_compatible("dlink,dns-kirkwood"))
60 dnskw_init();
61
62 if (of_machine_is_compatible("iom,iconnect"))
63 iconnect_init();
64
65 if (of_machine_is_compatible("raidsonic,ib-nas62x0"))
66 ib62x0_init();
67
59 of_platform_populate(NULL, kirkwood_dt_match_table, NULL, NULL); 68 of_platform_populate(NULL, kirkwood_dt_match_table, NULL, NULL);
60} 69}
61 70
62static const char *kirkwood_dt_board_compat[] = { 71static const char *kirkwood_dt_board_compat[] = {
63 "globalscale,dreamplug", 72 "globalscale,dreamplug",
73 "dlink,dns-320",
74 "dlink,dns-325",
75 "iom,iconnect",
76 "raidsonic,ib-nas62x0",
64 NULL 77 NULL
65}; 78};
66 79
diff --git a/arch/arm/mach-kirkwood/board-ib62x0.c b/arch/arm/mach-kirkwood/board-ib62x0.c
new file mode 100644
index 000000000000..eddf1df8891f
--- /dev/null
+++ b/arch/arm/mach-kirkwood/board-ib62x0.c
@@ -0,0 +1,143 @@
1/*
2 * Copyright 2012 (C), Simon Baatz <gmbnomis@gmail.com>
3 *
4 * arch/arm/mach-kirkwood/board-ib62x0.c
5 *
6 * RaidSonic ICY BOX IB-NAS6210 & IB-NAS6220 init for drivers not
7 * converted to flattened device tree yet.
8 *
9 * This file is licensed under the terms of the GNU General Public
10 * License version 2. This program is licensed "as is" without any
11 * warranty of any kind, whether express or implied.
12 */
13
14#include <linux/kernel.h>
15#include <linux/init.h>
16#include <linux/platform_device.h>
17#include <linux/mtd/partitions.h>
18#include <linux/ata_platform.h>
19#include <linux/mv643xx_eth.h>
20#include <linux/gpio.h>
21#include <linux/gpio_keys.h>
22#include <linux/input.h>
23#include <linux/leds.h>
24#include <asm/mach-types.h>
25#include <asm/mach/arch.h>
26#include <mach/kirkwood.h>
27#include "common.h"
28#include "mpp.h"
29
30#define IB62X0_GPIO_POWER_OFF 24
31
32static struct mv643xx_eth_platform_data ib62x0_ge00_data = {
33 .phy_addr = MV643XX_ETH_PHY_ADDR(8),
34};
35
36static struct mv_sata_platform_data ib62x0_sata_data = {
37 .n_ports = 2,
38};
39
40static unsigned int ib62x0_mpp_config[] __initdata = {
41 MPP0_NF_IO2,
42 MPP1_NF_IO3,
43 MPP2_NF_IO4,
44 MPP3_NF_IO5,
45 MPP4_NF_IO6,
46 MPP5_NF_IO7,
47 MPP18_NF_IO0,
48 MPP19_NF_IO1,
49 MPP22_GPIO, /* OS LED red */
50 MPP24_GPIO, /* Power off device */
51 MPP25_GPIO, /* OS LED green */
52 MPP27_GPIO, /* USB transfer LED */
53 MPP28_GPIO, /* Reset button */
54 MPP29_GPIO, /* USB Copy button */
55 0
56};
57
58static struct gpio_led ib62x0_led_pins[] = {
59 {
60 .name = "ib62x0:green:os",
61 .default_trigger = "default-on",
62 .gpio = 25,
63 .active_low = 0,
64 },
65 {
66 .name = "ib62x0:red:os",
67 .default_trigger = "none",
68 .gpio = 22,
69 .active_low = 0,
70 },
71 {
72 .name = "ib62x0:red:usb_copy",
73 .default_trigger = "none",
74 .gpio = 27,
75 .active_low = 0,
76 },
77};
78
79static struct gpio_led_platform_data ib62x0_led_data = {
80 .leds = ib62x0_led_pins,
81 .num_leds = ARRAY_SIZE(ib62x0_led_pins),
82};
83
84static struct platform_device ib62x0_led_device = {
85 .name = "leds-gpio",
86 .id = -1,
87 .dev = {
88 .platform_data = &ib62x0_led_data,
89 }
90};
91
92static struct gpio_keys_button ib62x0_button_pins[] = {
93 {
94 .code = KEY_COPY,
95 .gpio = 29,
96 .desc = "USB Copy",
97 .active_low = 1,
98 },
99 {
100 .code = KEY_RESTART,
101 .gpio = 28,
102 .desc = "Reset",
103 .active_low = 1,
104 },
105};
106
107static struct gpio_keys_platform_data ib62x0_button_data = {
108 .buttons = ib62x0_button_pins,
109 .nbuttons = ARRAY_SIZE(ib62x0_button_pins),
110};
111
112static struct platform_device ib62x0_button_device = {
113 .name = "gpio-keys",
114 .id = -1,
115 .num_resources = 0,
116 .dev = {
117 .platform_data = &ib62x0_button_data,
118 }
119};
120
121static void ib62x0_power_off(void)
122{
123 gpio_set_value(IB62X0_GPIO_POWER_OFF, 1);
124}
125
126void __init ib62x0_init(void)
127{
128 /*
129 * Basic setup. Needs to be called early.
130 */
131 kirkwood_mpp_conf(ib62x0_mpp_config);
132
133 kirkwood_ehci_init();
134 kirkwood_ge00_init(&ib62x0_ge00_data);
135 kirkwood_sata_init(&ib62x0_sata_data);
136 platform_device_register(&ib62x0_led_device);
137 platform_device_register(&ib62x0_button_device);
138 if (gpio_request(IB62X0_GPIO_POWER_OFF, "ib62x0:power:off") == 0 &&
139 gpio_direction_output(IB62X0_GPIO_POWER_OFF, 0) == 0)
140 pm_power_off = ib62x0_power_off;
141 else
142 pr_err("board-ib62x0: failed to configure power-off GPIO\n");
143}
diff --git a/arch/arm/mach-kirkwood/board-iconnect.c b/arch/arm/mach-kirkwood/board-iconnect.c
new file mode 100644
index 000000000000..2222c5739519
--- /dev/null
+++ b/arch/arm/mach-kirkwood/board-iconnect.c
@@ -0,0 +1,165 @@
1/*
2 * arch/arm/mach-kirkwood/board-iconnect.c
3 *
4 * Iomega i-connect Board Setup
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/platform_device.h>
14#include <linux/of.h>
15#include <linux/of_address.h>
16#include <linux/of_fdt.h>
17#include <linux/of_irq.h>
18#include <linux/of_platform.h>
19#include <linux/mtd/partitions.h>
20#include <linux/mv643xx_eth.h>
21#include <linux/gpio.h>
22#include <linux/leds.h>
23#include <linux/spi/flash.h>
24#include <linux/spi/spi.h>
25#include <linux/spi/orion_spi.h>
26#include <linux/i2c.h>
27#include <linux/input.h>
28#include <linux/gpio_keys.h>
29#include <asm/mach/arch.h>
30#include <mach/kirkwood.h>
31#include "common.h"
32#include "mpp.h"
33
34static struct mv643xx_eth_platform_data iconnect_ge00_data = {
35 .phy_addr = MV643XX_ETH_PHY_ADDR(11),
36};
37
38static struct gpio_led iconnect_led_pins[] = {
39 {
40 .name = "led_level",
41 .gpio = 41,
42 .default_trigger = "default-on",
43 }, {
44 .name = "power:blue",
45 .gpio = 42,
46 .default_trigger = "timer",
47 }, {
48 .name = "power:red",
49 .gpio = 43,
50 }, {
51 .name = "usb1:blue",
52 .gpio = 44,
53 }, {
54 .name = "usb2:blue",
55 .gpio = 45,
56 }, {
57 .name = "usb3:blue",
58 .gpio = 46,
59 }, {
60 .name = "usb4:blue",
61 .gpio = 47,
62 }, {
63 .name = "otb:blue",
64 .gpio = 48,
65 },
66};
67
68static struct gpio_led_platform_data iconnect_led_data = {
69 .leds = iconnect_led_pins,
70 .num_leds = ARRAY_SIZE(iconnect_led_pins),
71 .gpio_blink_set = orion_gpio_led_blink_set,
72};
73
74static struct platform_device iconnect_leds = {
75 .name = "leds-gpio",
76 .id = -1,
77 .dev = {
78 .platform_data = &iconnect_led_data,
79 }
80};
81
82static unsigned int iconnect_mpp_config[] __initdata = {
83 MPP12_GPIO,
84 MPP35_GPIO,
85 MPP41_GPIO,
86 MPP42_GPIO,
87 MPP43_GPIO,
88 MPP44_GPIO,
89 MPP45_GPIO,
90 MPP46_GPIO,
91 MPP47_GPIO,
92 MPP48_GPIO,
93 0
94};
95
96static struct i2c_board_info __initdata iconnect_board_info[] = {
97 {
98 I2C_BOARD_INFO("lm63", 0x4c),
99 },
100};
101
102static struct mtd_partition iconnect_nand_parts[] = {
103 {
104 .name = "flash",
105 .offset = 0,
106 .size = MTDPART_SIZ_FULL,
107 },
108};
109
110/* yikes... theses are the original input buttons */
111/* but I'm not convinced by the sw event choices */
112static struct gpio_keys_button iconnect_buttons[] = {
113 {
114 .type = EV_SW,
115 .code = SW_LID,
116 .gpio = 12,
117 .desc = "Reset Button",
118 .active_low = 1,
119 .debounce_interval = 100,
120 }, {
121 .type = EV_SW,
122 .code = SW_TABLET_MODE,
123 .gpio = 35,
124 .desc = "OTB Button",
125 .active_low = 1,
126 .debounce_interval = 100,
127 },
128};
129
130static struct gpio_keys_platform_data iconnect_button_data = {
131 .buttons = iconnect_buttons,
132 .nbuttons = ARRAY_SIZE(iconnect_buttons),
133};
134
135static struct platform_device iconnect_button_device = {
136 .name = "gpio-keys",
137 .id = -1,
138 .num_resources = 0,
139 .dev = {
140 .platform_data = &iconnect_button_data,
141 },
142};
143
144void __init iconnect_init(void)
145{
146 kirkwood_mpp_conf(iconnect_mpp_config);
147 kirkwood_nand_init(ARRAY_AND_SIZE(iconnect_nand_parts), 25);
148 kirkwood_i2c_init();
149 i2c_register_board_info(0, iconnect_board_info,
150 ARRAY_SIZE(iconnect_board_info));
151
152 kirkwood_ehci_init();
153 kirkwood_ge00_init(&iconnect_ge00_data);
154
155 platform_device_register(&iconnect_button_device);
156 platform_device_register(&iconnect_leds);
157}
158
159static int __init iconnect_pci_init(void)
160{
161 if (of_machine_is_compatible("iom,iconnect"))
162 kirkwood_pcie_init(KW_PCIE0);
163 return 0;
164}
165subsys_initcall(iconnect_pci_init);
diff --git a/arch/arm/mach-kirkwood/common.c b/arch/arm/mach-kirkwood/common.c
index a02cae881f2f..3ad037385a5e 100644
--- a/arch/arm/mach-kirkwood/common.c
+++ b/arch/arm/mach-kirkwood/common.c
@@ -15,6 +15,7 @@
15#include <linux/ata_platform.h> 15#include <linux/ata_platform.h>
16#include <linux/mtd/nand.h> 16#include <linux/mtd/nand.h>
17#include <linux/dma-mapping.h> 17#include <linux/dma-mapping.h>
18#include <linux/of.h>
18#include <net/dsa.h> 19#include <net/dsa.h>
19#include <asm/page.h> 20#include <asm/page.h>
20#include <asm/timex.h> 21#include <asm/timex.h>
@@ -482,6 +483,9 @@ static int __init kirkwood_clock_gate(void)
482 unsigned int curr = readl(CLOCK_GATING_CTRL); 483 unsigned int curr = readl(CLOCK_GATING_CTRL);
483 u32 dev, rev; 484 u32 dev, rev;
484 485
486#ifdef CONFIG_OF
487 struct device_node *np;
488#endif
485 kirkwood_pcie_id(&dev, &rev); 489 kirkwood_pcie_id(&dev, &rev);
486 printk(KERN_DEBUG "Gating clock of unused units\n"); 490 printk(KERN_DEBUG "Gating clock of unused units\n");
487 printk(KERN_DEBUG "before: 0x%08x\n", curr); 491 printk(KERN_DEBUG "before: 0x%08x\n", curr);
@@ -489,6 +493,14 @@ static int __init kirkwood_clock_gate(void)
489 /* Make sure those units are accessible */ 493 /* Make sure those units are accessible */
490 writel(curr | CGC_SATA0 | CGC_SATA1 | CGC_PEX0 | CGC_PEX1, CLOCK_GATING_CTRL); 494 writel(curr | CGC_SATA0 | CGC_SATA1 | CGC_PEX0 | CGC_PEX1, CLOCK_GATING_CTRL);
491 495
496#ifdef CONFIG_OF
497 np = of_find_compatible_node(NULL, NULL, "mrvl,orion-nand");
498 if (np && of_device_is_available(np)) {
499 kirkwood_clk_ctrl |= CGC_RUNIT;
500 of_node_put(np);
501 }
502#endif
503
492 /* For SATA: first shutdown the phy */ 504 /* For SATA: first shutdown the phy */
493 if (!(kirkwood_clk_ctrl & CGC_SATA0)) { 505 if (!(kirkwood_clk_ctrl & CGC_SATA0)) {
494 /* Disable PLL and IVREF */ 506 /* Disable PLL and IVREF */
diff --git a/arch/arm/mach-kirkwood/common.h b/arch/arm/mach-kirkwood/common.h
index fa8e7689c436..a34c41a5172e 100644
--- a/arch/arm/mach-kirkwood/common.h
+++ b/arch/arm/mach-kirkwood/common.h
@@ -58,6 +58,24 @@ void dreamplug_init(void);
58static inline void dreamplug_init(void) {}; 58static inline void dreamplug_init(void) {};
59#endif 59#endif
60 60
61#ifdef CONFIG_MACH_DLINK_KIRKWOOD_DT
62void dnskw_init(void);
63#else
64static inline void dnskw_init(void) {};
65#endif
66
67#ifdef CONFIG_MACH_ICONNECT_DT
68void iconnect_init(void);
69#else
70static inline void iconnect_init(void) {};
71#endif
72
73#ifdef CONFIG_MACH_IB62X0_DT
74void ib62x0_init(void);
75#else
76static inline void ib62x0_init(void) {};
77#endif
78
61/* early init functions not converted to fdt yet */ 79/* early init functions not converted to fdt yet */
62char *kirkwood_id(void); 80char *kirkwood_id(void);
63void kirkwood_l2_init(void); 81void kirkwood_l2_init(void);
diff --git a/arch/arm/mach-mmp/Kconfig b/arch/arm/mach-mmp/Kconfig
index ede721628150..7fddd01b85b9 100644
--- a/arch/arm/mach-mmp/Kconfig
+++ b/arch/arm/mach-mmp/Kconfig
@@ -122,4 +122,11 @@ config CPU_MMP2
122 select CPU_PJ4 122 select CPU_PJ4
123 help 123 help
124 Select code specific to MMP2. MMP2 is ARMv7 compatible. 124 Select code specific to MMP2. MMP2 is ARMv7 compatible.
125
126config USB_EHCI_MV_U2O
127 bool "EHCI support for PXA USB OTG controller"
128 depends on USB_EHCI_MV
129 help
130 Enables support for OTG controller which can be switched to host mode.
131
125endif 132endif
diff --git a/arch/arm/mach-mmp/aspenite.c b/arch/arm/mach-mmp/aspenite.c
index bf5d8e195c3e..223090b1444d 100644
--- a/arch/arm/mach-mmp/aspenite.c
+++ b/arch/arm/mach-mmp/aspenite.c
@@ -17,6 +17,7 @@
17#include <linux/mtd/partitions.h> 17#include <linux/mtd/partitions.h>
18#include <linux/mtd/nand.h> 18#include <linux/mtd/nand.h>
19#include <linux/interrupt.h> 19#include <linux/interrupt.h>
20#include <linux/platform_data/mv_usb.h>
20 21
21#include <asm/mach-types.h> 22#include <asm/mach-types.h>
22#include <asm/mach/arch.h> 23#include <asm/mach/arch.h>
@@ -221,6 +222,21 @@ static struct pxa27x_keypad_platform_data aspenite_keypad_info __initdata = {
221 .debounce_interval = 30, 222 .debounce_interval = 30,
222}; 223};
223 224
225#if defined(CONFIG_USB_EHCI_MV)
226static char *pxa168_sph_clock_name[] = {
227 [0] = "PXA168-USBCLK",
228};
229
230static struct mv_usb_platform_data pxa168_sph_pdata = {
231 .clknum = 1,
232 .clkname = pxa168_sph_clock_name,
233 .mode = MV_USB_MODE_HOST,
234 .phy_init = pxa_usb_phy_init,
235 .phy_deinit = pxa_usb_phy_deinit,
236 .set_vbus = NULL,
237};
238#endif
239
224static void __init common_init(void) 240static void __init common_init(void)
225{ 241{
226 mfp_config(ARRAY_AND_SIZE(common_pin_config)); 242 mfp_config(ARRAY_AND_SIZE(common_pin_config));
@@ -236,6 +252,10 @@ static void __init common_init(void)
236 252
237 /* off-chip devices */ 253 /* off-chip devices */
238 platform_device_register(&smc91x_device); 254 platform_device_register(&smc91x_device);
255
256#if defined(CONFIG_USB_EHCI_MV)
257 pxa168_add_usb_host(&pxa168_sph_pdata);
258#endif
239} 259}
240 260
241MACHINE_START(ASPENITE, "PXA168-based Aspenite Development Platform") 261MACHINE_START(ASPENITE, "PXA168-based Aspenite Development Platform")
diff --git a/arch/arm/mach-mmp/devices.c b/arch/arm/mach-mmp/devices.c
index 191d9dea8731..dd2d8b103cc8 100644
--- a/arch/arm/mach-mmp/devices.c
+++ b/arch/arm/mach-mmp/devices.c
@@ -9,9 +9,13 @@
9#include <linux/init.h> 9#include <linux/init.h>
10#include <linux/platform_device.h> 10#include <linux/platform_device.h>
11#include <linux/dma-mapping.h> 11#include <linux/dma-mapping.h>
12#include <linux/delay.h>
12 13
13#include <asm/irq.h> 14#include <asm/irq.h>
15#include <mach/irqs.h>
14#include <mach/devices.h> 16#include <mach/devices.h>
17#include <mach/cputype.h>
18#include <mach/regs-usb.h>
15 19
16int __init pxa_register_device(struct pxa_device_desc *desc, 20int __init pxa_register_device(struct pxa_device_desc *desc,
17 void *data, size_t size) 21 void *data, size_t size)
@@ -67,3 +71,281 @@ int __init pxa_register_device(struct pxa_device_desc *desc,
67 71
68 return platform_device_add(pdev); 72 return platform_device_add(pdev);
69} 73}
74
75#if defined(CONFIG_USB) || defined(CONFIG_USB_GADGET)
76
77/*****************************************************************************
78 * The registers read/write routines
79 *****************************************************************************/
80
81static unsigned int u2o_get(void __iomem *base, unsigned int offset)
82{
83 return readl_relaxed(base + offset);
84}
85
86static void u2o_set(void __iomem *base, unsigned int offset,
87 unsigned int value)
88{
89 u32 reg;
90
91 reg = readl_relaxed(base + offset);
92 reg |= value;
93 writel_relaxed(reg, base + offset);
94 readl_relaxed(base + offset);
95}
96
97static void u2o_clear(void __iomem *base, unsigned int offset,
98 unsigned int value)
99{
100 u32 reg;
101
102 reg = readl_relaxed(base + offset);
103 reg &= ~value;
104 writel_relaxed(reg, base + offset);
105 readl_relaxed(base + offset);
106}
107
108static void u2o_write(void __iomem *base, unsigned int offset,
109 unsigned int value)
110{
111 writel_relaxed(value, base + offset);
112 readl_relaxed(base + offset);
113}
114
115#if defined(CONFIG_USB_MV_UDC) || defined(CONFIG_USB_EHCI_MV)
116
117#if defined(CONFIG_CPU_PXA910) || defined(CONFIG_CPU_PXA168)
118
119static DEFINE_MUTEX(phy_lock);
120static int phy_init_cnt;
121
122static int usb_phy_init_internal(void __iomem *base)
123{
124 int loops;
125
126 pr_info("Init usb phy!!!\n");
127
128 /* Initialize the USB PHY power */
129 if (cpu_is_pxa910()) {
130 u2o_set(base, UTMI_CTRL, (1<<UTMI_CTRL_INPKT_DELAY_SOF_SHIFT)
131 | (1<<UTMI_CTRL_PU_REF_SHIFT));
132 }
133
134 u2o_set(base, UTMI_CTRL, 1<<UTMI_CTRL_PLL_PWR_UP_SHIFT);
135 u2o_set(base, UTMI_CTRL, 1<<UTMI_CTRL_PWR_UP_SHIFT);
136
137 /* UTMI_PLL settings */
138 u2o_clear(base, UTMI_PLL, UTMI_PLL_PLLVDD18_MASK
139 | UTMI_PLL_PLLVDD12_MASK | UTMI_PLL_PLLCALI12_MASK
140 | UTMI_PLL_FBDIV_MASK | UTMI_PLL_REFDIV_MASK
141 | UTMI_PLL_ICP_MASK | UTMI_PLL_KVCO_MASK);
142
143 u2o_set(base, UTMI_PLL, 0xee<<UTMI_PLL_FBDIV_SHIFT
144 | 0xb<<UTMI_PLL_REFDIV_SHIFT | 3<<UTMI_PLL_PLLVDD18_SHIFT
145 | 3<<UTMI_PLL_PLLVDD12_SHIFT | 3<<UTMI_PLL_PLLCALI12_SHIFT
146 | 1<<UTMI_PLL_ICP_SHIFT | 3<<UTMI_PLL_KVCO_SHIFT);
147
148 /* UTMI_TX */
149 u2o_clear(base, UTMI_TX, UTMI_TX_REG_EXT_FS_RCAL_EN_MASK
150 | UTMI_TX_TXVDD12_MASK | UTMI_TX_CK60_PHSEL_MASK
151 | UTMI_TX_IMPCAL_VTH_MASK | UTMI_TX_REG_EXT_FS_RCAL_MASK
152 | UTMI_TX_AMP_MASK);
153 u2o_set(base, UTMI_TX, 3<<UTMI_TX_TXVDD12_SHIFT
154 | 4<<UTMI_TX_CK60_PHSEL_SHIFT | 4<<UTMI_TX_IMPCAL_VTH_SHIFT
155 | 8<<UTMI_TX_REG_EXT_FS_RCAL_SHIFT | 3<<UTMI_TX_AMP_SHIFT);
156
157 /* UTMI_RX */
158 u2o_clear(base, UTMI_RX, UTMI_RX_SQ_THRESH_MASK
159 | UTMI_REG_SQ_LENGTH_MASK);
160 u2o_set(base, UTMI_RX, 7<<UTMI_RX_SQ_THRESH_SHIFT
161 | 2<<UTMI_REG_SQ_LENGTH_SHIFT);
162
163 /* UTMI_IVREF */
164 if (cpu_is_pxa168())
165 /* fixing Microsoft Altair board interface with NEC hub issue -
166 * Set UTMI_IVREF from 0x4a3 to 0x4bf */
167 u2o_write(base, UTMI_IVREF, 0x4bf);
168
169 /* toggle VCOCAL_START bit of UTMI_PLL */
170 udelay(200);
171 u2o_set(base, UTMI_PLL, VCOCAL_START);
172 udelay(40);
173 u2o_clear(base, UTMI_PLL, VCOCAL_START);
174
175 /* toggle REG_RCAL_START bit of UTMI_TX */
176 udelay(400);
177 u2o_set(base, UTMI_TX, REG_RCAL_START);
178 udelay(40);
179 u2o_clear(base, UTMI_TX, REG_RCAL_START);
180 udelay(400);
181
182 /* Make sure PHY PLL is ready */
183 loops = 0;
184 while ((u2o_get(base, UTMI_PLL) & PLL_READY) == 0) {
185 mdelay(1);
186 loops++;
187 if (loops > 100) {
188 printk(KERN_WARNING "calibrate timeout, UTMI_PLL %x\n",
189 u2o_get(base, UTMI_PLL));
190 break;
191 }
192 }
193
194 if (cpu_is_pxa168()) {
195 u2o_set(base, UTMI_RESERVE, 1 << 5);
196 /* Turn on UTMI PHY OTG extension */
197 u2o_write(base, UTMI_OTG_ADDON, 1);
198 }
199
200 return 0;
201}
202
203static int usb_phy_deinit_internal(void __iomem *base)
204{
205 pr_info("Deinit usb phy!!!\n");
206
207 if (cpu_is_pxa168())
208 u2o_clear(base, UTMI_OTG_ADDON, UTMI_OTG_ADDON_OTG_ON);
209
210 u2o_clear(base, UTMI_CTRL, UTMI_CTRL_RXBUF_PDWN);
211 u2o_clear(base, UTMI_CTRL, UTMI_CTRL_TXBUF_PDWN);
212 u2o_clear(base, UTMI_CTRL, UTMI_CTRL_USB_CLK_EN);
213 u2o_clear(base, UTMI_CTRL, 1<<UTMI_CTRL_PWR_UP_SHIFT);
214 u2o_clear(base, UTMI_CTRL, 1<<UTMI_CTRL_PLL_PWR_UP_SHIFT);
215
216 return 0;
217}
218
219int pxa_usb_phy_init(void __iomem *phy_reg)
220{
221 mutex_lock(&phy_lock);
222 if (phy_init_cnt++ == 0)
223 usb_phy_init_internal(phy_reg);
224 mutex_unlock(&phy_lock);
225 return 0;
226}
227
228void pxa_usb_phy_deinit(void __iomem *phy_reg)
229{
230 WARN_ON(phy_init_cnt == 0);
231
232 mutex_lock(&phy_lock);
233 if (--phy_init_cnt == 0)
234 usb_phy_deinit_internal(phy_reg);
235 mutex_unlock(&phy_lock);
236}
237#endif
238#endif
239#endif
240
241#ifdef CONFIG_USB_SUPPORT
242static u64 usb_dma_mask = ~(u32)0;
243
244#ifdef CONFIG_USB_MV_UDC
245struct resource pxa168_u2o_resources[] = {
246 /* regbase */
247 [0] = {
248 .start = PXA168_U2O_REGBASE + U2x_CAPREGS_OFFSET,
249 .end = PXA168_U2O_REGBASE + USB_REG_RANGE,
250 .flags = IORESOURCE_MEM,
251 .name = "capregs",
252 },
253 /* phybase */
254 [1] = {
255 .start = PXA168_U2O_PHYBASE,
256 .end = PXA168_U2O_PHYBASE + USB_PHY_RANGE,
257 .flags = IORESOURCE_MEM,
258 .name = "phyregs",
259 },
260 [2] = {
261 .start = IRQ_PXA168_USB1,
262 .end = IRQ_PXA168_USB1,
263 .flags = IORESOURCE_IRQ,
264 },
265};
266
267struct platform_device pxa168_device_u2o = {
268 .name = "mv-udc",
269 .id = -1,
270 .resource = pxa168_u2o_resources,
271 .num_resources = ARRAY_SIZE(pxa168_u2o_resources),
272 .dev = {
273 .dma_mask = &usb_dma_mask,
274 .coherent_dma_mask = 0xffffffff,
275 }
276};
277#endif /* CONFIG_USB_MV_UDC */
278
279#ifdef CONFIG_USB_EHCI_MV_U2O
280struct resource pxa168_u2oehci_resources[] = {
281 /* regbase */
282 [0] = {
283 .start = PXA168_U2O_REGBASE + U2x_CAPREGS_OFFSET,
284 .end = PXA168_U2O_REGBASE + USB_REG_RANGE,
285 .flags = IORESOURCE_MEM,
286 .name = "capregs",
287 },
288 /* phybase */
289 [1] = {
290 .start = PXA168_U2O_PHYBASE,
291 .end = PXA168_U2O_PHYBASE + USB_PHY_RANGE,
292 .flags = IORESOURCE_MEM,
293 .name = "phyregs",
294 },
295 [2] = {
296 .start = IRQ_PXA168_USB1,
297 .end = IRQ_PXA168_USB1,
298 .flags = IORESOURCE_IRQ,
299 },
300};
301
302struct platform_device pxa168_device_u2oehci = {
303 .name = "pxa-u2oehci",
304 .id = -1,
305 .dev = {
306 .dma_mask = &usb_dma_mask,
307 .coherent_dma_mask = 0xffffffff,
308 },
309
310 .num_resources = ARRAY_SIZE(pxa168_u2oehci_resources),
311 .resource = pxa168_u2oehci_resources,
312};
313#endif
314
315#if defined(CONFIG_USB_MV_OTG)
316struct resource pxa168_u2ootg_resources[] = {
317 /* regbase */
318 [0] = {
319 .start = PXA168_U2O_REGBASE + U2x_CAPREGS_OFFSET,
320 .end = PXA168_U2O_REGBASE + USB_REG_RANGE,
321 .flags = IORESOURCE_MEM,
322 .name = "capregs",
323 },
324 /* phybase */
325 [1] = {
326 .start = PXA168_U2O_PHYBASE,
327 .end = PXA168_U2O_PHYBASE + USB_PHY_RANGE,
328 .flags = IORESOURCE_MEM,
329 .name = "phyregs",
330 },
331 [2] = {
332 .start = IRQ_PXA168_USB1,
333 .end = IRQ_PXA168_USB1,
334 .flags = IORESOURCE_IRQ,
335 },
336};
337
338struct platform_device pxa168_device_u2ootg = {
339 .name = "mv-otg",
340 .id = -1,
341 .dev = {
342 .dma_mask = &usb_dma_mask,
343 .coherent_dma_mask = 0xffffffff,
344 },
345
346 .num_resources = ARRAY_SIZE(pxa168_u2ootg_resources),
347 .resource = pxa168_u2ootg_resources,
348};
349#endif /* CONFIG_USB_MV_OTG */
350
351#endif
diff --git a/arch/arm/mach-mmp/include/mach/devices.h b/arch/arm/mach-mmp/include/mach/devices.h
index d0ec7dae88e4..21217ef11b64 100644
--- a/arch/arm/mach-mmp/include/mach/devices.h
+++ b/arch/arm/mach-mmp/include/mach/devices.h
@@ -50,4 +50,7 @@ struct pxa_device_desc mmp2_device_##_name __initdata = { \
50} 50}
51 51
52extern int pxa_register_device(struct pxa_device_desc *, void *, size_t); 52extern int pxa_register_device(struct pxa_device_desc *, void *, size_t);
53extern int pxa_usb_phy_init(void __iomem *phy_reg);
54extern void pxa_usb_phy_deinit(void __iomem *phy_reg);
55
53#endif /* __MACH_DEVICE_H */ 56#endif /* __MACH_DEVICE_H */
diff --git a/arch/arm/mach-mmp/include/mach/pxa168.h b/arch/arm/mach-mmp/include/mach/pxa168.h
index dc03d580a06d..09dcd6e2b6a8 100644
--- a/arch/arm/mach-mmp/include/mach/pxa168.h
+++ b/arch/arm/mach-mmp/include/mach/pxa168.h
@@ -16,6 +16,7 @@ extern void pxa168_clear_keypad_wakeup(void);
16#include <plat/pxa27x_keypad.h> 16#include <plat/pxa27x_keypad.h>
17#include <mach/cputype.h> 17#include <mach/cputype.h>
18#include <linux/pxa168_eth.h> 18#include <linux/pxa168_eth.h>
19#include <linux/platform_data/mv_usb.h>
19 20
20extern struct pxa_device_desc pxa168_device_uart1; 21extern struct pxa_device_desc pxa168_device_uart1;
21extern struct pxa_device_desc pxa168_device_uart2; 22extern struct pxa_device_desc pxa168_device_uart2;
@@ -36,12 +37,9 @@ extern struct pxa_device_desc pxa168_device_fb;
36extern struct pxa_device_desc pxa168_device_keypad; 37extern struct pxa_device_desc pxa168_device_keypad;
37extern struct pxa_device_desc pxa168_device_eth; 38extern struct pxa_device_desc pxa168_device_eth;
38 39
39struct pxa168_usb_pdata {
40 /* If NULL, default phy init routine for PXA168 would be called */
41 int (*phy_init)(void __iomem *usb_phy_reg_base);
42};
43/* pdata can be NULL */ 40/* pdata can be NULL */
44int __init pxa168_add_usb_host(struct pxa168_usb_pdata *pdata); 41extern int __init pxa168_add_usb_host(struct mv_usb_platform_data *pdata);
42
45 43
46extern struct platform_device pxa168_device_gpio; 44extern struct platform_device pxa168_device_gpio;
47 45
diff --git a/arch/arm/mach-mmp/include/mach/pxa910.h b/arch/arm/mach-mmp/include/mach/pxa910.h
index e2e1f1e5e124..793634c837ef 100644
--- a/arch/arm/mach-mmp/include/mach/pxa910.h
+++ b/arch/arm/mach-mmp/include/mach/pxa910.h
@@ -20,6 +20,9 @@ extern struct pxa_device_desc pxa910_device_pwm2;
20extern struct pxa_device_desc pxa910_device_pwm3; 20extern struct pxa_device_desc pxa910_device_pwm3;
21extern struct pxa_device_desc pxa910_device_pwm4; 21extern struct pxa_device_desc pxa910_device_pwm4;
22extern struct pxa_device_desc pxa910_device_nand; 22extern struct pxa_device_desc pxa910_device_nand;
23extern struct platform_device pxa168_device_u2o;
24extern struct platform_device pxa168_device_u2ootg;
25extern struct platform_device pxa168_device_u2oehci;
23 26
24extern struct platform_device pxa910_device_gpio; 27extern struct platform_device pxa910_device_gpio;
25extern struct platform_device pxa910_device_rtc; 28extern struct platform_device pxa910_device_rtc;
diff --git a/arch/arm/mach-mmp/include/mach/regs-usb.h b/arch/arm/mach-mmp/include/mach/regs-usb.h
new file mode 100644
index 000000000000..b047bf487506
--- /dev/null
+++ b/arch/arm/mach-mmp/include/mach/regs-usb.h
@@ -0,0 +1,253 @@
1/*
2 * Copyright (C) 2011 Marvell International Ltd. All rights reserved.
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2 of the License, or (at your
7 * option) any later version.
8 */
9
10#ifndef __ASM_ARCH_REGS_USB_H
11#define __ASM_ARCH_REGS_USB_H
12
13#define PXA168_U2O_REGBASE (0xd4208000)
14#define PXA168_U2O_PHYBASE (0xd4207000)
15
16#define PXA168_U2H_REGBASE (0xd4209000)
17#define PXA168_U2H_PHYBASE (0xd4206000)
18
19#define MMP3_HSIC1_REGBASE (0xf0001000)
20#define MMP3_HSIC1_PHYBASE (0xf0001800)
21
22#define MMP3_HSIC2_REGBASE (0xf0002000)
23#define MMP3_HSIC2_PHYBASE (0xf0002800)
24
25#define MMP3_FSIC_REGBASE (0xf0003000)
26#define MMP3_FSIC_PHYBASE (0xf0003800)
27
28
29#define USB_REG_RANGE (0x1ff)
30#define USB_PHY_RANGE (0xff)
31
32/* registers */
33#define U2x_CAPREGS_OFFSET 0x100
34
35/* phy regs */
36#define UTMI_REVISION 0x0
37#define UTMI_CTRL 0x4
38#define UTMI_PLL 0x8
39#define UTMI_TX 0xc
40#define UTMI_RX 0x10
41#define UTMI_IVREF 0x14
42#define UTMI_T0 0x18
43#define UTMI_T1 0x1c
44#define UTMI_T2 0x20
45#define UTMI_T3 0x24
46#define UTMI_T4 0x28
47#define UTMI_T5 0x2c
48#define UTMI_RESERVE 0x30
49#define UTMI_USB_INT 0x34
50#define UTMI_DBG_CTL 0x38
51#define UTMI_OTG_ADDON 0x3c
52
53/* For UTMICTRL Register */
54#define UTMI_CTRL_USB_CLK_EN (1 << 31)
55/* pxa168 */
56#define UTMI_CTRL_SUSPEND_SET1 (1 << 30)
57#define UTMI_CTRL_SUSPEND_SET2 (1 << 29)
58#define UTMI_CTRL_RXBUF_PDWN (1 << 24)
59#define UTMI_CTRL_TXBUF_PDWN (1 << 11)
60
61#define UTMI_CTRL_INPKT_DELAY_SHIFT 30
62#define UTMI_CTRL_INPKT_DELAY_SOF_SHIFT 28
63#define UTMI_CTRL_PU_REF_SHIFT 20
64#define UTMI_CTRL_ARC_PULLDN_SHIFT 12
65#define UTMI_CTRL_PLL_PWR_UP_SHIFT 1
66#define UTMI_CTRL_PWR_UP_SHIFT 0
67
68/* For UTMI_PLL Register */
69#define UTMI_PLL_PLLCALI12_SHIFT 29
70#define UTMI_PLL_PLLCALI12_MASK (0x3 << 29)
71
72#define UTMI_PLL_PLLVDD18_SHIFT 27
73#define UTMI_PLL_PLLVDD18_MASK (0x3 << 27)
74
75#define UTMI_PLL_PLLVDD12_SHIFT 25
76#define UTMI_PLL_PLLVDD12_MASK (0x3 << 25)
77
78#define UTMI_PLL_CLK_BLK_EN_SHIFT 24
79#define CLK_BLK_EN (0x1 << 24)
80#define PLL_READY (0x1 << 23)
81#define KVCO_EXT (0x1 << 22)
82#define VCOCAL_START (0x1 << 21)
83
84#define UTMI_PLL_KVCO_SHIFT 15
85#define UTMI_PLL_KVCO_MASK (0x7 << 15)
86
87#define UTMI_PLL_ICP_SHIFT 12
88#define UTMI_PLL_ICP_MASK (0x7 << 12)
89
90#define UTMI_PLL_FBDIV_SHIFT 4
91#define UTMI_PLL_FBDIV_MASK (0xFF << 4)
92
93#define UTMI_PLL_REFDIV_SHIFT 0
94#define UTMI_PLL_REFDIV_MASK (0xF << 0)
95
96/* For UTMI_TX Register */
97#define UTMI_TX_REG_EXT_FS_RCAL_SHIFT 27
98#define UTMI_TX_REG_EXT_FS_RCAL_MASK (0xf << 27)
99
100#define UTMI_TX_REG_EXT_FS_RCAL_EN_SHIFT 26
101#define UTMI_TX_REG_EXT_FS_RCAL_EN_MASK (0x1 << 26)
102
103#define UTMI_TX_TXVDD12_SHIFT 22
104#define UTMI_TX_TXVDD12_MASK (0x3 << 22)
105
106#define UTMI_TX_CK60_PHSEL_SHIFT 17
107#define UTMI_TX_CK60_PHSEL_MASK (0xf << 17)
108
109#define UTMI_TX_IMPCAL_VTH_SHIFT 14
110#define UTMI_TX_IMPCAL_VTH_MASK (0x7 << 14)
111
112#define REG_RCAL_START (0x1 << 12)
113
114#define UTMI_TX_LOW_VDD_EN_SHIFT 11
115
116#define UTMI_TX_AMP_SHIFT 0
117#define UTMI_TX_AMP_MASK (0x7 << 0)
118
119/* For UTMI_RX Register */
120#define UTMI_REG_SQ_LENGTH_SHIFT 15
121#define UTMI_REG_SQ_LENGTH_MASK (0x3 << 15)
122
123#define UTMI_RX_SQ_THRESH_SHIFT 4
124#define UTMI_RX_SQ_THRESH_MASK (0xf << 4)
125
126#define UTMI_OTG_ADDON_OTG_ON (1 << 0)
127
128/* For MMP3 USB Phy */
129#define USB2_PLL_REG0 0x4
130#define USB2_PLL_REG1 0x8
131#define USB2_TX_REG0 0x10
132#define USB2_TX_REG1 0x14
133#define USB2_TX_REG2 0x18
134#define USB2_RX_REG0 0x20
135#define USB2_RX_REG1 0x24
136#define USB2_RX_REG2 0x28
137#define USB2_ANA_REG0 0x30
138#define USB2_ANA_REG1 0x34
139#define USB2_ANA_REG2 0x38
140#define USB2_DIG_REG0 0x3C
141#define USB2_DIG_REG1 0x40
142#define USB2_DIG_REG2 0x44
143#define USB2_DIG_REG3 0x48
144#define USB2_TEST_REG0 0x4C
145#define USB2_TEST_REG1 0x50
146#define USB2_TEST_REG2 0x54
147#define USB2_CHARGER_REG0 0x58
148#define USB2_OTG_REG0 0x5C
149#define USB2_PHY_MON0 0x60
150#define USB2_RESETVE_REG0 0x64
151#define USB2_ICID_REG0 0x78
152#define USB2_ICID_REG1 0x7C
153
154/* USB2_PLL_REG0 */
155/* This is for Ax stepping */
156#define USB2_PLL_FBDIV_SHIFT_MMP3 0
157#define USB2_PLL_FBDIV_MASK_MMP3 (0xFF << 0)
158
159#define USB2_PLL_REFDIV_SHIFT_MMP3 8
160#define USB2_PLL_REFDIV_MASK_MMP3 (0xF << 8)
161
162#define USB2_PLL_VDD12_SHIFT_MMP3 12
163#define USB2_PLL_VDD18_SHIFT_MMP3 14
164
165/* This is for B0 stepping */
166#define USB2_PLL_FBDIV_SHIFT_MMP3_B0 0
167#define USB2_PLL_REFDIV_SHIFT_MMP3_B0 9
168#define USB2_PLL_VDD18_SHIFT_MMP3_B0 14
169#define USB2_PLL_FBDIV_MASK_MMP3_B0 0x01FF
170#define USB2_PLL_REFDIV_MASK_MMP3_B0 0x3E00
171
172#define USB2_PLL_CAL12_SHIFT_MMP3 0
173#define USB2_PLL_CALI12_MASK_MMP3 (0x3 << 0)
174
175#define USB2_PLL_VCOCAL_START_SHIFT_MMP3 2
176
177#define USB2_PLL_KVCO_SHIFT_MMP3 4
178#define USB2_PLL_KVCO_MASK_MMP3 (0x7<<4)
179
180#define USB2_PLL_ICP_SHIFT_MMP3 8
181#define USB2_PLL_ICP_MASK_MMP3 (0x7<<8)
182
183#define USB2_PLL_LOCK_BYPASS_SHIFT_MMP3 12
184
185#define USB2_PLL_PU_PLL_SHIFT_MMP3 13
186#define USB2_PLL_PU_PLL_MASK (0x1 << 13)
187
188#define USB2_PLL_READY_MASK_MMP3 (0x1 << 15)
189
190/* USB2_TX_REG0 */
191#define USB2_TX_IMPCAL_VTH_SHIFT_MMP3 8
192#define USB2_TX_IMPCAL_VTH_MASK_MMP3 (0x7 << 8)
193
194#define USB2_TX_RCAL_START_SHIFT_MMP3 13
195
196/* USB2_TX_REG1 */
197#define USB2_TX_CK60_PHSEL_SHIFT_MMP3 0
198#define USB2_TX_CK60_PHSEL_MASK_MMP3 (0xf << 0)
199
200#define USB2_TX_AMP_SHIFT_MMP3 4
201#define USB2_TX_AMP_MASK_MMP3 (0x7 << 4)
202
203#define USB2_TX_VDD12_SHIFT_MMP3 8
204#define USB2_TX_VDD12_MASK_MMP3 (0x3 << 8)
205
206/* USB2_TX_REG2 */
207#define USB2_TX_DRV_SLEWRATE_SHIFT 10
208
209/* USB2_RX_REG0 */
210#define USB2_RX_SQ_THRESH_SHIFT_MMP3 4
211#define USB2_RX_SQ_THRESH_MASK_MMP3 (0xf << 4)
212
213#define USB2_RX_SQ_LENGTH_SHIFT_MMP3 10
214#define USB2_RX_SQ_LENGTH_MASK_MMP3 (0x3 << 10)
215
216/* USB2_ANA_REG1*/
217#define USB2_ANA_PU_ANA_SHIFT_MMP3 14
218
219/* USB2_OTG_REG0 */
220#define USB2_OTG_PU_OTG_SHIFT_MMP3 3
221
222/* fsic registers */
223#define FSIC_MISC 0x4
224#define FSIC_INT 0x28
225#define FSIC_CTRL 0x30
226
227/* HSIC registers */
228#define HSIC_PAD_CTRL 0x4
229
230#define HSIC_CTRL 0x8
231#define HSIC_CTRL_HSIC_ENABLE (1<<7)
232#define HSIC_CTRL_PLL_BYPASS (1<<4)
233
234#define TEST_GRP_0 0xc
235#define TEST_GRP_1 0x10
236
237#define HSIC_INT 0x14
238#define HSIC_INT_READY_INT_EN (1<<10)
239#define HSIC_INT_CONNECT_INT_EN (1<<9)
240#define HSIC_INT_CORE_INT_EN (1<<8)
241#define HSIC_INT_HS_READY (1<<2)
242#define HSIC_INT_CONNECT (1<<1)
243#define HSIC_INT_CORE (1<<0)
244
245#define HSIC_CONFIG 0x18
246#define USBHSIC_CTRL 0x20
247
248#define HSIC_USB_CTRL 0x28
249#define HSIC_USB_CTRL_CLKEN 1
250#define HSIC_USB_CLK_PHY 0x0
251#define HSIC_USB_CLK_PMU 0x1
252
253#endif /* __ASM_ARCH_PXA_U2O_H */
diff --git a/arch/arm/mach-mmp/pxa168.c b/arch/arm/mach-mmp/pxa168.c
index b24d2c32cba9..62d787c34475 100644
--- a/arch/arm/mach-mmp/pxa168.c
+++ b/arch/arm/mach-mmp/pxa168.c
@@ -14,6 +14,7 @@
14#include <linux/io.h> 14#include <linux/io.h>
15#include <linux/clk.h> 15#include <linux/clk.h>
16#include <linux/platform_device.h> 16#include <linux/platform_device.h>
17#include <linux/platform_data/mv_usb.h>
17 18
18#include <asm/mach/time.h> 19#include <asm/mach/time.h>
19#include <asm/system_misc.h> 20#include <asm/system_misc.h>
@@ -27,6 +28,7 @@
27#include <mach/mfp.h> 28#include <mach/mfp.h>
28#include <linux/dma-mapping.h> 29#include <linux/dma-mapping.h>
29#include <mach/pxa168.h> 30#include <mach/pxa168.h>
31#include <mach/regs-usb.h>
30 32
31#include "common.h" 33#include "common.h"
32#include "clock.h" 34#include "clock.h"
@@ -93,7 +95,7 @@ static struct clk_lookup pxa168_clkregs[] = {
93 INIT_CLKREG(&clk_gpio, "pxa-gpio", NULL), 95 INIT_CLKREG(&clk_gpio, "pxa-gpio", NULL),
94 INIT_CLKREG(&clk_keypad, "pxa27x-keypad", NULL), 96 INIT_CLKREG(&clk_keypad, "pxa27x-keypad", NULL),
95 INIT_CLKREG(&clk_eth, "pxa168-eth", "MFUCLK"), 97 INIT_CLKREG(&clk_eth, "pxa168-eth", "MFUCLK"),
96 INIT_CLKREG(&clk_usb, "pxa168-ehci", "PXA168-USBCLK"), 98 INIT_CLKREG(&clk_usb, NULL, "PXA168-USBCLK"),
97 INIT_CLKREG(&clk_rtc, "sa1100-rtc", NULL), 99 INIT_CLKREG(&clk_rtc, "sa1100-rtc", NULL),
98}; 100};
99 101
@@ -184,17 +186,17 @@ struct platform_device pxa168_device_gpio = {
184struct resource pxa168_usb_host_resources[] = { 186struct resource pxa168_usb_host_resources[] = {
185 /* USB Host conroller register base */ 187 /* USB Host conroller register base */
186 [0] = { 188 [0] = {
187 .start = 0xd4209000, 189 .start = PXA168_U2H_REGBASE + U2x_CAPREGS_OFFSET,
188 .end = 0xd4209000 + 0x200, 190 .end = PXA168_U2H_REGBASE + USB_REG_RANGE,
189 .flags = IORESOURCE_MEM, 191 .flags = IORESOURCE_MEM,
190 .name = "pxa168-usb-host", 192 .name = "capregs",
191 }, 193 },
192 /* USB PHY register base */ 194 /* USB PHY register base */
193 [1] = { 195 [1] = {
194 .start = 0xd4206000, 196 .start = PXA168_U2H_PHYBASE,
195 .end = 0xd4206000 + 0xff, 197 .end = PXA168_U2H_PHYBASE + USB_PHY_RANGE,
196 .flags = IORESOURCE_MEM, 198 .flags = IORESOURCE_MEM,
197 .name = "pxa168-usb-phy", 199 .name = "phyregs",
198 }, 200 },
199 [2] = { 201 [2] = {
200 .start = IRQ_PXA168_USB2, 202 .start = IRQ_PXA168_USB2,
@@ -205,7 +207,7 @@ struct resource pxa168_usb_host_resources[] = {
205 207
206static u64 pxa168_usb_host_dmamask = DMA_BIT_MASK(32); 208static u64 pxa168_usb_host_dmamask = DMA_BIT_MASK(32);
207struct platform_device pxa168_device_usb_host = { 209struct platform_device pxa168_device_usb_host = {
208 .name = "pxa168-ehci", 210 .name = "pxa-sph",
209 .id = -1, 211 .id = -1,
210 .dev = { 212 .dev = {
211 .dma_mask = &pxa168_usb_host_dmamask, 213 .dma_mask = &pxa168_usb_host_dmamask,
@@ -216,7 +218,7 @@ struct platform_device pxa168_device_usb_host = {
216 .resource = pxa168_usb_host_resources, 218 .resource = pxa168_usb_host_resources,
217}; 219};
218 220
219int __init pxa168_add_usb_host(struct pxa168_usb_pdata *pdata) 221int __init pxa168_add_usb_host(struct mv_usb_platform_data *pdata)
220{ 222{
221 pxa168_device_usb_host.dev.platform_data = pdata; 223 pxa168_device_usb_host.dev.platform_data = pdata;
222 return platform_device_register(&pxa168_device_usb_host); 224 return platform_device_register(&pxa168_device_usb_host);
diff --git a/arch/arm/mach-mmp/pxa910.c b/arch/arm/mach-mmp/pxa910.c
index 43f8bcc29b67..6da52e9f2bdc 100644
--- a/arch/arm/mach-mmp/pxa910.c
+++ b/arch/arm/mach-mmp/pxa910.c
@@ -109,7 +109,7 @@ static struct clk_lookup pxa910_clkregs[] = {
109 INIT_CLKREG(&clk_pwm4, "pxa910-pwm.3", NULL), 109 INIT_CLKREG(&clk_pwm4, "pxa910-pwm.3", NULL),
110 INIT_CLKREG(&clk_nand, "pxa3xx-nand", NULL), 110 INIT_CLKREG(&clk_nand, "pxa3xx-nand", NULL),
111 INIT_CLKREG(&clk_gpio, "pxa-gpio", NULL), 111 INIT_CLKREG(&clk_gpio, "pxa-gpio", NULL),
112 INIT_CLKREG(&clk_u2o, "pxa-u2o", "U2OCLK"), 112 INIT_CLKREG(&clk_u2o, NULL, "U2OCLK"),
113 INIT_CLKREG(&clk_rtc, "sa1100-rtc", NULL), 113 INIT_CLKREG(&clk_rtc, "sa1100-rtc", NULL),
114}; 114};
115 115
diff --git a/arch/arm/mach-mmp/ttc_dkb.c b/arch/arm/mach-mmp/ttc_dkb.c
index e8cf5ea15263..7a7de2b12a62 100644
--- a/arch/arm/mach-mmp/ttc_dkb.c
+++ b/arch/arm/mach-mmp/ttc_dkb.c
@@ -18,6 +18,7 @@
18#include <linux/i2c/pca953x.h> 18#include <linux/i2c/pca953x.h>
19#include <linux/gpio.h> 19#include <linux/gpio.h>
20#include <linux/mfd/88pm860x.h> 20#include <linux/mfd/88pm860x.h>
21#include <linux/platform_data/mv_usb.h>
21 22
22#include <asm/mach-types.h> 23#include <asm/mach-types.h>
23#include <asm/mach/arch.h> 24#include <asm/mach/arch.h>
@@ -26,6 +27,7 @@
26#include <mach/mfp-pxa910.h> 27#include <mach/mfp-pxa910.h>
27#include <mach/pxa910.h> 28#include <mach/pxa910.h>
28#include <mach/irqs.h> 29#include <mach/irqs.h>
30#include <mach/regs-usb.h>
29 31
30#include "common.h" 32#include "common.h"
31 33
@@ -155,6 +157,26 @@ static struct i2c_board_info ttc_dkb_i2c_info[] = {
155 }, 157 },
156}; 158};
157 159
160#ifdef CONFIG_USB_SUPPORT
161#if defined(CONFIG_USB_MV_UDC) || defined(CONFIG_USB_EHCI_MV_U2O)
162
163static char *pxa910_usb_clock_name[] = {
164 [0] = "U2OCLK",
165};
166
167static struct mv_usb_platform_data ttc_usb_pdata = {
168 .clknum = 1,
169 .clkname = pxa910_usb_clock_name,
170 .vbus = NULL,
171 .mode = MV_USB_MODE_OTG,
172 .otg_force_a_bus_req = 1,
173 .phy_init = pxa_usb_phy_init,
174 .phy_deinit = pxa_usb_phy_deinit,
175 .set_vbus = NULL,
176};
177#endif
178#endif
179
158static void __init ttc_dkb_init(void) 180static void __init ttc_dkb_init(void)
159{ 181{
160 mfp_config(ARRAY_AND_SIZE(ttc_dkb_pin_config)); 182 mfp_config(ARRAY_AND_SIZE(ttc_dkb_pin_config));
@@ -165,6 +187,21 @@ static void __init ttc_dkb_init(void)
165 /* off-chip devices */ 187 /* off-chip devices */
166 pxa910_add_twsi(0, NULL, ARRAY_AND_SIZE(ttc_dkb_i2c_info)); 188 pxa910_add_twsi(0, NULL, ARRAY_AND_SIZE(ttc_dkb_i2c_info));
167 platform_add_devices(ARRAY_AND_SIZE(ttc_dkb_devices)); 189 platform_add_devices(ARRAY_AND_SIZE(ttc_dkb_devices));
190
191#ifdef CONFIG_USB_MV_UDC
192 pxa168_device_u2o.dev.platform_data = &ttc_usb_pdata;
193 platform_device_register(&pxa168_device_u2o);
194#endif
195
196#ifdef CONFIG_USB_EHCI_MV_U2O
197 pxa168_device_u2oehci.dev.platform_data = &ttc_usb_pdata;
198 platform_device_register(&pxa168_device_u2oehci);
199#endif
200
201#ifdef CONFIG_USB_MV_OTG
202 pxa168_device_u2ootg.dev.platform_data = &ttc_usb_pdata;
203 platform_device_register(&pxa168_device_u2ootg);
204#endif
168} 205}
169 206
170MACHINE_START(TTC_DKB, "PXA910-based TTC_DKB Development Platform") 207MACHINE_START(TTC_DKB, "PXA910-based TTC_DKB Development Platform")
diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
index 8141b76283a6..964ee67a3b77 100644
--- a/arch/arm/mach-omap2/Kconfig
+++ b/arch/arm/mach-omap2/Kconfig
@@ -17,6 +17,7 @@ config ARCH_OMAP2PLUS_TYPICAL
17 select MENELAUS if ARCH_OMAP2 17 select MENELAUS if ARCH_OMAP2
18 select TWL4030_CORE if ARCH_OMAP3 || ARCH_OMAP4 18 select TWL4030_CORE if ARCH_OMAP3 || ARCH_OMAP4
19 select TWL4030_POWER if ARCH_OMAP3 || ARCH_OMAP4 19 select TWL4030_POWER if ARCH_OMAP3 || ARCH_OMAP4
20 select HIGHMEM
20 help 21 help
21 Compile a kernel suitable for booting most boards 22 Compile a kernel suitable for booting most boards
22 23
diff --git a/arch/arm/mach-omap2/board-4430sdp.c b/arch/arm/mach-omap2/board-4430sdp.c
index 4a9bc00a7d98..94af6cde2e36 100644
--- a/arch/arm/mach-omap2/board-4430sdp.c
+++ b/arch/arm/mach-omap2/board-4430sdp.c
@@ -384,6 +384,11 @@ static struct platform_device sdp4430_dmic_codec = {
384 .id = -1, 384 .id = -1,
385}; 385};
386 386
387static struct platform_device sdp4430_hdmi_audio_codec = {
388 .name = "hdmi-audio-codec",
389 .id = -1,
390};
391
387static struct omap_abe_twl6040_data sdp4430_abe_audio_data = { 392static struct omap_abe_twl6040_data sdp4430_abe_audio_data = {
388 .card_name = "SDP4430", 393 .card_name = "SDP4430",
389 .has_hs = ABE_TWL6040_LEFT | ABE_TWL6040_RIGHT, 394 .has_hs = ABE_TWL6040_LEFT | ABE_TWL6040_RIGHT,
@@ -418,6 +423,7 @@ static struct platform_device *sdp4430_devices[] __initdata = {
418 &sdp4430_vbat, 423 &sdp4430_vbat,
419 &sdp4430_dmic_codec, 424 &sdp4430_dmic_codec,
420 &sdp4430_abe_audio, 425 &sdp4430_abe_audio,
426 &sdp4430_hdmi_audio_codec,
421}; 427};
422 428
423static struct omap_musb_board_data musb_board_data = { 429static struct omap_musb_board_data musb_board_data = {
@@ -571,7 +577,9 @@ static int __init omap4_i2c_init(void)
571 TWL_COMMON_REGULATOR_VANA | 577 TWL_COMMON_REGULATOR_VANA |
572 TWL_COMMON_REGULATOR_VCXIO | 578 TWL_COMMON_REGULATOR_VCXIO |
573 TWL_COMMON_REGULATOR_VUSB | 579 TWL_COMMON_REGULATOR_VUSB |
574 TWL_COMMON_REGULATOR_CLK32KG); 580 TWL_COMMON_REGULATOR_CLK32KG |
581 TWL_COMMON_REGULATOR_V1V8 |
582 TWL_COMMON_REGULATOR_V2V1);
575 omap4_pmic_init("twl6030", &sdp4430_twldata, 583 omap4_pmic_init("twl6030", &sdp4430_twldata,
576 &twl6040_data, OMAP44XX_IRQ_SYS_2N); 584 &twl6040_data, OMAP44XX_IRQ_SYS_2N);
577 omap_register_i2c_bus(2, 400, NULL, 0); 585 omap_register_i2c_bus(2, 400, NULL, 0);
diff --git a/arch/arm/mach-omap2/board-am3517crane.c b/arch/arm/mach-omap2/board-am3517crane.c
index c3851e8de28b..3b8a53c1f2a8 100644
--- a/arch/arm/mach-omap2/board-am3517crane.c
+++ b/arch/arm/mach-omap2/board-am3517crane.c
@@ -30,6 +30,7 @@
30#include "common.h" 30#include "common.h"
31#include <plat/usb.h> 31#include <plat/usb.h>
32 32
33#include "am35xx-emac.h"
33#include "mux.h" 34#include "mux.h"
34#include "control.h" 35#include "control.h"
35 36
@@ -90,6 +91,7 @@ static void __init am3517_crane_init(void)
90 } 91 }
91 92
92 usbhs_init(&usbhs_bdata); 93 usbhs_init(&usbhs_bdata);
94 am35xx_emac_init(AM35XX_DEFAULT_MDIO_FREQUENCY, 1);
93} 95}
94 96
95MACHINE_START(CRANEBOARD, "AM3517/05 CRANEBOARD") 97MACHINE_START(CRANEBOARD, "AM3517/05 CRANEBOARD")
diff --git a/arch/arm/mach-omap2/board-cm-t35.c b/arch/arm/mach-omap2/board-cm-t35.c
index 45746cb56c68..c03df142ea67 100644
--- a/arch/arm/mach-omap2/board-cm-t35.c
+++ b/arch/arm/mach-omap2/board-cm-t35.c
@@ -476,6 +476,10 @@ static struct twl4030_gpio_platform_data cm_t35_gpio_data = {
476 .setup = cm_t35_twl_gpio_setup, 476 .setup = cm_t35_twl_gpio_setup,
477}; 477};
478 478
479static struct twl4030_power_data cm_t35_power_data = {
480 .use_poweroff = true,
481};
482
479static struct twl4030_platform_data cm_t35_twldata = { 483static struct twl4030_platform_data cm_t35_twldata = {
480 /* platform_data for children goes here */ 484 /* platform_data for children goes here */
481 .keypad = &cm_t35_kp_data, 485 .keypad = &cm_t35_kp_data,
@@ -483,6 +487,7 @@ static struct twl4030_platform_data cm_t35_twldata = {
483 .vmmc1 = &cm_t35_vmmc1, 487 .vmmc1 = &cm_t35_vmmc1,
484 .vsim = &cm_t35_vsim, 488 .vsim = &cm_t35_vsim,
485 .vio = &cm_t35_vio, 489 .vio = &cm_t35_vio,
490 .power = &cm_t35_power_data,
486}; 491};
487 492
488static void __init cm_t35_init_i2c(void) 493static void __init cm_t35_init_i2c(void)
diff --git a/arch/arm/mach-omap2/board-flash.c b/arch/arm/mach-omap2/board-flash.c
index 0349fd2b68d8..70a81f900bb5 100644
--- a/arch/arm/mach-omap2/board-flash.c
+++ b/arch/arm/mach-omap2/board-flash.c
@@ -87,7 +87,7 @@ static struct omap_onenand_platform_data board_onenand_data = {
87 .dma_channel = -1, /* disable DMA in OMAP OneNAND driver */ 87 .dma_channel = -1, /* disable DMA in OMAP OneNAND driver */
88}; 88};
89 89
90static void 90void
91__init board_onenand_init(struct mtd_partition *onenand_parts, 91__init board_onenand_init(struct mtd_partition *onenand_parts,
92 u8 nr_parts, u8 cs) 92 u8 nr_parts, u8 cs)
93{ 93{
@@ -98,7 +98,7 @@ __init board_onenand_init(struct mtd_partition *onenand_parts,
98 gpmc_onenand_init(&board_onenand_data); 98 gpmc_onenand_init(&board_onenand_data);
99} 99}
100#else 100#else
101static void 101void
102__init board_onenand_init(struct mtd_partition *nor_parts, u8 nr_parts, u8 cs) 102__init board_onenand_init(struct mtd_partition *nor_parts, u8 nr_parts, u8 cs)
103{ 103{
104} 104}
diff --git a/arch/arm/mach-omap2/board-flash.h b/arch/arm/mach-omap2/board-flash.h
index d25503a98417..c44b70d52021 100644
--- a/arch/arm/mach-omap2/board-flash.h
+++ b/arch/arm/mach-omap2/board-flash.h
@@ -47,3 +47,14 @@ static inline void board_nand_init(struct mtd_partition *nand_parts,
47{ 47{
48} 48}
49#endif 49#endif
50
51#if defined(CONFIG_MTD_ONENAND_OMAP2) || \
52 defined(CONFIG_MTD_ONENAND_OMAP2_MODULE)
53extern void board_onenand_init(struct mtd_partition *nand_parts,
54 u8 nr_parts, u8 cs);
55#else
56static inline void board_onenand_init(struct mtd_partition *nand_parts,
57 u8 nr_parts, u8 cs)
58{
59}
60#endif
diff --git a/arch/arm/mach-omap2/board-igep0020.c b/arch/arm/mach-omap2/board-igep0020.c
index 4c1acecce93f..7a274098f67b 100644
--- a/arch/arm/mach-omap2/board-igep0020.c
+++ b/arch/arm/mach-omap2/board-igep0020.c
@@ -24,6 +24,8 @@
24#include <linux/i2c/twl.h> 24#include <linux/i2c/twl.h>
25#include <linux/mmc/host.h> 25#include <linux/mmc/host.h>
26 26
27#include <linux/mtd/nand.h>
28
27#include <asm/mach-types.h> 29#include <asm/mach-types.h>
28#include <asm/mach/arch.h> 30#include <asm/mach/arch.h>
29 31
@@ -39,6 +41,8 @@
39#include "hsmmc.h" 41#include "hsmmc.h"
40#include "sdram-numonyx-m65kxxxxam.h" 42#include "sdram-numonyx-m65kxxxxam.h"
41#include "common-board-devices.h" 43#include "common-board-devices.h"
44#include "board-flash.h"
45#include "control.h"
42 46
43#define IGEP2_SMSC911X_CS 5 47#define IGEP2_SMSC911X_CS 5
44#define IGEP2_SMSC911X_GPIO 176 48#define IGEP2_SMSC911X_GPIO 176
@@ -60,6 +64,10 @@
60#define IGEP3_GPIO_LED1_RED 16 64#define IGEP3_GPIO_LED1_RED 16
61#define IGEP3_GPIO_USBH_NRESET 183 65#define IGEP3_GPIO_USBH_NRESET 183
62 66
67#define IGEP_SYSBOOT_MASK 0x1f
68#define IGEP_SYSBOOT_NAND 0x0f
69#define IGEP_SYSBOOT_ONENAND 0x10
70
63/* 71/*
64 * IGEP2 Hardware Revision Table 72 * IGEP2 Hardware Revision Table
65 * 73 *
@@ -110,8 +118,10 @@ static void __init igep2_get_revision(void)
110 gpio_free(IGEP2_GPIO_LED1_RED); 118 gpio_free(IGEP2_GPIO_LED1_RED);
111} 119}
112 120
113#if defined(CONFIG_MTD_ONENAND_OMAP2) || \ 121#if defined(CONFIG_MTD_ONENAND_OMAP2) || \
114 defined(CONFIG_MTD_ONENAND_OMAP2_MODULE) 122 defined(CONFIG_MTD_ONENAND_OMAP2_MODULE) || \
123 defined(CONFIG_MTD_NAND_OMAP2) || \
124 defined(CONFIG_MTD_NAND_OMAP2_MODULE)
115 125
116#define ONENAND_MAP 0x20000000 126#define ONENAND_MAP 0x20000000
117 127
@@ -123,7 +133,7 @@ static void __init igep2_get_revision(void)
123 * So MTD regards it as 4KiB page size and 256KiB block size 64*(2*2048) 133 * So MTD regards it as 4KiB page size and 256KiB block size 64*(2*2048)
124 */ 134 */
125 135
126static struct mtd_partition igep_onenand_partitions[] = { 136static struct mtd_partition igep_flash_partitions[] = {
127 { 137 {
128 .name = "X-Loader", 138 .name = "X-Loader",
129 .offset = 0, 139 .offset = 0,
@@ -151,50 +161,28 @@ static struct mtd_partition igep_onenand_partitions[] = {
151 }, 161 },
152}; 162};
153 163
154static struct omap_onenand_platform_data igep_onenand_data = { 164static inline u32 igep_get_sysboot_value(void)
155 .parts = igep_onenand_partitions, 165{
156 .nr_parts = ARRAY_SIZE(igep_onenand_partitions), 166 return omap_ctrl_readl(OMAP343X_CONTROL_STATUS) & IGEP_SYSBOOT_MASK;
157 .dma_channel = -1, /* disable DMA in OMAP OneNAND driver */ 167}
158};
159
160static struct platform_device igep_onenand_device = {
161 .name = "omap2-onenand",
162 .id = -1,
163 .dev = {
164 .platform_data = &igep_onenand_data,
165 },
166};
167 168
168static void __init igep_flash_init(void) 169static void __init igep_flash_init(void)
169{ 170{
170 u8 cs = 0; 171 u32 mux;
171 u8 onenandcs = GPMC_CS_NUM + 1; 172 mux = igep_get_sysboot_value();
172 173
173 for (cs = 0; cs < GPMC_CS_NUM; cs++) { 174 if (mux == IGEP_SYSBOOT_NAND) {
174 u32 ret; 175 pr_info("IGEP: initializing NAND memory device\n");
175 ret = gpmc_cs_read_reg(cs, GPMC_CS_CONFIG1); 176 board_nand_init(igep_flash_partitions,
176 177 ARRAY_SIZE(igep_flash_partitions),
177 /* Check if NAND/oneNAND is configured */ 178 0, NAND_BUSWIDTH_16);
178 if ((ret & 0xC00) == 0x800) 179 } else if (mux == IGEP_SYSBOOT_ONENAND) {
179 /* NAND found */ 180 pr_info("IGEP: initializing OneNAND memory device\n");
180 pr_err("IGEP: Unsupported NAND found\n"); 181 board_onenand_init(igep_flash_partitions,
181 else { 182 ARRAY_SIZE(igep_flash_partitions), 0);
182 ret = gpmc_cs_read_reg(cs, GPMC_CS_CONFIG7); 183 } else {
183 if ((ret & 0x3F) == (ONENAND_MAP >> 24)) 184 pr_err("IGEP: Flash: unsupported sysboot sequence found\n");
184 /* ONENAND found */
185 onenandcs = cs;
186 }
187 }
188
189 if (onenandcs > GPMC_CS_NUM) {
190 pr_err("IGEP: Unable to find configuration in GPMC\n");
191 return;
192 } 185 }
193
194 igep_onenand_data.cs = onenandcs;
195
196 if (platform_device_register(&igep_onenand_device) < 0)
197 pr_err("IGEP: Unable to register OneNAND device\n");
198} 186}
199 187
200#else 188#else
diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
index 8ede8d20d7b2..2a7b9a9da1db 100644
--- a/arch/arm/mach-omap2/board-omap3beagle.c
+++ b/arch/arm/mach-omap2/board-omap3beagle.c
@@ -83,11 +83,13 @@ static struct {
83 int usb_pwr_level; 83 int usb_pwr_level;
84 int reset_gpio; 84 int reset_gpio;
85 int usr_button_gpio; 85 int usr_button_gpio;
86 int mmc_caps;
86} beagle_config = { 87} beagle_config = {
87 .mmc1_gpio_wp = -EINVAL, 88 .mmc1_gpio_wp = -EINVAL,
88 .usb_pwr_level = GPIOF_OUT_INIT_LOW, 89 .usb_pwr_level = GPIOF_OUT_INIT_LOW,
89 .reset_gpio = 129, 90 .reset_gpio = 129,
90 .usr_button_gpio = 4, 91 .usr_button_gpio = 4,
92 .mmc_caps = MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA,
91}; 93};
92 94
93static struct gpio omap3_beagle_rev_gpios[] __initdata = { 95static struct gpio omap3_beagle_rev_gpios[] __initdata = {
@@ -145,10 +147,12 @@ static void __init omap3_beagle_init_rev(void)
145 printk(KERN_INFO "OMAP3 Beagle Rev: xM Ax/Bx\n"); 147 printk(KERN_INFO "OMAP3 Beagle Rev: xM Ax/Bx\n");
146 omap3_beagle_version = OMAP3BEAGLE_BOARD_XM; 148 omap3_beagle_version = OMAP3BEAGLE_BOARD_XM;
147 beagle_config.usb_pwr_level = GPIOF_OUT_INIT_HIGH; 149 beagle_config.usb_pwr_level = GPIOF_OUT_INIT_HIGH;
150 beagle_config.mmc_caps &= ~MMC_CAP_8_BIT_DATA;
148 break; 151 break;
149 case 2: 152 case 2:
150 printk(KERN_INFO "OMAP3 Beagle Rev: xM C\n"); 153 printk(KERN_INFO "OMAP3 Beagle Rev: xM C\n");
151 omap3_beagle_version = OMAP3BEAGLE_BOARD_XMC; 154 omap3_beagle_version = OMAP3BEAGLE_BOARD_XMC;
155 beagle_config.mmc_caps &= ~MMC_CAP_8_BIT_DATA;
152 break; 156 break;
153 default: 157 default:
154 printk(KERN_INFO "OMAP3 Beagle Rev: unknown %hd\n", beagle_rev); 158 printk(KERN_INFO "OMAP3 Beagle Rev: unknown %hd\n", beagle_rev);
@@ -225,7 +229,7 @@ static struct omap_dss_board_info beagle_dss_data = {
225static struct omap2_hsmmc_info mmc[] = { 229static struct omap2_hsmmc_info mmc[] = {
226 { 230 {
227 .mmc = 1, 231 .mmc = 1,
228 .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA, 232 .caps = MMC_CAP_4_BIT_DATA,
229 .gpio_wp = -EINVAL, 233 .gpio_wp = -EINVAL,
230 .deferred = true, 234 .deferred = true,
231 }, 235 },
@@ -497,6 +501,7 @@ static void __init omap3_beagle_init(void)
497 501
498 if (beagle_config.mmc1_gpio_wp != -EINVAL) 502 if (beagle_config.mmc1_gpio_wp != -EINVAL)
499 omap_mux_init_gpio(beagle_config.mmc1_gpio_wp, OMAP_PIN_INPUT); 503 omap_mux_init_gpio(beagle_config.mmc1_gpio_wp, OMAP_PIN_INPUT);
504 mmc[0].caps = beagle_config.mmc_caps;
500 omap_hsmmc_init(mmc); 505 omap_hsmmc_init(mmc);
501 506
502 omap3_beagle_i2c_init(); 507 omap3_beagle_i2c_init();
diff --git a/arch/arm/mach-omap2/board-omap3logic.c b/arch/arm/mach-omap2/board-omap3logic.c
index 9b3c141ff51b..c008bf8e1c36 100644
--- a/arch/arm/mach-omap2/board-omap3logic.c
+++ b/arch/arm/mach-omap2/board-omap3logic.c
@@ -4,8 +4,9 @@
4 * Copyright (C) 2010 Li-Pro.Net 4 * Copyright (C) 2010 Li-Pro.Net
5 * Stephan Linz <linz@li-pro.net> 5 * Stephan Linz <linz@li-pro.net>
6 * 6 *
7 * Copyright (C) 2010 Logic Product Development, Inc. 7 * Copyright (C) 2010-2012 Logic Product Development, Inc.
8 * Peter Barada <peter.barada@logicpd.com> 8 * Peter Barada <peter.barada@logicpd.com>
9 * Ashwin BIhari <ashwin.bihari@logicpd.com>
9 * 10 *
10 * Modified from Beagle, EVM, and RX51 11 * Modified from Beagle, EVM, and RX51
11 * 12 *
@@ -45,6 +46,7 @@
45#include <plat/gpmc-smsc911x.h> 46#include <plat/gpmc-smsc911x.h>
46#include <plat/gpmc.h> 47#include <plat/gpmc.h>
47#include <plat/sdrc.h> 48#include <plat/sdrc.h>
49#include <plat/usb.h>
48 50
49#define OMAP3LOGIC_SMSC911X_CS 1 51#define OMAP3LOGIC_SMSC911X_CS 1
50 52
@@ -85,6 +87,11 @@ static struct twl4030_gpio_platform_data omap3logic_gpio_data = {
85 | BIT(13) | BIT(15) | BIT(16) | BIT(17), 87 | BIT(13) | BIT(15) | BIT(16) | BIT(17),
86}; 88};
87 89
90static struct twl4030_usb_data omap3logic_usb_data = {
91 .usb_mode = T2_USB_MODE_ULPI,
92};
93
94
88static struct twl4030_platform_data omap3logic_twldata = { 95static struct twl4030_platform_data omap3logic_twldata = {
89 .irq_base = TWL4030_IRQ_BASE, 96 .irq_base = TWL4030_IRQ_BASE,
90 .irq_end = TWL4030_IRQ_END, 97 .irq_end = TWL4030_IRQ_END,
@@ -92,6 +99,7 @@ static struct twl4030_platform_data omap3logic_twldata = {
92 /* platform_data for children goes here */ 99 /* platform_data for children goes here */
93 .gpio = &omap3logic_gpio_data, 100 .gpio = &omap3logic_gpio_data,
94 .vmmc1 = &omap3logic_vmmc1, 101 .vmmc1 = &omap3logic_vmmc1,
102 .usb = &omap3logic_usb_data,
95}; 103};
96 104
97static int __init omap3logic_i2c_init(void) 105static int __init omap3logic_i2c_init(void)
@@ -185,6 +193,20 @@ static inline void __init board_smsc911x_init(void)
185 193
186#ifdef CONFIG_OMAP_MUX 194#ifdef CONFIG_OMAP_MUX
187static struct omap_board_mux board_mux[] __initdata = { 195static struct omap_board_mux board_mux[] __initdata = {
196 /* mUSB */
197 OMAP3_MUX(HSUSB0_CLK, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
198 OMAP3_MUX(HSUSB0_STP, OMAP_MUX_MODE0 | OMAP_PIN_OUTPUT),
199 OMAP3_MUX(HSUSB0_DIR, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
200 OMAP3_MUX(HSUSB0_NXT, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
201 OMAP3_MUX(HSUSB0_DATA0, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
202 OMAP3_MUX(HSUSB0_DATA1, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
203 OMAP3_MUX(HSUSB0_DATA2, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
204 OMAP3_MUX(HSUSB0_DATA3, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
205 OMAP3_MUX(HSUSB0_DATA4, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
206 OMAP3_MUX(HSUSB0_DATA5, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
207 OMAP3_MUX(HSUSB0_DATA6, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
208 OMAP3_MUX(HSUSB0_DATA7, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
209
188 { .reg_offset = OMAP_MUX_TERMINATOR }, 210 { .reg_offset = OMAP_MUX_TERMINATOR },
189}; 211};
190#endif 212#endif
@@ -205,6 +227,8 @@ static void __init omap3logic_init(void)
205 board_mmc_init(); 227 board_mmc_init();
206 board_smsc911x_init(); 228 board_smsc911x_init();
207 229
230 usb_musb_init(NULL);
231
208 /* Ensure SDRC pins are mux'd for self-refresh */ 232 /* Ensure SDRC pins are mux'd for self-refresh */
209 omap_mux_init_signal("sdrc_cke0", OMAP_PIN_OUTPUT); 233 omap_mux_init_signal("sdrc_cke0", OMAP_PIN_OUTPUT);
210 omap_mux_init_signal("sdrc_cke1", OMAP_PIN_OUTPUT); 234 omap_mux_init_signal("sdrc_cke1", OMAP_PIN_OUTPUT);
diff --git a/arch/arm/mach-omap2/board-omap4panda.c b/arch/arm/mach-omap2/board-omap4panda.c
index bb75eb091a88..68b8fc9ff010 100644
--- a/arch/arm/mach-omap2/board-omap4panda.c
+++ b/arch/arm/mach-omap2/board-omap4panda.c
@@ -28,6 +28,7 @@
28#include <linux/mfd/twl6040.h> 28#include <linux/mfd/twl6040.h>
29#include <linux/regulator/machine.h> 29#include <linux/regulator/machine.h>
30#include <linux/regulator/fixed.h> 30#include <linux/regulator/fixed.h>
31#include <linux/ti_wilink_st.h>
31#include <linux/wl12xx.h> 32#include <linux/wl12xx.h>
32#include <linux/platform_data/omap-abe-twl6040.h> 33#include <linux/platform_data/omap-abe-twl6040.h>
33 34
@@ -58,12 +59,21 @@
58#define HDMI_GPIO_HPD 63 /* Hotplug detect */ 59#define HDMI_GPIO_HPD 63 /* Hotplug detect */
59 60
60/* wl127x BT, FM, GPS connectivity chip */ 61/* wl127x BT, FM, GPS connectivity chip */
61static int wl1271_gpios[] = {46, -1, -1}; 62static struct ti_st_plat_data wilink_platform_data = {
63 .nshutdown_gpio = 46,
64 .dev_name = "/dev/ttyO1",
65 .flow_cntrl = 1,
66 .baud_rate = 3000000,
67 .chip_enable = NULL,
68 .suspend = NULL,
69 .resume = NULL,
70};
71
62static struct platform_device wl1271_device = { 72static struct platform_device wl1271_device = {
63 .name = "kim", 73 .name = "kim",
64 .id = -1, 74 .id = -1,
65 .dev = { 75 .dev = {
66 .platform_data = &wl1271_gpios, 76 .platform_data = &wilink_platform_data,
67 }, 77 },
68}; 78};
69 79
@@ -117,6 +127,11 @@ static struct platform_device panda_abe_audio = {
117 }, 127 },
118}; 128};
119 129
130static struct platform_device panda_hdmi_audio_codec = {
131 .name = "hdmi-audio-codec",
132 .id = -1,
133};
134
120static struct platform_device btwilink_device = { 135static struct platform_device btwilink_device = {
121 .name = "btwilink", 136 .name = "btwilink",
122 .id = -1, 137 .id = -1,
@@ -126,6 +141,7 @@ static struct platform_device *panda_devices[] __initdata = {
126 &leds_gpio, 141 &leds_gpio,
127 &wl1271_device, 142 &wl1271_device,
128 &panda_abe_audio, 143 &panda_abe_audio,
144 &panda_hdmi_audio_codec,
129 &btwilink_device, 145 &btwilink_device,
130}; 146};
131 147
@@ -274,7 +290,9 @@ static int __init omap4_panda_i2c_init(void)
274 TWL_COMMON_REGULATOR_VANA | 290 TWL_COMMON_REGULATOR_VANA |
275 TWL_COMMON_REGULATOR_VCXIO | 291 TWL_COMMON_REGULATOR_VCXIO |
276 TWL_COMMON_REGULATOR_VUSB | 292 TWL_COMMON_REGULATOR_VUSB |
277 TWL_COMMON_REGULATOR_CLK32KG); 293 TWL_COMMON_REGULATOR_CLK32KG |
294 TWL_COMMON_REGULATOR_V1V8 |
295 TWL_COMMON_REGULATOR_V2V1);
278 omap4_pmic_init("twl6030", &omap4_panda_twldata, 296 omap4_pmic_init("twl6030", &omap4_panda_twldata,
279 &twl6040_data, OMAP44XX_IRQ_SYS_2N); 297 &twl6040_data, OMAP44XX_IRQ_SYS_2N);
280 omap_register_i2c_bus(2, 400, NULL, 0); 298 omap_register_i2c_bus(2, 400, NULL, 0);
diff --git a/arch/arm/mach-omap2/board-rx51-peripherals.c b/arch/arm/mach-omap2/board-rx51-peripherals.c
index ae957c92081b..ff53deccecab 100644
--- a/arch/arm/mach-omap2/board-rx51-peripherals.c
+++ b/arch/arm/mach-omap2/board-rx51-peripherals.c
@@ -44,6 +44,7 @@
44#include <linux/leds-lp5523.h> 44#include <linux/leds-lp5523.h>
45 45
46#include <../drivers/staging/iio/light/tsl2563.h> 46#include <../drivers/staging/iio/light/tsl2563.h>
47#include <linux/lis3lv02d.h>
47 48
48#include "mux.h" 49#include "mux.h"
49#include "hsmmc.h" 50#include "hsmmc.h"
@@ -63,6 +64,9 @@
63#define RX51_TSC2005_RESET_GPIO 104 64#define RX51_TSC2005_RESET_GPIO 104
64#define RX51_TSC2005_IRQ_GPIO 100 65#define RX51_TSC2005_IRQ_GPIO 100
65 66
67#define LIS302_IRQ1_GPIO 181
68#define LIS302_IRQ2_GPIO 180 /* Not yet in use */
69
66/* list all spi devices here */ 70/* list all spi devices here */
67enum { 71enum {
68 RX51_SPI_WL1251, 72 RX51_SPI_WL1251,
@@ -73,6 +77,77 @@ enum {
73static struct wl12xx_platform_data wl1251_pdata; 77static struct wl12xx_platform_data wl1251_pdata;
74static struct tsc2005_platform_data tsc2005_pdata; 78static struct tsc2005_platform_data tsc2005_pdata;
75 79
80#if defined(CONFIG_SENSORS_LIS3_I2C) || defined(CONFIG_SENSORS_LIS3_I2C_MODULE)
81static int lis302_setup(void)
82{
83 int err;
84 int irq1 = LIS302_IRQ1_GPIO;
85 int irq2 = LIS302_IRQ2_GPIO;
86
87 /* gpio for interrupt pin 1 */
88 err = gpio_request(irq1, "lis3lv02dl_irq1");
89 if (err) {
90 printk(KERN_ERR "lis3lv02dl: gpio request failed\n");
91 goto out;
92 }
93
94 /* gpio for interrupt pin 2 */
95 err = gpio_request(irq2, "lis3lv02dl_irq2");
96 if (err) {
97 gpio_free(irq1);
98 printk(KERN_ERR "lis3lv02dl: gpio request failed\n");
99 goto out;
100 }
101
102 gpio_direction_input(irq1);
103 gpio_direction_input(irq2);
104
105out:
106 return err;
107}
108
109static int lis302_release(void)
110{
111 gpio_free(LIS302_IRQ1_GPIO);
112 gpio_free(LIS302_IRQ2_GPIO);
113
114 return 0;
115}
116
117static struct lis3lv02d_platform_data rx51_lis3lv02d_data = {
118 .click_flags = LIS3_CLICK_SINGLE_X | LIS3_CLICK_SINGLE_Y |
119 LIS3_CLICK_SINGLE_Z,
120 /* Limits are 0.5g * value */
121 .click_thresh_x = 8,
122 .click_thresh_y = 8,
123 .click_thresh_z = 10,
124 /* Click must be longer than time limit */
125 .click_time_limit = 9,
126 /* Kind of debounce filter */
127 .click_latency = 50,
128
129 /* Limits for all axis. millig-value / 18 to get HW values */
130 .wakeup_flags = LIS3_WAKEUP_X_HI | LIS3_WAKEUP_Y_HI,
131 .wakeup_thresh = 800 / 18,
132 .wakeup_flags2 = LIS3_WAKEUP_Z_HI ,
133 .wakeup_thresh2 = 900 / 18,
134
135 .hipass_ctrl = LIS3_HIPASS1_DISABLE | LIS3_HIPASS2_DISABLE,
136
137 /* Interrupt line 2 for click detection, line 1 for thresholds */
138 .irq_cfg = LIS3_IRQ2_CLICK | LIS3_IRQ1_FF_WU_12,
139
140 .axis_x = LIS3_DEV_X,
141 .axis_y = LIS3_INV_DEV_Y,
142 .axis_z = LIS3_INV_DEV_Z,
143 .setup_resources = lis302_setup,
144 .release_resources = lis302_release,
145 .st_min_limits = {-32, 3, 3},
146 .st_max_limits = {-3, 32, 32},
147 .irq2 = OMAP_GPIO_IRQ(LIS302_IRQ2_GPIO),
148};
149#endif
150
76#if defined(CONFIG_SENSORS_TSL2563) || defined(CONFIG_SENSORS_TSL2563_MODULE) 151#if defined(CONFIG_SENSORS_TSL2563) || defined(CONFIG_SENSORS_TSL2563_MODULE)
77static struct tsl2563_platform_data rx51_tsl2563_platform_data = { 152static struct tsl2563_platform_data rx51_tsl2563_platform_data = {
78 .cover_comp_gain = 16, 153 .cover_comp_gain = 16,
@@ -950,6 +1025,16 @@ static struct i2c_board_info __initdata rx51_peripherals_i2c_board_info_2[] = {
950 } 1025 }
951}; 1026};
952 1027
1028static struct i2c_board_info __initdata rx51_peripherals_i2c_board_info_3[] = {
1029#if defined(CONFIG_SENSORS_LIS3_I2C) || defined(CONFIG_SENSORS_LIS3_I2C_MODULE)
1030 {
1031 I2C_BOARD_INFO("lis3lv02d", 0x1d),
1032 .platform_data = &rx51_lis3lv02d_data,
1033 .irq = OMAP_GPIO_IRQ(LIS302_IRQ1_GPIO),
1034 },
1035#endif
1036};
1037
953static int __init rx51_i2c_init(void) 1038static int __init rx51_i2c_init(void)
954{ 1039{
955 if ((system_rev >= SYSTEM_REV_S_USES_VAUX3 && system_rev < 0x100) || 1040 if ((system_rev >= SYSTEM_REV_S_USES_VAUX3 && system_rev < 0x100) ||
@@ -971,7 +1056,8 @@ static int __init rx51_i2c_init(void)
971 omap_pmic_init(1, 2200, "twl5030", INT_34XX_SYS_NIRQ, &rx51_twldata); 1056 omap_pmic_init(1, 2200, "twl5030", INT_34XX_SYS_NIRQ, &rx51_twldata);
972 omap_register_i2c_bus(2, 100, rx51_peripherals_i2c_board_info_2, 1057 omap_register_i2c_bus(2, 100, rx51_peripherals_i2c_board_info_2,
973 ARRAY_SIZE(rx51_peripherals_i2c_board_info_2)); 1058 ARRAY_SIZE(rx51_peripherals_i2c_board_info_2));
974 omap_register_i2c_bus(3, 400, NULL, 0); 1059 omap_register_i2c_bus(3, 400, rx51_peripherals_i2c_board_info_3,
1060 ARRAY_SIZE(rx51_peripherals_i2c_board_info_3));
975 return 0; 1061 return 0;
976} 1062}
977 1063
diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c
index 84fa55b4c8b9..ae62ece04ef9 100644
--- a/arch/arm/mach-omap2/devices.c
+++ b/arch/arm/mach-omap2/devices.c
@@ -354,6 +354,36 @@ static void __init omap_init_dmic(void)
354static inline void omap_init_dmic(void) {} 354static inline void omap_init_dmic(void) {}
355#endif 355#endif
356 356
357#if defined(CONFIG_SND_OMAP_SOC_OMAP_HDMI) || \
358 defined(CONFIG_SND_OMAP_SOC_OMAP_HDMI_MODULE)
359
360static struct platform_device omap_hdmi_audio = {
361 .name = "omap-hdmi-audio",
362 .id = -1,
363};
364
365static void __init omap_init_hdmi_audio(void)
366{
367 struct omap_hwmod *oh;
368 struct platform_device *pdev;
369
370 oh = omap_hwmod_lookup("dss_hdmi");
371 if (!oh) {
372 printk(KERN_ERR "Could not look up dss_hdmi hw_mod\n");
373 return;
374 }
375
376 pdev = omap_device_build("omap-hdmi-audio-dai",
377 -1, oh, NULL, 0, NULL, 0, 0);
378 WARN(IS_ERR(pdev),
379 "Can't build omap_device for omap-hdmi-audio-dai.\n");
380
381 platform_device_register(&omap_hdmi_audio);
382}
383#else
384static inline void omap_init_hdmi_audio(void) {}
385#endif
386
357#if defined(CONFIG_SPI_OMAP24XX) || defined(CONFIG_SPI_OMAP24XX_MODULE) 387#if defined(CONFIG_SPI_OMAP24XX) || defined(CONFIG_SPI_OMAP24XX_MODULE)
358 388
359#include <plat/mcspi.h> 389#include <plat/mcspi.h>
@@ -701,6 +731,7 @@ static int __init omap2_init_devices(void)
701 */ 731 */
702 omap_init_audio(); 732 omap_init_audio();
703 omap_init_camera(); 733 omap_init_camera();
734 omap_init_hdmi_audio();
704 omap_init_mbox(); 735 omap_init_mbox();
705 /* If dtb is there, the devices will be created dynamically */ 736 /* If dtb is there, the devices will be created dynamically */
706 if (!of_have_populated_dt()) { 737 if (!of_have_populated_dt()) {
diff --git a/arch/arm/mach-omap2/twl-common.c b/arch/arm/mach-omap2/twl-common.c
index ee6596b45214..119d5a910f3a 100644
--- a/arch/arm/mach-omap2/twl-common.c
+++ b/arch/arm/mach-omap2/twl-common.c
@@ -266,6 +266,7 @@ static struct regulator_init_data omap4_vdac_idata = {
266 .valid_ops_mask = REGULATOR_CHANGE_MODE 266 .valid_ops_mask = REGULATOR_CHANGE_MODE
267 | REGULATOR_CHANGE_STATUS, 267 | REGULATOR_CHANGE_STATUS,
268 }, 268 },
269 .supply_regulator = "V2V1",
269}; 270};
270 271
271static struct regulator_init_data omap4_vaux2_idata = { 272static struct regulator_init_data omap4_vaux2_idata = {
@@ -356,6 +357,7 @@ static struct regulator_init_data omap4_vcxio_idata = {
356 }, 357 },
357 .num_consumer_supplies = ARRAY_SIZE(omap4_vcxio_supply), 358 .num_consumer_supplies = ARRAY_SIZE(omap4_vcxio_supply),
358 .consumer_supplies = omap4_vcxio_supply, 359 .consumer_supplies = omap4_vcxio_supply,
360 .supply_regulator = "V2V1",
359}; 361};
360 362
361static struct regulator_init_data omap4_vusb_idata = { 363static struct regulator_init_data omap4_vusb_idata = {
@@ -439,6 +441,41 @@ static struct twl_regulator_driver_data omap4_vdd3_drvdata = {
439 .set_voltage = twl_set_voltage, 441 .set_voltage = twl_set_voltage,
440}; 442};
441 443
444static struct regulator_consumer_supply omap4_v1v8_supply[] = {
445 REGULATOR_SUPPLY("vio", "1-004b"),
446};
447
448static struct regulator_init_data omap4_v1v8_idata = {
449 .constraints = {
450 .min_uV = 1800000,
451 .max_uV = 1800000,
452 .valid_modes_mask = REGULATOR_MODE_NORMAL
453 | REGULATOR_MODE_STANDBY,
454 .valid_ops_mask = REGULATOR_CHANGE_MODE
455 | REGULATOR_CHANGE_STATUS,
456 .always_on = true,
457 },
458 .num_consumer_supplies = ARRAY_SIZE(omap4_v1v8_supply),
459 .consumer_supplies = omap4_v1v8_supply,
460};
461
462static struct regulator_consumer_supply omap4_v2v1_supply[] = {
463 REGULATOR_SUPPLY("v2v1", "1-004b"),
464};
465
466static struct regulator_init_data omap4_v2v1_idata = {
467 .constraints = {
468 .min_uV = 2100000,
469 .max_uV = 2100000,
470 .valid_modes_mask = REGULATOR_MODE_NORMAL
471 | REGULATOR_MODE_STANDBY,
472 .valid_ops_mask = REGULATOR_CHANGE_MODE
473 | REGULATOR_CHANGE_STATUS,
474 },
475 .num_consumer_supplies = ARRAY_SIZE(omap4_v2v1_supply),
476 .consumer_supplies = omap4_v2v1_supply,
477};
478
442void __init omap4_pmic_get_config(struct twl4030_platform_data *pmic_data, 479void __init omap4_pmic_get_config(struct twl4030_platform_data *pmic_data,
443 u32 pdata_flags, u32 regulators_flags) 480 u32 pdata_flags, u32 regulators_flags)
444{ 481{
@@ -497,5 +534,11 @@ void __init omap4_pmic_get_config(struct twl4030_platform_data *pmic_data,
497 if (regulators_flags & TWL_COMMON_REGULATOR_CLK32KG && 534 if (regulators_flags & TWL_COMMON_REGULATOR_CLK32KG &&
498 !pmic_data->clk32kg) 535 !pmic_data->clk32kg)
499 pmic_data->clk32kg = &omap4_clk32kg_idata; 536 pmic_data->clk32kg = &omap4_clk32kg_idata;
537
538 if (regulators_flags & TWL_COMMON_REGULATOR_V1V8 && !pmic_data->v1v8)
539 pmic_data->v1v8 = &omap4_v1v8_idata;
540
541 if (regulators_flags & TWL_COMMON_REGULATOR_V2V1 && !pmic_data->v2v1)
542 pmic_data->v2v1 = &omap4_v2v1_idata;
500} 543}
501#endif /* CONFIG_ARCH_OMAP4 */ 544#endif /* CONFIG_ARCH_OMAP4 */
diff --git a/arch/arm/mach-omap2/twl-common.h b/arch/arm/mach-omap2/twl-common.h
index 09627483a57f..8fe71cfd002c 100644
--- a/arch/arm/mach-omap2/twl-common.h
+++ b/arch/arm/mach-omap2/twl-common.h
@@ -22,6 +22,8 @@
22#define TWL_COMMON_REGULATOR_VCXIO (1 << 8) 22#define TWL_COMMON_REGULATOR_VCXIO (1 << 8)
23#define TWL_COMMON_REGULATOR_VUSB (1 << 9) 23#define TWL_COMMON_REGULATOR_VUSB (1 << 9)
24#define TWL_COMMON_REGULATOR_CLK32KG (1 << 10) 24#define TWL_COMMON_REGULATOR_CLK32KG (1 << 10)
25#define TWL_COMMON_REGULATOR_V1V8 (1 << 11)
26#define TWL_COMMON_REGULATOR_V2V1 (1 << 12)
25 27
26/* TWL4030 LDO regulators */ 28/* TWL4030 LDO regulators */
27#define TWL_COMMON_REGULATOR_VPLL1 (1 << 4) 29#define TWL_COMMON_REGULATOR_VPLL1 (1 << 4)
diff --git a/arch/arm/mach-orion5x/dns323-setup.c b/arch/arm/mach-orion5x/dns323-setup.c
index 8c06ccac44c2..d470864b4e42 100644
--- a/arch/arm/mach-orion5x/dns323-setup.c
+++ b/arch/arm/mach-orion5x/dns323-setup.c
@@ -252,27 +252,6 @@ error_fail:
252 * GPIO LEDs (simple - doesn't use hardware blinking support) 252 * GPIO LEDs (simple - doesn't use hardware blinking support)
253 */ 253 */
254 254
255#define ORION_BLINK_HALF_PERIOD 100 /* ms */
256
257static int dns323_gpio_blink_set(unsigned gpio, int state,
258 unsigned long *delay_on, unsigned long *delay_off)
259{
260
261 if (delay_on && delay_off && !*delay_on && !*delay_off)
262 *delay_on = *delay_off = ORION_BLINK_HALF_PERIOD;
263
264 switch(state) {
265 case GPIO_LED_NO_BLINK_LOW:
266 case GPIO_LED_NO_BLINK_HIGH:
267 orion_gpio_set_blink(gpio, 0);
268 gpio_set_value(gpio, state);
269 break;
270 case GPIO_LED_BLINK:
271 orion_gpio_set_blink(gpio, 1);
272 }
273 return 0;
274}
275
276static struct gpio_led dns323ab_leds[] = { 255static struct gpio_led dns323ab_leds[] = {
277 { 256 {
278 .name = "power:blue", 257 .name = "power:blue",
@@ -311,13 +290,13 @@ static struct gpio_led dns323c_leds[] = {
311static struct gpio_led_platform_data dns323ab_led_data = { 290static struct gpio_led_platform_data dns323ab_led_data = {
312 .num_leds = ARRAY_SIZE(dns323ab_leds), 291 .num_leds = ARRAY_SIZE(dns323ab_leds),
313 .leds = dns323ab_leds, 292 .leds = dns323ab_leds,
314 .gpio_blink_set = dns323_gpio_blink_set, 293 .gpio_blink_set = orion_gpio_led_blink_set,
315}; 294};
316 295
317static struct gpio_led_platform_data dns323c_led_data = { 296static struct gpio_led_platform_data dns323c_led_data = {
318 .num_leds = ARRAY_SIZE(dns323c_leds), 297 .num_leds = ARRAY_SIZE(dns323c_leds),
319 .leds = dns323c_leds, 298 .leds = dns323c_leds,
320 .gpio_blink_set = dns323_gpio_blink_set, 299 .gpio_blink_set = orion_gpio_led_blink_set,
321}; 300};
322 301
323static struct platform_device dns323_gpio_leds = { 302static struct platform_device dns323_gpio_leds = {
diff --git a/arch/arm/mach-pxa/balloon3.c b/arch/arm/mach-pxa/balloon3.c
index c35456f02acb..56e8cebeb7d5 100644
--- a/arch/arm/mach-pxa/balloon3.c
+++ b/arch/arm/mach-pxa/balloon3.c
@@ -732,9 +732,7 @@ static inline void balloon3_nand_init(void) {}
732#if defined(CONFIG_REGULATOR_MAX1586) || \ 732#if defined(CONFIG_REGULATOR_MAX1586) || \
733 defined(CONFIG_REGULATOR_MAX1586_MODULE) 733 defined(CONFIG_REGULATOR_MAX1586_MODULE)
734static struct regulator_consumer_supply balloon3_max1587a_consumers[] = { 734static struct regulator_consumer_supply balloon3_max1587a_consumers[] = {
735 { 735 REGULATOR_SUPPLY("vcc_core", NULL),
736 .supply = "vcc_core",
737 }
738}; 736};
739 737
740static struct regulator_init_data balloon3_max1587a_v3_info = { 738static struct regulator_init_data balloon3_max1587a_v3_info = {
diff --git a/arch/arm/mach-pxa/cm-x300.c b/arch/arm/mach-pxa/cm-x300.c
index 313274016277..3e4e9fe2d462 100644
--- a/arch/arm/mach-pxa/cm-x300.c
+++ b/arch/arm/mach-pxa/cm-x300.c
@@ -713,9 +713,7 @@ struct da9030_battery_info cm_x300_battery_info = {
713}; 713};
714 714
715static struct regulator_consumer_supply buck2_consumers[] = { 715static struct regulator_consumer_supply buck2_consumers[] = {
716 { 716 REGULATOR_SUPPLY("vcc_core", NULL),
717 .supply = "vcc_core",
718 },
719}; 717};
720 718
721static struct regulator_init_data buck2_data = { 719static struct regulator_init_data buck2_data = {
diff --git a/arch/arm/mach-pxa/em-x270.c b/arch/arm/mach-pxa/em-x270.c
index 16ec557b8e43..a3a4a38d4972 100644
--- a/arch/arm/mach-pxa/em-x270.c
+++ b/arch/arm/mach-pxa/em-x270.c
@@ -1085,10 +1085,7 @@ static void __init em_x270_userspace_consumers_init(void)
1085/* DA9030 related initializations */ 1085/* DA9030 related initializations */
1086#define REGULATOR_CONSUMER(_name, _dev_name, _supply) \ 1086#define REGULATOR_CONSUMER(_name, _dev_name, _supply) \
1087 static struct regulator_consumer_supply _name##_consumers[] = { \ 1087 static struct regulator_consumer_supply _name##_consumers[] = { \
1088 { \ 1088 REGULATOR_SUPPLY(_supply, _dev_name), \
1089 .dev_name = _dev_name, \
1090 .supply = _supply, \
1091 }, \
1092 } 1089 }
1093 1090
1094REGULATOR_CONSUMER(ldo3, "reg-userspace-consumer.0", "vcc gps"); 1091REGULATOR_CONSUMER(ldo3, "reg-userspace-consumer.0", "vcc gps");
diff --git a/arch/arm/mach-pxa/hx4700.c b/arch/arm/mach-pxa/hx4700.c
index b83b95a29503..d09da6a746b8 100644
--- a/arch/arm/mach-pxa/hx4700.c
+++ b/arch/arm/mach-pxa/hx4700.c
@@ -22,6 +22,7 @@
22#include <linux/gpio.h> 22#include <linux/gpio.h>
23#include <linux/gpio_keys.h> 23#include <linux/gpio_keys.h>
24#include <linux/input.h> 24#include <linux/input.h>
25#include <linux/input/navpoint.h>
25#include <linux/lcd.h> 26#include <linux/lcd.h>
26#include <linux/mfd/htc-egpio.h> 27#include <linux/mfd/htc-egpio.h>
27#include <linux/mfd/asic3.h> 28#include <linux/mfd/asic3.h>
@@ -102,6 +103,10 @@ static unsigned long hx4700_pin_config[] __initdata = {
102 GPIO44_BTUART_CTS, 103 GPIO44_BTUART_CTS,
103 GPIO45_BTUART_RTS_LPM_LOW, 104 GPIO45_BTUART_RTS_LPM_LOW,
104 105
106 /* STUART (IRDA) */
107 GPIO46_STUART_RXD,
108 GPIO47_STUART_TXD,
109
105 /* PWM 1 (Backlight) */ 110 /* PWM 1 (Backlight) */
106 GPIO17_PWM1_OUT, 111 GPIO17_PWM1_OUT,
107 112
@@ -113,7 +118,7 @@ static unsigned long hx4700_pin_config[] __initdata = {
113 GPIO113_I2S_SYSCLK, 118 GPIO113_I2S_SYSCLK,
114 119
115 /* SSP 1 (NavPoint) */ 120 /* SSP 1 (NavPoint) */
116 GPIO23_SSP1_SCLK, 121 GPIO23_SSP1_SCLK_IN,
117 GPIO24_SSP1_SFRM, 122 GPIO24_SSP1_SFRM,
118 GPIO25_SSP1_TXD, 123 GPIO25_SSP1_TXD,
119 GPIO26_SSP1_RXD, 124 GPIO26_SSP1_RXD,
@@ -125,10 +130,13 @@ static unsigned long hx4700_pin_config[] __initdata = {
125 GPIO88_GPIO, 130 GPIO88_GPIO,
126 131
127 /* HX4700 specific input GPIOs */ 132 /* HX4700 specific input GPIOs */
128 GPIO12_GPIO, /* ASIC3_IRQ */ 133 GPIO12_GPIO | WAKEUP_ON_EDGE_RISE, /* ASIC3_IRQ */
129 GPIO13_GPIO, /* W3220_IRQ */ 134 GPIO13_GPIO, /* W3220_IRQ */
130 GPIO14_GPIO, /* nWLAN_IRQ */ 135 GPIO14_GPIO, /* nWLAN_IRQ */
131 136
137 /* HX4700 specific output GPIOs */
138 GPIO102_GPIO | MFP_LPM_DRIVE_LOW, /* SYNAPTICS_POWER_ON */
139
132 GPIO10_GPIO, /* GSM_IRQ */ 140 GPIO10_GPIO, /* GSM_IRQ */
133 GPIO13_GPIO, /* CPLD_IRQ */ 141 GPIO13_GPIO, /* CPLD_IRQ */
134 GPIO107_GPIO, /* DS1WM_IRQ */ 142 GPIO107_GPIO, /* DS1WM_IRQ */
@@ -183,6 +191,23 @@ static struct platform_device gpio_keys = {
183}; 191};
184 192
185/* 193/*
194 * Synaptics NavPoint connected to SSP1
195 */
196
197static struct navpoint_platform_data navpoint_platform_data = {
198 .port = 1,
199 .gpio = GPIO102_HX4700_SYNAPTICS_POWER_ON,
200};
201
202static struct platform_device navpoint = {
203 .name = "navpoint",
204 .id = -1,
205 .dev = {
206 .platform_data = &navpoint_platform_data,
207 },
208};
209
210/*
186 * ASIC3 211 * ASIC3
187 */ 212 */
188 213
@@ -227,7 +252,6 @@ static u16 asic3_gpio_config[] = {
227 ASIC3_GPIOC0_LED0, /* red */ 252 ASIC3_GPIOC0_LED0, /* red */
228 ASIC3_GPIOC1_LED1, /* green */ 253 ASIC3_GPIOC1_LED1, /* green */
229 ASIC3_GPIOC2_LED2, /* blue */ 254 ASIC3_GPIOC2_LED2, /* blue */
230 ASIC3_GPIOC4_CF_nCD,
231 ASIC3_GPIOC5_nCIOW, 255 ASIC3_GPIOC5_nCIOW,
232 ASIC3_GPIOC6_nCIOR, 256 ASIC3_GPIOC6_nCIOR,
233 ASIC3_GPIOC7_nPCE_1, 257 ASIC3_GPIOC7_nPCE_1,
@@ -241,6 +265,7 @@ static u16 asic3_gpio_config[] = {
241 ASIC3_GPIOC15_nPIOR, 265 ASIC3_GPIOC15_nPIOR,
242 266
243 /* GPIOD: input GPIOs, CF */ 267 /* GPIOD: input GPIOs, CF */
268 ASIC3_GPIOD4_CF_nCD,
244 ASIC3_GPIOD11_nCIOIS16, 269 ASIC3_GPIOD11_nCIOIS16,
245 ASIC3_GPIOD12_nCWAIT, 270 ASIC3_GPIOD12_nCWAIT,
246 ASIC3_GPIOD15_nPIOW, 271 ASIC3_GPIOD15_nPIOW,
@@ -291,6 +316,7 @@ static struct asic3_platform_data asic3_platform_data = {
291 .gpio_config_num = ARRAY_SIZE(asic3_gpio_config), 316 .gpio_config_num = ARRAY_SIZE(asic3_gpio_config),
292 .irq_base = IRQ_BOARD_START, 317 .irq_base = IRQ_BOARD_START,
293 .gpio_base = HX4700_ASIC3_GPIO_BASE, 318 .gpio_base = HX4700_ASIC3_GPIO_BASE,
319 .clock_rate = 4000000,
294 .leds = asic3_leds, 320 .leds = asic3_leds,
295}; 321};
296 322
@@ -680,12 +706,8 @@ static struct platform_device power_supply = {
680 */ 706 */
681 707
682static struct regulator_consumer_supply bq24022_consumers[] = { 708static struct regulator_consumer_supply bq24022_consumers[] = {
683 { 709 REGULATOR_SUPPLY("vbus_draw", NULL),
684 .supply = "vbus_draw", 710 REGULATOR_SUPPLY("ac_draw", NULL),
685 },
686 {
687 .supply = "ac_draw",
688 },
689}; 711};
690 712
691static struct regulator_init_data bq24022_init_data = { 713static struct regulator_init_data bq24022_init_data = {
@@ -764,9 +786,8 @@ static struct platform_device strataflash = {
764 * Maxim MAX1587A on PI2C 786 * Maxim MAX1587A on PI2C
765 */ 787 */
766 788
767static struct regulator_consumer_supply max1587a_consumer = { 789static struct regulator_consumer_supply max1587a_consumer =
768 .supply = "vcc_core", 790 REGULATOR_SUPPLY("vcc_core", NULL);
769};
770 791
771static struct regulator_init_data max1587a_v3_info = { 792static struct regulator_init_data max1587a_v3_info = {
772 .constraints = { 793 .constraints = {
@@ -828,6 +849,7 @@ static struct platform_device audio = {
828static struct platform_device *devices[] __initdata = { 849static struct platform_device *devices[] __initdata = {
829 &asic3, 850 &asic3,
830 &gpio_keys, 851 &gpio_keys,
852 &navpoint,
831 &backlight, 853 &backlight,
832 &w3220, 854 &w3220,
833 &hx4700_lcd, 855 &hx4700_lcd,
@@ -859,6 +881,7 @@ static void __init hx4700_init(void)
859 int ret; 881 int ret;
860 882
861 pxa2xx_mfp_config(ARRAY_AND_SIZE(hx4700_pin_config)); 883 pxa2xx_mfp_config(ARRAY_AND_SIZE(hx4700_pin_config));
884 gpio_set_wake(GPIO12_HX4700_ASIC3_IRQ, 1);
862 ret = gpio_request_array(ARRAY_AND_SIZE(global_gpios)); 885 ret = gpio_request_array(ARRAY_AND_SIZE(global_gpios));
863 if (ret) 886 if (ret)
864 pr_err ("hx4700: Failed to request GPIOs.\n"); 887 pr_err ("hx4700: Failed to request GPIOs.\n");
diff --git a/arch/arm/mach-pxa/include/mach/mfp-pxa27x.h b/arch/arm/mach-pxa/include/mach/mfp-pxa27x.h
index a65867209aa0..a611ad3153c7 100644
--- a/arch/arm/mach-pxa/include/mach/mfp-pxa27x.h
+++ b/arch/arm/mach-pxa/include/mach/mfp-pxa27x.h
@@ -208,6 +208,7 @@
208#define GPIO113_I2S_SYSCLK MFP_CFG_OUT(GPIO113, AF1, DRIVE_LOW) 208#define GPIO113_I2S_SYSCLK MFP_CFG_OUT(GPIO113, AF1, DRIVE_LOW)
209 209
210/* SSP 1 */ 210/* SSP 1 */
211#define GPIO23_SSP1_SCLK_IN MFP_CFG_IN(GPIO23, AF2)
211#define GPIO23_SSP1_SCLK MFP_CFG_OUT(GPIO23, AF2, DRIVE_LOW) 212#define GPIO23_SSP1_SCLK MFP_CFG_OUT(GPIO23, AF2, DRIVE_LOW)
212#define GPIO29_SSP1_SCLK MFP_CFG_IN(GPIO29, AF3) 213#define GPIO29_SSP1_SCLK MFP_CFG_IN(GPIO29, AF3)
213#define GPIO27_SSP1_SYSCLK MFP_CFG_OUT(GPIO27, AF1, DRIVE_LOW) 214#define GPIO27_SSP1_SYSCLK MFP_CFG_OUT(GPIO27, AF1, DRIVE_LOW)
diff --git a/arch/arm/mach-pxa/include/mach/mioa701.h b/arch/arm/mach-pxa/include/mach/mioa701.h
index 02868447b0b1..e57f5c724e8a 100644
--- a/arch/arm/mach-pxa/include/mach/mioa701.h
+++ b/arch/arm/mach-pxa/include/mach/mioa701.h
@@ -61,6 +61,9 @@
61#define GPIO93_KEY_VOLUME_UP 93 61#define GPIO93_KEY_VOLUME_UP 93
62#define GPIO94_KEY_VOLUME_DOWN 94 62#define GPIO94_KEY_VOLUME_DOWN 94
63 63
64/* Camera */
65#define GPIO56_MT9M111_nOE 56
66
64extern struct input_dev *mioa701_evdev; 67extern struct input_dev *mioa701_evdev;
65extern void mioa701_gpio_lpm_set(unsigned long mfp_pin); 68extern void mioa701_gpio_lpm_set(unsigned long mfp_pin);
66 69
diff --git a/arch/arm/mach-pxa/include/mach/pcm990_baseboard.h b/arch/arm/mach-pxa/include/mach/pcm990_baseboard.h
index d72791695b26..0260aaa2fc17 100644
--- a/arch/arm/mach-pxa/include/mach/pcm990_baseboard.h
+++ b/arch/arm/mach-pxa/include/mach/pcm990_baseboard.h
@@ -31,7 +31,6 @@
31#define PCM990_CTRL_INT_IRQ PXA_GPIO_TO_IRQ(PCM990_CTRL_INT_IRQ_GPIO) 31#define PCM990_CTRL_INT_IRQ PXA_GPIO_TO_IRQ(PCM990_CTRL_INT_IRQ_GPIO)
32#define PCM990_CTRL_INT_IRQ_EDGE IRQ_TYPE_EDGE_RISING 32#define PCM990_CTRL_INT_IRQ_EDGE IRQ_TYPE_EDGE_RISING
33#define PCM990_CTRL_PHYS PXA_CS1_PHYS /* 16-Bit */ 33#define PCM990_CTRL_PHYS PXA_CS1_PHYS /* 16-Bit */
34#define PCM990_CTRL_BASE 0xea000000
35#define PCM990_CTRL_SIZE (1*1024*1024) 34#define PCM990_CTRL_SIZE (1*1024*1024)
36 35
37#define PCM990_CTRL_PWR_IRQ_GPIO 14 36#define PCM990_CTRL_PWR_IRQ_GPIO 14
@@ -69,13 +68,13 @@
69#define PCM990_CTRL_MMC2DE 0x0004 /* R MMC2 Card detect */ 68#define PCM990_CTRL_MMC2DE 0x0004 /* R MMC2 Card detect */
70#define PCM990_CTRL_MMC2WP 0x0008 /* R MMC2 Card write protect */ 69#define PCM990_CTRL_MMC2WP 0x0008 /* R MMC2 Card write protect */
71 70
72#define PCM990_CTRL_REG6 0x000C /* Interrupt Clear REGISTER */ 71#define PCM990_CTRL_INTSETCLR 0x000C /* Interrupt Clear REGISTER */
73#define PCM990_CTRL_INTC0 0x0001 /* Clear Reg BT Detect */ 72#define PCM990_CTRL_INTC0 0x0001 /* Clear Reg BT Detect */
74#define PCM990_CTRL_INTC1 0x0002 /* Clear Reg FR RI */ 73#define PCM990_CTRL_INTC1 0x0002 /* Clear Reg FR RI */
75#define PCM990_CTRL_INTC2 0x0004 /* Clear Reg MMC1 Detect */ 74#define PCM990_CTRL_INTC2 0x0004 /* Clear Reg MMC1 Detect */
76#define PCM990_CTRL_INTC3 0x0008 /* Clear Reg PM_5V off */ 75#define PCM990_CTRL_INTC3 0x0008 /* Clear Reg PM_5V off */
77 76
78#define PCM990_CTRL_REG7 0x000E /* Interrupt Enable REGISTER */ 77#define PCM990_CTRL_INTMSKENA 0x000E /* Interrupt Enable REGISTER */
79#define PCM990_CTRL_ENAINT0 0x0001 /* Enable Int BT Detect */ 78#define PCM990_CTRL_ENAINT0 0x0001 /* Enable Int BT Detect */
80#define PCM990_CTRL_ENAINT1 0x0002 /* Enable Int FR RI */ 79#define PCM990_CTRL_ENAINT1 0x0002 /* Enable Int FR RI */
81#define PCM990_CTRL_ENAINT2 0x0004 /* Enable Int MMC1 Detect */ 80#define PCM990_CTRL_ENAINT2 0x0004 /* Enable Int MMC1 Detect */
@@ -102,32 +101,6 @@
102#define PCM990_CTRL_ACPRES 0x0004 /* DC Present */ 101#define PCM990_CTRL_ACPRES 0x0004 /* DC Present */
103#define PCM990_CTRL_ACALARM 0x0008 /* Error Akku */ 102#define PCM990_CTRL_ACALARM 0x0008 /* Error Akku */
104 103
105#define PCM990_CTRL_P2V(x) ((x) - PCM990_CTRL_PHYS + PCM990_CTRL_BASE)
106#define PCM990_CTRL_V2P(x) ((x) - PCM990_CTRL_BASE + PCM990_CTRL_PHYS)
107
108#ifndef __ASSEMBLY__
109# define __PCM990_CTRL_REG(x) \
110 (*((volatile unsigned char *)PCM990_CTRL_P2V(x)))
111#else
112# define __PCM990_CTRL_REG(x) PCM990_CTRL_P2V(x)
113#endif
114
115#define PCM990_INTMSKENA __PCM990_CTRL_REG(PCM990_CTRL_PHYS + PCM990_CTRL_REG7)
116#define PCM990_INTSETCLR __PCM990_CTRL_REG(PCM990_CTRL_PHYS + PCM990_CTRL_REG6)
117#define PCM990_CTRL0 __PCM990_CTRL_REG(PCM990_CTRL_PHYS + PCM990_CTRL_REG0)
118#define PCM990_CTRL1 __PCM990_CTRL_REG(PCM990_CTRL_PHYS + PCM990_CTRL_REG1)
119#define PCM990_CTRL2 __PCM990_CTRL_REG(PCM990_CTRL_PHYS + PCM990_CTRL_REG2)
120#define PCM990_CTRL3 __PCM990_CTRL_REG(PCM990_CTRL_PHYS + PCM990_CTRL_REG3)
121#define PCM990_CTRL4 __PCM990_CTRL_REG(PCM990_CTRL_PHYS + PCM990_CTRL_REG4)
122#define PCM990_CTRL5 __PCM990_CTRL_REG(PCM990_CTRL_PHYS + PCM990_CTRL_REG5)
123#define PCM990_CTRL6 __PCM990_CTRL_REG(PCM990_CTRL_PHYS + PCM990_CTRL_REG6)
124#define PCM990_CTRL7 __PCM990_CTRL_REG(PCM990_CTRL_PHYS + PCM990_CTRL_REG7)
125#define PCM990_CTRL8 __PCM990_CTRL_REG(PCM990_CTRL_PHYS + PCM990_CTRL_REG8)
126#define PCM990_CTRL9 __PCM990_CTRL_REG(PCM990_CTRL_PHYS + PCM990_CTRL_REG9)
127#define PCM990_CTRL10 __PCM990_CTRL_REG(PCM990_CTRL_PHYS + PCM990_CTRL_REG10)
128#define PCM990_CTRL11 __PCM990_CTRL_REG(PCM990_CTRL_PHYS + PCM990_CTRL_REG11)
129
130
131/* 104/*
132 * IDE 105 * IDE
133 */ 106 */
@@ -166,24 +139,6 @@
166#define PCM990_IDE_PLD_P2V(x) ((x) - PCM990_IDE_PLD_PHYS + PCM990_IDE_PLD_BASE) 139#define PCM990_IDE_PLD_P2V(x) ((x) - PCM990_IDE_PLD_PHYS + PCM990_IDE_PLD_BASE)
167#define PCM990_IDE_PLD_V2P(x) ((x) - PCM990_IDE_PLD_BASE + PCM990_IDE_PLD_PHYS) 140#define PCM990_IDE_PLD_V2P(x) ((x) - PCM990_IDE_PLD_BASE + PCM990_IDE_PLD_PHYS)
168 141
169#ifndef __ASSEMBLY__
170# define __PCM990_IDE_PLD_REG(x) \
171 (*((volatile unsigned char *)PCM990_IDE_PLD_P2V(x)))
172#else
173# define __PCM990_IDE_PLD_REG(x) PCM990_IDE_PLD_P2V(x)
174#endif
175
176#define PCM990_IDE0 \
177 __PCM990_IDE_PLD_REG(PCM990_IDE_PLD_PHYS + PCM990_IDE_PLD_REG0)
178#define PCM990_IDE1 \
179 __PCM990_IDE_PLD_REG(PCM990_IDE_PLD_PHYS + PCM990_IDE_PLD_REG1)
180#define PCM990_IDE2 \
181 __PCM990_IDE_PLD_REG(PCM990_IDE_PLD_PHYS + PCM990_IDE_PLD_REG2)
182#define PCM990_IDE3 \
183 __PCM990_IDE_PLD_REG(PCM990_IDE_PLD_PHYS + PCM990_IDE_PLD_REG3)
184#define PCM990_IDE4 \
185 __PCM990_IDE_PLD_REG(PCM990_IDE_PLD_PHYS + PCM990_IDE_PLD_REG4)
186
187/* 142/*
188 * Compact Flash 143 * Compact Flash
189 */ 144 */
@@ -196,10 +151,6 @@
196#define PCM990_CF_CD_EDGE IRQ_TYPE_EDGE_RISING 151#define PCM990_CF_CD_EDGE IRQ_TYPE_EDGE_RISING
197 152
198#define PCM990_CF_PLD_PHYS 0x30000000 /* 16 bit wide */ 153#define PCM990_CF_PLD_PHYS 0x30000000 /* 16 bit wide */
199#define PCM990_CF_PLD_BASE 0xef000000
200#define PCM990_CF_PLD_SIZE (1*1024*1024)
201#define PCM990_CF_PLD_P2V(x) ((x) - PCM990_CF_PLD_PHYS + PCM990_CF_PLD_BASE)
202#define PCM990_CF_PLD_V2P(x) ((x) - PCM990_CF_PLD_BASE + PCM990_CF_PLD_PHYS)
203 154
204/* visible CPLD (U6) registers */ 155/* visible CPLD (U6) registers */
205#define PCM990_CF_PLD_REG0 0x1000 /* OFFSET CF REGISTER 0 */ 156#define PCM990_CF_PLD_REG0 0x1000 /* OFFSET CF REGISTER 0 */
@@ -239,21 +190,6 @@
239#define PCM990_CF_REG6_CD1 0x0001 /* R CF Card_Detect1 */ 190#define PCM990_CF_REG6_CD1 0x0001 /* R CF Card_Detect1 */
240#define PCM990_CF_REG6_CD2 0x0002 /* R CF Card_Detect2 */ 191#define PCM990_CF_REG6_CD2 0x0002 /* R CF Card_Detect2 */
241 192
242#ifndef __ASSEMBLY__
243# define __PCM990_CF_PLD_REG(x) \
244 (*((volatile unsigned char *)PCM990_CF_PLD_P2V(x)))
245#else
246# define __PCM990_CF_PLD_REG(x) PCM990_CF_PLD_P2V(x)
247#endif
248
249#define PCM990_CF0 __PCM990_CF_PLD_REG(PCM990_CF_PLD_PHYS + PCM990_CF_PLD_REG0)
250#define PCM990_CF1 __PCM990_CF_PLD_REG(PCM990_CF_PLD_PHYS + PCM990_CF_PLD_REG1)
251#define PCM990_CF2 __PCM990_CF_PLD_REG(PCM990_CF_PLD_PHYS + PCM990_CF_PLD_REG2)
252#define PCM990_CF3 __PCM990_CF_PLD_REG(PCM990_CF_PLD_PHYS + PCM990_CF_PLD_REG3)
253#define PCM990_CF4 __PCM990_CF_PLD_REG(PCM990_CF_PLD_PHYS + PCM990_CF_PLD_REG4)
254#define PCM990_CF5 __PCM990_CF_PLD_REG(PCM990_CF_PLD_PHYS + PCM990_CF_PLD_REG5)
255#define PCM990_CF6 __PCM990_CF_PLD_REG(PCM990_CF_PLD_PHYS + PCM990_CF_PLD_REG6)
256
257/* 193/*
258 * Wolfson AC97 Touch 194 * Wolfson AC97 Touch
259 */ 195 */
diff --git a/arch/arm/mach-pxa/magician.c b/arch/arm/mach-pxa/magician.c
index 8de0651d7efb..2db697cd2b4e 100644
--- a/arch/arm/mach-pxa/magician.c
+++ b/arch/arm/mach-pxa/magician.c
@@ -579,12 +579,8 @@ static struct platform_device power_supply = {
579 */ 579 */
580 580
581static struct regulator_consumer_supply bq24022_consumers[] = { 581static struct regulator_consumer_supply bq24022_consumers[] = {
582 { 582 REGULATOR_SUPPLY("vbus_draw", NULL),
583 .supply = "vbus_draw", 583 REGULATOR_SUPPLY("ac_draw", NULL),
584 },
585 {
586 .supply = "ac_draw",
587 },
588}; 584};
589 585
590static struct regulator_init_data bq24022_init_data = { 586static struct regulator_init_data bq24022_init_data = {
diff --git a/arch/arm/mach-pxa/mioa701.c b/arch/arm/mach-pxa/mioa701.c
index 061d57009cee..bf99022b021f 100644
--- a/arch/arm/mach-pxa/mioa701.c
+++ b/arch/arm/mach-pxa/mioa701.c
@@ -103,6 +103,7 @@ static unsigned long mioa701_pin_config[] = {
103 GPIO82_CIF_DD_5, 103 GPIO82_CIF_DD_5,
104 GPIO84_CIF_FV, 104 GPIO84_CIF_FV,
105 GPIO85_CIF_LV, 105 GPIO85_CIF_LV,
106 MIO_CFG_OUT(GPIO56_MT9M111_nOE, AF0, DRIVE_LOW),
106 107
107 /* Bluetooth */ 108 /* Bluetooth */
108 MIO_CFG_IN(GPIO14_BT_nACTIVITY, AF0), 109 MIO_CFG_IN(GPIO14_BT_nACTIVITY, AF0),
@@ -581,9 +582,7 @@ static struct wm97xx_pdata mioa701_wm97xx_pdata = {
581 * Voltage regulation 582 * Voltage regulation
582 */ 583 */
583static struct regulator_consumer_supply max1586_consumers[] = { 584static struct regulator_consumer_supply max1586_consumers[] = {
584 { 585 REGULATOR_SUPPLY("vcc_core", NULL),
585 .supply = "vcc_core",
586 }
587}; 586};
588 587
589static struct regulator_init_data max1586_v3_info = { 588static struct regulator_init_data max1586_v3_info = {
@@ -705,6 +704,7 @@ static struct gpio global_gpios[] = {
705 { GPIO9_CHARGE_EN, GPIOF_OUT_INIT_HIGH, "Charger enable" }, 704 { GPIO9_CHARGE_EN, GPIOF_OUT_INIT_HIGH, "Charger enable" },
706 { GPIO18_POWEROFF, GPIOF_OUT_INIT_LOW, "Power Off" }, 705 { GPIO18_POWEROFF, GPIOF_OUT_INIT_LOW, "Power Off" },
707 { GPIO87_LCD_POWER, GPIOF_OUT_INIT_LOW, "LCD Power" }, 706 { GPIO87_LCD_POWER, GPIOF_OUT_INIT_LOW, "LCD Power" },
707 { GPIO56_MT9M111_nOE, GPIOF_OUT_INIT_LOW, "Camera nOE" },
708}; 708};
709 709
710static void __init mioa701_machine_init(void) 710static void __init mioa701_machine_init(void)
diff --git a/arch/arm/mach-pxa/palm27x.c b/arch/arm/mach-pxa/palm27x.c
index fbc10d7b95d1..dad71cfa34c8 100644
--- a/arch/arm/mach-pxa/palm27x.c
+++ b/arch/arm/mach-pxa/palm27x.c
@@ -429,9 +429,7 @@ void __init palm27x_power_init(int ac, int usb)
429#if defined(CONFIG_REGULATOR_MAX1586) || \ 429#if defined(CONFIG_REGULATOR_MAX1586) || \
430 defined(CONFIG_REGULATOR_MAX1586_MODULE) 430 defined(CONFIG_REGULATOR_MAX1586_MODULE)
431static struct regulator_consumer_supply palm27x_max1587a_consumers[] = { 431static struct regulator_consumer_supply palm27x_max1587a_consumers[] = {
432 { 432 REGULATOR_SUPPLY("vcc_core", NULL),
433 .supply = "vcc_core",
434 }
435}; 433};
436 434
437static struct regulator_init_data palm27x_max1587a_v3_info = { 435static struct regulator_init_data palm27x_max1587a_v3_info = {
diff --git a/arch/arm/mach-pxa/pcm990-baseboard.c b/arch/arm/mach-pxa/pcm990-baseboard.c
index abab4e2b122c..cb723e84bc27 100644
--- a/arch/arm/mach-pxa/pcm990-baseboard.c
+++ b/arch/arm/mach-pxa/pcm990-baseboard.c
@@ -65,6 +65,18 @@ static unsigned long pcm990_pin_config[] __initdata = {
65 GPIO31_AC97_SYNC, 65 GPIO31_AC97_SYNC,
66}; 66};
67 67
68static void __iomem *pcm990_cpld_base;
69
70static u8 pcm990_cpld_readb(unsigned int reg)
71{
72 return readb(pcm990_cpld_base + reg);
73}
74
75static void pcm990_cpld_writeb(u8 value, unsigned int reg)
76{
77 writeb(value, pcm990_cpld_base + reg);
78}
79
68/* 80/*
69 * pcm990_lcd_power - control power supply to the LCD 81 * pcm990_lcd_power - control power supply to the LCD
70 * @on: 0 = switch off, 1 = switch on 82 * @on: 0 = switch off, 1 = switch on
@@ -78,13 +90,13 @@ static void pcm990_lcd_power(int on, struct fb_var_screeninfo *var)
78 /* enable LCD-Latches 90 /* enable LCD-Latches
79 * power on LCD 91 * power on LCD
80 */ 92 */
81 __PCM990_CTRL_REG(PCM990_CTRL_PHYS + PCM990_CTRL_REG3) = 93 pcm990_cpld_writeb(PCM990_CTRL_LCDPWR + PCM990_CTRL_LCDON,
82 PCM990_CTRL_LCDPWR + PCM990_CTRL_LCDON; 94 PCM990_CTRL_REG3);
83 } else { 95 } else {
84 /* disable LCD-Latches 96 /* disable LCD-Latches
85 * power off LCD 97 * power off LCD
86 */ 98 */
87 __PCM990_CTRL_REG(PCM990_CTRL_PHYS + PCM990_CTRL_REG3) = 0x00; 99 pcm990_cpld_writeb(0, PCM990_CTRL_REG3);
88 } 100 }
89} 101}
90#endif 102#endif
@@ -243,15 +255,26 @@ static unsigned long pcm990_irq_enabled;
243static void pcm990_mask_ack_irq(struct irq_data *d) 255static void pcm990_mask_ack_irq(struct irq_data *d)
244{ 256{
245 int pcm990_irq = (d->irq - PCM027_IRQ(0)); 257 int pcm990_irq = (d->irq - PCM027_IRQ(0));
246 PCM990_INTMSKENA = (pcm990_irq_enabled &= ~(1 << pcm990_irq)); 258
259 pcm990_irq_enabled &= ~(1 << pcm990_irq);
260
261 pcm990_cpld_writeb(pcm990_irq_enabled, PCM990_CTRL_INTMSKENA);
247} 262}
248 263
249static void pcm990_unmask_irq(struct irq_data *d) 264static void pcm990_unmask_irq(struct irq_data *d)
250{ 265{
251 int pcm990_irq = (d->irq - PCM027_IRQ(0)); 266 int pcm990_irq = (d->irq - PCM027_IRQ(0));
267 u8 val;
268
252 /* the irq can be acknowledged only if deasserted, so it's done here */ 269 /* the irq can be acknowledged only if deasserted, so it's done here */
253 PCM990_INTSETCLR |= 1 << pcm990_irq; 270
254 PCM990_INTMSKENA = (pcm990_irq_enabled |= (1 << pcm990_irq)); 271 pcm990_irq_enabled |= (1 << pcm990_irq);
272
273 val = pcm990_cpld_readb(PCM990_CTRL_INTSETCLR);
274 val |= 1 << pcm990_irq;
275 pcm990_cpld_writeb(val, PCM990_CTRL_INTSETCLR);
276
277 pcm990_cpld_writeb(pcm990_irq_enabled, PCM990_CTRL_INTMSKENA);
255} 278}
256 279
257static struct irq_chip pcm990_irq_chip = { 280static struct irq_chip pcm990_irq_chip = {
@@ -261,7 +284,10 @@ static struct irq_chip pcm990_irq_chip = {
261 284
262static void pcm990_irq_handler(unsigned int irq, struct irq_desc *desc) 285static void pcm990_irq_handler(unsigned int irq, struct irq_desc *desc)
263{ 286{
264 unsigned long pending = (~PCM990_INTSETCLR) & pcm990_irq_enabled; 287 unsigned long pending;
288
289 pending = ~pcm990_cpld_readb(PCM990_CTRL_INTSETCLR);
290 pending &= pcm990_irq_enabled;
265 291
266 do { 292 do {
267 /* clear our parent IRQ */ 293 /* clear our parent IRQ */
@@ -270,7 +296,8 @@ static void pcm990_irq_handler(unsigned int irq, struct irq_desc *desc)
270 irq = PCM027_IRQ(0) + __ffs(pending); 296 irq = PCM027_IRQ(0) + __ffs(pending);
271 generic_handle_irq(irq); 297 generic_handle_irq(irq);
272 } 298 }
273 pending = (~PCM990_INTSETCLR) & pcm990_irq_enabled; 299 pending = ~pcm990_cpld_readb(PCM990_CTRL_INTSETCLR);
300 pending &= pcm990_irq_enabled;
274 } while (pending); 301 } while (pending);
275} 302}
276 303
@@ -285,8 +312,9 @@ static void __init pcm990_init_irq(void)
285 set_irq_flags(irq, IRQF_VALID | IRQF_PROBE); 312 set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
286 } 313 }
287 314
288 PCM990_INTMSKENA = 0x00; /* disable all Interrupts */ 315 /* disable all Interrupts */
289 PCM990_INTSETCLR = 0xFF; 316 pcm990_cpld_writeb(0x0, PCM990_CTRL_INTMSKENA);
317 pcm990_cpld_writeb(0xff, PCM990_CTRL_INTSETCLR);
290 318
291 irq_set_chained_handler(PCM990_CTRL_INT_IRQ, pcm990_irq_handler); 319 irq_set_chained_handler(PCM990_CTRL_INT_IRQ, pcm990_irq_handler);
292 irq_set_irq_type(PCM990_CTRL_INT_IRQ, PCM990_CTRL_INT_IRQ_EDGE); 320 irq_set_irq_type(PCM990_CTRL_INT_IRQ, PCM990_CTRL_INT_IRQ_EDGE);
@@ -309,13 +337,16 @@ static int pcm990_mci_init(struct device *dev, irq_handler_t mci_detect_int,
309static void pcm990_mci_setpower(struct device *dev, unsigned int vdd) 337static void pcm990_mci_setpower(struct device *dev, unsigned int vdd)
310{ 338{
311 struct pxamci_platform_data *p_d = dev->platform_data; 339 struct pxamci_platform_data *p_d = dev->platform_data;
340 u8 val;
341
342 val = pcm990_cpld_readb(PCM990_CTRL_REG5);
312 343
313 if ((1 << vdd) & p_d->ocr_mask) 344 if ((1 << vdd) & p_d->ocr_mask)
314 __PCM990_CTRL_REG(PCM990_CTRL_PHYS + PCM990_CTRL_REG5) = 345 val |= PCM990_CTRL_MMC2PWR;
315 PCM990_CTRL_MMC2PWR;
316 else 346 else
317 __PCM990_CTRL_REG(PCM990_CTRL_PHYS + PCM990_CTRL_REG5) = 347 val &= ~PCM990_CTRL_MMC2PWR;
318 ~PCM990_CTRL_MMC2PWR; 348
349 pcm990_cpld_writeb(PCM990_CTRL_MMC2PWR, PCM990_CTRL_REG5);
319} 350}
320 351
321static void pcm990_mci_exit(struct device *dev, void *data) 352static void pcm990_mci_exit(struct device *dev, void *data)
@@ -481,23 +512,6 @@ static struct platform_device pcm990_camera[] = {
481#endif /* CONFIG_VIDEO_PXA27x ||CONFIG_VIDEO_PXA27x_MODULE */ 512#endif /* CONFIG_VIDEO_PXA27x ||CONFIG_VIDEO_PXA27x_MODULE */
482 513
483/* 514/*
484 * enable generic access to the base board control CPLDs U6 and U7
485 */
486static struct map_desc pcm990_io_desc[] __initdata = {
487 {
488 .virtual = PCM990_CTRL_BASE,
489 .pfn = __phys_to_pfn(PCM990_CTRL_PHYS),
490 .length = PCM990_CTRL_SIZE,
491 .type = MT_DEVICE /* CPLD */
492 }, {
493 .virtual = PCM990_CF_PLD_BASE,
494 .pfn = __phys_to_pfn(PCM990_CF_PLD_PHYS),
495 .length = PCM990_CF_PLD_SIZE,
496 .type = MT_DEVICE /* CPLD */
497 }
498};
499
500/*
501 * system init for baseboard usage. Will be called by pcm027 init. 515 * system init for baseboard usage. Will be called by pcm027 init.
502 * 516 *
503 * Add platform devices present on this baseboard and init 517 * Add platform devices present on this baseboard and init
@@ -507,8 +521,11 @@ void __init pcm990_baseboard_init(void)
507{ 521{
508 pxa2xx_mfp_config(ARRAY_AND_SIZE(pcm990_pin_config)); 522 pxa2xx_mfp_config(ARRAY_AND_SIZE(pcm990_pin_config));
509 523
510 /* register CPLD access */ 524 pcm990_cpld_base = ioremap(PCM990_CTRL_PHYS, PCM990_CTRL_SIZE);
511 iotable_init(ARRAY_AND_SIZE(pcm990_io_desc)); 525 if (!pcm990_cpld_base) {
526 pr_err("pcm990: failed to ioremap cpld\n");
527 return;
528 }
512 529
513 /* register CPLD's IRQ controller */ 530 /* register CPLD's IRQ controller */
514 pcm990_init_irq(); 531 pcm990_init_irq();
diff --git a/arch/arm/mach-pxa/spitz.c b/arch/arm/mach-pxa/spitz.c
index df2ab0fb2ace..363d91b44ecb 100644
--- a/arch/arm/mach-pxa/spitz.c
+++ b/arch/arm/mach-pxa/spitz.c
@@ -877,9 +877,7 @@ static struct i2c_board_info spitz_i2c_devs[] = {
877}; 877};
878 878
879static struct regulator_consumer_supply isl6271a_consumers[] = { 879static struct regulator_consumer_supply isl6271a_consumers[] = {
880 { 880 REGULATOR_SUPPLY("vcc_core", NULL),
881 .supply = "vcc_core",
882 }
883}; 881};
884 882
885static struct regulator_init_data isl6271a_info[] = { 883static struct regulator_init_data isl6271a_info[] = {
diff --git a/arch/arm/mach-pxa/stargate2.c b/arch/arm/mach-pxa/stargate2.c
index 4cd645e29b64..30b1b0b3c7f7 100644
--- a/arch/arm/mach-pxa/stargate2.c
+++ b/arch/arm/mach-pxa/stargate2.c
@@ -151,10 +151,7 @@ static struct platform_device sht15 = {
151}; 151};
152 152
153static struct regulator_consumer_supply stargate2_sensor_3_con[] = { 153static struct regulator_consumer_supply stargate2_sensor_3_con[] = {
154 { 154 REGULATOR_SUPPLY("vcc", "sht15"),
155 .dev_name = "sht15",
156 .supply = "vcc",
157 },
158}; 155};
159 156
160enum stargate2_ldos{ 157enum stargate2_ldos{
diff --git a/arch/arm/mach-pxa/vpac270.c b/arch/arm/mach-pxa/vpac270.c
index c57ab636ea9c..e1740acd15f1 100644
--- a/arch/arm/mach-pxa/vpac270.c
+++ b/arch/arm/mach-pxa/vpac270.c
@@ -640,9 +640,7 @@ static inline void vpac270_ide_init(void) {}
640#if defined(CONFIG_REGULATOR_MAX1586) || \ 640#if defined(CONFIG_REGULATOR_MAX1586) || \
641 defined(CONFIG_REGULATOR_MAX1586_MODULE) 641 defined(CONFIG_REGULATOR_MAX1586_MODULE)
642static struct regulator_consumer_supply vpac270_max1587a_consumers[] = { 642static struct regulator_consumer_supply vpac270_max1587a_consumers[] = {
643 { 643 REGULATOR_SUPPLY("vcc_core", NULL),
644 .supply = "vcc_core",
645 }
646}; 644};
647 645
648static struct regulator_init_data vpac270_max1587a_v3_info = { 646static struct regulator_init_data vpac270_max1587a_v3_info = {
diff --git a/arch/arm/mach-pxa/z2.c b/arch/arm/mach-pxa/z2.c
index fa8619970841..b9320cb8a11f 100644
--- a/arch/arm/mach-pxa/z2.c
+++ b/arch/arm/mach-pxa/z2.c
@@ -615,9 +615,7 @@ static inline void z2_spi_init(void) {}
615#if defined(CONFIG_REGULATOR_TPS65023) || \ 615#if defined(CONFIG_REGULATOR_TPS65023) || \
616 defined(CONFIG_REGULATOR_TPS65023_MODULE) 616 defined(CONFIG_REGULATOR_TPS65023_MODULE)
617static struct regulator_consumer_supply z2_tps65021_consumers[] = { 617static struct regulator_consumer_supply z2_tps65021_consumers[] = {
618 { 618 REGULATOR_SUPPLY("vcc_core", NULL),
619 .supply = "vcc_core",
620 }
621}; 619};
622 620
623static struct regulator_init_data z2_tps65021_info[] = { 621static struct regulator_init_data z2_tps65021_info[] = {
diff --git a/arch/arm/mach-s3c64xx/mach-crag6410.c b/arch/arm/mach-s3c64xx/mach-crag6410.c
index 164467cbb7ea..0569765a8e90 100644
--- a/arch/arm/mach-s3c64xx/mach-crag6410.c
+++ b/arch/arm/mach-s3c64xx/mach-crag6410.c
@@ -290,6 +290,24 @@ static struct regulator_consumer_supply wallvdd_consumers[] = {
290 REGULATOR_SUPPLY("SPKVDD2", "1-001a"), 290 REGULATOR_SUPPLY("SPKVDD2", "1-001a"),
291 REGULATOR_SUPPLY("SPKVDDL", "1-001a"), 291 REGULATOR_SUPPLY("SPKVDDL", "1-001a"),
292 REGULATOR_SUPPLY("SPKVDDR", "1-001a"), 292 REGULATOR_SUPPLY("SPKVDDR", "1-001a"),
293
294 REGULATOR_SUPPLY("DC1VDD", "0-0034"),
295 REGULATOR_SUPPLY("DC2VDD", "0-0034"),
296 REGULATOR_SUPPLY("DC3VDD", "0-0034"),
297 REGULATOR_SUPPLY("LDO1VDD", "0-0034"),
298 REGULATOR_SUPPLY("LDO2VDD", "0-0034"),
299 REGULATOR_SUPPLY("LDO4VDD", "0-0034"),
300 REGULATOR_SUPPLY("LDO5VDD", "0-0034"),
301 REGULATOR_SUPPLY("LDO6VDD", "0-0034"),
302 REGULATOR_SUPPLY("LDO7VDD", "0-0034"),
303 REGULATOR_SUPPLY("LDO8VDD", "0-0034"),
304 REGULATOR_SUPPLY("LDO9VDD", "0-0034"),
305 REGULATOR_SUPPLY("LDO10VDD", "0-0034"),
306 REGULATOR_SUPPLY("LDO11VDD", "0-0034"),
307
308 REGULATOR_SUPPLY("DC1VDD", "1-0034"),
309 REGULATOR_SUPPLY("DC2VDD", "1-0034"),
310 REGULATOR_SUPPLY("DC3VDD", "1-0034"),
293}; 311};
294 312
295static struct regulator_init_data wallvdd_data = { 313static struct regulator_init_data wallvdd_data = {
diff --git a/arch/arm/mach-shmobile/Kconfig b/arch/arm/mach-shmobile/Kconfig
index 7dcf08ee979d..98327b7a503c 100644
--- a/arch/arm/mach-shmobile/Kconfig
+++ b/arch/arm/mach-shmobile/Kconfig
@@ -99,6 +99,12 @@ config MACH_BONITO
99 select ARCH_REQUIRE_GPIOLIB 99 select ARCH_REQUIRE_GPIOLIB
100 depends on ARCH_R8A7740 100 depends on ARCH_R8A7740
101 101
102config MACH_ARMADILLO800EVA
103 bool "Armadillo-800 EVA board"
104 depends on ARCH_R8A7740
105 select ARCH_REQUIRE_GPIOLIB
106 select USE_OF
107
102config MACH_MARZEN 108config MACH_MARZEN
103 bool "MARZEN board" 109 bool "MARZEN board"
104 depends on ARCH_R8A7779 110 depends on ARCH_R8A7779
@@ -109,6 +115,12 @@ config MACH_KZM9D
109 depends on ARCH_EMEV2 115 depends on ARCH_EMEV2
110 select USE_OF 116 select USE_OF
111 117
118config MACH_KZM9G
119 bool "KZM-A9-GT board"
120 depends on ARCH_SH73A0
121 select ARCH_REQUIRE_GPIOLIB
122 select USE_OF
123
112comment "SH-Mobile System Configuration" 124comment "SH-Mobile System Configuration"
113 125
114config CPU_HAS_INTEVT 126config CPU_HAS_INTEVT
@@ -121,7 +133,8 @@ config MEMORY_START
121 hex "Physical memory start address" 133 hex "Physical memory start address"
122 default "0x50000000" if MACH_G3EVM 134 default "0x50000000" if MACH_G3EVM
123 default "0x40000000" if MACH_G4EVM || MACH_AP4EVB || MACH_AG5EVM || \ 135 default "0x40000000" if MACH_G4EVM || MACH_AP4EVB || MACH_AG5EVM || \
124 MACH_MACKEREL || MACH_BONITO 136 MACH_MACKEREL || MACH_BONITO || \
137 MACH_ARMADILLO800EVA
125 default "0x41000000" if MACH_KOTA2 138 default "0x41000000" if MACH_KOTA2
126 default "0x00000000" 139 default "0x00000000"
127 ---help--- 140 ---help---
@@ -133,7 +146,8 @@ config MEMORY_SIZE
133 hex "Physical memory size" 146 hex "Physical memory size"
134 default "0x08000000" if MACH_G3EVM 147 default "0x08000000" if MACH_G3EVM
135 default "0x08000000" if MACH_G4EVM 148 default "0x08000000" if MACH_G4EVM
136 default "0x20000000" if MACH_AG5EVM || MACH_BONITO 149 default "0x20000000" if MACH_AG5EVM || MACH_BONITO || \
150 MACH_ARMADILLO800EVA
137 default "0x1e000000" if MACH_KOTA2 151 default "0x1e000000" if MACH_KOTA2
138 default "0x10000000" if MACH_AP4EVB || MACH_MACKEREL 152 default "0x10000000" if MACH_AP4EVB || MACH_MACKEREL
139 default "0x04000000" 153 default "0x04000000"
diff --git a/arch/arm/mach-shmobile/Makefile b/arch/arm/mach-shmobile/Makefile
index c795335931c9..e6b177bc9410 100644
--- a/arch/arm/mach-shmobile/Makefile
+++ b/arch/arm/mach-shmobile/Makefile
@@ -51,7 +51,9 @@ obj-$(CONFIG_MACH_MACKEREL) += board-mackerel.o
51obj-$(CONFIG_MACH_KOTA2) += board-kota2.o 51obj-$(CONFIG_MACH_KOTA2) += board-kota2.o
52obj-$(CONFIG_MACH_BONITO) += board-bonito.o 52obj-$(CONFIG_MACH_BONITO) += board-bonito.o
53obj-$(CONFIG_MACH_MARZEN) += board-marzen.o 53obj-$(CONFIG_MACH_MARZEN) += board-marzen.o
54obj-$(CONFIG_MACH_ARMADILLO800EVA) += board-armadillo800eva.o
54obj-$(CONFIG_MACH_KZM9D) += board-kzm9d.o 55obj-$(CONFIG_MACH_KZM9D) += board-kzm9d.o
56obj-$(CONFIG_MACH_KZM9G) += board-kzm9g.o
55 57
56# Framework support 58# Framework support
57obj-$(CONFIG_SMP) += $(smp-y) 59obj-$(CONFIG_SMP) += $(smp-y)
diff --git a/arch/arm/mach-shmobile/board-ap4evb.c b/arch/arm/mach-shmobile/board-ap4evb.c
index b56dde2732bb..0c3caeba2f3e 100644
--- a/arch/arm/mach-shmobile/board-ap4evb.c
+++ b/arch/arm/mach-shmobile/board-ap4evb.c
@@ -997,6 +997,8 @@ static struct sh_mobile_ceu_companion csi2 = {
997 997
998static struct sh_mobile_ceu_info sh_mobile_ceu_info = { 998static struct sh_mobile_ceu_info sh_mobile_ceu_info = {
999 .flags = SH_CEU_FLAG_USE_8BIT_BUS, 999 .flags = SH_CEU_FLAG_USE_8BIT_BUS,
1000 .max_width = 8188,
1001 .max_height = 8188,
1000 .csi2 = &csi2, 1002 .csi2 = &csi2,
1001}; 1003};
1002 1004
diff --git a/arch/arm/mach-shmobile/board-armadillo800eva.c b/arch/arm/mach-shmobile/board-armadillo800eva.c
new file mode 100644
index 000000000000..9e37026ef9dd
--- /dev/null
+++ b/arch/arm/mach-shmobile/board-armadillo800eva.c
@@ -0,0 +1,784 @@
1/*
2 * armadillo 800 eva board support
3 *
4 * Copyright (C) 2012 Renesas Solutions Corp.
5 * Copyright (C) 2012 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
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; version 2 of the License.
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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 *
20 */
21
22#include <linux/clk.h>
23#include <linux/delay.h>
24#include <linux/err.h>
25#include <linux/kernel.h>
26#include <linux/input.h>
27#include <linux/irq.h>
28#include <linux/platform_device.h>
29#include <linux/gpio.h>
30#include <linux/gpio_keys.h>
31#include <linux/sh_eth.h>
32#include <linux/videodev2.h>
33#include <linux/usb/renesas_usbhs.h>
34#include <linux/mfd/tmio.h>
35#include <linux/mmc/host.h>
36#include <linux/mmc/sh_mmcif.h>
37#include <linux/mmc/sh_mobile_sdhi.h>
38#include <mach/common.h>
39#include <mach/irqs.h>
40#include <asm/page.h>
41#include <asm/mach-types.h>
42#include <asm/mach/arch.h>
43#include <asm/mach/map.h>
44#include <asm/mach/time.h>
45#include <asm/hardware/cache-l2x0.h>
46#include <mach/r8a7740.h>
47#include <video/sh_mobile_lcdc.h>
48
49/*
50 * CON1 Camera Module
51 * CON2 Extension Bus
52 * CON3 HDMI Output
53 * CON4 Composite Video Output
54 * CON5 H-UDI JTAG
55 * CON6 ARM JTAG
56 * CON7 SD1
57 * CON8 SD2
58 * CON9 RTC BackUp
59 * CON10 Monaural Mic Input
60 * CON11 Stereo Headphone Output
61 * CON12 Audio Line Output(L)
62 * CON13 Audio Line Output(R)
63 * CON14 AWL13 Module
64 * CON15 Extension
65 * CON16 LCD1
66 * CON17 LCD2
67 * CON19 Power Input
68 * CON20 USB1
69 * CON21 USB2
70 * CON22 Serial
71 * CON23 LAN
72 * CON24 USB3
73 * LED1 Camera LED(Yellow)
74 * LED2 Power LED (Green)
75 * ED3-LED6 User LED(Yellow)
76 * LED7 LAN link LED(Green)
77 * LED8 LAN activity LED(Yellow)
78 */
79
80/*
81 * DipSwitch
82 *
83 * SW1
84 *
85 * -12345678-+---------------+----------------------------
86 * 1 | boot | hermit
87 * 0 | boot | OS auto boot
88 * -12345678-+---------------+----------------------------
89 * 00 | boot device | eMMC
90 * 10 | boot device | SDHI0 (CON7)
91 * 01 | boot device | -
92 * 11 | boot device | Extension Buss (CS0)
93 * -12345678-+---------------+----------------------------
94 * 0 | Extension Bus | D8-D15 disable, eMMC enable
95 * 1 | Extension Bus | D8-D15 enable, eMMC disable
96 * -12345678-+---------------+----------------------------
97 * 0 | SDHI1 | COM8 disable, COM14 enable
98 * 1 | SDHI1 | COM8 enable, COM14 disable
99 * -12345678-+---------------+----------------------------
100 * 0 | USB0 | COM20 enable, COM24 disable
101 * 1 | USB0 | COM20 disable, COM24 enable
102 * -12345678-+---------------+----------------------------
103 * 00 | JTAG | SH-X2
104 * 10 | JTAG | ARM
105 * 01 | JTAG | -
106 * 11 | JTAG | Boundary Scan
107 *-----------+---------------+----------------------------
108 */
109
110/*
111 * USB function
112 *
113 * When you use USB Function,
114 * set SW1.6 ON, and connect cable to CN24.
115 *
116 * USBF needs workaround on R8A7740 chip.
117 * These are a little bit complex.
118 * see
119 * usbhsf_power_ctrl()
120 *
121 * CAUTION
122 *
123 * It uses autonomy mode for USB hotplug at this point
124 * (= usbhs_private.platform_callback.get_vbus is NULL),
125 * since we don't know what's happen on PM control
126 * on this workaround.
127 */
128#define USBCR1 0xe605810a
129#define USBH 0xC6700000
130#define USBH_USBCTR 0x10834
131
132struct usbhsf_private {
133 struct clk *phy;
134 struct clk *usb24;
135 struct clk *pci;
136 struct clk *func;
137 struct clk *host;
138 void __iomem *usbh_base;
139 struct renesas_usbhs_platform_info info;
140};
141
142#define usbhsf_get_priv(pdev) \
143 container_of(renesas_usbhs_get_info(pdev), \
144 struct usbhsf_private, info)
145
146static int usbhsf_get_id(struct platform_device *pdev)
147{
148 return USBHS_GADGET;
149}
150
151static void usbhsf_power_ctrl(struct platform_device *pdev,
152 void __iomem *base, int enable)
153{
154 struct usbhsf_private *priv = usbhsf_get_priv(pdev);
155
156 /*
157 * Work around for USB Function.
158 * It needs USB host clock, and settings
159 */
160 if (enable) {
161 /*
162 * enable all the related usb clocks
163 * for usb workaround
164 */
165 clk_enable(priv->usb24);
166 clk_enable(priv->pci);
167 clk_enable(priv->host);
168 clk_enable(priv->func);
169 clk_enable(priv->phy);
170
171 /*
172 * set USBCR1
173 *
174 * Port1 is driven by USB function,
175 * Port2 is driven by USB HOST
176 * One HOST (Port1 or Port2 is HOST)
177 * USB PLL input clock = 24MHz
178 */
179 __raw_writew(0xd750, USBCR1);
180 mdelay(1);
181
182 /*
183 * start USB Host
184 */
185 __raw_writel(0x0000000c, priv->usbh_base + USBH_USBCTR);
186 __raw_writel(0x00000008, priv->usbh_base + USBH_USBCTR);
187 mdelay(10);
188
189 /*
190 * USB PHY Power ON
191 */
192 __raw_writew(0xd770, USBCR1);
193 __raw_writew(0x4000, base + 0x102); /* USBF :: SUSPMODE */
194
195 } else {
196 __raw_writel(0x0000010f, priv->usbh_base + USBH_USBCTR);
197 __raw_writew(0xd7c0, USBCR1); /* GPIO */
198
199 clk_disable(priv->phy);
200 clk_disable(priv->func); /* usb work around */
201 clk_disable(priv->host); /* usb work around */
202 clk_disable(priv->pci); /* usb work around */
203 clk_disable(priv->usb24); /* usb work around */
204 }
205}
206
207static void usbhsf_hardware_exit(struct platform_device *pdev)
208{
209 struct usbhsf_private *priv = usbhsf_get_priv(pdev);
210
211 if (!IS_ERR(priv->phy))
212 clk_put(priv->phy);
213 if (!IS_ERR(priv->usb24))
214 clk_put(priv->usb24);
215 if (!IS_ERR(priv->pci))
216 clk_put(priv->pci);
217 if (!IS_ERR(priv->host))
218 clk_put(priv->host);
219 if (!IS_ERR(priv->func))
220 clk_put(priv->func);
221 if (priv->usbh_base)
222 iounmap(priv->usbh_base);
223
224 priv->phy = NULL;
225 priv->usb24 = NULL;
226 priv->pci = NULL;
227 priv->host = NULL;
228 priv->func = NULL;
229 priv->usbh_base = NULL;
230}
231
232static int usbhsf_hardware_init(struct platform_device *pdev)
233{
234 struct usbhsf_private *priv = usbhsf_get_priv(pdev);
235
236 priv->phy = clk_get(&pdev->dev, "phy");
237 priv->usb24 = clk_get(&pdev->dev, "usb24");
238 priv->pci = clk_get(&pdev->dev, "pci");
239 priv->func = clk_get(&pdev->dev, "func");
240 priv->host = clk_get(&pdev->dev, "host");
241 priv->usbh_base = ioremap_nocache(USBH, 0x20000);
242
243 if (IS_ERR(priv->phy) ||
244 IS_ERR(priv->usb24) ||
245 IS_ERR(priv->pci) ||
246 IS_ERR(priv->host) ||
247 IS_ERR(priv->func) ||
248 !priv->usbh_base) {
249 dev_err(&pdev->dev, "USB clock setting failed\n");
250 usbhsf_hardware_exit(pdev);
251 return -EIO;
252 }
253
254 /* usb24 use 1/1 of parent clock (= usb24s = 24MHz) */
255 clk_set_rate(priv->usb24,
256 clk_get_rate(clk_get_parent(priv->usb24)));
257
258 return 0;
259}
260
261static struct usbhsf_private usbhsf_private = {
262 .info = {
263 .platform_callback = {
264 .get_id = usbhsf_get_id,
265 .hardware_init = usbhsf_hardware_init,
266 .hardware_exit = usbhsf_hardware_exit,
267 .power_ctrl = usbhsf_power_ctrl,
268 },
269 .driver_param = {
270 .buswait_bwait = 5,
271 .detection_delay = 5,
272 },
273 }
274};
275
276static struct resource usbhsf_resources[] = {
277 {
278 .name = "USBHS",
279 .start = 0xe6890000,
280 .end = 0xe6890104 - 1,
281 .flags = IORESOURCE_MEM,
282 },
283 {
284 .start = evt2irq(0x0A20),
285 .flags = IORESOURCE_IRQ,
286 },
287};
288
289static struct platform_device usbhsf_device = {
290 .name = "renesas_usbhs",
291 .dev = {
292 .platform_data = &usbhsf_private.info,
293 },
294 .id = -1,
295 .num_resources = ARRAY_SIZE(usbhsf_resources),
296 .resource = usbhsf_resources,
297};
298
299/* Ether */
300static struct sh_eth_plat_data sh_eth_platdata = {
301 .phy = 0x00, /* LAN8710A */
302 .edmac_endian = EDMAC_LITTLE_ENDIAN,
303 .register_type = SH_ETH_REG_GIGABIT,
304 .phy_interface = PHY_INTERFACE_MODE_MII,
305};
306
307static struct resource sh_eth_resources[] = {
308 {
309 .start = 0xe9a00000,
310 .end = 0xe9a00800 - 1,
311 .flags = IORESOURCE_MEM,
312 }, {
313 .start = 0xe9a01800,
314 .end = 0xe9a02000 - 1,
315 .flags = IORESOURCE_MEM,
316 }, {
317 .start = evt2irq(0x0500),
318 .flags = IORESOURCE_IRQ,
319 },
320};
321
322static struct platform_device sh_eth_device = {
323 .name = "sh-eth",
324 .id = -1,
325 .dev = {
326 .platform_data = &sh_eth_platdata,
327 },
328 .resource = sh_eth_resources,
329 .num_resources = ARRAY_SIZE(sh_eth_resources),
330};
331
332/* LCDC */
333static struct fb_videomode lcdc0_mode = {
334 .name = "AMPIER/AM-800480",
335 .xres = 800,
336 .yres = 480,
337 .left_margin = 88,
338 .right_margin = 40,
339 .hsync_len = 128,
340 .upper_margin = 20,
341 .lower_margin = 5,
342 .vsync_len = 5,
343 .sync = 0,
344};
345
346static struct sh_mobile_lcdc_info lcdc0_info = {
347 .clock_source = LCDC_CLK_BUS,
348 .ch[0] = {
349 .chan = LCDC_CHAN_MAINLCD,
350 .fourcc = V4L2_PIX_FMT_RGB565,
351 .interface_type = RGB24,
352 .clock_divider = 5,
353 .flags = 0,
354 .lcd_modes = &lcdc0_mode,
355 .num_modes = 1,
356 .panel_cfg = {
357 .width = 111,
358 .height = 68,
359 },
360 },
361};
362
363static struct resource lcdc0_resources[] = {
364 [0] = {
365 .name = "LCD0",
366 .start = 0xfe940000,
367 .end = 0xfe943fff,
368 .flags = IORESOURCE_MEM,
369 },
370 [1] = {
371 .start = intcs_evt2irq(0x580),
372 .flags = IORESOURCE_IRQ,
373 },
374};
375
376static struct platform_device lcdc0_device = {
377 .name = "sh_mobile_lcdc_fb",
378 .num_resources = ARRAY_SIZE(lcdc0_resources),
379 .resource = lcdc0_resources,
380 .id = 0,
381 .dev = {
382 .platform_data = &lcdc0_info,
383 .coherent_dma_mask = ~0,
384 },
385};
386
387/* GPIO KEY */
388#define GPIO_KEY(c, g, d) { .code = c, .gpio = g, .desc = d, .active_low = 1 }
389
390static struct gpio_keys_button gpio_buttons[] = {
391 GPIO_KEY(KEY_POWER, GPIO_PORT99, "SW1"),
392 GPIO_KEY(KEY_BACK, GPIO_PORT100, "SW2"),
393 GPIO_KEY(KEY_MENU, GPIO_PORT97, "SW3"),
394 GPIO_KEY(KEY_HOME, GPIO_PORT98, "SW4"),
395};
396
397static struct gpio_keys_platform_data gpio_key_info = {
398 .buttons = gpio_buttons,
399 .nbuttons = ARRAY_SIZE(gpio_buttons),
400};
401
402static struct platform_device gpio_keys_device = {
403 .name = "gpio-keys",
404 .id = -1,
405 .dev = {
406 .platform_data = &gpio_key_info,
407 },
408};
409
410/* SDHI0 */
411/*
412 * FIXME
413 *
414 * It use polling mode here, since
415 * CD (= Card Detect) pin is not connected to SDHI0_CD.
416 * We can use IRQ31 as card detect irq,
417 * but it needs chattering removal operation
418 */
419#define IRQ31 evt2irq(0x33E0)
420static struct sh_mobile_sdhi_info sdhi0_info = {
421 .tmio_caps = MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ |\
422 MMC_CAP_NEEDS_POLL,
423 .tmio_ocr_mask = MMC_VDD_165_195 | MMC_VDD_32_33 | MMC_VDD_33_34,
424 .tmio_flags = TMIO_MMC_HAS_IDLE_WAIT,
425};
426
427static struct resource sdhi0_resources[] = {
428 {
429 .name = "SDHI0",
430 .start = 0xe6850000,
431 .end = 0xe6850100 - 1,
432 .flags = IORESOURCE_MEM,
433 },
434 /*
435 * no SH_MOBILE_SDHI_IRQ_CARD_DETECT here
436 */
437 {
438 .name = SH_MOBILE_SDHI_IRQ_SDCARD,
439 .start = evt2irq(0x0E20),
440 .flags = IORESOURCE_IRQ,
441 },
442 {
443 .name = SH_MOBILE_SDHI_IRQ_SDIO,
444 .start = evt2irq(0x0E40),
445 .flags = IORESOURCE_IRQ,
446 },
447};
448
449static struct platform_device sdhi0_device = {
450 .name = "sh_mobile_sdhi",
451 .id = 0,
452 .dev = {
453 .platform_data = &sdhi0_info,
454 },
455 .num_resources = ARRAY_SIZE(sdhi0_resources),
456 .resource = sdhi0_resources,
457};
458
459/* SDHI1 */
460static struct sh_mobile_sdhi_info sdhi1_info = {
461 .tmio_caps = MMC_CAP_SD_HIGHSPEED | MMC_CAP_SDIO_IRQ,
462 .tmio_ocr_mask = MMC_VDD_165_195 | MMC_VDD_32_33 | MMC_VDD_33_34,
463 .tmio_flags = TMIO_MMC_HAS_IDLE_WAIT,
464};
465
466static struct resource sdhi1_resources[] = {
467 [0] = {
468 .name = "SDHI1",
469 .start = 0xe6860000,
470 .end = 0xe6860100 - 1,
471 .flags = IORESOURCE_MEM,
472 },
473 [1] = {
474 .start = evt2irq(0x0E80),
475 .flags = IORESOURCE_IRQ,
476 },
477 [2] = {
478 .start = evt2irq(0x0EA0),
479 .flags = IORESOURCE_IRQ,
480 },
481 [3] = {
482 .start = evt2irq(0x0EC0),
483 .flags = IORESOURCE_IRQ,
484 },
485};
486
487static struct platform_device sdhi1_device = {
488 .name = "sh_mobile_sdhi",
489 .id = 1,
490 .dev = {
491 .platform_data = &sdhi1_info,
492 },
493 .num_resources = ARRAY_SIZE(sdhi1_resources),
494 .resource = sdhi1_resources,
495};
496
497/* MMCIF */
498static struct sh_mmcif_plat_data sh_mmcif_plat = {
499 .sup_pclk = 0,
500 .ocr = MMC_VDD_165_195 | MMC_VDD_32_33 | MMC_VDD_33_34,
501 .caps = MMC_CAP_4_BIT_DATA |
502 MMC_CAP_8_BIT_DATA |
503 MMC_CAP_NONREMOVABLE,
504};
505
506static struct resource sh_mmcif_resources[] = {
507 [0] = {
508 .name = "MMCIF",
509 .start = 0xe6bd0000,
510 .end = 0xe6bd0100 - 1,
511 .flags = IORESOURCE_MEM,
512 },
513 [1] = {
514 /* MMC ERR */
515 .start = evt2irq(0x1AC0),
516 .flags = IORESOURCE_IRQ,
517 },
518 [2] = {
519 /* MMC NOR */
520 .start = evt2irq(0x1AE0),
521 .flags = IORESOURCE_IRQ,
522 },
523};
524
525static struct platform_device sh_mmcif_device = {
526 .name = "sh_mmcif",
527 .id = -1,
528 .dev = {
529 .platform_data = &sh_mmcif_plat,
530 },
531 .num_resources = ARRAY_SIZE(sh_mmcif_resources),
532 .resource = sh_mmcif_resources,
533};
534
535/* I2C */
536static struct i2c_board_info i2c0_devices[] = {
537 {
538 I2C_BOARD_INFO("st1232-ts", 0x55),
539 .irq = evt2irq(0x0340),
540 },
541};
542
543/*
544 * board devices
545 */
546static struct platform_device *eva_devices[] __initdata = {
547 &lcdc0_device,
548 &gpio_keys_device,
549 &sh_eth_device,
550 &sdhi0_device,
551 &sh_mmcif_device,
552};
553
554static void __init eva_clock_init(void)
555{
556 struct clk *system = clk_get(NULL, "system_clk");
557 struct clk *xtal1 = clk_get(NULL, "extal1");
558 struct clk *usb24s = clk_get(NULL, "usb24s");
559
560 if (IS_ERR(system) ||
561 IS_ERR(xtal1) ||
562 IS_ERR(usb24s)) {
563 pr_err("armadillo800eva board clock init failed\n");
564 goto clock_error;
565 }
566
567 /* armadillo 800 eva extal1 is 24MHz */
568 clk_set_rate(xtal1, 24000000);
569
570 /* usb24s use extal1 (= system) clock (= 24MHz) */
571 clk_set_parent(usb24s, system);
572
573clock_error:
574 if (!IS_ERR(system))
575 clk_put(system);
576 if (!IS_ERR(xtal1))
577 clk_put(xtal1);
578 if (!IS_ERR(usb24s))
579 clk_put(usb24s);
580}
581
582/*
583 * board init
584 */
585static void __init eva_init(void)
586{
587 eva_clock_init();
588
589 r8a7740_pinmux_init();
590
591 /* SCIFA1 */
592 gpio_request(GPIO_FN_SCIFA1_RXD, NULL);
593 gpio_request(GPIO_FN_SCIFA1_TXD, NULL);
594
595 /* LCDC0 */
596 gpio_request(GPIO_FN_LCDC0_SELECT, NULL);
597 gpio_request(GPIO_FN_LCD0_D0, NULL);
598 gpio_request(GPIO_FN_LCD0_D1, NULL);
599 gpio_request(GPIO_FN_LCD0_D2, NULL);
600 gpio_request(GPIO_FN_LCD0_D3, NULL);
601 gpio_request(GPIO_FN_LCD0_D4, NULL);
602 gpio_request(GPIO_FN_LCD0_D5, NULL);
603 gpio_request(GPIO_FN_LCD0_D6, NULL);
604 gpio_request(GPIO_FN_LCD0_D7, NULL);
605 gpio_request(GPIO_FN_LCD0_D8, NULL);
606 gpio_request(GPIO_FN_LCD0_D9, NULL);
607 gpio_request(GPIO_FN_LCD0_D10, NULL);
608 gpio_request(GPIO_FN_LCD0_D11, NULL);
609 gpio_request(GPIO_FN_LCD0_D12, NULL);
610 gpio_request(GPIO_FN_LCD0_D13, NULL);
611 gpio_request(GPIO_FN_LCD0_D14, NULL);
612 gpio_request(GPIO_FN_LCD0_D15, NULL);
613 gpio_request(GPIO_FN_LCD0_D16, NULL);
614 gpio_request(GPIO_FN_LCD0_D17, NULL);
615 gpio_request(GPIO_FN_LCD0_D18_PORT40, NULL);
616 gpio_request(GPIO_FN_LCD0_D19_PORT4, NULL);
617 gpio_request(GPIO_FN_LCD0_D20_PORT3, NULL);
618 gpio_request(GPIO_FN_LCD0_D21_PORT2, NULL);
619 gpio_request(GPIO_FN_LCD0_D22_PORT0, NULL);
620 gpio_request(GPIO_FN_LCD0_D23_PORT1, NULL);
621 gpio_request(GPIO_FN_LCD0_DCK, NULL);
622 gpio_request(GPIO_FN_LCD0_VSYN, NULL);
623 gpio_request(GPIO_FN_LCD0_HSYN, NULL);
624 gpio_request(GPIO_FN_LCD0_DISP, NULL);
625 gpio_request(GPIO_FN_LCD0_LCLK_PORT165, NULL);
626
627 gpio_request(GPIO_PORT61, NULL); /* LCDDON */
628 gpio_direction_output(GPIO_PORT61, 1);
629
630 gpio_request(GPIO_PORT202, NULL); /* LCD0_LED_CONT */
631 gpio_direction_output(GPIO_PORT202, 0);
632
633 /* Touchscreen */
634 gpio_request(GPIO_FN_IRQ10, NULL); /* TP_INT */
635 gpio_request(GPIO_PORT166, NULL); /* TP_RST_B */
636 gpio_direction_output(GPIO_PORT166, 1);
637
638 /* GETHER */
639 gpio_request(GPIO_FN_ET_CRS, NULL);
640 gpio_request(GPIO_FN_ET_MDC, NULL);
641 gpio_request(GPIO_FN_ET_MDIO, NULL);
642 gpio_request(GPIO_FN_ET_TX_ER, NULL);
643 gpio_request(GPIO_FN_ET_RX_ER, NULL);
644 gpio_request(GPIO_FN_ET_ERXD0, NULL);
645 gpio_request(GPIO_FN_ET_ERXD1, NULL);
646 gpio_request(GPIO_FN_ET_ERXD2, NULL);
647 gpio_request(GPIO_FN_ET_ERXD3, NULL);
648 gpio_request(GPIO_FN_ET_TX_CLK, NULL);
649 gpio_request(GPIO_FN_ET_TX_EN, NULL);
650 gpio_request(GPIO_FN_ET_ETXD0, NULL);
651 gpio_request(GPIO_FN_ET_ETXD1, NULL);
652 gpio_request(GPIO_FN_ET_ETXD2, NULL);
653 gpio_request(GPIO_FN_ET_ETXD3, NULL);
654 gpio_request(GPIO_FN_ET_PHY_INT, NULL);
655 gpio_request(GPIO_FN_ET_COL, NULL);
656 gpio_request(GPIO_FN_ET_RX_DV, NULL);
657 gpio_request(GPIO_FN_ET_RX_CLK, NULL);
658
659 gpio_request(GPIO_PORT18, NULL); /* PHY_RST */
660 gpio_direction_output(GPIO_PORT18, 1);
661
662 /* USB */
663 gpio_request(GPIO_PORT159, NULL); /* USB_DEVICE_MODE */
664 gpio_direction_input(GPIO_PORT159);
665
666 if (gpio_get_value(GPIO_PORT159)) {
667 /* USB Host */
668 } else {
669 /* USB Func */
670 gpio_request(GPIO_FN_VBUS, NULL);
671 platform_device_register(&usbhsf_device);
672 }
673
674 /* SDHI0 */
675 gpio_request(GPIO_FN_SDHI0_CMD, NULL);
676 gpio_request(GPIO_FN_SDHI0_CLK, NULL);
677 gpio_request(GPIO_FN_SDHI0_D0, NULL);
678 gpio_request(GPIO_FN_SDHI0_D1, NULL);
679 gpio_request(GPIO_FN_SDHI0_D2, NULL);
680 gpio_request(GPIO_FN_SDHI0_D3, NULL);
681 gpio_request(GPIO_FN_SDHI0_WP, NULL);
682
683 gpio_request(GPIO_PORT17, NULL); /* SDHI0_18/33_B */
684 gpio_request(GPIO_PORT74, NULL); /* SDHI0_PON */
685 gpio_request(GPIO_PORT75, NULL); /* SDSLOT1_PON */
686 gpio_direction_output(GPIO_PORT17, 0);
687 gpio_direction_output(GPIO_PORT74, 1);
688 gpio_direction_output(GPIO_PORT75, 1);
689
690 /* we can use GPIO_FN_IRQ31_PORT167 here for SDHI0 CD irq */
691
692 /*
693 * MMCIF
694 *
695 * Here doesn't care SW1.4 status,
696 * since CON2 is not mounted.
697 */
698 gpio_request(GPIO_FN_MMC1_CLK_PORT103, NULL);
699 gpio_request(GPIO_FN_MMC1_CMD_PORT104, NULL);
700 gpio_request(GPIO_FN_MMC1_D0_PORT149, NULL);
701 gpio_request(GPIO_FN_MMC1_D1_PORT148, NULL);
702 gpio_request(GPIO_FN_MMC1_D2_PORT147, NULL);
703 gpio_request(GPIO_FN_MMC1_D3_PORT146, NULL);
704 gpio_request(GPIO_FN_MMC1_D4_PORT145, NULL);
705 gpio_request(GPIO_FN_MMC1_D5_PORT144, NULL);
706 gpio_request(GPIO_FN_MMC1_D6_PORT143, NULL);
707 gpio_request(GPIO_FN_MMC1_D7_PORT142, NULL);
708
709 /*
710 * CAUTION
711 *
712 * DBGMD/LCDC0/FSIA MUX
713 * DBGMD_SELECT_B should be set after setting PFC Function.
714 */
715 gpio_request(GPIO_PORT176, NULL);
716 gpio_direction_output(GPIO_PORT176, 1);
717
718 /*
719 * We can switch CON8/CON14 by SW1.5,
720 * but it needs after DBGMD_SELECT_B
721 */
722 gpio_request(GPIO_PORT6, NULL);
723 gpio_direction_input(GPIO_PORT6);
724 if (gpio_get_value(GPIO_PORT6)) {
725 /* CON14 enable */
726 } else {
727 /* CON8 (SDHI1) enable */
728 gpio_request(GPIO_FN_SDHI1_CLK, NULL);
729 gpio_request(GPIO_FN_SDHI1_CMD, NULL);
730 gpio_request(GPIO_FN_SDHI1_D0, NULL);
731 gpio_request(GPIO_FN_SDHI1_D1, NULL);
732 gpio_request(GPIO_FN_SDHI1_D2, NULL);
733 gpio_request(GPIO_FN_SDHI1_D3, NULL);
734 gpio_request(GPIO_FN_SDHI1_CD, NULL);
735 gpio_request(GPIO_FN_SDHI1_WP, NULL);
736
737 gpio_request(GPIO_PORT16, NULL); /* SDSLOT2_PON */
738 gpio_direction_output(GPIO_PORT16, 1);
739
740 platform_device_register(&sdhi1_device);
741 }
742
743
744#ifdef CONFIG_CACHE_L2X0
745 /* Early BRESP enable, Shared attribute override enable, 32K*8way */
746 l2x0_init(__io(0xf0002000), 0x40440000, 0x82000fff);
747#endif
748
749 i2c_register_board_info(0, i2c0_devices, ARRAY_SIZE(i2c0_devices));
750
751 r8a7740_add_standard_devices();
752
753 platform_add_devices(eva_devices,
754 ARRAY_SIZE(eva_devices));
755}
756
757static void __init eva_earlytimer_init(void)
758{
759 r8a7740_clock_init(MD_CK0 | MD_CK2);
760 shmobile_earlytimer_init();
761}
762
763static void __init eva_add_early_devices(void)
764{
765 r8a7740_add_early_devices();
766
767 /* override timer setup with board-specific code */
768 shmobile_timer.init = eva_earlytimer_init;
769}
770
771static const char *eva_boards_compat_dt[] __initdata = {
772 "renesas,armadillo800eva",
773 NULL,
774};
775
776DT_MACHINE_START(ARMADILLO800EVA_DT, "armadillo800eva")
777 .map_io = r8a7740_map_io,
778 .init_early = eva_add_early_devices,
779 .init_irq = r8a7740_init_irq,
780 .handle_irq = shmobile_handle_irq_intc,
781 .init_machine = eva_init,
782 .timer = &shmobile_timer,
783 .dt_compat = eva_boards_compat_dt,
784MACHINE_END
diff --git a/arch/arm/mach-shmobile/board-bonito.c b/arch/arm/mach-shmobile/board-bonito.c
index 81fd95f7f52a..63ab7062bee3 100644
--- a/arch/arm/mach-shmobile/board-bonito.c
+++ b/arch/arm/mach-shmobile/board-bonito.c
@@ -486,7 +486,7 @@ static void __init bonito_earlytimer_init(void)
486 shmobile_earlytimer_init(); 486 shmobile_earlytimer_init();
487} 487}
488 488
489void __init bonito_add_early_devices(void) 489static void __init bonito_add_early_devices(void)
490{ 490{
491 r8a7740_add_early_devices(); 491 r8a7740_add_early_devices();
492 492
diff --git a/arch/arm/mach-shmobile/board-kzm9g.c b/arch/arm/mach-shmobile/board-kzm9g.c
new file mode 100644
index 000000000000..d8e33b682832
--- /dev/null
+++ b/arch/arm/mach-shmobile/board-kzm9g.c
@@ -0,0 +1,460 @@
1/*
2 * KZM-A9-GT board support
3 *
4 * Copyright (C) 2012 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
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 as published by
8 * the Free Software Foundation; version 2 of the License.
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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 */
19
20#include <linux/delay.h>
21#include <linux/gpio.h>
22#include <linux/gpio_keys.h>
23#include <linux/io.h>
24#include <linux/irq.h>
25#include <linux/i2c.h>
26#include <linux/i2c/pcf857x.h>
27#include <linux/input.h>
28#include <linux/mmc/host.h>
29#include <linux/mmc/sh_mmcif.h>
30#include <linux/mmc/sh_mobile_sdhi.h>
31#include <linux/mfd/tmio.h>
32#include <linux/platform_device.h>
33#include <linux/smsc911x.h>
34#include <linux/usb/r8a66597.h>
35#include <linux/videodev2.h>
36#include <mach/irqs.h>
37#include <mach/sh73a0.h>
38#include <mach/common.h>
39#include <asm/hardware/cache-l2x0.h>
40#include <asm/hardware/gic.h>
41#include <asm/mach-types.h>
42#include <asm/mach/arch.h>
43#include <video/sh_mobile_lcdc.h>
44
45/*
46 * external GPIO
47 */
48#define GPIO_PCF8575_BASE (GPIO_NR)
49#define GPIO_PCF8575_PORT10 (GPIO_NR + 8)
50#define GPIO_PCF8575_PORT11 (GPIO_NR + 9)
51#define GPIO_PCF8575_PORT12 (GPIO_NR + 10)
52#define GPIO_PCF8575_PORT13 (GPIO_NR + 11)
53#define GPIO_PCF8575_PORT14 (GPIO_NR + 12)
54#define GPIO_PCF8575_PORT15 (GPIO_NR + 13)
55#define GPIO_PCF8575_PORT16 (GPIO_NR + 14)
56
57/* SMSC 9221 */
58static struct resource smsc9221_resources[] = {
59 [0] = {
60 .start = 0x10000000, /* CS4 */
61 .end = 0x100000ff,
62 .flags = IORESOURCE_MEM,
63 },
64 [1] = {
65 .start = intcs_evt2irq(0x260), /* IRQ3 */
66 .flags = IORESOURCE_IRQ,
67 },
68};
69
70static struct smsc911x_platform_config smsc9221_platdata = {
71 .flags = SMSC911X_USE_32BIT | SMSC911X_SAVE_MAC_ADDRESS,
72 .phy_interface = PHY_INTERFACE_MODE_MII,
73 .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
74 .irq_type = SMSC911X_IRQ_TYPE_PUSH_PULL,
75};
76
77static struct platform_device smsc_device = {
78 .name = "smsc911x",
79 .dev = {
80 .platform_data = &smsc9221_platdata,
81 },
82 .resource = smsc9221_resources,
83 .num_resources = ARRAY_SIZE(smsc9221_resources),
84};
85
86/* USB external chip */
87static struct r8a66597_platdata usb_host_data = {
88 .on_chip = 0,
89 .xtal = R8A66597_PLATDATA_XTAL_48MHZ,
90};
91
92static struct resource usb_resources[] = {
93 [0] = {
94 .start = 0x10010000,
95 .end = 0x1001ffff - 1,
96 .flags = IORESOURCE_MEM,
97 },
98 [1] = {
99 .start = intcs_evt2irq(0x220), /* IRQ1 */
100 .flags = IORESOURCE_IRQ,
101 },
102};
103
104static struct platform_device usb_host_device = {
105 .name = "r8a66597_hcd",
106 .dev = {
107 .platform_data = &usb_host_data,
108 .dma_mask = NULL,
109 .coherent_dma_mask = 0xffffffff,
110 },
111 .num_resources = ARRAY_SIZE(usb_resources),
112 .resource = usb_resources,
113};
114
115/* LCDC */
116static struct fb_videomode kzm_lcdc_mode = {
117 .name = "WVGA Panel",
118 .xres = 800,
119 .yres = 480,
120 .left_margin = 220,
121 .right_margin = 110,
122 .hsync_len = 70,
123 .upper_margin = 20,
124 .lower_margin = 5,
125 .vsync_len = 5,
126 .sync = 0,
127};
128
129static struct sh_mobile_lcdc_info lcdc_info = {
130 .clock_source = LCDC_CLK_BUS,
131 .ch[0] = {
132 .chan = LCDC_CHAN_MAINLCD,
133 .fourcc = V4L2_PIX_FMT_RGB565,
134 .interface_type = RGB24,
135 .lcd_modes = &kzm_lcdc_mode,
136 .num_modes = 1,
137 .clock_divider = 5,
138 .flags = 0,
139 .panel_cfg = {
140 .width = 152,
141 .height = 91,
142 },
143 }
144};
145
146static struct resource lcdc_resources[] = {
147 [0] = {
148 .name = "LCDC",
149 .start = 0xfe940000,
150 .end = 0xfe943fff,
151 .flags = IORESOURCE_MEM,
152 },
153 [1] = {
154 .start = intcs_evt2irq(0x580),
155 .flags = IORESOURCE_IRQ,
156 },
157};
158
159static struct platform_device lcdc_device = {
160 .name = "sh_mobile_lcdc_fb",
161 .num_resources = ARRAY_SIZE(lcdc_resources),
162 .resource = lcdc_resources,
163 .dev = {
164 .platform_data = &lcdc_info,
165 .coherent_dma_mask = ~0,
166 },
167};
168
169/* MMCIF */
170static struct resource sh_mmcif_resources[] = {
171 [0] = {
172 .name = "MMCIF",
173 .start = 0xe6bd0000,
174 .end = 0xe6bd00ff,
175 .flags = IORESOURCE_MEM,
176 },
177 [1] = {
178 .start = gic_spi(141),
179 .flags = IORESOURCE_IRQ,
180 },
181 [2] = {
182 .start = gic_spi(140),
183 .flags = IORESOURCE_IRQ,
184 },
185};
186
187static struct sh_mmcif_plat_data sh_mmcif_platdata = {
188 .ocr = MMC_VDD_165_195,
189 .caps = MMC_CAP_8_BIT_DATA | MMC_CAP_NONREMOVABLE,
190};
191
192static struct platform_device mmc_device = {
193 .name = "sh_mmcif",
194 .dev = {
195 .dma_mask = NULL,
196 .coherent_dma_mask = 0xffffffff,
197 .platform_data = &sh_mmcif_platdata,
198 },
199 .num_resources = ARRAY_SIZE(sh_mmcif_resources),
200 .resource = sh_mmcif_resources,
201};
202
203/* SDHI */
204static struct sh_mobile_sdhi_info sdhi0_info = {
205 .tmio_flags = TMIO_MMC_HAS_IDLE_WAIT,
206 .tmio_caps = MMC_CAP_SD_HIGHSPEED,
207 .tmio_ocr_mask = MMC_VDD_27_28 | MMC_VDD_28_29,
208};
209
210static struct resource sdhi0_resources[] = {
211 [0] = {
212 .name = "SDHI0",
213 .start = 0xee100000,
214 .end = 0xee1000ff,
215 .flags = IORESOURCE_MEM,
216 },
217 [1] = {
218 .name = SH_MOBILE_SDHI_IRQ_CARD_DETECT,
219 .start = gic_spi(83),
220 .flags = IORESOURCE_IRQ,
221 },
222 [2] = {
223 .name = SH_MOBILE_SDHI_IRQ_SDCARD,
224 .start = gic_spi(84),
225 .flags = IORESOURCE_IRQ,
226 },
227 [3] = {
228 .name = SH_MOBILE_SDHI_IRQ_SDIO,
229 .start = gic_spi(85),
230 .flags = IORESOURCE_IRQ,
231 },
232};
233
234static struct platform_device sdhi0_device = {
235 .name = "sh_mobile_sdhi",
236 .num_resources = ARRAY_SIZE(sdhi0_resources),
237 .resource = sdhi0_resources,
238 .dev = {
239 .platform_data = &sdhi0_info,
240 },
241};
242
243/* KEY */
244#define GPIO_KEY(c, g, d) { .code = c, .gpio = g, .desc = d, .active_low = 1 }
245
246static struct gpio_keys_button gpio_buttons[] = {
247 GPIO_KEY(KEY_BACK, GPIO_PCF8575_PORT10, "SW3"),
248 GPIO_KEY(KEY_RIGHT, GPIO_PCF8575_PORT11, "SW2-R"),
249 GPIO_KEY(KEY_LEFT, GPIO_PCF8575_PORT12, "SW2-L"),
250 GPIO_KEY(KEY_ENTER, GPIO_PCF8575_PORT13, "SW2-P"),
251 GPIO_KEY(KEY_UP, GPIO_PCF8575_PORT14, "SW2-U"),
252 GPIO_KEY(KEY_DOWN, GPIO_PCF8575_PORT15, "SW2-D"),
253 GPIO_KEY(KEY_HOME, GPIO_PCF8575_PORT16, "SW1"),
254};
255
256static struct gpio_keys_platform_data gpio_key_info = {
257 .buttons = gpio_buttons,
258 .nbuttons = ARRAY_SIZE(gpio_buttons),
259 .poll_interval = 250, /* poling at this point */
260};
261
262static struct platform_device gpio_keys_device = {
263 /* gpio-pcf857x.c driver doesn't support gpio_to_irq() */
264 .name = "gpio-keys-polled",
265 .dev = {
266 .platform_data = &gpio_key_info,
267 },
268};
269
270/* I2C */
271static struct pcf857x_platform_data pcf8575_pdata = {
272 .gpio_base = GPIO_PCF8575_BASE,
273};
274
275static struct i2c_board_info i2c1_devices[] = {
276 {
277 I2C_BOARD_INFO("st1232-ts", 0x55),
278 .irq = intcs_evt2irq(0x300), /* IRQ8 */
279 },
280};
281
282static struct i2c_board_info i2c3_devices[] = {
283 {
284 I2C_BOARD_INFO("pcf8575", 0x20),
285 .platform_data = &pcf8575_pdata,
286 },
287};
288
289static struct platform_device *kzm_devices[] __initdata = {
290 &smsc_device,
291 &usb_host_device,
292 &lcdc_device,
293 &mmc_device,
294 &sdhi0_device,
295 &gpio_keys_device,
296};
297
298/*
299 * FIXME
300 *
301 * This is quick hack for enabling LCDC backlight
302 */
303static int __init as3711_enable_lcdc_backlight(void)
304{
305 struct i2c_adapter *a = i2c_get_adapter(0);
306 struct i2c_msg msg;
307 int i, ret;
308 __u8 magic[] = {
309 0x40, 0x2a,
310 0x43, 0x3c,
311 0x44, 0x3c,
312 0x45, 0x3c,
313 0x54, 0x03,
314 0x51, 0x00,
315 0x51, 0x01,
316 0xff, 0x00, /* wait */
317 0x43, 0xf0,
318 0x44, 0xf0,
319 0x45, 0xf0,
320 };
321
322 if (!machine_is_kzm9g())
323 return 0;
324
325 if (!a)
326 return 0;
327
328 msg.addr = 0x40;
329 msg.len = 2;
330 msg.flags = 0;
331
332 for (i = 0; i < ARRAY_SIZE(magic); i += 2) {
333 msg.buf = magic + i;
334
335 if (0xff == msg.buf[0]) {
336 udelay(500);
337 continue;
338 }
339
340 ret = i2c_transfer(a, &msg, 1);
341 if (ret < 0) {
342 pr_err("i2c transfer fail\n");
343 break;
344 }
345 }
346
347 return 0;
348}
349device_initcall(as3711_enable_lcdc_backlight);
350
351static void __init kzm_init(void)
352{
353 sh73a0_pinmux_init();
354
355 /* enable SCIFA4 */
356 gpio_request(GPIO_FN_SCIFA4_TXD, NULL);
357 gpio_request(GPIO_FN_SCIFA4_RXD, NULL);
358 gpio_request(GPIO_FN_SCIFA4_RTS_, NULL);
359 gpio_request(GPIO_FN_SCIFA4_CTS_, NULL);
360
361 /* CS4 for SMSC/USB */
362 gpio_request(GPIO_FN_CS4_, NULL); /* CS4 */
363
364 /* SMSC */
365 gpio_request(GPIO_PORT224, NULL); /* IRQ3 */
366 gpio_direction_input(GPIO_PORT224);
367
368 /* LCDC */
369 gpio_request(GPIO_FN_LCDD23, NULL);
370 gpio_request(GPIO_FN_LCDD22, NULL);
371 gpio_request(GPIO_FN_LCDD21, NULL);
372 gpio_request(GPIO_FN_LCDD20, NULL);
373 gpio_request(GPIO_FN_LCDD19, NULL);
374 gpio_request(GPIO_FN_LCDD18, NULL);
375 gpio_request(GPIO_FN_LCDD17, NULL);
376 gpio_request(GPIO_FN_LCDD16, NULL);
377 gpio_request(GPIO_FN_LCDD15, NULL);
378 gpio_request(GPIO_FN_LCDD14, NULL);
379 gpio_request(GPIO_FN_LCDD13, NULL);
380 gpio_request(GPIO_FN_LCDD12, NULL);
381 gpio_request(GPIO_FN_LCDD11, NULL);
382 gpio_request(GPIO_FN_LCDD10, NULL);
383 gpio_request(GPIO_FN_LCDD9, NULL);
384 gpio_request(GPIO_FN_LCDD8, NULL);
385 gpio_request(GPIO_FN_LCDD7, NULL);
386 gpio_request(GPIO_FN_LCDD6, NULL);
387 gpio_request(GPIO_FN_LCDD5, NULL);
388 gpio_request(GPIO_FN_LCDD4, NULL);
389 gpio_request(GPIO_FN_LCDD3, NULL);
390 gpio_request(GPIO_FN_LCDD2, NULL);
391 gpio_request(GPIO_FN_LCDD1, NULL);
392 gpio_request(GPIO_FN_LCDD0, NULL);
393 gpio_request(GPIO_FN_LCDDISP, NULL);
394 gpio_request(GPIO_FN_LCDDCK, NULL);
395
396 gpio_request(GPIO_PORT222, NULL); /* LCDCDON */
397 gpio_request(GPIO_PORT226, NULL); /* SC */
398 gpio_direction_output(GPIO_PORT222, 1);
399 gpio_direction_output(GPIO_PORT226, 1);
400
401 /* Touchscreen */
402 gpio_request(GPIO_PORT223, NULL); /* IRQ8 */
403 gpio_direction_input(GPIO_PORT223);
404
405 /* enable MMCIF */
406 gpio_request(GPIO_FN_MMCCLK0, NULL);
407 gpio_request(GPIO_FN_MMCCMD0_PU, NULL);
408 gpio_request(GPIO_FN_MMCD0_0_PU, NULL);
409 gpio_request(GPIO_FN_MMCD0_1_PU, NULL);
410 gpio_request(GPIO_FN_MMCD0_2_PU, NULL);
411 gpio_request(GPIO_FN_MMCD0_3_PU, NULL);
412 gpio_request(GPIO_FN_MMCD0_4_PU, NULL);
413 gpio_request(GPIO_FN_MMCD0_5_PU, NULL);
414 gpio_request(GPIO_FN_MMCD0_6_PU, NULL);
415 gpio_request(GPIO_FN_MMCD0_7_PU, NULL);
416
417 /* enable SD */
418 gpio_request(GPIO_FN_SDHIWP0, NULL);
419 gpio_request(GPIO_FN_SDHICD0, NULL);
420 gpio_request(GPIO_FN_SDHICMD0, NULL);
421 gpio_request(GPIO_FN_SDHICLK0, NULL);
422 gpio_request(GPIO_FN_SDHID0_3, NULL);
423 gpio_request(GPIO_FN_SDHID0_2, NULL);
424 gpio_request(GPIO_FN_SDHID0_1, NULL);
425 gpio_request(GPIO_FN_SDHID0_0, NULL);
426 gpio_request(GPIO_FN_SDHI0_VCCQ_MC0_ON, NULL);
427 gpio_request(GPIO_PORT15, NULL);
428 gpio_direction_output(GPIO_PORT15, 1); /* power */
429
430 /* I2C 3 */
431 gpio_request(GPIO_FN_PORT27_I2C_SCL3, NULL);
432 gpio_request(GPIO_FN_PORT28_I2C_SDA3, NULL);
433
434#ifdef CONFIG_CACHE_L2X0
435 /* Early BRESP enable, Shared attribute override enable, 64K*8way */
436 l2x0_init(IOMEM(0xf0100000), 0x40460000, 0x82000fff);
437#endif
438
439 i2c_register_board_info(1, i2c1_devices, ARRAY_SIZE(i2c1_devices));
440 i2c_register_board_info(3, i2c3_devices, ARRAY_SIZE(i2c3_devices));
441
442 sh73a0_add_standard_devices();
443 platform_add_devices(kzm_devices, ARRAY_SIZE(kzm_devices));
444}
445
446static const char *kzm9g_boards_compat_dt[] __initdata = {
447 "renesas,kzm9g",
448 NULL,
449};
450
451DT_MACHINE_START(KZM9G_DT, "kzm9g")
452 .map_io = sh73a0_map_io,
453 .init_early = sh73a0_add_early_devices,
454 .nr_irqs = NR_IRQS_LEGACY,
455 .init_irq = sh73a0_init_irq,
456 .handle_irq = gic_handle_irq,
457 .init_machine = kzm_init,
458 .timer = &shmobile_timer,
459 .dt_compat = kzm9g_boards_compat_dt,
460MACHINE_END
diff --git a/arch/arm/mach-shmobile/board-mackerel.c b/arch/arm/mach-shmobile/board-mackerel.c
index 8c6202bb6aeb..aae2e24fde46 100644
--- a/arch/arm/mach-shmobile/board-mackerel.c
+++ b/arch/arm/mach-shmobile/board-mackerel.c
@@ -908,6 +908,8 @@ fsi_set_rate_end:
908static struct sh_fsi_platform_info fsi_info = { 908static struct sh_fsi_platform_info fsi_info = {
909 .port_a = { 909 .port_a = {
910 .flags = SH_FSI_BRS_INV, 910 .flags = SH_FSI_BRS_INV,
911 .tx_id = SHDMA_SLAVE_FSIA_TX,
912 .rx_id = SHDMA_SLAVE_FSIA_RX,
911 }, 913 },
912 .port_b = { 914 .port_b = {
913 .flags = SH_FSI_BRS_INV | 915 .flags = SH_FSI_BRS_INV |
@@ -920,9 +922,11 @@ static struct sh_fsi_platform_info fsi_info = {
920 922
921static struct resource fsi_resources[] = { 923static struct resource fsi_resources[] = {
922 [0] = { 924 [0] = {
925 /* we need 0xFE1F0000 to access DMA
926 * instead of 0xFE3C0000 */
923 .name = "FSI", 927 .name = "FSI",
924 .start = 0xFE3C0000, 928 .start = 0xFE1F0000,
925 .end = 0xFE3C0400 - 1, 929 .end = 0xFE1F0400 - 1,
926 .flags = IORESOURCE_MEM, 930 .flags = IORESOURCE_MEM,
927 }, 931 },
928 [1] = { 932 [1] = {
@@ -1248,6 +1252,8 @@ static void mackerel_camera_del(struct soc_camera_device *icd)
1248 1252
1249static struct sh_mobile_ceu_info sh_mobile_ceu_info = { 1253static struct sh_mobile_ceu_info sh_mobile_ceu_info = {
1250 .flags = SH_CEU_FLAG_USE_8BIT_BUS, 1254 .flags = SH_CEU_FLAG_USE_8BIT_BUS,
1255 .max_width = 8188,
1256 .max_height = 8188,
1251}; 1257};
1252 1258
1253static struct resource ceu_resources[] = { 1259static struct resource ceu_resources[] = {
diff --git a/arch/arm/mach-shmobile/clock-r8a7740.c b/arch/arm/mach-shmobile/clock-r8a7740.c
index 81b54a6af20f..26eea5f21054 100644
--- a/arch/arm/mach-shmobile/clock-r8a7740.c
+++ b/arch/arm/mach-shmobile/clock-r8a7740.c
@@ -352,6 +352,7 @@ enum {
352 352
353 MSTP329, MSTP328, MSTP323, MSTP320, 353 MSTP329, MSTP328, MSTP323, MSTP320,
354 MSTP314, MSTP313, MSTP312, 354 MSTP314, MSTP313, MSTP312,
355 MSTP309,
355 356
356 MSTP416, MSTP415, MSTP407, MSTP406, 357 MSTP416, MSTP415, MSTP407, MSTP406,
357 358
@@ -382,6 +383,7 @@ static struct clk mstp_clks[MSTP_NR] = {
382 [MSTP314] = SH_CLK_MSTP32(&div4_clks[DIV4_HP], SMSTPCR3, 14, 0), /* SDHI0 */ 383 [MSTP314] = SH_CLK_MSTP32(&div4_clks[DIV4_HP], SMSTPCR3, 14, 0), /* SDHI0 */
383 [MSTP313] = SH_CLK_MSTP32(&div4_clks[DIV4_HP], SMSTPCR3, 13, 0), /* SDHI1 */ 384 [MSTP313] = SH_CLK_MSTP32(&div4_clks[DIV4_HP], SMSTPCR3, 13, 0), /* SDHI1 */
384 [MSTP312] = SH_CLK_MSTP32(&div4_clks[DIV4_HP], SMSTPCR3, 12, 0), /* MMC */ 385 [MSTP312] = SH_CLK_MSTP32(&div4_clks[DIV4_HP], SMSTPCR3, 12, 0), /* MMC */
386 [MSTP309] = SH_CLK_MSTP32(&div4_clks[DIV4_HP], SMSTPCR3, 9, 0), /* GEther */
385 387
386 [MSTP416] = SH_CLK_MSTP32(&div4_clks[DIV4_HP], SMSTPCR4, 16, 0), /* USBHOST */ 388 [MSTP416] = SH_CLK_MSTP32(&div4_clks[DIV4_HP], SMSTPCR4, 16, 0), /* USBHOST */
387 [MSTP415] = SH_CLK_MSTP32(&div4_clks[DIV4_HP], SMSTPCR4, 15, 0), /* SDHI2 */ 389 [MSTP415] = SH_CLK_MSTP32(&div4_clks[DIV4_HP], SMSTPCR4, 15, 0), /* SDHI2 */
@@ -447,6 +449,7 @@ static struct clk_lookup lookups[] = {
447 CLKDEV_DEV_ID("sh_mobile_sdhi.0", &mstp_clks[MSTP314]), 449 CLKDEV_DEV_ID("sh_mobile_sdhi.0", &mstp_clks[MSTP314]),
448 CLKDEV_DEV_ID("sh_mobile_sdhi.1", &mstp_clks[MSTP313]), 450 CLKDEV_DEV_ID("sh_mobile_sdhi.1", &mstp_clks[MSTP313]),
449 CLKDEV_DEV_ID("sh_mmcif", &mstp_clks[MSTP312]), 451 CLKDEV_DEV_ID("sh_mmcif", &mstp_clks[MSTP312]),
452 CLKDEV_DEV_ID("sh-eth", &mstp_clks[MSTP309]),
450 453
451 CLKDEV_DEV_ID("sh_mobile_sdhi.2", &mstp_clks[MSTP415]), 454 CLKDEV_DEV_ID("sh_mobile_sdhi.2", &mstp_clks[MSTP415]),
452 455
diff --git a/arch/arm/mach-shmobile/include/mach/sh73a0.h b/arch/arm/mach-shmobile/include/mach/sh73a0.h
index 9b3598e4f105..398e2c10913b 100644
--- a/arch/arm/mach-shmobile/include/mach/sh73a0.h
+++ b/arch/arm/mach-shmobile/include/mach/sh73a0.h
@@ -482,6 +482,9 @@ enum {
482 GPIO_FN_FSIAILR_PU, 482 GPIO_FN_FSIAILR_PU,
483 GPIO_FN_FSIAIBT_PU, 483 GPIO_FN_FSIAIBT_PU,
484 GPIO_FN_FSIAISLD_PU, 484 GPIO_FN_FSIAISLD_PU,
485
486 /* end of GPIO */
487 GPIO_NR,
485}; 488};
486 489
487/* DMA slave IDs */ 490/* DMA slave IDs */
diff --git a/arch/arm/mach-shmobile/pfc-sh73a0.c b/arch/arm/mach-shmobile/pfc-sh73a0.c
index e05634ce2e0d..4a547b803268 100644
--- a/arch/arm/mach-shmobile/pfc-sh73a0.c
+++ b/arch/arm/mach-shmobile/pfc-sh73a0.c
@@ -829,14 +829,14 @@ static pinmux_enum_t pinmux_data[] = {
829 PINMUX_DATA(PORT27_I2C_SCL2_MARK, PORT27_FN2, MSEL2CR_MSEL17_0, 829 PINMUX_DATA(PORT27_I2C_SCL2_MARK, PORT27_FN2, MSEL2CR_MSEL17_0,
830 MSEL2CR_MSEL16_1), \ 830 MSEL2CR_MSEL16_1), \
831 PINMUX_DATA(PORT27_I2C_SCL3_MARK, PORT27_FN3, MSEL2CR_MSEL19_0, 831 PINMUX_DATA(PORT27_I2C_SCL3_MARK, PORT27_FN3, MSEL2CR_MSEL19_0,
832 MSEL2CR_MSEL18_0), \ 832 MSEL2CR_MSEL18_1), \
833 PINMUX_DATA(MFG0_OUT1_MARK, PORT27_FN4), \ 833 PINMUX_DATA(MFG0_OUT1_MARK, PORT27_FN4), \
834 PINMUX_DATA(PORT27_IROUT_MARK, PORT27_FN7), 834 PINMUX_DATA(PORT27_IROUT_MARK, PORT27_FN7),
835 PINMUX_DATA(XDVFS2_MARK, PORT28_FN1), \ 835 PINMUX_DATA(XDVFS2_MARK, PORT28_FN1), \
836 PINMUX_DATA(PORT28_I2C_SDA2_MARK, PORT28_FN2, MSEL2CR_MSEL17_0, 836 PINMUX_DATA(PORT28_I2C_SDA2_MARK, PORT28_FN2, MSEL2CR_MSEL17_0,
837 MSEL2CR_MSEL16_1), \ 837 MSEL2CR_MSEL16_1), \
838 PINMUX_DATA(PORT28_I2C_SDA3_MARK, PORT28_FN3, MSEL2CR_MSEL19_0, 838 PINMUX_DATA(PORT28_I2C_SDA3_MARK, PORT28_FN3, MSEL2CR_MSEL19_0,
839 MSEL2CR_MSEL18_0), \ 839 MSEL2CR_MSEL18_1), \
840 PINMUX_DATA(PORT28_TPU1TO1_MARK, PORT28_FN7), 840 PINMUX_DATA(PORT28_TPU1TO1_MARK, PORT28_FN7),
841 PINMUX_DATA(SIM_RST_MARK, PORT29_FN1), \ 841 PINMUX_DATA(SIM_RST_MARK, PORT29_FN1), \
842 PINMUX_DATA(PORT29_TPU1TO1_MARK, PORT29_FN4), 842 PINMUX_DATA(PORT29_TPU1TO1_MARK, PORT29_FN4),
diff --git a/arch/arm/mach-shmobile/platsmp.c b/arch/arm/mach-shmobile/platsmp.c
index 7006cdc8b8ca..bacdd667e3b1 100644
--- a/arch/arm/mach-shmobile/platsmp.c
+++ b/arch/arm/mach-shmobile/platsmp.c
@@ -22,7 +22,8 @@
22#include <mach/common.h> 22#include <mach/common.h>
23#include <mach/emev2.h> 23#include <mach/emev2.h>
24 24
25#define is_sh73a0() (machine_is_ag5evm() || machine_is_kota2()) 25#define is_sh73a0() (machine_is_ag5evm() || machine_is_kota2() || \
26 of_machine_is_compatible("renesas,sh73a0"))
26#define is_r8a7779() machine_is_marzen() 27#define is_r8a7779() machine_is_marzen()
27#define is_emev2() of_machine_is_compatible("renesas,emev2") 28#define is_emev2() of_machine_is_compatible("renesas,emev2")
28 29
diff --git a/arch/arm/mach-shmobile/setup-r8a7740.c b/arch/arm/mach-shmobile/setup-r8a7740.c
index 34a1548dbda6..ec4eb49c1693 100644
--- a/arch/arm/mach-shmobile/setup-r8a7740.c
+++ b/arch/arm/mach-shmobile/setup-r8a7740.c
@@ -18,6 +18,7 @@
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 */ 19 */
20#include <linux/delay.h> 20#include <linux/delay.h>
21#include <linux/dma-mapping.h>
21#include <linux/kernel.h> 22#include <linux/kernel.h>
22#include <linux/init.h> 23#include <linux/init.h>
23#include <linux/io.h> 24#include <linux/io.h>
@@ -60,6 +61,12 @@ static struct map_desc r8a7740_io_desc[] __initdata = {
60void __init r8a7740_map_io(void) 61void __init r8a7740_map_io(void)
61{ 62{
62 iotable_init(r8a7740_io_desc, ARRAY_SIZE(r8a7740_io_desc)); 63 iotable_init(r8a7740_io_desc, ARRAY_SIZE(r8a7740_io_desc));
64
65 /*
66 * DMA memory at 0xff200000 - 0xffdfffff. The default 2MB size isn't
67 * enough to allocate the frame buffer memory.
68 */
69 init_consistent_dma_size(12 << 20);
63} 70}
64 71
65/* SCIFA0 */ 72/* SCIFA0 */
diff --git a/arch/arm/plat-orion/gpio.c b/arch/arm/plat-orion/gpio.c
index 10d160888133..af95af257301 100644
--- a/arch/arm/plat-orion/gpio.c
+++ b/arch/arm/plat-orion/gpio.c
@@ -16,6 +16,7 @@
16#include <linux/bitops.h> 16#include <linux/bitops.h>
17#include <linux/io.h> 17#include <linux/io.h>
18#include <linux/gpio.h> 18#include <linux/gpio.h>
19#include <linux/leds.h>
19 20
20/* 21/*
21 * GPIO unit register offsets. 22 * GPIO unit register offsets.
@@ -289,12 +290,34 @@ void orion_gpio_set_blink(unsigned pin, int blink)
289 return; 290 return;
290 291
291 spin_lock_irqsave(&ochip->lock, flags); 292 spin_lock_irqsave(&ochip->lock, flags);
292 __set_level(ochip, pin, 0); 293 __set_level(ochip, pin & 31, 0);
293 __set_blinking(ochip, pin, blink); 294 __set_blinking(ochip, pin & 31, blink);
294 spin_unlock_irqrestore(&ochip->lock, flags); 295 spin_unlock_irqrestore(&ochip->lock, flags);
295} 296}
296EXPORT_SYMBOL(orion_gpio_set_blink); 297EXPORT_SYMBOL(orion_gpio_set_blink);
297 298
299#define ORION_BLINK_HALF_PERIOD 100 /* ms */
300
301int orion_gpio_led_blink_set(unsigned gpio, int state,
302 unsigned long *delay_on, unsigned long *delay_off)
303{
304
305 if (delay_on && delay_off && !*delay_on && !*delay_off)
306 *delay_on = *delay_off = ORION_BLINK_HALF_PERIOD;
307
308 switch (state) {
309 case GPIO_LED_NO_BLINK_LOW:
310 case GPIO_LED_NO_BLINK_HIGH:
311 orion_gpio_set_blink(gpio, 0);
312 gpio_set_value(gpio, state);
313 break;
314 case GPIO_LED_BLINK:
315 orion_gpio_set_blink(gpio, 1);
316 }
317 return 0;
318}
319EXPORT_SYMBOL_GPL(orion_gpio_led_blink_set);
320
298 321
299/***************************************************************************** 322/*****************************************************************************
300 * Orion GPIO IRQ 323 * Orion GPIO IRQ
diff --git a/arch/arm/plat-orion/include/plat/gpio.h b/arch/arm/plat-orion/include/plat/gpio.h
index 3abf30428bee..bec0c98ce41f 100644
--- a/arch/arm/plat-orion/include/plat/gpio.h
+++ b/arch/arm/plat-orion/include/plat/gpio.h
@@ -19,6 +19,8 @@
19 */ 19 */
20void orion_gpio_set_unused(unsigned pin); 20void orion_gpio_set_unused(unsigned pin);
21void orion_gpio_set_blink(unsigned pin, int blink); 21void orion_gpio_set_blink(unsigned pin, int blink);
22int orion_gpio_led_blink_set(unsigned gpio, int state,
23 unsigned long *delay_on, unsigned long *delay_off);
22 24
23#define GPIO_INPUT_OK (1 << 0) 25#define GPIO_INPUT_OK (1 << 0)
24#define GPIO_OUTPUT_OK (1 << 1) 26#define GPIO_OUTPUT_OK (1 << 1)