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" 276a08e1e6STony Lindgren 286a08e1e6STony Lindgren struct pdata_init { 296a08e1e6STony Lindgren const char *compatible; 306a08e1e6STony Lindgren void (*fn)(void); 316a08e1e6STony Lindgren }; 326a08e1e6STony Lindgren 33fa590c92STony Lindgren struct of_dev_auxdata omap_auxdata_lookup[]; 34dad12d11STony Lindgren static struct twl4030_gpio_platform_data twl_gpio_auxdata; 35fa590c92STony Lindgren 365f0a2c69STony Lindgren #if IS_ENABLED(CONFIG_WL12XX) 375f0a2c69STony Lindgren 385f0a2c69STony Lindgren static struct wl12xx_platform_data wl12xx __initdata; 395f0a2c69STony Lindgren 405f0a2c69STony Lindgren static void __init __used legacy_init_wl12xx(unsigned ref_clock, 415f0a2c69STony Lindgren unsigned tcxo_clock, 425f0a2c69STony Lindgren int gpio) 435f0a2c69STony Lindgren { 445f0a2c69STony Lindgren int res; 455f0a2c69STony Lindgren 465f0a2c69STony Lindgren wl12xx.board_ref_clock = ref_clock; 475f0a2c69STony Lindgren wl12xx.board_tcxo_clock = tcxo_clock; 485f0a2c69STony Lindgren wl12xx.irq = gpio_to_irq(gpio); 495f0a2c69STony Lindgren 505f0a2c69STony Lindgren res = wl12xx_set_platform_data(&wl12xx); 515f0a2c69STony Lindgren if (res) { 525f0a2c69STony Lindgren pr_err("error setting wl12xx data: %d\n", res); 535f0a2c69STony Lindgren return; 545f0a2c69STony Lindgren } 555f0a2c69STony Lindgren } 565f0a2c69STony Lindgren #else 575f0a2c69STony Lindgren static inline void legacy_init_wl12xx(unsigned ref_clock, 585f0a2c69STony Lindgren unsigned tcxo_clock, 595f0a2c69STony Lindgren int gpio) 605f0a2c69STony Lindgren { 615f0a2c69STony Lindgren } 625f0a2c69STony Lindgren #endif 635f0a2c69STony Lindgren 64fa590c92STony Lindgren #ifdef CONFIG_MACH_NOKIA_N8X0 65fa590c92STony Lindgren static void __init omap2420_n8x0_legacy_init(void) 66fa590c92STony Lindgren { 67fa590c92STony Lindgren omap_auxdata_lookup[0].platform_data = n8x0_legacy_init(); 68fa590c92STony Lindgren } 69fa590c92STony Lindgren #else 70fa590c92STony Lindgren #define omap2420_n8x0_legacy_init NULL 71fa590c92STony Lindgren #endif 72fa590c92STony Lindgren 73faf4bd47SAaro Koskinen #ifdef CONFIG_ARCH_OMAP3 74faf4bd47SAaro Koskinen static void __init hsmmc2_internal_input_clk(void) 75faf4bd47SAaro Koskinen { 76faf4bd47SAaro Koskinen u32 reg; 77faf4bd47SAaro Koskinen 78faf4bd47SAaro Koskinen reg = omap_ctrl_readl(OMAP343X_CONTROL_DEVCONF1); 79faf4bd47SAaro Koskinen reg |= OMAP2_MMCSDIO2ADPCLKISEL; 80faf4bd47SAaro Koskinen omap_ctrl_writel(reg, OMAP343X_CONTROL_DEVCONF1); 81faf4bd47SAaro Koskinen } 8215c9887eSJavier Martinez Canillas 83910f1678SSuman Anna static struct iommu_platform_data omap3_iommu_pdata = { 84910f1678SSuman Anna .reset_name = "mmu", 85910f1678SSuman Anna .assert_reset = omap_device_assert_hardreset, 86910f1678SSuman Anna .deassert_reset = omap_device_deassert_hardreset, 87910f1678SSuman Anna }; 88910f1678SSuman Anna 890f0cfc69STony Lindgren static int omap3_sbc_t3730_twl_callback(struct device *dev, 900f0cfc69STony Lindgren unsigned gpio, 910f0cfc69STony Lindgren unsigned ngpio) 920f0cfc69STony Lindgren { 930f0cfc69STony Lindgren int res; 940f0cfc69STony Lindgren 950f0cfc69STony Lindgren res = gpio_request_one(gpio + 2, GPIOF_OUT_INIT_HIGH, 96d234e423SDmitry Lifshitz "wlan pwr"); 970f0cfc69STony Lindgren if (res) 980f0cfc69STony Lindgren return res; 990f0cfc69STony Lindgren 1000f0cfc69STony Lindgren gpio_export(gpio, 0); 1010f0cfc69STony Lindgren 1020f0cfc69STony Lindgren return 0; 1030f0cfc69STony Lindgren } 1040f0cfc69STony Lindgren 105b62d91e5SDmitry Lifshitz static void __init omap3_sbc_t3x_usb_hub_init(int gpio, char *hub_name) 106b62d91e5SDmitry Lifshitz { 107b62d91e5SDmitry Lifshitz int err = gpio_request_one(gpio, GPIOF_OUT_INIT_LOW, hub_name); 108b62d91e5SDmitry Lifshitz 109b62d91e5SDmitry Lifshitz if (err) { 110b62d91e5SDmitry Lifshitz pr_err("SBC-T3x: %s reset gpio request failed: %d\n", 111b62d91e5SDmitry Lifshitz hub_name, err); 112b62d91e5SDmitry Lifshitz return; 113b62d91e5SDmitry Lifshitz } 114b62d91e5SDmitry Lifshitz 115b62d91e5SDmitry Lifshitz gpio_export(gpio, 0); 116b62d91e5SDmitry Lifshitz 117b62d91e5SDmitry Lifshitz udelay(10); 118b62d91e5SDmitry Lifshitz gpio_set_value(gpio, 1); 119b62d91e5SDmitry Lifshitz msleep(1); 120b62d91e5SDmitry Lifshitz } 121b62d91e5SDmitry Lifshitz 1220f0cfc69STony Lindgren static void __init omap3_sbc_t3730_twl_init(void) 1230f0cfc69STony Lindgren { 1240f0cfc69STony Lindgren twl_gpio_auxdata.setup = omap3_sbc_t3730_twl_callback; 1250f0cfc69STony Lindgren } 1260f0cfc69STony Lindgren 1270f0cfc69STony Lindgren static void __init omap3_sbc_t3730_legacy_init(void) 1280f0cfc69STony Lindgren { 129b62d91e5SDmitry Lifshitz omap3_sbc_t3x_usb_hub_init(167, "sb-t35 usb hub"); 1300f0cfc69STony Lindgren legacy_init_wl12xx(WL12XX_REFCLOCK_38, 0, 136); 1310f0cfc69STony Lindgren omap_ads7846_init(1, 57, 0, NULL); 1320f0cfc69STony Lindgren } 1330f0cfc69STony Lindgren 13440ecc02eSDmitry Lifshitz static void __init omap3_sbc_t3530_legacy_init(void) 13540ecc02eSDmitry Lifshitz { 136b62d91e5SDmitry Lifshitz omap3_sbc_t3x_usb_hub_init(167, "sb-t35 usb hub"); 13740ecc02eSDmitry Lifshitz omap_ads7846_init(1, 57, 0, NULL); 13840ecc02eSDmitry Lifshitz } 13940ecc02eSDmitry Lifshitz 14015c9887eSJavier Martinez Canillas static void __init omap3_igep0020_legacy_init(void) 14115c9887eSJavier Martinez Canillas { 14215c9887eSJavier Martinez Canillas omap3_igep2_display_init_of(); 14315c9887eSJavier Martinez Canillas } 14479b39f79STony Lindgren 14579b39f79STony Lindgren static void __init omap3_evm_legacy_init(void) 14679b39f79STony Lindgren { 14779b39f79STony Lindgren legacy_init_wl12xx(WL12XX_REFCLOCK_38, 0, 149); 14879b39f79STony Lindgren } 14979b39f79STony Lindgren 15079b39f79STony Lindgren static void __init omap3_zoom_legacy_init(void) 15179b39f79STony Lindgren { 15279b39f79STony Lindgren legacy_init_wl12xx(WL12XX_REFCLOCK_26, 0, 162); 15379b39f79STony Lindgren } 15471900314STony Lindgren 15571900314STony Lindgren static void am35xx_enable_emac_int(void) 15671900314STony Lindgren { 15771900314STony Lindgren u32 v; 15871900314STony Lindgren 15971900314STony Lindgren v = omap_ctrl_readl(AM35XX_CONTROL_LVL_INTR_CLEAR); 16071900314STony Lindgren v |= (AM35XX_CPGMAC_C0_RX_PULSE_CLR | AM35XX_CPGMAC_C0_TX_PULSE_CLR | 16171900314STony Lindgren AM35XX_CPGMAC_C0_MISC_PULSE_CLR | AM35XX_CPGMAC_C0_RX_THRESH_CLR); 16271900314STony Lindgren omap_ctrl_writel(v, AM35XX_CONTROL_LVL_INTR_CLEAR); 16371900314STony Lindgren omap_ctrl_readl(AM35XX_CONTROL_LVL_INTR_CLEAR); /* OCP barrier */ 16471900314STony Lindgren } 16571900314STony Lindgren 16671900314STony Lindgren static void am35xx_disable_emac_int(void) 16771900314STony Lindgren { 16871900314STony Lindgren u32 v; 16971900314STony Lindgren 17071900314STony Lindgren v = omap_ctrl_readl(AM35XX_CONTROL_LVL_INTR_CLEAR); 17171900314STony Lindgren v |= (AM35XX_CPGMAC_C0_RX_PULSE_CLR | AM35XX_CPGMAC_C0_TX_PULSE_CLR); 17271900314STony Lindgren omap_ctrl_writel(v, AM35XX_CONTROL_LVL_INTR_CLEAR); 17371900314STony Lindgren omap_ctrl_readl(AM35XX_CONTROL_LVL_INTR_CLEAR); /* OCP barrier */ 17471900314STony Lindgren } 17571900314STony Lindgren 17671900314STony Lindgren static struct emac_platform_data am35xx_emac_pdata = { 17771900314STony Lindgren .interrupt_enable = am35xx_enable_emac_int, 17871900314STony Lindgren .interrupt_disable = am35xx_disable_emac_int, 17971900314STony Lindgren }; 18071900314STony Lindgren 181fb45105aSDmitry Lifshitz static void __init am35xx_emac_reset(void) 18271900314STony Lindgren { 18371900314STony Lindgren u32 v; 18471900314STony Lindgren 18571900314STony Lindgren v = omap_ctrl_readl(AM35XX_CONTROL_IP_SW_RESET); 18671900314STony Lindgren v &= ~AM35XX_CPGMACSS_SW_RST; 18771900314STony Lindgren omap_ctrl_writel(v, AM35XX_CONTROL_IP_SW_RESET); 18871900314STony Lindgren omap_ctrl_readl(AM35XX_CONTROL_IP_SW_RESET); /* OCP barrier */ 18971900314STony Lindgren } 190fb45105aSDmitry Lifshitz 191fb45105aSDmitry Lifshitz static struct gpio cm_t3517_wlan_gpios[] __initdata = { 192fb45105aSDmitry Lifshitz { 56, GPIOF_OUT_INIT_HIGH, "wlan pwr" }, 193fb45105aSDmitry Lifshitz { 4, GPIOF_OUT_INIT_HIGH, "xcvr noe" }, 194fb45105aSDmitry Lifshitz }; 195fb45105aSDmitry Lifshitz 196fb45105aSDmitry Lifshitz static void __init omap3_sbc_t3517_wifi_init(void) 197fb45105aSDmitry Lifshitz { 198fb45105aSDmitry Lifshitz int err = gpio_request_array(cm_t3517_wlan_gpios, 199fb45105aSDmitry Lifshitz ARRAY_SIZE(cm_t3517_wlan_gpios)); 200fb45105aSDmitry Lifshitz if (err) { 201fb45105aSDmitry Lifshitz pr_err("SBC-T3517: wl12xx gpios request failed: %d\n", err); 202fb45105aSDmitry Lifshitz return; 203fb45105aSDmitry Lifshitz } 204fb45105aSDmitry Lifshitz 205fb45105aSDmitry Lifshitz gpio_export(cm_t3517_wlan_gpios[0].gpio, 0); 206fb45105aSDmitry Lifshitz gpio_export(cm_t3517_wlan_gpios[1].gpio, 0); 207fb45105aSDmitry Lifshitz 208fb45105aSDmitry Lifshitz msleep(100); 209fb45105aSDmitry Lifshitz gpio_set_value(cm_t3517_wlan_gpios[1].gpio, 0); 210fb45105aSDmitry Lifshitz } 211fb45105aSDmitry Lifshitz 212fb45105aSDmitry Lifshitz static void __init omap3_sbc_t3517_legacy_init(void) 213fb45105aSDmitry Lifshitz { 214b62d91e5SDmitry Lifshitz omap3_sbc_t3x_usb_hub_init(152, "cm-t3517 usb hub"); 215b62d91e5SDmitry Lifshitz omap3_sbc_t3x_usb_hub_init(98, "sb-t35 usb hub"); 216fb45105aSDmitry Lifshitz am35xx_emac_reset(); 217fb45105aSDmitry Lifshitz hsmmc2_internal_input_clk(); 218fb45105aSDmitry Lifshitz omap3_sbc_t3517_wifi_init(); 219fb45105aSDmitry Lifshitz legacy_init_wl12xx(WL12XX_REFCLOCK_38, 0, 145); 220fb45105aSDmitry Lifshitz omap_ads7846_init(1, 57, 0, NULL); 221fb45105aSDmitry Lifshitz } 222fb45105aSDmitry Lifshitz 223fb45105aSDmitry Lifshitz static void __init am3517_evm_legacy_init(void) 224fb45105aSDmitry Lifshitz { 225fb45105aSDmitry Lifshitz am35xx_emac_reset(); 226fb45105aSDmitry Lifshitz } 227faf4bd47SAaro Koskinen #endif /* CONFIG_ARCH_OMAP3 */ 228faf4bd47SAaro Koskinen 2293e7a3185STony Lindgren #ifdef CONFIG_ARCH_OMAP4 2303e7a3185STony Lindgren static void __init omap4_sdp_legacy_init(void) 2313e7a3185STony Lindgren { 2323e7a3185STony Lindgren omap_4430sdp_display_init_of(); 2335f0a2c69STony Lindgren legacy_init_wl12xx(WL12XX_REFCLOCK_26, 2345f0a2c69STony Lindgren WL12XX_TCXOCLOCK_26, 53); 2353e7a3185STony Lindgren } 2363e7a3185STony Lindgren 2373e7a3185STony Lindgren static void __init omap4_panda_legacy_init(void) 2383e7a3185STony Lindgren { 2393e7a3185STony Lindgren omap4_panda_display_init_of(); 2405f0a2c69STony Lindgren legacy_init_wl12xx(WL12XX_REFCLOCK_38, 0, 53); 2413e7a3185STony Lindgren } 242*67eb1e6eSSuman Anna #endif 243910f1678SSuman Anna 244*67eb1e6eSSuman Anna #if defined(CONFIG_ARCH_OMAP4) || defined(CONFIG_SOC_OMAP5) 245910f1678SSuman Anna static struct iommu_platform_data omap4_iommu_pdata = { 246910f1678SSuman Anna .reset_name = "mmu_cache", 247910f1678SSuman Anna .assert_reset = omap_device_assert_hardreset, 248910f1678SSuman Anna .deassert_reset = omap_device_deassert_hardreset, 249910f1678SSuman Anna }; 2503e7a3185STony Lindgren #endif 2513e7a3185STony Lindgren 25290f4f01bSImre Kaloz #ifdef CONFIG_SOC_AM33XX 25390f4f01bSImre Kaloz static void __init am335x_evmsk_legacy_init(void) 25490f4f01bSImre Kaloz { 25590f4f01bSImre Kaloz legacy_init_wl12xx(WL12XX_REFCLOCK_38, 0, 31); 25690f4f01bSImre Kaloz } 25790f4f01bSImre Kaloz #endif 25890f4f01bSImre Kaloz 2593e7a3185STony Lindgren #ifdef CONFIG_SOC_OMAP5 2603e7a3185STony Lindgren static void __init omap5_uevm_legacy_init(void) 2613e7a3185STony Lindgren { 2623e7a3185STony Lindgren } 2633e7a3185STony Lindgren #endif 2643e7a3185STony Lindgren 26530a69ef7STony Lindgren static struct pcs_pdata pcs_pdata; 26630a69ef7STony Lindgren 26730a69ef7STony Lindgren void omap_pcs_legacy_init(int irq, void (*rearm)(void)) 26830a69ef7STony Lindgren { 26930a69ef7STony Lindgren pcs_pdata.irq = irq; 27030a69ef7STony Lindgren pcs_pdata.rearm = rearm; 27130a69ef7STony Lindgren } 27230a69ef7STony Lindgren 273036582f7STony Lindgren /* 274dad12d11STony Lindgren * GPIOs for TWL are initialized by the I2C bus and need custom 275dad12d11STony Lindgren * handing until DSS has device tree bindings. 276dad12d11STony Lindgren */ 277dad12d11STony Lindgren void omap_auxdata_legacy_init(struct device *dev) 278dad12d11STony Lindgren { 279dad12d11STony Lindgren if (dev->platform_data) 280dad12d11STony Lindgren return; 281dad12d11STony Lindgren 282dad12d11STony Lindgren if (strcmp("twl4030-gpio", dev_name(dev))) 283dad12d11STony Lindgren return; 284dad12d11STony Lindgren 285dad12d11STony Lindgren dev->platform_data = &twl_gpio_auxdata; 286dad12d11STony Lindgren } 287dad12d11STony Lindgren 288dad12d11STony Lindgren /* 289036582f7STony Lindgren * Few boards still need auxdata populated before we populate 290036582f7STony Lindgren * the dev entries in of_platform_populate(). 291036582f7STony Lindgren */ 292036582f7STony Lindgren static struct pdata_init auxdata_quirks[] __initdata = { 293fa590c92STony Lindgren #ifdef CONFIG_SOC_OMAP2420 294fa590c92STony Lindgren { "nokia,n800", omap2420_n8x0_legacy_init, }, 295fa590c92STony Lindgren { "nokia,n810", omap2420_n8x0_legacy_init, }, 296fa590c92STony Lindgren { "nokia,n810-wimax", omap2420_n8x0_legacy_init, }, 297fa590c92STony Lindgren #endif 2980f0cfc69STony Lindgren #ifdef CONFIG_ARCH_OMAP3 2990f0cfc69STony Lindgren { "compulab,omap3-sbc-t3730", omap3_sbc_t3730_twl_init, }, 3000f0cfc69STony Lindgren #endif 301036582f7STony Lindgren { /* sentinel */ }, 302036582f7STony Lindgren }; 303036582f7STony Lindgren 3048651bd8cSTony Lindgren struct of_dev_auxdata omap_auxdata_lookup[] __initdata = { 305036582f7STony Lindgren #ifdef CONFIG_MACH_NOKIA_N8X0 306036582f7STony Lindgren OF_DEV_AUXDATA("ti,omap2420-mmc", 0x4809c000, "mmci-omap.0", NULL), 307036582f7STony Lindgren #endif 30830a69ef7STony Lindgren #ifdef CONFIG_ARCH_OMAP3 30930a69ef7STony Lindgren OF_DEV_AUXDATA("ti,omap3-padconf", 0x48002030, "48002030.pinmux", &pcs_pdata), 31030a69ef7STony Lindgren OF_DEV_AUXDATA("ti,omap3-padconf", 0x48002a00, "48002a00.pinmux", &pcs_pdata), 311910f1678SSuman Anna OF_DEV_AUXDATA("ti,omap2-iommu", 0x5d000000, "5d000000.mmu", 312910f1678SSuman Anna &omap3_iommu_pdata), 31371900314STony Lindgren /* Only on am3517 */ 31471900314STony Lindgren OF_DEV_AUXDATA("ti,davinci_mdio", 0x5c030000, "davinci_mdio.0", NULL), 31571900314STony Lindgren OF_DEV_AUXDATA("ti,am3517-emac", 0x5c000000, "davinci_emac.0", 31671900314STony Lindgren &am35xx_emac_pdata), 31730a69ef7STony Lindgren #endif 31830a69ef7STony Lindgren #ifdef CONFIG_ARCH_OMAP4 31930a69ef7STony Lindgren OF_DEV_AUXDATA("ti,omap4-padconf", 0x4a100040, "4a100040.pinmux", &pcs_pdata), 32030a69ef7STony Lindgren OF_DEV_AUXDATA("ti,omap4-padconf", 0x4a31e040, "4a31e040.pinmux", &pcs_pdata), 321*67eb1e6eSSuman Anna #endif 322*67eb1e6eSSuman Anna #if defined(CONFIG_ARCH_OMAP4) || defined(CONFIG_SOC_OMAP5) 323910f1678SSuman Anna OF_DEV_AUXDATA("ti,omap4-iommu", 0x4a066000, "4a066000.mmu", 324910f1678SSuman Anna &omap4_iommu_pdata), 325910f1678SSuman Anna OF_DEV_AUXDATA("ti,omap4-iommu", 0x55082000, "55082000.mmu", 326910f1678SSuman Anna &omap4_iommu_pdata), 32730a69ef7STony Lindgren #endif 3288651bd8cSTony Lindgren { /* sentinel */ }, 3298651bd8cSTony Lindgren }; 3308651bd8cSTony Lindgren 331036582f7STony Lindgren /* 332036582f7STony Lindgren * Few boards still need to initialize some legacy devices with 333036582f7STony Lindgren * platform data until the drivers support device tree. 334036582f7STony Lindgren */ 3356a08e1e6STony Lindgren static struct pdata_init pdata_quirks[] __initdata = { 336faf4bd47SAaro Koskinen #ifdef CONFIG_ARCH_OMAP3 337fb45105aSDmitry Lifshitz { "compulab,omap3-sbc-t3517", omap3_sbc_t3517_legacy_init, }, 33840ecc02eSDmitry Lifshitz { "compulab,omap3-sbc-t3530", omap3_sbc_t3530_legacy_init, }, 3390f0cfc69STony Lindgren { "compulab,omap3-sbc-t3730", omap3_sbc_t3730_legacy_init, }, 340edd5eb4eSTony Lindgren { "nokia,omap3-n900", hsmmc2_internal_input_clk, }, 341faf4bd47SAaro Koskinen { "nokia,omap3-n9", hsmmc2_internal_input_clk, }, 342faf4bd47SAaro Koskinen { "nokia,omap3-n950", hsmmc2_internal_input_clk, }, 34315c9887eSJavier Martinez Canillas { "isee,omap3-igep0020", omap3_igep0020_legacy_init, }, 34479b39f79STony Lindgren { "ti,omap3-evm-37xx", omap3_evm_legacy_init, }, 34579b39f79STony Lindgren { "ti,omap3-zoom3", omap3_zoom_legacy_init, }, 34671900314STony Lindgren { "ti,am3517-evm", am3517_evm_legacy_init, }, 347faf4bd47SAaro Koskinen #endif 3483e7a3185STony Lindgren #ifdef CONFIG_ARCH_OMAP4 3493e7a3185STony Lindgren { "ti,omap4-sdp", omap4_sdp_legacy_init, }, 3503e7a3185STony Lindgren { "ti,omap4-panda", omap4_panda_legacy_init, }, 3513e7a3185STony Lindgren #endif 35290f4f01bSImre Kaloz #ifdef CONFIG_SOC_AM33XX 35390f4f01bSImre Kaloz { "ti,am335x-evmsk", am335x_evmsk_legacy_init, }, 35490f4f01bSImre Kaloz #endif 3553e7a3185STony Lindgren #ifdef CONFIG_SOC_OMAP5 3563e7a3185STony Lindgren { "ti,omap5-uevm", omap5_uevm_legacy_init, }, 3573e7a3185STony Lindgren #endif 3586a08e1e6STony Lindgren { /* sentinel */ }, 3596a08e1e6STony Lindgren }; 3606a08e1e6STony Lindgren 361036582f7STony Lindgren static void pdata_quirks_check(struct pdata_init *quirks) 3626a08e1e6STony Lindgren { 3636a08e1e6STony Lindgren while (quirks->compatible) { 3646a08e1e6STony Lindgren if (of_machine_is_compatible(quirks->compatible)) { 3656a08e1e6STony Lindgren if (quirks->fn) 3666a08e1e6STony Lindgren quirks->fn(); 3676a08e1e6STony Lindgren break; 3686a08e1e6STony Lindgren } 3696a08e1e6STony Lindgren quirks++; 3706a08e1e6STony Lindgren } 3716a08e1e6STony Lindgren } 372036582f7STony Lindgren 373036582f7STony Lindgren void __init pdata_quirks_init(struct of_device_id *omap_dt_match_table) 374036582f7STony Lindgren { 375036582f7STony Lindgren omap_sdrc_init(NULL, NULL); 376036582f7STony Lindgren pdata_quirks_check(auxdata_quirks); 377036582f7STony Lindgren of_platform_populate(NULL, omap_dt_match_table, 378036582f7STony Lindgren omap_auxdata_lookup, NULL); 379036582f7STony Lindgren pdata_quirks_check(pdata_quirks); 380036582f7STony Lindgren } 381