blob: ef5ca0ef0cb5179b666ce4dc2f298fcda6ed1bf6 [file] [log] [blame]
Magnus Damm28626632011-08-18 05:44:07 +00001/*
2 * kota2 board support
3 *
4 * Copyright (C) 2011 Renesas Solutions Corp.
5 * Copyright (C) 2011 Magnus Damm
6 * Copyright (C) 2010 Takashi Yoshii <yoshii.takashi.zj@renesas.com>
7 * Copyright (C) 2009 Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com>
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; version 2 of the License.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21 */
22
23#include <linux/kernel.h>
24#include <linux/init.h>
25#include <linux/interrupt.h>
26#include <linux/irq.h>
Laurent Pinchartff11e872013-01-03 12:54:28 +010027#include <linux/pinctrl/machine.h>
Laurent Pinchartd1436d12013-03-13 03:52:31 +010028#include <linux/pinctrl/pinconf-generic.h>
Magnus Damm28626632011-08-18 05:44:07 +000029#include <linux/platform_device.h>
30#include <linux/delay.h>
31#include <linux/io.h>
Guennadi Liakhovetskif185c212012-06-27 00:32:29 +020032#include <linux/regulator/fixed.h>
33#include <linux/regulator/machine.h>
Magnus Damm28626632011-08-18 05:44:07 +000034#include <linux/smsc911x.h>
35#include <linux/gpio.h>
Magnus Dammef4f9942011-08-18 05:44:16 +000036#include <linux/input.h>
37#include <linux/input/sh_keysc.h>
Magnus Damm6b7c0ea2011-08-18 05:44:25 +000038#include <linux/gpio_keys.h>
Magnus Dammae6e7082011-08-18 05:44:33 +000039#include <linux/leds.h>
Rob Herring520f7bd2012-12-27 13:10:24 -060040#include <linux/irqchip/arm-gic.h>
Magnus Damm33661c92011-11-22 15:44:58 +090041#include <linux/platform_data/leds-renesas-tpu.h>
Magnus Damm4e927942011-08-18 05:44:42 +000042#include <linux/mmc/host.h>
43#include <linux/mmc/sh_mmcif.h>
Magnus Damm8722c992011-08-18 05:45:00 +000044#include <linux/mfd/tmio.h>
45#include <linux/mmc/sh_mobile_sdhi.h>
Magnus Damm28626632011-08-18 05:44:07 +000046#include <mach/hardware.h>
Rob Herring250a2722012-01-03 16:57:33 -060047#include <mach/irqs.h>
Magnus Damm28626632011-08-18 05:44:07 +000048#include <mach/sh73a0.h>
49#include <mach/common.h>
50#include <asm/mach-types.h>
51#include <asm/mach/arch.h>
Magnus Damm28626632011-08-18 05:44:07 +000052#include <asm/mach/time.h>
Magnus Damm28626632011-08-18 05:44:07 +000053#include <asm/hardware/cache-l2x0.h>
54#include <asm/traps.h>
55
Guennadi Liakhovetskif185c212012-06-27 00:32:29 +020056/* Dummy supplies, where voltage doesn't matter */
57static struct regulator_consumer_supply dummy_supplies[] = {
58 REGULATOR_SUPPLY("vddvario", "smsc911x"),
59 REGULATOR_SUPPLY("vdd33a", "smsc911x"),
60};
61
Kuninori Morimotoc5e7bcd2011-11-10 18:44:43 -080062/* SMSC 9220 */
Magnus Damm28626632011-08-18 05:44:07 +000063static struct resource smsc9220_resources[] = {
64 [0] = {
65 .start = 0x14000000, /* CS5A */
66 .end = 0x140000ff, /* A1->A7 */
67 .flags = IORESOURCE_MEM,
68 },
69 [1] = {
Magnus Damm1b6cec82011-11-22 15:15:57 +090070 .start = SH73A0_PINT0_IRQ(2), /* PINTA2 */
Magnus Damm28626632011-08-18 05:44:07 +000071 .flags = IORESOURCE_IRQ,
72 },
73};
74
75static struct smsc911x_platform_config smsc9220_platdata = {
76 .flags = SMSC911X_USE_32BIT, /* 32-bit SW on 16-bit HW bus */
77 .phy_interface = PHY_INTERFACE_MODE_MII,
78 .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
79 .irq_type = SMSC911X_IRQ_TYPE_PUSH_PULL,
80};
81
82static struct platform_device eth_device = {
83 .name = "smsc911x",
84 .id = 0,
85 .dev = {
86 .platform_data = &smsc9220_platdata,
87 },
88 .resource = smsc9220_resources,
89 .num_resources = ARRAY_SIZE(smsc9220_resources),
90};
91
Kuninori Morimotoc5e7bcd2011-11-10 18:44:43 -080092/* KEYSC */
Magnus Dammef4f9942011-08-18 05:44:16 +000093static struct sh_keysc_info keysc_platdata = {
94 .mode = SH_KEYSC_MODE_6,
95 .scan_timing = 3,
96 .delay = 100,
97 .keycodes = {
98 KEY_NUMERIC_STAR, KEY_NUMERIC_0, KEY_NUMERIC_POUND,
99 0, 0, 0, 0, 0,
100 KEY_NUMERIC_7, KEY_NUMERIC_8, KEY_NUMERIC_9,
101 0, KEY_DOWN, 0, 0, 0,
102 KEY_NUMERIC_4, KEY_NUMERIC_5, KEY_NUMERIC_6,
103 KEY_LEFT, KEY_ENTER, KEY_RIGHT, 0, 0,
104 KEY_NUMERIC_1, KEY_NUMERIC_2, KEY_NUMERIC_3,
105 0, KEY_UP, 0, 0, 0,
106 0, 0, 0, 0, 0, 0, 0, 0,
107 0, 0, 0, 0, 0, 0, 0, 0,
108 0, 0, 0, 0, 0, 0, 0, 0,
109 0, 0, 0, 0, 0, 0, 0, 0,
110 },
111};
112
113static struct resource keysc_resources[] = {
114 [0] = {
115 .name = "KEYSC",
116 .start = 0xe61b0000,
117 .end = 0xe61b0098 - 1,
118 .flags = IORESOURCE_MEM,
119 },
120 [1] = {
121 .start = gic_spi(71),
122 .flags = IORESOURCE_IRQ,
123 },
124};
125
126static struct platform_device keysc_device = {
127 .name = "sh_keysc",
128 .id = 0,
129 .num_resources = ARRAY_SIZE(keysc_resources),
130 .resource = keysc_resources,
131 .dev = {
132 .platform_data = &keysc_platdata,
133 },
134};
135
Kuninori Morimotoc5e7bcd2011-11-10 18:44:43 -0800136/* GPIO KEY */
Magnus Damm6b7c0ea2011-08-18 05:44:25 +0000137#define GPIO_KEY(c, g, d) { .code = c, .gpio = g, .desc = d, .active_low = 1 }
138
139static struct gpio_keys_button gpio_buttons[] = {
Guennadi Liakhovetskib58e5fa2013-02-12 16:50:02 +0100140 GPIO_KEY(KEY_VOLUMEUP, 56, "+"), /* S2: VOL+ [IRQ9] */
141 GPIO_KEY(KEY_VOLUMEDOWN, 54, "-"), /* S3: VOL- [IRQ10] */
142 GPIO_KEY(KEY_MENU, 27, "Menu"), /* S4: MENU [IRQ30] */
143 GPIO_KEY(KEY_HOMEPAGE, 26, "Home"), /* S5: HOME [IRQ31] */
144 GPIO_KEY(KEY_BACK, 11, "Back"), /* S6: BACK [IRQ0] */
145 GPIO_KEY(KEY_PHONE, 238, "Tel"), /* S7: TEL [IRQ11] */
146 GPIO_KEY(KEY_POWER, 239, "C1"), /* S8: CAM [IRQ13] */
147 GPIO_KEY(KEY_MAIL, 224, "Mail"), /* S9: MAIL [IRQ3] */
148 /* Omitted button "C3?": 223 - S10: CUST [IRQ8] */
149 GPIO_KEY(KEY_CAMERA, 164, "C2"), /* S11: CAM_HALF [IRQ25] */
150 /* Omitted button "?": 152 - S12: CAM_FULL [No IRQ] */
Magnus Damm6b7c0ea2011-08-18 05:44:25 +0000151};
152
153static struct gpio_keys_platform_data gpio_key_info = {
154 .buttons = gpio_buttons,
155 .nbuttons = ARRAY_SIZE(gpio_buttons),
Magnus Damm6b7c0ea2011-08-18 05:44:25 +0000156};
157
158static struct platform_device gpio_keys_device = {
Magnus Damm2fde1092012-01-17 20:14:07 +0900159 .name = "gpio-keys",
Magnus Damm6b7c0ea2011-08-18 05:44:25 +0000160 .id = -1,
161 .dev = {
162 .platform_data = &gpio_key_info,
163 },
164};
165
Kuninori Morimotoc5e7bcd2011-11-10 18:44:43 -0800166/* GPIO LED */
Magnus Dammae6e7082011-08-18 05:44:33 +0000167#define GPIO_LED(n, g) { .name = n, .gpio = g }
168
169static struct gpio_led gpio_leds[] = {
Guennadi Liakhovetskib58e5fa2013-02-12 16:50:02 +0100170 GPIO_LED("G", 20), /* PORT20 [GPO0] -> LED7 -> "G" */
171 GPIO_LED("H", 21), /* PORT21 [GPO1] -> LED8 -> "H" */
172 GPIO_LED("J", 22), /* PORT22 [GPO2] -> LED9 -> "J" */
Magnus Dammae6e7082011-08-18 05:44:33 +0000173};
174
175static struct gpio_led_platform_data gpio_leds_info = {
176 .leds = gpio_leds,
177 .num_leds = ARRAY_SIZE(gpio_leds),
178};
179
180static struct platform_device gpio_leds_device = {
181 .name = "leds-gpio",
182 .id = -1,
183 .dev = {
184 .platform_data = &gpio_leds_info,
185 },
186};
187
Magnus Damm33661c92011-11-22 15:44:58 +0900188/* TPU LED */
189static struct led_renesas_tpu_config led_renesas_tpu12_pdata = {
190 .name = "V2513",
191 .pin_gpio_fn = GPIO_FN_TPU1TO2,
Guennadi Liakhovetskib58e5fa2013-02-12 16:50:02 +0100192 .pin_gpio = 153,
Magnus Damm33661c92011-11-22 15:44:58 +0900193 .channel_offset = 0x90,
194 .timer_bit = 2,
195 .max_brightness = 1000,
196};
197
198static struct resource tpu12_resources[] = {
199 [0] = {
200 .name = "TPU12",
201 .start = 0xe6610090,
202 .end = 0xe66100b5,
203 .flags = IORESOURCE_MEM,
204 },
205};
206
207static struct platform_device leds_tpu12_device = {
208 .name = "leds-renesas-tpu",
209 .id = 12,
210 .dev = {
211 .platform_data = &led_renesas_tpu12_pdata,
212 },
213 .num_resources = ARRAY_SIZE(tpu12_resources),
214 .resource = tpu12_resources,
215};
216
217static struct led_renesas_tpu_config led_renesas_tpu41_pdata = {
218 .name = "V2514",
219 .pin_gpio_fn = GPIO_FN_TPU4TO1,
Guennadi Liakhovetskib58e5fa2013-02-12 16:50:02 +0100220 .pin_gpio = 199,
Magnus Damm33661c92011-11-22 15:44:58 +0900221 .channel_offset = 0x50,
222 .timer_bit = 1,
223 .max_brightness = 1000,
224};
225
226static struct resource tpu41_resources[] = {
227 [0] = {
228 .name = "TPU41",
229 .start = 0xe6640050,
230 .end = 0xe6640075,
231 .flags = IORESOURCE_MEM,
232 },
233};
234
235static struct platform_device leds_tpu41_device = {
236 .name = "leds-renesas-tpu",
237 .id = 41,
238 .dev = {
239 .platform_data = &led_renesas_tpu41_pdata,
240 },
241 .num_resources = ARRAY_SIZE(tpu41_resources),
242 .resource = tpu41_resources,
243};
244
245static struct led_renesas_tpu_config led_renesas_tpu21_pdata = {
246 .name = "V2515",
247 .pin_gpio_fn = GPIO_FN_TPU2TO1,
Guennadi Liakhovetskib58e5fa2013-02-12 16:50:02 +0100248 .pin_gpio = 197,
Magnus Damm33661c92011-11-22 15:44:58 +0900249 .channel_offset = 0x50,
250 .timer_bit = 1,
251 .max_brightness = 1000,
252};
253
254static struct resource tpu21_resources[] = {
255 [0] = {
256 .name = "TPU21",
257 .start = 0xe6620050,
258 .end = 0xe6620075,
259 .flags = IORESOURCE_MEM,
260 },
261};
262
263static struct platform_device leds_tpu21_device = {
264 .name = "leds-renesas-tpu",
265 .id = 21,
266 .dev = {
267 .platform_data = &led_renesas_tpu21_pdata,
268 },
269 .num_resources = ARRAY_SIZE(tpu21_resources),
270 .resource = tpu21_resources,
271};
272
273static struct led_renesas_tpu_config led_renesas_tpu30_pdata = {
274 .name = "KEYLED",
275 .pin_gpio_fn = GPIO_FN_TPU3TO0,
Guennadi Liakhovetskib58e5fa2013-02-12 16:50:02 +0100276 .pin_gpio = 163,
Magnus Damm33661c92011-11-22 15:44:58 +0900277 .channel_offset = 0x10,
278 .timer_bit = 0,
279 .max_brightness = 1000,
280};
281
282static struct resource tpu30_resources[] = {
283 [0] = {
284 .name = "TPU30",
285 .start = 0xe6630010,
286 .end = 0xe6630035,
287 .flags = IORESOURCE_MEM,
288 },
289};
290
291static struct platform_device leds_tpu30_device = {
292 .name = "leds-renesas-tpu",
293 .id = 30,
294 .dev = {
295 .platform_data = &led_renesas_tpu30_pdata,
296 },
297 .num_resources = ARRAY_SIZE(tpu30_resources),
298 .resource = tpu30_resources,
299};
300
Guennadi Liakhovetskif185c212012-06-27 00:32:29 +0200301/* Fixed 1.8V regulator to be used by MMCIF */
302static struct regulator_consumer_supply fixed1v8_power_consumers[] =
303{
304 REGULATOR_SUPPLY("vmmc", "sh_mmcif.0"),
305 REGULATOR_SUPPLY("vqmmc", "sh_mmcif.0"),
306};
307
Kuninori Morimotoc5e7bcd2011-11-10 18:44:43 -0800308/* MMCIF */
Magnus Damm4e927942011-08-18 05:44:42 +0000309static struct resource mmcif_resources[] = {
310 [0] = {
311 .name = "MMCIF",
312 .start = 0xe6bd0000,
313 .end = 0xe6bd00ff,
314 .flags = IORESOURCE_MEM,
315 },
316 [1] = {
317 .start = gic_spi(140),
318 .flags = IORESOURCE_IRQ,
319 },
320 [2] = {
321 .start = gic_spi(141),
322 .flags = IORESOURCE_IRQ,
323 },
324};
325
326static struct sh_mmcif_plat_data mmcif_info = {
327 .ocr = MMC_VDD_165_195,
328 .caps = MMC_CAP_8_BIT_DATA | MMC_CAP_NONREMOVABLE,
329};
330
331static struct platform_device mmcif_device = {
332 .name = "sh_mmcif",
333 .id = 0,
334 .dev = {
335 .platform_data = &mmcif_info,
336 },
337 .num_resources = ARRAY_SIZE(mmcif_resources),
338 .resource = mmcif_resources,
339};
340
Guennadi Liakhovetskif185c212012-06-27 00:32:29 +0200341/* Fixed 3.3V regulator to be used by SDHI0 and SDHI1 */
342static struct regulator_consumer_supply fixed3v3_power_consumers[] =
343{
344 REGULATOR_SUPPLY("vmmc", "sh_mobile_sdhi.0"),
345 REGULATOR_SUPPLY("vqmmc", "sh_mobile_sdhi.0"),
346 REGULATOR_SUPPLY("vmmc", "sh_mobile_sdhi.1"),
347 REGULATOR_SUPPLY("vqmmc", "sh_mobile_sdhi.1"),
348};
349
Kuninori Morimotoc5e7bcd2011-11-10 18:44:43 -0800350/* SDHI0 */
Magnus Damm8722c992011-08-18 05:45:00 +0000351static struct sh_mobile_sdhi_info sdhi0_info = {
352 .tmio_caps = MMC_CAP_SD_HIGHSPEED,
353 .tmio_flags = TMIO_MMC_WRPROTECT_DISABLE | TMIO_MMC_HAS_IDLE_WAIT,
354};
355
356static struct resource sdhi0_resources[] = {
357 [0] = {
358 .name = "SDHI0",
359 .start = 0xee100000,
360 .end = 0xee1000ff,
361 .flags = IORESOURCE_MEM,
362 },
363 [1] = {
364 .start = gic_spi(83),
365 .flags = IORESOURCE_IRQ,
366 },
367 [2] = {
368 .start = gic_spi(84),
369 .flags = IORESOURCE_IRQ,
370 },
371 [3] = {
372 .start = gic_spi(85),
373 .flags = IORESOURCE_IRQ,
374 },
375};
376
377static struct platform_device sdhi0_device = {
378 .name = "sh_mobile_sdhi",
379 .id = 0,
380 .num_resources = ARRAY_SIZE(sdhi0_resources),
381 .resource = sdhi0_resources,
382 .dev = {
383 .platform_data = &sdhi0_info,
384 },
385};
386
Kuninori Morimotoc5e7bcd2011-11-10 18:44:43 -0800387/* SDHI1 */
Magnus Damm8722c992011-08-18 05:45:00 +0000388static struct sh_mobile_sdhi_info sdhi1_info = {
389 .tmio_caps = MMC_CAP_NONREMOVABLE | MMC_CAP_SDIO_IRQ,
390 .tmio_flags = TMIO_MMC_WRPROTECT_DISABLE | TMIO_MMC_HAS_IDLE_WAIT,
391};
392
393static struct resource sdhi1_resources[] = {
394 [0] = {
395 .name = "SDHI1",
396 .start = 0xee120000,
397 .end = 0xee1200ff,
398 .flags = IORESOURCE_MEM,
399 },
400 [1] = {
401 .start = gic_spi(87),
402 .flags = IORESOURCE_IRQ,
403 },
404 [2] = {
405 .start = gic_spi(88),
406 .flags = IORESOURCE_IRQ,
407 },
408 [3] = {
409 .start = gic_spi(89),
410 .flags = IORESOURCE_IRQ,
411 },
412};
413
414static struct platform_device sdhi1_device = {
415 .name = "sh_mobile_sdhi",
416 .id = 1,
417 .num_resources = ARRAY_SIZE(sdhi1_resources),
418 .resource = sdhi1_resources,
419 .dev = {
420 .platform_data = &sdhi1_info,
421 },
422};
423
Magnus Damm28626632011-08-18 05:44:07 +0000424static struct platform_device *kota2_devices[] __initdata = {
425 &eth_device,
Magnus Dammef4f9942011-08-18 05:44:16 +0000426 &keysc_device,
Magnus Damm6b7c0ea2011-08-18 05:44:25 +0000427 &gpio_keys_device,
Magnus Dammae6e7082011-08-18 05:44:33 +0000428 &gpio_leds_device,
Magnus Damm33661c92011-11-22 15:44:58 +0900429 &leds_tpu12_device,
430 &leds_tpu41_device,
431 &leds_tpu21_device,
432 &leds_tpu30_device,
Magnus Damm4e927942011-08-18 05:44:42 +0000433 &mmcif_device,
Magnus Damm8722c992011-08-18 05:45:00 +0000434 &sdhi0_device,
435 &sdhi1_device,
Magnus Damm28626632011-08-18 05:44:07 +0000436};
437
Laurent Pinchartd1436d12013-03-13 03:52:31 +0100438static unsigned long pin_pullup_conf[] = {
439 PIN_CONF_PACKED(PIN_CONFIG_BIAS_PULL_UP, 0),
440};
441
Laurent Pinchartff11e872013-01-03 12:54:28 +0100442static const struct pinctrl_map kota2_pinctrl_map[] = {
Laurent Pinchart67ee2fd2013-03-13 03:52:31 +0100443 /* KEYSC */
444 PIN_MAP_MUX_GROUP_DEFAULT("sh_keysc.0", "pfc-sh73a0",
445 "keysc_in8", "keysc"),
446 PIN_MAP_MUX_GROUP_DEFAULT("sh_keysc.0", "pfc-sh73a0",
447 "keysc_out04", "keysc"),
448 PIN_MAP_MUX_GROUP_DEFAULT("sh_keysc.0", "pfc-sh73a0",
449 "keysc_out5", "keysc"),
450 PIN_MAP_MUX_GROUP_DEFAULT("sh_keysc.0", "pfc-sh73a0",
451 "keysc_out6_0", "keysc"),
452 PIN_MAP_MUX_GROUP_DEFAULT("sh_keysc.0", "pfc-sh73a0",
453 "keysc_out7_0", "keysc"),
454 PIN_MAP_MUX_GROUP_DEFAULT("sh_keysc.0", "pfc-sh73a0",
455 "keysc_out8_0", "keysc"),
456 PIN_MAP_CONFIGS_GROUP_DEFAULT("sh_keysc.0", "pfc-sh73a0",
457 "keysc_in8", pin_pullup_conf),
Laurent Pinchartd1436d12013-03-13 03:52:31 +0100458 /* MMCIF */
459 PIN_MAP_MUX_GROUP_DEFAULT("sh_mmcif.0", "pfc-sh73a0",
460 "mmc0_data8_0", "mmc0"),
461 PIN_MAP_MUX_GROUP_DEFAULT("sh_mmcif.0", "pfc-sh73a0",
462 "mmc0_ctrl_0", "mmc0"),
463 PIN_MAP_CONFIGS_PIN_DEFAULT("sh_mmcif.0", "pfc-sh73a0",
464 "PORT279", pin_pullup_conf),
465 PIN_MAP_CONFIGS_GROUP_DEFAULT("sh_mmcif.0", "pfc-sh73a0",
466 "mmc0_data8_0", pin_pullup_conf),
Laurent Pinchartff11e872013-01-03 12:54:28 +0100467 /* SCIFA2 (UART2) */
468 PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.2", "pfc-sh73a0",
469 "scifa2_data_0", "scifa2"),
470 PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.2", "pfc-sh73a0",
471 "scifa2_ctrl_0", "scifa2"),
472 /* SCIFA4 (UART1) */
473 PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.4", "pfc-sh73a0",
474 "scifa4_data", "scifa4"),
475 PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.4", "pfc-sh73a0",
476 "scifa4_ctrl", "scifa4"),
477 /* SCIFB (BT) */
478 PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.8", "pfc-sh73a0",
479 "scifb_data_0", "scifb"),
480 PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.8", "pfc-sh73a0",
481 "scifb_clk_0", "scifb"),
482 PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.8", "pfc-sh73a0",
483 "scifb_ctrl_0", "scifb"),
Laurent Pinchartd1436d12013-03-13 03:52:31 +0100484 /* SDHI0 (microSD) */
485 PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-sh73a0",
486 "sdhi0_data4", "sdhi0"),
487 PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-sh73a0",
488 "sdhi0_ctrl", "sdhi0"),
489 PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-sh73a0",
490 "sdhi0_cd", "sdhi0"),
491 PIN_MAP_CONFIGS_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-sh73a0",
492 "sdhi0_data4", pin_pullup_conf),
493 PIN_MAP_CONFIGS_PIN_DEFAULT("sh_mobile_sdhi.0", "pfc-sh73a0",
494 "PORT256", pin_pullup_conf),
495 PIN_MAP_CONFIGS_PIN_DEFAULT("sh_mobile_sdhi.0", "pfc-sh73a0",
496 "PORT251", pin_pullup_conf),
497 /* SDHI1 (BCM4330) */
498 PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.1", "pfc-sh73a0",
499 "sdhi1_data4", "sdhi1"),
500 PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.1", "pfc-sh73a0",
501 "sdhi1_ctrl", "sdhi1"),
502 PIN_MAP_CONFIGS_GROUP_DEFAULT("sh_mobile_sdhi.1", "pfc-sh73a0",
503 "sdhi1_data4", pin_pullup_conf),
504 PIN_MAP_CONFIGS_PIN_DEFAULT("sh_mobile_sdhi.1", "pfc-sh73a0",
505 "PORT263", pin_pullup_conf),
Laurent Pinchartb5ee0e12013-03-13 03:52:31 +0100506 /* SMSC911X */
507 PIN_MAP_MUX_GROUP_DEFAULT("smsc911x.0", "pfc-sh73a0",
508 "bsc_data_0_7", "bsc"),
509 PIN_MAP_MUX_GROUP_DEFAULT("smsc911x.0", "pfc-sh73a0",
510 "bsc_data_8_15", "bsc"),
511 PIN_MAP_MUX_GROUP_DEFAULT("smsc911x.0", "pfc-sh73a0",
512 "bsc_cs5_a", "bsc"),
513 PIN_MAP_MUX_GROUP_DEFAULT("smsc911x.0", "pfc-sh73a0",
514 "bsc_we0", "bsc"),
Laurent Pinchartff11e872013-01-03 12:54:28 +0100515};
516
Magnus Damm28626632011-08-18 05:44:07 +0000517static void __init kota2_init(void)
518{
Guennadi Liakhovetskif185c212012-06-27 00:32:29 +0200519 regulator_register_always_on(0, "fixed-1.8V", fixed1v8_power_consumers,
520 ARRAY_SIZE(fixed1v8_power_consumers), 1800000);
521 regulator_register_always_on(1, "fixed-3.3V", fixed3v3_power_consumers,
522 ARRAY_SIZE(fixed3v3_power_consumers), 3300000);
523 regulator_register_fixed(2, dummy_supplies, ARRAY_SIZE(dummy_supplies));
524
Laurent Pinchartff11e872013-01-03 12:54:28 +0100525 pinctrl_register_mappings(kota2_pinctrl_map,
526 ARRAY_SIZE(kota2_pinctrl_map));
Magnus Damm28626632011-08-18 05:44:07 +0000527 sh73a0_pinmux_init();
528
Magnus Damm28626632011-08-18 05:44:07 +0000529 /* SMSC911X */
Guennadi Liakhovetskib58e5fa2013-02-12 16:50:02 +0100530 gpio_request_one(144, GPIOF_IN, NULL); /* PINTA2 */
531 gpio_request_one(145, GPIOF_OUT_INIT_HIGH, NULL); /* RESET */
Magnus Damm28626632011-08-18 05:44:07 +0000532
Magnus Damm4e927942011-08-18 05:44:42 +0000533 /* MMCIF */
Guennadi Liakhovetskib58e5fa2013-02-12 16:50:02 +0100534 gpio_request_one(208, GPIOF_OUT_INIT_HIGH, NULL); /* Reset */
Magnus Damm4e927942011-08-18 05:44:42 +0000535
Magnus Damm28626632011-08-18 05:44:07 +0000536#ifdef CONFIG_CACHE_L2X0
537 /* Early BRESP enable, Shared attribute override enable, 64K*8way */
Rob Herringa2a47ca2012-03-09 17:16:40 -0600538 l2x0_init(IOMEM(0xf0100000), 0x40460000, 0x82000fff);
Magnus Damm28626632011-08-18 05:44:07 +0000539#endif
540 sh73a0_add_standard_devices();
541 platform_add_devices(kota2_devices, ARRAY_SIZE(kota2_devices));
542}
543
Magnus Damm28626632011-08-18 05:44:07 +0000544MACHINE_START(KOTA2, "kota2")
Marc Zyngiera62580e2011-09-08 13:15:22 +0100545 .smp = smp_ops(sh73a0_smp_ops),
Magnus Damm50e15c32012-02-29 21:37:27 +0900546 .map_io = sh73a0_map_io,
547 .init_early = sh73a0_add_early_devices,
Magnus Dammdcb4ea82011-11-22 15:29:54 +0900548 .nr_irqs = NR_IRQS_LEGACY,
Magnus Damm1b6cec82011-11-22 15:15:57 +0900549 .init_irq = sh73a0_init_irq,
Magnus Damm28626632011-08-18 05:44:07 +0000550 .init_machine = kota2_init,
Shawn Guo21cc1b72012-04-26 21:58:41 +0800551 .init_late = shmobile_init_late,
Stephen Warren6bb27d72012-11-08 12:40:59 -0700552 .init_time = sh73a0_earlytimer_init,
Magnus Damm28626632011-08-18 05:44:07 +0000553MACHINE_END