blob: 7894cd125f9473634214ad60dcdb8d09aff3b5ef [file] [log] [blame]
Magnus Damm6d9598e2010-11-17 10:59:31 +00001/*
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>
Yoshii Takashi2d22d482010-11-19 13:15:46 +000033#include <linux/input.h>
34#include <linux/input/sh_keysc.h>
Takashi YOSHII6bf45a12010-12-22 06:35:30 +000035#include <linux/mmc/host.h>
36#include <linux/mmc/sh_mmcif.h>
Magnus Dammfb66c522011-05-23 05:10:36 +000037#include <linux/mmc/sh_mobile_sdhi.h>
38#include <linux/mfd/tmio.h>
Magnus Damm170c7ab2011-01-20 08:41:03 +000039#include <linux/sh_clk.h>
40#include <video/sh_mobile_lcdc.h>
41#include <video/sh_mipi_dsi.h>
Kuninori Morimoto208c7dc2010-11-29 02:10:08 +000042#include <sound/sh_fsi.h>
Magnus Damm6d9598e2010-11-17 10:59:31 +000043#include <mach/hardware.h>
44#include <mach/sh73a0.h>
45#include <mach/common.h>
46#include <asm/mach-types.h>
47#include <asm/mach/arch.h>
48#include <asm/mach/map.h>
49#include <asm/mach/time.h>
50#include <asm/hardware/gic.h>
51#include <asm/hardware/cache-l2x0.h>
52#include <asm/traps.h>
53
54static struct resource smsc9220_resources[] = {
55 [0] = {
56 .start = 0x14000000,
57 .end = 0x14000000 + SZ_64K - 1,
58 .flags = IORESOURCE_MEM,
59 },
60 [1] = {
61 .start = gic_spi(33), /* PINT1 */
62 .flags = IORESOURCE_IRQ,
63 },
64};
65
66static struct smsc911x_platform_config smsc9220_platdata = {
67 .flags = SMSC911X_USE_32BIT | SMSC911X_SAVE_MAC_ADDRESS,
68 .phy_interface = PHY_INTERFACE_MODE_MII,
69 .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
70 .irq_type = SMSC911X_IRQ_TYPE_PUSH_PULL,
71};
72
73static struct platform_device eth_device = {
74 .name = "smsc911x",
75 .id = 0,
76 .dev = {
77 .platform_data = &smsc9220_platdata,
78 },
79 .resource = smsc9220_resources,
80 .num_resources = ARRAY_SIZE(smsc9220_resources),
81};
82
Yoshii Takashi2d22d482010-11-19 13:15:46 +000083static struct sh_keysc_info keysc_platdata = {
84 .mode = SH_KEYSC_MODE_6,
85 .scan_timing = 3,
86 .delay = 100,
87 .keycodes = {
88 KEY_A, KEY_B, KEY_C, KEY_D, KEY_E, KEY_F, KEY_G,
89 KEY_H, KEY_I, KEY_J, KEY_K, KEY_L, KEY_M, KEY_N,
90 KEY_O, KEY_P, KEY_Q, KEY_R, KEY_S, KEY_T, KEY_U,
91 KEY_V, KEY_W, KEY_X, KEY_Y, KEY_Z, KEY_HOME, KEY_SLEEP,
92 KEY_SPACE, KEY_9, KEY_6, KEY_3, KEY_WAKEUP, KEY_RIGHT, \
93 KEY_COFFEE,
94 KEY_0, KEY_8, KEY_5, KEY_2, KEY_DOWN, KEY_ENTER, KEY_UP,
95 KEY_KPASTERISK, KEY_7, KEY_4, KEY_1, KEY_STOP, KEY_LEFT, \
96 KEY_COMPUTER,
97 },
98};
99
100static struct resource keysc_resources[] = {
101 [0] = {
102 .name = "KEYSC",
103 .start = 0xe61b0000,
104 .end = 0xe61b0098 - 1,
105 .flags = IORESOURCE_MEM,
106 },
107 [1] = {
108 .start = gic_spi(71),
109 .flags = IORESOURCE_IRQ,
110 },
111};
112
113static struct platform_device keysc_device = {
114 .name = "sh_keysc",
115 .id = 0,
116 .num_resources = ARRAY_SIZE(keysc_resources),
117 .resource = keysc_resources,
118 .dev = {
119 .platform_data = &keysc_platdata,
120 },
121};
122
Kuninori Morimoto208c7dc2010-11-29 02:10:08 +0000123/* FSI A */
Kuninori Morimoto208c7dc2010-11-29 02:10:08 +0000124static struct resource fsi_resources[] = {
125 [0] = {
126 .name = "FSI",
127 .start = 0xEC230000,
128 .end = 0xEC230400 - 1,
129 .flags = IORESOURCE_MEM,
130 },
131 [1] = {
132 .start = gic_spi(146),
133 .flags = IORESOURCE_IRQ,
134 },
135};
136
137static struct platform_device fsi_device = {
138 .name = "sh_fsi2",
139 .id = -1,
140 .num_resources = ARRAY_SIZE(fsi_resources),
141 .resource = fsi_resources,
Kuninori Morimoto208c7dc2010-11-29 02:10:08 +0000142};
143
Takashi YOSHII6bf45a12010-12-22 06:35:30 +0000144static struct resource sh_mmcif_resources[] = {
145 [0] = {
146 .name = "MMCIF",
147 .start = 0xe6bd0000,
148 .end = 0xe6bd00ff,
149 .flags = IORESOURCE_MEM,
150 },
151 [1] = {
152 .start = gic_spi(141),
153 .flags = IORESOURCE_IRQ,
154 },
155 [2] = {
156 .start = gic_spi(140),
157 .flags = IORESOURCE_IRQ,
158 },
159};
160
161static struct sh_mmcif_plat_data sh_mmcif_platdata = {
162 .sup_pclk = 0,
163 .ocr = MMC_VDD_165_195,
164 .caps = MMC_CAP_8_BIT_DATA | MMC_CAP_NONREMOVABLE,
165};
166
167static struct platform_device mmc_device = {
168 .name = "sh_mmcif",
169 .id = 0,
170 .dev = {
171 .dma_mask = NULL,
172 .coherent_dma_mask = 0xffffffff,
173 .platform_data = &sh_mmcif_platdata,
174 },
175 .num_resources = ARRAY_SIZE(sh_mmcif_resources),
176 .resource = sh_mmcif_resources,
177};
178
Kuninori Morimotoa33bb8a2011-01-14 11:00:41 +0000179/* IrDA */
180static struct resource irda_resources[] = {
181 [0] = {
182 .start = 0xE6D00000,
183 .end = 0xE6D01FD4 - 1,
184 .flags = IORESOURCE_MEM,
185 },
186 [1] = {
187 .start = gic_spi(95),
188 .flags = IORESOURCE_IRQ,
189 },
190};
191
192static struct platform_device irda_device = {
193 .name = "sh_irda",
194 .id = 0,
195 .resource = irda_resources,
196 .num_resources = ARRAY_SIZE(irda_resources),
197};
198
Magnus Damm170c7ab2011-01-20 08:41:03 +0000199static unsigned char lcd_backlight_seq[3][2] = {
200 { 0x04, 0x07 },
201 { 0x23, 0x80 },
202 { 0x03, 0x01 },
203};
204
205static void lcd_backlight_on(void)
206{
207 struct i2c_adapter *a;
208 struct i2c_msg msg;
209 int k;
210
211 a = i2c_get_adapter(1);
212 for (k = 0; a && k < 3; k++) {
213 msg.addr = 0x6d;
214 msg.buf = &lcd_backlight_seq[k][0];
215 msg.len = 2;
216 msg.flags = 0;
217 if (i2c_transfer(a, &msg, 1) != 1)
218 break;
219 }
220}
221
222static void lcd_backlight_reset(void)
223{
224 gpio_set_value(GPIO_PORT235, 0);
225 mdelay(24);
226 gpio_set_value(GPIO_PORT235, 1);
227}
228
229static void lcd_on(void *board_data, struct fb_info *info)
230{
231 lcd_backlight_on();
232}
233
234static void lcd_off(void *board_data)
235{
236 lcd_backlight_reset();
237}
238
239/* LCDC0 */
240static const struct fb_videomode lcdc0_modes[] = {
241 {
242 .name = "R63302(QHD)",
243 .xres = 544,
244 .yres = 961,
245 .left_margin = 72,
246 .right_margin = 600,
247 .hsync_len = 16,
248 .upper_margin = 8,
249 .lower_margin = 8,
250 .vsync_len = 2,
251 .sync = FB_SYNC_VERT_HIGH_ACT | FB_SYNC_HOR_HIGH_ACT,
252 },
253};
254
255static struct sh_mobile_lcdc_info lcdc0_info = {
256 .clock_source = LCDC_CLK_PERIPHERAL,
257 .ch[0] = {
258 .chan = LCDC_CHAN_MAINLCD,
259 .interface_type = RGB24,
260 .clock_divider = 1,
261 .flags = LCDC_FLAGS_DWPOL,
262 .lcd_size_cfg.width = 44,
263 .lcd_size_cfg.height = 79,
264 .bpp = 16,
265 .lcd_cfg = lcdc0_modes,
266 .num_cfg = ARRAY_SIZE(lcdc0_modes),
267 .board_cfg = {
268 .display_on = lcd_on,
269 .display_off = lcd_off,
270 },
271 }
272};
273
274static struct resource lcdc0_resources[] = {
275 [0] = {
276 .name = "LCDC0",
277 .start = 0xfe940000, /* P4-only space */
278 .end = 0xfe943fff,
279 .flags = IORESOURCE_MEM,
280 },
281 [1] = {
282 .start = intcs_evt2irq(0x580),
283 .flags = IORESOURCE_IRQ,
284 },
285};
286
287static struct platform_device lcdc0_device = {
288 .name = "sh_mobile_lcdc_fb",
289 .num_resources = ARRAY_SIZE(lcdc0_resources),
290 .resource = lcdc0_resources,
291 .id = 0,
292 .dev = {
293 .platform_data = &lcdc0_info,
294 .coherent_dma_mask = ~0,
295 },
296};
297
298/* MIPI-DSI */
299static struct resource mipidsi0_resources[] = {
300 [0] = {
Magnus Damm6b36fdd2011-05-19 06:30:59 +0000301 .name = "DSI0",
Magnus Damm170c7ab2011-01-20 08:41:03 +0000302 .start = 0xfeab0000,
303 .end = 0xfeab3fff,
304 .flags = IORESOURCE_MEM,
305 },
306 [1] = {
Magnus Damm6b36fdd2011-05-19 06:30:59 +0000307 .name = "DSI0",
Magnus Damm170c7ab2011-01-20 08:41:03 +0000308 .start = 0xfeab4000,
309 .end = 0xfeab7fff,
310 .flags = IORESOURCE_MEM,
311 },
312};
313
314static struct sh_mipi_dsi_info mipidsi0_info = {
315 .data_format = MIPI_RGB888,
316 .lcd_chan = &lcdc0_info.ch[0],
317 .vsynw_offset = 20,
318 .clksrc = 1,
319 .flags = SH_MIPI_DSI_HSABM,
320};
321
322static struct platform_device mipidsi0_device = {
323 .name = "sh-mipi-dsi",
324 .num_resources = ARRAY_SIZE(mipidsi0_resources),
325 .resource = mipidsi0_resources,
326 .id = 0,
327 .dev = {
328 .platform_data = &mipidsi0_info,
329 },
330};
331
Magnus Dammfb66c522011-05-23 05:10:36 +0000332static struct sh_mobile_sdhi_info sdhi0_info = {
333 .tmio_caps = MMC_CAP_SD_HIGHSPEED,
334 .tmio_ocr_mask = MMC_VDD_27_28 | MMC_VDD_28_29,
335};
336
337static struct resource sdhi0_resources[] = {
338 [0] = {
339 .name = "SDHI0",
340 .start = 0xee100000,
341 .end = 0xee1000ff,
342 .flags = IORESOURCE_MEM,
343 },
344 [1] = {
345 .start = gic_spi(83),
346 .flags = IORESOURCE_IRQ,
347 },
348 [2] = {
349 .start = gic_spi(84),
350 .flags = IORESOURCE_IRQ,
351 },
352 [3] = {
353 .start = gic_spi(85),
354 .flags = IORESOURCE_IRQ,
355 },
356};
357
358static struct platform_device sdhi0_device = {
359 .name = "sh_mobile_sdhi",
360 .id = 0,
361 .num_resources = ARRAY_SIZE(sdhi0_resources),
362 .resource = sdhi0_resources,
363 .dev = {
364 .platform_data = &sdhi0_info,
365 },
366};
367
368void ag5evm_sdhi1_set_pwr(struct platform_device *pdev, int state)
369{
370 gpio_set_value(GPIO_PORT114, state);
371}
372
373static struct sh_mobile_sdhi_info sh_sdhi1_platdata = {
374 .tmio_flags = TMIO_MMC_WRPROTECT_DISABLE,
375 .tmio_caps = MMC_CAP_NONREMOVABLE,
376 .tmio_ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34,
377 .set_pwr = ag5evm_sdhi1_set_pwr,
378};
379
380static struct resource sdhi1_resources[] = {
381 [0] = {
382 .name = "SDHI1",
383 .start = 0xee120000,
384 .end = 0xee1200ff,
385 .flags = IORESOURCE_MEM,
386 },
387 [1] = {
388 .start = gic_spi(87),
389 .flags = IORESOURCE_IRQ,
390 },
391 [2] = {
392 .start = gic_spi(88),
393 .flags = IORESOURCE_IRQ,
394 },
395 [3] = {
396 .start = gic_spi(89),
397 .flags = IORESOURCE_IRQ,
398 },
399};
400
401static struct platform_device sdhi1_device = {
402 .name = "sh_mobile_sdhi",
403 .id = 1,
404 .dev = {
405 .platform_data = &sh_sdhi1_platdata,
406 },
407 .num_resources = ARRAY_SIZE(sdhi1_resources),
408 .resource = sdhi1_resources,
409};
410
Magnus Damm6d9598e2010-11-17 10:59:31 +0000411static struct platform_device *ag5evm_devices[] __initdata = {
412 &eth_device,
Yoshii Takashi2d22d482010-11-19 13:15:46 +0000413 &keysc_device,
Kuninori Morimoto208c7dc2010-11-29 02:10:08 +0000414 &fsi_device,
Takashi YOSHII6bf45a12010-12-22 06:35:30 +0000415 &mmc_device,
Kuninori Morimotoa33bb8a2011-01-14 11:00:41 +0000416 &irda_device,
Magnus Damm170c7ab2011-01-20 08:41:03 +0000417 &lcdc0_device,
418 &mipidsi0_device,
Magnus Dammfb66c522011-05-23 05:10:36 +0000419 &sdhi0_device,
420 &sdhi1_device,
Magnus Damm6d9598e2010-11-17 10:59:31 +0000421};
422
423static struct map_desc ag5evm_io_desc[] __initdata = {
424 /* create a 1:1 entity map for 0xe6xxxxxx
425 * used by CPGA, INTC and PFC.
426 */
427 {
428 .virtual = 0xe6000000,
429 .pfn = __phys_to_pfn(0xe6000000),
430 .length = 256 << 20,
431 .type = MT_DEVICE_NONSHARED
432 },
433};
434
435static void __init ag5evm_map_io(void)
436{
437 iotable_init(ag5evm_io_desc, ARRAY_SIZE(ag5evm_io_desc));
438
439 /* setup early devices and console here as well */
440 sh73a0_add_early_devices();
441 shmobile_setup_console();
442}
443
444#define PINTC_ADDR 0xe6900000
445#define PINTER0A (PINTC_ADDR + 0xa0)
446#define PINTCR0A (PINTC_ADDR + 0xb0)
447
448void __init ag5evm_init_irq(void)
449{
Magnus Damm5f53a562010-12-21 08:37:32 +0000450 sh73a0_init_irq();
451
Magnus Damm6d9598e2010-11-17 10:59:31 +0000452 /* setup PINT: enable PINTA2 as active low */
453 __raw_writel(__raw_readl(PINTER0A) | (1<<29), PINTER0A);
454 __raw_writew(__raw_readw(PINTCR0A) | (2<<10), PINTCR0A);
Magnus Damm6d9598e2010-11-17 10:59:31 +0000455}
456
Magnus Damm170c7ab2011-01-20 08:41:03 +0000457#define DSI0PHYCR 0xe615006c
458
Magnus Damm6d9598e2010-11-17 10:59:31 +0000459static void __init ag5evm_init(void)
460{
Takashi YOSHII3256c782010-11-19 16:49:38 +0900461 sh73a0_pinmux_init();
462
Magnus Damm6d9598e2010-11-17 10:59:31 +0000463 /* enable SCIFA2 */
Takashi YOSHII3256c782010-11-19 16:49:38 +0900464 gpio_request(GPIO_FN_SCIFA2_TXD1, NULL);
465 gpio_request(GPIO_FN_SCIFA2_RXD1, NULL);
466 gpio_request(GPIO_FN_SCIFA2_RTS1_, NULL);
467 gpio_request(GPIO_FN_SCIFA2_CTS1_, NULL);
Magnus Damm6d9598e2010-11-17 10:59:31 +0000468
Yoshii Takashi2d22d482010-11-19 13:15:46 +0000469 /* enable KEYSC */
Takashi YOSHII5d781472010-12-22 06:30:19 +0000470 gpio_request(GPIO_FN_KEYIN0_PU, NULL);
471 gpio_request(GPIO_FN_KEYIN1_PU, NULL);
472 gpio_request(GPIO_FN_KEYIN2_PU, NULL);
473 gpio_request(GPIO_FN_KEYIN3_PU, NULL);
474 gpio_request(GPIO_FN_KEYIN4_PU, NULL);
475 gpio_request(GPIO_FN_KEYIN5_PU, NULL);
476 gpio_request(GPIO_FN_KEYIN6_PU, NULL);
477 gpio_request(GPIO_FN_KEYIN7_PU, NULL);
Yoshii Takashi2d22d482010-11-19 13:15:46 +0000478 gpio_request(GPIO_FN_KEYOUT0, NULL);
479 gpio_request(GPIO_FN_KEYOUT1, NULL);
480 gpio_request(GPIO_FN_KEYOUT2, NULL);
481 gpio_request(GPIO_FN_KEYOUT3, NULL);
482 gpio_request(GPIO_FN_KEYOUT4, NULL);
483 gpio_request(GPIO_FN_KEYOUT5, NULL);
484 gpio_request(GPIO_FN_PORT59_KEYOUT6, NULL);
485 gpio_request(GPIO_FN_PORT58_KEYOUT7, NULL);
486 gpio_request(GPIO_FN_KEYOUT8, NULL);
487 gpio_request(GPIO_FN_PORT149_KEYOUT9, NULL);
488
Takashi YOSHII6bf45a12010-12-22 06:35:30 +0000489 /* enable I2C channel 2 and 3 */
Yoshii Takashi8e67b222010-11-19 13:21:32 +0000490 gpio_request(GPIO_FN_PORT236_I2C_SDA2, NULL);
491 gpio_request(GPIO_FN_PORT237_I2C_SCL2, NULL);
492 gpio_request(GPIO_FN_PORT248_I2C_SCL3, NULL);
493 gpio_request(GPIO_FN_PORT249_I2C_SDA3, NULL);
494
Takashi YOSHII6bf45a12010-12-22 06:35:30 +0000495 /* enable MMCIF */
496 gpio_request(GPIO_FN_MMCCLK0, NULL);
497 gpio_request(GPIO_FN_MMCCMD0_PU, NULL);
498 gpio_request(GPIO_FN_MMCD0_0, NULL);
499 gpio_request(GPIO_FN_MMCD0_1, NULL);
500 gpio_request(GPIO_FN_MMCD0_2, NULL);
501 gpio_request(GPIO_FN_MMCD0_3, NULL);
502 gpio_request(GPIO_FN_MMCD0_4, NULL);
503 gpio_request(GPIO_FN_MMCD0_5, NULL);
504 gpio_request(GPIO_FN_MMCD0_6, NULL);
505 gpio_request(GPIO_FN_MMCD0_7, NULL);
506 gpio_request(GPIO_PORT208, NULL); /* Reset */
507 gpio_direction_output(GPIO_PORT208, 1);
508
Magnus Damm6d9598e2010-11-17 10:59:31 +0000509 /* enable SMSC911X */
Takashi YOSHII3256c782010-11-19 16:49:38 +0900510 gpio_request(GPIO_PORT144, NULL); /* PINTA2 */
511 gpio_direction_input(GPIO_PORT144);
512 gpio_request(GPIO_PORT145, NULL); /* RESET */
513 gpio_direction_output(GPIO_PORT145, 1);
Magnus Damm6d9598e2010-11-17 10:59:31 +0000514
Kuninori Morimoto208c7dc2010-11-29 02:10:08 +0000515 /* FSI A */
516 gpio_request(GPIO_FN_FSIACK, NULL);
517 gpio_request(GPIO_FN_FSIAILR, NULL);
518 gpio_request(GPIO_FN_FSIAIBT, NULL);
519 gpio_request(GPIO_FN_FSIAISLD, NULL);
520 gpio_request(GPIO_FN_FSIAOSLD, NULL);
521
Kuninori Morimotoa33bb8a2011-01-14 11:00:41 +0000522 /* IrDA */
523 gpio_request(GPIO_FN_PORT241_IRDA_OUT, NULL);
524 gpio_request(GPIO_FN_PORT242_IRDA_IN, NULL);
525 gpio_request(GPIO_FN_PORT243_IRDA_FIRSEL, NULL);
526
Magnus Damm170c7ab2011-01-20 08:41:03 +0000527 /* LCD panel */
528 gpio_request(GPIO_PORT217, NULL); /* RESET */
529 gpio_direction_output(GPIO_PORT217, 0);
530 mdelay(1);
531 gpio_set_value(GPIO_PORT217, 1);
Magnus Dammf55398a2011-01-28 09:59:17 +0000532 mdelay(100);
Magnus Damm170c7ab2011-01-20 08:41:03 +0000533
534 /* LCD backlight controller */
535 gpio_request(GPIO_PORT235, NULL); /* RESET */
536 gpio_direction_output(GPIO_PORT235, 0);
537 lcd_backlight_reset();
538
539 /* MIPI-DSI clock setup */
540 __raw_writel(0x2a809010, DSI0PHYCR);
541
Magnus Dammfb66c522011-05-23 05:10:36 +0000542 /* enable SDHI0 on CN15 [SD I/F] */
543 gpio_request(GPIO_FN_SDHICD0, NULL);
544 gpio_request(GPIO_FN_SDHIWP0, NULL);
545 gpio_request(GPIO_FN_SDHICMD0, NULL);
546 gpio_request(GPIO_FN_SDHICLK0, NULL);
547 gpio_request(GPIO_FN_SDHID0_3, NULL);
548 gpio_request(GPIO_FN_SDHID0_2, NULL);
549 gpio_request(GPIO_FN_SDHID0_1, NULL);
550 gpio_request(GPIO_FN_SDHID0_0, NULL);
551
552 /* enable SDHI1 on CN4 [WLAN I/F] */
553 gpio_request(GPIO_FN_SDHICLK1, NULL);
554 gpio_request(GPIO_FN_SDHICMD1_PU, NULL);
555 gpio_request(GPIO_FN_SDHID1_3_PU, NULL);
556 gpio_request(GPIO_FN_SDHID1_2_PU, NULL);
557 gpio_request(GPIO_FN_SDHID1_1_PU, NULL);
558 gpio_request(GPIO_FN_SDHID1_0_PU, NULL);
559 gpio_request(GPIO_PORT114, "sdhi1_power");
560 gpio_direction_output(GPIO_PORT114, 0);
561
Magnus Damm6d9598e2010-11-17 10:59:31 +0000562#ifdef CONFIG_CACHE_L2X0
563 /* Shared attribute override enable, 64K*8way */
564 l2x0_init(__io(0xf0100000), 0x00460000, 0xc2000fff);
565#endif
566 sh73a0_add_standard_devices();
567 platform_add_devices(ag5evm_devices, ARRAY_SIZE(ag5evm_devices));
568}
569
570static void __init ag5evm_timer_init(void)
571{
572 sh73a0_clock_init();
573 shmobile_timer.init();
574 return;
575}
576
577struct sys_timer ag5evm_timer = {
578 .init = ag5evm_timer_init,
579};
580
581MACHINE_START(AG5EVM, "ag5evm")
582 .map_io = ag5evm_map_io,
583 .init_irq = ag5evm_init_irq,
Magnus Damme74a9622010-12-28 08:27:10 +0000584 .handle_irq = shmobile_handle_irq_gic,
Magnus Damm6d9598e2010-11-17 10:59:31 +0000585 .init_machine = ag5evm_init,
586 .timer = &ag5evm_timer,
587MACHINE_END