blob: 9bfb47a4756e4ecc39f025ca08959954e641d065 [file] [log] [blame]
Tony Lindgren6a08e1e2013-09-25 15:44:39 -07001/*
2 * Legacy platform_data quirks
3 *
4 * Copyright (C) 2013 Texas Instruments
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10#include <linux/clk.h>
Tony Lindgren71900312013-12-06 10:53:04 -080011#include <linux/davinci_emac.h>
Tony Lindgren5f0a2c62013-09-25 15:44:40 -070012#include <linux/gpio.h>
Tony Lindgren6a08e1e2013-09-25 15:44:39 -070013#include <linux/init.h>
14#include <linux/kernel.h>
Tony Lindgren8651bd82013-10-10 15:45:12 -070015#include <linux/of_platform.h>
Enric Balletbo i Serrad565b5f2014-11-06 13:01:51 +010016#include <linux/ti_wilink_st.h>
Tony Lindgren6a08e1e2013-09-25 15:44:39 -070017
Tony Lindgren30a69ef2013-10-10 15:45:13 -070018#include <linux/platform_data/pinctrl-single.h>
Suman Anna910f1672014-03-05 18:24:13 -060019#include <linux/platform_data/iommu-omap.h>
Dave Gerlach6da74c52015-07-13 12:34:53 -050020#include <linux/platform_data/wkup_m3.h>
Tony Lindgren30a69ef2013-10-10 15:45:13 -070021
Tony Lindgren6a08e1e2013-09-25 15:44:39 -070022#include "common.h"
23#include "common-board-devices.h"
24#include "dss-common.h"
Aaro Koskinenfaf4bd42013-09-24 22:28:15 +030025#include "control.h"
Suman Anna910f1672014-03-05 18:24:13 -060026#include "omap_device.h"
Sebastian Reicheldeff82e2014-02-17 22:30:58 +010027#include "omap-secure.h"
28#include "soc.h"
Tony Lindgren6a08e1e2013-09-25 15:44:39 -070029
30struct pdata_init {
31 const char *compatible;
32 void (*fn)(void);
33};
34
Tony Lindgrenfa590c92013-11-25 15:17:10 -080035struct of_dev_auxdata omap_auxdata_lookup[];
Tony Lindgrendad12d12013-12-06 10:52:58 -080036static struct twl4030_gpio_platform_data twl_gpio_auxdata;
Tony Lindgrenfa590c92013-11-25 15:17:10 -080037
Tony Lindgrenfa590c92013-11-25 15:17:10 -080038#ifdef CONFIG_MACH_NOKIA_N8X0
39static void __init omap2420_n8x0_legacy_init(void)
40{
41 omap_auxdata_lookup[0].platform_data = n8x0_legacy_init();
42}
43#else
44#define omap2420_n8x0_legacy_init NULL
45#endif
46
Aaro Koskinenfaf4bd42013-09-24 22:28:15 +030047#ifdef CONFIG_ARCH_OMAP3
Tony Lindgrenb96b3322015-05-20 09:23:43 -070048/*
49 * Configures GPIOs 126, 127 and 129 to 1.8V mode instead of 3.0V
50 * mode for MMC1 in case bootloader did not configure things.
51 * Note that if the pins are used for MMC1, pbias-regulator
52 * manages the IO voltage.
53 */
54static void __init omap3_gpio126_127_129(void)
55{
56 u32 reg;
57
58 reg = omap_ctrl_readl(OMAP343X_CONTROL_PBIAS_LITE);
59 reg &= ~OMAP343X_PBIASLITEVMODE1;
60 reg |= OMAP343X_PBIASLITEPWRDNZ1;
61 omap_ctrl_writel(reg, OMAP343X_CONTROL_PBIAS_LITE);
62 if (cpu_is_omap3630()) {
63 reg = omap_ctrl_readl(OMAP34XX_CONTROL_WKUP_CTRL);
64 reg |= OMAP36XX_GPIO_IO_PWRDNZ;
65 omap_ctrl_writel(reg, OMAP34XX_CONTROL_WKUP_CTRL);
66 }
67}
68
Aaro Koskinenfaf4bd42013-09-24 22:28:15 +030069static void __init hsmmc2_internal_input_clk(void)
70{
71 u32 reg;
72
73 reg = omap_ctrl_readl(OMAP343X_CONTROL_DEVCONF1);
74 reg |= OMAP2_MMCSDIO2ADPCLKISEL;
75 omap_ctrl_writel(reg, OMAP343X_CONTROL_DEVCONF1);
76}
Javier Martinez Canillas15c98872013-10-09 11:19:18 +020077
Suman Anna910f1672014-03-05 18:24:13 -060078static struct iommu_platform_data omap3_iommu_pdata = {
79 .reset_name = "mmu",
80 .assert_reset = omap_device_assert_hardreset,
81 .deassert_reset = omap_device_deassert_hardreset,
82};
83
Tony Lindgren0f0cfc62013-12-18 13:13:21 -080084static int omap3_sbc_t3730_twl_callback(struct device *dev,
85 unsigned gpio,
86 unsigned ngpio)
87{
88 int res;
89
90 res = gpio_request_one(gpio + 2, GPIOF_OUT_INIT_HIGH,
Dmitry Lifshitzd234e422014-01-12 15:22:45 +020091 "wlan pwr");
Tony Lindgren0f0cfc62013-12-18 13:13:21 -080092 if (res)
93 return res;
94
95 gpio_export(gpio, 0);
96
97 return 0;
98}
99
Dmitry Lifshitzb62d91e2014-01-12 15:22:55 +0200100static void __init omap3_sbc_t3x_usb_hub_init(int gpio, char *hub_name)
101{
102 int err = gpio_request_one(gpio, GPIOF_OUT_INIT_LOW, hub_name);
103
104 if (err) {
105 pr_err("SBC-T3x: %s reset gpio request failed: %d\n",
106 hub_name, err);
107 return;
108 }
109
110 gpio_export(gpio, 0);
111
112 udelay(10);
113 gpio_set_value(gpio, 1);
114 msleep(1);
115}
116
Tony Lindgren0f0cfc62013-12-18 13:13:21 -0800117static void __init omap3_sbc_t3730_twl_init(void)
118{
119 twl_gpio_auxdata.setup = omap3_sbc_t3730_twl_callback;
120}
121
122static void __init omap3_sbc_t3730_legacy_init(void)
123{
Dmitry Lifshitzb62d91e2014-01-12 15:22:55 +0200124 omap3_sbc_t3x_usb_hub_init(167, "sb-t35 usb hub");
Tony Lindgren0f0cfc62013-12-18 13:13:21 -0800125}
126
Dmitry Lifshitz40ecc022014-01-12 15:22:53 +0200127static void __init omap3_sbc_t3530_legacy_init(void)
128{
Dmitry Lifshitzb62d91e2014-01-12 15:22:55 +0200129 omap3_sbc_t3x_usb_hub_init(167, "sb-t35 usb hub");
Dmitry Lifshitz40ecc022014-01-12 15:22:53 +0200130}
131
Enric Balletbo i Serrad565b5f2014-11-06 13:01:51 +0100132struct ti_st_plat_data wilink_pdata = {
133 .nshutdown_gpio = 137,
134 .dev_name = "/dev/ttyO1",
135 .flow_cntrl = 1,
136 .baud_rate = 300000,
137};
138
139static struct platform_device wl18xx_device = {
140 .name = "kim",
141 .id = -1,
142 .dev = {
143 .platform_data = &wilink_pdata,
144 }
145};
146
147static struct platform_device btwilink_device = {
148 .name = "btwilink",
149 .id = -1,
150};
151
152static void __init omap3_igep0020_rev_f_legacy_init(void)
Javier Martinez Canillas15c98872013-10-09 11:19:18 +0200153{
Enric Balletbo i Serrad565b5f2014-11-06 13:01:51 +0100154 platform_device_register(&wl18xx_device);
155 platform_device_register(&btwilink_device);
156}
157
158static void __init omap3_igep0030_rev_g_legacy_init(void)
159{
Enric Balletbo i Serrad565b5f2014-11-06 13:01:51 +0100160 platform_device_register(&wl18xx_device);
161 platform_device_register(&btwilink_device);
Javier Martinez Canillas15c98872013-10-09 11:19:18 +0200162}
Tony Lindgren79b39f72013-10-11 09:20:54 -0700163
164static void __init omap3_evm_legacy_init(void)
165{
Tony Lindgren5b7610f2015-03-06 10:37:34 -0800166 hsmmc2_internal_input_clk();
Tony Lindgren79b39f72013-10-11 09:20:54 -0700167}
Tony Lindgren71900312013-12-06 10:53:04 -0800168
169static void am35xx_enable_emac_int(void)
170{
171 u32 v;
172
173 v = omap_ctrl_readl(AM35XX_CONTROL_LVL_INTR_CLEAR);
174 v |= (AM35XX_CPGMAC_C0_RX_PULSE_CLR | AM35XX_CPGMAC_C0_TX_PULSE_CLR |
175 AM35XX_CPGMAC_C0_MISC_PULSE_CLR | AM35XX_CPGMAC_C0_RX_THRESH_CLR);
176 omap_ctrl_writel(v, AM35XX_CONTROL_LVL_INTR_CLEAR);
177 omap_ctrl_readl(AM35XX_CONTROL_LVL_INTR_CLEAR); /* OCP barrier */
178}
179
180static void am35xx_disable_emac_int(void)
181{
182 u32 v;
183
184 v = omap_ctrl_readl(AM35XX_CONTROL_LVL_INTR_CLEAR);
185 v |= (AM35XX_CPGMAC_C0_RX_PULSE_CLR | AM35XX_CPGMAC_C0_TX_PULSE_CLR);
186 omap_ctrl_writel(v, AM35XX_CONTROL_LVL_INTR_CLEAR);
187 omap_ctrl_readl(AM35XX_CONTROL_LVL_INTR_CLEAR); /* OCP barrier */
188}
189
190static struct emac_platform_data am35xx_emac_pdata = {
191 .interrupt_enable = am35xx_enable_emac_int,
192 .interrupt_disable = am35xx_disable_emac_int,
193};
194
Dmitry Lifshitzfb451052014-01-12 15:22:54 +0200195static void __init am35xx_emac_reset(void)
Tony Lindgren71900312013-12-06 10:53:04 -0800196{
197 u32 v;
198
199 v = omap_ctrl_readl(AM35XX_CONTROL_IP_SW_RESET);
200 v &= ~AM35XX_CPGMACSS_SW_RST;
201 omap_ctrl_writel(v, AM35XX_CONTROL_IP_SW_RESET);
202 omap_ctrl_readl(AM35XX_CONTROL_IP_SW_RESET); /* OCP barrier */
203}
Sebastian Reicheldeff82e2014-02-17 22:30:58 +0100204
Dmitry Lifshitzfb451052014-01-12 15:22:54 +0200205static struct gpio cm_t3517_wlan_gpios[] __initdata = {
206 { 56, GPIOF_OUT_INIT_HIGH, "wlan pwr" },
207 { 4, GPIOF_OUT_INIT_HIGH, "xcvr noe" },
208};
209
210static void __init omap3_sbc_t3517_wifi_init(void)
211{
212 int err = gpio_request_array(cm_t3517_wlan_gpios,
213 ARRAY_SIZE(cm_t3517_wlan_gpios));
214 if (err) {
215 pr_err("SBC-T3517: wl12xx gpios request failed: %d\n", err);
216 return;
217 }
218
219 gpio_export(cm_t3517_wlan_gpios[0].gpio, 0);
220 gpio_export(cm_t3517_wlan_gpios[1].gpio, 0);
221
222 msleep(100);
223 gpio_set_value(cm_t3517_wlan_gpios[1].gpio, 0);
224}
225
226static void __init omap3_sbc_t3517_legacy_init(void)
227{
Dmitry Lifshitzb62d91e2014-01-12 15:22:55 +0200228 omap3_sbc_t3x_usb_hub_init(152, "cm-t3517 usb hub");
229 omap3_sbc_t3x_usb_hub_init(98, "sb-t35 usb hub");
Dmitry Lifshitzfb451052014-01-12 15:22:54 +0200230 am35xx_emac_reset();
231 hsmmc2_internal_input_clk();
232 omap3_sbc_t3517_wifi_init();
Dmitry Lifshitzfb451052014-01-12 15:22:54 +0200233}
234
235static void __init am3517_evm_legacy_init(void)
236{
237 am35xx_emac_reset();
238}
Linus Torvaldsf83ccb92014-04-05 15:29:04 -0700239
Sebastian Reichel14c0a5b2014-04-07 14:28:46 +0200240static struct platform_device omap3_rom_rng_device = {
241 .name = "omap3-rom-rng",
242 .id = -1,
243 .dev = {
244 .platform_data = rx51_secure_rng_call,
245 },
246};
247
Sebastian Reicheldeff82e2014-02-17 22:30:58 +0100248static void __init nokia_n900_legacy_init(void)
249{
250 hsmmc2_internal_input_clk();
251
252 if (omap_type() == OMAP2_DEVICE_TYPE_SEC) {
253 if (IS_ENABLED(CONFIG_ARM_ERRATA_430973)) {
254 pr_info("RX-51: Enabling ARM errata 430973 workaround\n");
255 /* set IBE to 1 */
256 rx51_secure_update_aux_cr(BIT(6), 0);
257 } else {
Joe Perches3d0cb732014-09-13 11:31:16 -0700258 pr_warn("RX-51: Not enabling ARM errata 430973 workaround\n");
259 pr_warn("Thumb binaries may crash randomly without this workaround\n");
Sebastian Reicheldeff82e2014-02-17 22:30:58 +0100260 }
Sebastian Reichel14c0a5b2014-04-07 14:28:46 +0200261
262 pr_info("RX-51: Registring OMAP3 HWRNG device\n");
263 platform_device_register(&omap3_rom_rng_device);
264
Sebastian Reicheldeff82e2014-02-17 22:30:58 +0100265 }
266}
Stefan Roese63dd5bc2014-08-29 12:40:03 +0200267
268static void __init omap3_tao3530_legacy_init(void)
269{
270 hsmmc2_internal_input_clk();
Aaro Koskinenfaf4bd42013-09-24 22:28:15 +0300271}
Grazvydas Ignotasfc53e2c2015-07-21 04:12:00 +0300272
273static struct platform_device pandora_backlight = {
274 .name = "pandora-backlight",
275 .id = -1,
276};
277
278static void __init omap3_pandora_legacy_init(void)
279{
280 platform_device_register(&pandora_backlight);
281}
Aaro Koskinenfaf4bd42013-09-24 22:28:15 +0300282#endif /* CONFIG_ARCH_OMAP3 */
283
Suman Anna67eb1e62014-03-05 18:24:15 -0600284#if defined(CONFIG_ARCH_OMAP4) || defined(CONFIG_SOC_OMAP5)
Suman Anna910f1672014-03-05 18:24:13 -0600285static struct iommu_platform_data omap4_iommu_pdata = {
286 .reset_name = "mmu_cache",
287 .assert_reset = omap_device_assert_hardreset,
288 .deassert_reset = omap_device_deassert_hardreset,
289};
Tony Lindgren3e7a3182013-09-25 15:44:39 -0700290#endif
291
Dave Gerlach6da74c52015-07-13 12:34:53 -0500292#if defined(CONFIG_SOC_AM33XX) || defined(CONFIG_SOC_AM43XX)
293static struct wkup_m3_platform_data wkup_m3_data = {
294 .reset_name = "wkup_m3",
295 .assert_reset = omap_device_assert_hardreset,
296 .deassert_reset = omap_device_deassert_hardreset,
297};
298#endif
299
Tony Lindgren3e7a3182013-09-25 15:44:39 -0700300#ifdef CONFIG_SOC_OMAP5
301static void __init omap5_uevm_legacy_init(void)
302{
Tony Lindgren3e7a3182013-09-25 15:44:39 -0700303}
304#endif
305
Tony Lindgren30a69ef2013-10-10 15:45:13 -0700306static struct pcs_pdata pcs_pdata;
307
308void omap_pcs_legacy_init(int irq, void (*rearm)(void))
309{
310 pcs_pdata.irq = irq;
311 pcs_pdata.rearm = rearm;
312}
313
Tony Lindgren036582f2013-11-25 15:17:09 -0800314/*
Tony Lindgrendad12d12013-12-06 10:52:58 -0800315 * GPIOs for TWL are initialized by the I2C bus and need custom
316 * handing until DSS has device tree bindings.
317 */
318void omap_auxdata_legacy_init(struct device *dev)
319{
320 if (dev->platform_data)
321 return;
322
323 if (strcmp("twl4030-gpio", dev_name(dev)))
324 return;
325
326 dev->platform_data = &twl_gpio_auxdata;
327}
328
329/*
Tony Lindgren036582f2013-11-25 15:17:09 -0800330 * Few boards still need auxdata populated before we populate
331 * the dev entries in of_platform_populate().
332 */
333static struct pdata_init auxdata_quirks[] __initdata = {
Tony Lindgrenfa590c92013-11-25 15:17:10 -0800334#ifdef CONFIG_SOC_OMAP2420
335 { "nokia,n800", omap2420_n8x0_legacy_init, },
336 { "nokia,n810", omap2420_n8x0_legacy_init, },
337 { "nokia,n810-wimax", omap2420_n8x0_legacy_init, },
338#endif
Tony Lindgren0f0cfc62013-12-18 13:13:21 -0800339#ifdef CONFIG_ARCH_OMAP3
340 { "compulab,omap3-sbc-t3730", omap3_sbc_t3730_twl_init, },
341#endif
Tony Lindgren036582f2013-11-25 15:17:09 -0800342 { /* sentinel */ },
343};
344
Tony Lindgren8651bd82013-10-10 15:45:12 -0700345struct of_dev_auxdata omap_auxdata_lookup[] __initdata = {
Tony Lindgren036582f2013-11-25 15:17:09 -0800346#ifdef CONFIG_MACH_NOKIA_N8X0
347 OF_DEV_AUXDATA("ti,omap2420-mmc", 0x4809c000, "mmci-omap.0", NULL),
Felipe Balbie92ce892014-09-16 15:31:40 -0500348 OF_DEV_AUXDATA("menelaus", 0x72, "1-0072", &n8x0_menelaus_platform_data),
349 OF_DEV_AUXDATA("tlv320aic3x", 0x18, "2-0018", &n810_aic33_data),
Tony Lindgren036582f2013-11-25 15:17:09 -0800350#endif
Tony Lindgren30a69ef2013-10-10 15:45:13 -0700351#ifdef CONFIG_ARCH_OMAP3
352 OF_DEV_AUXDATA("ti,omap3-padconf", 0x48002030, "48002030.pinmux", &pcs_pdata),
Tony Lindgren4b416362014-02-27 15:35:48 -0800353 OF_DEV_AUXDATA("ti,omap3-padconf", 0x480025a0, "480025a0.pinmux", &pcs_pdata),
Tony Lindgren30a69ef2013-10-10 15:45:13 -0700354 OF_DEV_AUXDATA("ti,omap3-padconf", 0x48002a00, "48002a00.pinmux", &pcs_pdata),
Suman Anna910f1672014-03-05 18:24:13 -0600355 OF_DEV_AUXDATA("ti,omap2-iommu", 0x5d000000, "5d000000.mmu",
356 &omap3_iommu_pdata),
Tony Lindgren71900312013-12-06 10:53:04 -0800357 /* Only on am3517 */
358 OF_DEV_AUXDATA("ti,davinci_mdio", 0x5c030000, "davinci_mdio.0", NULL),
359 OF_DEV_AUXDATA("ti,am3517-emac", 0x5c000000, "davinci_emac.0",
360 &am35xx_emac_pdata),
Tony Lindgren30a69ef2013-10-10 15:45:13 -0700361#endif
Dave Gerlach6da74c52015-07-13 12:34:53 -0500362#ifdef CONFIG_SOC_AM33XX
363 OF_DEV_AUXDATA("ti,am3352-wkup-m3", 0x44d00000, "44d00000.wkup_m3",
364 &wkup_m3_data),
365#endif
Tony Lindgren30a69ef2013-10-10 15:45:13 -0700366#ifdef CONFIG_ARCH_OMAP4
367 OF_DEV_AUXDATA("ti,omap4-padconf", 0x4a100040, "4a100040.pinmux", &pcs_pdata),
368 OF_DEV_AUXDATA("ti,omap4-padconf", 0x4a31e040, "4a31e040.pinmux", &pcs_pdata),
369#endif
Nishanth Menon874fef72014-05-22 15:19:29 -0500370#ifdef CONFIG_SOC_OMAP5
371 OF_DEV_AUXDATA("ti,omap5-padconf", 0x4a002840, "4a002840.pinmux", &pcs_pdata),
372 OF_DEV_AUXDATA("ti,omap5-padconf", 0x4ae0c840, "4ae0c840.pinmux", &pcs_pdata),
373#endif
Nishanth Menonb0a3d0d2014-05-22 23:39:54 -0500374#ifdef CONFIG_SOC_DRA7XX
375 OF_DEV_AUXDATA("ti,dra7-padconf", 0x4a003400, "4a003400.pinmux", &pcs_pdata),
376#endif
Keerthydbbe9772014-04-07 11:54:49 +0530377#ifdef CONFIG_SOC_AM43XX
378 OF_DEV_AUXDATA("ti,am437-padconf", 0x44e10800, "44e10800.pinmux", &pcs_pdata),
Dave Gerlach6da74c52015-07-13 12:34:53 -0500379 OF_DEV_AUXDATA("ti,am4372-wkup-m3", 0x44d00000, "44d00000.wkup_m3",
380 &wkup_m3_data),
Keerthydbbe9772014-04-07 11:54:49 +0530381#endif
Suman Anna67eb1e62014-03-05 18:24:15 -0600382#if defined(CONFIG_ARCH_OMAP4) || defined(CONFIG_SOC_OMAP5)
Suman Anna910f1672014-03-05 18:24:13 -0600383 OF_DEV_AUXDATA("ti,omap4-iommu", 0x4a066000, "4a066000.mmu",
384 &omap4_iommu_pdata),
385 OF_DEV_AUXDATA("ti,omap4-iommu", 0x55082000, "55082000.mmu",
386 &omap4_iommu_pdata),
Tony Lindgren6a08e1e2013-09-25 15:44:39 -0700387#endif
388 { /* sentinel */ },
Tony Lindgren8651bd82013-10-10 15:45:12 -0700389};
Tony Lindgren6a08e1e2013-09-25 15:44:39 -0700390
Tony Lindgren036582f2013-11-25 15:17:09 -0800391/*
392 * Few boards still need to initialize some legacy devices with
393 * platform data until the drivers support device tree.
394 */
Tony Lindgren6a08e1e2013-09-25 15:44:39 -0700395static struct pdata_init pdata_quirks[] __initdata = {
396#ifdef CONFIG_ARCH_OMAP3
Dmitry Lifshitzfb451052014-01-12 15:22:54 +0200397 { "compulab,omap3-sbc-t3517", omap3_sbc_t3517_legacy_init, },
Dmitry Lifshitz40ecc022014-01-12 15:22:53 +0200398 { "compulab,omap3-sbc-t3530", omap3_sbc_t3530_legacy_init, },
Tony Lindgren0f0cfc62013-12-18 13:13:21 -0800399 { "compulab,omap3-sbc-t3730", omap3_sbc_t3730_legacy_init, },
Sebastian Reicheldeff82e2014-02-17 22:30:58 +0100400 { "nokia,omap3-n900", nokia_n900_legacy_init, },
Tony Lindgren6a08e1e2013-09-25 15:44:39 -0700401 { "nokia,omap3-n9", hsmmc2_internal_input_clk, },
402 { "nokia,omap3-n950", hsmmc2_internal_input_clk, },
Enric Balletbo i Serrad565b5f2014-11-06 13:01:51 +0100403 { "isee,omap3-igep0020-rev-f", omap3_igep0020_rev_f_legacy_init, },
404 { "isee,omap3-igep0030-rev-g", omap3_igep0030_rev_g_legacy_init, },
Tony Lindgrenb96b3322015-05-20 09:23:43 -0700405 { "logicpd,dm3730-torpedo-devkit", omap3_gpio126_127_129, },
Tony Lindgren79b39f72013-10-11 09:20:54 -0700406 { "ti,omap3-evm-37xx", omap3_evm_legacy_init, },
Tony Lindgren71900312013-12-06 10:53:04 -0800407 { "ti,am3517-evm", am3517_evm_legacy_init, },
Stefan Roese63dd5bc2014-08-29 12:40:03 +0200408 { "technexion,omap3-tao3530", omap3_tao3530_legacy_init, },
Grazvydas Ignotasfc53e2c2015-07-21 04:12:00 +0300409 { "openpandora,omap3-pandora-600mhz", omap3_pandora_legacy_init, },
410 { "openpandora,omap3-pandora-1ghz", omap3_pandora_legacy_init, },
Tony Lindgren6a08e1e2013-09-25 15:44:39 -0700411#endif
Tony Lindgren6a08e1e2013-09-25 15:44:39 -0700412#ifdef CONFIG_SOC_OMAP5
413 { "ti,omap5-uevm", omap5_uevm_legacy_init, },
414#endif
415 { /* sentinel */ },
416};
417
Tony Lindgren036582f2013-11-25 15:17:09 -0800418static void pdata_quirks_check(struct pdata_init *quirks)
Tony Lindgren6a08e1e2013-09-25 15:44:39 -0700419{
Tony Lindgren6a08e1e2013-09-25 15:44:39 -0700420 while (quirks->compatible) {
421 if (of_machine_is_compatible(quirks->compatible)) {
422 if (quirks->fn)
423 quirks->fn();
424 break;
425 }
426 quirks++;
427 }
428}
Tony Lindgren036582f2013-11-25 15:17:09 -0800429
Uwe Kleine-König31957602014-09-10 10:26:17 +0200430void __init pdata_quirks_init(const struct of_device_id *omap_dt_match_table)
Tony Lindgren036582f2013-11-25 15:17:09 -0800431{
432 omap_sdrc_init(NULL, NULL);
433 pdata_quirks_check(auxdata_quirks);
434 of_platform_populate(NULL, omap_dt_match_table,
435 omap_auxdata_lookup, NULL);
436 pdata_quirks_check(pdata_quirks);
437}