board-ag5evm.c 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601
  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/videodev2.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/hardware/gic.h>
  50. #include <asm/hardware/cache-l2x0.h>
  51. #include <asm/traps.h>
  52. static struct resource smsc9220_resources[] = {
  53. [0] = {
  54. .start = 0x14000000,
  55. .end = 0x14000000 + SZ_64K - 1,
  56. .flags = IORESOURCE_MEM,
  57. },
  58. [1] = {
  59. .start = SH73A0_PINT0_IRQ(2), /* PINTA2 */
  60. .flags = IORESOURCE_IRQ,
  61. },
  62. };
  63. static struct smsc911x_platform_config smsc9220_platdata = {
  64. .flags = SMSC911X_USE_32BIT | SMSC911X_SAVE_MAC_ADDRESS,
  65. .phy_interface = PHY_INTERFACE_MODE_MII,
  66. .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
  67. .irq_type = SMSC911X_IRQ_TYPE_PUSH_PULL,
  68. };
  69. static struct platform_device eth_device = {
  70. .name = "smsc911x",
  71. .id = 0,
  72. .dev = {
  73. .platform_data = &smsc9220_platdata,
  74. },
  75. .resource = smsc9220_resources,
  76. .num_resources = ARRAY_SIZE(smsc9220_resources),
  77. };
  78. static struct sh_keysc_info keysc_platdata = {
  79. .mode = SH_KEYSC_MODE_6,
  80. .scan_timing = 3,
  81. .delay = 100,
  82. .keycodes = {
  83. KEY_A, KEY_B, KEY_C, KEY_D, KEY_E, KEY_F, KEY_G,
  84. KEY_H, KEY_I, KEY_J, KEY_K, KEY_L, KEY_M, KEY_N,
  85. KEY_O, KEY_P, KEY_Q, KEY_R, KEY_S, KEY_T, KEY_U,
  86. KEY_V, KEY_W, KEY_X, KEY_Y, KEY_Z, KEY_HOME, KEY_SLEEP,
  87. KEY_SPACE, KEY_9, KEY_6, KEY_3, KEY_WAKEUP, KEY_RIGHT, \
  88. KEY_COFFEE,
  89. KEY_0, KEY_8, KEY_5, KEY_2, KEY_DOWN, KEY_ENTER, KEY_UP,
  90. KEY_KPASTERISK, KEY_7, KEY_4, KEY_1, KEY_STOP, KEY_LEFT, \
  91. KEY_COMPUTER,
  92. },
  93. };
  94. static struct resource keysc_resources[] = {
  95. [0] = {
  96. .name = "KEYSC",
  97. .start = 0xe61b0000,
  98. .end = 0xe61b0098 - 1,
  99. .flags = IORESOURCE_MEM,
  100. },
  101. [1] = {
  102. .start = gic_spi(71),
  103. .flags = IORESOURCE_IRQ,
  104. },
  105. };
  106. static struct platform_device keysc_device = {
  107. .name = "sh_keysc",
  108. .id = 0,
  109. .num_resources = ARRAY_SIZE(keysc_resources),
  110. .resource = keysc_resources,
  111. .dev = {
  112. .platform_data = &keysc_platdata,
  113. },
  114. };
  115. /* FSI A */
  116. static struct resource fsi_resources[] = {
  117. [0] = {
  118. .name = "FSI",
  119. .start = 0xEC230000,
  120. .end = 0xEC230400 - 1,
  121. .flags = IORESOURCE_MEM,
  122. },
  123. [1] = {
  124. .start = gic_spi(146),
  125. .flags = IORESOURCE_IRQ,
  126. },
  127. };
  128. static struct platform_device fsi_device = {
  129. .name = "sh_fsi2",
  130. .id = -1,
  131. .num_resources = ARRAY_SIZE(fsi_resources),
  132. .resource = fsi_resources,
  133. };
  134. static struct resource sh_mmcif_resources[] = {
  135. [0] = {
  136. .name = "MMCIF",
  137. .start = 0xe6bd0000,
  138. .end = 0xe6bd00ff,
  139. .flags = IORESOURCE_MEM,
  140. },
  141. [1] = {
  142. .start = gic_spi(141),
  143. .flags = IORESOURCE_IRQ,
  144. },
  145. [2] = {
  146. .start = gic_spi(140),
  147. .flags = IORESOURCE_IRQ,
  148. },
  149. };
  150. static struct sh_mmcif_plat_data sh_mmcif_platdata = {
  151. .sup_pclk = 0,
  152. .ocr = MMC_VDD_165_195,
  153. .caps = MMC_CAP_8_BIT_DATA | MMC_CAP_NONREMOVABLE,
  154. .slave_id_tx = SHDMA_SLAVE_MMCIF_TX,
  155. .slave_id_rx = SHDMA_SLAVE_MMCIF_RX,
  156. };
  157. static struct platform_device mmc_device = {
  158. .name = "sh_mmcif",
  159. .id = 0,
  160. .dev = {
  161. .dma_mask = NULL,
  162. .coherent_dma_mask = 0xffffffff,
  163. .platform_data = &sh_mmcif_platdata,
  164. },
  165. .num_resources = ARRAY_SIZE(sh_mmcif_resources),
  166. .resource = sh_mmcif_resources,
  167. };
  168. /* IrDA */
  169. static struct resource irda_resources[] = {
  170. [0] = {
  171. .start = 0xE6D00000,
  172. .end = 0xE6D01FD4 - 1,
  173. .flags = IORESOURCE_MEM,
  174. },
  175. [1] = {
  176. .start = gic_spi(95),
  177. .flags = IORESOURCE_IRQ,
  178. },
  179. };
  180. static struct platform_device irda_device = {
  181. .name = "sh_irda",
  182. .id = 0,
  183. .resource = irda_resources,
  184. .num_resources = ARRAY_SIZE(irda_resources),
  185. };
  186. static unsigned char lcd_backlight_seq[3][2] = {
  187. { 0x04, 0x07 },
  188. { 0x23, 0x80 },
  189. { 0x03, 0x01 },
  190. };
  191. static void lcd_backlight_on(void)
  192. {
  193. struct i2c_adapter *a;
  194. struct i2c_msg msg;
  195. int k;
  196. a = i2c_get_adapter(1);
  197. for (k = 0; a && k < 3; k++) {
  198. msg.addr = 0x6d;
  199. msg.buf = &lcd_backlight_seq[k][0];
  200. msg.len = 2;
  201. msg.flags = 0;
  202. if (i2c_transfer(a, &msg, 1) != 1)
  203. break;
  204. }
  205. }
  206. static void lcd_backlight_reset(void)
  207. {
  208. gpio_set_value(GPIO_PORT235, 0);
  209. mdelay(24);
  210. gpio_set_value(GPIO_PORT235, 1);
  211. }
  212. /* LCDC0 */
  213. static const struct fb_videomode lcdc0_modes[] = {
  214. {
  215. .name = "R63302(QHD)",
  216. .xres = 544,
  217. .yres = 961,
  218. .left_margin = 72,
  219. .right_margin = 600,
  220. .hsync_len = 16,
  221. .upper_margin = 8,
  222. .lower_margin = 8,
  223. .vsync_len = 2,
  224. .sync = FB_SYNC_VERT_HIGH_ACT | FB_SYNC_HOR_HIGH_ACT,
  225. },
  226. };
  227. static struct sh_mobile_lcdc_info lcdc0_info = {
  228. .clock_source = LCDC_CLK_PERIPHERAL,
  229. .ch[0] = {
  230. .chan = LCDC_CHAN_MAINLCD,
  231. .interface_type = RGB24,
  232. .clock_divider = 1,
  233. .flags = LCDC_FLAGS_DWPOL,
  234. .fourcc = V4L2_PIX_FMT_RGB565,
  235. .lcd_modes = lcdc0_modes,
  236. .num_modes = ARRAY_SIZE(lcdc0_modes),
  237. .panel_cfg = {
  238. .width = 44,
  239. .height = 79,
  240. .display_on = lcd_backlight_on,
  241. .display_off = lcd_backlight_reset,
  242. },
  243. }
  244. };
  245. static struct resource lcdc0_resources[] = {
  246. [0] = {
  247. .name = "LCDC0",
  248. .start = 0xfe940000, /* P4-only space */
  249. .end = 0xfe943fff,
  250. .flags = IORESOURCE_MEM,
  251. },
  252. [1] = {
  253. .start = intcs_evt2irq(0x580),
  254. .flags = IORESOURCE_IRQ,
  255. },
  256. };
  257. static struct platform_device lcdc0_device = {
  258. .name = "sh_mobile_lcdc_fb",
  259. .num_resources = ARRAY_SIZE(lcdc0_resources),
  260. .resource = lcdc0_resources,
  261. .id = 0,
  262. .dev = {
  263. .platform_data = &lcdc0_info,
  264. .coherent_dma_mask = ~0,
  265. },
  266. };
  267. /* MIPI-DSI */
  268. static struct resource mipidsi0_resources[] = {
  269. [0] = {
  270. .name = "DSI0",
  271. .start = 0xfeab0000,
  272. .end = 0xfeab3fff,
  273. .flags = IORESOURCE_MEM,
  274. },
  275. [1] = {
  276. .name = "DSI0",
  277. .start = 0xfeab4000,
  278. .end = 0xfeab7fff,
  279. .flags = IORESOURCE_MEM,
  280. },
  281. };
  282. static int sh_mipi_set_dot_clock(struct platform_device *pdev,
  283. void __iomem *base,
  284. int enable)
  285. {
  286. struct clk *pck, *phy;
  287. int ret;
  288. pck = clk_get(&pdev->dev, "dsip_clk");
  289. if (IS_ERR(pck)) {
  290. ret = PTR_ERR(pck);
  291. goto sh_mipi_set_dot_clock_pck_err;
  292. }
  293. phy = clk_get(&pdev->dev, "dsiphy_clk");
  294. if (IS_ERR(phy)) {
  295. ret = PTR_ERR(phy);
  296. goto sh_mipi_set_dot_clock_phy_err;
  297. }
  298. if (enable) {
  299. clk_set_rate(pck, clk_round_rate(pck, 24000000));
  300. clk_set_rate(phy, clk_round_rate(pck, 510000000));
  301. clk_enable(pck);
  302. clk_enable(phy);
  303. } else {
  304. clk_disable(pck);
  305. clk_disable(phy);
  306. }
  307. ret = 0;
  308. clk_put(phy);
  309. sh_mipi_set_dot_clock_phy_err:
  310. clk_put(pck);
  311. sh_mipi_set_dot_clock_pck_err:
  312. return ret;
  313. }
  314. static struct sh_mipi_dsi_info mipidsi0_info = {
  315. .data_format = MIPI_RGB888,
  316. .lcd_chan = &lcdc0_info.ch[0],
  317. .lane = 2,
  318. .vsynw_offset = 20,
  319. .clksrc = 1,
  320. .flags = SH_MIPI_DSI_HSABM |
  321. SH_MIPI_DSI_SYNC_PULSES_MODE |
  322. SH_MIPI_DSI_HSbyteCLK,
  323. .set_dot_clock = sh_mipi_set_dot_clock,
  324. };
  325. static struct platform_device mipidsi0_device = {
  326. .name = "sh-mipi-dsi",
  327. .num_resources = ARRAY_SIZE(mipidsi0_resources),
  328. .resource = mipidsi0_resources,
  329. .id = 0,
  330. .dev = {
  331. .platform_data = &mipidsi0_info,
  332. },
  333. };
  334. /* SDHI0 */
  335. static irqreturn_t ag5evm_sdhi0_gpio_cd(int irq, void *arg)
  336. {
  337. struct device *dev = arg;
  338. struct sh_mobile_sdhi_info *info = dev->platform_data;
  339. struct tmio_mmc_data *pdata = info->pdata;
  340. tmio_mmc_cd_wakeup(pdata);
  341. return IRQ_HANDLED;
  342. }
  343. static struct sh_mobile_sdhi_info sdhi0_info = {
  344. .dma_slave_tx = SHDMA_SLAVE_SDHI0_TX,
  345. .dma_slave_rx = SHDMA_SLAVE_SDHI0_RX,
  346. .tmio_flags = TMIO_MMC_HAS_IDLE_WAIT,
  347. .tmio_caps = MMC_CAP_SD_HIGHSPEED,
  348. .tmio_ocr_mask = MMC_VDD_27_28 | MMC_VDD_28_29,
  349. };
  350. static struct resource sdhi0_resources[] = {
  351. [0] = {
  352. .name = "SDHI0",
  353. .start = 0xee100000,
  354. .end = 0xee1000ff,
  355. .flags = IORESOURCE_MEM,
  356. },
  357. [1] = {
  358. .name = SH_MOBILE_SDHI_IRQ_CARD_DETECT,
  359. .start = gic_spi(83),
  360. .flags = IORESOURCE_IRQ,
  361. },
  362. [2] = {
  363. .name = SH_MOBILE_SDHI_IRQ_SDCARD,
  364. .start = gic_spi(84),
  365. .flags = IORESOURCE_IRQ,
  366. },
  367. [3] = {
  368. .name = SH_MOBILE_SDHI_IRQ_SDIO,
  369. .start = gic_spi(85),
  370. .flags = IORESOURCE_IRQ,
  371. },
  372. };
  373. static struct platform_device sdhi0_device = {
  374. .name = "sh_mobile_sdhi",
  375. .id = 0,
  376. .num_resources = ARRAY_SIZE(sdhi0_resources),
  377. .resource = sdhi0_resources,
  378. .dev = {
  379. .platform_data = &sdhi0_info,
  380. },
  381. };
  382. void ag5evm_sdhi1_set_pwr(struct platform_device *pdev, int state)
  383. {
  384. gpio_set_value(GPIO_PORT114, state);
  385. }
  386. static struct sh_mobile_sdhi_info sh_sdhi1_info = {
  387. .tmio_flags = TMIO_MMC_WRPROTECT_DISABLE | TMIO_MMC_HAS_IDLE_WAIT,
  388. .tmio_caps = MMC_CAP_NONREMOVABLE | MMC_CAP_SDIO_IRQ,
  389. .tmio_ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34,
  390. .set_pwr = ag5evm_sdhi1_set_pwr,
  391. };
  392. static struct resource sdhi1_resources[] = {
  393. [0] = {
  394. .name = "SDHI1",
  395. .start = 0xee120000,
  396. .end = 0xee1200ff,
  397. .flags = IORESOURCE_MEM,
  398. },
  399. [1] = {
  400. .name = SH_MOBILE_SDHI_IRQ_CARD_DETECT,
  401. .start = gic_spi(87),
  402. .flags = IORESOURCE_IRQ,
  403. },
  404. [2] = {
  405. .name = SH_MOBILE_SDHI_IRQ_SDCARD,
  406. .start = gic_spi(88),
  407. .flags = IORESOURCE_IRQ,
  408. },
  409. [3] = {
  410. .name = SH_MOBILE_SDHI_IRQ_SDIO,
  411. .start = gic_spi(89),
  412. .flags = IORESOURCE_IRQ,
  413. },
  414. };
  415. static struct platform_device sdhi1_device = {
  416. .name = "sh_mobile_sdhi",
  417. .id = 1,
  418. .dev = {
  419. .platform_data = &sh_sdhi1_info,
  420. },
  421. .num_resources = ARRAY_SIZE(sdhi1_resources),
  422. .resource = sdhi1_resources,
  423. };
  424. static struct platform_device *ag5evm_devices[] __initdata = {
  425. &eth_device,
  426. &keysc_device,
  427. &fsi_device,
  428. &mmc_device,
  429. &irda_device,
  430. &lcdc0_device,
  431. &mipidsi0_device,
  432. &sdhi0_device,
  433. &sdhi1_device,
  434. };
  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. /* enable SDHI0 on CN15 [SD I/F] */
  506. gpio_request(GPIO_FN_SDHICD0, NULL);
  507. gpio_request(GPIO_FN_SDHIWP0, NULL);
  508. gpio_request(GPIO_FN_SDHICMD0, NULL);
  509. gpio_request(GPIO_FN_SDHICLK0, NULL);
  510. gpio_request(GPIO_FN_SDHID0_3, NULL);
  511. gpio_request(GPIO_FN_SDHID0_2, NULL);
  512. gpio_request(GPIO_FN_SDHID0_1, NULL);
  513. gpio_request(GPIO_FN_SDHID0_0, NULL);
  514. if (!request_irq(intcs_evt2irq(0x3c0), ag5evm_sdhi0_gpio_cd,
  515. IRQF_TRIGGER_FALLING | IRQF_TRIGGER_RISING,
  516. "sdhi0 cd", &sdhi0_device.dev))
  517. sdhi0_info.tmio_flags |= TMIO_MMC_HAS_COLD_CD;
  518. else
  519. pr_warn("Unable to setup SDHI0 GPIO IRQ\n");
  520. /* enable SDHI1 on CN4 [WLAN I/F] */
  521. gpio_request(GPIO_FN_SDHICLK1, NULL);
  522. gpio_request(GPIO_FN_SDHICMD1_PU, NULL);
  523. gpio_request(GPIO_FN_SDHID1_3_PU, NULL);
  524. gpio_request(GPIO_FN_SDHID1_2_PU, NULL);
  525. gpio_request(GPIO_FN_SDHID1_1_PU, NULL);
  526. gpio_request(GPIO_FN_SDHID1_0_PU, NULL);
  527. gpio_request(GPIO_PORT114, "sdhi1_power");
  528. gpio_direction_output(GPIO_PORT114, 0);
  529. #ifdef CONFIG_CACHE_L2X0
  530. /* Shared attribute override enable, 64K*8way */
  531. l2x0_init(__io(0xf0100000), 0x00460000, 0xc2000fff);
  532. #endif
  533. sh73a0_add_standard_devices();
  534. platform_add_devices(ag5evm_devices, ARRAY_SIZE(ag5evm_devices));
  535. }
  536. MACHINE_START(AG5EVM, "ag5evm")
  537. .map_io = sh73a0_map_io,
  538. .init_early = sh73a0_add_early_devices,
  539. .nr_irqs = NR_IRQS_LEGACY,
  540. .init_irq = sh73a0_init_irq,
  541. .handle_irq = gic_handle_irq,
  542. .init_machine = ag5evm_init,
  543. .timer = &shmobile_timer,
  544. MACHINE_END