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