board-kota2.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550
  1. /*
  2. * kota2 board support
  3. *
  4. * Copyright (C) 2011 Renesas Solutions Corp.
  5. * Copyright (C) 2011 Magnus Damm
  6. * Copyright (C) 2010 Takashi Yoshii <yoshii.takashi.zj@renesas.com>
  7. * Copyright (C) 2009 Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com>
  8. *
  9. * This program is free software; you can redistribute it and/or modify
  10. * it under the terms of the GNU General Public License as published by
  11. * the Free Software Foundation; version 2 of the License.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program; if not, write to the Free Software
  20. * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  21. */
  22. #include <linux/kernel.h>
  23. #include <linux/init.h>
  24. #include <linux/interrupt.h>
  25. #include <linux/irq.h>
  26. #include <linux/pinctrl/machine.h>
  27. #include <linux/pinctrl/pinconf-generic.h>
  28. #include <linux/platform_data/pwm-renesas-tpu.h>
  29. #include <linux/platform_device.h>
  30. #include <linux/delay.h>
  31. #include <linux/io.h>
  32. #include <linux/regulator/fixed.h>
  33. #include <linux/regulator/machine.h>
  34. #include <linux/smsc911x.h>
  35. #include <linux/gpio.h>
  36. #include <linux/input.h>
  37. #include <linux/input/sh_keysc.h>
  38. #include <linux/gpio_keys.h>
  39. #include <linux/leds.h>
  40. #include <linux/leds_pwm.h>
  41. #include <linux/irqchip/arm-gic.h>
  42. #include <linux/mmc/host.h>
  43. #include <linux/mmc/sh_mmcif.h>
  44. #include <linux/mfd/tmio.h>
  45. #include <linux/mmc/sh_mobile_sdhi.h>
  46. #include <mach/hardware.h>
  47. #include <mach/irqs.h>
  48. #include <mach/sh73a0.h>
  49. #include <mach/common.h>
  50. #include <asm/mach-types.h>
  51. #include <asm/mach/arch.h>
  52. #include <asm/mach/time.h>
  53. #include <asm/hardware/cache-l2x0.h>
  54. #include <asm/traps.h>
  55. /* Dummy supplies, where voltage doesn't matter */
  56. static struct regulator_consumer_supply dummy_supplies[] = {
  57. REGULATOR_SUPPLY("vddvario", "smsc911x"),
  58. REGULATOR_SUPPLY("vdd33a", "smsc911x"),
  59. };
  60. /* SMSC 9220 */
  61. static struct resource smsc9220_resources[] = {
  62. [0] = {
  63. .start = 0x14000000, /* CS5A */
  64. .end = 0x140000ff, /* A1->A7 */
  65. .flags = IORESOURCE_MEM,
  66. },
  67. [1] = {
  68. .start = SH73A0_PINT0_IRQ(2), /* PINTA2 */
  69. .flags = IORESOURCE_IRQ,
  70. },
  71. };
  72. static struct smsc911x_platform_config smsc9220_platdata = {
  73. .flags = SMSC911X_USE_32BIT, /* 32-bit SW on 16-bit HW bus */
  74. .phy_interface = PHY_INTERFACE_MODE_MII,
  75. .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
  76. .irq_type = SMSC911X_IRQ_TYPE_PUSH_PULL,
  77. };
  78. static struct platform_device eth_device = {
  79. .name = "smsc911x",
  80. .id = 0,
  81. .dev = {
  82. .platform_data = &smsc9220_platdata,
  83. },
  84. .resource = smsc9220_resources,
  85. .num_resources = ARRAY_SIZE(smsc9220_resources),
  86. };
  87. /* KEYSC */
  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_NUMERIC_STAR, KEY_NUMERIC_0, KEY_NUMERIC_POUND,
  94. 0, 0, 0, 0, 0,
  95. KEY_NUMERIC_7, KEY_NUMERIC_8, KEY_NUMERIC_9,
  96. 0, KEY_DOWN, 0, 0, 0,
  97. KEY_NUMERIC_4, KEY_NUMERIC_5, KEY_NUMERIC_6,
  98. KEY_LEFT, KEY_ENTER, KEY_RIGHT, 0, 0,
  99. KEY_NUMERIC_1, KEY_NUMERIC_2, KEY_NUMERIC_3,
  100. 0, KEY_UP, 0, 0, 0,
  101. 0, 0, 0, 0, 0, 0, 0, 0,
  102. 0, 0, 0, 0, 0, 0, 0, 0,
  103. 0, 0, 0, 0, 0, 0, 0, 0,
  104. 0, 0, 0, 0, 0, 0, 0, 0,
  105. },
  106. };
  107. static struct resource keysc_resources[] = {
  108. [0] = {
  109. .name = "KEYSC",
  110. .start = 0xe61b0000,
  111. .end = 0xe61b0098 - 1,
  112. .flags = IORESOURCE_MEM,
  113. },
  114. [1] = {
  115. .start = gic_spi(71),
  116. .flags = IORESOURCE_IRQ,
  117. },
  118. };
  119. static struct platform_device keysc_device = {
  120. .name = "sh_keysc",
  121. .id = 0,
  122. .num_resources = ARRAY_SIZE(keysc_resources),
  123. .resource = keysc_resources,
  124. .dev = {
  125. .platform_data = &keysc_platdata,
  126. },
  127. };
  128. /* GPIO KEY */
  129. #define GPIO_KEY(c, g, d) { .code = c, .gpio = g, .desc = d, .active_low = 1 }
  130. static struct gpio_keys_button gpio_buttons[] = {
  131. GPIO_KEY(KEY_VOLUMEUP, 56, "+"), /* S2: VOL+ [IRQ9] */
  132. GPIO_KEY(KEY_VOLUMEDOWN, 54, "-"), /* S3: VOL- [IRQ10] */
  133. GPIO_KEY(KEY_MENU, 27, "Menu"), /* S4: MENU [IRQ30] */
  134. GPIO_KEY(KEY_HOMEPAGE, 26, "Home"), /* S5: HOME [IRQ31] */
  135. GPIO_KEY(KEY_BACK, 11, "Back"), /* S6: BACK [IRQ0] */
  136. GPIO_KEY(KEY_PHONE, 238, "Tel"), /* S7: TEL [IRQ11] */
  137. GPIO_KEY(KEY_POWER, 239, "C1"), /* S8: CAM [IRQ13] */
  138. GPIO_KEY(KEY_MAIL, 224, "Mail"), /* S9: MAIL [IRQ3] */
  139. /* Omitted button "C3?": 223 - S10: CUST [IRQ8] */
  140. GPIO_KEY(KEY_CAMERA, 164, "C2"), /* S11: CAM_HALF [IRQ25] */
  141. /* Omitted button "?": 152 - S12: CAM_FULL [No IRQ] */
  142. };
  143. static struct gpio_keys_platform_data gpio_key_info = {
  144. .buttons = gpio_buttons,
  145. .nbuttons = ARRAY_SIZE(gpio_buttons),
  146. };
  147. static struct platform_device gpio_keys_device = {
  148. .name = "gpio-keys",
  149. .id = -1,
  150. .dev = {
  151. .platform_data = &gpio_key_info,
  152. },
  153. };
  154. /* GPIO LED */
  155. #define GPIO_LED(n, g) { .name = n, .gpio = g }
  156. static struct gpio_led gpio_leds[] = {
  157. GPIO_LED("G", 20), /* PORT20 [GPO0] -> LED7 -> "G" */
  158. GPIO_LED("H", 21), /* PORT21 [GPO1] -> LED8 -> "H" */
  159. GPIO_LED("J", 22), /* PORT22 [GPO2] -> LED9 -> "J" */
  160. };
  161. static struct gpio_led_platform_data gpio_leds_info = {
  162. .leds = gpio_leds,
  163. .num_leds = ARRAY_SIZE(gpio_leds),
  164. };
  165. static struct platform_device gpio_leds_device = {
  166. .name = "leds-gpio",
  167. .id = -1,
  168. .dev = {
  169. .platform_data = &gpio_leds_info,
  170. },
  171. };
  172. /* TPU LED */
  173. static struct resource tpu1_pwm_resources[] = {
  174. [0] = {
  175. .start = 0xe6610000,
  176. .end = 0xe66100ff,
  177. .flags = IORESOURCE_MEM,
  178. },
  179. };
  180. static struct platform_device tpu1_pwm_device = {
  181. .name = "renesas-tpu-pwm",
  182. .id = 1,
  183. .num_resources = ARRAY_SIZE(tpu1_pwm_resources),
  184. .resource = tpu1_pwm_resources,
  185. };
  186. static struct resource tpu2_pwm_resources[] = {
  187. [0] = {
  188. .start = 0xe6620000,
  189. .end = 0xe66200ff,
  190. .flags = IORESOURCE_MEM,
  191. },
  192. };
  193. static struct platform_device tpu2_pwm_device = {
  194. .name = "renesas-tpu-pwm",
  195. .id = 2,
  196. .num_resources = ARRAY_SIZE(tpu2_pwm_resources),
  197. .resource = tpu2_pwm_resources,
  198. };
  199. static struct resource tpu3_pwm_resources[] = {
  200. [0] = {
  201. .start = 0xe6630000,
  202. .end = 0xe66300ff,
  203. .flags = IORESOURCE_MEM,
  204. },
  205. };
  206. static struct platform_device tpu3_pwm_device = {
  207. .name = "renesas-tpu-pwm",
  208. .id = 3,
  209. .num_resources = ARRAY_SIZE(tpu3_pwm_resources),
  210. .resource = tpu3_pwm_resources,
  211. };
  212. static struct resource tpu4_pwm_resources[] = {
  213. [0] = {
  214. .start = 0xe6640000,
  215. .end = 0xe66400ff,
  216. .flags = IORESOURCE_MEM,
  217. },
  218. };
  219. static struct platform_device tpu4_pwm_device = {
  220. .name = "renesas-tpu-pwm",
  221. .id = 4,
  222. .num_resources = ARRAY_SIZE(tpu4_pwm_resources),
  223. .resource = tpu4_pwm_resources,
  224. };
  225. static struct pwm_lookup pwm_lookup[] = {
  226. PWM_LOOKUP("renesas-tpu-pwm.1", 2, "leds-pwm.0", "V2513"),
  227. PWM_LOOKUP("renesas-tpu-pwm.2", 1, "leds-pwm.0", "V2515"),
  228. PWM_LOOKUP("renesas-tpu-pwm.3", 0, "leds-pwm.0", "KEYLED"),
  229. PWM_LOOKUP("renesas-tpu-pwm.4", 1, "leds-pwm.0", "V2514"),
  230. };
  231. static struct led_pwm tpu_pwm_leds[] = {
  232. {
  233. .name = "V2513",
  234. .max_brightness = 1000,
  235. }, {
  236. .name = "V2515",
  237. .max_brightness = 1000,
  238. }, {
  239. .name = "KEYLED",
  240. .max_brightness = 1000,
  241. }, {
  242. .name = "V2514",
  243. .max_brightness = 1000,
  244. },
  245. };
  246. static struct led_pwm_platform_data leds_pwm_pdata = {
  247. .num_leds = ARRAY_SIZE(tpu_pwm_leds),
  248. .leds = tpu_pwm_leds,
  249. };
  250. static struct platform_device leds_pwm_device = {
  251. .name = "leds-pwm",
  252. .id = 0,
  253. .dev = {
  254. .platform_data = &leds_pwm_pdata,
  255. },
  256. };
  257. /* Fixed 1.8V regulator to be used by MMCIF */
  258. static struct regulator_consumer_supply fixed1v8_power_consumers[] =
  259. {
  260. REGULATOR_SUPPLY("vmmc", "sh_mmcif.0"),
  261. REGULATOR_SUPPLY("vqmmc", "sh_mmcif.0"),
  262. };
  263. /* MMCIF */
  264. static struct resource mmcif_resources[] = {
  265. [0] = {
  266. .name = "MMCIF",
  267. .start = 0xe6bd0000,
  268. .end = 0xe6bd00ff,
  269. .flags = IORESOURCE_MEM,
  270. },
  271. [1] = {
  272. .start = gic_spi(140),
  273. .flags = IORESOURCE_IRQ,
  274. },
  275. [2] = {
  276. .start = gic_spi(141),
  277. .flags = IORESOURCE_IRQ,
  278. },
  279. };
  280. static struct sh_mmcif_plat_data mmcif_info = {
  281. .ocr = MMC_VDD_165_195,
  282. .caps = MMC_CAP_8_BIT_DATA | MMC_CAP_NONREMOVABLE,
  283. };
  284. static struct platform_device mmcif_device = {
  285. .name = "sh_mmcif",
  286. .id = 0,
  287. .dev = {
  288. .platform_data = &mmcif_info,
  289. },
  290. .num_resources = ARRAY_SIZE(mmcif_resources),
  291. .resource = mmcif_resources,
  292. };
  293. /* Fixed 3.3V regulator to be used by SDHI0 and SDHI1 */
  294. static struct regulator_consumer_supply fixed3v3_power_consumers[] =
  295. {
  296. REGULATOR_SUPPLY("vmmc", "sh_mobile_sdhi.0"),
  297. REGULATOR_SUPPLY("vqmmc", "sh_mobile_sdhi.0"),
  298. REGULATOR_SUPPLY("vmmc", "sh_mobile_sdhi.1"),
  299. REGULATOR_SUPPLY("vqmmc", "sh_mobile_sdhi.1"),
  300. };
  301. /* SDHI0 */
  302. static struct sh_mobile_sdhi_info sdhi0_info = {
  303. .tmio_caps = MMC_CAP_SD_HIGHSPEED,
  304. .tmio_flags = TMIO_MMC_WRPROTECT_DISABLE | TMIO_MMC_HAS_IDLE_WAIT,
  305. };
  306. static struct resource sdhi0_resources[] = {
  307. [0] = {
  308. .name = "SDHI0",
  309. .start = 0xee100000,
  310. .end = 0xee1000ff,
  311. .flags = IORESOURCE_MEM,
  312. },
  313. [1] = {
  314. .start = gic_spi(83),
  315. .flags = IORESOURCE_IRQ,
  316. },
  317. [2] = {
  318. .start = gic_spi(84),
  319. .flags = IORESOURCE_IRQ,
  320. },
  321. [3] = {
  322. .start = gic_spi(85),
  323. .flags = IORESOURCE_IRQ,
  324. },
  325. };
  326. static struct platform_device sdhi0_device = {
  327. .name = "sh_mobile_sdhi",
  328. .id = 0,
  329. .num_resources = ARRAY_SIZE(sdhi0_resources),
  330. .resource = sdhi0_resources,
  331. .dev = {
  332. .platform_data = &sdhi0_info,
  333. },
  334. };
  335. /* SDHI1 */
  336. static struct sh_mobile_sdhi_info sdhi1_info = {
  337. .tmio_caps = MMC_CAP_NONREMOVABLE | MMC_CAP_SDIO_IRQ,
  338. .tmio_flags = TMIO_MMC_WRPROTECT_DISABLE | TMIO_MMC_HAS_IDLE_WAIT,
  339. };
  340. static struct resource sdhi1_resources[] = {
  341. [0] = {
  342. .name = "SDHI1",
  343. .start = 0xee120000,
  344. .end = 0xee1200ff,
  345. .flags = IORESOURCE_MEM,
  346. },
  347. [1] = {
  348. .start = gic_spi(87),
  349. .flags = IORESOURCE_IRQ,
  350. },
  351. [2] = {
  352. .start = gic_spi(88),
  353. .flags = IORESOURCE_IRQ,
  354. },
  355. [3] = {
  356. .start = gic_spi(89),
  357. .flags = IORESOURCE_IRQ,
  358. },
  359. };
  360. static struct platform_device sdhi1_device = {
  361. .name = "sh_mobile_sdhi",
  362. .id = 1,
  363. .num_resources = ARRAY_SIZE(sdhi1_resources),
  364. .resource = sdhi1_resources,
  365. .dev = {
  366. .platform_data = &sdhi1_info,
  367. },
  368. };
  369. static struct platform_device *kota2_devices[] __initdata = {
  370. &eth_device,
  371. &keysc_device,
  372. &gpio_keys_device,
  373. &gpio_leds_device,
  374. &tpu1_pwm_device,
  375. &tpu2_pwm_device,
  376. &tpu3_pwm_device,
  377. &tpu4_pwm_device,
  378. &leds_pwm_device,
  379. &mmcif_device,
  380. &sdhi0_device,
  381. &sdhi1_device,
  382. };
  383. static unsigned long pin_pullup_conf[] = {
  384. PIN_CONF_PACKED(PIN_CONFIG_BIAS_PULL_UP, 0),
  385. };
  386. static const struct pinctrl_map kota2_pinctrl_map[] = {
  387. /* KEYSC */
  388. PIN_MAP_MUX_GROUP_DEFAULT("sh_keysc.0", "pfc-sh73a0",
  389. "keysc_in8", "keysc"),
  390. PIN_MAP_MUX_GROUP_DEFAULT("sh_keysc.0", "pfc-sh73a0",
  391. "keysc_out04", "keysc"),
  392. PIN_MAP_MUX_GROUP_DEFAULT("sh_keysc.0", "pfc-sh73a0",
  393. "keysc_out5", "keysc"),
  394. PIN_MAP_MUX_GROUP_DEFAULT("sh_keysc.0", "pfc-sh73a0",
  395. "keysc_out6_0", "keysc"),
  396. PIN_MAP_MUX_GROUP_DEFAULT("sh_keysc.0", "pfc-sh73a0",
  397. "keysc_out7_0", "keysc"),
  398. PIN_MAP_MUX_GROUP_DEFAULT("sh_keysc.0", "pfc-sh73a0",
  399. "keysc_out8_0", "keysc"),
  400. PIN_MAP_CONFIGS_GROUP_DEFAULT("sh_keysc.0", "pfc-sh73a0",
  401. "keysc_in8", pin_pullup_conf),
  402. /* MMCIF */
  403. PIN_MAP_MUX_GROUP_DEFAULT("sh_mmcif.0", "pfc-sh73a0",
  404. "mmc0_data8_0", "mmc0"),
  405. PIN_MAP_MUX_GROUP_DEFAULT("sh_mmcif.0", "pfc-sh73a0",
  406. "mmc0_ctrl_0", "mmc0"),
  407. PIN_MAP_CONFIGS_PIN_DEFAULT("sh_mmcif.0", "pfc-sh73a0",
  408. "PORT279", pin_pullup_conf),
  409. PIN_MAP_CONFIGS_GROUP_DEFAULT("sh_mmcif.0", "pfc-sh73a0",
  410. "mmc0_data8_0", pin_pullup_conf),
  411. /* SCIFA2 (UART2) */
  412. PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.2", "pfc-sh73a0",
  413. "scifa2_data_0", "scifa2"),
  414. PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.2", "pfc-sh73a0",
  415. "scifa2_ctrl_0", "scifa2"),
  416. /* SCIFA4 (UART1) */
  417. PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.4", "pfc-sh73a0",
  418. "scifa4_data", "scifa4"),
  419. PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.4", "pfc-sh73a0",
  420. "scifa4_ctrl", "scifa4"),
  421. /* SCIFB (BT) */
  422. PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.8", "pfc-sh73a0",
  423. "scifb_data_0", "scifb"),
  424. PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.8", "pfc-sh73a0",
  425. "scifb_clk_0", "scifb"),
  426. PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.8", "pfc-sh73a0",
  427. "scifb_ctrl_0", "scifb"),
  428. /* SDHI0 (microSD) */
  429. PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-sh73a0",
  430. "sdhi0_data4", "sdhi0"),
  431. PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-sh73a0",
  432. "sdhi0_ctrl", "sdhi0"),
  433. PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-sh73a0",
  434. "sdhi0_cd", "sdhi0"),
  435. PIN_MAP_CONFIGS_GROUP_DEFAULT("sh_mobile_sdhi.0", "pfc-sh73a0",
  436. "sdhi0_data4", pin_pullup_conf),
  437. PIN_MAP_CONFIGS_PIN_DEFAULT("sh_mobile_sdhi.0", "pfc-sh73a0",
  438. "PORT256", pin_pullup_conf),
  439. PIN_MAP_CONFIGS_PIN_DEFAULT("sh_mobile_sdhi.0", "pfc-sh73a0",
  440. "PORT251", pin_pullup_conf),
  441. /* SDHI1 (BCM4330) */
  442. PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.1", "pfc-sh73a0",
  443. "sdhi1_data4", "sdhi1"),
  444. PIN_MAP_MUX_GROUP_DEFAULT("sh_mobile_sdhi.1", "pfc-sh73a0",
  445. "sdhi1_ctrl", "sdhi1"),
  446. PIN_MAP_CONFIGS_GROUP_DEFAULT("sh_mobile_sdhi.1", "pfc-sh73a0",
  447. "sdhi1_data4", pin_pullup_conf),
  448. PIN_MAP_CONFIGS_PIN_DEFAULT("sh_mobile_sdhi.1", "pfc-sh73a0",
  449. "PORT263", pin_pullup_conf),
  450. /* SMSC911X */
  451. PIN_MAP_MUX_GROUP_DEFAULT("smsc911x.0", "pfc-sh73a0",
  452. "bsc_data_0_7", "bsc"),
  453. PIN_MAP_MUX_GROUP_DEFAULT("smsc911x.0", "pfc-sh73a0",
  454. "bsc_data_8_15", "bsc"),
  455. PIN_MAP_MUX_GROUP_DEFAULT("smsc911x.0", "pfc-sh73a0",
  456. "bsc_cs5_a", "bsc"),
  457. PIN_MAP_MUX_GROUP_DEFAULT("smsc911x.0", "pfc-sh73a0",
  458. "bsc_we0", "bsc"),
  459. /* TPU */
  460. PIN_MAP_MUX_GROUP_DEFAULT("renesas-tpu-pwm.1", "pfc-sh73a0",
  461. "tpu1_to2", "tpu1"),
  462. PIN_MAP_MUX_GROUP_DEFAULT("renesas-tpu-pwm.2", "pfc-sh73a0",
  463. "tpu2_to1", "tpu2"),
  464. PIN_MAP_MUX_GROUP_DEFAULT("renesas-tpu-pwm.3", "pfc-sh73a0",
  465. "tpu3_to0", "tpu3"),
  466. PIN_MAP_MUX_GROUP_DEFAULT("renesas-tpu-pwm.4", "pfc-sh73a0",
  467. "tpu4_to1", "tpu4"),
  468. };
  469. static void __init kota2_init(void)
  470. {
  471. regulator_register_always_on(0, "fixed-1.8V", fixed1v8_power_consumers,
  472. ARRAY_SIZE(fixed1v8_power_consumers), 1800000);
  473. regulator_register_always_on(1, "fixed-3.3V", fixed3v3_power_consumers,
  474. ARRAY_SIZE(fixed3v3_power_consumers), 3300000);
  475. regulator_register_fixed(2, dummy_supplies, ARRAY_SIZE(dummy_supplies));
  476. pinctrl_register_mappings(kota2_pinctrl_map,
  477. ARRAY_SIZE(kota2_pinctrl_map));
  478. pwm_add_table(pwm_lookup, ARRAY_SIZE(pwm_lookup));
  479. sh73a0_pinmux_init();
  480. /* SMSC911X */
  481. gpio_request_one(144, GPIOF_IN, NULL); /* PINTA2 */
  482. gpio_request_one(145, GPIOF_OUT_INIT_HIGH, NULL); /* RESET */
  483. /* MMCIF */
  484. gpio_request_one(208, GPIOF_OUT_INIT_HIGH, NULL); /* Reset */
  485. #ifdef CONFIG_CACHE_L2X0
  486. /* Early BRESP enable, Shared attribute override enable, 64K*8way */
  487. l2x0_init(IOMEM(0xf0100000), 0x40460000, 0x82000fff);
  488. #endif
  489. sh73a0_add_standard_devices();
  490. platform_add_devices(kota2_devices, ARRAY_SIZE(kota2_devices));
  491. }
  492. MACHINE_START(KOTA2, "kota2")
  493. .smp = smp_ops(sh73a0_smp_ops),
  494. .map_io = sh73a0_map_io,
  495. .init_early = sh73a0_add_early_devices,
  496. .nr_irqs = NR_IRQS_LEGACY,
  497. .init_irq = sh73a0_init_irq,
  498. .init_machine = kota2_init,
  499. .init_late = shmobile_init_late,
  500. .init_time = sh73a0_earlytimer_init,
  501. MACHINE_END