board-ag5evm.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639
  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/pinctrl/machine.h>
  26. #include <linux/pinctrl/pinconf-generic.h>
  27. #include <linux/platform_device.h>
  28. #include <linux/delay.h>
  29. #include <linux/io.h>
  30. #include <linux/dma-mapping.h>
  31. #include <linux/regulator/fixed.h>
  32. #include <linux/regulator/machine.h>
  33. #include <linux/serial_sci.h>
  34. #include <linux/smsc911x.h>
  35. #include <linux/gpio.h>
  36. #include <linux/videodev2.h>
  37. #include <linux/input.h>
  38. #include <linux/input/sh_keysc.h>
  39. #include <linux/mmc/host.h>
  40. #include <linux/mmc/sh_mmcif.h>
  41. #include <linux/mmc/sh_mobile_sdhi.h>
  42. #include <linux/mfd/tmio.h>
  43. #include <linux/platform_data/bd6107.h>
  44. #include <linux/sh_clk.h>
  45. #include <linux/irqchip/arm-gic.h>
  46. #include <video/sh_mobile_lcdc.h>
  47. #include <video/sh_mipi_dsi.h>
  48. #include <sound/sh_fsi.h>
  49. #include <mach/hardware.h>
  50. #include <mach/irqs.h>
  51. #include <mach/sh73a0.h>
  52. #include <mach/common.h>
  53. #include <asm/mach-types.h>
  54. #include <asm/mach/arch.h>
  55. #include <asm/hardware/cache-l2x0.h>
  56. #include <asm/traps.h>
  57. /* Dummy supplies, where voltage doesn't matter */
  58. static struct regulator_consumer_supply dummy_supplies[] = {
  59. REGULATOR_SUPPLY("vddvario", "smsc911x"),
  60. REGULATOR_SUPPLY("vdd33a", "smsc911x"),
  61. };
  62. static struct resource smsc9220_resources[] = {
  63. [0] = {
  64. .start = 0x14000000,
  65. .end = 0x14000000 + SZ_64K - 1,
  66. .flags = IORESOURCE_MEM,
  67. },
  68. [1] = {
  69. .start = SH73A0_PINT0_IRQ(2), /* PINTA2 */
  70. .flags = IORESOURCE_IRQ,
  71. },
  72. };
  73. static struct smsc911x_platform_config smsc9220_platdata = {
  74. .flags = SMSC911X_USE_32BIT | SMSC911X_SAVE_MAC_ADDRESS,
  75. .phy_interface = PHY_INTERFACE_MODE_MII,
  76. .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
  77. .irq_type = SMSC911X_IRQ_TYPE_PUSH_PULL,
  78. };
  79. static struct platform_device eth_device = {
  80. .name = "smsc911x",
  81. .id = 0,
  82. .dev = {
  83. .platform_data = &smsc9220_platdata,
  84. },
  85. .resource = smsc9220_resources,
  86. .num_resources = ARRAY_SIZE(smsc9220_resources),
  87. };
  88. static struct sh_keysc_info keysc_platdata = {
  89. .mode = SH_KEYSC_MODE_6,
  90. .scan_timing = 3,
  91. .delay = 100,
  92. .keycodes = {
  93. KEY_A, KEY_B, KEY_C, KEY_D, KEY_E, KEY_F, KEY_G,
  94. KEY_H, KEY_I, KEY_J, KEY_K, KEY_L, KEY_M, KEY_N,
  95. KEY_O, KEY_P, KEY_Q, KEY_R, KEY_S, KEY_T, KEY_U,
  96. KEY_V, KEY_W, KEY_X, KEY_Y, KEY_Z, KEY_HOME, KEY_SLEEP,
  97. KEY_SPACE, KEY_9, KEY_6, KEY_3, KEY_WAKEUP, KEY_RIGHT, \
  98. KEY_COFFEE,
  99. KEY_0, KEY_8, KEY_5, KEY_2, KEY_DOWN, KEY_ENTER, KEY_UP,
  100. KEY_KPASTERISK, KEY_7, KEY_4, KEY_1, KEY_STOP, KEY_LEFT, \
  101. KEY_COMPUTER,
  102. },
  103. };
  104. static struct resource keysc_resources[] = {
  105. [0] = {
  106. .name = "KEYSC",
  107. .start = 0xe61b0000,
  108. .end = 0xe61b0098 - 1,
  109. .flags = IORESOURCE_MEM,
  110. },
  111. [1] = {
  112. .start = gic_spi(71),
  113. .flags = IORESOURCE_IRQ,
  114. },
  115. };
  116. static struct platform_device keysc_device = {
  117. .name = "sh_keysc",
  118. .id = 0,
  119. .num_resources = ARRAY_SIZE(keysc_resources),
  120. .resource = keysc_resources,
  121. .dev = {
  122. .platform_data = &keysc_platdata,
  123. },
  124. };
  125. /* FSI A */
  126. static struct resource fsi_resources[] = {
  127. [0] = {
  128. .name = "FSI",
  129. .start = 0xEC230000,
  130. .end = 0xEC230400 - 1,
  131. .flags = IORESOURCE_MEM,
  132. },
  133. [1] = {
  134. .start = gic_spi(146),
  135. .flags = IORESOURCE_IRQ,
  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. /* Fixed 1.8V regulator to be used by MMCIF */
  145. static struct regulator_consumer_supply fixed1v8_power_consumers[] =
  146. {
  147. REGULATOR_SUPPLY("vmmc", "sh_mmcif.0"),
  148. REGULATOR_SUPPLY("vqmmc", "sh_mmcif.0"),
  149. };
  150. static struct resource sh_mmcif_resources[] = {
  151. [0] = {
  152. .name = "MMCIF",
  153. .start = 0xe6bd0000,
  154. .end = 0xe6bd00ff,
  155. .flags = IORESOURCE_MEM,
  156. },
  157. [1] = {
  158. .start = gic_spi(141),
  159. .flags = IORESOURCE_IRQ,
  160. },
  161. [2] = {
  162. .start = gic_spi(140),
  163. .flags = IORESOURCE_IRQ,
  164. },
  165. };
  166. static struct sh_mmcif_plat_data sh_mmcif_platdata = {
  167. .sup_pclk = 0,
  168. .ocr = MMC_VDD_165_195,
  169. .caps = MMC_CAP_8_BIT_DATA | MMC_CAP_NONREMOVABLE,
  170. .slave_id_tx = SHDMA_SLAVE_MMCIF_TX,
  171. .slave_id_rx = SHDMA_SLAVE_MMCIF_RX,
  172. };
  173. static struct platform_device mmc_device = {
  174. .name = "sh_mmcif",
  175. .id = 0,
  176. .dev = {
  177. .dma_mask = NULL,
  178. .coherent_dma_mask = 0xffffffff,
  179. .platform_data = &sh_mmcif_platdata,
  180. },
  181. .num_resources = ARRAY_SIZE(sh_mmcif_resources),
  182. .resource = sh_mmcif_resources,
  183. };
  184. /* IrDA */
  185. static struct resource irda_resources[] = {
  186. [0] = {
  187. .start = 0xE6D00000,
  188. .end = 0xE6D01FD4 - 1,
  189. .flags = IORESOURCE_MEM,
  190. },
  191. [1] = {
  192. .start = gic_spi(95),
  193. .flags = IORESOURCE_IRQ,
  194. },
  195. };
  196. static struct platform_device irda_device = {
  197. .name = "sh_irda",
  198. .id = 0,
  199. .resource = irda_resources,
  200. .num_resources = ARRAY_SIZE(irda_resources),
  201. };
  202. /* MIPI-DSI */
  203. static struct resource mipidsi0_resources[] = {
  204. [0] = {
  205. .name = "DSI0",
  206. .start = 0xfeab0000,
  207. .end = 0xfeab3fff,
  208. .flags = IORESOURCE_MEM,
  209. },
  210. [1] = {
  211. .name = "DSI0",
  212. .start = 0xfeab4000,
  213. .end = 0xfeab7fff,
  214. .flags = IORESOURCE_MEM,
  215. },
  216. };
  217. static int sh_mipi_set_dot_clock(struct platform_device *pdev,
  218. void __iomem *base,
  219. int enable)
  220. {
  221. struct clk *pck, *phy;
  222. int ret;
  223. pck = clk_get(&pdev->dev, "dsip_clk");
  224. if (IS_ERR(pck)) {
  225. ret = PTR_ERR(pck);
  226. goto sh_mipi_set_dot_clock_pck_err;
  227. }
  228. phy = clk_get(&pdev->dev, "dsiphy_clk");
  229. if (IS_ERR(phy)) {
  230. ret = PTR_ERR(phy);
  231. goto sh_mipi_set_dot_clock_phy_err;
  232. }
  233. if (enable) {
  234. clk_set_rate(pck, clk_round_rate(pck, 24000000));
  235. clk_set_rate(phy, clk_round_rate(pck, 510000000));
  236. clk_enable(pck);
  237. clk_enable(phy);
  238. } else {
  239. clk_disable(pck);
  240. clk_disable(phy);
  241. }
  242. ret = 0;
  243. clk_put(phy);
  244. sh_mipi_set_dot_clock_phy_err:
  245. clk_put(pck);
  246. sh_mipi_set_dot_clock_pck_err:
  247. return ret;
  248. }
  249. static struct sh_mipi_dsi_info mipidsi0_info = {
  250. .data_format = MIPI_RGB888,
  251. .channel = LCDC_CHAN_MAINLCD,
  252. .lane = 2,
  253. .vsynw_offset = 20,
  254. .clksrc = 1,
  255. .flags = SH_MIPI_DSI_HSABM |
  256. SH_MIPI_DSI_SYNC_PULSES_MODE |
  257. SH_MIPI_DSI_HSbyteCLK,
  258. .set_dot_clock = sh_mipi_set_dot_clock,
  259. };
  260. static struct platform_device mipidsi0_device = {
  261. .name = "sh-mipi-dsi",
  262. .num_resources = ARRAY_SIZE(mipidsi0_resources),
  263. .resource = mipidsi0_resources,
  264. .id = 0,
  265. .dev = {
  266. .platform_data = &mipidsi0_info,
  267. },
  268. };
  269. /* LCDC0 and backlight */
  270. static const struct fb_videomode lcdc0_modes[] = {
  271. {
  272. .name = "R63302(QHD)",
  273. .xres = 544,
  274. .yres = 961,
  275. .left_margin = 72,
  276. .right_margin = 600,
  277. .hsync_len = 16,
  278. .upper_margin = 8,
  279. .lower_margin = 8,
  280. .vsync_len = 2,
  281. .sync = FB_SYNC_VERT_HIGH_ACT | FB_SYNC_HOR_HIGH_ACT,
  282. },
  283. };
  284. static struct sh_mobile_lcdc_info lcdc0_info = {
  285. .clock_source = LCDC_CLK_PERIPHERAL,
  286. .ch[0] = {
  287. .chan = LCDC_CHAN_MAINLCD,
  288. .interface_type = RGB24,
  289. .clock_divider = 1,
  290. .flags = LCDC_FLAGS_DWPOL,
  291. .fourcc = V4L2_PIX_FMT_RGB565,
  292. .lcd_modes = lcdc0_modes,
  293. .num_modes = ARRAY_SIZE(lcdc0_modes),
  294. .panel_cfg = {
  295. .width = 44,
  296. .height = 79,
  297. },
  298. .tx_dev = &mipidsi0_device,
  299. }
  300. };
  301. static struct resource lcdc0_resources[] = {
  302. [0] = {
  303. .name = "LCDC0",
  304. .start = 0xfe940000, /* P4-only space */
  305. .end = 0xfe943fff,
  306. .flags = IORESOURCE_MEM,
  307. },
  308. [1] = {
  309. .start = intcs_evt2irq(0x580),
  310. .flags = IORESOURCE_IRQ,
  311. },
  312. };
  313. static struct platform_device lcdc0_device = {
  314. .name = "sh_mobile_lcdc_fb",
  315. .num_resources = ARRAY_SIZE(lcdc0_resources),
  316. .resource = lcdc0_resources,
  317. .id = 0,
  318. .dev = {
  319. .platform_data = &lcdc0_info,
  320. .coherent_dma_mask = ~0,
  321. },
  322. };
  323. static struct bd6107_platform_data backlight_data = {
  324. .fbdev = &lcdc0_device.dev,
  325. .reset = 235,
  326. .def_value = 0,
  327. };
  328. static struct i2c_board_info backlight_board_info = {
  329. I2C_BOARD_INFO("bd6107", 0x6d),
  330. .platform_data = &backlight_data,
  331. };
  332. /* Fixed 2.8V regulators to be used by SDHI0 */
  333. static struct regulator_consumer_supply fixed2v8_power_consumers[] =
  334. {
  335. REGULATOR_SUPPLY("vmmc", "sh_mobile_sdhi.0"),
  336. REGULATOR_SUPPLY("vqmmc", "sh_mobile_sdhi.0"),
  337. };
  338. /* SDHI0 */
  339. static struct sh_mobile_sdhi_info sdhi0_info = {
  340. .dma_slave_tx = SHDMA_SLAVE_SDHI0_TX,
  341. .dma_slave_rx = SHDMA_SLAVE_SDHI0_RX,
  342. .tmio_flags = TMIO_MMC_HAS_IDLE_WAIT | TMIO_MMC_USE_GPIO_CD,
  343. .tmio_caps = MMC_CAP_SD_HIGHSPEED,
  344. .tmio_ocr_mask = MMC_VDD_27_28 | MMC_VDD_28_29,
  345. .cd_gpio = 251,
  346. };
  347. static struct resource sdhi0_resources[] = {
  348. [0] = {
  349. .name = "SDHI0",
  350. .start = 0xee100000,
  351. .end = 0xee1000ff,
  352. .flags = IORESOURCE_MEM,
  353. },
  354. [1] = {
  355. .name = SH_MOBILE_SDHI_IRQ_CARD_DETECT,
  356. .start = gic_spi(83),
  357. .flags = IORESOURCE_IRQ,
  358. },
  359. [2] = {
  360. .name = SH_MOBILE_SDHI_IRQ_SDCARD,
  361. .start = gic_spi(84),
  362. .flags = IORESOURCE_IRQ,
  363. },
  364. [3] = {
  365. .name = SH_MOBILE_SDHI_IRQ_SDIO,
  366. .start = gic_spi(85),
  367. .flags = IORESOURCE_IRQ,
  368. },
  369. };
  370. static struct platform_device sdhi0_device = {
  371. .name = "sh_mobile_sdhi",
  372. .id = 0,
  373. .num_resources = ARRAY_SIZE(sdhi0_resources),
  374. .resource = sdhi0_resources,
  375. .dev = {
  376. .platform_data = &sdhi0_info,
  377. },
  378. };
  379. /* Fixed 3.3V regulator to be used by SDHI1 */
  380. static struct regulator_consumer_supply cn4_power_consumers[] =
  381. {
  382. REGULATOR_SUPPLY("vmmc", "sh_mobile_sdhi.1"),
  383. REGULATOR_SUPPLY("vqmmc", "sh_mobile_sdhi.1"),
  384. };
  385. static struct regulator_init_data cn4_power_init_data = {
  386. .constraints = {
  387. .valid_ops_mask = REGULATOR_CHANGE_STATUS,
  388. },
  389. .num_consumer_supplies = ARRAY_SIZE(cn4_power_consumers),
  390. .consumer_supplies = cn4_power_consumers,
  391. };
  392. static struct fixed_voltage_config cn4_power_info = {
  393. .supply_name = "CN4 SD/MMC Vdd",
  394. .microvolts = 3300000,
  395. .gpio = 114,
  396. .enable_high = 1,
  397. .init_data = &cn4_power_init_data,
  398. };
  399. static struct platform_device cn4_power = {
  400. .name = "reg-fixed-voltage",
  401. .id = 2,
  402. .dev = {
  403. .platform_data = &cn4_power_info,
  404. },
  405. };
  406. static void ag5evm_sdhi1_set_pwr(struct platform_device *pdev, int state)
  407. {
  408. static int power_gpio = -EINVAL;
  409. if (power_gpio < 0) {
  410. int ret = gpio_request_one(114, GPIOF_OUT_INIT_LOW,
  411. "sdhi1_power");
  412. if (!ret)
  413. power_gpio = 114;
  414. }
  415. /*
  416. * If requesting the GPIO above failed, it means, that the regulator got
  417. * probed and grabbed the GPIO, but we don't know, whether the sdhi
  418. * driver already uses the regulator. If it doesn't, we have to toggle
  419. * the GPIO ourselves, even though it is now owned by the fixed
  420. * regulator driver. We have to live with the race in case the driver
  421. * gets unloaded and the GPIO freed between these two steps.
  422. */
  423. gpio_set_value(114, state);
  424. }
  425. static struct sh_mobile_sdhi_info sh_sdhi1_info = {
  426. .tmio_flags = TMIO_MMC_WRPROTECT_DISABLE | TMIO_MMC_HAS_IDLE_WAIT,
  427. .tmio_caps = MMC_CAP_NONREMOVABLE | MMC_CAP_SDIO_IRQ,
  428. .tmio_ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34,
  429. .set_pwr = ag5evm_sdhi1_set_pwr,
  430. };
  431. static struct resource sdhi1_resources[] = {
  432. [0] = {
  433. .name = "SDHI1",
  434. .start = 0xee120000,
  435. .end = 0xee1200ff,
  436. .flags = IORESOURCE_MEM,
  437. },
  438. [1] = {
  439. .name = SH_MOBILE_SDHI_IRQ_CARD_DETECT,
  440. .start = gic_spi(87),
  441. .flags = IORESOURCE_IRQ,
  442. },
  443. [2] = {
  444. .name = SH_MOBILE_SDHI_IRQ_SDCARD,
  445. .start = gic_spi(88),
  446. .flags = IORESOURCE_IRQ,
  447. },
  448. [3] = {
  449. .name = SH_MOBILE_SDHI_IRQ_SDIO,
  450. .start = gic_spi(89),
  451. .flags = IORESOURCE_IRQ,
  452. },
  453. };
  454. static struct platform_device sdhi1_device = {
  455. .name = "sh_mobile_sdhi",
  456. .id = 1,
  457. .dev = {
  458. .platform_data = &sh_sdhi1_info,
  459. },
  460. .num_resources = ARRAY_SIZE(sdhi1_resources),
  461. .resource = sdhi1_resources,
  462. };
  463. static struct platform_device *ag5evm_devices[] __initdata = {
  464. &cn4_power,
  465. &eth_device,
  466. &keysc_device,
  467. &fsi_device,
  468. &mmc_device,
  469. &irda_device,
  470. &mipidsi0_device,
  471. &lcdc0_device,
  472. &sdhi0_device,
  473. &sdhi1_device,
  474. };
  475. static unsigned long pin_pullup_conf[] = {
  476. PIN_CONF_PACKED(PIN_CONFIG_BIAS_PULL_UP, 0),
  477. };
  478. static const struct pinctrl_map ag5evm_pinctrl_map[] = {
  479. /* FSIA */
  480. PIN_MAP_MUX_GROUP_DEFAULT("sh_fsi2.0", "pfc-sh73a0",
  481. "fsia_mclk_in", "fsia"),
  482. PIN_MAP_MUX_GROUP_DEFAULT("sh_fsi2.0", "pfc-sh73a0",
  483. "fsia_sclk_in", "fsia"),
  484. PIN_MAP_MUX_GROUP_DEFAULT("sh_fsi2.0", "pfc-sh73a0",
  485. "fsia_data_in", "fsia"),
  486. PIN_MAP_MUX_GROUP_DEFAULT("sh_fsi2.0", "pfc-sh73a0",
  487. "fsia_data_out", "fsia"),
  488. /* I2C2 & I2C3 */
  489. PIN_MAP_MUX_GROUP_DEFAULT("i2c-sh_mobile.2", "pfc-sh73a0",
  490. "i2c2_0", "i2c2"),
  491. PIN_MAP_MUX_GROUP_DEFAULT("i2c-sh_mobile.3", "pfc-sh73a0",
  492. "i2c3_0", "i2c3"),
  493. /* IrDA */
  494. PIN_MAP_MUX_GROUP_DEFAULT("sh_irda.0", "pfc-sh73a0",
  495. "irda_0", "irda"),
  496. /* KEYSC */
  497. PIN_MAP_MUX_GROUP_DEFAULT("sh_keysc.0", "pfc-sh73a0",
  498. "keysc_in8", "keysc"),
  499. PIN_MAP_MUX_GROUP_DEFAULT("sh_keysc.0", "pfc-sh73a0",
  500. "keysc_out04", "keysc"),
  501. PIN_MAP_MUX_GROUP_DEFAULT("sh_keysc.0", "pfc-sh73a0",
  502. "keysc_out5", "keysc"),
  503. PIN_MAP_MUX_GROUP_DEFAULT("sh_keysc.0", "pfc-sh73a0",
  504. "keysc_out6_0", "keysc"),
  505. PIN_MAP_MUX_GROUP_DEFAULT("sh_keysc.0", "pfc-sh73a0",
  506. "keysc_out7_0", "keysc"),
  507. PIN_MAP_MUX_GROUP_DEFAULT("sh_keysc.0", "pfc-sh73a0",
  508. "keysc_out8_0", "keysc"),
  509. PIN_MAP_MUX_GROUP_DEFAULT("sh_keysc.0", "pfc-sh73a0",
  510. "keysc_out9_2", "keysc"),
  511. PIN_MAP_CONFIGS_GROUP_DEFAULT("sh_keysc.0", "pfc-sh73a0",
  512. "keysc_in8", pin_pullup_conf),
  513. /* MMCIF */
  514. PIN_MAP_MUX_GROUP_DEFAULT("sh_mmcif.0", "pfc-sh73a0",
  515. "mmc0_data8_0", "mmc0"),
  516. PIN_MAP_MUX_GROUP_DEFAULT("sh_mmcif.0", "pfc-sh73a0",
  517. "mmc0_ctrl_0", "mmc0"),
  518. PIN_MAP_CONFIGS_PIN_DEFAULT("sh_mmcif.0", "pfc-sh73a0",
  519. "PORT279", pin_pullup_conf),
  520. PIN_MAP_CONFIGS_GROUP_DEFAULT("sh_mmcif.0", "pfc-sh73a0",
  521. "mmc0_data8_0", pin_pullup_conf),
  522. /* SCIFA2 */
  523. PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.2", "pfc-sh73a0",
  524. "scifa2_data_0", "scifa2"),
  525. PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.2", "pfc-sh73a0",
  526. "scifa2_ctrl_0", "scifa2"),
  527. /* SDHI0 (CN15 [SD I/F]) */
  528. PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-sh73a0",
  529. "sdhi0_data4", "sdhi0"),
  530. PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-sh73a0",
  531. "sdhi0_ctrl", "sdhi0"),
  532. PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-sh73a0",
  533. "sdhi0_wp", "sdhi0"),
  534. /* SDHI1 (CN4 [WLAN I/F]) */
  535. PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.1", "pfc-sh73a0",
  536. "sdhi1_data4", "sdhi1"),
  537. PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.1", "pfc-sh73a0",
  538. "sdhi1_ctrl", "sdhi1"),
  539. PIN_MAP_CONFIGS_GROUP_DEFAULT("sh_mobile_sdhi.1", "pfc-sh73a0",
  540. "sdhi1_data4", pin_pullup_conf),
  541. PIN_MAP_CONFIGS_PIN_DEFAULT("sh_mobile_sdhi.1", "pfc-sh73a0",
  542. "PORT263", pin_pullup_conf),
  543. };
  544. static void __init ag5evm_init(void)
  545. {
  546. regulator_register_always_on(0, "fixed-1.8V", fixed1v8_power_consumers,
  547. ARRAY_SIZE(fixed1v8_power_consumers), 1800000);
  548. regulator_register_always_on(1, "fixed-2.8V", fixed2v8_power_consumers,
  549. ARRAY_SIZE(fixed2v8_power_consumers), 3300000);
  550. regulator_register_fixed(3, dummy_supplies, ARRAY_SIZE(dummy_supplies));
  551. pinctrl_register_mappings(ag5evm_pinctrl_map,
  552. ARRAY_SIZE(ag5evm_pinctrl_map));
  553. sh73a0_pinmux_init();
  554. /* enable MMCIF */
  555. gpio_request_one(208, GPIOF_OUT_INIT_HIGH, NULL); /* Reset */
  556. /* enable SMSC911X */
  557. gpio_request_one(144, GPIOF_IN, NULL); /* PINTA2 */
  558. gpio_request_one(145, GPIOF_OUT_INIT_HIGH, NULL); /* RESET */
  559. /* LCD panel */
  560. gpio_request_one(217, GPIOF_OUT_INIT_LOW, NULL); /* RESET */
  561. mdelay(1);
  562. gpio_set_value(217, 1);
  563. mdelay(100);
  564. #ifdef CONFIG_CACHE_L2X0
  565. /* Shared attribute override enable, 64K*8way */
  566. l2x0_init(IOMEM(0xf0100000), 0x00460000, 0xc2000fff);
  567. #endif
  568. sh73a0_add_standard_devices();
  569. i2c_register_board_info(1, &backlight_board_info, 1);
  570. platform_add_devices(ag5evm_devices, ARRAY_SIZE(ag5evm_devices));
  571. }
  572. MACHINE_START(AG5EVM, "ag5evm")
  573. .smp = smp_ops(sh73a0_smp_ops),
  574. .map_io = sh73a0_map_io,
  575. .init_early = sh73a0_add_early_devices,
  576. .nr_irqs = NR_IRQS_LEGACY,
  577. .init_irq = sh73a0_init_irq,
  578. .init_machine = ag5evm_init,
  579. .init_late = shmobile_init_late,
  580. .init_time = sh73a0_earlytimer_init,
  581. MACHINE_END