]> Pileus Git - ~andy/linux/blob - arch/arm/mach-shmobile/board-ag5evm.c
Merge tag 'for-linus' of git://linux-c6x.org/git/projects/linux-c6x-upstreaming
[~andy/linux] / arch / arm / mach-shmobile / board-ag5evm.c
1 /*
2  * arch/arm/mach-shmobile/board-ag5evm.c
3  *
4  * Copyright (C) 2010  Takashi Yoshii <yoshii.takashi.zj@renesas.com>
5  * Copyright (C) 2009  Yoshihiro Shimoda <shimoda.yoshihiro@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/kernel.h>
23 #include <linux/init.h>
24 #include <linux/interrupt.h>
25 #include <linux/irq.h>
26 #include <linux/platform_device.h>
27 #include <linux/delay.h>
28 #include <linux/io.h>
29 #include <linux/dma-mapping.h>
30 #include <linux/regulator/fixed.h>
31 #include <linux/regulator/machine.h>
32 #include <linux/serial_sci.h>
33 #include <linux/smsc911x.h>
34 #include <linux/gpio.h>
35 #include <linux/videodev2.h>
36 #include <linux/input.h>
37 #include <linux/input/sh_keysc.h>
38 #include <linux/mmc/host.h>
39 #include <linux/mmc/sh_mmcif.h>
40 #include <linux/mmc/sh_mobile_sdhi.h>
41 #include <linux/mfd/tmio.h>
42 #include <linux/sh_clk.h>
43 #include <linux/videodev2.h>
44 #include <video/sh_mobile_lcdc.h>
45 #include <video/sh_mipi_dsi.h>
46 #include <sound/sh_fsi.h>
47 #include <mach/hardware.h>
48 #include <mach/irqs.h>
49 #include <mach/sh73a0.h>
50 #include <mach/common.h>
51 #include <asm/mach-types.h>
52 #include <asm/mach/arch.h>
53 #include <asm/hardware/gic.h>
54 #include <asm/hardware/cache-l2x0.h>
55 #include <asm/traps.h>
56
57 /* Dummy supplies, where voltage doesn't matter */
58 static struct regulator_consumer_supply dummy_supplies[] = {
59         REGULATOR_SUPPLY("vddvario", "smsc911x"),
60         REGULATOR_SUPPLY("vdd33a", "smsc911x"),
61 };
62
63 static struct resource smsc9220_resources[] = {
64         [0] = {
65                 .start          = 0x14000000,
66                 .end            = 0x14000000 + SZ_64K - 1,
67                 .flags          = IORESOURCE_MEM,
68         },
69         [1] = {
70                 .start          = SH73A0_PINT0_IRQ(2), /* PINTA2 */
71                 .flags          = IORESOURCE_IRQ,
72         },
73 };
74
75 static struct smsc911x_platform_config smsc9220_platdata = {
76         .flags          = SMSC911X_USE_32BIT | SMSC911X_SAVE_MAC_ADDRESS,
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
82 static 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
92 static struct sh_keysc_info keysc_platdata = {
93         .mode           = SH_KEYSC_MODE_6,
94         .scan_timing    = 3,
95         .delay          = 100,
96         .keycodes       = {
97                 KEY_A, KEY_B, KEY_C, KEY_D, KEY_E, KEY_F, KEY_G,
98                 KEY_H, KEY_I, KEY_J, KEY_K, KEY_L, KEY_M, KEY_N,
99                 KEY_O, KEY_P, KEY_Q, KEY_R, KEY_S, KEY_T, KEY_U,
100                 KEY_V, KEY_W, KEY_X, KEY_Y, KEY_Z, KEY_HOME, KEY_SLEEP,
101                 KEY_SPACE, KEY_9, KEY_6, KEY_3, KEY_WAKEUP, KEY_RIGHT, \
102                 KEY_COFFEE,
103                 KEY_0, KEY_8, KEY_5, KEY_2, KEY_DOWN, KEY_ENTER, KEY_UP,
104                 KEY_KPASTERISK, KEY_7, KEY_4, KEY_1, KEY_STOP, KEY_LEFT, \
105                 KEY_COMPUTER,
106         },
107 };
108
109 static struct resource keysc_resources[] = {
110         [0] = {
111                 .name   = "KEYSC",
112                 .start  = 0xe61b0000,
113                 .end    = 0xe61b0098 - 1,
114                 .flags  = IORESOURCE_MEM,
115         },
116         [1] = {
117                 .start  = gic_spi(71),
118                 .flags  = IORESOURCE_IRQ,
119         },
120 };
121
122 static struct platform_device keysc_device = {
123         .name           = "sh_keysc",
124         .id             = 0,
125         .num_resources  = ARRAY_SIZE(keysc_resources),
126         .resource       = keysc_resources,
127         .dev            = {
128                 .platform_data  = &keysc_platdata,
129         },
130 };
131
132 /* FSI A */
133 static struct resource fsi_resources[] = {
134         [0] = {
135                 .name   = "FSI",
136                 .start  = 0xEC230000,
137                 .end    = 0xEC230400 - 1,
138                 .flags  = IORESOURCE_MEM,
139         },
140         [1] = {
141                 .start  = gic_spi(146),
142                 .flags  = IORESOURCE_IRQ,
143         },
144 };
145
146 static struct platform_device fsi_device = {
147         .name           = "sh_fsi2",
148         .id             = -1,
149         .num_resources  = ARRAY_SIZE(fsi_resources),
150         .resource       = fsi_resources,
151 };
152
153 /* Fixed 1.8V regulator to be used by MMCIF */
154 static struct regulator_consumer_supply fixed1v8_power_consumers[] =
155 {
156         REGULATOR_SUPPLY("vmmc", "sh_mmcif.0"),
157         REGULATOR_SUPPLY("vqmmc", "sh_mmcif.0"),
158 };
159
160 static struct resource sh_mmcif_resources[] = {
161         [0] = {
162                 .name   = "MMCIF",
163                 .start  = 0xe6bd0000,
164                 .end    = 0xe6bd00ff,
165                 .flags  = IORESOURCE_MEM,
166         },
167         [1] = {
168                 .start  = gic_spi(141),
169                 .flags  = IORESOURCE_IRQ,
170         },
171         [2] = {
172                 .start  = gic_spi(140),
173                 .flags  = IORESOURCE_IRQ,
174         },
175 };
176
177 static struct sh_mmcif_plat_data sh_mmcif_platdata = {
178         .sup_pclk       = 0,
179         .ocr            = MMC_VDD_165_195,
180         .caps           = MMC_CAP_8_BIT_DATA | MMC_CAP_NONREMOVABLE,
181         .slave_id_tx    = SHDMA_SLAVE_MMCIF_TX,
182         .slave_id_rx    = SHDMA_SLAVE_MMCIF_RX,
183 };
184
185 static struct platform_device mmc_device = {
186         .name           = "sh_mmcif",
187         .id             = 0,
188         .dev            = {
189                 .dma_mask               = NULL,
190                 .coherent_dma_mask      = 0xffffffff,
191                 .platform_data          = &sh_mmcif_platdata,
192         },
193         .num_resources  = ARRAY_SIZE(sh_mmcif_resources),
194         .resource       = sh_mmcif_resources,
195 };
196
197 /* IrDA */
198 static struct resource irda_resources[] = {
199         [0] = {
200                 .start  = 0xE6D00000,
201                 .end    = 0xE6D01FD4 - 1,
202                 .flags  = IORESOURCE_MEM,
203         },
204         [1] = {
205                 .start  = gic_spi(95),
206                 .flags  = IORESOURCE_IRQ,
207         },
208 };
209
210 static struct platform_device irda_device = {
211         .name           = "sh_irda",
212         .id             = 0,
213         .resource       = irda_resources,
214         .num_resources  = ARRAY_SIZE(irda_resources),
215 };
216
217 static unsigned char lcd_backlight_seq[3][2] = {
218         { 0x04, 0x07 },
219         { 0x23, 0x80 },
220         { 0x03, 0x01 },
221 };
222
223 static void lcd_backlight_on(void)
224 {
225         struct i2c_adapter *a;
226         struct i2c_msg msg;
227         int k;
228
229         a = i2c_get_adapter(1);
230         for (k = 0; a && k < 3; k++) {
231                 msg.addr = 0x6d;
232                 msg.buf = &lcd_backlight_seq[k][0];
233                 msg.len = 2;
234                 msg.flags = 0;
235                 if (i2c_transfer(a, &msg, 1) != 1)
236                         break;
237         }
238 }
239
240 static void lcd_backlight_reset(void)
241 {
242         gpio_set_value(GPIO_PORT235, 0);
243         mdelay(24);
244         gpio_set_value(GPIO_PORT235, 1);
245 }
246
247 /* LCDC0 */
248 static const struct fb_videomode lcdc0_modes[] = {
249         {
250                 .name           = "R63302(QHD)",
251                 .xres           = 544,
252                 .yres           = 961,
253                 .left_margin    = 72,
254                 .right_margin   = 600,
255                 .hsync_len      = 16,
256                 .upper_margin   = 8,
257                 .lower_margin   = 8,
258                 .vsync_len      = 2,
259                 .sync           = FB_SYNC_VERT_HIGH_ACT | FB_SYNC_HOR_HIGH_ACT,
260         },
261 };
262
263 static struct sh_mobile_lcdc_info lcdc0_info = {
264         .clock_source = LCDC_CLK_PERIPHERAL,
265         .ch[0] = {
266                 .chan = LCDC_CHAN_MAINLCD,
267                 .interface_type = RGB24,
268                 .clock_divider = 1,
269                 .flags = LCDC_FLAGS_DWPOL,
270                 .fourcc = V4L2_PIX_FMT_RGB565,
271                 .lcd_modes = lcdc0_modes,
272                 .num_modes = ARRAY_SIZE(lcdc0_modes),
273                 .panel_cfg = {
274                         .width = 44,
275                         .height = 79,
276                         .display_on = lcd_backlight_on,
277                         .display_off = lcd_backlight_reset,
278                 },
279         }
280 };
281
282 static struct resource lcdc0_resources[] = {
283         [0] = {
284                 .name   = "LCDC0",
285                 .start  = 0xfe940000, /* P4-only space */
286                 .end    = 0xfe943fff,
287                 .flags  = IORESOURCE_MEM,
288         },
289         [1] = {
290                 .start  = intcs_evt2irq(0x580),
291                 .flags  = IORESOURCE_IRQ,
292         },
293 };
294
295 static struct platform_device lcdc0_device = {
296         .name           = "sh_mobile_lcdc_fb",
297         .num_resources  = ARRAY_SIZE(lcdc0_resources),
298         .resource       = lcdc0_resources,
299         .id             = 0,
300         .dev    = {
301                 .platform_data  = &lcdc0_info,
302                 .coherent_dma_mask = ~0,
303         },
304 };
305
306 /* MIPI-DSI */
307 static struct resource mipidsi0_resources[] = {
308         [0] = {
309                 .name   = "DSI0",
310                 .start  = 0xfeab0000,
311                 .end    = 0xfeab3fff,
312                 .flags  = IORESOURCE_MEM,
313         },
314         [1] = {
315                 .name   = "DSI0",
316                 .start  = 0xfeab4000,
317                 .end    = 0xfeab7fff,
318                 .flags  = IORESOURCE_MEM,
319         },
320 };
321
322 static int sh_mipi_set_dot_clock(struct platform_device *pdev,
323                                  void __iomem *base,
324                                  int enable)
325 {
326         struct clk *pck, *phy;
327         int ret;
328
329         pck = clk_get(&pdev->dev, "dsip_clk");
330         if (IS_ERR(pck)) {
331                 ret = PTR_ERR(pck);
332                 goto sh_mipi_set_dot_clock_pck_err;
333         }
334
335         phy = clk_get(&pdev->dev, "dsiphy_clk");
336         if (IS_ERR(phy)) {
337                 ret = PTR_ERR(phy);
338                 goto sh_mipi_set_dot_clock_phy_err;
339         }
340
341         if (enable) {
342                 clk_set_rate(pck, clk_round_rate(pck,  24000000));
343                 clk_set_rate(phy, clk_round_rate(pck, 510000000));
344                 clk_enable(pck);
345                 clk_enable(phy);
346         } else {
347                 clk_disable(pck);
348                 clk_disable(phy);
349         }
350
351         ret = 0;
352
353         clk_put(phy);
354 sh_mipi_set_dot_clock_phy_err:
355         clk_put(pck);
356 sh_mipi_set_dot_clock_pck_err:
357         return ret;
358 }
359
360 static struct sh_mipi_dsi_info mipidsi0_info = {
361         .data_format    = MIPI_RGB888,
362         .lcd_chan       = &lcdc0_info.ch[0],
363         .lane           = 2,
364         .vsynw_offset   = 20,
365         .clksrc         = 1,
366         .flags          = SH_MIPI_DSI_HSABM             |
367                           SH_MIPI_DSI_SYNC_PULSES_MODE  |
368                           SH_MIPI_DSI_HSbyteCLK,
369         .set_dot_clock  = sh_mipi_set_dot_clock,
370 };
371
372 static struct platform_device mipidsi0_device = {
373         .name           = "sh-mipi-dsi",
374         .num_resources  = ARRAY_SIZE(mipidsi0_resources),
375         .resource       = mipidsi0_resources,
376         .id             = 0,
377         .dev    = {
378                 .platform_data  = &mipidsi0_info,
379         },
380 };
381
382 /* Fixed 2.8V regulators to be used by SDHI0 */
383 static struct regulator_consumer_supply fixed2v8_power_consumers[] =
384 {
385         REGULATOR_SUPPLY("vmmc", "sh_mobile_sdhi.0"),
386         REGULATOR_SUPPLY("vqmmc", "sh_mobile_sdhi.0"),
387 };
388
389 /* SDHI0 */
390 static struct sh_mobile_sdhi_info sdhi0_info = {
391         .dma_slave_tx   = SHDMA_SLAVE_SDHI0_TX,
392         .dma_slave_rx   = SHDMA_SLAVE_SDHI0_RX,
393         .tmio_flags     = TMIO_MMC_HAS_IDLE_WAIT | TMIO_MMC_USE_GPIO_CD,
394         .tmio_caps      = MMC_CAP_SD_HIGHSPEED,
395         .tmio_ocr_mask  = MMC_VDD_27_28 | MMC_VDD_28_29,
396         .cd_gpio        = GPIO_PORT251,
397 };
398
399 static struct resource sdhi0_resources[] = {
400         [0] = {
401                 .name   = "SDHI0",
402                 .start  = 0xee100000,
403                 .end    = 0xee1000ff,
404                 .flags  = IORESOURCE_MEM,
405         },
406         [1] = {
407                 .name   = SH_MOBILE_SDHI_IRQ_CARD_DETECT,
408                 .start  = gic_spi(83),
409                 .flags  = IORESOURCE_IRQ,
410         },
411         [2] = {
412                 .name   = SH_MOBILE_SDHI_IRQ_SDCARD,
413                 .start  = gic_spi(84),
414                 .flags  = IORESOURCE_IRQ,
415         },
416         [3] = {
417                 .name   = SH_MOBILE_SDHI_IRQ_SDIO,
418                 .start  = gic_spi(85),
419                 .flags  = IORESOURCE_IRQ,
420         },
421 };
422
423 static struct platform_device sdhi0_device = {
424         .name           = "sh_mobile_sdhi",
425         .id             = 0,
426         .num_resources  = ARRAY_SIZE(sdhi0_resources),
427         .resource       = sdhi0_resources,
428         .dev    = {
429                 .platform_data  = &sdhi0_info,
430         },
431 };
432
433 /* Fixed 3.3V regulator to be used by SDHI1 */
434 static struct regulator_consumer_supply cn4_power_consumers[] =
435 {
436         REGULATOR_SUPPLY("vmmc", "sh_mobile_sdhi.1"),
437         REGULATOR_SUPPLY("vqmmc", "sh_mobile_sdhi.1"),
438 };
439
440 static struct regulator_init_data cn4_power_init_data = {
441         .constraints = {
442                 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
443         },
444         .num_consumer_supplies  = ARRAY_SIZE(cn4_power_consumers),
445         .consumer_supplies      = cn4_power_consumers,
446 };
447
448 static struct fixed_voltage_config cn4_power_info = {
449         .supply_name = "CN4 SD/MMC Vdd",
450         .microvolts = 3300000,
451         .gpio = GPIO_PORT114,
452         .enable_high = 1,
453         .init_data = &cn4_power_init_data,
454 };
455
456 static struct platform_device cn4_power = {
457         .name = "reg-fixed-voltage",
458         .id   = 2,
459         .dev  = {
460                 .platform_data = &cn4_power_info,
461         },
462 };
463
464 static void ag5evm_sdhi1_set_pwr(struct platform_device *pdev, int state)
465 {
466         static int power_gpio = -EINVAL;
467
468         if (power_gpio < 0) {
469                 int ret = gpio_request(GPIO_PORT114, "sdhi1_power");
470                 if (!ret) {
471                         power_gpio = GPIO_PORT114;
472                         gpio_direction_output(power_gpio, 0);
473                 }
474         }
475
476         /*
477          * If requesting the GPIO above failed, it means, that the regulator got
478          * probed and grabbed the GPIO, but we don't know, whether the sdhi
479          * driver already uses the regulator. If it doesn't, we have to toggle
480          * the GPIO ourselves, even though it is now owned by the fixed
481          * regulator driver. We have to live with the race in case the driver
482          * gets unloaded and the GPIO freed between these two steps.
483          */
484         gpio_set_value(GPIO_PORT114, state);
485 }
486
487 static struct sh_mobile_sdhi_info sh_sdhi1_info = {
488         .tmio_flags     = TMIO_MMC_WRPROTECT_DISABLE | TMIO_MMC_HAS_IDLE_WAIT,
489         .tmio_caps      = MMC_CAP_NONREMOVABLE | MMC_CAP_SDIO_IRQ,
490         .tmio_ocr_mask  = MMC_VDD_32_33 | MMC_VDD_33_34,
491         .set_pwr        = ag5evm_sdhi1_set_pwr,
492 };
493
494 static struct resource sdhi1_resources[] = {
495         [0] = {
496                 .name   = "SDHI1",
497                 .start  = 0xee120000,
498                 .end    = 0xee1200ff,
499                 .flags  = IORESOURCE_MEM,
500         },
501         [1] = {
502                 .name   = SH_MOBILE_SDHI_IRQ_CARD_DETECT,
503                 .start  = gic_spi(87),
504                 .flags  = IORESOURCE_IRQ,
505         },
506         [2] = {
507                 .name   = SH_MOBILE_SDHI_IRQ_SDCARD,
508                 .start  = gic_spi(88),
509                 .flags  = IORESOURCE_IRQ,
510         },
511         [3] = {
512                 .name   = SH_MOBILE_SDHI_IRQ_SDIO,
513                 .start  = gic_spi(89),
514                 .flags  = IORESOURCE_IRQ,
515         },
516 };
517
518 static struct platform_device sdhi1_device = {
519         .name           = "sh_mobile_sdhi",
520         .id             = 1,
521         .dev            = {
522                 .platform_data  = &sh_sdhi1_info,
523         },
524         .num_resources  = ARRAY_SIZE(sdhi1_resources),
525         .resource       = sdhi1_resources,
526 };
527
528 static struct platform_device *ag5evm_devices[] __initdata = {
529         &cn4_power,
530         &eth_device,
531         &keysc_device,
532         &fsi_device,
533         &mmc_device,
534         &irda_device,
535         &lcdc0_device,
536         &mipidsi0_device,
537         &sdhi0_device,
538         &sdhi1_device,
539 };
540
541 static void __init ag5evm_init(void)
542 {
543         regulator_register_always_on(0, "fixed-1.8V", fixed1v8_power_consumers,
544                                      ARRAY_SIZE(fixed1v8_power_consumers), 1800000);
545         regulator_register_always_on(1, "fixed-2.8V", fixed2v8_power_consumers,
546                                      ARRAY_SIZE(fixed2v8_power_consumers), 3300000);
547         regulator_register_fixed(3, dummy_supplies, ARRAY_SIZE(dummy_supplies));
548
549         sh73a0_pinmux_init();
550
551         /* enable SCIFA2 */
552         gpio_request(GPIO_FN_SCIFA2_TXD1, NULL);
553         gpio_request(GPIO_FN_SCIFA2_RXD1, NULL);
554         gpio_request(GPIO_FN_SCIFA2_RTS1_, NULL);
555         gpio_request(GPIO_FN_SCIFA2_CTS1_, NULL);
556
557         /* enable KEYSC */
558         gpio_request(GPIO_FN_KEYIN0_PU, NULL);
559         gpio_request(GPIO_FN_KEYIN1_PU, NULL);
560         gpio_request(GPIO_FN_KEYIN2_PU, NULL);
561         gpio_request(GPIO_FN_KEYIN3_PU, NULL);
562         gpio_request(GPIO_FN_KEYIN4_PU, NULL);
563         gpio_request(GPIO_FN_KEYIN5_PU, NULL);
564         gpio_request(GPIO_FN_KEYIN6_PU, NULL);
565         gpio_request(GPIO_FN_KEYIN7_PU, NULL);
566         gpio_request(GPIO_FN_KEYOUT0, NULL);
567         gpio_request(GPIO_FN_KEYOUT1, NULL);
568         gpio_request(GPIO_FN_KEYOUT2, NULL);
569         gpio_request(GPIO_FN_KEYOUT3, NULL);
570         gpio_request(GPIO_FN_KEYOUT4, NULL);
571         gpio_request(GPIO_FN_KEYOUT5, NULL);
572         gpio_request(GPIO_FN_PORT59_KEYOUT6, NULL);
573         gpio_request(GPIO_FN_PORT58_KEYOUT7, NULL);
574         gpio_request(GPIO_FN_KEYOUT8, NULL);
575         gpio_request(GPIO_FN_PORT149_KEYOUT9, NULL);
576
577         /* enable I2C channel 2 and 3 */
578         gpio_request(GPIO_FN_PORT236_I2C_SDA2, NULL);
579         gpio_request(GPIO_FN_PORT237_I2C_SCL2, NULL);
580         gpio_request(GPIO_FN_PORT248_I2C_SCL3, NULL);
581         gpio_request(GPIO_FN_PORT249_I2C_SDA3, NULL);
582
583         /* enable MMCIF */
584         gpio_request(GPIO_FN_MMCCLK0, NULL);
585         gpio_request(GPIO_FN_MMCCMD0_PU, NULL);
586         gpio_request(GPIO_FN_MMCD0_0_PU, NULL);
587         gpio_request(GPIO_FN_MMCD0_1_PU, NULL);
588         gpio_request(GPIO_FN_MMCD0_2_PU, NULL);
589         gpio_request(GPIO_FN_MMCD0_3_PU, NULL);
590         gpio_request(GPIO_FN_MMCD0_4_PU, NULL);
591         gpio_request(GPIO_FN_MMCD0_5_PU, NULL);
592         gpio_request(GPIO_FN_MMCD0_6_PU, NULL);
593         gpio_request(GPIO_FN_MMCD0_7_PU, NULL);
594         gpio_request(GPIO_PORT208, NULL); /* Reset */
595         gpio_direction_output(GPIO_PORT208, 1);
596
597         /* enable SMSC911X */
598         gpio_request(GPIO_PORT144, NULL); /* PINTA2 */
599         gpio_direction_input(GPIO_PORT144);
600         gpio_request(GPIO_PORT145, NULL); /* RESET */
601         gpio_direction_output(GPIO_PORT145, 1);
602
603         /* FSI A */
604         gpio_request(GPIO_FN_FSIACK, NULL);
605         gpio_request(GPIO_FN_FSIAILR, NULL);
606         gpio_request(GPIO_FN_FSIAIBT, NULL);
607         gpio_request(GPIO_FN_FSIAISLD, NULL);
608         gpio_request(GPIO_FN_FSIAOSLD, NULL);
609
610         /* IrDA */
611         gpio_request(GPIO_FN_PORT241_IRDA_OUT, NULL);
612         gpio_request(GPIO_FN_PORT242_IRDA_IN,  NULL);
613         gpio_request(GPIO_FN_PORT243_IRDA_FIRSEL, NULL);
614
615         /* LCD panel */
616         gpio_request(GPIO_PORT217, NULL); /* RESET */
617         gpio_direction_output(GPIO_PORT217, 0);
618         mdelay(1);
619         gpio_set_value(GPIO_PORT217, 1);
620         mdelay(100);
621
622         /* LCD backlight controller */
623         gpio_request(GPIO_PORT235, NULL); /* RESET */
624         gpio_direction_output(GPIO_PORT235, 0);
625         lcd_backlight_reset();
626
627         /* enable SDHI0 on CN15 [SD I/F] */
628         gpio_request(GPIO_FN_SDHIWP0, NULL);
629         gpio_request(GPIO_FN_SDHICMD0, NULL);
630         gpio_request(GPIO_FN_SDHICLK0, NULL);
631         gpio_request(GPIO_FN_SDHID0_3, NULL);
632         gpio_request(GPIO_FN_SDHID0_2, NULL);
633         gpio_request(GPIO_FN_SDHID0_1, NULL);
634         gpio_request(GPIO_FN_SDHID0_0, NULL);
635
636         /* enable SDHI1 on CN4 [WLAN I/F] */
637         gpio_request(GPIO_FN_SDHICLK1, NULL);
638         gpio_request(GPIO_FN_SDHICMD1_PU, NULL);
639         gpio_request(GPIO_FN_SDHID1_3_PU, NULL);
640         gpio_request(GPIO_FN_SDHID1_2_PU, NULL);
641         gpio_request(GPIO_FN_SDHID1_1_PU, NULL);
642         gpio_request(GPIO_FN_SDHID1_0_PU, NULL);
643
644 #ifdef CONFIG_CACHE_L2X0
645         /* Shared attribute override enable, 64K*8way */
646         l2x0_init(IOMEM(0xf0100000), 0x00460000, 0xc2000fff);
647 #endif
648         sh73a0_add_standard_devices();
649         platform_add_devices(ag5evm_devices, ARRAY_SIZE(ag5evm_devices));
650 }
651
652 MACHINE_START(AG5EVM, "ag5evm")
653         .map_io         = sh73a0_map_io,
654         .init_early     = sh73a0_add_early_devices,
655         .nr_irqs        = NR_IRQS_LEGACY,
656         .init_irq       = sh73a0_init_irq,
657         .handle_irq     = gic_handle_irq,
658         .init_machine   = ag5evm_init,
659         .init_late      = shmobile_init_late,
660         .timer          = &shmobile_timer,
661 MACHINE_END