blob: c95258c274c11c0c3eea565ef0709531440c3cab [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
Magnus Damm19aec342011-05-24 10:40:33 +0000161static struct sh_mmcif_dma sh_mmcif_dma = {
162 .chan_priv_rx = {
163 .slave_id = SHDMA_SLAVE_MMCIF_RX,
164 },
165 .chan_priv_tx = {
166 .slave_id = SHDMA_SLAVE_MMCIF_TX,
167 },
168};
Takashi YOSHII6bf45a12010-12-22 06:35:30 +0000169static struct sh_mmcif_plat_data sh_mmcif_platdata = {
170 .sup_pclk = 0,
171 .ocr = MMC_VDD_165_195,
172 .caps = MMC_CAP_8_BIT_DATA | MMC_CAP_NONREMOVABLE,
Magnus Damm19aec342011-05-24 10:40:33 +0000173 .dma = &sh_mmcif_dma,
Takashi YOSHII6bf45a12010-12-22 06:35:30 +0000174};
175
176static struct platform_device mmc_device = {
177 .name = "sh_mmcif",
178 .id = 0,
179 .dev = {
180 .dma_mask = NULL,
181 .coherent_dma_mask = 0xffffffff,
182 .platform_data = &sh_mmcif_platdata,
183 },
184 .num_resources = ARRAY_SIZE(sh_mmcif_resources),
185 .resource = sh_mmcif_resources,
186};
187
Kuninori Morimotoa33bb8a2011-01-14 11:00:41 +0000188/* IrDA */
189static struct resource irda_resources[] = {
190 [0] = {
191 .start = 0xE6D00000,
192 .end = 0xE6D01FD4 - 1,
193 .flags = IORESOURCE_MEM,
194 },
195 [1] = {
196 .start = gic_spi(95),
197 .flags = IORESOURCE_IRQ,
198 },
199};
200
201static struct platform_device irda_device = {
202 .name = "sh_irda",
203 .id = 0,
204 .resource = irda_resources,
205 .num_resources = ARRAY_SIZE(irda_resources),
206};
207
Magnus Damm170c7ab2011-01-20 08:41:03 +0000208static unsigned char lcd_backlight_seq[3][2] = {
209 { 0x04, 0x07 },
210 { 0x23, 0x80 },
211 { 0x03, 0x01 },
212};
213
214static void lcd_backlight_on(void)
215{
216 struct i2c_adapter *a;
217 struct i2c_msg msg;
218 int k;
219
220 a = i2c_get_adapter(1);
221 for (k = 0; a && k < 3; k++) {
222 msg.addr = 0x6d;
223 msg.buf = &lcd_backlight_seq[k][0];
224 msg.len = 2;
225 msg.flags = 0;
226 if (i2c_transfer(a, &msg, 1) != 1)
227 break;
228 }
229}
230
231static void lcd_backlight_reset(void)
232{
233 gpio_set_value(GPIO_PORT235, 0);
234 mdelay(24);
235 gpio_set_value(GPIO_PORT235, 1);
236}
237
238static void lcd_on(void *board_data, struct fb_info *info)
239{
240 lcd_backlight_on();
241}
242
243static void lcd_off(void *board_data)
244{
245 lcd_backlight_reset();
246}
247
248/* LCDC0 */
249static const struct fb_videomode lcdc0_modes[] = {
250 {
251 .name = "R63302(QHD)",
252 .xres = 544,
253 .yres = 961,
254 .left_margin = 72,
255 .right_margin = 600,
256 .hsync_len = 16,
257 .upper_margin = 8,
258 .lower_margin = 8,
259 .vsync_len = 2,
260 .sync = FB_SYNC_VERT_HIGH_ACT | FB_SYNC_HOR_HIGH_ACT,
261 },
262};
263
264static struct sh_mobile_lcdc_info lcdc0_info = {
265 .clock_source = LCDC_CLK_PERIPHERAL,
266 .ch[0] = {
267 .chan = LCDC_CHAN_MAINLCD,
268 .interface_type = RGB24,
269 .clock_divider = 1,
270 .flags = LCDC_FLAGS_DWPOL,
271 .lcd_size_cfg.width = 44,
272 .lcd_size_cfg.height = 79,
273 .bpp = 16,
274 .lcd_cfg = lcdc0_modes,
275 .num_cfg = ARRAY_SIZE(lcdc0_modes),
276 .board_cfg = {
277 .display_on = lcd_on,
278 .display_off = lcd_off,
279 },
280 }
281};
282
283static struct resource lcdc0_resources[] = {
284 [0] = {
285 .name = "LCDC0",
286 .start = 0xfe940000, /* P4-only space */
287 .end = 0xfe943fff,
288 .flags = IORESOURCE_MEM,
289 },
290 [1] = {
291 .start = intcs_evt2irq(0x580),
292 .flags = IORESOURCE_IRQ,
293 },
294};
295
296static struct platform_device lcdc0_device = {
297 .name = "sh_mobile_lcdc_fb",
298 .num_resources = ARRAY_SIZE(lcdc0_resources),
299 .resource = lcdc0_resources,
300 .id = 0,
301 .dev = {
302 .platform_data = &lcdc0_info,
303 .coherent_dma_mask = ~0,
304 },
305};
306
307/* MIPI-DSI */
308static struct resource mipidsi0_resources[] = {
309 [0] = {
Magnus Damm6b36fdd2011-05-19 06:30:59 +0000310 .name = "DSI0",
Magnus Damm170c7ab2011-01-20 08:41:03 +0000311 .start = 0xfeab0000,
312 .end = 0xfeab3fff,
313 .flags = IORESOURCE_MEM,
314 },
315 [1] = {
Magnus Damm6b36fdd2011-05-19 06:30:59 +0000316 .name = "DSI0",
Magnus Damm170c7ab2011-01-20 08:41:03 +0000317 .start = 0xfeab4000,
318 .end = 0xfeab7fff,
319 .flags = IORESOURCE_MEM,
320 },
321};
322
323static struct sh_mipi_dsi_info mipidsi0_info = {
324 .data_format = MIPI_RGB888,
325 .lcd_chan = &lcdc0_info.ch[0],
326 .vsynw_offset = 20,
327 .clksrc = 1,
328 .flags = SH_MIPI_DSI_HSABM,
329};
330
331static struct platform_device mipidsi0_device = {
332 .name = "sh-mipi-dsi",
333 .num_resources = ARRAY_SIZE(mipidsi0_resources),
334 .resource = mipidsi0_resources,
335 .id = 0,
336 .dev = {
337 .platform_data = &mipidsi0_info,
338 },
339};
340
Magnus Dammfb66c522011-05-23 05:10:36 +0000341static struct sh_mobile_sdhi_info sdhi0_info = {
Magnus Damm6820e692011-05-24 10:42:15 +0000342 .dma_slave_tx = SHDMA_SLAVE_SDHI0_TX,
343 .dma_slave_rx = SHDMA_SLAVE_SDHI0_RX,
Magnus Dammfb66c522011-05-23 05:10:36 +0000344 .tmio_caps = MMC_CAP_SD_HIGHSPEED,
345 .tmio_ocr_mask = MMC_VDD_27_28 | MMC_VDD_28_29,
346};
347
348static struct resource sdhi0_resources[] = {
349 [0] = {
350 .name = "SDHI0",
351 .start = 0xee100000,
352 .end = 0xee1000ff,
353 .flags = IORESOURCE_MEM,
354 },
355 [1] = {
356 .start = gic_spi(83),
357 .flags = IORESOURCE_IRQ,
358 },
359 [2] = {
360 .start = gic_spi(84),
361 .flags = IORESOURCE_IRQ,
362 },
363 [3] = {
364 .start = gic_spi(85),
365 .flags = IORESOURCE_IRQ,
366 },
367};
368
369static struct platform_device sdhi0_device = {
370 .name = "sh_mobile_sdhi",
371 .id = 0,
372 .num_resources = ARRAY_SIZE(sdhi0_resources),
373 .resource = sdhi0_resources,
374 .dev = {
375 .platform_data = &sdhi0_info,
376 },
377};
378
379void ag5evm_sdhi1_set_pwr(struct platform_device *pdev, int state)
380{
381 gpio_set_value(GPIO_PORT114, state);
382}
383
384static struct sh_mobile_sdhi_info sh_sdhi1_platdata = {
Magnus Damm6820e692011-05-24 10:42:15 +0000385 .dma_slave_tx = SHDMA_SLAVE_SDHI1_TX,
386 .dma_slave_rx = SHDMA_SLAVE_SDHI1_RX,
Magnus Dammfb66c522011-05-23 05:10:36 +0000387 .tmio_flags = TMIO_MMC_WRPROTECT_DISABLE,
388 .tmio_caps = MMC_CAP_NONREMOVABLE,
389 .tmio_ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34,
390 .set_pwr = ag5evm_sdhi1_set_pwr,
391};
392
393static struct resource sdhi1_resources[] = {
394 [0] = {
395 .name = "SDHI1",
396 .start = 0xee120000,
397 .end = 0xee1200ff,
398 .flags = IORESOURCE_MEM,
399 },
400 [1] = {
401 .start = gic_spi(87),
402 .flags = IORESOURCE_IRQ,
403 },
404 [2] = {
405 .start = gic_spi(88),
406 .flags = IORESOURCE_IRQ,
407 },
408 [3] = {
409 .start = gic_spi(89),
410 .flags = IORESOURCE_IRQ,
411 },
412};
413
414static struct platform_device sdhi1_device = {
415 .name = "sh_mobile_sdhi",
416 .id = 1,
417 .dev = {
418 .platform_data = &sh_sdhi1_platdata,
419 },
420 .num_resources = ARRAY_SIZE(sdhi1_resources),
421 .resource = sdhi1_resources,
422};
423
Magnus Damm6d9598e2010-11-17 10:59:31 +0000424static struct platform_device *ag5evm_devices[] __initdata = {
425 &eth_device,
Yoshii Takashi2d22d482010-11-19 13:15:46 +0000426 &keysc_device,
Kuninori Morimoto208c7dc2010-11-29 02:10:08 +0000427 &fsi_device,
Takashi YOSHII6bf45a12010-12-22 06:35:30 +0000428 &mmc_device,
Kuninori Morimotoa33bb8a2011-01-14 11:00:41 +0000429 &irda_device,
Magnus Damm170c7ab2011-01-20 08:41:03 +0000430 &lcdc0_device,
431 &mipidsi0_device,
Magnus Dammfb66c522011-05-23 05:10:36 +0000432 &sdhi0_device,
433 &sdhi1_device,
Magnus Damm6d9598e2010-11-17 10:59:31 +0000434};
435
436static struct map_desc ag5evm_io_desc[] __initdata = {
437 /* create a 1:1 entity map for 0xe6xxxxxx
438 * used by CPGA, INTC and PFC.
439 */
440 {
441 .virtual = 0xe6000000,
442 .pfn = __phys_to_pfn(0xe6000000),
443 .length = 256 << 20,
444 .type = MT_DEVICE_NONSHARED
445 },
446};
447
448static void __init ag5evm_map_io(void)
449{
450 iotable_init(ag5evm_io_desc, ARRAY_SIZE(ag5evm_io_desc));
451
452 /* setup early devices and console here as well */
453 sh73a0_add_early_devices();
454 shmobile_setup_console();
455}
456
457#define PINTC_ADDR 0xe6900000
458#define PINTER0A (PINTC_ADDR + 0xa0)
459#define PINTCR0A (PINTC_ADDR + 0xb0)
460
461void __init ag5evm_init_irq(void)
462{
Magnus Damm5f53a562010-12-21 08:37:32 +0000463 sh73a0_init_irq();
464
Magnus Damm6d9598e2010-11-17 10:59:31 +0000465 /* setup PINT: enable PINTA2 as active low */
466 __raw_writel(__raw_readl(PINTER0A) | (1<<29), PINTER0A);
467 __raw_writew(__raw_readw(PINTCR0A) | (2<<10), PINTCR0A);
Magnus Damm6d9598e2010-11-17 10:59:31 +0000468}
469
Magnus Damm170c7ab2011-01-20 08:41:03 +0000470#define DSI0PHYCR 0xe615006c
471
Magnus Damm6d9598e2010-11-17 10:59:31 +0000472static void __init ag5evm_init(void)
473{
Takashi YOSHII3256c782010-11-19 16:49:38 +0900474 sh73a0_pinmux_init();
475
Magnus Damm6d9598e2010-11-17 10:59:31 +0000476 /* enable SCIFA2 */
Takashi YOSHII3256c782010-11-19 16:49:38 +0900477 gpio_request(GPIO_FN_SCIFA2_TXD1, NULL);
478 gpio_request(GPIO_FN_SCIFA2_RXD1, NULL);
479 gpio_request(GPIO_FN_SCIFA2_RTS1_, NULL);
480 gpio_request(GPIO_FN_SCIFA2_CTS1_, NULL);
Magnus Damm6d9598e2010-11-17 10:59:31 +0000481
Yoshii Takashi2d22d482010-11-19 13:15:46 +0000482 /* enable KEYSC */
Takashi YOSHII5d781472010-12-22 06:30:19 +0000483 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);
Yoshii Takashi2d22d482010-11-19 13:15:46 +0000491 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 gpio_request(GPIO_FN_PORT149_KEYOUT9, NULL);
501
Takashi YOSHII6bf45a12010-12-22 06:35:30 +0000502 /* enable I2C channel 2 and 3 */
Yoshii Takashi8e67b222010-11-19 13:21:32 +0000503 gpio_request(GPIO_FN_PORT236_I2C_SDA2, NULL);
504 gpio_request(GPIO_FN_PORT237_I2C_SCL2, NULL);
505 gpio_request(GPIO_FN_PORT248_I2C_SCL3, NULL);
506 gpio_request(GPIO_FN_PORT249_I2C_SDA3, NULL);
507
Takashi YOSHII6bf45a12010-12-22 06:35:30 +0000508 /* enable MMCIF */
509 gpio_request(GPIO_FN_MMCCLK0, NULL);
510 gpio_request(GPIO_FN_MMCCMD0_PU, NULL);
511 gpio_request(GPIO_FN_MMCD0_0, NULL);
512 gpio_request(GPIO_FN_MMCD0_1, NULL);
513 gpio_request(GPIO_FN_MMCD0_2, NULL);
514 gpio_request(GPIO_FN_MMCD0_3, NULL);
515 gpio_request(GPIO_FN_MMCD0_4, NULL);
516 gpio_request(GPIO_FN_MMCD0_5, NULL);
517 gpio_request(GPIO_FN_MMCD0_6, NULL);
518 gpio_request(GPIO_FN_MMCD0_7, NULL);
519 gpio_request(GPIO_PORT208, NULL); /* Reset */
520 gpio_direction_output(GPIO_PORT208, 1);
521
Magnus Damm6d9598e2010-11-17 10:59:31 +0000522 /* enable SMSC911X */
Takashi YOSHII3256c782010-11-19 16:49:38 +0900523 gpio_request(GPIO_PORT144, NULL); /* PINTA2 */
524 gpio_direction_input(GPIO_PORT144);
525 gpio_request(GPIO_PORT145, NULL); /* RESET */
526 gpio_direction_output(GPIO_PORT145, 1);
Magnus Damm6d9598e2010-11-17 10:59:31 +0000527
Kuninori Morimoto208c7dc2010-11-29 02:10:08 +0000528 /* FSI A */
529 gpio_request(GPIO_FN_FSIACK, NULL);
530 gpio_request(GPIO_FN_FSIAILR, NULL);
531 gpio_request(GPIO_FN_FSIAIBT, NULL);
532 gpio_request(GPIO_FN_FSIAISLD, NULL);
533 gpio_request(GPIO_FN_FSIAOSLD, NULL);
534
Kuninori Morimotoa33bb8a2011-01-14 11:00:41 +0000535 /* IrDA */
536 gpio_request(GPIO_FN_PORT241_IRDA_OUT, NULL);
537 gpio_request(GPIO_FN_PORT242_IRDA_IN, NULL);
538 gpio_request(GPIO_FN_PORT243_IRDA_FIRSEL, NULL);
539
Magnus Damm170c7ab2011-01-20 08:41:03 +0000540 /* LCD panel */
541 gpio_request(GPIO_PORT217, NULL); /* RESET */
542 gpio_direction_output(GPIO_PORT217, 0);
543 mdelay(1);
544 gpio_set_value(GPIO_PORT217, 1);
Magnus Dammf55398a2011-01-28 09:59:17 +0000545 mdelay(100);
Magnus Damm170c7ab2011-01-20 08:41:03 +0000546
547 /* LCD backlight controller */
548 gpio_request(GPIO_PORT235, NULL); /* RESET */
549 gpio_direction_output(GPIO_PORT235, 0);
550 lcd_backlight_reset();
551
552 /* MIPI-DSI clock setup */
553 __raw_writel(0x2a809010, DSI0PHYCR);
554
Magnus Dammfb66c522011-05-23 05:10:36 +0000555 /* enable SDHI0 on CN15 [SD I/F] */
556 gpio_request(GPIO_FN_SDHICD0, NULL);
557 gpio_request(GPIO_FN_SDHIWP0, NULL);
558 gpio_request(GPIO_FN_SDHICMD0, NULL);
559 gpio_request(GPIO_FN_SDHICLK0, NULL);
560 gpio_request(GPIO_FN_SDHID0_3, NULL);
561 gpio_request(GPIO_FN_SDHID0_2, NULL);
562 gpio_request(GPIO_FN_SDHID0_1, NULL);
563 gpio_request(GPIO_FN_SDHID0_0, NULL);
564
565 /* enable SDHI1 on CN4 [WLAN I/F] */
566 gpio_request(GPIO_FN_SDHICLK1, NULL);
567 gpio_request(GPIO_FN_SDHICMD1_PU, NULL);
568 gpio_request(GPIO_FN_SDHID1_3_PU, NULL);
569 gpio_request(GPIO_FN_SDHID1_2_PU, NULL);
570 gpio_request(GPIO_FN_SDHID1_1_PU, NULL);
571 gpio_request(GPIO_FN_SDHID1_0_PU, NULL);
572 gpio_request(GPIO_PORT114, "sdhi1_power");
573 gpio_direction_output(GPIO_PORT114, 0);
574
Magnus Damm6d9598e2010-11-17 10:59:31 +0000575#ifdef CONFIG_CACHE_L2X0
576 /* Shared attribute override enable, 64K*8way */
577 l2x0_init(__io(0xf0100000), 0x00460000, 0xc2000fff);
578#endif
579 sh73a0_add_standard_devices();
580 platform_add_devices(ag5evm_devices, ARRAY_SIZE(ag5evm_devices));
581}
582
583static void __init ag5evm_timer_init(void)
584{
585 sh73a0_clock_init();
586 shmobile_timer.init();
587 return;
588}
589
590struct sys_timer ag5evm_timer = {
591 .init = ag5evm_timer_init,
592};
593
594MACHINE_START(AG5EVM, "ag5evm")
595 .map_io = ag5evm_map_io,
596 .init_irq = ag5evm_init_irq,
Magnus Damme74a9622010-12-28 08:27:10 +0000597 .handle_irq = shmobile_handle_irq_gic,
Magnus Damm6d9598e2010-11-17 10:59:31 +0000598 .init_machine = ag5evm_init,
599 .timer = &ag5evm_timer,
600MACHINE_END