diff options
author | Rafael J. Wysocki <rjw@sisk.pl> | 2012-05-12 16:36:02 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rjw@sisk.pl> | 2012-05-12 16:36:02 -0400 |
commit | a515be1ca7df947db0f6018a174f49507affcdbc (patch) | |
tree | 8f5be875e2902bee701a6840ba1fbb19e8d0384a | |
parent | 9183857d503f915ee05abb6e03cea7253dcbace6 (diff) | |
parent | fecf84c14fa755b0e30ba64a290db658a06c76fb (diff) |
Merge branch 'renesas-kzm9g' into renesas-board-new
* renesas-kzm9g:
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
ARM: mach-shmobile: pfc-sh73a0: fixup MSEL2CR MSEL18 for I2C-3
ARM: mach-shmobile: kzm9g: add ST1232 Touchscreen support
ARM: mach-shmobile: kzm9g: add LCDC support
ARM: mach-shmobile: kzm9g: add external USB Host support
ARM: mach-shmobile: kzm9g: add SMSC 9221 support
ARM: mach-shmobile: kzm9g: add defconfig
ARM: mach-shmobile: add KZM-A9-GT board support
Conflicts:
arch/arm/mach-shmobile/Makefile
-rw-r--r-- | arch/arm/configs/kzm9g_defconfig | 139 | ||||
-rw-r--r-- | arch/arm/mach-shmobile/Kconfig | 5 | ||||
-rw-r--r-- | arch/arm/mach-shmobile/Makefile | 1 | ||||
-rw-r--r-- | arch/arm/mach-shmobile/board-kzm9g.c | 454 | ||||
-rw-r--r-- | arch/arm/mach-shmobile/include/mach/sh73a0.h | 3 | ||||
-rw-r--r-- | arch/arm/mach-shmobile/pfc-sh73a0.c | 4 | ||||
-rw-r--r-- | arch/arm/mach-shmobile/platsmp.c | 2 |
7 files changed, 605 insertions, 3 deletions
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 | ||
2 | CONFIG_EXPERIMENTAL=y | ||
3 | # CONFIG_LOCALVERSION_AUTO is not set | ||
4 | CONFIG_SYSVIPC=y | ||
5 | CONFIG_IKCONFIG=y | ||
6 | CONFIG_IKCONFIG_PROC=y | ||
7 | CONFIG_LOG_BUF_SHIFT=16 | ||
8 | CONFIG_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 | ||
14 | CONFIG_CC_OPTIMIZE_FOR_SIZE=y | ||
15 | CONFIG_SYSCTL_SYSCALL=y | ||
16 | CONFIG_EMBEDDED=y | ||
17 | CONFIG_SLAB=y | ||
18 | CONFIG_MODULES=y | ||
19 | CONFIG_MODULE_FORCE_LOAD=y | ||
20 | CONFIG_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 | ||
24 | CONFIG_ARCH_SHMOBILE=y | ||
25 | CONFIG_KEYBOARD_GPIO_POLLED=y | ||
26 | CONFIG_ARCH_SH73A0=y | ||
27 | CONFIG_MACH_KZM9G=y | ||
28 | CONFIG_MEMORY_START=0x41000000 | ||
29 | CONFIG_MEMORY_SIZE=0x1f000000 | ||
30 | CONFIG_ARM_ERRATA_743622=y | ||
31 | CONFIG_ARM_ERRATA_754322=y | ||
32 | CONFIG_NO_HZ=y | ||
33 | CONFIG_HIGH_RES_TIMERS=y | ||
34 | CONFIG_SMP=y | ||
35 | CONFIG_SCHED_MC=y | ||
36 | CONFIG_PREEMPT=y | ||
37 | CONFIG_AEABI=y | ||
38 | # CONFIG_OABI_COMPAT is not set | ||
39 | CONFIG_HIGHMEM=y | ||
40 | CONFIG_ZBOOT_ROM_TEXT=0x0 | ||
41 | CONFIG_ZBOOT_ROM_BSS=0x0 | ||
42 | CONFIG_CMDLINE="console=tty0 console=ttySC4,115200 root=/dev/nfs ip=dhcp ignore_loglevel earlyprintk=sh-sci.4,115200" | ||
43 | CONFIG_KEXEC=y | ||
44 | CONFIG_VFP=y | ||
45 | CONFIG_NEON=y | ||
46 | # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set | ||
47 | CONFIG_PM_RUNTIME=y | ||
48 | CONFIG_NET=y | ||
49 | CONFIG_PACKET=y | ||
50 | CONFIG_UNIX=y | ||
51 | CONFIG_INET=y | ||
52 | CONFIG_IP_PNP=y | ||
53 | CONFIG_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 | ||
60 | CONFIG_IRDA=y | ||
61 | CONFIG_SH_IRDA=y | ||
62 | # CONFIG_WIRELESS is not set | ||
63 | CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" | ||
64 | CONFIG_SCSI=y | ||
65 | CONFIG_BLK_DEV_SD=y | ||
66 | CONFIG_NETDEVICES=y | ||
67 | CONFIG_SMSC911X=y | ||
68 | # CONFIG_WLAN is not set | ||
69 | CONFIG_INPUT_SPARSEKMAP=y | ||
70 | # CONFIG_INPUT_MOUSEDEV is not set | ||
71 | CONFIG_INPUT_EVDEV=y | ||
72 | # CONFIG_KEYBOARD_ATKBD is not set | ||
73 | # CONFIG_INPUT_MOUSE is not set | ||
74 | CONFIG_INPUT_TOUCHSCREEN=y | ||
75 | CONFIG_TOUCHSCREEN_ST1232=y | ||
76 | # CONFIG_LEGACY_PTYS is not set | ||
77 | CONFIG_SERIAL_SH_SCI=y | ||
78 | CONFIG_SERIAL_SH_SCI_NR_UARTS=9 | ||
79 | CONFIG_SERIAL_SH_SCI_CONSOLE=y | ||
80 | # CONFIG_HW_RANDOM is not set | ||
81 | CONFIG_I2C_CHARDEV=y | ||
82 | CONFIG_I2C_SH_MOBILE=y | ||
83 | CONFIG_GPIO_PCF857X=y | ||
84 | # CONFIG_HWMON is not set | ||
85 | CONFIG_FB=y | ||
86 | CONFIG_FB_SH_MOBILE_LCDC=y | ||
87 | CONFIG_FRAMEBUFFER_CONSOLE=y | ||
88 | CONFIG_LOGO=y | ||
89 | CONFIG_FB_SH_MOBILE_MERAM=y | ||
90 | CONFIG_SOUND=y | ||
91 | CONFIG_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 | ||
97 | CONFIG_SND_SOC=y | ||
98 | CONFIG_SND_SOC_SH4_FSI=y | ||
99 | # CONFIG_HID_SUPPORT is not set | ||
100 | CONFIG_USB=y | ||
101 | CONFIG_USB_DEVICEFS=y | ||
102 | CONFIG_USB_R8A66597_HCD=y | ||
103 | CONFIG_USB_STORAGE=y | ||
104 | CONFIG_MMC=y | ||
105 | # CONFIG_MMC_BLOCK_BOUNCE is not set | ||
106 | CONFIG_MMC_SDHI=y | ||
107 | CONFIG_MMC_SH_MMCIF=y | ||
108 | CONFIG_NEW_LEDS=y | ||
109 | CONFIG_LEDS_CLASS=y | ||
110 | CONFIG_RTC_CLASS=y | ||
111 | CONFIG_DMADEVICES=y | ||
112 | CONFIG_SH_DMAE=y | ||
113 | CONFIG_ASYNC_TX_DMA=y | ||
114 | CONFIG_STAGING=y | ||
115 | # CONFIG_DNOTIFY is not set | ||
116 | # CONFIG_INOTIFY_USER is not set | ||
117 | CONFIG_VFAT_FS=y | ||
118 | CONFIG_TMPFS=y | ||
119 | # CONFIG_MISC_FILESYSTEMS is not set | ||
120 | CONFIG_NFS_FS=y | ||
121 | CONFIG_NFS_V3=y | ||
122 | CONFIG_NFS_V3_ACL=y | ||
123 | CONFIG_NFS_V4=y | ||
124 | CONFIG_NFS_V4_1=y | ||
125 | CONFIG_ROOT_NFS=y | ||
126 | CONFIG_NLS_CODEPAGE_437=y | ||
127 | CONFIG_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 | ||
135 | CONFIG_CRYPTO=y | ||
136 | CONFIG_CRYPTO_CBC=y | ||
137 | CONFIG_CRYPTO_MD5=y | ||
138 | CONFIG_CRYPTO_DES=y | ||
139 | CONFIG_CRC16=y | ||
diff --git a/arch/arm/mach-shmobile/Kconfig b/arch/arm/mach-shmobile/Kconfig index 7828a7a5f8d6..e703bd280f98 100644 --- a/arch/arm/mach-shmobile/Kconfig +++ b/arch/arm/mach-shmobile/Kconfig | |||
@@ -103,6 +103,11 @@ config MACH_MARZEN | |||
103 | depends on ARCH_R8A7779 | 103 | depends on ARCH_R8A7779 |
104 | select ARCH_REQUIRE_GPIOLIB | 104 | select ARCH_REQUIRE_GPIOLIB |
105 | 105 | ||
106 | config MACH_KZM9G | ||
107 | bool "KZM-A9-GT board" | ||
108 | depends on ARCH_SH73A0 | ||
109 | select ARCH_REQUIRE_GPIOLIB | ||
110 | |||
106 | comment "SH-Mobile System Configuration" | 111 | comment "SH-Mobile System Configuration" |
107 | 112 | ||
108 | config CPU_HAS_INTEVT | 113 | config CPU_HAS_INTEVT |
diff --git a/arch/arm/mach-shmobile/Makefile b/arch/arm/mach-shmobile/Makefile index 6125c2b4d523..4ac8c12c72ba 100644 --- a/arch/arm/mach-shmobile/Makefile +++ b/arch/arm/mach-shmobile/Makefile | |||
@@ -50,6 +50,7 @@ obj-$(CONFIG_MACH_KOTA2) += board-kota2.o | |||
50 | obj-$(CONFIG_MACH_BONITO) += board-bonito.o | 50 | obj-$(CONFIG_MACH_BONITO) += board-bonito.o |
51 | obj-$(CONFIG_MACH_MARZEN) += board-marzen.o | 51 | obj-$(CONFIG_MACH_MARZEN) += board-marzen.o |
52 | obj-$(CONFIG_MACH_ARMADILLO800EVA) += board-armadillo800eva.o | 52 | obj-$(CONFIG_MACH_ARMADILLO800EVA) += board-armadillo800eva.o |
53 | obj-$(CONFIG_MACH_KZM9G) += board-kzm9g.o | ||
53 | 54 | ||
54 | # Framework support | 55 | # Framework support |
55 | obj-$(CONFIG_SMP) += $(smp-y) | 56 | obj-$(CONFIG_SMP) += $(smp-y) |
diff --git a/arch/arm/mach-shmobile/board-kzm9g.c b/arch/arm/mach-shmobile/board-kzm9g.c new file mode 100644 index 000000000000..78e9850967eb --- /dev/null +++ b/arch/arm/mach-shmobile/board-kzm9g.c | |||
@@ -0,0 +1,454 @@ | |||
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 */ | ||
58 | static 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 | |||
70 | static 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 | |||
77 | static 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 */ | ||
87 | static struct r8a66597_platdata usb_host_data = { | ||
88 | .on_chip = 0, | ||
89 | .xtal = R8A66597_PLATDATA_XTAL_48MHZ, | ||
90 | }; | ||
91 | |||
92 | static 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 | |||
104 | static 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 */ | ||
116 | static 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 | |||
129 | static 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 | |||
146 | static 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 | |||
159 | static 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 */ | ||
170 | static 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 | |||
187 | static 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 | |||
192 | static 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 */ | ||
204 | static 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 | |||
210 | static 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 | |||
234 | static 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 | |||
246 | static 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 | |||
256 | static 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 | |||
262 | static 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 */ | ||
271 | static struct pcf857x_platform_data pcf8575_pdata = { | ||
272 | .gpio_base = GPIO_PCF8575_BASE, | ||
273 | }; | ||
274 | |||
275 | static struct i2c_board_info i2c1_devices[] = { | ||
276 | { | ||
277 | I2C_BOARD_INFO("st1232-ts", 0x55), | ||
278 | .irq = intcs_evt2irq(0x300), /* IRQ8 */ | ||
279 | }, | ||
280 | }; | ||
281 | |||
282 | static struct i2c_board_info i2c3_devices[] = { | ||
283 | { | ||
284 | I2C_BOARD_INFO("pcf8575", 0x20), | ||
285 | .platform_data = &pcf8575_pdata, | ||
286 | }, | ||
287 | }; | ||
288 | |||
289 | static 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 | */ | ||
303 | static 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 | } | ||
349 | device_initcall(as3711_enable_lcdc_backlight); | ||
350 | |||
351 | static 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 | |||
446 | MACHINE_START(KZM9G, "kzm9g") | ||
447 | .map_io = sh73a0_map_io, | ||
448 | .init_early = sh73a0_add_early_devices, | ||
449 | .nr_irqs = NR_IRQS_LEGACY, | ||
450 | .init_irq = sh73a0_init_irq, | ||
451 | .handle_irq = gic_handle_irq, | ||
452 | .init_machine = kzm_init, | ||
453 | .timer = &shmobile_timer, | ||
454 | MACHINE_END | ||
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 | ||
26 | static unsigned int __init shmobile_smp_get_core_count(void) | 26 | static unsigned int __init shmobile_smp_get_core_count(void) |