xref: /linux/arch/arm/mach-omap2/pdata-quirks.c (revision 95eb894e93dfaab96f7fe3db3fb767e754e8ee1b)
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>
165f0a2c69STony Lindgren #include <linux/wl12xx.h>
176a08e1e6STony Lindgren 
1830a69ef7STony Lindgren #include <linux/platform_data/pinctrl-single.h>
19910f1678SSuman Anna #include <linux/platform_data/iommu-omap.h>
2030a69ef7STony Lindgren 
2171900314STony Lindgren #include "am35xx.h"
226a08e1e6STony Lindgren #include "common.h"
236a08e1e6STony Lindgren #include "common-board-devices.h"
246a08e1e6STony Lindgren #include "dss-common.h"
25faf4bd47SAaro Koskinen #include "control.h"
26910f1678SSuman Anna #include "omap_device.h"
27deff82e6SSebastian Reichel #include "omap-secure.h"
28deff82e6SSebastian Reichel #include "soc.h"
296a08e1e6STony Lindgren 
306a08e1e6STony Lindgren struct pdata_init {
316a08e1e6STony Lindgren 	const char *compatible;
326a08e1e6STony Lindgren 	void (*fn)(void);
336a08e1e6STony Lindgren };
346a08e1e6STony Lindgren 
35fa590c92STony Lindgren struct of_dev_auxdata omap_auxdata_lookup[];
36dad12d11STony Lindgren static struct twl4030_gpio_platform_data twl_gpio_auxdata;
37fa590c92STony Lindgren 
385f0a2c69STony Lindgren #if IS_ENABLED(CONFIG_WL12XX)
395f0a2c69STony Lindgren 
405f0a2c69STony Lindgren static struct wl12xx_platform_data wl12xx __initdata;
415f0a2c69STony Lindgren 
425f0a2c69STony Lindgren static void __init __used legacy_init_wl12xx(unsigned ref_clock,
435f0a2c69STony Lindgren 					     unsigned tcxo_clock,
445f0a2c69STony Lindgren 					     int gpio)
455f0a2c69STony Lindgren {
465f0a2c69STony Lindgren 	int res;
475f0a2c69STony Lindgren 
485f0a2c69STony Lindgren 	wl12xx.board_ref_clock = ref_clock;
495f0a2c69STony Lindgren 	wl12xx.board_tcxo_clock = tcxo_clock;
505f0a2c69STony Lindgren 	wl12xx.irq = gpio_to_irq(gpio);
515f0a2c69STony Lindgren 
525f0a2c69STony Lindgren 	res = wl12xx_set_platform_data(&wl12xx);
535f0a2c69STony Lindgren 	if (res) {
545f0a2c69STony Lindgren 		pr_err("error setting wl12xx data: %d\n", res);
555f0a2c69STony Lindgren 		return;
565f0a2c69STony Lindgren 	}
575f0a2c69STony Lindgren }
585f0a2c69STony Lindgren #else
595f0a2c69STony Lindgren static inline void legacy_init_wl12xx(unsigned ref_clock,
605f0a2c69STony Lindgren 				      unsigned tcxo_clock,
615f0a2c69STony Lindgren 				      int gpio)
625f0a2c69STony Lindgren {
635f0a2c69STony Lindgren }
645f0a2c69STony Lindgren #endif
655f0a2c69STony Lindgren 
66fa590c92STony Lindgren #ifdef CONFIG_MACH_NOKIA_N8X0
67fa590c92STony Lindgren static void __init omap2420_n8x0_legacy_init(void)
68fa590c92STony Lindgren {
69fa590c92STony Lindgren 	omap_auxdata_lookup[0].platform_data = n8x0_legacy_init();
70fa590c92STony Lindgren }
71fa590c92STony Lindgren #else
72fa590c92STony Lindgren #define omap2420_n8x0_legacy_init	NULL
73fa590c92STony Lindgren #endif
74fa590c92STony Lindgren 
75faf4bd47SAaro Koskinen #ifdef CONFIG_ARCH_OMAP3
76faf4bd47SAaro Koskinen static void __init hsmmc2_internal_input_clk(void)
77faf4bd47SAaro Koskinen {
78faf4bd47SAaro Koskinen 	u32 reg;
79faf4bd47SAaro Koskinen 
80faf4bd47SAaro Koskinen 	reg = omap_ctrl_readl(OMAP343X_CONTROL_DEVCONF1);
81faf4bd47SAaro Koskinen 	reg |= OMAP2_MMCSDIO2ADPCLKISEL;
82faf4bd47SAaro Koskinen 	omap_ctrl_writel(reg, OMAP343X_CONTROL_DEVCONF1);
83faf4bd47SAaro Koskinen }
8415c9887eSJavier Martinez Canillas 
85910f1678SSuman Anna static struct iommu_platform_data omap3_iommu_pdata = {
86910f1678SSuman Anna 	.reset_name = "mmu",
87910f1678SSuman Anna 	.assert_reset = omap_device_assert_hardreset,
88910f1678SSuman Anna 	.deassert_reset = omap_device_deassert_hardreset,
89910f1678SSuman Anna };
90910f1678SSuman Anna 
910f0cfc69STony Lindgren static int omap3_sbc_t3730_twl_callback(struct device *dev,
920f0cfc69STony Lindgren 					   unsigned gpio,
930f0cfc69STony Lindgren 					   unsigned ngpio)
940f0cfc69STony Lindgren {
950f0cfc69STony Lindgren 	int res;
960f0cfc69STony Lindgren 
970f0cfc69STony Lindgren 	res = gpio_request_one(gpio + 2, GPIOF_OUT_INIT_HIGH,
98d234e423SDmitry Lifshitz 			       "wlan pwr");
990f0cfc69STony Lindgren 	if (res)
1000f0cfc69STony Lindgren 		return res;
1010f0cfc69STony Lindgren 
1020f0cfc69STony Lindgren 	gpio_export(gpio, 0);
1030f0cfc69STony Lindgren 
1040f0cfc69STony Lindgren 	return 0;
1050f0cfc69STony Lindgren }
1060f0cfc69STony Lindgren 
107b62d91e5SDmitry Lifshitz static void __init omap3_sbc_t3x_usb_hub_init(int gpio, char *hub_name)
108b62d91e5SDmitry Lifshitz {
109b62d91e5SDmitry Lifshitz 	int err = gpio_request_one(gpio, GPIOF_OUT_INIT_LOW, hub_name);
110b62d91e5SDmitry Lifshitz 
111b62d91e5SDmitry Lifshitz 	if (err) {
112b62d91e5SDmitry Lifshitz 		pr_err("SBC-T3x: %s reset gpio request failed: %d\n",
113b62d91e5SDmitry Lifshitz 			hub_name, err);
114b62d91e5SDmitry Lifshitz 		return;
115b62d91e5SDmitry Lifshitz 	}
116b62d91e5SDmitry Lifshitz 
117b62d91e5SDmitry Lifshitz 	gpio_export(gpio, 0);
118b62d91e5SDmitry Lifshitz 
119b62d91e5SDmitry Lifshitz 	udelay(10);
120b62d91e5SDmitry Lifshitz 	gpio_set_value(gpio, 1);
121b62d91e5SDmitry Lifshitz 	msleep(1);
122b62d91e5SDmitry Lifshitz }
123b62d91e5SDmitry Lifshitz 
1240f0cfc69STony Lindgren static void __init omap3_sbc_t3730_twl_init(void)
1250f0cfc69STony Lindgren {
1260f0cfc69STony Lindgren 	twl_gpio_auxdata.setup = omap3_sbc_t3730_twl_callback;
1270f0cfc69STony Lindgren }
1280f0cfc69STony Lindgren 
1290f0cfc69STony Lindgren static void __init omap3_sbc_t3730_legacy_init(void)
1300f0cfc69STony Lindgren {
131b62d91e5SDmitry Lifshitz 	omap3_sbc_t3x_usb_hub_init(167, "sb-t35 usb hub");
1320f0cfc69STony Lindgren 	legacy_init_wl12xx(WL12XX_REFCLOCK_38, 0, 136);
1330f0cfc69STony Lindgren 	omap_ads7846_init(1, 57, 0, NULL);
1340f0cfc69STony Lindgren }
1350f0cfc69STony Lindgren 
13640ecc02eSDmitry Lifshitz static void __init omap3_sbc_t3530_legacy_init(void)
13740ecc02eSDmitry Lifshitz {
138b62d91e5SDmitry Lifshitz 	omap3_sbc_t3x_usb_hub_init(167, "sb-t35 usb hub");
13940ecc02eSDmitry Lifshitz 	omap_ads7846_init(1, 57, 0, NULL);
14040ecc02eSDmitry Lifshitz }
14140ecc02eSDmitry Lifshitz 
14215c9887eSJavier Martinez Canillas static void __init omap3_igep0020_legacy_init(void)
14315c9887eSJavier Martinez Canillas {
14415c9887eSJavier Martinez Canillas }
14579b39f79STony Lindgren 
14679b39f79STony Lindgren static void __init omap3_evm_legacy_init(void)
14779b39f79STony Lindgren {
14879b39f79STony Lindgren 	legacy_init_wl12xx(WL12XX_REFCLOCK_38, 0, 149);
14979b39f79STony Lindgren }
15079b39f79STony Lindgren 
15179b39f79STony Lindgren static void __init omap3_zoom_legacy_init(void)
15279b39f79STony Lindgren {
15379b39f79STony Lindgren 	legacy_init_wl12xx(WL12XX_REFCLOCK_26, 0, 162);
15479b39f79STony Lindgren }
15571900314STony Lindgren 
15671900314STony Lindgren static void am35xx_enable_emac_int(void)
15771900314STony Lindgren {
15871900314STony Lindgren 	u32 v;
15971900314STony Lindgren 
16071900314STony Lindgren 	v = omap_ctrl_readl(AM35XX_CONTROL_LVL_INTR_CLEAR);
16171900314STony Lindgren 	v |= (AM35XX_CPGMAC_C0_RX_PULSE_CLR | AM35XX_CPGMAC_C0_TX_PULSE_CLR |
16271900314STony Lindgren 	      AM35XX_CPGMAC_C0_MISC_PULSE_CLR | AM35XX_CPGMAC_C0_RX_THRESH_CLR);
16371900314STony Lindgren 	omap_ctrl_writel(v, AM35XX_CONTROL_LVL_INTR_CLEAR);
16471900314STony Lindgren 	omap_ctrl_readl(AM35XX_CONTROL_LVL_INTR_CLEAR); /* OCP barrier */
16571900314STony Lindgren }
16671900314STony Lindgren 
16771900314STony Lindgren static void am35xx_disable_emac_int(void)
16871900314STony Lindgren {
16971900314STony Lindgren 	u32 v;
17071900314STony Lindgren 
17171900314STony Lindgren 	v = omap_ctrl_readl(AM35XX_CONTROL_LVL_INTR_CLEAR);
17271900314STony Lindgren 	v |= (AM35XX_CPGMAC_C0_RX_PULSE_CLR | AM35XX_CPGMAC_C0_TX_PULSE_CLR);
17371900314STony Lindgren 	omap_ctrl_writel(v, AM35XX_CONTROL_LVL_INTR_CLEAR);
17471900314STony Lindgren 	omap_ctrl_readl(AM35XX_CONTROL_LVL_INTR_CLEAR); /* OCP barrier */
17571900314STony Lindgren }
17671900314STony Lindgren 
17771900314STony Lindgren static struct emac_platform_data am35xx_emac_pdata = {
17871900314STony Lindgren 	.interrupt_enable	= am35xx_enable_emac_int,
17971900314STony Lindgren 	.interrupt_disable	= am35xx_disable_emac_int,
18071900314STony Lindgren };
18171900314STony Lindgren 
182fb45105aSDmitry Lifshitz static void __init am35xx_emac_reset(void)
18371900314STony Lindgren {
18471900314STony Lindgren 	u32 v;
18571900314STony Lindgren 
18671900314STony Lindgren 	v = omap_ctrl_readl(AM35XX_CONTROL_IP_SW_RESET);
18771900314STony Lindgren 	v &= ~AM35XX_CPGMACSS_SW_RST;
18871900314STony Lindgren 	omap_ctrl_writel(v, AM35XX_CONTROL_IP_SW_RESET);
18971900314STony Lindgren 	omap_ctrl_readl(AM35XX_CONTROL_IP_SW_RESET); /* OCP barrier */
19071900314STony Lindgren }
191deff82e6SSebastian Reichel 
192fb45105aSDmitry Lifshitz static struct gpio cm_t3517_wlan_gpios[] __initdata = {
193fb45105aSDmitry Lifshitz 	{ 56,	GPIOF_OUT_INIT_HIGH,	"wlan pwr" },
194fb45105aSDmitry Lifshitz 	{ 4,	GPIOF_OUT_INIT_HIGH,	"xcvr noe" },
195fb45105aSDmitry Lifshitz };
196fb45105aSDmitry Lifshitz 
197fb45105aSDmitry Lifshitz static void __init omap3_sbc_t3517_wifi_init(void)
198fb45105aSDmitry Lifshitz {
199fb45105aSDmitry Lifshitz 	int err = gpio_request_array(cm_t3517_wlan_gpios,
200fb45105aSDmitry Lifshitz 				ARRAY_SIZE(cm_t3517_wlan_gpios));
201fb45105aSDmitry Lifshitz 	if (err) {
202fb45105aSDmitry Lifshitz 		pr_err("SBC-T3517: wl12xx gpios request failed: %d\n", err);
203fb45105aSDmitry Lifshitz 		return;
204fb45105aSDmitry Lifshitz 	}
205fb45105aSDmitry Lifshitz 
206fb45105aSDmitry Lifshitz 	gpio_export(cm_t3517_wlan_gpios[0].gpio, 0);
207fb45105aSDmitry Lifshitz 	gpio_export(cm_t3517_wlan_gpios[1].gpio, 0);
208fb45105aSDmitry Lifshitz 
209fb45105aSDmitry Lifshitz 	msleep(100);
210fb45105aSDmitry Lifshitz 	gpio_set_value(cm_t3517_wlan_gpios[1].gpio, 0);
211fb45105aSDmitry Lifshitz }
212fb45105aSDmitry Lifshitz 
213fb45105aSDmitry Lifshitz static void __init omap3_sbc_t3517_legacy_init(void)
214fb45105aSDmitry Lifshitz {
215b62d91e5SDmitry Lifshitz 	omap3_sbc_t3x_usb_hub_init(152, "cm-t3517 usb hub");
216b62d91e5SDmitry Lifshitz 	omap3_sbc_t3x_usb_hub_init(98, "sb-t35 usb hub");
217fb45105aSDmitry Lifshitz 	am35xx_emac_reset();
218fb45105aSDmitry Lifshitz 	hsmmc2_internal_input_clk();
219fb45105aSDmitry Lifshitz 	omap3_sbc_t3517_wifi_init();
220fb45105aSDmitry Lifshitz 	legacy_init_wl12xx(WL12XX_REFCLOCK_38, 0, 145);
221fb45105aSDmitry Lifshitz 	omap_ads7846_init(1, 57, 0, NULL);
222fb45105aSDmitry Lifshitz }
223fb45105aSDmitry Lifshitz 
224fb45105aSDmitry Lifshitz static void __init am3517_evm_legacy_init(void)
225fb45105aSDmitry Lifshitz {
226fb45105aSDmitry Lifshitz 	am35xx_emac_reset();
227fb45105aSDmitry Lifshitz }
228f83ccb93SLinus Torvalds 
229deff82e6SSebastian Reichel static void __init nokia_n900_legacy_init(void)
230deff82e6SSebastian Reichel {
231deff82e6SSebastian Reichel 	hsmmc2_internal_input_clk();
232deff82e6SSebastian Reichel 
233deff82e6SSebastian Reichel 	if (omap_type() == OMAP2_DEVICE_TYPE_SEC) {
234deff82e6SSebastian Reichel 		if (IS_ENABLED(CONFIG_ARM_ERRATA_430973)) {
235deff82e6SSebastian Reichel 			pr_info("RX-51: Enabling ARM errata 430973 workaround\n");
236deff82e6SSebastian Reichel 			/* set IBE to 1 */
237deff82e6SSebastian Reichel 			rx51_secure_update_aux_cr(BIT(6), 0);
238deff82e6SSebastian Reichel 		} else {
239deff82e6SSebastian Reichel 			pr_warning("RX-51: Not enabling ARM errata 430973 workaround\n");
240deff82e6SSebastian Reichel 			pr_warning("Thumb binaries may crash randomly without this workaround\n");
241deff82e6SSebastian Reichel 		}
242deff82e6SSebastian Reichel 	}
243deff82e6SSebastian Reichel }
244faf4bd47SAaro Koskinen #endif /* CONFIG_ARCH_OMAP3 */
245faf4bd47SAaro Koskinen 
2463e7a3185STony Lindgren #ifdef CONFIG_ARCH_OMAP4
2473e7a3185STony Lindgren static void __init omap4_sdp_legacy_init(void)
2483e7a3185STony Lindgren {
2495f0a2c69STony Lindgren 	legacy_init_wl12xx(WL12XX_REFCLOCK_26,
2505f0a2c69STony Lindgren 			   WL12XX_TCXOCLOCK_26, 53);
2513e7a3185STony Lindgren }
2523e7a3185STony Lindgren 
2533e7a3185STony Lindgren static void __init omap4_panda_legacy_init(void)
2543e7a3185STony Lindgren {
2555f0a2c69STony Lindgren 	legacy_init_wl12xx(WL12XX_REFCLOCK_38, 0, 53);
2563e7a3185STony Lindgren }
257*95eb894eSJoachim Eastwood 
258*95eb894eSJoachim Eastwood static void __init var_som_om44_legacy_init(void)
259*95eb894eSJoachim Eastwood {
260*95eb894eSJoachim Eastwood 	legacy_init_wl12xx(WL12XX_REFCLOCK_38, 0, 41);
261*95eb894eSJoachim Eastwood }
2623e7a3185STony Lindgren #endif
2633e7a3185STony Lindgren 
26467eb1e6eSSuman Anna #if defined(CONFIG_ARCH_OMAP4) || defined(CONFIG_SOC_OMAP5)
265910f1678SSuman Anna static struct iommu_platform_data omap4_iommu_pdata = {
266910f1678SSuman Anna 	.reset_name = "mmu_cache",
267910f1678SSuman Anna 	.assert_reset = omap_device_assert_hardreset,
268910f1678SSuman Anna 	.deassert_reset = omap_device_deassert_hardreset,
269910f1678SSuman Anna };
2703e7a3185STony Lindgren #endif
2713e7a3185STony Lindgren 
27290f4f01bSImre Kaloz #ifdef CONFIG_SOC_AM33XX
27390f4f01bSImre Kaloz static void __init am335x_evmsk_legacy_init(void)
27490f4f01bSImre Kaloz {
27590f4f01bSImre Kaloz 	legacy_init_wl12xx(WL12XX_REFCLOCK_38, 0, 31);
27690f4f01bSImre Kaloz }
27790f4f01bSImre Kaloz #endif
27890f4f01bSImre Kaloz 
2793e7a3185STony Lindgren #ifdef CONFIG_SOC_OMAP5
2803e7a3185STony Lindgren static void __init omap5_uevm_legacy_init(void)
2813e7a3185STony Lindgren {
2823e7a3185STony Lindgren }
2833e7a3185STony Lindgren #endif
2843e7a3185STony Lindgren 
28530a69ef7STony Lindgren static struct pcs_pdata pcs_pdata;
28630a69ef7STony Lindgren 
28730a69ef7STony Lindgren void omap_pcs_legacy_init(int irq, void (*rearm)(void))
28830a69ef7STony Lindgren {
28930a69ef7STony Lindgren 	pcs_pdata.irq = irq;
29030a69ef7STony Lindgren 	pcs_pdata.rearm = rearm;
29130a69ef7STony Lindgren }
29230a69ef7STony Lindgren 
293036582f7STony Lindgren /*
294dad12d11STony Lindgren  * GPIOs for TWL are initialized by the I2C bus and need custom
295dad12d11STony Lindgren  * handing until DSS has device tree bindings.
296dad12d11STony Lindgren  */
297dad12d11STony Lindgren void omap_auxdata_legacy_init(struct device *dev)
298dad12d11STony Lindgren {
299dad12d11STony Lindgren 	if (dev->platform_data)
300dad12d11STony Lindgren 		return;
301dad12d11STony Lindgren 
302dad12d11STony Lindgren 	if (strcmp("twl4030-gpio", dev_name(dev)))
303dad12d11STony Lindgren 		return;
304dad12d11STony Lindgren 
305dad12d11STony Lindgren 	dev->platform_data = &twl_gpio_auxdata;
306dad12d11STony Lindgren }
307dad12d11STony Lindgren 
308dad12d11STony Lindgren /*
309036582f7STony Lindgren  * Few boards still need auxdata populated before we populate
310036582f7STony Lindgren  * the dev entries in of_platform_populate().
311036582f7STony Lindgren  */
312036582f7STony Lindgren static struct pdata_init auxdata_quirks[] __initdata = {
313fa590c92STony Lindgren #ifdef CONFIG_SOC_OMAP2420
314fa590c92STony Lindgren 	{ "nokia,n800", omap2420_n8x0_legacy_init, },
315fa590c92STony Lindgren 	{ "nokia,n810", omap2420_n8x0_legacy_init, },
316fa590c92STony Lindgren 	{ "nokia,n810-wimax", omap2420_n8x0_legacy_init, },
317fa590c92STony Lindgren #endif
3180f0cfc69STony Lindgren #ifdef CONFIG_ARCH_OMAP3
3190f0cfc69STony Lindgren 	{ "compulab,omap3-sbc-t3730", omap3_sbc_t3730_twl_init, },
3200f0cfc69STony Lindgren #endif
321036582f7STony Lindgren 	{ /* sentinel */ },
322036582f7STony Lindgren };
323036582f7STony Lindgren 
3248651bd8cSTony Lindgren struct of_dev_auxdata omap_auxdata_lookup[] __initdata = {
325036582f7STony Lindgren #ifdef CONFIG_MACH_NOKIA_N8X0
326036582f7STony Lindgren 	OF_DEV_AUXDATA("ti,omap2420-mmc", 0x4809c000, "mmci-omap.0", NULL),
327036582f7STony Lindgren #endif
32830a69ef7STony Lindgren #ifdef CONFIG_ARCH_OMAP3
32930a69ef7STony Lindgren 	OF_DEV_AUXDATA("ti,omap3-padconf", 0x48002030, "48002030.pinmux", &pcs_pdata),
3304b416368STony Lindgren 	OF_DEV_AUXDATA("ti,omap3-padconf", 0x480025a0, "480025a0.pinmux", &pcs_pdata),
33130a69ef7STony Lindgren 	OF_DEV_AUXDATA("ti,omap3-padconf", 0x48002a00, "48002a00.pinmux", &pcs_pdata),
332910f1678SSuman Anna 	OF_DEV_AUXDATA("ti,omap2-iommu", 0x5d000000, "5d000000.mmu",
333910f1678SSuman Anna 		       &omap3_iommu_pdata),
33471900314STony Lindgren 	/* Only on am3517 */
33571900314STony Lindgren 	OF_DEV_AUXDATA("ti,davinci_mdio", 0x5c030000, "davinci_mdio.0", NULL),
33671900314STony Lindgren 	OF_DEV_AUXDATA("ti,am3517-emac", 0x5c000000, "davinci_emac.0",
33771900314STony Lindgren 		       &am35xx_emac_pdata),
33830a69ef7STony Lindgren #endif
33930a69ef7STony Lindgren #ifdef CONFIG_ARCH_OMAP4
34030a69ef7STony Lindgren 	OF_DEV_AUXDATA("ti,omap4-padconf", 0x4a100040, "4a100040.pinmux", &pcs_pdata),
34130a69ef7STony Lindgren 	OF_DEV_AUXDATA("ti,omap4-padconf", 0x4a31e040, "4a31e040.pinmux", &pcs_pdata),
34230a69ef7STony Lindgren #endif
34367eb1e6eSSuman Anna #if defined(CONFIG_ARCH_OMAP4) || defined(CONFIG_SOC_OMAP5)
344910f1678SSuman Anna 	OF_DEV_AUXDATA("ti,omap4-iommu", 0x4a066000, "4a066000.mmu",
345910f1678SSuman Anna 		       &omap4_iommu_pdata),
346910f1678SSuman Anna 	OF_DEV_AUXDATA("ti,omap4-iommu", 0x55082000, "55082000.mmu",
347910f1678SSuman Anna 		       &omap4_iommu_pdata),
3486a08e1e6STony Lindgren #endif
3496a08e1e6STony Lindgren 	{ /* sentinel */ },
3508651bd8cSTony Lindgren };
3516a08e1e6STony Lindgren 
352036582f7STony Lindgren /*
353036582f7STony Lindgren  * Few boards still need to initialize some legacy devices with
354036582f7STony Lindgren  * platform data until the drivers support device tree.
355036582f7STony Lindgren  */
3566a08e1e6STony Lindgren static struct pdata_init pdata_quirks[] __initdata = {
3576a08e1e6STony Lindgren #ifdef CONFIG_ARCH_OMAP3
358fb45105aSDmitry Lifshitz 	{ "compulab,omap3-sbc-t3517", omap3_sbc_t3517_legacy_init, },
35940ecc02eSDmitry Lifshitz 	{ "compulab,omap3-sbc-t3530", omap3_sbc_t3530_legacy_init, },
3600f0cfc69STony Lindgren 	{ "compulab,omap3-sbc-t3730", omap3_sbc_t3730_legacy_init, },
361deff82e6SSebastian Reichel 	{ "nokia,omap3-n900", nokia_n900_legacy_init, },
3626a08e1e6STony Lindgren 	{ "nokia,omap3-n9", hsmmc2_internal_input_clk, },
3636a08e1e6STony Lindgren 	{ "nokia,omap3-n950", hsmmc2_internal_input_clk, },
3646a08e1e6STony Lindgren 	{ "isee,omap3-igep0020", omap3_igep0020_legacy_init, },
36579b39f79STony Lindgren 	{ "ti,omap3-evm-37xx", omap3_evm_legacy_init, },
36679b39f79STony Lindgren 	{ "ti,omap3-zoom3", omap3_zoom_legacy_init, },
36771900314STony Lindgren 	{ "ti,am3517-evm", am3517_evm_legacy_init, },
3686a08e1e6STony Lindgren #endif
3696a08e1e6STony Lindgren #ifdef CONFIG_ARCH_OMAP4
3706a08e1e6STony Lindgren 	{ "ti,omap4-sdp", omap4_sdp_legacy_init, },
3716a08e1e6STony Lindgren 	{ "ti,omap4-panda", omap4_panda_legacy_init, },
372*95eb894eSJoachim Eastwood 	{ "variscite,var-dvk-om44", var_som_om44_legacy_init, },
373*95eb894eSJoachim Eastwood 	{ "variscite,var-stk-om44", var_som_om44_legacy_init, },
3746a08e1e6STony Lindgren #endif
37590f4f01bSImre Kaloz #ifdef CONFIG_SOC_AM33XX
37690f4f01bSImre Kaloz 	{ "ti,am335x-evmsk", am335x_evmsk_legacy_init, },
37790f4f01bSImre Kaloz #endif
3786a08e1e6STony Lindgren #ifdef CONFIG_SOC_OMAP5
3796a08e1e6STony Lindgren 	{ "ti,omap5-uevm", omap5_uevm_legacy_init, },
3806a08e1e6STony Lindgren #endif
3816a08e1e6STony Lindgren 	{ /* sentinel */ },
3826a08e1e6STony Lindgren };
3836a08e1e6STony Lindgren 
384036582f7STony Lindgren static void pdata_quirks_check(struct pdata_init *quirks)
3856a08e1e6STony Lindgren {
3866a08e1e6STony Lindgren 	while (quirks->compatible) {
3876a08e1e6STony Lindgren 		if (of_machine_is_compatible(quirks->compatible)) {
3886a08e1e6STony Lindgren 			if (quirks->fn)
3896a08e1e6STony Lindgren 				quirks->fn();
3906a08e1e6STony Lindgren 			break;
3916a08e1e6STony Lindgren 		}
3926a08e1e6STony Lindgren 		quirks++;
3936a08e1e6STony Lindgren 	}
3946a08e1e6STony Lindgren }
395036582f7STony Lindgren 
396036582f7STony Lindgren void __init pdata_quirks_init(struct of_device_id *omap_dt_match_table)
397036582f7STony Lindgren {
398036582f7STony Lindgren 	omap_sdrc_init(NULL, NULL);
399036582f7STony Lindgren 	pdata_quirks_check(auxdata_quirks);
400036582f7STony Lindgren 	of_platform_populate(NULL, omap_dt_match_table,
401036582f7STony Lindgren 			     omap_auxdata_lookup, NULL);
402036582f7STony Lindgren 	pdata_quirks_check(pdata_quirks);
403036582f7STony Lindgren }
404