blob: bf88f9a8b7ac78ce381add800731e6d5ee7aef37 [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>
27#include <linux/platform_device.h>
28#include <linux/delay.h>
29#include <linux/io.h>
Guennadi Liakhovetskif185c212012-06-27 00:32:29 +020030#include <linux/regulator/fixed.h>
31#include <linux/regulator/machine.h>
Magnus Damm28626632011-08-18 05:44:07 +000032#include <linux/smsc911x.h>
33#include <linux/gpio.h>
Magnus Dammef4f9942011-08-18 05:44:16 +000034#include <linux/input.h>
35#include <linux/input/sh_keysc.h>
Magnus Damm6b7c0ea2011-08-18 05:44:25 +000036#include <linux/gpio_keys.h>
Magnus Dammae6e7082011-08-18 05:44:33 +000037#include <linux/leds.h>
Magnus Damm33661c92011-11-22 15:44:58 +090038#include <linux/platform_data/leds-renesas-tpu.h>
Magnus Damm4e927942011-08-18 05:44:42 +000039#include <linux/mmc/host.h>
40#include <linux/mmc/sh_mmcif.h>
Magnus Damm8722c992011-08-18 05:45:00 +000041#include <linux/mfd/tmio.h>
42#include <linux/mmc/sh_mobile_sdhi.h>
Magnus Damm28626632011-08-18 05:44:07 +000043#include <mach/hardware.h>
Rob Herring250a2722012-01-03 16:57:33 -060044#include <mach/irqs.h>
Magnus Damm28626632011-08-18 05:44:07 +000045#include <mach/sh73a0.h>
46#include <mach/common.h>
47#include <asm/mach-types.h>
48#include <asm/mach/arch.h>
Magnus Damm28626632011-08-18 05:44:07 +000049#include <asm/mach/time.h>
50#include <asm/hardware/gic.h>
51#include <asm/hardware/cache-l2x0.h>
52#include <asm/traps.h>
53
Guennadi Liakhovetskif185c212012-06-27 00:32:29 +020054/* Dummy supplies, where voltage doesn't matter */
55static struct regulator_consumer_supply dummy_supplies[] = {
56 REGULATOR_SUPPLY("vddvario", "smsc911x"),
57 REGULATOR_SUPPLY("vdd33a", "smsc911x"),
58};
59
Kuninori Morimotoc5e7bcd2011-11-10 18:44:43 -080060/* SMSC 9220 */
Magnus Damm28626632011-08-18 05:44:07 +000061static struct resource smsc9220_resources[] = {
62 [0] = {
63 .start = 0x14000000, /* CS5A */
64 .end = 0x140000ff, /* A1->A7 */
65 .flags = IORESOURCE_MEM,
66 },
67 [1] = {
Magnus Damm1b6cec82011-11-22 15:15:57 +090068 .start = SH73A0_PINT0_IRQ(2), /* PINTA2 */
Magnus Damm28626632011-08-18 05:44:07 +000069 .flags = IORESOURCE_IRQ,
70 },
71};
72
73static struct smsc911x_platform_config smsc9220_platdata = {
74 .flags = SMSC911X_USE_32BIT, /* 32-bit SW on 16-bit HW bus */
75 .phy_interface = PHY_INTERFACE_MODE_MII,
76 .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
77 .irq_type = SMSC911X_IRQ_TYPE_PUSH_PULL,
78};
79
80static struct platform_device eth_device = {
81 .name = "smsc911x",
82 .id = 0,
83 .dev = {
84 .platform_data = &smsc9220_platdata,
85 },
86 .resource = smsc9220_resources,
87 .num_resources = ARRAY_SIZE(smsc9220_resources),
88};
89
Kuninori Morimotoc5e7bcd2011-11-10 18:44:43 -080090/* KEYSC */
Magnus Dammef4f9942011-08-18 05:44:16 +000091static struct sh_keysc_info keysc_platdata = {
92 .mode = SH_KEYSC_MODE_6,
93 .scan_timing = 3,
94 .delay = 100,
95 .keycodes = {
96 KEY_NUMERIC_STAR, KEY_NUMERIC_0, KEY_NUMERIC_POUND,
97 0, 0, 0, 0, 0,
98 KEY_NUMERIC_7, KEY_NUMERIC_8, KEY_NUMERIC_9,
99 0, KEY_DOWN, 0, 0, 0,
100 KEY_NUMERIC_4, KEY_NUMERIC_5, KEY_NUMERIC_6,
101 KEY_LEFT, KEY_ENTER, KEY_RIGHT, 0, 0,
102 KEY_NUMERIC_1, KEY_NUMERIC_2, KEY_NUMERIC_3,
103 0, KEY_UP, 0, 0, 0,
104 0, 0, 0, 0, 0, 0, 0, 0,
105 0, 0, 0, 0, 0, 0, 0, 0,
106 0, 0, 0, 0, 0, 0, 0, 0,
107 0, 0, 0, 0, 0, 0, 0, 0,
108 },
109};
110
111static struct resource keysc_resources[] = {
112 [0] = {
113 .name = "KEYSC",
114 .start = 0xe61b0000,
115 .end = 0xe61b0098 - 1,
116 .flags = IORESOURCE_MEM,
117 },
118 [1] = {
119 .start = gic_spi(71),
120 .flags = IORESOURCE_IRQ,
121 },
122};
123
124static struct platform_device keysc_device = {
125 .name = "sh_keysc",
126 .id = 0,
127 .num_resources = ARRAY_SIZE(keysc_resources),
128 .resource = keysc_resources,
129 .dev = {
130 .platform_data = &keysc_platdata,
131 },
132};
133
Kuninori Morimotoc5e7bcd2011-11-10 18:44:43 -0800134/* GPIO KEY */
Magnus Damm6b7c0ea2011-08-18 05:44:25 +0000135#define GPIO_KEY(c, g, d) { .code = c, .gpio = g, .desc = d, .active_low = 1 }
136
137static struct gpio_keys_button gpio_buttons[] = {
138 GPIO_KEY(KEY_VOLUMEUP, GPIO_PORT56, "+"), /* S2: VOL+ [IRQ9] */
139 GPIO_KEY(KEY_VOLUMEDOWN, GPIO_PORT54, "-"), /* S3: VOL- [IRQ10] */
140 GPIO_KEY(KEY_MENU, GPIO_PORT27, "Menu"), /* S4: MENU [IRQ30] */
141 GPIO_KEY(KEY_HOMEPAGE, GPIO_PORT26, "Home"), /* S5: HOME [IRQ31] */
142 GPIO_KEY(KEY_BACK, GPIO_PORT11, "Back"), /* S6: BACK [IRQ0] */
143 GPIO_KEY(KEY_PHONE, GPIO_PORT238, "Tel"), /* S7: TEL [IRQ11] */
144 GPIO_KEY(KEY_POWER, GPIO_PORT239, "C1"), /* S8: CAM [IRQ13] */
145 GPIO_KEY(KEY_MAIL, GPIO_PORT224, "Mail"), /* S9: MAIL [IRQ3] */
146 /* Omitted button "C3?": GPIO_PORT223 - S10: CUST [IRQ8] */
147 GPIO_KEY(KEY_CAMERA, GPIO_PORT164, "C2"), /* S11: CAM_HALF [IRQ25] */
148 /* Omitted button "?": GPIO_PORT152 - S12: CAM_FULL [No IRQ] */
149};
150
151static struct gpio_keys_platform_data gpio_key_info = {
152 .buttons = gpio_buttons,
153 .nbuttons = ARRAY_SIZE(gpio_buttons),
Magnus Damm6b7c0ea2011-08-18 05:44:25 +0000154};
155
156static struct platform_device gpio_keys_device = {
Magnus Damm2fde1092012-01-17 20:14:07 +0900157 .name = "gpio-keys",
Magnus Damm6b7c0ea2011-08-18 05:44:25 +0000158 .id = -1,
159 .dev = {
160 .platform_data = &gpio_key_info,
161 },
162};
163
Kuninori Morimotoc5e7bcd2011-11-10 18:44:43 -0800164/* GPIO LED */
Magnus Dammae6e7082011-08-18 05:44:33 +0000165#define GPIO_LED(n, g) { .name = n, .gpio = g }
166
167static struct gpio_led gpio_leds[] = {
Magnus Dammae6e7082011-08-18 05:44:33 +0000168 GPIO_LED("G", GPIO_PORT20), /* PORT20 [GPO0] -> LED7 -> "G" */
169 GPIO_LED("H", GPIO_PORT21), /* PORT21 [GPO1] -> LED8 -> "H" */
170 GPIO_LED("J", GPIO_PORT22), /* PORT22 [GPO2] -> LED9 -> "J" */
171};
172
173static struct gpio_led_platform_data gpio_leds_info = {
174 .leds = gpio_leds,
175 .num_leds = ARRAY_SIZE(gpio_leds),
176};
177
178static struct platform_device gpio_leds_device = {
179 .name = "leds-gpio",
180 .id = -1,
181 .dev = {
182 .platform_data = &gpio_leds_info,
183 },
184};
185
Magnus Damm33661c92011-11-22 15:44:58 +0900186/* TPU LED */
187static struct led_renesas_tpu_config led_renesas_tpu12_pdata = {
188 .name = "V2513",
189 .pin_gpio_fn = GPIO_FN_TPU1TO2,
190 .pin_gpio = GPIO_PORT153,
191 .channel_offset = 0x90,
192 .timer_bit = 2,
193 .max_brightness = 1000,
194};
195
196static struct resource tpu12_resources[] = {
197 [0] = {
198 .name = "TPU12",
199 .start = 0xe6610090,
200 .end = 0xe66100b5,
201 .flags = IORESOURCE_MEM,
202 },
203};
204
205static struct platform_device leds_tpu12_device = {
206 .name = "leds-renesas-tpu",
207 .id = 12,
208 .dev = {
209 .platform_data = &led_renesas_tpu12_pdata,
210 },
211 .num_resources = ARRAY_SIZE(tpu12_resources),
212 .resource = tpu12_resources,
213};
214
215static struct led_renesas_tpu_config led_renesas_tpu41_pdata = {
216 .name = "V2514",
217 .pin_gpio_fn = GPIO_FN_TPU4TO1,
218 .pin_gpio = GPIO_PORT199,
219 .channel_offset = 0x50,
220 .timer_bit = 1,
221 .max_brightness = 1000,
222};
223
224static struct resource tpu41_resources[] = {
225 [0] = {
226 .name = "TPU41",
227 .start = 0xe6640050,
228 .end = 0xe6640075,
229 .flags = IORESOURCE_MEM,
230 },
231};
232
233static struct platform_device leds_tpu41_device = {
234 .name = "leds-renesas-tpu",
235 .id = 41,
236 .dev = {
237 .platform_data = &led_renesas_tpu41_pdata,
238 },
239 .num_resources = ARRAY_SIZE(tpu41_resources),
240 .resource = tpu41_resources,
241};
242
243static struct led_renesas_tpu_config led_renesas_tpu21_pdata = {
244 .name = "V2515",
245 .pin_gpio_fn = GPIO_FN_TPU2TO1,
246 .pin_gpio = GPIO_PORT197,
247 .channel_offset = 0x50,
248 .timer_bit = 1,
249 .max_brightness = 1000,
250};
251
252static struct resource tpu21_resources[] = {
253 [0] = {
254 .name = "TPU21",
255 .start = 0xe6620050,
256 .end = 0xe6620075,
257 .flags = IORESOURCE_MEM,
258 },
259};
260
261static struct platform_device leds_tpu21_device = {
262 .name = "leds-renesas-tpu",
263 .id = 21,
264 .dev = {
265 .platform_data = &led_renesas_tpu21_pdata,
266 },
267 .num_resources = ARRAY_SIZE(tpu21_resources),
268 .resource = tpu21_resources,
269};
270
271static struct led_renesas_tpu_config led_renesas_tpu30_pdata = {
272 .name = "KEYLED",
273 .pin_gpio_fn = GPIO_FN_TPU3TO0,
274 .pin_gpio = GPIO_PORT163,
275 .channel_offset = 0x10,
276 .timer_bit = 0,
277 .max_brightness = 1000,
278};
279
280static struct resource tpu30_resources[] = {
281 [0] = {
282 .name = "TPU30",
283 .start = 0xe6630010,
284 .end = 0xe6630035,
285 .flags = IORESOURCE_MEM,
286 },
287};
288
289static struct platform_device leds_tpu30_device = {
290 .name = "leds-renesas-tpu",
291 .id = 30,
292 .dev = {
293 .platform_data = &led_renesas_tpu30_pdata,
294 },
295 .num_resources = ARRAY_SIZE(tpu30_resources),
296 .resource = tpu30_resources,
297};
298
Guennadi Liakhovetskif185c212012-06-27 00:32:29 +0200299/* Fixed 1.8V regulator to be used by MMCIF */
300static struct regulator_consumer_supply fixed1v8_power_consumers[] =
301{
302 REGULATOR_SUPPLY("vmmc", "sh_mmcif.0"),
303 REGULATOR_SUPPLY("vqmmc", "sh_mmcif.0"),
304};
305
Kuninori Morimotoc5e7bcd2011-11-10 18:44:43 -0800306/* MMCIF */
Magnus Damm4e927942011-08-18 05:44:42 +0000307static struct resource mmcif_resources[] = {
308 [0] = {
309 .name = "MMCIF",
310 .start = 0xe6bd0000,
311 .end = 0xe6bd00ff,
312 .flags = IORESOURCE_MEM,
313 },
314 [1] = {
315 .start = gic_spi(140),
316 .flags = IORESOURCE_IRQ,
317 },
318 [2] = {
319 .start = gic_spi(141),
320 .flags = IORESOURCE_IRQ,
321 },
322};
323
324static struct sh_mmcif_plat_data mmcif_info = {
325 .ocr = MMC_VDD_165_195,
326 .caps = MMC_CAP_8_BIT_DATA | MMC_CAP_NONREMOVABLE,
327};
328
329static struct platform_device mmcif_device = {
330 .name = "sh_mmcif",
331 .id = 0,
332 .dev = {
333 .platform_data = &mmcif_info,
334 },
335 .num_resources = ARRAY_SIZE(mmcif_resources),
336 .resource = mmcif_resources,
337};
338
Guennadi Liakhovetskif185c212012-06-27 00:32:29 +0200339/* Fixed 3.3V regulator to be used by SDHI0 and SDHI1 */
340static struct regulator_consumer_supply fixed3v3_power_consumers[] =
341{
342 REGULATOR_SUPPLY("vmmc", "sh_mobile_sdhi.0"),
343 REGULATOR_SUPPLY("vqmmc", "sh_mobile_sdhi.0"),
344 REGULATOR_SUPPLY("vmmc", "sh_mobile_sdhi.1"),
345 REGULATOR_SUPPLY("vqmmc", "sh_mobile_sdhi.1"),
346};
347
Kuninori Morimotoc5e7bcd2011-11-10 18:44:43 -0800348/* SDHI0 */
Magnus Damm8722c992011-08-18 05:45:00 +0000349static struct sh_mobile_sdhi_info sdhi0_info = {
350 .tmio_caps = MMC_CAP_SD_HIGHSPEED,
351 .tmio_flags = TMIO_MMC_WRPROTECT_DISABLE | TMIO_MMC_HAS_IDLE_WAIT,
352};
353
354static struct resource sdhi0_resources[] = {
355 [0] = {
356 .name = "SDHI0",
357 .start = 0xee100000,
358 .end = 0xee1000ff,
359 .flags = IORESOURCE_MEM,
360 },
361 [1] = {
362 .start = gic_spi(83),
363 .flags = IORESOURCE_IRQ,
364 },
365 [2] = {
366 .start = gic_spi(84),
367 .flags = IORESOURCE_IRQ,
368 },
369 [3] = {
370 .start = gic_spi(85),
371 .flags = IORESOURCE_IRQ,
372 },
373};
374
375static struct platform_device sdhi0_device = {
376 .name = "sh_mobile_sdhi",
377 .id = 0,
378 .num_resources = ARRAY_SIZE(sdhi0_resources),
379 .resource = sdhi0_resources,
380 .dev = {
381 .platform_data = &sdhi0_info,
382 },
383};
384
Kuninori Morimotoc5e7bcd2011-11-10 18:44:43 -0800385/* SDHI1 */
Magnus Damm8722c992011-08-18 05:45:00 +0000386static struct sh_mobile_sdhi_info sdhi1_info = {
387 .tmio_caps = MMC_CAP_NONREMOVABLE | MMC_CAP_SDIO_IRQ,
388 .tmio_flags = TMIO_MMC_WRPROTECT_DISABLE | TMIO_MMC_HAS_IDLE_WAIT,
389};
390
391static struct resource sdhi1_resources[] = {
392 [0] = {
393 .name = "SDHI1",
394 .start = 0xee120000,
395 .end = 0xee1200ff,
396 .flags = IORESOURCE_MEM,
397 },
398 [1] = {
399 .start = gic_spi(87),
400 .flags = IORESOURCE_IRQ,
401 },
402 [2] = {
403 .start = gic_spi(88),
404 .flags = IORESOURCE_IRQ,
405 },
406 [3] = {
407 .start = gic_spi(89),
408 .flags = IORESOURCE_IRQ,
409 },
410};
411
412static struct platform_device sdhi1_device = {
413 .name = "sh_mobile_sdhi",
414 .id = 1,
415 .num_resources = ARRAY_SIZE(sdhi1_resources),
416 .resource = sdhi1_resources,
417 .dev = {
418 .platform_data = &sdhi1_info,
419 },
420};
421
Magnus Damm28626632011-08-18 05:44:07 +0000422static struct platform_device *kota2_devices[] __initdata = {
423 &eth_device,
Magnus Dammef4f9942011-08-18 05:44:16 +0000424 &keysc_device,
Magnus Damm6b7c0ea2011-08-18 05:44:25 +0000425 &gpio_keys_device,
Magnus Dammae6e7082011-08-18 05:44:33 +0000426 &gpio_leds_device,
Magnus Damm33661c92011-11-22 15:44:58 +0900427 &leds_tpu12_device,
428 &leds_tpu41_device,
429 &leds_tpu21_device,
430 &leds_tpu30_device,
Magnus Damm4e927942011-08-18 05:44:42 +0000431 &mmcif_device,
Magnus Damm8722c992011-08-18 05:45:00 +0000432 &sdhi0_device,
433 &sdhi1_device,
Magnus Damm28626632011-08-18 05:44:07 +0000434};
435
Magnus Damm28626632011-08-18 05:44:07 +0000436static void __init kota2_init(void)
437{
Guennadi Liakhovetskif185c212012-06-27 00:32:29 +0200438 regulator_register_always_on(0, "fixed-1.8V", fixed1v8_power_consumers,
439 ARRAY_SIZE(fixed1v8_power_consumers), 1800000);
440 regulator_register_always_on(1, "fixed-3.3V", fixed3v3_power_consumers,
441 ARRAY_SIZE(fixed3v3_power_consumers), 3300000);
442 regulator_register_fixed(2, dummy_supplies, ARRAY_SIZE(dummy_supplies));
443
Magnus Damm28626632011-08-18 05:44:07 +0000444 sh73a0_pinmux_init();
445
446 /* SCIFA2 (UART2) */
447 gpio_request(GPIO_FN_SCIFA2_TXD1, NULL);
448 gpio_request(GPIO_FN_SCIFA2_RXD1, NULL);
449 gpio_request(GPIO_FN_SCIFA2_RTS1_, NULL);
450 gpio_request(GPIO_FN_SCIFA2_CTS1_, NULL);
451
Magnus Damm9e9a8922011-08-18 05:44:51 +0000452 /* SCIFA4 (UART1) */
453 gpio_request(GPIO_FN_SCIFA4_TXD, NULL);
454 gpio_request(GPIO_FN_SCIFA4_RXD, NULL);
455 gpio_request(GPIO_FN_SCIFA4_RTS_, NULL);
456 gpio_request(GPIO_FN_SCIFA4_CTS_, NULL);
457
Magnus Damm28626632011-08-18 05:44:07 +0000458 /* SMSC911X */
459 gpio_request(GPIO_FN_D0_NAF0, NULL);
460 gpio_request(GPIO_FN_D1_NAF1, NULL);
461 gpio_request(GPIO_FN_D2_NAF2, NULL);
462 gpio_request(GPIO_FN_D3_NAF3, NULL);
463 gpio_request(GPIO_FN_D4_NAF4, NULL);
464 gpio_request(GPIO_FN_D5_NAF5, NULL);
465 gpio_request(GPIO_FN_D6_NAF6, NULL);
466 gpio_request(GPIO_FN_D7_NAF7, NULL);
467 gpio_request(GPIO_FN_D8_NAF8, NULL);
468 gpio_request(GPIO_FN_D9_NAF9, NULL);
469 gpio_request(GPIO_FN_D10_NAF10, NULL);
470 gpio_request(GPIO_FN_D11_NAF11, NULL);
471 gpio_request(GPIO_FN_D12_NAF12, NULL);
472 gpio_request(GPIO_FN_D13_NAF13, NULL);
473 gpio_request(GPIO_FN_D14_NAF14, NULL);
474 gpio_request(GPIO_FN_D15_NAF15, NULL);
475 gpio_request(GPIO_FN_CS5A_, NULL);
476 gpio_request(GPIO_FN_WE0__FWE, NULL);
477 gpio_request(GPIO_PORT144, NULL); /* PINTA2 */
478 gpio_direction_input(GPIO_PORT144);
479 gpio_request(GPIO_PORT145, NULL); /* RESET */
480 gpio_direction_output(GPIO_PORT145, 1);
481
Magnus Dammef4f9942011-08-18 05:44:16 +0000482 /* KEYSC */
483 gpio_request(GPIO_FN_KEYIN0_PU, NULL);
484 gpio_request(GPIO_FN_KEYIN1_PU, NULL);
485 gpio_request(GPIO_FN_KEYIN2_PU, NULL);
486 gpio_request(GPIO_FN_KEYIN3_PU, NULL);
487 gpio_request(GPIO_FN_KEYIN4_PU, NULL);
488 gpio_request(GPIO_FN_KEYIN5_PU, NULL);
489 gpio_request(GPIO_FN_KEYIN6_PU, NULL);
490 gpio_request(GPIO_FN_KEYIN7_PU, NULL);
491 gpio_request(GPIO_FN_KEYOUT0, NULL);
492 gpio_request(GPIO_FN_KEYOUT1, NULL);
493 gpio_request(GPIO_FN_KEYOUT2, NULL);
494 gpio_request(GPIO_FN_KEYOUT3, NULL);
495 gpio_request(GPIO_FN_KEYOUT4, NULL);
496 gpio_request(GPIO_FN_KEYOUT5, NULL);
497 gpio_request(GPIO_FN_PORT59_KEYOUT6, NULL);
498 gpio_request(GPIO_FN_PORT58_KEYOUT7, NULL);
499 gpio_request(GPIO_FN_KEYOUT8, NULL);
500
Magnus Damm4e927942011-08-18 05:44:42 +0000501 /* MMCIF */
502 gpio_request(GPIO_FN_MMCCLK0, NULL);
503 gpio_request(GPIO_FN_MMCD0_0, NULL);
504 gpio_request(GPIO_FN_MMCD0_1, NULL);
505 gpio_request(GPIO_FN_MMCD0_2, NULL);
506 gpio_request(GPIO_FN_MMCD0_3, NULL);
507 gpio_request(GPIO_FN_MMCD0_4, NULL);
508 gpio_request(GPIO_FN_MMCD0_5, NULL);
509 gpio_request(GPIO_FN_MMCD0_6, NULL);
510 gpio_request(GPIO_FN_MMCD0_7, NULL);
511 gpio_request(GPIO_FN_MMCCMD0, NULL);
512 gpio_request(GPIO_PORT208, NULL); /* Reset */
513 gpio_direction_output(GPIO_PORT208, 1);
514
Magnus Damm8722c992011-08-18 05:45:00 +0000515 /* SDHI0 (microSD) */
516 gpio_request(GPIO_FN_SDHICD0_PU, NULL);
517 gpio_request(GPIO_FN_SDHICMD0_PU, NULL);
518 gpio_request(GPIO_FN_SDHICLK0, NULL);
519 gpio_request(GPIO_FN_SDHID0_3_PU, NULL);
520 gpio_request(GPIO_FN_SDHID0_2_PU, NULL);
521 gpio_request(GPIO_FN_SDHID0_1_PU, NULL);
522 gpio_request(GPIO_FN_SDHID0_0_PU, NULL);
523
Magnus Damm9e9a8922011-08-18 05:44:51 +0000524 /* SCIFB (BT) */
525 gpio_request(GPIO_FN_PORT159_SCIFB_SCK, NULL);
526 gpio_request(GPIO_FN_PORT160_SCIFB_TXD, NULL);
527 gpio_request(GPIO_FN_PORT161_SCIFB_CTS_, NULL);
528 gpio_request(GPIO_FN_PORT162_SCIFB_RXD, NULL);
529 gpio_request(GPIO_FN_PORT163_SCIFB_RTS_, NULL);
530
Magnus Damm8722c992011-08-18 05:45:00 +0000531 /* SDHI1 (BCM4330) */
532 gpio_request(GPIO_FN_SDHICLK1, NULL);
533 gpio_request(GPIO_FN_SDHICMD1_PU, NULL);
534 gpio_request(GPIO_FN_SDHID1_3_PU, NULL);
535 gpio_request(GPIO_FN_SDHID1_2_PU, NULL);
536 gpio_request(GPIO_FN_SDHID1_1_PU, NULL);
537 gpio_request(GPIO_FN_SDHID1_0_PU, NULL);
538
Magnus Damm28626632011-08-18 05:44:07 +0000539#ifdef CONFIG_CACHE_L2X0
540 /* Early BRESP enable, Shared attribute override enable, 64K*8way */
Rob Herringa2a47ca2012-03-09 17:16:40 -0600541 l2x0_init(IOMEM(0xf0100000), 0x40460000, 0x82000fff);
Magnus Damm28626632011-08-18 05:44:07 +0000542#endif
543 sh73a0_add_standard_devices();
544 platform_add_devices(kota2_devices, ARRAY_SIZE(kota2_devices));
545}
546
Magnus Damm28626632011-08-18 05:44:07 +0000547MACHINE_START(KOTA2, "kota2")
Marc Zyngiera62580e2011-09-08 13:15:22 +0100548 .smp = smp_ops(sh73a0_smp_ops),
Magnus Damm50e15c32012-02-29 21:37:27 +0900549 .map_io = sh73a0_map_io,
550 .init_early = sh73a0_add_early_devices,
Magnus Dammdcb4ea82011-11-22 15:29:54 +0900551 .nr_irqs = NR_IRQS_LEGACY,
Magnus Damm1b6cec82011-11-22 15:15:57 +0900552 .init_irq = sh73a0_init_irq,
Marc Zyngiera83d8e22011-09-06 10:23:45 +0100553 .handle_irq = gic_handle_irq,
Magnus Damm28626632011-08-18 05:44:07 +0000554 .init_machine = kota2_init,
Shawn Guo21cc1b72012-04-26 21:58:41 +0800555 .init_late = shmobile_init_late,
Magnus Damm3be26fd2012-03-06 17:36:45 +0900556 .timer = &shmobile_timer,
Magnus Damm28626632011-08-18 05:44:07 +0000557MACHINE_END