xref: /linux/arch/arm/mach-omap2/pdata-quirks.c (revision f83ccb93585d1f472c30fa2bbb8b56c23dbdb506)
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 	omap3_igep2_display_init_of();
14515c9887eSJavier Martinez Canillas }
14679b39f79STony Lindgren 
14779b39f79STony Lindgren static void __init omap3_evm_legacy_init(void)
14879b39f79STony Lindgren {
14979b39f79STony Lindgren 	legacy_init_wl12xx(WL12XX_REFCLOCK_38, 0, 149);
15079b39f79STony Lindgren }
15179b39f79STony Lindgren 
15279b39f79STony Lindgren static void __init omap3_zoom_legacy_init(void)
15379b39f79STony Lindgren {
15479b39f79STony Lindgren 	legacy_init_wl12xx(WL12XX_REFCLOCK_26, 0, 162);
15579b39f79STony Lindgren }
15671900314STony Lindgren 
15771900314STony Lindgren static void am35xx_enable_emac_int(void)
15871900314STony Lindgren {
15971900314STony Lindgren 	u32 v;
16071900314STony Lindgren 
16171900314STony Lindgren 	v = omap_ctrl_readl(AM35XX_CONTROL_LVL_INTR_CLEAR);
16271900314STony Lindgren 	v |= (AM35XX_CPGMAC_C0_RX_PULSE_CLR | AM35XX_CPGMAC_C0_TX_PULSE_CLR |
16371900314STony Lindgren 	      AM35XX_CPGMAC_C0_MISC_PULSE_CLR | AM35XX_CPGMAC_C0_RX_THRESH_CLR);
16471900314STony Lindgren 	omap_ctrl_writel(v, AM35XX_CONTROL_LVL_INTR_CLEAR);
16571900314STony Lindgren 	omap_ctrl_readl(AM35XX_CONTROL_LVL_INTR_CLEAR); /* OCP barrier */
16671900314STony Lindgren }
16771900314STony Lindgren 
16871900314STony Lindgren static void am35xx_disable_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 	omap_ctrl_writel(v, AM35XX_CONTROL_LVL_INTR_CLEAR);
17571900314STony Lindgren 	omap_ctrl_readl(AM35XX_CONTROL_LVL_INTR_CLEAR); /* OCP barrier */
17671900314STony Lindgren }
17771900314STony Lindgren 
17871900314STony Lindgren static struct emac_platform_data am35xx_emac_pdata = {
17971900314STony Lindgren 	.interrupt_enable	= am35xx_enable_emac_int,
18071900314STony Lindgren 	.interrupt_disable	= am35xx_disable_emac_int,
18171900314STony Lindgren };
18271900314STony Lindgren 
183fb45105aSDmitry Lifshitz static void __init am35xx_emac_reset(void)
18471900314STony Lindgren {
18571900314STony Lindgren 	u32 v;
18671900314STony Lindgren 
18771900314STony Lindgren 	v = omap_ctrl_readl(AM35XX_CONTROL_IP_SW_RESET);
18871900314STony Lindgren 	v &= ~AM35XX_CPGMACSS_SW_RST;
18971900314STony Lindgren 	omap_ctrl_writel(v, AM35XX_CONTROL_IP_SW_RESET);
19071900314STony Lindgren 	omap_ctrl_readl(AM35XX_CONTROL_IP_SW_RESET); /* OCP barrier */
19171900314STony Lindgren }
192deff82e6SSebastian Reichel 
193fb45105aSDmitry Lifshitz static struct gpio cm_t3517_wlan_gpios[] __initdata = {
194fb45105aSDmitry Lifshitz 	{ 56,	GPIOF_OUT_INIT_HIGH,	"wlan pwr" },
195fb45105aSDmitry Lifshitz 	{ 4,	GPIOF_OUT_INIT_HIGH,	"xcvr noe" },
196fb45105aSDmitry Lifshitz };
197fb45105aSDmitry Lifshitz 
198fb45105aSDmitry Lifshitz static void __init omap3_sbc_t3517_wifi_init(void)
199fb45105aSDmitry Lifshitz {
200fb45105aSDmitry Lifshitz 	int err = gpio_request_array(cm_t3517_wlan_gpios,
201fb45105aSDmitry Lifshitz 				ARRAY_SIZE(cm_t3517_wlan_gpios));
202fb45105aSDmitry Lifshitz 	if (err) {
203fb45105aSDmitry Lifshitz 		pr_err("SBC-T3517: wl12xx gpios request failed: %d\n", err);
204fb45105aSDmitry Lifshitz 		return;
205fb45105aSDmitry Lifshitz 	}
206fb45105aSDmitry Lifshitz 
207fb45105aSDmitry Lifshitz 	gpio_export(cm_t3517_wlan_gpios[0].gpio, 0);
208fb45105aSDmitry Lifshitz 	gpio_export(cm_t3517_wlan_gpios[1].gpio, 0);
209fb45105aSDmitry Lifshitz 
210fb45105aSDmitry Lifshitz 	msleep(100);
211fb45105aSDmitry Lifshitz 	gpio_set_value(cm_t3517_wlan_gpios[1].gpio, 0);
212fb45105aSDmitry Lifshitz }
213fb45105aSDmitry Lifshitz 
214fb45105aSDmitry Lifshitz static void __init omap3_sbc_t3517_legacy_init(void)
215fb45105aSDmitry Lifshitz {
216b62d91e5SDmitry Lifshitz 	omap3_sbc_t3x_usb_hub_init(152, "cm-t3517 usb hub");
217b62d91e5SDmitry Lifshitz 	omap3_sbc_t3x_usb_hub_init(98, "sb-t35 usb hub");
218fb45105aSDmitry Lifshitz 	am35xx_emac_reset();
219fb45105aSDmitry Lifshitz 	hsmmc2_internal_input_clk();
220fb45105aSDmitry Lifshitz 	omap3_sbc_t3517_wifi_init();
221fb45105aSDmitry Lifshitz 	legacy_init_wl12xx(WL12XX_REFCLOCK_38, 0, 145);
222fb45105aSDmitry Lifshitz 	omap_ads7846_init(1, 57, 0, NULL);
223fb45105aSDmitry Lifshitz }
224fb45105aSDmitry Lifshitz 
225fb45105aSDmitry Lifshitz static void __init am3517_evm_legacy_init(void)
226fb45105aSDmitry Lifshitz {
227fb45105aSDmitry Lifshitz 	am35xx_emac_reset();
228fb45105aSDmitry Lifshitz }
229*f83ccb93SLinus Torvalds 
230deff82e6SSebastian Reichel static void __init nokia_n900_legacy_init(void)
231deff82e6SSebastian Reichel {
232deff82e6SSebastian Reichel 	hsmmc2_internal_input_clk();
233deff82e6SSebastian Reichel 
234deff82e6SSebastian Reichel 	if (omap_type() == OMAP2_DEVICE_TYPE_SEC) {
235deff82e6SSebastian Reichel 		if (IS_ENABLED(CONFIG_ARM_ERRATA_430973)) {
236deff82e6SSebastian Reichel 			pr_info("RX-51: Enabling ARM errata 430973 workaround\n");
237deff82e6SSebastian Reichel 			/* set IBE to 1 */
238deff82e6SSebastian Reichel 			rx51_secure_update_aux_cr(BIT(6), 0);
239deff82e6SSebastian Reichel 		} else {
240deff82e6SSebastian Reichel 			pr_warning("RX-51: Not enabling ARM errata 430973 workaround\n");
241deff82e6SSebastian Reichel 			pr_warning("Thumb binaries may crash randomly without this workaround\n");
242deff82e6SSebastian Reichel 		}
243deff82e6SSebastian Reichel 	}
244deff82e6SSebastian Reichel }
245faf4bd47SAaro Koskinen #endif /* CONFIG_ARCH_OMAP3 */
246faf4bd47SAaro Koskinen 
2473e7a3185STony Lindgren #ifdef CONFIG_ARCH_OMAP4
2483e7a3185STony Lindgren static void __init omap4_sdp_legacy_init(void)
2493e7a3185STony Lindgren {
2503e7a3185STony Lindgren 	omap_4430sdp_display_init_of();
2515f0a2c69STony Lindgren 	legacy_init_wl12xx(WL12XX_REFCLOCK_26,
2525f0a2c69STony Lindgren 			   WL12XX_TCXOCLOCK_26, 53);
2533e7a3185STony Lindgren }
2543e7a3185STony Lindgren 
2553e7a3185STony Lindgren static void __init omap4_panda_legacy_init(void)
2563e7a3185STony Lindgren {
2573e7a3185STony Lindgren 	omap4_panda_display_init_of();
2585f0a2c69STony Lindgren 	legacy_init_wl12xx(WL12XX_REFCLOCK_38, 0, 53);
2593e7a3185STony Lindgren }
2603e7a3185STony Lindgren #endif
2613e7a3185STony Lindgren 
26267eb1e6eSSuman Anna #if defined(CONFIG_ARCH_OMAP4) || defined(CONFIG_SOC_OMAP5)
263910f1678SSuman Anna static struct iommu_platform_data omap4_iommu_pdata = {
264910f1678SSuman Anna 	.reset_name = "mmu_cache",
265910f1678SSuman Anna 	.assert_reset = omap_device_assert_hardreset,
266910f1678SSuman Anna 	.deassert_reset = omap_device_deassert_hardreset,
267910f1678SSuman Anna };
2683e7a3185STony Lindgren #endif
2693e7a3185STony Lindgren 
27090f4f01bSImre Kaloz #ifdef CONFIG_SOC_AM33XX
27190f4f01bSImre Kaloz static void __init am335x_evmsk_legacy_init(void)
27290f4f01bSImre Kaloz {
27390f4f01bSImre Kaloz 	legacy_init_wl12xx(WL12XX_REFCLOCK_38, 0, 31);
27490f4f01bSImre Kaloz }
27590f4f01bSImre Kaloz #endif
27690f4f01bSImre Kaloz 
2773e7a3185STony Lindgren #ifdef CONFIG_SOC_OMAP5
2783e7a3185STony Lindgren static void __init omap5_uevm_legacy_init(void)
2793e7a3185STony Lindgren {
2803e7a3185STony Lindgren }
2813e7a3185STony Lindgren #endif
2823e7a3185STony Lindgren 
28330a69ef7STony Lindgren static struct pcs_pdata pcs_pdata;
28430a69ef7STony Lindgren 
28530a69ef7STony Lindgren void omap_pcs_legacy_init(int irq, void (*rearm)(void))
28630a69ef7STony Lindgren {
28730a69ef7STony Lindgren 	pcs_pdata.irq = irq;
28830a69ef7STony Lindgren 	pcs_pdata.rearm = rearm;
28930a69ef7STony Lindgren }
29030a69ef7STony Lindgren 
291036582f7STony Lindgren /*
292dad12d11STony Lindgren  * GPIOs for TWL are initialized by the I2C bus and need custom
293dad12d11STony Lindgren  * handing until DSS has device tree bindings.
294dad12d11STony Lindgren  */
295dad12d11STony Lindgren void omap_auxdata_legacy_init(struct device *dev)
296dad12d11STony Lindgren {
297dad12d11STony Lindgren 	if (dev->platform_data)
298dad12d11STony Lindgren 		return;
299dad12d11STony Lindgren 
300dad12d11STony Lindgren 	if (strcmp("twl4030-gpio", dev_name(dev)))
301dad12d11STony Lindgren 		return;
302dad12d11STony Lindgren 
303dad12d11STony Lindgren 	dev->platform_data = &twl_gpio_auxdata;
304dad12d11STony Lindgren }
305dad12d11STony Lindgren 
306dad12d11STony Lindgren /*
307036582f7STony Lindgren  * Few boards still need auxdata populated before we populate
308036582f7STony Lindgren  * the dev entries in of_platform_populate().
309036582f7STony Lindgren  */
310036582f7STony Lindgren static struct pdata_init auxdata_quirks[] __initdata = {
311fa590c92STony Lindgren #ifdef CONFIG_SOC_OMAP2420
312fa590c92STony Lindgren 	{ "nokia,n800", omap2420_n8x0_legacy_init, },
313fa590c92STony Lindgren 	{ "nokia,n810", omap2420_n8x0_legacy_init, },
314fa590c92STony Lindgren 	{ "nokia,n810-wimax", omap2420_n8x0_legacy_init, },
315fa590c92STony Lindgren #endif
3160f0cfc69STony Lindgren #ifdef CONFIG_ARCH_OMAP3
3170f0cfc69STony Lindgren 	{ "compulab,omap3-sbc-t3730", omap3_sbc_t3730_twl_init, },
3180f0cfc69STony Lindgren #endif
319036582f7STony Lindgren 	{ /* sentinel */ },
320036582f7STony Lindgren };
321036582f7STony Lindgren 
3228651bd8cSTony Lindgren struct of_dev_auxdata omap_auxdata_lookup[] __initdata = {
323036582f7STony Lindgren #ifdef CONFIG_MACH_NOKIA_N8X0
324036582f7STony Lindgren 	OF_DEV_AUXDATA("ti,omap2420-mmc", 0x4809c000, "mmci-omap.0", NULL),
325036582f7STony Lindgren #endif
32630a69ef7STony Lindgren #ifdef CONFIG_ARCH_OMAP3
32730a69ef7STony Lindgren 	OF_DEV_AUXDATA("ti,omap3-padconf", 0x48002030, "48002030.pinmux", &pcs_pdata),
3284b416368STony Lindgren 	OF_DEV_AUXDATA("ti,omap3-padconf", 0x480025a0, "480025a0.pinmux", &pcs_pdata),
32930a69ef7STony Lindgren 	OF_DEV_AUXDATA("ti,omap3-padconf", 0x48002a00, "48002a00.pinmux", &pcs_pdata),
330910f1678SSuman Anna 	OF_DEV_AUXDATA("ti,omap2-iommu", 0x5d000000, "5d000000.mmu",
331910f1678SSuman Anna 		       &omap3_iommu_pdata),
33271900314STony Lindgren 	/* Only on am3517 */
33371900314STony Lindgren 	OF_DEV_AUXDATA("ti,davinci_mdio", 0x5c030000, "davinci_mdio.0", NULL),
33471900314STony Lindgren 	OF_DEV_AUXDATA("ti,am3517-emac", 0x5c000000, "davinci_emac.0",
33571900314STony Lindgren 		       &am35xx_emac_pdata),
33630a69ef7STony Lindgren #endif
33730a69ef7STony Lindgren #ifdef CONFIG_ARCH_OMAP4
33830a69ef7STony Lindgren 	OF_DEV_AUXDATA("ti,omap4-padconf", 0x4a100040, "4a100040.pinmux", &pcs_pdata),
33930a69ef7STony Lindgren 	OF_DEV_AUXDATA("ti,omap4-padconf", 0x4a31e040, "4a31e040.pinmux", &pcs_pdata),
34030a69ef7STony Lindgren #endif
34167eb1e6eSSuman Anna #if defined(CONFIG_ARCH_OMAP4) || defined(CONFIG_SOC_OMAP5)
342910f1678SSuman Anna 	OF_DEV_AUXDATA("ti,omap4-iommu", 0x4a066000, "4a066000.mmu",
343910f1678SSuman Anna 		       &omap4_iommu_pdata),
344910f1678SSuman Anna 	OF_DEV_AUXDATA("ti,omap4-iommu", 0x55082000, "55082000.mmu",
345910f1678SSuman Anna 		       &omap4_iommu_pdata),
3466a08e1e6STony Lindgren #endif
3476a08e1e6STony Lindgren 	{ /* sentinel */ },
3488651bd8cSTony Lindgren };
3496a08e1e6STony Lindgren 
350036582f7STony Lindgren /*
351036582f7STony Lindgren  * Few boards still need to initialize some legacy devices with
352036582f7STony Lindgren  * platform data until the drivers support device tree.
353036582f7STony Lindgren  */
3546a08e1e6STony Lindgren static struct pdata_init pdata_quirks[] __initdata = {
3556a08e1e6STony Lindgren #ifdef CONFIG_ARCH_OMAP3
356fb45105aSDmitry Lifshitz 	{ "compulab,omap3-sbc-t3517", omap3_sbc_t3517_legacy_init, },
35740ecc02eSDmitry Lifshitz 	{ "compulab,omap3-sbc-t3530", omap3_sbc_t3530_legacy_init, },
3580f0cfc69STony Lindgren 	{ "compulab,omap3-sbc-t3730", omap3_sbc_t3730_legacy_init, },
359deff82e6SSebastian Reichel 	{ "nokia,omap3-n900", nokia_n900_legacy_init, },
3606a08e1e6STony Lindgren 	{ "nokia,omap3-n9", hsmmc2_internal_input_clk, },
3616a08e1e6STony Lindgren 	{ "nokia,omap3-n950", hsmmc2_internal_input_clk, },
3626a08e1e6STony Lindgren 	{ "isee,omap3-igep0020", omap3_igep0020_legacy_init, },
36379b39f79STony Lindgren 	{ "ti,omap3-evm-37xx", omap3_evm_legacy_init, },
36479b39f79STony Lindgren 	{ "ti,omap3-zoom3", omap3_zoom_legacy_init, },
36571900314STony Lindgren 	{ "ti,am3517-evm", am3517_evm_legacy_init, },
3666a08e1e6STony Lindgren #endif
3676a08e1e6STony Lindgren #ifdef CONFIG_ARCH_OMAP4
3686a08e1e6STony Lindgren 	{ "ti,omap4-sdp", omap4_sdp_legacy_init, },
3696a08e1e6STony Lindgren 	{ "ti,omap4-panda", omap4_panda_legacy_init, },
3706a08e1e6STony Lindgren #endif
37190f4f01bSImre Kaloz #ifdef CONFIG_SOC_AM33XX
37290f4f01bSImre Kaloz 	{ "ti,am335x-evmsk", am335x_evmsk_legacy_init, },
37390f4f01bSImre Kaloz #endif
3746a08e1e6STony Lindgren #ifdef CONFIG_SOC_OMAP5
3756a08e1e6STony Lindgren 	{ "ti,omap5-uevm", omap5_uevm_legacy_init, },
3766a08e1e6STony Lindgren #endif
3776a08e1e6STony Lindgren 	{ /* sentinel */ },
3786a08e1e6STony Lindgren };
3796a08e1e6STony Lindgren 
380036582f7STony Lindgren static void pdata_quirks_check(struct pdata_init *quirks)
3816a08e1e6STony Lindgren {
3826a08e1e6STony Lindgren 	while (quirks->compatible) {
3836a08e1e6STony Lindgren 		if (of_machine_is_compatible(quirks->compatible)) {
3846a08e1e6STony Lindgren 			if (quirks->fn)
3856a08e1e6STony Lindgren 				quirks->fn();
3866a08e1e6STony Lindgren 			break;
3876a08e1e6STony Lindgren 		}
3886a08e1e6STony Lindgren 		quirks++;
3896a08e1e6STony Lindgren 	}
3906a08e1e6STony Lindgren }
391036582f7STony Lindgren 
392036582f7STony Lindgren void __init pdata_quirks_init(struct of_device_id *omap_dt_match_table)
393036582f7STony Lindgren {
394036582f7STony Lindgren 	omap_sdrc_init(NULL, NULL);
395036582f7STony Lindgren 	pdata_quirks_check(auxdata_quirks);
396036582f7STony Lindgren 	of_platform_populate(NULL, omap_dt_match_table,
397036582f7STony Lindgren 			     omap_auxdata_lookup, NULL);
398036582f7STony Lindgren 	pdata_quirks_check(pdata_quirks);
399036582f7STony Lindgren }
400