blob: 09c4f000754edce7a771fd9226cff4a4ad013947 [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>
Magnus Damm28626632011-08-18 05:44:07 +000028#include <linux/platform_device.h>
29#include <linux/delay.h>
30#include <linux/io.h>
Guennadi Liakhovetskif185c212012-06-27 00:32:29 +020031#include <linux/regulator/fixed.h>
32#include <linux/regulator/machine.h>
Magnus Damm28626632011-08-18 05:44:07 +000033#include <linux/smsc911x.h>
34#include <linux/gpio.h>
Magnus Dammef4f9942011-08-18 05:44:16 +000035#include <linux/input.h>
36#include <linux/input/sh_keysc.h>
Magnus Damm6b7c0ea2011-08-18 05:44:25 +000037#include <linux/gpio_keys.h>
Magnus Dammae6e7082011-08-18 05:44:33 +000038#include <linux/leds.h>
Rob Herring520f7bd2012-12-27 13:10:24 -060039#include <linux/irqchip/arm-gic.h>
Magnus Damm33661c92011-11-22 15:44:58 +090040#include <linux/platform_data/leds-renesas-tpu.h>
Magnus Damm4e927942011-08-18 05:44:42 +000041#include <linux/mmc/host.h>
42#include <linux/mmc/sh_mmcif.h>
Magnus Damm8722c992011-08-18 05:45:00 +000043#include <linux/mfd/tmio.h>
44#include <linux/mmc/sh_mobile_sdhi.h>
Magnus Damm28626632011-08-18 05:44:07 +000045#include <mach/hardware.h>
Rob Herring250a2722012-01-03 16:57:33 -060046#include <mach/irqs.h>
Magnus Damm28626632011-08-18 05:44:07 +000047#include <mach/sh73a0.h>
48#include <mach/common.h>
49#include <asm/mach-types.h>
50#include <asm/mach/arch.h>
Magnus Damm28626632011-08-18 05:44:07 +000051#include <asm/mach/time.h>
Magnus Damm28626632011-08-18 05:44:07 +000052#include <asm/hardware/cache-l2x0.h>
53#include <asm/traps.h>
54
Guennadi Liakhovetskif185c212012-06-27 00:32:29 +020055/* Dummy supplies, where voltage doesn't matter */
56static struct regulator_consumer_supply dummy_supplies[] = {
57 REGULATOR_SUPPLY("vddvario", "smsc911x"),
58 REGULATOR_SUPPLY("vdd33a", "smsc911x"),
59};
60
Kuninori Morimotoc5e7bcd2011-11-10 18:44:43 -080061/* SMSC 9220 */
Magnus Damm28626632011-08-18 05:44:07 +000062static struct resource smsc9220_resources[] = {
63 [0] = {
64 .start = 0x14000000, /* CS5A */
65 .end = 0x140000ff, /* A1->A7 */
66 .flags = IORESOURCE_MEM,
67 },
68 [1] = {
Magnus Damm1b6cec82011-11-22 15:15:57 +090069 .start = SH73A0_PINT0_IRQ(2), /* PINTA2 */
Magnus Damm28626632011-08-18 05:44:07 +000070 .flags = IORESOURCE_IRQ,
71 },
72};
73
74static struct smsc911x_platform_config smsc9220_platdata = {
75 .flags = SMSC911X_USE_32BIT, /* 32-bit SW on 16-bit HW bus */
76 .phy_interface = PHY_INTERFACE_MODE_MII,
77 .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
78 .irq_type = SMSC911X_IRQ_TYPE_PUSH_PULL,
79};
80
81static struct platform_device eth_device = {
82 .name = "smsc911x",
83 .id = 0,
84 .dev = {
85 .platform_data = &smsc9220_platdata,
86 },
87 .resource = smsc9220_resources,
88 .num_resources = ARRAY_SIZE(smsc9220_resources),
89};
90
Kuninori Morimotoc5e7bcd2011-11-10 18:44:43 -080091/* KEYSC */
Magnus Dammef4f9942011-08-18 05:44:16 +000092static struct sh_keysc_info keysc_platdata = {
93 .mode = SH_KEYSC_MODE_6,
94 .scan_timing = 3,
95 .delay = 100,
96 .keycodes = {
97 KEY_NUMERIC_STAR, KEY_NUMERIC_0, KEY_NUMERIC_POUND,
98 0, 0, 0, 0, 0,
99 KEY_NUMERIC_7, KEY_NUMERIC_8, KEY_NUMERIC_9,
100 0, KEY_DOWN, 0, 0, 0,
101 KEY_NUMERIC_4, KEY_NUMERIC_5, KEY_NUMERIC_6,
102 KEY_LEFT, KEY_ENTER, KEY_RIGHT, 0, 0,
103 KEY_NUMERIC_1, KEY_NUMERIC_2, KEY_NUMERIC_3,
104 0, KEY_UP, 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 0, 0, 0, 0, 0, 0, 0, 0,
109 },
110};
111
112static struct resource keysc_resources[] = {
113 [0] = {
114 .name = "KEYSC",
115 .start = 0xe61b0000,
116 .end = 0xe61b0098 - 1,
117 .flags = IORESOURCE_MEM,
118 },
119 [1] = {
120 .start = gic_spi(71),
121 .flags = IORESOURCE_IRQ,
122 },
123};
124
125static struct platform_device keysc_device = {
126 .name = "sh_keysc",
127 .id = 0,
128 .num_resources = ARRAY_SIZE(keysc_resources),
129 .resource = keysc_resources,
130 .dev = {
131 .platform_data = &keysc_platdata,
132 },
133};
134
Kuninori Morimotoc5e7bcd2011-11-10 18:44:43 -0800135/* GPIO KEY */
Magnus Damm6b7c0ea2011-08-18 05:44:25 +0000136#define GPIO_KEY(c, g, d) { .code = c, .gpio = g, .desc = d, .active_low = 1 }
137
138static struct gpio_keys_button gpio_buttons[] = {
Guennadi Liakhovetskib58e5fa2013-02-12 16:50:02 +0100139 GPIO_KEY(KEY_VOLUMEUP, 56, "+"), /* S2: VOL+ [IRQ9] */
140 GPIO_KEY(KEY_VOLUMEDOWN, 54, "-"), /* S3: VOL- [IRQ10] */
141 GPIO_KEY(KEY_MENU, 27, "Menu"), /* S4: MENU [IRQ30] */
142 GPIO_KEY(KEY_HOMEPAGE, 26, "Home"), /* S5: HOME [IRQ31] */
143 GPIO_KEY(KEY_BACK, 11, "Back"), /* S6: BACK [IRQ0] */
144 GPIO_KEY(KEY_PHONE, 238, "Tel"), /* S7: TEL [IRQ11] */
145 GPIO_KEY(KEY_POWER, 239, "C1"), /* S8: CAM [IRQ13] */
146 GPIO_KEY(KEY_MAIL, 224, "Mail"), /* S9: MAIL [IRQ3] */
147 /* Omitted button "C3?": 223 - S10: CUST [IRQ8] */
148 GPIO_KEY(KEY_CAMERA, 164, "C2"), /* S11: CAM_HALF [IRQ25] */
149 /* Omitted button "?": 152 - S12: CAM_FULL [No IRQ] */
Magnus Damm6b7c0ea2011-08-18 05:44:25 +0000150};
151
152static struct gpio_keys_platform_data gpio_key_info = {
153 .buttons = gpio_buttons,
154 .nbuttons = ARRAY_SIZE(gpio_buttons),
Magnus Damm6b7c0ea2011-08-18 05:44:25 +0000155};
156
157static struct platform_device gpio_keys_device = {
Magnus Damm2fde1092012-01-17 20:14:07 +0900158 .name = "gpio-keys",
Magnus Damm6b7c0ea2011-08-18 05:44:25 +0000159 .id = -1,
160 .dev = {
161 .platform_data = &gpio_key_info,
162 },
163};
164
Kuninori Morimotoc5e7bcd2011-11-10 18:44:43 -0800165/* GPIO LED */
Magnus Dammae6e7082011-08-18 05:44:33 +0000166#define GPIO_LED(n, g) { .name = n, .gpio = g }
167
168static struct gpio_led gpio_leds[] = {
Guennadi Liakhovetskib58e5fa2013-02-12 16:50:02 +0100169 GPIO_LED("G", 20), /* PORT20 [GPO0] -> LED7 -> "G" */
170 GPIO_LED("H", 21), /* PORT21 [GPO1] -> LED8 -> "H" */
171 GPIO_LED("J", 22), /* PORT22 [GPO2] -> LED9 -> "J" */
Magnus Dammae6e7082011-08-18 05:44:33 +0000172};
173
174static struct gpio_led_platform_data gpio_leds_info = {
175 .leds = gpio_leds,
176 .num_leds = ARRAY_SIZE(gpio_leds),
177};
178
179static struct platform_device gpio_leds_device = {
180 .name = "leds-gpio",
181 .id = -1,
182 .dev = {
183 .platform_data = &gpio_leds_info,
184 },
185};
186
Magnus Damm33661c92011-11-22 15:44:58 +0900187/* TPU LED */
188static struct led_renesas_tpu_config led_renesas_tpu12_pdata = {
189 .name = "V2513",
190 .pin_gpio_fn = GPIO_FN_TPU1TO2,
Guennadi Liakhovetskib58e5fa2013-02-12 16:50:02 +0100191 .pin_gpio = 153,
Magnus Damm33661c92011-11-22 15:44:58 +0900192 .channel_offset = 0x90,
193 .timer_bit = 2,
194 .max_brightness = 1000,
195};
196
197static struct resource tpu12_resources[] = {
198 [0] = {
199 .name = "TPU12",
200 .start = 0xe6610090,
201 .end = 0xe66100b5,
202 .flags = IORESOURCE_MEM,
203 },
204};
205
206static struct platform_device leds_tpu12_device = {
207 .name = "leds-renesas-tpu",
208 .id = 12,
209 .dev = {
210 .platform_data = &led_renesas_tpu12_pdata,
211 },
212 .num_resources = ARRAY_SIZE(tpu12_resources),
213 .resource = tpu12_resources,
214};
215
216static struct led_renesas_tpu_config led_renesas_tpu41_pdata = {
217 .name = "V2514",
218 .pin_gpio_fn = GPIO_FN_TPU4TO1,
Guennadi Liakhovetskib58e5fa2013-02-12 16:50:02 +0100219 .pin_gpio = 199,
Magnus Damm33661c92011-11-22 15:44:58 +0900220 .channel_offset = 0x50,
221 .timer_bit = 1,
222 .max_brightness = 1000,
223};
224
225static struct resource tpu41_resources[] = {
226 [0] = {
227 .name = "TPU41",
228 .start = 0xe6640050,
229 .end = 0xe6640075,
230 .flags = IORESOURCE_MEM,
231 },
232};
233
234static struct platform_device leds_tpu41_device = {
235 .name = "leds-renesas-tpu",
236 .id = 41,
237 .dev = {
238 .platform_data = &led_renesas_tpu41_pdata,
239 },
240 .num_resources = ARRAY_SIZE(tpu41_resources),
241 .resource = tpu41_resources,
242};
243
244static struct led_renesas_tpu_config led_renesas_tpu21_pdata = {
245 .name = "V2515",
246 .pin_gpio_fn = GPIO_FN_TPU2TO1,
Guennadi Liakhovetskib58e5fa2013-02-12 16:50:02 +0100247 .pin_gpio = 197,
Magnus Damm33661c92011-11-22 15:44:58 +0900248 .channel_offset = 0x50,
249 .timer_bit = 1,
250 .max_brightness = 1000,
251};
252
253static struct resource tpu21_resources[] = {
254 [0] = {
255 .name = "TPU21",
256 .start = 0xe6620050,
257 .end = 0xe6620075,
258 .flags = IORESOURCE_MEM,
259 },
260};
261
262static struct platform_device leds_tpu21_device = {
263 .name = "leds-renesas-tpu",
264 .id = 21,
265 .dev = {
266 .platform_data = &led_renesas_tpu21_pdata,
267 },
268 .num_resources = ARRAY_SIZE(tpu21_resources),
269 .resource = tpu21_resources,
270};
271
272static struct led_renesas_tpu_config led_renesas_tpu30_pdata = {
273 .name = "KEYLED",
274 .pin_gpio_fn = GPIO_FN_TPU3TO0,
Guennadi Liakhovetskib58e5fa2013-02-12 16:50:02 +0100275 .pin_gpio = 163,
Magnus Damm33661c92011-11-22 15:44:58 +0900276 .channel_offset = 0x10,
277 .timer_bit = 0,
278 .max_brightness = 1000,
279};
280
281static struct resource tpu30_resources[] = {
282 [0] = {
283 .name = "TPU30",
284 .start = 0xe6630010,
285 .end = 0xe6630035,
286 .flags = IORESOURCE_MEM,
287 },
288};
289
290static struct platform_device leds_tpu30_device = {
291 .name = "leds-renesas-tpu",
292 .id = 30,
293 .dev = {
294 .platform_data = &led_renesas_tpu30_pdata,
295 },
296 .num_resources = ARRAY_SIZE(tpu30_resources),
297 .resource = tpu30_resources,
298};
299
Guennadi Liakhovetskif185c212012-06-27 00:32:29 +0200300/* Fixed 1.8V regulator to be used by MMCIF */
301static struct regulator_consumer_supply fixed1v8_power_consumers[] =
302{
303 REGULATOR_SUPPLY("vmmc", "sh_mmcif.0"),
304 REGULATOR_SUPPLY("vqmmc", "sh_mmcif.0"),
305};
306
Kuninori Morimotoc5e7bcd2011-11-10 18:44:43 -0800307/* MMCIF */
Magnus Damm4e927942011-08-18 05:44:42 +0000308static struct resource mmcif_resources[] = {
309 [0] = {
310 .name = "MMCIF",
311 .start = 0xe6bd0000,
312 .end = 0xe6bd00ff,
313 .flags = IORESOURCE_MEM,
314 },
315 [1] = {
316 .start = gic_spi(140),
317 .flags = IORESOURCE_IRQ,
318 },
319 [2] = {
320 .start = gic_spi(141),
321 .flags = IORESOURCE_IRQ,
322 },
323};
324
325static struct sh_mmcif_plat_data mmcif_info = {
326 .ocr = MMC_VDD_165_195,
327 .caps = MMC_CAP_8_BIT_DATA | MMC_CAP_NONREMOVABLE,
328};
329
330static struct platform_device mmcif_device = {
331 .name = "sh_mmcif",
332 .id = 0,
333 .dev = {
334 .platform_data = &mmcif_info,
335 },
336 .num_resources = ARRAY_SIZE(mmcif_resources),
337 .resource = mmcif_resources,
338};
339
Guennadi Liakhovetskif185c212012-06-27 00:32:29 +0200340/* Fixed 3.3V regulator to be used by SDHI0 and SDHI1 */
341static struct regulator_consumer_supply fixed3v3_power_consumers[] =
342{
343 REGULATOR_SUPPLY("vmmc", "sh_mobile_sdhi.0"),
344 REGULATOR_SUPPLY("vqmmc", "sh_mobile_sdhi.0"),
345 REGULATOR_SUPPLY("vmmc", "sh_mobile_sdhi.1"),
346 REGULATOR_SUPPLY("vqmmc", "sh_mobile_sdhi.1"),
347};
348
Kuninori Morimotoc5e7bcd2011-11-10 18:44:43 -0800349/* SDHI0 */
Magnus Damm8722c992011-08-18 05:45:00 +0000350static struct sh_mobile_sdhi_info sdhi0_info = {
351 .tmio_caps = MMC_CAP_SD_HIGHSPEED,
352 .tmio_flags = TMIO_MMC_WRPROTECT_DISABLE | TMIO_MMC_HAS_IDLE_WAIT,
353};
354
355static struct resource sdhi0_resources[] = {
356 [0] = {
357 .name = "SDHI0",
358 .start = 0xee100000,
359 .end = 0xee1000ff,
360 .flags = IORESOURCE_MEM,
361 },
362 [1] = {
363 .start = gic_spi(83),
364 .flags = IORESOURCE_IRQ,
365 },
366 [2] = {
367 .start = gic_spi(84),
368 .flags = IORESOURCE_IRQ,
369 },
370 [3] = {
371 .start = gic_spi(85),
372 .flags = IORESOURCE_IRQ,
373 },
374};
375
376static struct platform_device sdhi0_device = {
377 .name = "sh_mobile_sdhi",
378 .id = 0,
379 .num_resources = ARRAY_SIZE(sdhi0_resources),
380 .resource = sdhi0_resources,
381 .dev = {
382 .platform_data = &sdhi0_info,
383 },
384};
385
Kuninori Morimotoc5e7bcd2011-11-10 18:44:43 -0800386/* SDHI1 */
Magnus Damm8722c992011-08-18 05:45:00 +0000387static struct sh_mobile_sdhi_info sdhi1_info = {
388 .tmio_caps = MMC_CAP_NONREMOVABLE | MMC_CAP_SDIO_IRQ,
389 .tmio_flags = TMIO_MMC_WRPROTECT_DISABLE | TMIO_MMC_HAS_IDLE_WAIT,
390};
391
392static struct resource sdhi1_resources[] = {
393 [0] = {
394 .name = "SDHI1",
395 .start = 0xee120000,
396 .end = 0xee1200ff,
397 .flags = IORESOURCE_MEM,
398 },
399 [1] = {
400 .start = gic_spi(87),
401 .flags = IORESOURCE_IRQ,
402 },
403 [2] = {
404 .start = gic_spi(88),
405 .flags = IORESOURCE_IRQ,
406 },
407 [3] = {
408 .start = gic_spi(89),
409 .flags = IORESOURCE_IRQ,
410 },
411};
412
413static struct platform_device sdhi1_device = {
414 .name = "sh_mobile_sdhi",
415 .id = 1,
416 .num_resources = ARRAY_SIZE(sdhi1_resources),
417 .resource = sdhi1_resources,
418 .dev = {
419 .platform_data = &sdhi1_info,
420 },
421};
422
Magnus Damm28626632011-08-18 05:44:07 +0000423static struct platform_device *kota2_devices[] __initdata = {
424 &eth_device,
Magnus Dammef4f9942011-08-18 05:44:16 +0000425 &keysc_device,
Magnus Damm6b7c0ea2011-08-18 05:44:25 +0000426 &gpio_keys_device,
Magnus Dammae6e7082011-08-18 05:44:33 +0000427 &gpio_leds_device,
Magnus Damm33661c92011-11-22 15:44:58 +0900428 &leds_tpu12_device,
429 &leds_tpu41_device,
430 &leds_tpu21_device,
431 &leds_tpu30_device,
Magnus Damm4e927942011-08-18 05:44:42 +0000432 &mmcif_device,
Magnus Damm8722c992011-08-18 05:45:00 +0000433 &sdhi0_device,
434 &sdhi1_device,
Magnus Damm28626632011-08-18 05:44:07 +0000435};
436
Laurent Pinchartff11e872013-01-03 12:54:28 +0100437static const struct pinctrl_map kota2_pinctrl_map[] = {
438 /* SCIFA2 (UART2) */
439 PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.2", "pfc-sh73a0",
440 "scifa2_data_0", "scifa2"),
441 PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.2", "pfc-sh73a0",
442 "scifa2_ctrl_0", "scifa2"),
443 /* SCIFA4 (UART1) */
444 PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.4", "pfc-sh73a0",
445 "scifa4_data", "scifa4"),
446 PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.4", "pfc-sh73a0",
447 "scifa4_ctrl", "scifa4"),
448 /* SCIFB (BT) */
449 PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.8", "pfc-sh73a0",
450 "scifb_data_0", "scifb"),
451 PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.8", "pfc-sh73a0",
452 "scifb_clk_0", "scifb"),
453 PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.8", "pfc-sh73a0",
454 "scifb_ctrl_0", "scifb"),
455};
456
Magnus Damm28626632011-08-18 05:44:07 +0000457static void __init kota2_init(void)
458{
Guennadi Liakhovetskif185c212012-06-27 00:32:29 +0200459 regulator_register_always_on(0, "fixed-1.8V", fixed1v8_power_consumers,
460 ARRAY_SIZE(fixed1v8_power_consumers), 1800000);
461 regulator_register_always_on(1, "fixed-3.3V", fixed3v3_power_consumers,
462 ARRAY_SIZE(fixed3v3_power_consumers), 3300000);
463 regulator_register_fixed(2, dummy_supplies, ARRAY_SIZE(dummy_supplies));
464
Laurent Pinchartff11e872013-01-03 12:54:28 +0100465 pinctrl_register_mappings(kota2_pinctrl_map,
466 ARRAY_SIZE(kota2_pinctrl_map));
Magnus Damm28626632011-08-18 05:44:07 +0000467 sh73a0_pinmux_init();
468
Magnus Damm28626632011-08-18 05:44:07 +0000469 /* SMSC911X */
470 gpio_request(GPIO_FN_D0_NAF0, NULL);
471 gpio_request(GPIO_FN_D1_NAF1, NULL);
472 gpio_request(GPIO_FN_D2_NAF2, NULL);
473 gpio_request(GPIO_FN_D3_NAF3, NULL);
474 gpio_request(GPIO_FN_D4_NAF4, NULL);
475 gpio_request(GPIO_FN_D5_NAF5, NULL);
476 gpio_request(GPIO_FN_D6_NAF6, NULL);
477 gpio_request(GPIO_FN_D7_NAF7, NULL);
478 gpio_request(GPIO_FN_D8_NAF8, NULL);
479 gpio_request(GPIO_FN_D9_NAF9, NULL);
480 gpio_request(GPIO_FN_D10_NAF10, NULL);
481 gpio_request(GPIO_FN_D11_NAF11, NULL);
482 gpio_request(GPIO_FN_D12_NAF12, NULL);
483 gpio_request(GPIO_FN_D13_NAF13, NULL);
484 gpio_request(GPIO_FN_D14_NAF14, NULL);
485 gpio_request(GPIO_FN_D15_NAF15, NULL);
486 gpio_request(GPIO_FN_CS5A_, NULL);
487 gpio_request(GPIO_FN_WE0__FWE, NULL);
Guennadi Liakhovetskib58e5fa2013-02-12 16:50:02 +0100488 gpio_request_one(144, GPIOF_IN, NULL); /* PINTA2 */
489 gpio_request_one(145, GPIOF_OUT_INIT_HIGH, NULL); /* RESET */
Magnus Damm28626632011-08-18 05:44:07 +0000490
Magnus Dammef4f9942011-08-18 05:44:16 +0000491 /* KEYSC */
492 gpio_request(GPIO_FN_KEYIN0_PU, NULL);
493 gpio_request(GPIO_FN_KEYIN1_PU, NULL);
494 gpio_request(GPIO_FN_KEYIN2_PU, NULL);
495 gpio_request(GPIO_FN_KEYIN3_PU, NULL);
496 gpio_request(GPIO_FN_KEYIN4_PU, NULL);
497 gpio_request(GPIO_FN_KEYIN5_PU, NULL);
498 gpio_request(GPIO_FN_KEYIN6_PU, NULL);
499 gpio_request(GPIO_FN_KEYIN7_PU, NULL);
500 gpio_request(GPIO_FN_KEYOUT0, NULL);
501 gpio_request(GPIO_FN_KEYOUT1, NULL);
502 gpio_request(GPIO_FN_KEYOUT2, NULL);
503 gpio_request(GPIO_FN_KEYOUT3, NULL);
504 gpio_request(GPIO_FN_KEYOUT4, NULL);
505 gpio_request(GPIO_FN_KEYOUT5, NULL);
506 gpio_request(GPIO_FN_PORT59_KEYOUT6, NULL);
507 gpio_request(GPIO_FN_PORT58_KEYOUT7, NULL);
508 gpio_request(GPIO_FN_KEYOUT8, NULL);
509
Magnus Damm4e927942011-08-18 05:44:42 +0000510 /* MMCIF */
511 gpio_request(GPIO_FN_MMCCLK0, NULL);
512 gpio_request(GPIO_FN_MMCD0_0, NULL);
513 gpio_request(GPIO_FN_MMCD0_1, NULL);
514 gpio_request(GPIO_FN_MMCD0_2, NULL);
515 gpio_request(GPIO_FN_MMCD0_3, NULL);
516 gpio_request(GPIO_FN_MMCD0_4, NULL);
517 gpio_request(GPIO_FN_MMCD0_5, NULL);
518 gpio_request(GPIO_FN_MMCD0_6, NULL);
519 gpio_request(GPIO_FN_MMCD0_7, NULL);
520 gpio_request(GPIO_FN_MMCCMD0, NULL);
Guennadi Liakhovetskib58e5fa2013-02-12 16:50:02 +0100521 gpio_request_one(208, GPIOF_OUT_INIT_HIGH, NULL); /* Reset */
Magnus Damm4e927942011-08-18 05:44:42 +0000522
Magnus Damm8722c992011-08-18 05:45:00 +0000523 /* SDHI0 (microSD) */
524 gpio_request(GPIO_FN_SDHICD0_PU, NULL);
525 gpio_request(GPIO_FN_SDHICMD0_PU, NULL);
526 gpio_request(GPIO_FN_SDHICLK0, NULL);
527 gpio_request(GPIO_FN_SDHID0_3_PU, NULL);
528 gpio_request(GPIO_FN_SDHID0_2_PU, NULL);
529 gpio_request(GPIO_FN_SDHID0_1_PU, NULL);
530 gpio_request(GPIO_FN_SDHID0_0_PU, NULL);
531
Magnus Damm8722c992011-08-18 05:45:00 +0000532 /* SDHI1 (BCM4330) */
533 gpio_request(GPIO_FN_SDHICLK1, NULL);
534 gpio_request(GPIO_FN_SDHICMD1_PU, NULL);
535 gpio_request(GPIO_FN_SDHID1_3_PU, NULL);
536 gpio_request(GPIO_FN_SDHID1_2_PU, NULL);
537 gpio_request(GPIO_FN_SDHID1_1_PU, NULL);
538 gpio_request(GPIO_FN_SDHID1_0_PU, NULL);
539
Magnus Damm28626632011-08-18 05:44:07 +0000540#ifdef CONFIG_CACHE_L2X0
541 /* Early BRESP enable, Shared attribute override enable, 64K*8way */
Rob Herringa2a47ca2012-03-09 17:16:40 -0600542 l2x0_init(IOMEM(0xf0100000), 0x40460000, 0x82000fff);
Magnus Damm28626632011-08-18 05:44:07 +0000543#endif
544 sh73a0_add_standard_devices();
545 platform_add_devices(kota2_devices, ARRAY_SIZE(kota2_devices));
546}
547
Magnus Damm28626632011-08-18 05:44:07 +0000548MACHINE_START(KOTA2, "kota2")
Marc Zyngiera62580e2011-09-08 13:15:22 +0100549 .smp = smp_ops(sh73a0_smp_ops),
Magnus Damm50e15c32012-02-29 21:37:27 +0900550 .map_io = sh73a0_map_io,
551 .init_early = sh73a0_add_early_devices,
Magnus Dammdcb4ea82011-11-22 15:29:54 +0900552 .nr_irqs = NR_IRQS_LEGACY,
Magnus Damm1b6cec82011-11-22 15:15:57 +0900553 .init_irq = sh73a0_init_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,
Stephen Warren6bb27d72012-11-08 12:40:59 -0700556 .init_time = sh73a0_earlytimer_init,
Magnus Damm28626632011-08-18 05:44:07 +0000557MACHINE_END