pdata-quirks.c 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624
  1. /*
  2. * Legacy platform_data quirks
  3. *
  4. * Copyright (C) 2013 Texas Instruments
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License version 2 as
  8. * published by the Free Software Foundation.
  9. */
  10. #include <linux/clk.h>
  11. #include <linux/davinci_emac.h>
  12. #include <linux/gpio.h>
  13. #include <linux/init.h>
  14. #include <linux/kernel.h>
  15. #include <linux/of_platform.h>
  16. #include <linux/ti_wilink_st.h>
  17. #include <linux/wl12xx.h>
  18. #include <linux/mmc/card.h>
  19. #include <linux/mmc/host.h>
  20. #include <linux/regulator/machine.h>
  21. #include <linux/regulator/fixed.h>
  22. #include <linux/platform_data/pinctrl-single.h>
  23. #include <linux/platform_data/hsmmc-omap.h>
  24. #include <linux/platform_data/iommu-omap.h>
  25. #include <linux/platform_data/wkup_m3.h>
  26. #include <linux/platform_data/pwm_omap_dmtimer.h>
  27. #include <linux/platform_data/media/ir-rx51.h>
  28. #include <linux/platform_data/asoc-ti-mcbsp.h>
  29. #include <plat/dmtimer.h>
  30. #include "common.h"
  31. #include "common-board-devices.h"
  32. #include "control.h"
  33. #include "omap_device.h"
  34. #include "omap-pm.h"
  35. #include "omap-secure.h"
  36. #include "soc.h"
  37. #include "hsmmc.h"
  38. static struct omap_hsmmc_platform_data __maybe_unused mmc_pdata[2];
  39. struct pdata_init {
  40. const char *compatible;
  41. void (*fn)(void);
  42. };
  43. static struct of_dev_auxdata omap_auxdata_lookup[];
  44. static struct twl4030_gpio_platform_data twl_gpio_auxdata;
  45. #ifdef CONFIG_MACH_NOKIA_N8X0
  46. static void __init omap2420_n8x0_legacy_init(void)
  47. {
  48. omap_auxdata_lookup[0].platform_data = n8x0_legacy_init();
  49. }
  50. #else
  51. #define omap2420_n8x0_legacy_init NULL
  52. #endif
  53. #ifdef CONFIG_ARCH_OMAP3
  54. /*
  55. * Configures GPIOs 126, 127 and 129 to 1.8V mode instead of 3.0V
  56. * mode for MMC1 in case bootloader did not configure things.
  57. * Note that if the pins are used for MMC1, pbias-regulator
  58. * manages the IO voltage.
  59. */
  60. static void __init omap3_gpio126_127_129(void)
  61. {
  62. u32 reg;
  63. reg = omap_ctrl_readl(OMAP343X_CONTROL_PBIAS_LITE);
  64. reg &= ~OMAP343X_PBIASLITEVMODE1;
  65. reg |= OMAP343X_PBIASLITEPWRDNZ1;
  66. omap_ctrl_writel(reg, OMAP343X_CONTROL_PBIAS_LITE);
  67. if (cpu_is_omap3630()) {
  68. reg = omap_ctrl_readl(OMAP34XX_CONTROL_WKUP_CTRL);
  69. reg |= OMAP36XX_GPIO_IO_PWRDNZ;
  70. omap_ctrl_writel(reg, OMAP34XX_CONTROL_WKUP_CTRL);
  71. }
  72. }
  73. static void __init hsmmc2_internal_input_clk(void)
  74. {
  75. u32 reg;
  76. reg = omap_ctrl_readl(OMAP343X_CONTROL_DEVCONF1);
  77. reg |= OMAP2_MMCSDIO2ADPCLKISEL;
  78. omap_ctrl_writel(reg, OMAP343X_CONTROL_DEVCONF1);
  79. }
  80. static struct iommu_platform_data omap3_iommu_pdata = {
  81. .reset_name = "mmu",
  82. .assert_reset = omap_device_assert_hardreset,
  83. .deassert_reset = omap_device_deassert_hardreset,
  84. };
  85. static int omap3_sbc_t3730_twl_callback(struct device *dev,
  86. unsigned gpio,
  87. unsigned ngpio)
  88. {
  89. int res;
  90. res = gpio_request_one(gpio + 2, GPIOF_OUT_INIT_HIGH,
  91. "wlan pwr");
  92. if (res)
  93. return res;
  94. gpio_export(gpio, 0);
  95. return 0;
  96. }
  97. static void __init omap3_sbc_t3x_usb_hub_init(int gpio, char *hub_name)
  98. {
  99. int err = gpio_request_one(gpio, GPIOF_OUT_INIT_LOW, hub_name);
  100. if (err) {
  101. pr_err("SBC-T3x: %s reset gpio request failed: %d\n",
  102. hub_name, err);
  103. return;
  104. }
  105. gpio_export(gpio, 0);
  106. udelay(10);
  107. gpio_set_value(gpio, 1);
  108. msleep(1);
  109. }
  110. static void __init omap3_sbc_t3730_twl_init(void)
  111. {
  112. twl_gpio_auxdata.setup = omap3_sbc_t3730_twl_callback;
  113. }
  114. static void __init omap3_sbc_t3730_legacy_init(void)
  115. {
  116. omap3_sbc_t3x_usb_hub_init(167, "sb-t35 usb hub");
  117. }
  118. static void __init omap3_sbc_t3530_legacy_init(void)
  119. {
  120. omap3_sbc_t3x_usb_hub_init(167, "sb-t35 usb hub");
  121. }
  122. static struct ti_st_plat_data wilink_pdata = {
  123. .nshutdown_gpio = 137,
  124. .dev_name = "/dev/ttyO1",
  125. .flow_cntrl = 1,
  126. .baud_rate = 300000,
  127. };
  128. static struct platform_device wl18xx_device = {
  129. .name = "kim",
  130. .id = -1,
  131. .dev = {
  132. .platform_data = &wilink_pdata,
  133. }
  134. };
  135. static struct ti_st_plat_data wilink7_pdata = {
  136. .nshutdown_gpio = 162,
  137. .dev_name = "/dev/ttyO1",
  138. .flow_cntrl = 1,
  139. .baud_rate = 3000000,
  140. };
  141. static struct platform_device wl128x_device = {
  142. .name = "kim",
  143. .id = -1,
  144. .dev = {
  145. .platform_data = &wilink7_pdata,
  146. }
  147. };
  148. static struct platform_device btwilink_device = {
  149. .name = "btwilink",
  150. .id = -1,
  151. };
  152. static void __init omap3_igep0020_rev_f_legacy_init(void)
  153. {
  154. platform_device_register(&wl18xx_device);
  155. platform_device_register(&btwilink_device);
  156. }
  157. static void __init omap3_igep0030_rev_g_legacy_init(void)
  158. {
  159. platform_device_register(&wl18xx_device);
  160. platform_device_register(&btwilink_device);
  161. }
  162. static void __init omap3_evm_legacy_init(void)
  163. {
  164. hsmmc2_internal_input_clk();
  165. }
  166. static void am35xx_enable_emac_int(void)
  167. {
  168. u32 v;
  169. v = omap_ctrl_readl(AM35XX_CONTROL_LVL_INTR_CLEAR);
  170. v |= (AM35XX_CPGMAC_C0_RX_PULSE_CLR | AM35XX_CPGMAC_C0_TX_PULSE_CLR |
  171. AM35XX_CPGMAC_C0_MISC_PULSE_CLR | AM35XX_CPGMAC_C0_RX_THRESH_CLR);
  172. omap_ctrl_writel(v, AM35XX_CONTROL_LVL_INTR_CLEAR);
  173. omap_ctrl_readl(AM35XX_CONTROL_LVL_INTR_CLEAR); /* OCP barrier */
  174. }
  175. static void am35xx_disable_emac_int(void)
  176. {
  177. u32 v;
  178. v = omap_ctrl_readl(AM35XX_CONTROL_LVL_INTR_CLEAR);
  179. v |= (AM35XX_CPGMAC_C0_RX_PULSE_CLR | AM35XX_CPGMAC_C0_TX_PULSE_CLR);
  180. omap_ctrl_writel(v, AM35XX_CONTROL_LVL_INTR_CLEAR);
  181. omap_ctrl_readl(AM35XX_CONTROL_LVL_INTR_CLEAR); /* OCP barrier */
  182. }
  183. static struct emac_platform_data am35xx_emac_pdata = {
  184. .interrupt_enable = am35xx_enable_emac_int,
  185. .interrupt_disable = am35xx_disable_emac_int,
  186. };
  187. static void __init am35xx_emac_reset(void)
  188. {
  189. u32 v;
  190. v = omap_ctrl_readl(AM35XX_CONTROL_IP_SW_RESET);
  191. v &= ~AM35XX_CPGMACSS_SW_RST;
  192. omap_ctrl_writel(v, AM35XX_CONTROL_IP_SW_RESET);
  193. omap_ctrl_readl(AM35XX_CONTROL_IP_SW_RESET); /* OCP barrier */
  194. }
  195. static struct gpio cm_t3517_wlan_gpios[] __initdata = {
  196. { 56, GPIOF_OUT_INIT_HIGH, "wlan pwr" },
  197. { 4, GPIOF_OUT_INIT_HIGH, "xcvr noe" },
  198. };
  199. static void __init omap3_sbc_t3517_wifi_init(void)
  200. {
  201. int err = gpio_request_array(cm_t3517_wlan_gpios,
  202. ARRAY_SIZE(cm_t3517_wlan_gpios));
  203. if (err) {
  204. pr_err("SBC-T3517: wl12xx gpios request failed: %d\n", err);
  205. return;
  206. }
  207. gpio_export(cm_t3517_wlan_gpios[0].gpio, 0);
  208. gpio_export(cm_t3517_wlan_gpios[1].gpio, 0);
  209. msleep(100);
  210. gpio_set_value(cm_t3517_wlan_gpios[1].gpio, 0);
  211. }
  212. static void __init omap3_sbc_t3517_legacy_init(void)
  213. {
  214. omap3_sbc_t3x_usb_hub_init(152, "cm-t3517 usb hub");
  215. omap3_sbc_t3x_usb_hub_init(98, "sb-t35 usb hub");
  216. am35xx_emac_reset();
  217. hsmmc2_internal_input_clk();
  218. omap3_sbc_t3517_wifi_init();
  219. }
  220. static void __init am3517_evm_legacy_init(void)
  221. {
  222. am35xx_emac_reset();
  223. }
  224. static struct platform_device omap3_rom_rng_device = {
  225. .name = "omap3-rom-rng",
  226. .id = -1,
  227. .dev = {
  228. .platform_data = rx51_secure_rng_call,
  229. },
  230. };
  231. static void __init nokia_n900_legacy_init(void)
  232. {
  233. hsmmc2_internal_input_clk();
  234. mmc_pdata[0].name = "external";
  235. mmc_pdata[1].name = "internal";
  236. if (omap_type() == OMAP2_DEVICE_TYPE_SEC) {
  237. if (IS_ENABLED(CONFIG_ARM_ERRATA_430973)) {
  238. pr_info("RX-51: Enabling ARM errata 430973 workaround\n");
  239. /* set IBE to 1 */
  240. rx51_secure_update_aux_cr(BIT(6), 0);
  241. } else {
  242. pr_warn("RX-51: Not enabling ARM errata 430973 workaround\n");
  243. pr_warn("Thumb binaries may crash randomly without this workaround\n");
  244. }
  245. pr_info("RX-51: Registering OMAP3 HWRNG device\n");
  246. platform_device_register(&omap3_rom_rng_device);
  247. }
  248. }
  249. static void __init omap3_tao3530_legacy_init(void)
  250. {
  251. hsmmc2_internal_input_clk();
  252. }
  253. static void __init omap3_logicpd_torpedo_init(void)
  254. {
  255. omap3_gpio126_127_129();
  256. platform_device_register(&wl128x_device);
  257. platform_device_register(&btwilink_device);
  258. }
  259. /* omap3pandora legacy devices */
  260. #define PANDORA_WIFI_IRQ_GPIO 21
  261. #define PANDORA_WIFI_NRESET_GPIO 23
  262. static struct platform_device pandora_backlight = {
  263. .name = "pandora-backlight",
  264. .id = -1,
  265. };
  266. static struct regulator_consumer_supply pandora_vmmc3_supply[] = {
  267. REGULATOR_SUPPLY("vmmc", "omap_hsmmc.2"),
  268. };
  269. static struct regulator_init_data pandora_vmmc3 = {
  270. .constraints = {
  271. .valid_ops_mask = REGULATOR_CHANGE_STATUS,
  272. },
  273. .num_consumer_supplies = ARRAY_SIZE(pandora_vmmc3_supply),
  274. .consumer_supplies = pandora_vmmc3_supply,
  275. };
  276. static struct fixed_voltage_config pandora_vwlan = {
  277. .supply_name = "vwlan",
  278. .microvolts = 1800000, /* 1.8V */
  279. .gpio = PANDORA_WIFI_NRESET_GPIO,
  280. .startup_delay = 50000, /* 50ms */
  281. .enable_high = 1,
  282. .init_data = &pandora_vmmc3,
  283. };
  284. static struct platform_device pandora_vwlan_device = {
  285. .name = "reg-fixed-voltage",
  286. .id = 1,
  287. .dev = {
  288. .platform_data = &pandora_vwlan,
  289. },
  290. };
  291. static void pandora_wl1251_init_card(struct mmc_card *card)
  292. {
  293. /*
  294. * We have TI wl1251 attached to MMC3. Pass this information to
  295. * SDIO core because it can't be probed by normal methods.
  296. */
  297. if (card->type == MMC_TYPE_SDIO || card->type == MMC_TYPE_SD_COMBO) {
  298. card->quirks |= MMC_QUIRK_NONSTD_SDIO;
  299. card->cccr.wide_bus = 1;
  300. card->cis.vendor = 0x104c;
  301. card->cis.device = 0x9066;
  302. card->cis.blksize = 512;
  303. card->cis.max_dtr = 24000000;
  304. card->ocr = 0x80;
  305. }
  306. }
  307. static struct omap2_hsmmc_info pandora_mmc3[] = {
  308. {
  309. .mmc = 3,
  310. .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_POWER_OFF_CARD,
  311. .gpio_cd = -EINVAL,
  312. .gpio_wp = -EINVAL,
  313. .init_card = pandora_wl1251_init_card,
  314. },
  315. {} /* Terminator */
  316. };
  317. static void __init pandora_wl1251_init(void)
  318. {
  319. struct wl1251_platform_data pandora_wl1251_pdata;
  320. int ret;
  321. memset(&pandora_wl1251_pdata, 0, sizeof(pandora_wl1251_pdata));
  322. pandora_wl1251_pdata.power_gpio = -1;
  323. ret = gpio_request_one(PANDORA_WIFI_IRQ_GPIO, GPIOF_IN, "wl1251 irq");
  324. if (ret < 0)
  325. goto fail;
  326. pandora_wl1251_pdata.irq = gpio_to_irq(PANDORA_WIFI_IRQ_GPIO);
  327. if (pandora_wl1251_pdata.irq < 0)
  328. goto fail_irq;
  329. pandora_wl1251_pdata.use_eeprom = true;
  330. ret = wl1251_set_platform_data(&pandora_wl1251_pdata);
  331. if (ret < 0)
  332. goto fail_irq;
  333. return;
  334. fail_irq:
  335. gpio_free(PANDORA_WIFI_IRQ_GPIO);
  336. fail:
  337. pr_err("wl1251 board initialisation failed\n");
  338. }
  339. static void __init omap3_pandora_legacy_init(void)
  340. {
  341. platform_device_register(&pandora_backlight);
  342. platform_device_register(&pandora_vwlan_device);
  343. omap_hsmmc_init(pandora_mmc3);
  344. omap_hsmmc_late_init(pandora_mmc3);
  345. pandora_wl1251_init();
  346. }
  347. #endif /* CONFIG_ARCH_OMAP3 */
  348. #if defined(CONFIG_ARCH_OMAP4) || defined(CONFIG_SOC_OMAP5)
  349. static struct iommu_platform_data omap4_iommu_pdata = {
  350. .reset_name = "mmu_cache",
  351. .assert_reset = omap_device_assert_hardreset,
  352. .deassert_reset = omap_device_deassert_hardreset,
  353. };
  354. #endif
  355. #if defined(CONFIG_SOC_AM33XX) || defined(CONFIG_SOC_AM43XX)
  356. static struct wkup_m3_platform_data wkup_m3_data = {
  357. .reset_name = "wkup_m3",
  358. .assert_reset = omap_device_assert_hardreset,
  359. .deassert_reset = omap_device_deassert_hardreset,
  360. };
  361. #endif
  362. #ifdef CONFIG_SOC_OMAP5
  363. static void __init omap5_uevm_legacy_init(void)
  364. {
  365. }
  366. #endif
  367. static struct pcs_pdata pcs_pdata;
  368. void omap_pcs_legacy_init(int irq, void (*rearm)(void))
  369. {
  370. pcs_pdata.irq = irq;
  371. pcs_pdata.rearm = rearm;
  372. }
  373. /*
  374. * GPIOs for TWL are initialized by the I2C bus and need custom
  375. * handing until DSS has device tree bindings.
  376. */
  377. void omap_auxdata_legacy_init(struct device *dev)
  378. {
  379. if (dev->platform_data)
  380. return;
  381. if (strcmp("twl4030-gpio", dev_name(dev)))
  382. return;
  383. dev->platform_data = &twl_gpio_auxdata;
  384. }
  385. /* Dual mode timer PWM callbacks platdata */
  386. #if IS_ENABLED(CONFIG_OMAP_DM_TIMER)
  387. static struct pwm_omap_dmtimer_pdata pwm_dmtimer_pdata = {
  388. .request_by_node = omap_dm_timer_request_by_node,
  389. .request_specific = omap_dm_timer_request_specific,
  390. .request = omap_dm_timer_request,
  391. .set_source = omap_dm_timer_set_source,
  392. .get_irq = omap_dm_timer_get_irq,
  393. .set_int_enable = omap_dm_timer_set_int_enable,
  394. .set_int_disable = omap_dm_timer_set_int_disable,
  395. .free = omap_dm_timer_free,
  396. .enable = omap_dm_timer_enable,
  397. .disable = omap_dm_timer_disable,
  398. .get_fclk = omap_dm_timer_get_fclk,
  399. .start = omap_dm_timer_start,
  400. .stop = omap_dm_timer_stop,
  401. .set_load = omap_dm_timer_set_load,
  402. .set_match = omap_dm_timer_set_match,
  403. .set_pwm = omap_dm_timer_set_pwm,
  404. .set_prescaler = omap_dm_timer_set_prescaler,
  405. .read_counter = omap_dm_timer_read_counter,
  406. .write_counter = omap_dm_timer_write_counter,
  407. .read_status = omap_dm_timer_read_status,
  408. .write_status = omap_dm_timer_write_status,
  409. };
  410. #endif
  411. static struct lirc_rx51_platform_data __maybe_unused rx51_lirc_data = {
  412. .set_max_mpu_wakeup_lat = omap_pm_set_max_mpu_wakeup_lat,
  413. };
  414. static struct platform_device __maybe_unused rx51_lirc_device = {
  415. .name = "lirc_rx51",
  416. .id = -1,
  417. .dev = {
  418. .platform_data = &rx51_lirc_data,
  419. },
  420. };
  421. #if IS_ENABLED(CONFIG_SND_OMAP_SOC_MCBSP)
  422. static struct omap_mcbsp_platform_data mcbsp_pdata;
  423. static void __init omap3_mcbsp_init(void)
  424. {
  425. omap3_mcbsp_init_pdata_callback(&mcbsp_pdata);
  426. }
  427. #else
  428. static void __init omap3_mcbsp_init(void) {}
  429. #endif
  430. /*
  431. * Few boards still need auxdata populated before we populate
  432. * the dev entries in of_platform_populate().
  433. */
  434. static struct pdata_init auxdata_quirks[] __initdata = {
  435. #ifdef CONFIG_SOC_OMAP2420
  436. { "nokia,n800", omap2420_n8x0_legacy_init, },
  437. { "nokia,n810", omap2420_n8x0_legacy_init, },
  438. { "nokia,n810-wimax", omap2420_n8x0_legacy_init, },
  439. #endif
  440. #ifdef CONFIG_ARCH_OMAP3
  441. { "compulab,omap3-sbc-t3730", omap3_sbc_t3730_twl_init, },
  442. #endif
  443. { /* sentinel */ },
  444. };
  445. static struct of_dev_auxdata omap_auxdata_lookup[] __initdata = {
  446. #ifdef CONFIG_MACH_NOKIA_N8X0
  447. OF_DEV_AUXDATA("ti,omap2420-mmc", 0x4809c000, "mmci-omap.0", NULL),
  448. OF_DEV_AUXDATA("menelaus", 0x72, "1-0072", &n8x0_menelaus_platform_data),
  449. OF_DEV_AUXDATA("tlv320aic3x", 0x18, "2-0018", &n810_aic33_data),
  450. #endif
  451. #ifdef CONFIG_ARCH_OMAP3
  452. OF_DEV_AUXDATA("ti,omap2-iommu", 0x5d000000, "5d000000.mmu",
  453. &omap3_iommu_pdata),
  454. OF_DEV_AUXDATA("ti,omap3-hsmmc", 0x4809c000, "4809c000.mmc", &mmc_pdata[0]),
  455. OF_DEV_AUXDATA("ti,omap3-hsmmc", 0x480b4000, "480b4000.mmc", &mmc_pdata[1]),
  456. OF_DEV_AUXDATA("nokia,n900-ir", 0, "n900-ir", &rx51_lirc_data),
  457. /* Only on am3517 */
  458. OF_DEV_AUXDATA("ti,davinci_mdio", 0x5c030000, "davinci_mdio.0", NULL),
  459. OF_DEV_AUXDATA("ti,am3517-emac", 0x5c000000, "davinci_emac.0",
  460. &am35xx_emac_pdata),
  461. /* McBSP modules with sidetone core */
  462. #if IS_ENABLED(CONFIG_SND_OMAP_SOC_MCBSP)
  463. OF_DEV_AUXDATA("ti,omap3-mcbsp", 0x49022000, "49022000.mcbsp", &mcbsp_pdata),
  464. OF_DEV_AUXDATA("ti,omap3-mcbsp", 0x49024000, "49024000.mcbsp", &mcbsp_pdata),
  465. #endif
  466. #endif
  467. #ifdef CONFIG_SOC_AM33XX
  468. OF_DEV_AUXDATA("ti,am3352-wkup-m3", 0x44d00000, "44d00000.wkup_m3",
  469. &wkup_m3_data),
  470. #endif
  471. #ifdef CONFIG_SOC_AM43XX
  472. OF_DEV_AUXDATA("ti,am4372-wkup-m3", 0x44d00000, "44d00000.wkup_m3",
  473. &wkup_m3_data),
  474. #endif
  475. #if IS_ENABLED(CONFIG_OMAP_DM_TIMER)
  476. OF_DEV_AUXDATA("ti,omap-dmtimer-pwm", 0, NULL, &pwm_dmtimer_pdata),
  477. #endif
  478. #if defined(CONFIG_ARCH_OMAP4) || defined(CONFIG_SOC_OMAP5)
  479. OF_DEV_AUXDATA("ti,omap4-iommu", 0x4a066000, "4a066000.mmu",
  480. &omap4_iommu_pdata),
  481. OF_DEV_AUXDATA("ti,omap4-iommu", 0x55082000, "55082000.mmu",
  482. &omap4_iommu_pdata),
  483. #endif
  484. /* Common auxdata */
  485. OF_DEV_AUXDATA("pinctrl-single", 0, NULL, &pcs_pdata),
  486. { /* sentinel */ },
  487. };
  488. /*
  489. * Few boards still need to initialize some legacy devices with
  490. * platform data until the drivers support device tree.
  491. */
  492. static struct pdata_init pdata_quirks[] __initdata = {
  493. #ifdef CONFIG_ARCH_OMAP3
  494. { "compulab,omap3-sbc-t3517", omap3_sbc_t3517_legacy_init, },
  495. { "compulab,omap3-sbc-t3530", omap3_sbc_t3530_legacy_init, },
  496. { "compulab,omap3-sbc-t3730", omap3_sbc_t3730_legacy_init, },
  497. { "nokia,omap3-n900", nokia_n900_legacy_init, },
  498. { "nokia,omap3-n9", hsmmc2_internal_input_clk, },
  499. { "nokia,omap3-n950", hsmmc2_internal_input_clk, },
  500. { "isee,omap3-igep0020-rev-f", omap3_igep0020_rev_f_legacy_init, },
  501. { "isee,omap3-igep0030-rev-g", omap3_igep0030_rev_g_legacy_init, },
  502. { "logicpd,dm3730-torpedo-devkit", omap3_logicpd_torpedo_init, },
  503. { "ti,omap3-evm-37xx", omap3_evm_legacy_init, },
  504. { "ti,am3517-evm", am3517_evm_legacy_init, },
  505. { "technexion,omap3-tao3530", omap3_tao3530_legacy_init, },
  506. { "openpandora,omap3-pandora-600mhz", omap3_pandora_legacy_init, },
  507. { "openpandora,omap3-pandora-1ghz", omap3_pandora_legacy_init, },
  508. #endif
  509. #ifdef CONFIG_SOC_OMAP5
  510. { "ti,omap5-uevm", omap5_uevm_legacy_init, },
  511. #endif
  512. { /* sentinel */ },
  513. };
  514. static void pdata_quirks_check(struct pdata_init *quirks)
  515. {
  516. while (quirks->compatible) {
  517. if (of_machine_is_compatible(quirks->compatible)) {
  518. if (quirks->fn)
  519. quirks->fn();
  520. break;
  521. }
  522. quirks++;
  523. }
  524. }
  525. void __init pdata_quirks_init(const struct of_device_id *omap_dt_match_table)
  526. {
  527. /*
  528. * We still need this for omap2420 and omap3 PM to work, others are
  529. * using drivers/misc/sram.c already.
  530. */
  531. if (of_machine_is_compatible("ti,omap2420") ||
  532. of_machine_is_compatible("ti,omap3"))
  533. omap_sdrc_init(NULL, NULL);
  534. if (of_machine_is_compatible("ti,omap3"))
  535. omap3_mcbsp_init();
  536. pdata_quirks_check(auxdata_quirks);
  537. of_platform_populate(NULL, omap_dt_match_table,
  538. omap_auxdata_lookup, NULL);
  539. pdata_quirks_check(pdata_quirks);
  540. }