pdata-quirks.c 18 KB

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