board-ag5evm.c 15 KB

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