xref: /linux/arch/arm/mach-omap2/pdata-quirks.c (revision b96b332fd518cd4d08104bc5ca552ac1ade7e2c7)
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>
136a08e1e6STony Lindgren #include <linux/init.h>
146a08e1e6STony Lindgren #include <linux/kernel.h>
158651bd8cSTony Lindgren #include <linux/of_platform.h>
16d565b5f4SEnric Balletbo i Serra #include <linux/ti_wilink_st.h>
176a08e1e6STony Lindgren 
1830a69ef7STony Lindgren #include <linux/platform_data/pinctrl-single.h>
19910f1678SSuman Anna #include <linux/platform_data/iommu-omap.h>
2030a69ef7STony Lindgren 
216a08e1e6STony Lindgren #include "common.h"
226a08e1e6STony Lindgren #include "common-board-devices.h"
236a08e1e6STony Lindgren #include "dss-common.h"
24faf4bd47SAaro Koskinen #include "control.h"
25910f1678SSuman Anna #include "omap_device.h"
26deff82e6SSebastian Reichel #include "omap-secure.h"
27deff82e6SSebastian Reichel #include "soc.h"
286a08e1e6STony Lindgren 
296a08e1e6STony Lindgren struct pdata_init {
306a08e1e6STony Lindgren 	const char *compatible;
316a08e1e6STony Lindgren 	void (*fn)(void);
326a08e1e6STony Lindgren };
336a08e1e6STony Lindgren 
34fa590c92STony Lindgren struct of_dev_auxdata omap_auxdata_lookup[];
35dad12d11STony Lindgren static struct twl4030_gpio_platform_data twl_gpio_auxdata;
36fa590c92STony Lindgren 
37fa590c92STony Lindgren #ifdef CONFIG_MACH_NOKIA_N8X0
38fa590c92STony Lindgren static void __init omap2420_n8x0_legacy_init(void)
39fa590c92STony Lindgren {
40fa590c92STony Lindgren 	omap_auxdata_lookup[0].platform_data = n8x0_legacy_init();
41fa590c92STony Lindgren }
42fa590c92STony Lindgren #else
43fa590c92STony Lindgren #define omap2420_n8x0_legacy_init	NULL
44fa590c92STony Lindgren #endif
45fa590c92STony Lindgren 
46faf4bd47SAaro Koskinen #ifdef CONFIG_ARCH_OMAP3
47*b96b332fSTony Lindgren /*
48*b96b332fSTony Lindgren  * Configures GPIOs 126, 127 and 129 to 1.8V mode instead of 3.0V
49*b96b332fSTony Lindgren  * mode for MMC1 in case bootloader did not configure things.
50*b96b332fSTony Lindgren  * Note that if the pins are used for MMC1, pbias-regulator
51*b96b332fSTony Lindgren  * manages the IO voltage.
52*b96b332fSTony Lindgren  */
53*b96b332fSTony Lindgren static void __init omap3_gpio126_127_129(void)
54*b96b332fSTony Lindgren {
55*b96b332fSTony Lindgren 	u32 reg;
56*b96b332fSTony Lindgren 
57*b96b332fSTony Lindgren 	reg = omap_ctrl_readl(OMAP343X_CONTROL_PBIAS_LITE);
58*b96b332fSTony Lindgren 	reg &= ~OMAP343X_PBIASLITEVMODE1;
59*b96b332fSTony Lindgren 	reg |= OMAP343X_PBIASLITEPWRDNZ1;
60*b96b332fSTony Lindgren 	omap_ctrl_writel(reg, OMAP343X_CONTROL_PBIAS_LITE);
61*b96b332fSTony Lindgren 	if (cpu_is_omap3630()) {
62*b96b332fSTony Lindgren 		reg = omap_ctrl_readl(OMAP34XX_CONTROL_WKUP_CTRL);
63*b96b332fSTony Lindgren 		reg |= OMAP36XX_GPIO_IO_PWRDNZ;
64*b96b332fSTony Lindgren 		omap_ctrl_writel(reg, OMAP34XX_CONTROL_WKUP_CTRL);
65*b96b332fSTony Lindgren 	}
66*b96b332fSTony Lindgren }
67*b96b332fSTony Lindgren 
68faf4bd47SAaro Koskinen static void __init hsmmc2_internal_input_clk(void)
69faf4bd47SAaro Koskinen {
70faf4bd47SAaro Koskinen 	u32 reg;
71faf4bd47SAaro Koskinen 
72faf4bd47SAaro Koskinen 	reg = omap_ctrl_readl(OMAP343X_CONTROL_DEVCONF1);
73faf4bd47SAaro Koskinen 	reg |= OMAP2_MMCSDIO2ADPCLKISEL;
74faf4bd47SAaro Koskinen 	omap_ctrl_writel(reg, OMAP343X_CONTROL_DEVCONF1);
75faf4bd47SAaro Koskinen }
7615c9887eSJavier Martinez Canillas 
77910f1678SSuman Anna static struct iommu_platform_data omap3_iommu_pdata = {
78910f1678SSuman Anna 	.reset_name = "mmu",
79910f1678SSuman Anna 	.assert_reset = omap_device_assert_hardreset,
80910f1678SSuman Anna 	.deassert_reset = omap_device_deassert_hardreset,
81910f1678SSuman Anna };
82910f1678SSuman Anna 
830f0cfc69STony Lindgren static int omap3_sbc_t3730_twl_callback(struct device *dev,
840f0cfc69STony Lindgren 					   unsigned gpio,
850f0cfc69STony Lindgren 					   unsigned ngpio)
860f0cfc69STony Lindgren {
870f0cfc69STony Lindgren 	int res;
880f0cfc69STony Lindgren 
890f0cfc69STony Lindgren 	res = gpio_request_one(gpio + 2, GPIOF_OUT_INIT_HIGH,
90d234e423SDmitry Lifshitz 			       "wlan pwr");
910f0cfc69STony Lindgren 	if (res)
920f0cfc69STony Lindgren 		return res;
930f0cfc69STony Lindgren 
940f0cfc69STony Lindgren 	gpio_export(gpio, 0);
950f0cfc69STony Lindgren 
960f0cfc69STony Lindgren 	return 0;
970f0cfc69STony Lindgren }
980f0cfc69STony Lindgren 
99b62d91e5SDmitry Lifshitz static void __init omap3_sbc_t3x_usb_hub_init(int gpio, char *hub_name)
100b62d91e5SDmitry Lifshitz {
101b62d91e5SDmitry Lifshitz 	int err = gpio_request_one(gpio, GPIOF_OUT_INIT_LOW, hub_name);
102b62d91e5SDmitry Lifshitz 
103b62d91e5SDmitry Lifshitz 	if (err) {
104b62d91e5SDmitry Lifshitz 		pr_err("SBC-T3x: %s reset gpio request failed: %d\n",
105b62d91e5SDmitry Lifshitz 			hub_name, err);
106b62d91e5SDmitry Lifshitz 		return;
107b62d91e5SDmitry Lifshitz 	}
108b62d91e5SDmitry Lifshitz 
109b62d91e5SDmitry Lifshitz 	gpio_export(gpio, 0);
110b62d91e5SDmitry Lifshitz 
111b62d91e5SDmitry Lifshitz 	udelay(10);
112b62d91e5SDmitry Lifshitz 	gpio_set_value(gpio, 1);
113b62d91e5SDmitry Lifshitz 	msleep(1);
114b62d91e5SDmitry Lifshitz }
115b62d91e5SDmitry Lifshitz 
1160f0cfc69STony Lindgren static void __init omap3_sbc_t3730_twl_init(void)
1170f0cfc69STony Lindgren {
1180f0cfc69STony Lindgren 	twl_gpio_auxdata.setup = omap3_sbc_t3730_twl_callback;
1190f0cfc69STony Lindgren }
1200f0cfc69STony Lindgren 
1210f0cfc69STony Lindgren static void __init omap3_sbc_t3730_legacy_init(void)
1220f0cfc69STony Lindgren {
123b62d91e5SDmitry Lifshitz 	omap3_sbc_t3x_usb_hub_init(167, "sb-t35 usb hub");
1240f0cfc69STony Lindgren }
1250f0cfc69STony Lindgren 
12640ecc02eSDmitry Lifshitz static void __init omap3_sbc_t3530_legacy_init(void)
12740ecc02eSDmitry Lifshitz {
128b62d91e5SDmitry Lifshitz 	omap3_sbc_t3x_usb_hub_init(167, "sb-t35 usb hub");
12940ecc02eSDmitry Lifshitz }
13040ecc02eSDmitry Lifshitz 
131d565b5f4SEnric Balletbo i Serra struct ti_st_plat_data wilink_pdata = {
132d565b5f4SEnric Balletbo i Serra 	.nshutdown_gpio = 137,
133d565b5f4SEnric Balletbo i Serra 	.dev_name = "/dev/ttyO1",
134d565b5f4SEnric Balletbo i Serra 	.flow_cntrl = 1,
135d565b5f4SEnric Balletbo i Serra 	.baud_rate = 300000,
136d565b5f4SEnric Balletbo i Serra };
137d565b5f4SEnric Balletbo i Serra 
138d565b5f4SEnric Balletbo i Serra static struct platform_device wl18xx_device = {
139d565b5f4SEnric Balletbo i Serra 	.name	= "kim",
140d565b5f4SEnric Balletbo i Serra 	.id	= -1,
141d565b5f4SEnric Balletbo i Serra 	.dev	= {
142d565b5f4SEnric Balletbo i Serra 		.platform_data = &wilink_pdata,
143d565b5f4SEnric Balletbo i Serra 	}
144d565b5f4SEnric Balletbo i Serra };
145d565b5f4SEnric Balletbo i Serra 
146d565b5f4SEnric Balletbo i Serra static struct platform_device btwilink_device = {
147d565b5f4SEnric Balletbo i Serra 	.name	= "btwilink",
148d565b5f4SEnric Balletbo i Serra 	.id	= -1,
149d565b5f4SEnric Balletbo i Serra };
150d565b5f4SEnric Balletbo i Serra 
151d565b5f4SEnric Balletbo i Serra static void __init omap3_igep0020_rev_f_legacy_init(void)
15215c9887eSJavier Martinez Canillas {
153d565b5f4SEnric Balletbo i Serra 	platform_device_register(&wl18xx_device);
154d565b5f4SEnric Balletbo i Serra 	platform_device_register(&btwilink_device);
155d565b5f4SEnric Balletbo i Serra }
156d565b5f4SEnric Balletbo i Serra 
157d565b5f4SEnric Balletbo i Serra static void __init omap3_igep0030_rev_g_legacy_init(void)
158d565b5f4SEnric Balletbo i Serra {
159d565b5f4SEnric Balletbo i Serra 	platform_device_register(&wl18xx_device);
160d565b5f4SEnric Balletbo i Serra 	platform_device_register(&btwilink_device);
16115c9887eSJavier Martinez Canillas }
16279b39f79STony Lindgren 
16379b39f79STony Lindgren static void __init omap3_evm_legacy_init(void)
16479b39f79STony Lindgren {
1655b7610f2STony Lindgren 	hsmmc2_internal_input_clk();
16679b39f79STony Lindgren }
16771900314STony Lindgren 
16871900314STony Lindgren static void am35xx_enable_emac_int(void)
16971900314STony Lindgren {
17071900314STony Lindgren 	u32 v;
17171900314STony Lindgren 
17271900314STony Lindgren 	v = omap_ctrl_readl(AM35XX_CONTROL_LVL_INTR_CLEAR);
17371900314STony Lindgren 	v |= (AM35XX_CPGMAC_C0_RX_PULSE_CLR | AM35XX_CPGMAC_C0_TX_PULSE_CLR |
17471900314STony Lindgren 	      AM35XX_CPGMAC_C0_MISC_PULSE_CLR | AM35XX_CPGMAC_C0_RX_THRESH_CLR);
17571900314STony Lindgren 	omap_ctrl_writel(v, AM35XX_CONTROL_LVL_INTR_CLEAR);
17671900314STony Lindgren 	omap_ctrl_readl(AM35XX_CONTROL_LVL_INTR_CLEAR); /* OCP barrier */
17771900314STony Lindgren }
17871900314STony Lindgren 
17971900314STony Lindgren static void am35xx_disable_emac_int(void)
18071900314STony Lindgren {
18171900314STony Lindgren 	u32 v;
18271900314STony Lindgren 
18371900314STony Lindgren 	v = omap_ctrl_readl(AM35XX_CONTROL_LVL_INTR_CLEAR);
18471900314STony Lindgren 	v |= (AM35XX_CPGMAC_C0_RX_PULSE_CLR | AM35XX_CPGMAC_C0_TX_PULSE_CLR);
18571900314STony Lindgren 	omap_ctrl_writel(v, AM35XX_CONTROL_LVL_INTR_CLEAR);
18671900314STony Lindgren 	omap_ctrl_readl(AM35XX_CONTROL_LVL_INTR_CLEAR); /* OCP barrier */
18771900314STony Lindgren }
18871900314STony Lindgren 
18971900314STony Lindgren static struct emac_platform_data am35xx_emac_pdata = {
19071900314STony Lindgren 	.interrupt_enable	= am35xx_enable_emac_int,
19171900314STony Lindgren 	.interrupt_disable	= am35xx_disable_emac_int,
19271900314STony Lindgren };
19371900314STony Lindgren 
194fb45105aSDmitry Lifshitz static void __init am35xx_emac_reset(void)
19571900314STony Lindgren {
19671900314STony Lindgren 	u32 v;
19771900314STony Lindgren 
19871900314STony Lindgren 	v = omap_ctrl_readl(AM35XX_CONTROL_IP_SW_RESET);
19971900314STony Lindgren 	v &= ~AM35XX_CPGMACSS_SW_RST;
20071900314STony Lindgren 	omap_ctrl_writel(v, AM35XX_CONTROL_IP_SW_RESET);
20171900314STony Lindgren 	omap_ctrl_readl(AM35XX_CONTROL_IP_SW_RESET); /* OCP barrier */
20271900314STony Lindgren }
203deff82e6SSebastian Reichel 
204fb45105aSDmitry Lifshitz static struct gpio cm_t3517_wlan_gpios[] __initdata = {
205fb45105aSDmitry Lifshitz 	{ 56,	GPIOF_OUT_INIT_HIGH,	"wlan pwr" },
206fb45105aSDmitry Lifshitz 	{ 4,	GPIOF_OUT_INIT_HIGH,	"xcvr noe" },
207fb45105aSDmitry Lifshitz };
208fb45105aSDmitry Lifshitz 
209fb45105aSDmitry Lifshitz static void __init omap3_sbc_t3517_wifi_init(void)
210fb45105aSDmitry Lifshitz {
211fb45105aSDmitry Lifshitz 	int err = gpio_request_array(cm_t3517_wlan_gpios,
212fb45105aSDmitry Lifshitz 				ARRAY_SIZE(cm_t3517_wlan_gpios));
213fb45105aSDmitry Lifshitz 	if (err) {
214fb45105aSDmitry Lifshitz 		pr_err("SBC-T3517: wl12xx gpios request failed: %d\n", err);
215fb45105aSDmitry Lifshitz 		return;
216fb45105aSDmitry Lifshitz 	}
217fb45105aSDmitry Lifshitz 
218fb45105aSDmitry Lifshitz 	gpio_export(cm_t3517_wlan_gpios[0].gpio, 0);
219fb45105aSDmitry Lifshitz 	gpio_export(cm_t3517_wlan_gpios[1].gpio, 0);
220fb45105aSDmitry Lifshitz 
221fb45105aSDmitry Lifshitz 	msleep(100);
222fb45105aSDmitry Lifshitz 	gpio_set_value(cm_t3517_wlan_gpios[1].gpio, 0);
223fb45105aSDmitry Lifshitz }
224fb45105aSDmitry Lifshitz 
225fb45105aSDmitry Lifshitz static void __init omap3_sbc_t3517_legacy_init(void)
226fb45105aSDmitry Lifshitz {
227b62d91e5SDmitry Lifshitz 	omap3_sbc_t3x_usb_hub_init(152, "cm-t3517 usb hub");
228b62d91e5SDmitry Lifshitz 	omap3_sbc_t3x_usb_hub_init(98, "sb-t35 usb hub");
229fb45105aSDmitry Lifshitz 	am35xx_emac_reset();
230fb45105aSDmitry Lifshitz 	hsmmc2_internal_input_clk();
231fb45105aSDmitry Lifshitz 	omap3_sbc_t3517_wifi_init();
232fb45105aSDmitry Lifshitz }
233fb45105aSDmitry Lifshitz 
234fb45105aSDmitry Lifshitz static void __init am3517_evm_legacy_init(void)
235fb45105aSDmitry Lifshitz {
236fb45105aSDmitry Lifshitz 	am35xx_emac_reset();
237fb45105aSDmitry Lifshitz }
238f83ccb93SLinus Torvalds 
23914c0a5b4SSebastian Reichel static struct platform_device omap3_rom_rng_device = {
24014c0a5b4SSebastian Reichel 	.name		= "omap3-rom-rng",
24114c0a5b4SSebastian Reichel 	.id		= -1,
24214c0a5b4SSebastian Reichel 	.dev	= {
24314c0a5b4SSebastian Reichel 		.platform_data	= rx51_secure_rng_call,
24414c0a5b4SSebastian Reichel 	},
24514c0a5b4SSebastian Reichel };
24614c0a5b4SSebastian Reichel 
247deff82e6SSebastian Reichel static void __init nokia_n900_legacy_init(void)
248deff82e6SSebastian Reichel {
249deff82e6SSebastian Reichel 	hsmmc2_internal_input_clk();
250deff82e6SSebastian Reichel 
251deff82e6SSebastian Reichel 	if (omap_type() == OMAP2_DEVICE_TYPE_SEC) {
252deff82e6SSebastian Reichel 		if (IS_ENABLED(CONFIG_ARM_ERRATA_430973)) {
253deff82e6SSebastian Reichel 			pr_info("RX-51: Enabling ARM errata 430973 workaround\n");
254deff82e6SSebastian Reichel 			/* set IBE to 1 */
255deff82e6SSebastian Reichel 			rx51_secure_update_aux_cr(BIT(6), 0);
256deff82e6SSebastian Reichel 		} else {
2573d0cb73eSJoe Perches 			pr_warn("RX-51: Not enabling ARM errata 430973 workaround\n");
2583d0cb73eSJoe Perches 			pr_warn("Thumb binaries may crash randomly without this workaround\n");
259deff82e6SSebastian Reichel 		}
26014c0a5b4SSebastian Reichel 
26114c0a5b4SSebastian Reichel 		pr_info("RX-51: Registring OMAP3 HWRNG device\n");
26214c0a5b4SSebastian Reichel 		platform_device_register(&omap3_rom_rng_device);
26314c0a5b4SSebastian Reichel 
264deff82e6SSebastian Reichel 	}
265deff82e6SSebastian Reichel }
26663dd5bc0SStefan Roese 
26763dd5bc0SStefan Roese static void __init omap3_tao3530_legacy_init(void)
26863dd5bc0SStefan Roese {
26963dd5bc0SStefan Roese 	hsmmc2_internal_input_clk();
270faf4bd47SAaro Koskinen }
271faf4bd47SAaro Koskinen #endif /* CONFIG_ARCH_OMAP3 */
272faf4bd47SAaro Koskinen 
27367eb1e6eSSuman Anna #if defined(CONFIG_ARCH_OMAP4) || defined(CONFIG_SOC_OMAP5)
274910f1678SSuman Anna static struct iommu_platform_data omap4_iommu_pdata = {
275910f1678SSuman Anna 	.reset_name = "mmu_cache",
276910f1678SSuman Anna 	.assert_reset = omap_device_assert_hardreset,
277910f1678SSuman Anna 	.deassert_reset = omap_device_deassert_hardreset,
278910f1678SSuman Anna };
2793e7a3185STony Lindgren #endif
2803e7a3185STony Lindgren 
2813e7a3185STony Lindgren #ifdef CONFIG_SOC_OMAP5
2823e7a3185STony Lindgren static void __init omap5_uevm_legacy_init(void)
2833e7a3185STony Lindgren {
2843e7a3185STony Lindgren }
2853e7a3185STony Lindgren #endif
2863e7a3185STony Lindgren 
28730a69ef7STony Lindgren static struct pcs_pdata pcs_pdata;
28830a69ef7STony Lindgren 
28930a69ef7STony Lindgren void omap_pcs_legacy_init(int irq, void (*rearm)(void))
29030a69ef7STony Lindgren {
29130a69ef7STony Lindgren 	pcs_pdata.irq = irq;
29230a69ef7STony Lindgren 	pcs_pdata.rearm = rearm;
29330a69ef7STony Lindgren }
29430a69ef7STony Lindgren 
295036582f7STony Lindgren /*
296dad12d11STony Lindgren  * GPIOs for TWL are initialized by the I2C bus and need custom
297dad12d11STony Lindgren  * handing until DSS has device tree bindings.
298dad12d11STony Lindgren  */
299dad12d11STony Lindgren void omap_auxdata_legacy_init(struct device *dev)
300dad12d11STony Lindgren {
301dad12d11STony Lindgren 	if (dev->platform_data)
302dad12d11STony Lindgren 		return;
303dad12d11STony Lindgren 
304dad12d11STony Lindgren 	if (strcmp("twl4030-gpio", dev_name(dev)))
305dad12d11STony Lindgren 		return;
306dad12d11STony Lindgren 
307dad12d11STony Lindgren 	dev->platform_data = &twl_gpio_auxdata;
308dad12d11STony Lindgren }
309dad12d11STony Lindgren 
310dad12d11STony Lindgren /*
311036582f7STony Lindgren  * Few boards still need auxdata populated before we populate
312036582f7STony Lindgren  * the dev entries in of_platform_populate().
313036582f7STony Lindgren  */
314036582f7STony Lindgren static struct pdata_init auxdata_quirks[] __initdata = {
315fa590c92STony Lindgren #ifdef CONFIG_SOC_OMAP2420
316fa590c92STony Lindgren 	{ "nokia,n800", omap2420_n8x0_legacy_init, },
317fa590c92STony Lindgren 	{ "nokia,n810", omap2420_n8x0_legacy_init, },
318fa590c92STony Lindgren 	{ "nokia,n810-wimax", omap2420_n8x0_legacy_init, },
319fa590c92STony Lindgren #endif
3200f0cfc69STony Lindgren #ifdef CONFIG_ARCH_OMAP3
3210f0cfc69STony Lindgren 	{ "compulab,omap3-sbc-t3730", omap3_sbc_t3730_twl_init, },
3220f0cfc69STony Lindgren #endif
323036582f7STony Lindgren 	{ /* sentinel */ },
324036582f7STony Lindgren };
325036582f7STony Lindgren 
3268651bd8cSTony Lindgren struct of_dev_auxdata omap_auxdata_lookup[] __initdata = {
327036582f7STony Lindgren #ifdef CONFIG_MACH_NOKIA_N8X0
328036582f7STony Lindgren 	OF_DEV_AUXDATA("ti,omap2420-mmc", 0x4809c000, "mmci-omap.0", NULL),
329e92ce89cSFelipe Balbi 	OF_DEV_AUXDATA("menelaus", 0x72, "1-0072", &n8x0_menelaus_platform_data),
330e92ce89cSFelipe Balbi 	OF_DEV_AUXDATA("tlv320aic3x", 0x18, "2-0018", &n810_aic33_data),
331036582f7STony Lindgren #endif
33230a69ef7STony Lindgren #ifdef CONFIG_ARCH_OMAP3
33330a69ef7STony Lindgren 	OF_DEV_AUXDATA("ti,omap3-padconf", 0x48002030, "48002030.pinmux", &pcs_pdata),
3344b416368STony Lindgren 	OF_DEV_AUXDATA("ti,omap3-padconf", 0x480025a0, "480025a0.pinmux", &pcs_pdata),
33530a69ef7STony Lindgren 	OF_DEV_AUXDATA("ti,omap3-padconf", 0x48002a00, "48002a00.pinmux", &pcs_pdata),
336910f1678SSuman Anna 	OF_DEV_AUXDATA("ti,omap2-iommu", 0x5d000000, "5d000000.mmu",
337910f1678SSuman Anna 		       &omap3_iommu_pdata),
33871900314STony Lindgren 	/* Only on am3517 */
33971900314STony Lindgren 	OF_DEV_AUXDATA("ti,davinci_mdio", 0x5c030000, "davinci_mdio.0", NULL),
34071900314STony Lindgren 	OF_DEV_AUXDATA("ti,am3517-emac", 0x5c000000, "davinci_emac.0",
34171900314STony Lindgren 		       &am35xx_emac_pdata),
34230a69ef7STony Lindgren #endif
34330a69ef7STony Lindgren #ifdef CONFIG_ARCH_OMAP4
34430a69ef7STony Lindgren 	OF_DEV_AUXDATA("ti,omap4-padconf", 0x4a100040, "4a100040.pinmux", &pcs_pdata),
34530a69ef7STony Lindgren 	OF_DEV_AUXDATA("ti,omap4-padconf", 0x4a31e040, "4a31e040.pinmux", &pcs_pdata),
34630a69ef7STony Lindgren #endif
347874fef7dSNishanth Menon #ifdef CONFIG_SOC_OMAP5
348874fef7dSNishanth Menon 	OF_DEV_AUXDATA("ti,omap5-padconf", 0x4a002840, "4a002840.pinmux", &pcs_pdata),
349874fef7dSNishanth Menon 	OF_DEV_AUXDATA("ti,omap5-padconf", 0x4ae0c840, "4ae0c840.pinmux", &pcs_pdata),
350874fef7dSNishanth Menon #endif
351b0a3d0daSNishanth Menon #ifdef CONFIG_SOC_DRA7XX
352b0a3d0daSNishanth Menon 	OF_DEV_AUXDATA("ti,dra7-padconf", 0x4a003400, "4a003400.pinmux", &pcs_pdata),
353b0a3d0daSNishanth Menon #endif
354dbbe9770SKeerthy #ifdef CONFIG_SOC_AM43XX
355dbbe9770SKeerthy 	OF_DEV_AUXDATA("ti,am437-padconf", 0x44e10800, "44e10800.pinmux", &pcs_pdata),
356dbbe9770SKeerthy #endif
35767eb1e6eSSuman Anna #if defined(CONFIG_ARCH_OMAP4) || defined(CONFIG_SOC_OMAP5)
358910f1678SSuman Anna 	OF_DEV_AUXDATA("ti,omap4-iommu", 0x4a066000, "4a066000.mmu",
359910f1678SSuman Anna 		       &omap4_iommu_pdata),
360910f1678SSuman Anna 	OF_DEV_AUXDATA("ti,omap4-iommu", 0x55082000, "55082000.mmu",
361910f1678SSuman Anna 		       &omap4_iommu_pdata),
3626a08e1e6STony Lindgren #endif
3636a08e1e6STony Lindgren 	{ /* sentinel */ },
3648651bd8cSTony Lindgren };
3656a08e1e6STony Lindgren 
366036582f7STony Lindgren /*
367036582f7STony Lindgren  * Few boards still need to initialize some legacy devices with
368036582f7STony Lindgren  * platform data until the drivers support device tree.
369036582f7STony Lindgren  */
3706a08e1e6STony Lindgren static struct pdata_init pdata_quirks[] __initdata = {
3716a08e1e6STony Lindgren #ifdef CONFIG_ARCH_OMAP3
372fb45105aSDmitry Lifshitz 	{ "compulab,omap3-sbc-t3517", omap3_sbc_t3517_legacy_init, },
37340ecc02eSDmitry Lifshitz 	{ "compulab,omap3-sbc-t3530", omap3_sbc_t3530_legacy_init, },
3740f0cfc69STony Lindgren 	{ "compulab,omap3-sbc-t3730", omap3_sbc_t3730_legacy_init, },
375deff82e6SSebastian Reichel 	{ "nokia,omap3-n900", nokia_n900_legacy_init, },
3766a08e1e6STony Lindgren 	{ "nokia,omap3-n9", hsmmc2_internal_input_clk, },
3776a08e1e6STony Lindgren 	{ "nokia,omap3-n950", hsmmc2_internal_input_clk, },
378d565b5f4SEnric Balletbo i Serra 	{ "isee,omap3-igep0020-rev-f", omap3_igep0020_rev_f_legacy_init, },
379d565b5f4SEnric Balletbo i Serra 	{ "isee,omap3-igep0030-rev-g", omap3_igep0030_rev_g_legacy_init, },
380*b96b332fSTony Lindgren 	{ "logicpd,dm3730-torpedo-devkit", omap3_gpio126_127_129, },
38179b39f79STony Lindgren 	{ "ti,omap3-evm-37xx", omap3_evm_legacy_init, },
38271900314STony Lindgren 	{ "ti,am3517-evm", am3517_evm_legacy_init, },
38363dd5bc0SStefan Roese 	{ "technexion,omap3-tao3530", omap3_tao3530_legacy_init, },
3846a08e1e6STony Lindgren #endif
3856a08e1e6STony Lindgren #ifdef CONFIG_SOC_OMAP5
3866a08e1e6STony Lindgren 	{ "ti,omap5-uevm", omap5_uevm_legacy_init, },
3876a08e1e6STony Lindgren #endif
3886a08e1e6STony Lindgren 	{ /* sentinel */ },
3896a08e1e6STony Lindgren };
3906a08e1e6STony Lindgren 
391036582f7STony Lindgren static void pdata_quirks_check(struct pdata_init *quirks)
3926a08e1e6STony Lindgren {
3936a08e1e6STony Lindgren 	while (quirks->compatible) {
3946a08e1e6STony Lindgren 		if (of_machine_is_compatible(quirks->compatible)) {
3956a08e1e6STony Lindgren 			if (quirks->fn)
3966a08e1e6STony Lindgren 				quirks->fn();
3976a08e1e6STony Lindgren 			break;
3986a08e1e6STony Lindgren 		}
3996a08e1e6STony Lindgren 		quirks++;
4006a08e1e6STony Lindgren 	}
4016a08e1e6STony Lindgren }
402036582f7STony Lindgren 
40331957609SUwe Kleine-König void __init pdata_quirks_init(const struct of_device_id *omap_dt_match_table)
404036582f7STony Lindgren {
405036582f7STony Lindgren 	omap_sdrc_init(NULL, NULL);
406036582f7STony Lindgren 	pdata_quirks_check(auxdata_quirks);
407036582f7STony Lindgren 	of_platform_populate(NULL, omap_dt_match_table,
408036582f7STony Lindgren 			     omap_auxdata_lookup, NULL);
409036582f7STony Lindgren 	pdata_quirks_check(pdata_quirks);
410036582f7STony Lindgren }
411