xref: /linux/arch/arm/mach-omap2/pdata-quirks.c (revision efdfeb079cc3b6c7d9c19959c5ed65ce2510dd1d)
16a08e1e6STony Lindgren /*
26a08e1e6STony Lindgren  * Legacy platform_data quirks
36a08e1e6STony Lindgren  *
46a08e1e6STony Lindgren  * Copyright (C) 2013 Texas Instruments
56a08e1e6STony Lindgren  *
66a08e1e6STony Lindgren  * This program is free software; you can redistribute it and/or modify
76a08e1e6STony Lindgren  * it under the terms of the GNU General Public License version 2 as
86a08e1e6STony Lindgren  * published by the Free Software Foundation.
96a08e1e6STony Lindgren  */
106a08e1e6STony Lindgren #include <linux/clk.h>
1171900314STony Lindgren #include <linux/davinci_emac.h>
125f0a2c69STony Lindgren #include <linux/gpio.h>
13*efdfeb07SLinus Walleij #include <linux/gpio/machine.h>
146a08e1e6STony Lindgren #include <linux/init.h>
156a08e1e6STony Lindgren #include <linux/kernel.h>
168651bd8cSTony Lindgren #include <linux/of_platform.h>
17d565b5f4SEnric Balletbo i Serra #include <linux/ti_wilink_st.h>
18f9d50fefSGrazvydas Ignotas #include <linux/wl12xx.h>
19f9d50fefSGrazvydas Ignotas #include <linux/mmc/card.h>
20f9d50fefSGrazvydas Ignotas #include <linux/mmc/host.h>
21d060b405STony Lindgren #include <linux/power/smartreflex.h>
22f9d50fefSGrazvydas Ignotas #include <linux/regulator/machine.h>
23f9d50fefSGrazvydas Ignotas #include <linux/regulator/fixed.h>
246a08e1e6STony Lindgren 
2530a69ef7STony Lindgren #include <linux/platform_data/pinctrl-single.h>
2610c1f7d3STony Lindgren #include <linux/platform_data/hsmmc-omap.h>
27910f1678SSuman Anna #include <linux/platform_data/iommu-omap.h>
28ef70b0bdSTony Lindgren #include <linux/platform_data/ti-sysc.h>
296da74c54SDave Gerlach #include <linux/platform_data/wkup_m3.h>
30c26c84c9SPeter Ujfalusi #include <linux/platform_data/asoc-ti-mcbsp.h>
3130a69ef7STony Lindgren 
326a08e1e6STony Lindgren #include "common.h"
336a08e1e6STony Lindgren #include "common-board-devices.h"
34faf4bd47SAaro Koskinen #include "control.h"
35910f1678SSuman Anna #include "omap_device.h"
36deff82e6SSebastian Reichel #include "omap-secure.h"
37deff82e6SSebastian Reichel #include "soc.h"
38f9d50fefSGrazvydas Ignotas #include "hsmmc.h"
396a08e1e6STony Lindgren 
4010c1f7d3STony Lindgren static struct omap_hsmmc_platform_data __maybe_unused mmc_pdata[2];
4110c1f7d3STony Lindgren 
426a08e1e6STony Lindgren struct pdata_init {
436a08e1e6STony Lindgren 	const char *compatible;
446a08e1e6STony Lindgren 	void (*fn)(void);
456a08e1e6STony Lindgren };
466a08e1e6STony Lindgren 
47f734a9b3SSekhar Nori static struct of_dev_auxdata omap_auxdata_lookup[];
48dad12d11STony Lindgren static struct twl4030_gpio_platform_data twl_gpio_auxdata;
49fa590c92STony Lindgren 
50fa590c92STony Lindgren #ifdef CONFIG_MACH_NOKIA_N8X0
51fa590c92STony Lindgren static void __init omap2420_n8x0_legacy_init(void)
52fa590c92STony Lindgren {
53fa590c92STony Lindgren 	omap_auxdata_lookup[0].platform_data = n8x0_legacy_init();
54fa590c92STony Lindgren }
55fa590c92STony Lindgren #else
56fa590c92STony Lindgren #define omap2420_n8x0_legacy_init	NULL
57fa590c92STony Lindgren #endif
58fa590c92STony Lindgren 
59faf4bd47SAaro Koskinen #ifdef CONFIG_ARCH_OMAP3
60b96b332fSTony Lindgren /*
61b96b332fSTony Lindgren  * Configures GPIOs 126, 127 and 129 to 1.8V mode instead of 3.0V
62b96b332fSTony Lindgren  * mode for MMC1 in case bootloader did not configure things.
63b96b332fSTony Lindgren  * Note that if the pins are used for MMC1, pbias-regulator
64b96b332fSTony Lindgren  * manages the IO voltage.
65b96b332fSTony Lindgren  */
66b96b332fSTony Lindgren static void __init omap3_gpio126_127_129(void)
67b96b332fSTony Lindgren {
68b96b332fSTony Lindgren 	u32 reg;
69b96b332fSTony Lindgren 
70b96b332fSTony Lindgren 	reg = omap_ctrl_readl(OMAP343X_CONTROL_PBIAS_LITE);
71b96b332fSTony Lindgren 	reg &= ~OMAP343X_PBIASLITEVMODE1;
72b96b332fSTony Lindgren 	reg |= OMAP343X_PBIASLITEPWRDNZ1;
73b96b332fSTony Lindgren 	omap_ctrl_writel(reg, OMAP343X_CONTROL_PBIAS_LITE);
74b96b332fSTony Lindgren 	if (cpu_is_omap3630()) {
75b96b332fSTony Lindgren 		reg = omap_ctrl_readl(OMAP34XX_CONTROL_WKUP_CTRL);
76b96b332fSTony Lindgren 		reg |= OMAP36XX_GPIO_IO_PWRDNZ;
77b96b332fSTony Lindgren 		omap_ctrl_writel(reg, OMAP34XX_CONTROL_WKUP_CTRL);
78b96b332fSTony Lindgren 	}
79b96b332fSTony Lindgren }
80b96b332fSTony Lindgren 
81faf4bd47SAaro Koskinen static void __init hsmmc2_internal_input_clk(void)
82faf4bd47SAaro Koskinen {
83faf4bd47SAaro Koskinen 	u32 reg;
84faf4bd47SAaro Koskinen 
85faf4bd47SAaro Koskinen 	reg = omap_ctrl_readl(OMAP343X_CONTROL_DEVCONF1);
86faf4bd47SAaro Koskinen 	reg |= OMAP2_MMCSDIO2ADPCLKISEL;
87faf4bd47SAaro Koskinen 	omap_ctrl_writel(reg, OMAP343X_CONTROL_DEVCONF1);
88faf4bd47SAaro Koskinen }
8915c9887eSJavier Martinez Canillas 
90910f1678SSuman Anna static struct iommu_platform_data omap3_iommu_pdata = {
91910f1678SSuman Anna 	.reset_name = "mmu",
92910f1678SSuman Anna 	.assert_reset = omap_device_assert_hardreset,
93910f1678SSuman Anna 	.deassert_reset = omap_device_deassert_hardreset,
94910f1678SSuman Anna };
95910f1678SSuman Anna 
960f0cfc69STony Lindgren static int omap3_sbc_t3730_twl_callback(struct device *dev,
970f0cfc69STony Lindgren 					   unsigned gpio,
980f0cfc69STony Lindgren 					   unsigned ngpio)
990f0cfc69STony Lindgren {
1000f0cfc69STony Lindgren 	int res;
1010f0cfc69STony Lindgren 
1020f0cfc69STony Lindgren 	res = gpio_request_one(gpio + 2, GPIOF_OUT_INIT_HIGH,
103d234e423SDmitry Lifshitz 			       "wlan pwr");
1040f0cfc69STony Lindgren 	if (res)
1050f0cfc69STony Lindgren 		return res;
1060f0cfc69STony Lindgren 
1070f0cfc69STony Lindgren 	gpio_export(gpio, 0);
1080f0cfc69STony Lindgren 
1090f0cfc69STony Lindgren 	return 0;
1100f0cfc69STony Lindgren }
1110f0cfc69STony Lindgren 
112b62d91e5SDmitry Lifshitz static void __init omap3_sbc_t3x_usb_hub_init(int gpio, char *hub_name)
113b62d91e5SDmitry Lifshitz {
114b62d91e5SDmitry Lifshitz 	int err = gpio_request_one(gpio, GPIOF_OUT_INIT_LOW, hub_name);
115b62d91e5SDmitry Lifshitz 
116b62d91e5SDmitry Lifshitz 	if (err) {
117b62d91e5SDmitry Lifshitz 		pr_err("SBC-T3x: %s reset gpio request failed: %d\n",
118b62d91e5SDmitry Lifshitz 			hub_name, err);
119b62d91e5SDmitry Lifshitz 		return;
120b62d91e5SDmitry Lifshitz 	}
121b62d91e5SDmitry Lifshitz 
122b62d91e5SDmitry Lifshitz 	gpio_export(gpio, 0);
123b62d91e5SDmitry Lifshitz 
124b62d91e5SDmitry Lifshitz 	udelay(10);
125b62d91e5SDmitry Lifshitz 	gpio_set_value(gpio, 1);
126b62d91e5SDmitry Lifshitz 	msleep(1);
127b62d91e5SDmitry Lifshitz }
128b62d91e5SDmitry Lifshitz 
1290f0cfc69STony Lindgren static void __init omap3_sbc_t3730_twl_init(void)
1300f0cfc69STony Lindgren {
1310f0cfc69STony Lindgren 	twl_gpio_auxdata.setup = omap3_sbc_t3730_twl_callback;
1320f0cfc69STony Lindgren }
1330f0cfc69STony Lindgren 
1340f0cfc69STony Lindgren static void __init omap3_sbc_t3730_legacy_init(void)
1350f0cfc69STony Lindgren {
136b62d91e5SDmitry Lifshitz 	omap3_sbc_t3x_usb_hub_init(167, "sb-t35 usb hub");
1370f0cfc69STony Lindgren }
1380f0cfc69STony Lindgren 
13940ecc02eSDmitry Lifshitz static void __init omap3_sbc_t3530_legacy_init(void)
14040ecc02eSDmitry Lifshitz {
141b62d91e5SDmitry Lifshitz 	omap3_sbc_t3x_usb_hub_init(167, "sb-t35 usb hub");
14240ecc02eSDmitry Lifshitz }
14340ecc02eSDmitry Lifshitz 
144f734a9b3SSekhar Nori static struct ti_st_plat_data wilink_pdata = {
145d565b5f4SEnric Balletbo i Serra 	.nshutdown_gpio = 137,
146d565b5f4SEnric Balletbo i Serra 	.dev_name = "/dev/ttyO1",
147d565b5f4SEnric Balletbo i Serra 	.flow_cntrl = 1,
148d565b5f4SEnric Balletbo i Serra 	.baud_rate = 300000,
149d565b5f4SEnric Balletbo i Serra };
150d565b5f4SEnric Balletbo i Serra 
151d565b5f4SEnric Balletbo i Serra static struct platform_device wl18xx_device = {
152d565b5f4SEnric Balletbo i Serra 	.name	= "kim",
153d565b5f4SEnric Balletbo i Serra 	.id	= -1,
154d565b5f4SEnric Balletbo i Serra 	.dev	= {
155d565b5f4SEnric Balletbo i Serra 		.platform_data = &wilink_pdata,
156d565b5f4SEnric Balletbo i Serra 	}
157d565b5f4SEnric Balletbo i Serra };
158d565b5f4SEnric Balletbo i Serra 
159485fa126SAdam Ford static struct ti_st_plat_data wilink7_pdata = {
160485fa126SAdam Ford 	.nshutdown_gpio = 162,
161485fa126SAdam Ford 	.dev_name = "/dev/ttyO1",
162485fa126SAdam Ford 	.flow_cntrl = 1,
163a3ac3507SAdam Ford 	.baud_rate = 3000000,
164485fa126SAdam Ford };
165485fa126SAdam Ford 
166485fa126SAdam Ford static struct platform_device wl128x_device = {
167485fa126SAdam Ford 	.name	= "kim",
168485fa126SAdam Ford 	.id	= -1,
169485fa126SAdam Ford 	.dev	= {
170485fa126SAdam Ford 		.platform_data = &wilink7_pdata,
171485fa126SAdam Ford 	}
172485fa126SAdam Ford };
173485fa126SAdam Ford 
174d565b5f4SEnric Balletbo i Serra static struct platform_device btwilink_device = {
175d565b5f4SEnric Balletbo i Serra 	.name	= "btwilink",
176d565b5f4SEnric Balletbo i Serra 	.id	= -1,
177d565b5f4SEnric Balletbo i Serra };
178d565b5f4SEnric Balletbo i Serra 
179d565b5f4SEnric Balletbo i Serra static void __init omap3_igep0020_rev_f_legacy_init(void)
18015c9887eSJavier Martinez Canillas {
181d565b5f4SEnric Balletbo i Serra 	platform_device_register(&wl18xx_device);
182d565b5f4SEnric Balletbo i Serra 	platform_device_register(&btwilink_device);
183d565b5f4SEnric Balletbo i Serra }
184d565b5f4SEnric Balletbo i Serra 
185d565b5f4SEnric Balletbo i Serra static void __init omap3_igep0030_rev_g_legacy_init(void)
186d565b5f4SEnric Balletbo i Serra {
187d565b5f4SEnric Balletbo i Serra 	platform_device_register(&wl18xx_device);
188d565b5f4SEnric Balletbo i Serra 	platform_device_register(&btwilink_device);
18915c9887eSJavier Martinez Canillas }
19079b39f79STony Lindgren 
19179b39f79STony Lindgren static void __init omap3_evm_legacy_init(void)
19279b39f79STony Lindgren {
1935b7610f2STony Lindgren 	hsmmc2_internal_input_clk();
19479b39f79STony Lindgren }
19571900314STony Lindgren 
19671900314STony Lindgren static void am35xx_enable_emac_int(void)
19771900314STony Lindgren {
19871900314STony Lindgren 	u32 v;
19971900314STony Lindgren 
20071900314STony Lindgren 	v = omap_ctrl_readl(AM35XX_CONTROL_LVL_INTR_CLEAR);
20171900314STony Lindgren 	v |= (AM35XX_CPGMAC_C0_RX_PULSE_CLR | AM35XX_CPGMAC_C0_TX_PULSE_CLR |
20271900314STony Lindgren 	      AM35XX_CPGMAC_C0_MISC_PULSE_CLR | AM35XX_CPGMAC_C0_RX_THRESH_CLR);
20371900314STony Lindgren 	omap_ctrl_writel(v, AM35XX_CONTROL_LVL_INTR_CLEAR);
20471900314STony Lindgren 	omap_ctrl_readl(AM35XX_CONTROL_LVL_INTR_CLEAR); /* OCP barrier */
20571900314STony Lindgren }
20671900314STony Lindgren 
20771900314STony Lindgren static void am35xx_disable_emac_int(void)
20871900314STony Lindgren {
20971900314STony Lindgren 	u32 v;
21071900314STony Lindgren 
21171900314STony Lindgren 	v = omap_ctrl_readl(AM35XX_CONTROL_LVL_INTR_CLEAR);
21271900314STony Lindgren 	v |= (AM35XX_CPGMAC_C0_RX_PULSE_CLR | AM35XX_CPGMAC_C0_TX_PULSE_CLR);
21371900314STony Lindgren 	omap_ctrl_writel(v, AM35XX_CONTROL_LVL_INTR_CLEAR);
21471900314STony Lindgren 	omap_ctrl_readl(AM35XX_CONTROL_LVL_INTR_CLEAR); /* OCP barrier */
21571900314STony Lindgren }
21671900314STony Lindgren 
21771900314STony Lindgren static struct emac_platform_data am35xx_emac_pdata = {
21871900314STony Lindgren 	.interrupt_enable	= am35xx_enable_emac_int,
21971900314STony Lindgren 	.interrupt_disable	= am35xx_disable_emac_int,
22071900314STony Lindgren };
22171900314STony Lindgren 
222fb45105aSDmitry Lifshitz static void __init am35xx_emac_reset(void)
22371900314STony Lindgren {
22471900314STony Lindgren 	u32 v;
22571900314STony Lindgren 
22671900314STony Lindgren 	v = omap_ctrl_readl(AM35XX_CONTROL_IP_SW_RESET);
22771900314STony Lindgren 	v &= ~AM35XX_CPGMACSS_SW_RST;
22871900314STony Lindgren 	omap_ctrl_writel(v, AM35XX_CONTROL_IP_SW_RESET);
22971900314STony Lindgren 	omap_ctrl_readl(AM35XX_CONTROL_IP_SW_RESET); /* OCP barrier */
23071900314STony Lindgren }
231deff82e6SSebastian Reichel 
232fb45105aSDmitry Lifshitz static struct gpio cm_t3517_wlan_gpios[] __initdata = {
233fb45105aSDmitry Lifshitz 	{ 56,	GPIOF_OUT_INIT_HIGH,	"wlan pwr" },
234fb45105aSDmitry Lifshitz 	{ 4,	GPIOF_OUT_INIT_HIGH,	"xcvr noe" },
235fb45105aSDmitry Lifshitz };
236fb45105aSDmitry Lifshitz 
237fb45105aSDmitry Lifshitz static void __init omap3_sbc_t3517_wifi_init(void)
238fb45105aSDmitry Lifshitz {
239fb45105aSDmitry Lifshitz 	int err = gpio_request_array(cm_t3517_wlan_gpios,
240fb45105aSDmitry Lifshitz 				ARRAY_SIZE(cm_t3517_wlan_gpios));
241fb45105aSDmitry Lifshitz 	if (err) {
242fb45105aSDmitry Lifshitz 		pr_err("SBC-T3517: wl12xx gpios request failed: %d\n", err);
243fb45105aSDmitry Lifshitz 		return;
244fb45105aSDmitry Lifshitz 	}
245fb45105aSDmitry Lifshitz 
246fb45105aSDmitry Lifshitz 	gpio_export(cm_t3517_wlan_gpios[0].gpio, 0);
247fb45105aSDmitry Lifshitz 	gpio_export(cm_t3517_wlan_gpios[1].gpio, 0);
248fb45105aSDmitry Lifshitz 
249fb45105aSDmitry Lifshitz 	msleep(100);
250fb45105aSDmitry Lifshitz 	gpio_set_value(cm_t3517_wlan_gpios[1].gpio, 0);
251fb45105aSDmitry Lifshitz }
252fb45105aSDmitry Lifshitz 
253fb45105aSDmitry Lifshitz static void __init omap3_sbc_t3517_legacy_init(void)
254fb45105aSDmitry Lifshitz {
255b62d91e5SDmitry Lifshitz 	omap3_sbc_t3x_usb_hub_init(152, "cm-t3517 usb hub");
256b62d91e5SDmitry Lifshitz 	omap3_sbc_t3x_usb_hub_init(98, "sb-t35 usb hub");
257fb45105aSDmitry Lifshitz 	am35xx_emac_reset();
258fb45105aSDmitry Lifshitz 	hsmmc2_internal_input_clk();
259fb45105aSDmitry Lifshitz 	omap3_sbc_t3517_wifi_init();
260fb45105aSDmitry Lifshitz }
261fb45105aSDmitry Lifshitz 
262fb45105aSDmitry Lifshitz static void __init am3517_evm_legacy_init(void)
263fb45105aSDmitry Lifshitz {
264fb45105aSDmitry Lifshitz 	am35xx_emac_reset();
265fb45105aSDmitry Lifshitz }
266f83ccb93SLinus Torvalds 
26714c0a5b4SSebastian Reichel static struct platform_device omap3_rom_rng_device = {
26814c0a5b4SSebastian Reichel 	.name		= "omap3-rom-rng",
26914c0a5b4SSebastian Reichel 	.id		= -1,
27014c0a5b4SSebastian Reichel 	.dev	= {
27114c0a5b4SSebastian Reichel 		.platform_data	= rx51_secure_rng_call,
27214c0a5b4SSebastian Reichel 	},
27314c0a5b4SSebastian Reichel };
27414c0a5b4SSebastian Reichel 
275deff82e6SSebastian Reichel static void __init nokia_n900_legacy_init(void)
276deff82e6SSebastian Reichel {
277deff82e6SSebastian Reichel 	hsmmc2_internal_input_clk();
27810c1f7d3STony Lindgren 	mmc_pdata[0].name = "external";
27910c1f7d3STony Lindgren 	mmc_pdata[1].name = "internal";
280deff82e6SSebastian Reichel 
281deff82e6SSebastian Reichel 	if (omap_type() == OMAP2_DEVICE_TYPE_SEC) {
282deff82e6SSebastian Reichel 		if (IS_ENABLED(CONFIG_ARM_ERRATA_430973)) {
283deff82e6SSebastian Reichel 			pr_info("RX-51: Enabling ARM errata 430973 workaround\n");
284deff82e6SSebastian Reichel 			/* set IBE to 1 */
285deff82e6SSebastian Reichel 			rx51_secure_update_aux_cr(BIT(6), 0);
286deff82e6SSebastian Reichel 		} else {
2873d0cb73eSJoe Perches 			pr_warn("RX-51: Not enabling ARM errata 430973 workaround\n");
2883d0cb73eSJoe Perches 			pr_warn("Thumb binaries may crash randomly without this workaround\n");
289deff82e6SSebastian Reichel 		}
29014c0a5b4SSebastian Reichel 
291448f8bc6SAaro Koskinen 		pr_info("RX-51: Registering OMAP3 HWRNG device\n");
29214c0a5b4SSebastian Reichel 		platform_device_register(&omap3_rom_rng_device);
293deff82e6SSebastian Reichel 	}
294deff82e6SSebastian Reichel }
29563dd5bc0SStefan Roese 
29663dd5bc0SStefan Roese static void __init omap3_tao3530_legacy_init(void)
29763dd5bc0SStefan Roese {
29863dd5bc0SStefan Roese 	hsmmc2_internal_input_clk();
299faf4bd47SAaro Koskinen }
300fc53e2ccSGrazvydas Ignotas 
301485fa126SAdam Ford static void __init omap3_logicpd_torpedo_init(void)
302485fa126SAdam Ford {
303485fa126SAdam Ford 	omap3_gpio126_127_129();
304485fa126SAdam Ford 	platform_device_register(&wl128x_device);
305485fa126SAdam Ford 	platform_device_register(&btwilink_device);
306485fa126SAdam Ford }
307485fa126SAdam Ford 
308f9d50fefSGrazvydas Ignotas /* omap3pandora legacy devices */
309f9d50fefSGrazvydas Ignotas #define PANDORA_WIFI_IRQ_GPIO		21
310f9d50fefSGrazvydas Ignotas #define PANDORA_WIFI_NRESET_GPIO	23
311f9d50fefSGrazvydas Ignotas 
312fc53e2ccSGrazvydas Ignotas static struct platform_device pandora_backlight = {
313fc53e2ccSGrazvydas Ignotas 	.name	= "pandora-backlight",
314fc53e2ccSGrazvydas Ignotas 	.id	= -1,
315fc53e2ccSGrazvydas Ignotas };
316fc53e2ccSGrazvydas Ignotas 
317f9d50fefSGrazvydas Ignotas static struct regulator_consumer_supply pandora_vmmc3_supply[] = {
318f9d50fefSGrazvydas Ignotas 	REGULATOR_SUPPLY("vmmc", "omap_hsmmc.2"),
319f9d50fefSGrazvydas Ignotas };
320f9d50fefSGrazvydas Ignotas 
321f9d50fefSGrazvydas Ignotas static struct regulator_init_data pandora_vmmc3 = {
322f9d50fefSGrazvydas Ignotas 	.constraints = {
323f9d50fefSGrazvydas Ignotas 		.valid_ops_mask		= REGULATOR_CHANGE_STATUS,
324f9d50fefSGrazvydas Ignotas 	},
325f9d50fefSGrazvydas Ignotas 	.num_consumer_supplies	= ARRAY_SIZE(pandora_vmmc3_supply),
326f9d50fefSGrazvydas Ignotas 	.consumer_supplies	= pandora_vmmc3_supply,
327f9d50fefSGrazvydas Ignotas };
328f9d50fefSGrazvydas Ignotas 
329f9d50fefSGrazvydas Ignotas static struct fixed_voltage_config pandora_vwlan = {
330f9d50fefSGrazvydas Ignotas 	.supply_name		= "vwlan",
331f9d50fefSGrazvydas Ignotas 	.microvolts		= 1800000, /* 1.8V */
332f9d50fefSGrazvydas Ignotas 	.startup_delay		= 50000, /* 50ms */
333f9d50fefSGrazvydas Ignotas 	.enable_high		= 1,
334f9d50fefSGrazvydas Ignotas 	.init_data		= &pandora_vmmc3,
335f9d50fefSGrazvydas Ignotas };
336f9d50fefSGrazvydas Ignotas 
337f9d50fefSGrazvydas Ignotas static struct platform_device pandora_vwlan_device = {
338f9d50fefSGrazvydas Ignotas 	.name		= "reg-fixed-voltage",
339f9d50fefSGrazvydas Ignotas 	.id		= 1,
340f9d50fefSGrazvydas Ignotas 	.dev = {
341f9d50fefSGrazvydas Ignotas 		.platform_data = &pandora_vwlan,
342f9d50fefSGrazvydas Ignotas 	},
343f9d50fefSGrazvydas Ignotas };
344f9d50fefSGrazvydas Ignotas 
345*efdfeb07SLinus Walleij static struct gpiod_lookup_table pandora_vwlan_gpiod_table = {
346*efdfeb07SLinus Walleij 	.dev_id = "reg-fixed-voltage.1",
347*efdfeb07SLinus Walleij 	.table = {
348*efdfeb07SLinus Walleij 		/*
349*efdfeb07SLinus Walleij 		 * As this is a low GPIO number it should be at the first
350*efdfeb07SLinus Walleij 		 * GPIO bank.
351*efdfeb07SLinus Walleij 		 */
352*efdfeb07SLinus Walleij 		GPIO_LOOKUP("gpio-0-31", PANDORA_WIFI_NRESET_GPIO,
353*efdfeb07SLinus Walleij 			    NULL, GPIO_ACTIVE_HIGH),
354*efdfeb07SLinus Walleij 		{ },
355*efdfeb07SLinus Walleij 	},
356*efdfeb07SLinus Walleij };
357*efdfeb07SLinus Walleij 
358f9d50fefSGrazvydas Ignotas static void pandora_wl1251_init_card(struct mmc_card *card)
359f9d50fefSGrazvydas Ignotas {
360f9d50fefSGrazvydas Ignotas 	/*
361f9d50fefSGrazvydas Ignotas 	 * We have TI wl1251 attached to MMC3. Pass this information to
362f9d50fefSGrazvydas Ignotas 	 * SDIO core because it can't be probed by normal methods.
363f9d50fefSGrazvydas Ignotas 	 */
364f9d50fefSGrazvydas Ignotas 	if (card->type == MMC_TYPE_SDIO || card->type == MMC_TYPE_SD_COMBO) {
365f9d50fefSGrazvydas Ignotas 		card->quirks |= MMC_QUIRK_NONSTD_SDIO;
366f9d50fefSGrazvydas Ignotas 		card->cccr.wide_bus = 1;
367f9d50fefSGrazvydas Ignotas 		card->cis.vendor = 0x104c;
368f9d50fefSGrazvydas Ignotas 		card->cis.device = 0x9066;
369f9d50fefSGrazvydas Ignotas 		card->cis.blksize = 512;
370f9d50fefSGrazvydas Ignotas 		card->cis.max_dtr = 24000000;
371f9d50fefSGrazvydas Ignotas 		card->ocr = 0x80;
372f9d50fefSGrazvydas Ignotas 	}
373f9d50fefSGrazvydas Ignotas }
374f9d50fefSGrazvydas Ignotas 
375f9d50fefSGrazvydas Ignotas static struct omap2_hsmmc_info pandora_mmc3[] = {
376f9d50fefSGrazvydas Ignotas 	{
377f9d50fefSGrazvydas Ignotas 		.mmc		= 3,
378f9d50fefSGrazvydas Ignotas 		.caps		= MMC_CAP_4_BIT_DATA | MMC_CAP_POWER_OFF_CARD,
379f9d50fefSGrazvydas Ignotas 		.gpio_cd	= -EINVAL,
380f9d50fefSGrazvydas Ignotas 		.gpio_wp	= -EINVAL,
381f9d50fefSGrazvydas Ignotas 		.init_card	= pandora_wl1251_init_card,
382f9d50fefSGrazvydas Ignotas 	},
383f9d50fefSGrazvydas Ignotas 	{}	/* Terminator */
384f9d50fefSGrazvydas Ignotas };
385f9d50fefSGrazvydas Ignotas 
386f9d50fefSGrazvydas Ignotas static void __init pandora_wl1251_init(void)
387f9d50fefSGrazvydas Ignotas {
388f9d50fefSGrazvydas Ignotas 	struct wl1251_platform_data pandora_wl1251_pdata;
389f9d50fefSGrazvydas Ignotas 	int ret;
390f9d50fefSGrazvydas Ignotas 
391f9d50fefSGrazvydas Ignotas 	memset(&pandora_wl1251_pdata, 0, sizeof(pandora_wl1251_pdata));
392f9d50fefSGrazvydas Ignotas 
393f9d50fefSGrazvydas Ignotas 	pandora_wl1251_pdata.power_gpio = -1;
394f9d50fefSGrazvydas Ignotas 
395f9d50fefSGrazvydas Ignotas 	ret = gpio_request_one(PANDORA_WIFI_IRQ_GPIO, GPIOF_IN, "wl1251 irq");
396f9d50fefSGrazvydas Ignotas 	if (ret < 0)
397f9d50fefSGrazvydas Ignotas 		goto fail;
398f9d50fefSGrazvydas Ignotas 
399f9d50fefSGrazvydas Ignotas 	pandora_wl1251_pdata.irq = gpio_to_irq(PANDORA_WIFI_IRQ_GPIO);
400f9d50fefSGrazvydas Ignotas 	if (pandora_wl1251_pdata.irq < 0)
401f9d50fefSGrazvydas Ignotas 		goto fail_irq;
402f9d50fefSGrazvydas Ignotas 
403f9d50fefSGrazvydas Ignotas 	pandora_wl1251_pdata.use_eeprom = true;
404f9d50fefSGrazvydas Ignotas 	ret = wl1251_set_platform_data(&pandora_wl1251_pdata);
405f9d50fefSGrazvydas Ignotas 	if (ret < 0)
406f9d50fefSGrazvydas Ignotas 		goto fail_irq;
407f9d50fefSGrazvydas Ignotas 
408f9d50fefSGrazvydas Ignotas 	return;
409f9d50fefSGrazvydas Ignotas 
410f9d50fefSGrazvydas Ignotas fail_irq:
411f9d50fefSGrazvydas Ignotas 	gpio_free(PANDORA_WIFI_IRQ_GPIO);
412f9d50fefSGrazvydas Ignotas fail:
413f9d50fefSGrazvydas Ignotas 	pr_err("wl1251 board initialisation failed\n");
414f9d50fefSGrazvydas Ignotas }
415f9d50fefSGrazvydas Ignotas 
416fc53e2ccSGrazvydas Ignotas static void __init omap3_pandora_legacy_init(void)
417fc53e2ccSGrazvydas Ignotas {
418fc53e2ccSGrazvydas Ignotas 	platform_device_register(&pandora_backlight);
419*efdfeb07SLinus Walleij 	gpiod_add_lookup_table(&pandora_vwlan_gpiod_table);
420f9d50fefSGrazvydas Ignotas 	platform_device_register(&pandora_vwlan_device);
421f9d50fefSGrazvydas Ignotas 	omap_hsmmc_init(pandora_mmc3);
422f9d50fefSGrazvydas Ignotas 	omap_hsmmc_late_init(pandora_mmc3);
423f9d50fefSGrazvydas Ignotas 	pandora_wl1251_init();
424fc53e2ccSGrazvydas Ignotas }
425faf4bd47SAaro Koskinen #endif /* CONFIG_ARCH_OMAP3 */
426faf4bd47SAaro Koskinen 
42767eb1e6eSSuman Anna #if defined(CONFIG_ARCH_OMAP4) || defined(CONFIG_SOC_OMAP5)
428910f1678SSuman Anna static struct iommu_platform_data omap4_iommu_pdata = {
429910f1678SSuman Anna 	.reset_name = "mmu_cache",
430910f1678SSuman Anna 	.assert_reset = omap_device_assert_hardreset,
431910f1678SSuman Anna 	.deassert_reset = omap_device_deassert_hardreset,
432910f1678SSuman Anna };
4333e7a3185STony Lindgren #endif
4343e7a3185STony Lindgren 
4356da74c54SDave Gerlach #if defined(CONFIG_SOC_AM33XX) || defined(CONFIG_SOC_AM43XX)
4366da74c54SDave Gerlach static struct wkup_m3_platform_data wkup_m3_data = {
4376da74c54SDave Gerlach 	.reset_name = "wkup_m3",
4386da74c54SDave Gerlach 	.assert_reset = omap_device_assert_hardreset,
4396da74c54SDave Gerlach 	.deassert_reset = omap_device_deassert_hardreset,
4406da74c54SDave Gerlach };
4416da74c54SDave Gerlach #endif
4426da74c54SDave Gerlach 
4433e7a3185STony Lindgren #ifdef CONFIG_SOC_OMAP5
4443e7a3185STony Lindgren static void __init omap5_uevm_legacy_init(void)
4453e7a3185STony Lindgren {
4463e7a3185STony Lindgren }
4473e7a3185STony Lindgren #endif
4483e7a3185STony Lindgren 
449fc66ce0bSSekhar Nori #ifdef CONFIG_SOC_DRA7XX
450fc66ce0bSSekhar Nori static struct omap_hsmmc_platform_data dra7_hsmmc_data_mmc1;
451fc66ce0bSSekhar Nori static struct omap_hsmmc_platform_data dra7_hsmmc_data_mmc2;
452fc66ce0bSSekhar Nori static struct omap_hsmmc_platform_data dra7_hsmmc_data_mmc3;
453fc66ce0bSSekhar Nori 
454fc66ce0bSSekhar Nori static void __init dra7x_evm_mmc_quirk(void)
455fc66ce0bSSekhar Nori {
456fc66ce0bSSekhar Nori 	if (omap_rev() == DRA752_REV_ES1_1 || omap_rev() == DRA752_REV_ES1_0) {
457fc66ce0bSSekhar Nori 		dra7_hsmmc_data_mmc1.version = "rev11";
458fc66ce0bSSekhar Nori 		dra7_hsmmc_data_mmc1.max_freq = 96000000;
459fc66ce0bSSekhar Nori 
460fc66ce0bSSekhar Nori 		dra7_hsmmc_data_mmc2.version = "rev11";
461fc66ce0bSSekhar Nori 		dra7_hsmmc_data_mmc2.max_freq = 48000000;
462fc66ce0bSSekhar Nori 
463fc66ce0bSSekhar Nori 		dra7_hsmmc_data_mmc3.version = "rev11";
464fc66ce0bSSekhar Nori 		dra7_hsmmc_data_mmc3.max_freq = 48000000;
465fc66ce0bSSekhar Nori 	}
466fc66ce0bSSekhar Nori }
467fc66ce0bSSekhar Nori #endif
468fc66ce0bSSekhar Nori 
469ef70b0bdSTony Lindgren static int ti_sysc_enable_module(struct device *dev,
470ef70b0bdSTony Lindgren 				 const struct ti_sysc_cookie *cookie)
471ef70b0bdSTony Lindgren {
472ef70b0bdSTony Lindgren 	if (!cookie->data)
473ef70b0bdSTony Lindgren 		return -EINVAL;
474ef70b0bdSTony Lindgren 
475ef70b0bdSTony Lindgren 	return omap_hwmod_enable(cookie->data);
476ef70b0bdSTony Lindgren }
477ef70b0bdSTony Lindgren 
478ef70b0bdSTony Lindgren static int ti_sysc_idle_module(struct device *dev,
479ef70b0bdSTony Lindgren 			       const struct ti_sysc_cookie *cookie)
480ef70b0bdSTony Lindgren {
481ef70b0bdSTony Lindgren 	if (!cookie->data)
482ef70b0bdSTony Lindgren 		return -EINVAL;
483ef70b0bdSTony Lindgren 
484ef70b0bdSTony Lindgren 	return omap_hwmod_idle(cookie->data);
485ef70b0bdSTony Lindgren }
486ef70b0bdSTony Lindgren 
487ef70b0bdSTony Lindgren static int ti_sysc_shutdown_module(struct device *dev,
488ef70b0bdSTony Lindgren 				   const struct ti_sysc_cookie *cookie)
489ef70b0bdSTony Lindgren {
490ef70b0bdSTony Lindgren 	if (!cookie->data)
491ef70b0bdSTony Lindgren 		return -EINVAL;
492ef70b0bdSTony Lindgren 
493ef70b0bdSTony Lindgren 	return omap_hwmod_shutdown(cookie->data);
494ef70b0bdSTony Lindgren }
495ef70b0bdSTony Lindgren 
496ef70b0bdSTony Lindgren static struct of_dev_auxdata omap_auxdata_lookup[];
497ef70b0bdSTony Lindgren 
498ef70b0bdSTony Lindgren static struct ti_sysc_platform_data ti_sysc_pdata = {
499ef70b0bdSTony Lindgren 	.auxdata = omap_auxdata_lookup,
500695eea3dSTony Lindgren 	.init_module = omap_hwmod_init_module,
501ef70b0bdSTony Lindgren 	.enable_module = ti_sysc_enable_module,
502ef70b0bdSTony Lindgren 	.idle_module = ti_sysc_idle_module,
503ef70b0bdSTony Lindgren 	.shutdown_module = ti_sysc_shutdown_module,
504ef70b0bdSTony Lindgren };
505ef70b0bdSTony Lindgren 
50630a69ef7STony Lindgren static struct pcs_pdata pcs_pdata;
50730a69ef7STony Lindgren 
50830a69ef7STony Lindgren void omap_pcs_legacy_init(int irq, void (*rearm)(void))
50930a69ef7STony Lindgren {
51030a69ef7STony Lindgren 	pcs_pdata.irq = irq;
51130a69ef7STony Lindgren 	pcs_pdata.rearm = rearm;
51230a69ef7STony Lindgren }
51330a69ef7STony Lindgren 
514036582f7STony Lindgren /*
515dad12d11STony Lindgren  * GPIOs for TWL are initialized by the I2C bus and need custom
516dad12d11STony Lindgren  * handing until DSS has device tree bindings.
517dad12d11STony Lindgren  */
518dad12d11STony Lindgren void omap_auxdata_legacy_init(struct device *dev)
519dad12d11STony Lindgren {
520dad12d11STony Lindgren 	if (dev->platform_data)
521dad12d11STony Lindgren 		return;
522dad12d11STony Lindgren 
523dad12d11STony Lindgren 	if (strcmp("twl4030-gpio", dev_name(dev)))
524dad12d11STony Lindgren 		return;
525dad12d11STony Lindgren 
526dad12d11STony Lindgren 	dev->platform_data = &twl_gpio_auxdata;
527dad12d11STony Lindgren }
528dad12d11STony Lindgren 
529c26c84c9SPeter Ujfalusi #if IS_ENABLED(CONFIG_SND_OMAP_SOC_MCBSP)
530c26c84c9SPeter Ujfalusi static struct omap_mcbsp_platform_data mcbsp_pdata;
531c26c84c9SPeter Ujfalusi static void __init omap3_mcbsp_init(void)
532c26c84c9SPeter Ujfalusi {
533c26c84c9SPeter Ujfalusi 	omap3_mcbsp_init_pdata_callback(&mcbsp_pdata);
534c26c84c9SPeter Ujfalusi }
535c26c84c9SPeter Ujfalusi #else
536c26c84c9SPeter Ujfalusi static void __init omap3_mcbsp_init(void) {}
537c26c84c9SPeter Ujfalusi #endif
538c26c84c9SPeter Ujfalusi 
539dad12d11STony Lindgren /*
540036582f7STony Lindgren  * Few boards still need auxdata populated before we populate
541036582f7STony Lindgren  * the dev entries in of_platform_populate().
542036582f7STony Lindgren  */
543036582f7STony Lindgren static struct pdata_init auxdata_quirks[] __initdata = {
544fa590c92STony Lindgren #ifdef CONFIG_SOC_OMAP2420
545fa590c92STony Lindgren 	{ "nokia,n800", omap2420_n8x0_legacy_init, },
546fa590c92STony Lindgren 	{ "nokia,n810", omap2420_n8x0_legacy_init, },
547fa590c92STony Lindgren 	{ "nokia,n810-wimax", omap2420_n8x0_legacy_init, },
548fa590c92STony Lindgren #endif
5490f0cfc69STony Lindgren #ifdef CONFIG_ARCH_OMAP3
5500f0cfc69STony Lindgren 	{ "compulab,omap3-sbc-t3730", omap3_sbc_t3730_twl_init, },
5510f0cfc69STony Lindgren #endif
552036582f7STony Lindgren 	{ /* sentinel */ },
553036582f7STony Lindgren };
554036582f7STony Lindgren 
555d060b405STony Lindgren struct omap_sr_data __maybe_unused omap_sr_pdata[OMAP_SR_NR];
556d060b405STony Lindgren 
557ef70b0bdSTony Lindgren static struct of_dev_auxdata omap_auxdata_lookup[] = {
558036582f7STony Lindgren #ifdef CONFIG_MACH_NOKIA_N8X0
559036582f7STony Lindgren 	OF_DEV_AUXDATA("ti,omap2420-mmc", 0x4809c000, "mmci-omap.0", NULL),
560e92ce89cSFelipe Balbi 	OF_DEV_AUXDATA("menelaus", 0x72, "1-0072", &n8x0_menelaus_platform_data),
561e92ce89cSFelipe Balbi 	OF_DEV_AUXDATA("tlv320aic3x", 0x18, "2-0018", &n810_aic33_data),
562036582f7STony Lindgren #endif
56330a69ef7STony Lindgren #ifdef CONFIG_ARCH_OMAP3
564910f1678SSuman Anna 	OF_DEV_AUXDATA("ti,omap2-iommu", 0x5d000000, "5d000000.mmu",
565910f1678SSuman Anna 		       &omap3_iommu_pdata),
566d060b405STony Lindgren 	OF_DEV_AUXDATA("ti,omap3-smartreflex-core", 0x480cb000,
567d060b405STony Lindgren 		       "480cb000.smartreflex", &omap_sr_pdata[OMAP_SR_CORE]),
568d060b405STony Lindgren 	OF_DEV_AUXDATA("ti,omap3-smartreflex-mpu-iva", 0x480c9000,
569d060b405STony Lindgren 		       "480c9000.smartreflex", &omap_sr_pdata[OMAP_SR_MPU]),
57010c1f7d3STony Lindgren 	OF_DEV_AUXDATA("ti,omap3-hsmmc", 0x4809c000, "4809c000.mmc", &mmc_pdata[0]),
57110c1f7d3STony Lindgren 	OF_DEV_AUXDATA("ti,omap3-hsmmc", 0x480b4000, "480b4000.mmc", &mmc_pdata[1]),
57271900314STony Lindgren 	/* Only on am3517 */
57371900314STony Lindgren 	OF_DEV_AUXDATA("ti,davinci_mdio", 0x5c030000, "davinci_mdio.0", NULL),
57471900314STony Lindgren 	OF_DEV_AUXDATA("ti,am3517-emac", 0x5c000000, "davinci_emac.0",
57571900314STony Lindgren 		       &am35xx_emac_pdata),
576c26c84c9SPeter Ujfalusi 	/* McBSP modules with sidetone core */
577c26c84c9SPeter Ujfalusi #if IS_ENABLED(CONFIG_SND_OMAP_SOC_MCBSP)
578c26c84c9SPeter Ujfalusi 	OF_DEV_AUXDATA("ti,omap3-mcbsp", 0x49022000, "49022000.mcbsp", &mcbsp_pdata),
579c26c84c9SPeter Ujfalusi 	OF_DEV_AUXDATA("ti,omap3-mcbsp", 0x49024000, "49024000.mcbsp", &mcbsp_pdata),
580c26c84c9SPeter Ujfalusi #endif
58130a69ef7STony Lindgren #endif
5826da74c54SDave Gerlach #ifdef CONFIG_SOC_AM33XX
5836da74c54SDave Gerlach 	OF_DEV_AUXDATA("ti,am3352-wkup-m3", 0x44d00000, "44d00000.wkup_m3",
5846da74c54SDave Gerlach 		       &wkup_m3_data),
5856da74c54SDave Gerlach #endif
586dbbe9770SKeerthy #ifdef CONFIG_SOC_AM43XX
5876da74c54SDave Gerlach 	OF_DEV_AUXDATA("ti,am4372-wkup-m3", 0x44d00000, "44d00000.wkup_m3",
5886da74c54SDave Gerlach 		       &wkup_m3_data),
589dbbe9770SKeerthy #endif
59067eb1e6eSSuman Anna #if defined(CONFIG_ARCH_OMAP4) || defined(CONFIG_SOC_OMAP5)
591910f1678SSuman Anna 	OF_DEV_AUXDATA("ti,omap4-iommu", 0x4a066000, "4a066000.mmu",
592910f1678SSuman Anna 		       &omap4_iommu_pdata),
593910f1678SSuman Anna 	OF_DEV_AUXDATA("ti,omap4-iommu", 0x55082000, "55082000.mmu",
594910f1678SSuman Anna 		       &omap4_iommu_pdata),
595d060b405STony Lindgren 	OF_DEV_AUXDATA("ti,omap4-smartreflex-iva", 0x4a0db000,
596d060b405STony Lindgren 		       "4a0db000.smartreflex", &omap_sr_pdata[OMAP_SR_IVA]),
597d060b405STony Lindgren 	OF_DEV_AUXDATA("ti,omap4-smartreflex-core", 0x4a0dd000,
598d060b405STony Lindgren 		       "4a0dd000.smartreflex", &omap_sr_pdata[OMAP_SR_CORE]),
599d060b405STony Lindgren 	OF_DEV_AUXDATA("ti,omap4-smartreflex-mpu", 0x4a0d9000,
600d060b405STony Lindgren 		       "4a0d9000.smartreflex", &omap_sr_pdata[OMAP_SR_MPU]),
60130a69ef7STony Lindgren #endif
602fc66ce0bSSekhar Nori #ifdef CONFIG_SOC_DRA7XX
603fc66ce0bSSekhar Nori 	OF_DEV_AUXDATA("ti,dra7-hsmmc", 0x4809c000, "4809c000.mmc",
604fc66ce0bSSekhar Nori 		       &dra7_hsmmc_data_mmc1),
605fc66ce0bSSekhar Nori 	OF_DEV_AUXDATA("ti,dra7-hsmmc", 0x480b4000, "480b4000.mmc",
606fc66ce0bSSekhar Nori 		       &dra7_hsmmc_data_mmc2),
607fc66ce0bSSekhar Nori 	OF_DEV_AUXDATA("ti,dra7-hsmmc", 0x480ad000, "480ad000.mmc",
608fc66ce0bSSekhar Nori 		       &dra7_hsmmc_data_mmc3),
609fc66ce0bSSekhar Nori #endif
610d4f414e5STony Lindgren 	/* Common auxdata */
611ef70b0bdSTony Lindgren 	OF_DEV_AUXDATA("ti,sysc", 0, NULL, &ti_sysc_pdata),
612d4f414e5STony Lindgren 	OF_DEV_AUXDATA("pinctrl-single", 0, NULL, &pcs_pdata),
6138651bd8cSTony Lindgren 	{ /* sentinel */ },
6148651bd8cSTony Lindgren };
6158651bd8cSTony Lindgren 
616036582f7STony Lindgren /*
617036582f7STony Lindgren  * Few boards still need to initialize some legacy devices with
618036582f7STony Lindgren  * platform data until the drivers support device tree.
619036582f7STony Lindgren  */
6206a08e1e6STony Lindgren static struct pdata_init pdata_quirks[] __initdata = {
621faf4bd47SAaro Koskinen #ifdef CONFIG_ARCH_OMAP3
622fb45105aSDmitry Lifshitz 	{ "compulab,omap3-sbc-t3517", omap3_sbc_t3517_legacy_init, },
62340ecc02eSDmitry Lifshitz 	{ "compulab,omap3-sbc-t3530", omap3_sbc_t3530_legacy_init, },
6240f0cfc69STony Lindgren 	{ "compulab,omap3-sbc-t3730", omap3_sbc_t3730_legacy_init, },
625deff82e6SSebastian Reichel 	{ "nokia,omap3-n900", nokia_n900_legacy_init, },
626faf4bd47SAaro Koskinen 	{ "nokia,omap3-n9", hsmmc2_internal_input_clk, },
627faf4bd47SAaro Koskinen 	{ "nokia,omap3-n950", hsmmc2_internal_input_clk, },
628d565b5f4SEnric Balletbo i Serra 	{ "isee,omap3-igep0020-rev-f", omap3_igep0020_rev_f_legacy_init, },
629d565b5f4SEnric Balletbo i Serra 	{ "isee,omap3-igep0030-rev-g", omap3_igep0030_rev_g_legacy_init, },
630485fa126SAdam Ford 	{ "logicpd,dm3730-torpedo-devkit", omap3_logicpd_torpedo_init, },
63179b39f79STony Lindgren 	{ "ti,omap3-evm-37xx", omap3_evm_legacy_init, },
63271900314STony Lindgren 	{ "ti,am3517-evm", am3517_evm_legacy_init, },
63363dd5bc0SStefan Roese 	{ "technexion,omap3-tao3530", omap3_tao3530_legacy_init, },
634fc53e2ccSGrazvydas Ignotas 	{ "openpandora,omap3-pandora-600mhz", omap3_pandora_legacy_init, },
635fc53e2ccSGrazvydas Ignotas 	{ "openpandora,omap3-pandora-1ghz", omap3_pandora_legacy_init, },
636faf4bd47SAaro Koskinen #endif
6373e7a3185STony Lindgren #ifdef CONFIG_SOC_OMAP5
6383e7a3185STony Lindgren 	{ "ti,omap5-uevm", omap5_uevm_legacy_init, },
6393e7a3185STony Lindgren #endif
640fc66ce0bSSekhar Nori #ifdef CONFIG_SOC_DRA7XX
641fc66ce0bSSekhar Nori 	{ "ti,dra7-evm", dra7x_evm_mmc_quirk, },
642fc66ce0bSSekhar Nori #endif
6436a08e1e6STony Lindgren 	{ /* sentinel */ },
6446a08e1e6STony Lindgren };
6456a08e1e6STony Lindgren 
646036582f7STony Lindgren static void pdata_quirks_check(struct pdata_init *quirks)
6476a08e1e6STony Lindgren {
6486a08e1e6STony Lindgren 	while (quirks->compatible) {
6496a08e1e6STony Lindgren 		if (of_machine_is_compatible(quirks->compatible)) {
6506a08e1e6STony Lindgren 			if (quirks->fn)
6516a08e1e6STony Lindgren 				quirks->fn();
6526a08e1e6STony Lindgren 		}
6536a08e1e6STony Lindgren 		quirks++;
6546a08e1e6STony Lindgren 	}
6556a08e1e6STony Lindgren }
656036582f7STony Lindgren 
65731957609SUwe Kleine-König void __init pdata_quirks_init(const struct of_device_id *omap_dt_match_table)
658036582f7STony Lindgren {
65957df5380STony Lindgren 	/*
66057df5380STony Lindgren 	 * We still need this for omap2420 and omap3 PM to work, others are
66157df5380STony Lindgren 	 * using drivers/misc/sram.c already.
66257df5380STony Lindgren 	 */
66357df5380STony Lindgren 	if (of_machine_is_compatible("ti,omap2420") ||
66457df5380STony Lindgren 	    of_machine_is_compatible("ti,omap3"))
665036582f7STony Lindgren 		omap_sdrc_init(NULL, NULL);
66657df5380STony Lindgren 
667c26c84c9SPeter Ujfalusi 	if (of_machine_is_compatible("ti,omap3"))
668c26c84c9SPeter Ujfalusi 		omap3_mcbsp_init();
669036582f7STony Lindgren 	pdata_quirks_check(auxdata_quirks);
670036582f7STony Lindgren 	of_platform_populate(NULL, omap_dt_match_table,
671036582f7STony Lindgren 			     omap_auxdata_lookup, NULL);
672036582f7STony Lindgren 	pdata_quirks_check(pdata_quirks);
673036582f7STony Lindgren }
674