aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm')
-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/kzm9g_defconfig139
-rw-r--r--arch/arm/mach-shmobile/Kconfig18
-rw-r--r--arch/arm/mach-shmobile/Makefile2
-rw-r--r--arch/arm/mach-shmobile/board-armadillo800eva.c784
-rw-r--r--arch/arm/mach-shmobile/board-kzm9g.c460
-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.c2
-rw-r--r--arch/arm/mach-shmobile/setup-r8a7740.c7
13 files changed, 1603 insertions, 5 deletions
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..ed1bae5a24f1
--- /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";
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/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/mach-shmobile/Kconfig b/arch/arm/mach-shmobile/Kconfig
index 34560cab45d9..8e3602adabef 100644
--- a/arch/arm/mach-shmobile/Kconfig
+++ b/arch/arm/mach-shmobile/Kconfig
@@ -93,11 +93,23 @@ config MACH_BONITO
93 select ARCH_REQUIRE_GPIOLIB 93 select ARCH_REQUIRE_GPIOLIB
94 depends on ARCH_R8A7740 94 depends on ARCH_R8A7740
95 95
96config MACH_ARMADILLO800EVA
97 bool "Armadillo-800 EVA board"
98 depends on ARCH_R8A7740
99 select ARCH_REQUIRE_GPIOLIB
100 select USE_OF
101
96config MACH_MARZEN 102config MACH_MARZEN
97 bool "MARZEN board" 103 bool "MARZEN board"
98 depends on ARCH_R8A7779 104 depends on ARCH_R8A7779
99 select ARCH_REQUIRE_GPIOLIB 105 select ARCH_REQUIRE_GPIOLIB
100 106
107config MACH_KZM9G
108 bool "KZM-A9-GT board"
109 depends on ARCH_SH73A0
110 select ARCH_REQUIRE_GPIOLIB
111 select USE_OF
112
101comment "SH-Mobile System Configuration" 113comment "SH-Mobile System Configuration"
102 114
103config CPU_HAS_INTEVT 115config CPU_HAS_INTEVT
@@ -110,7 +122,8 @@ config MEMORY_START
110 hex "Physical memory start address" 122 hex "Physical memory start address"
111 default "0x50000000" if MACH_G3EVM 123 default "0x50000000" if MACH_G3EVM
112 default "0x40000000" if MACH_G4EVM || MACH_AP4EVB || MACH_AG5EVM || \ 124 default "0x40000000" if MACH_G4EVM || MACH_AP4EVB || MACH_AG5EVM || \
113 MACH_MACKEREL || MACH_BONITO 125 MACH_MACKEREL || MACH_BONITO || \
126 MACH_ARMADILLO800EVA
114 default "0x41000000" if MACH_KOTA2 127 default "0x41000000" if MACH_KOTA2
115 default "0x00000000" 128 default "0x00000000"
116 ---help--- 129 ---help---
@@ -122,7 +135,8 @@ config MEMORY_SIZE
122 hex "Physical memory size" 135 hex "Physical memory size"
123 default "0x08000000" if MACH_G3EVM 136 default "0x08000000" if MACH_G3EVM
124 default "0x08000000" if MACH_G4EVM 137 default "0x08000000" if MACH_G4EVM
125 default "0x20000000" if MACH_AG5EVM || MACH_BONITO 138 default "0x20000000" if MACH_AG5EVM || MACH_BONITO || \
139 MACH_ARMADILLO800EVA
126 default "0x1e000000" if MACH_KOTA2 140 default "0x1e000000" if MACH_KOTA2
127 default "0x10000000" if MACH_AP4EVB || MACH_MACKEREL 141 default "0x10000000" if MACH_AP4EVB || MACH_MACKEREL
128 default "0x04000000" 142 default "0x04000000"
diff --git a/arch/arm/mach-shmobile/Makefile b/arch/arm/mach-shmobile/Makefile
index e7c2590b75d9..4ac8c12c72ba 100644
--- a/arch/arm/mach-shmobile/Makefile
+++ b/arch/arm/mach-shmobile/Makefile
@@ -49,6 +49,8 @@ obj-$(CONFIG_MACH_MACKEREL) += board-mackerel.o
49obj-$(CONFIG_MACH_KOTA2) += board-kota2.o 49obj-$(CONFIG_MACH_KOTA2) += board-kota2.o
50obj-$(CONFIG_MACH_BONITO) += board-bonito.o 50obj-$(CONFIG_MACH_BONITO) += board-bonito.o
51obj-$(CONFIG_MACH_MARZEN) += board-marzen.o 51obj-$(CONFIG_MACH_MARZEN) += board-marzen.o
52obj-$(CONFIG_MACH_ARMADILLO800EVA) += board-armadillo800eva.o
53obj-$(CONFIG_MACH_KZM9G) += board-kzm9g.o
52 54
53# Framework support 55# Framework support
54obj-$(CONFIG_SMP) += $(smp-y) 56obj-$(CONFIG_SMP) += $(smp-y)
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-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/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 cad57578ceed..ac758579d4e9 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 45fa3924c6a1..d959f07d1ef0 100644
--- a/arch/arm/mach-shmobile/platsmp.c
+++ b/arch/arm/mach-shmobile/platsmp.c
@@ -20,7 +20,7 @@
20#include <asm/mach-types.h> 20#include <asm/mach-types.h>
21#include <mach/common.h> 21#include <mach/common.h>
22 22
23#define is_sh73a0() (machine_is_ag5evm() || machine_is_kota2()) 23#define is_sh73a0() (machine_is_ag5evm() || machine_is_kota2() || machine_is_kzm9g())
24#define is_r8a7779() machine_is_marzen() 24#define is_r8a7779() machine_is_marzen()
25 25
26static unsigned int __init shmobile_smp_get_core_count(void) 26static unsigned int __init shmobile_smp_get_core_count(void)
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 */