pdata-quirks.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567
  1. // SPDX-License-Identifier: GPL-2.0-only
  2. /*
  3. * Legacy platform_data quirks
  4. *
  5. * Copyright (C) 2013 Texas Instruments
  6. */
  7. #include <linux/clk.h>
  8. #include <linux/davinci_emac.h>
  9. #include <linux/gpio.h>
  10. #include <linux/init.h>
  11. #include <linux/kernel.h>
  12. #include <linux/of_platform.h>
  13. #include <linux/wl12xx.h>
  14. #include <linux/mmc/card.h>
  15. #include <linux/mmc/host.h>
  16. #include <linux/power/smartreflex.h>
  17. #include <linux/regulator/machine.h>
  18. #include <linux/regulator/fixed.h>
  19. #include <linux/platform_data/pinctrl-single.h>
  20. #include <linux/platform_data/hsmmc-omap.h>
  21. #include <linux/platform_data/iommu-omap.h>
  22. #include <linux/platform_data/ti-sysc.h>
  23. #include <linux/platform_data/wkup_m3.h>
  24. #include <linux/platform_data/asoc-ti-mcbsp.h>
  25. #include <linux/platform_data/ti-prm.h>
  26. #include "clockdomain.h"
  27. #include "common.h"
  28. #include "common-board-devices.h"
  29. #include "control.h"
  30. #include "omap_device.h"
  31. #include "omap-secure.h"
  32. #include "soc.h"
  33. static struct omap_hsmmc_platform_data __maybe_unused mmc_pdata[2];
  34. struct pdata_init {
  35. const char *compatible;
  36. void (*fn)(void);
  37. };
  38. static struct of_dev_auxdata omap_auxdata_lookup[];
  39. static struct twl4030_gpio_platform_data twl_gpio_auxdata;
  40. #ifdef CONFIG_MACH_NOKIA_N8X0
  41. static void __init omap2420_n8x0_legacy_init(void)
  42. {
  43. omap_auxdata_lookup[0].platform_data = n8x0_legacy_init();
  44. }
  45. #else
  46. #define omap2420_n8x0_legacy_init NULL
  47. #endif
  48. #ifdef CONFIG_ARCH_OMAP3
  49. /*
  50. * Configures GPIOs 126, 127 and 129 to 1.8V mode instead of 3.0V
  51. * mode for MMC1 in case bootloader did not configure things.
  52. * Note that if the pins are used for MMC1, pbias-regulator
  53. * manages the IO voltage.
  54. */
  55. static void __init omap3_gpio126_127_129(void)
  56. {
  57. u32 reg;
  58. reg = omap_ctrl_readl(OMAP343X_CONTROL_PBIAS_LITE);
  59. reg &= ~OMAP343X_PBIASLITEVMODE1;
  60. reg |= OMAP343X_PBIASLITEPWRDNZ1;
  61. omap_ctrl_writel(reg, OMAP343X_CONTROL_PBIAS_LITE);
  62. if (cpu_is_omap3630()) {
  63. reg = omap_ctrl_readl(OMAP34XX_CONTROL_WKUP_CTRL);
  64. reg |= OMAP36XX_GPIO_IO_PWRDNZ;
  65. omap_ctrl_writel(reg, OMAP34XX_CONTROL_WKUP_CTRL);
  66. }
  67. }
  68. static void __init hsmmc2_internal_input_clk(void)
  69. {
  70. u32 reg;
  71. reg = omap_ctrl_readl(OMAP343X_CONTROL_DEVCONF1);
  72. reg |= OMAP2_MMCSDIO2ADPCLKISEL;
  73. omap_ctrl_writel(reg, OMAP343X_CONTROL_DEVCONF1);
  74. }
  75. #ifdef CONFIG_OMAP_HWMOD
  76. static struct iommu_platform_data omap3_iommu_pdata = {
  77. .reset_name = "mmu",
  78. .assert_reset = omap_device_assert_hardreset,
  79. .deassert_reset = omap_device_deassert_hardreset,
  80. .device_enable = omap_device_enable,
  81. .device_idle = omap_device_idle,
  82. };
  83. static struct iommu_platform_data omap3_iommu_isp_pdata = {
  84. .device_enable = omap_device_enable,
  85. .device_idle = omap_device_idle,
  86. };
  87. #endif
  88. static int omap3_sbc_t3730_twl_callback(struct device *dev,
  89. unsigned gpio,
  90. unsigned ngpio)
  91. {
  92. int res;
  93. res = gpio_request_one(gpio + 2, GPIOF_OUT_INIT_HIGH,
  94. "wlan pwr");
  95. if (res)
  96. return res;
  97. gpio_export(gpio, 0);
  98. return 0;
  99. }
  100. static void __init omap3_sbc_t3x_usb_hub_init(int gpio, char *hub_name)
  101. {
  102. int err = gpio_request_one(gpio, GPIOF_OUT_INIT_LOW, hub_name);
  103. if (err) {
  104. pr_err("SBC-T3x: %s reset gpio request failed: %d\n",
  105. hub_name, err);
  106. return;
  107. }
  108. gpio_export(gpio, 0);
  109. udelay(10);
  110. gpio_set_value(gpio, 1);
  111. msleep(1);
  112. }
  113. static void __init omap3_sbc_t3730_twl_init(void)
  114. {
  115. twl_gpio_auxdata.setup = omap3_sbc_t3730_twl_callback;
  116. }
  117. static void __init omap3_sbc_t3730_legacy_init(void)
  118. {
  119. omap3_sbc_t3x_usb_hub_init(167, "sb-t35 usb hub");
  120. }
  121. static void __init omap3_sbc_t3530_legacy_init(void)
  122. {
  123. omap3_sbc_t3x_usb_hub_init(167, "sb-t35 usb hub");
  124. }
  125. static void __init omap3_evm_legacy_init(void)
  126. {
  127. hsmmc2_internal_input_clk();
  128. }
  129. static void am35xx_enable_emac_int(void)
  130. {
  131. u32 v;
  132. v = omap_ctrl_readl(AM35XX_CONTROL_LVL_INTR_CLEAR);
  133. v |= (AM35XX_CPGMAC_C0_RX_PULSE_CLR | AM35XX_CPGMAC_C0_TX_PULSE_CLR |
  134. AM35XX_CPGMAC_C0_MISC_PULSE_CLR | AM35XX_CPGMAC_C0_RX_THRESH_CLR);
  135. omap_ctrl_writel(v, AM35XX_CONTROL_LVL_INTR_CLEAR);
  136. omap_ctrl_readl(AM35XX_CONTROL_LVL_INTR_CLEAR); /* OCP barrier */
  137. }
  138. static void am35xx_disable_emac_int(void)
  139. {
  140. u32 v;
  141. v = omap_ctrl_readl(AM35XX_CONTROL_LVL_INTR_CLEAR);
  142. v |= (AM35XX_CPGMAC_C0_RX_PULSE_CLR | AM35XX_CPGMAC_C0_TX_PULSE_CLR);
  143. omap_ctrl_writel(v, AM35XX_CONTROL_LVL_INTR_CLEAR);
  144. omap_ctrl_readl(AM35XX_CONTROL_LVL_INTR_CLEAR); /* OCP barrier */
  145. }
  146. static struct emac_platform_data am35xx_emac_pdata = {
  147. .interrupt_enable = am35xx_enable_emac_int,
  148. .interrupt_disable = am35xx_disable_emac_int,
  149. };
  150. static void __init am35xx_emac_reset(void)
  151. {
  152. u32 v;
  153. v = omap_ctrl_readl(AM35XX_CONTROL_IP_SW_RESET);
  154. v &= ~AM35XX_CPGMACSS_SW_RST;
  155. omap_ctrl_writel(v, AM35XX_CONTROL_IP_SW_RESET);
  156. omap_ctrl_readl(AM35XX_CONTROL_IP_SW_RESET); /* OCP barrier */
  157. }
  158. static struct gpio cm_t3517_wlan_gpios[] __initdata = {
  159. { 56, GPIOF_OUT_INIT_HIGH, "wlan pwr" },
  160. { 4, GPIOF_OUT_INIT_HIGH, "xcvr noe" },
  161. };
  162. static void __init omap3_sbc_t3517_wifi_init(void)
  163. {
  164. int err = gpio_request_array(cm_t3517_wlan_gpios,
  165. ARRAY_SIZE(cm_t3517_wlan_gpios));
  166. if (err) {
  167. pr_err("SBC-T3517: wl12xx gpios request failed: %d\n", err);
  168. return;
  169. }
  170. gpio_export(cm_t3517_wlan_gpios[0].gpio, 0);
  171. gpio_export(cm_t3517_wlan_gpios[1].gpio, 0);
  172. msleep(100);
  173. gpio_set_value(cm_t3517_wlan_gpios[1].gpio, 0);
  174. }
  175. static void __init omap3_sbc_t3517_legacy_init(void)
  176. {
  177. omap3_sbc_t3x_usb_hub_init(152, "cm-t3517 usb hub");
  178. omap3_sbc_t3x_usb_hub_init(98, "sb-t35 usb hub");
  179. am35xx_emac_reset();
  180. hsmmc2_internal_input_clk();
  181. omap3_sbc_t3517_wifi_init();
  182. }
  183. static void __init am3517_evm_legacy_init(void)
  184. {
  185. am35xx_emac_reset();
  186. }
  187. static void __init nokia_n900_legacy_init(void)
  188. {
  189. hsmmc2_internal_input_clk();
  190. mmc_pdata[0].name = "external";
  191. mmc_pdata[1].name = "internal";
  192. if (omap_type() != OMAP2_DEVICE_TYPE_GP) {
  193. if (IS_ENABLED(CONFIG_ARM_ERRATA_430973)) {
  194. pr_info("RX-51: Enabling ARM errata 430973 workaround\n");
  195. /* set IBE to 1 */
  196. rx51_secure_update_aux_cr(BIT(6), 0);
  197. } else {
  198. pr_warn("RX-51: Not enabling ARM errata 430973 workaround\n");
  199. pr_warn("Thumb binaries may crash randomly without this workaround\n");
  200. }
  201. }
  202. }
  203. static void __init omap3_tao3530_legacy_init(void)
  204. {
  205. hsmmc2_internal_input_clk();
  206. }
  207. static void __init omap3_logicpd_torpedo_init(void)
  208. {
  209. omap3_gpio126_127_129();
  210. }
  211. /* omap3pandora legacy devices */
  212. static struct platform_device pandora_backlight = {
  213. .name = "pandora-backlight",
  214. .id = -1,
  215. };
  216. static void __init omap3_pandora_legacy_init(void)
  217. {
  218. platform_device_register(&pandora_backlight);
  219. }
  220. #endif /* CONFIG_ARCH_OMAP3 */
  221. #ifdef CONFIG_SOC_DRA7XX
  222. static struct iommu_platform_data dra7_ipu1_dsp_iommu_pdata = {
  223. .set_pwrdm_constraint = omap_iommu_set_pwrdm_constraint,
  224. };
  225. #endif
  226. static struct clockdomain *ti_sysc_find_one_clockdomain(struct clk *clk)
  227. {
  228. struct clk_hw *hw = __clk_get_hw(clk);
  229. struct clockdomain *clkdm = NULL;
  230. struct clk_hw_omap *hwclk;
  231. hwclk = to_clk_hw_omap(hw);
  232. if (!omap2_clk_is_hw_omap(hw))
  233. return NULL;
  234. if (hwclk && hwclk->clkdm_name)
  235. clkdm = clkdm_lookup(hwclk->clkdm_name);
  236. return clkdm;
  237. }
  238. /**
  239. * ti_sysc_clkdm_init - find clockdomain based on clock
  240. * @fck: device functional clock
  241. * @ick: device interface clock
  242. * @dev: struct device
  243. *
  244. * Populate clockdomain based on clock. It is needed for
  245. * clkdm_deny_idle() and clkdm_allow_idle() for blocking clockdomain
  246. * clockdomain idle during reset, enable and idle.
  247. *
  248. * Note that we assume interconnect driver manages the clocks
  249. * and do not need to populate oh->_clk for dynamically
  250. * allocated modules.
  251. */
  252. static int ti_sysc_clkdm_init(struct device *dev,
  253. struct clk *fck, struct clk *ick,
  254. struct ti_sysc_cookie *cookie)
  255. {
  256. if (!IS_ERR(fck))
  257. cookie->clkdm = ti_sysc_find_one_clockdomain(fck);
  258. if (cookie->clkdm)
  259. return 0;
  260. if (!IS_ERR(ick))
  261. cookie->clkdm = ti_sysc_find_one_clockdomain(ick);
  262. if (cookie->clkdm)
  263. return 0;
  264. return -ENODEV;
  265. }
  266. static void ti_sysc_clkdm_deny_idle(struct device *dev,
  267. const struct ti_sysc_cookie *cookie)
  268. {
  269. if (cookie->clkdm)
  270. clkdm_deny_idle(cookie->clkdm);
  271. }
  272. static void ti_sysc_clkdm_allow_idle(struct device *dev,
  273. const struct ti_sysc_cookie *cookie)
  274. {
  275. if (cookie->clkdm)
  276. clkdm_allow_idle(cookie->clkdm);
  277. }
  278. #ifdef CONFIG_OMAP_HWMOD
  279. static int ti_sysc_enable_module(struct device *dev,
  280. const struct ti_sysc_cookie *cookie)
  281. {
  282. if (!cookie->data)
  283. return -EINVAL;
  284. return omap_hwmod_enable(cookie->data);
  285. }
  286. static int ti_sysc_idle_module(struct device *dev,
  287. const struct ti_sysc_cookie *cookie)
  288. {
  289. if (!cookie->data)
  290. return -EINVAL;
  291. return omap_hwmod_idle(cookie->data);
  292. }
  293. static int ti_sysc_shutdown_module(struct device *dev,
  294. const struct ti_sysc_cookie *cookie)
  295. {
  296. if (!cookie->data)
  297. return -EINVAL;
  298. return omap_hwmod_shutdown(cookie->data);
  299. }
  300. #endif /* CONFIG_OMAP_HWMOD */
  301. static bool ti_sysc_soc_type_gp(void)
  302. {
  303. return omap_type() == OMAP2_DEVICE_TYPE_GP;
  304. }
  305. static struct of_dev_auxdata omap_auxdata_lookup[];
  306. static struct ti_sysc_platform_data ti_sysc_pdata = {
  307. .auxdata = omap_auxdata_lookup,
  308. .soc_type_gp = ti_sysc_soc_type_gp,
  309. .init_clockdomain = ti_sysc_clkdm_init,
  310. .clkdm_deny_idle = ti_sysc_clkdm_deny_idle,
  311. .clkdm_allow_idle = ti_sysc_clkdm_allow_idle,
  312. #ifdef CONFIG_OMAP_HWMOD
  313. .init_module = omap_hwmod_init_module,
  314. .enable_module = ti_sysc_enable_module,
  315. .idle_module = ti_sysc_idle_module,
  316. .shutdown_module = ti_sysc_shutdown_module,
  317. #endif
  318. };
  319. static struct pcs_pdata pcs_pdata;
  320. void omap_pcs_legacy_init(int irq, void (*rearm)(void))
  321. {
  322. pcs_pdata.irq = irq;
  323. pcs_pdata.rearm = rearm;
  324. }
  325. static struct ti_prm_platform_data ti_prm_pdata = {
  326. .clkdm_deny_idle = clkdm_deny_idle,
  327. .clkdm_allow_idle = clkdm_allow_idle,
  328. .clkdm_lookup = clkdm_lookup,
  329. };
  330. /*
  331. * GPIOs for TWL are initialized by the I2C bus and need custom
  332. * handing until DSS has device tree bindings.
  333. */
  334. void omap_auxdata_legacy_init(struct device *dev)
  335. {
  336. if (dev->platform_data)
  337. return;
  338. if (strcmp("twl4030-gpio", dev_name(dev)))
  339. return;
  340. dev->platform_data = &twl_gpio_auxdata;
  341. }
  342. #if defined(CONFIG_ARCH_OMAP3) && IS_ENABLED(CONFIG_SND_SOC_OMAP_MCBSP)
  343. static struct omap_mcbsp_platform_data mcbsp_pdata;
  344. static void __init omap3_mcbsp_init(void)
  345. {
  346. omap3_mcbsp_init_pdata_callback(&mcbsp_pdata);
  347. }
  348. #else
  349. static void __init omap3_mcbsp_init(void) {}
  350. #endif
  351. /*
  352. * Few boards still need auxdata populated before we populate
  353. * the dev entries in of_platform_populate().
  354. */
  355. static struct pdata_init auxdata_quirks[] __initdata = {
  356. #ifdef CONFIG_SOC_OMAP2420
  357. { "nokia,n800", omap2420_n8x0_legacy_init, },
  358. { "nokia,n810", omap2420_n8x0_legacy_init, },
  359. { "nokia,n810-wimax", omap2420_n8x0_legacy_init, },
  360. #endif
  361. #ifdef CONFIG_ARCH_OMAP3
  362. { "compulab,omap3-sbc-t3730", omap3_sbc_t3730_twl_init, },
  363. #endif
  364. { /* sentinel */ },
  365. };
  366. struct omap_sr_data __maybe_unused omap_sr_pdata[OMAP_SR_NR];
  367. static struct of_dev_auxdata omap_auxdata_lookup[] = {
  368. #ifdef CONFIG_MACH_NOKIA_N8X0
  369. OF_DEV_AUXDATA("ti,omap2420-mmc", 0x4809c000, "mmci-omap.0", NULL),
  370. OF_DEV_AUXDATA("menelaus", 0x72, "1-0072", &n8x0_menelaus_platform_data),
  371. OF_DEV_AUXDATA("tlv320aic3x", 0x18, "2-0018", &n810_aic33_data),
  372. #endif
  373. #ifdef CONFIG_ARCH_OMAP3
  374. OF_DEV_AUXDATA("ti,omap2-iommu", 0x5d000000, "5d000000.mmu",
  375. &omap3_iommu_pdata),
  376. OF_DEV_AUXDATA("ti,omap2-iommu", 0x480bd400, "480bd400.mmu",
  377. &omap3_iommu_isp_pdata),
  378. OF_DEV_AUXDATA("ti,omap3-smartreflex-core", 0x480cb000,
  379. "480cb000.smartreflex", &omap_sr_pdata[OMAP_SR_CORE]),
  380. OF_DEV_AUXDATA("ti,omap3-smartreflex-mpu-iva", 0x480c9000,
  381. "480c9000.smartreflex", &omap_sr_pdata[OMAP_SR_MPU]),
  382. OF_DEV_AUXDATA("ti,omap3-hsmmc", 0x4809c000, "4809c000.mmc", &mmc_pdata[0]),
  383. OF_DEV_AUXDATA("ti,omap3-hsmmc", 0x480b4000, "480b4000.mmc", &mmc_pdata[1]),
  384. /* Only on am3517 */
  385. OF_DEV_AUXDATA("ti,davinci_mdio", 0x5c030000, "davinci_mdio.0", NULL),
  386. OF_DEV_AUXDATA("ti,am3517-emac", 0x5c000000, "davinci_emac.0",
  387. &am35xx_emac_pdata),
  388. OF_DEV_AUXDATA("nokia,n900-rom-rng", 0, NULL, rx51_secure_rng_call),
  389. /* McBSP modules with sidetone core */
  390. #if IS_ENABLED(CONFIG_SND_SOC_OMAP_MCBSP)
  391. OF_DEV_AUXDATA("ti,omap3-mcbsp", 0x49022000, "49022000.mcbsp", &mcbsp_pdata),
  392. OF_DEV_AUXDATA("ti,omap3-mcbsp", 0x49024000, "49024000.mcbsp", &mcbsp_pdata),
  393. #endif
  394. #endif
  395. #if defined(CONFIG_ARCH_OMAP4) || defined(CONFIG_SOC_OMAP5)
  396. OF_DEV_AUXDATA("ti,omap4-smartreflex-iva", 0x4a0db000,
  397. "4a0db000.smartreflex", &omap_sr_pdata[OMAP_SR_IVA]),
  398. OF_DEV_AUXDATA("ti,omap4-smartreflex-core", 0x4a0dd000,
  399. "4a0dd000.smartreflex", &omap_sr_pdata[OMAP_SR_CORE]),
  400. OF_DEV_AUXDATA("ti,omap4-smartreflex-mpu", 0x4a0d9000,
  401. "4a0d9000.smartreflex", &omap_sr_pdata[OMAP_SR_MPU]),
  402. #endif
  403. #ifdef CONFIG_SOC_DRA7XX
  404. OF_DEV_AUXDATA("ti,dra7-dsp-iommu", 0x40d01000, "40d01000.mmu",
  405. &dra7_ipu1_dsp_iommu_pdata),
  406. OF_DEV_AUXDATA("ti,dra7-dsp-iommu", 0x41501000, "41501000.mmu",
  407. &dra7_ipu1_dsp_iommu_pdata),
  408. OF_DEV_AUXDATA("ti,dra7-iommu", 0x58882000, "58882000.mmu",
  409. &dra7_ipu1_dsp_iommu_pdata),
  410. #endif
  411. /* Common auxdata */
  412. OF_DEV_AUXDATA("simple-pm-bus", 0, NULL, omap_auxdata_lookup),
  413. OF_DEV_AUXDATA("ti,sysc", 0, NULL, &ti_sysc_pdata),
  414. OF_DEV_AUXDATA("pinctrl-single", 0, NULL, &pcs_pdata),
  415. OF_DEV_AUXDATA("ti,omap-prm-inst", 0, NULL, &ti_prm_pdata),
  416. OF_DEV_AUXDATA("ti,omap-sdma", 0, NULL, &dma_plat_info),
  417. { /* sentinel */ },
  418. };
  419. /*
  420. * Few boards still need to initialize some legacy devices with
  421. * platform data until the drivers support device tree.
  422. */
  423. static struct pdata_init pdata_quirks[] __initdata = {
  424. #ifdef CONFIG_ARCH_OMAP3
  425. { "compulab,omap3-sbc-t3517", omap3_sbc_t3517_legacy_init, },
  426. { "compulab,omap3-sbc-t3530", omap3_sbc_t3530_legacy_init, },
  427. { "compulab,omap3-sbc-t3730", omap3_sbc_t3730_legacy_init, },
  428. { "nokia,omap3-n900", nokia_n900_legacy_init, },
  429. { "nokia,omap3-n9", hsmmc2_internal_input_clk, },
  430. { "nokia,omap3-n950", hsmmc2_internal_input_clk, },
  431. { "logicpd,dm3730-torpedo-devkit", omap3_logicpd_torpedo_init, },
  432. { "ti,omap3-evm-37xx", omap3_evm_legacy_init, },
  433. { "ti,am3517-evm", am3517_evm_legacy_init, },
  434. { "technexion,omap3-tao3530", omap3_tao3530_legacy_init, },
  435. { "openpandora,omap3-pandora-600mhz", omap3_pandora_legacy_init, },
  436. { "openpandora,omap3-pandora-1ghz", omap3_pandora_legacy_init, },
  437. #endif
  438. { /* sentinel */ },
  439. };
  440. static void pdata_quirks_check(struct pdata_init *quirks)
  441. {
  442. while (quirks->compatible) {
  443. if (of_machine_is_compatible(quirks->compatible)) {
  444. if (quirks->fn)
  445. quirks->fn();
  446. }
  447. quirks++;
  448. }
  449. }
  450. static const char * const pdata_quirks_init_nodes[] = {
  451. "prcm",
  452. "prm",
  453. };
  454. static void __init
  455. pdata_quirks_init_clocks(const struct of_device_id *omap_dt_match_table)
  456. {
  457. struct device_node *np;
  458. int i;
  459. for (i = 0; i < ARRAY_SIZE(pdata_quirks_init_nodes); i++) {
  460. np = of_find_node_by_name(NULL, pdata_quirks_init_nodes[i]);
  461. if (!np)
  462. continue;
  463. of_platform_populate(np, omap_dt_match_table,
  464. omap_auxdata_lookup, NULL);
  465. of_node_put(np);
  466. }
  467. }
  468. void __init pdata_quirks_init(const struct of_device_id *omap_dt_match_table)
  469. {
  470. /*
  471. * We still need this for omap2420 and omap3 PM to work, others are
  472. * using drivers/misc/sram.c already.
  473. */
  474. if (of_machine_is_compatible("ti,omap2420") ||
  475. of_machine_is_compatible("ti,omap3"))
  476. omap_sdrc_init(NULL, NULL);
  477. if (of_machine_is_compatible("ti,omap3"))
  478. omap3_mcbsp_init();
  479. pdata_quirks_check(auxdata_quirks);
  480. pdata_quirks_init_clocks(omap_dt_match_table);
  481. of_platform_populate(NULL, omap_dt_match_table,
  482. omap_auxdata_lookup, NULL);
  483. pdata_quirks_check(pdata_quirks);
  484. }