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 22914c0a5b4SSebastian Reichel static struct platform_device omap3_rom_rng_device = { 23014c0a5b4SSebastian Reichel .name = "omap3-rom-rng", 23114c0a5b4SSebastian Reichel .id = -1, 23214c0a5b4SSebastian Reichel .dev = { 23314c0a5b4SSebastian Reichel .platform_data = rx51_secure_rng_call, 23414c0a5b4SSebastian Reichel }, 23514c0a5b4SSebastian Reichel }; 23614c0a5b4SSebastian Reichel 237deff82e6SSebastian Reichel static void __init nokia_n900_legacy_init(void) 238deff82e6SSebastian Reichel { 239deff82e6SSebastian Reichel hsmmc2_internal_input_clk(); 240deff82e6SSebastian Reichel 241deff82e6SSebastian Reichel if (omap_type() == OMAP2_DEVICE_TYPE_SEC) { 242deff82e6SSebastian Reichel if (IS_ENABLED(CONFIG_ARM_ERRATA_430973)) { 243deff82e6SSebastian Reichel pr_info("RX-51: Enabling ARM errata 430973 workaround\n"); 244deff82e6SSebastian Reichel /* set IBE to 1 */ 245deff82e6SSebastian Reichel rx51_secure_update_aux_cr(BIT(6), 0); 246deff82e6SSebastian Reichel } else { 247deff82e6SSebastian Reichel pr_warning("RX-51: Not enabling ARM errata 430973 workaround\n"); 248deff82e6SSebastian Reichel pr_warning("Thumb binaries may crash randomly without this workaround\n"); 249deff82e6SSebastian Reichel } 25014c0a5b4SSebastian Reichel 25114c0a5b4SSebastian Reichel pr_info("RX-51: Registring OMAP3 HWRNG device\n"); 25214c0a5b4SSebastian Reichel platform_device_register(&omap3_rom_rng_device); 25314c0a5b4SSebastian Reichel 254deff82e6SSebastian Reichel } 255deff82e6SSebastian Reichel } 256faf4bd47SAaro Koskinen #endif /* CONFIG_ARCH_OMAP3 */ 257faf4bd47SAaro Koskinen 2583e7a3185STony Lindgren #ifdef CONFIG_ARCH_OMAP4 2593e7a3185STony Lindgren static void __init omap4_sdp_legacy_init(void) 2603e7a3185STony Lindgren { 2615f0a2c69STony Lindgren legacy_init_wl12xx(WL12XX_REFCLOCK_26, 2625f0a2c69STony Lindgren WL12XX_TCXOCLOCK_26, 53); 2633e7a3185STony Lindgren } 2643e7a3185STony Lindgren 2653e7a3185STony Lindgren static void __init omap4_panda_legacy_init(void) 2663e7a3185STony Lindgren { 2675f0a2c69STony Lindgren legacy_init_wl12xx(WL12XX_REFCLOCK_38, 0, 53); 2683e7a3185STony Lindgren } 26995eb894eSJoachim Eastwood 27095eb894eSJoachim Eastwood static void __init var_som_om44_legacy_init(void) 27195eb894eSJoachim Eastwood { 27295eb894eSJoachim Eastwood legacy_init_wl12xx(WL12XX_REFCLOCK_38, 0, 41); 27395eb894eSJoachim Eastwood } 2743e7a3185STony Lindgren #endif 2753e7a3185STony Lindgren 27667eb1e6eSSuman Anna #if defined(CONFIG_ARCH_OMAP4) || defined(CONFIG_SOC_OMAP5) 277910f1678SSuman Anna static struct iommu_platform_data omap4_iommu_pdata = { 278910f1678SSuman Anna .reset_name = "mmu_cache", 279910f1678SSuman Anna .assert_reset = omap_device_assert_hardreset, 280910f1678SSuman Anna .deassert_reset = omap_device_deassert_hardreset, 281910f1678SSuman Anna }; 2823e7a3185STony Lindgren #endif 2833e7a3185STony Lindgren 28490f4f01bSImre Kaloz #ifdef CONFIG_SOC_AM33XX 28590f4f01bSImre Kaloz static void __init am335x_evmsk_legacy_init(void) 28690f4f01bSImre Kaloz { 28790f4f01bSImre Kaloz legacy_init_wl12xx(WL12XX_REFCLOCK_38, 0, 31); 28890f4f01bSImre Kaloz } 28990f4f01bSImre Kaloz #endif 29090f4f01bSImre Kaloz 2913e7a3185STony Lindgren #ifdef CONFIG_SOC_OMAP5 2923e7a3185STony Lindgren static void __init omap5_uevm_legacy_init(void) 2933e7a3185STony Lindgren { 2943e7a3185STony Lindgren } 2953e7a3185STony Lindgren #endif 2963e7a3185STony Lindgren 29730a69ef7STony Lindgren static struct pcs_pdata pcs_pdata; 29830a69ef7STony Lindgren 29930a69ef7STony Lindgren void omap_pcs_legacy_init(int irq, void (*rearm)(void)) 30030a69ef7STony Lindgren { 30130a69ef7STony Lindgren pcs_pdata.irq = irq; 30230a69ef7STony Lindgren pcs_pdata.rearm = rearm; 30330a69ef7STony Lindgren } 30430a69ef7STony Lindgren 305036582f7STony Lindgren /* 306dad12d11STony Lindgren * GPIOs for TWL are initialized by the I2C bus and need custom 307dad12d11STony Lindgren * handing until DSS has device tree bindings. 308dad12d11STony Lindgren */ 309dad12d11STony Lindgren void omap_auxdata_legacy_init(struct device *dev) 310dad12d11STony Lindgren { 311dad12d11STony Lindgren if (dev->platform_data) 312dad12d11STony Lindgren return; 313dad12d11STony Lindgren 314dad12d11STony Lindgren if (strcmp("twl4030-gpio", dev_name(dev))) 315dad12d11STony Lindgren return; 316dad12d11STony Lindgren 317dad12d11STony Lindgren dev->platform_data = &twl_gpio_auxdata; 318dad12d11STony Lindgren } 319dad12d11STony Lindgren 320dad12d11STony Lindgren /* 321036582f7STony Lindgren * Few boards still need auxdata populated before we populate 322036582f7STony Lindgren * the dev entries in of_platform_populate(). 323036582f7STony Lindgren */ 324036582f7STony Lindgren static struct pdata_init auxdata_quirks[] __initdata = { 325fa590c92STony Lindgren #ifdef CONFIG_SOC_OMAP2420 326fa590c92STony Lindgren { "nokia,n800", omap2420_n8x0_legacy_init, }, 327fa590c92STony Lindgren { "nokia,n810", omap2420_n8x0_legacy_init, }, 328fa590c92STony Lindgren { "nokia,n810-wimax", omap2420_n8x0_legacy_init, }, 329fa590c92STony Lindgren #endif 3300f0cfc69STony Lindgren #ifdef CONFIG_ARCH_OMAP3 3310f0cfc69STony Lindgren { "compulab,omap3-sbc-t3730", omap3_sbc_t3730_twl_init, }, 3320f0cfc69STony Lindgren #endif 333036582f7STony Lindgren { /* sentinel */ }, 334036582f7STony Lindgren }; 335036582f7STony Lindgren 3368651bd8cSTony Lindgren struct of_dev_auxdata omap_auxdata_lookup[] __initdata = { 337036582f7STony Lindgren #ifdef CONFIG_MACH_NOKIA_N8X0 338036582f7STony Lindgren OF_DEV_AUXDATA("ti,omap2420-mmc", 0x4809c000, "mmci-omap.0", NULL), 339036582f7STony Lindgren #endif 34030a69ef7STony Lindgren #ifdef CONFIG_ARCH_OMAP3 34130a69ef7STony Lindgren OF_DEV_AUXDATA("ti,omap3-padconf", 0x48002030, "48002030.pinmux", &pcs_pdata), 3424b416368STony Lindgren OF_DEV_AUXDATA("ti,omap3-padconf", 0x480025a0, "480025a0.pinmux", &pcs_pdata), 34330a69ef7STony Lindgren OF_DEV_AUXDATA("ti,omap3-padconf", 0x48002a00, "48002a00.pinmux", &pcs_pdata), 344910f1678SSuman Anna OF_DEV_AUXDATA("ti,omap2-iommu", 0x5d000000, "5d000000.mmu", 345910f1678SSuman Anna &omap3_iommu_pdata), 34671900314STony Lindgren /* Only on am3517 */ 34771900314STony Lindgren OF_DEV_AUXDATA("ti,davinci_mdio", 0x5c030000, "davinci_mdio.0", NULL), 34871900314STony Lindgren OF_DEV_AUXDATA("ti,am3517-emac", 0x5c000000, "davinci_emac.0", 34971900314STony Lindgren &am35xx_emac_pdata), 35030a69ef7STony Lindgren #endif 35130a69ef7STony Lindgren #ifdef CONFIG_ARCH_OMAP4 35230a69ef7STony Lindgren OF_DEV_AUXDATA("ti,omap4-padconf", 0x4a100040, "4a100040.pinmux", &pcs_pdata), 35330a69ef7STony Lindgren OF_DEV_AUXDATA("ti,omap4-padconf", 0x4a31e040, "4a31e040.pinmux", &pcs_pdata), 35430a69ef7STony Lindgren #endif 35567eb1e6eSSuman Anna #if defined(CONFIG_ARCH_OMAP4) || defined(CONFIG_SOC_OMAP5) 356910f1678SSuman Anna OF_DEV_AUXDATA("ti,omap4-iommu", 0x4a066000, "4a066000.mmu", 357910f1678SSuman Anna &omap4_iommu_pdata), 358910f1678SSuman Anna OF_DEV_AUXDATA("ti,omap4-iommu", 0x55082000, "55082000.mmu", 359910f1678SSuman Anna &omap4_iommu_pdata), 3606a08e1e6STony Lindgren #endif 3616a08e1e6STony Lindgren { /* sentinel */ }, 3628651bd8cSTony Lindgren }; 3636a08e1e6STony Lindgren 364036582f7STony Lindgren /* 365036582f7STony Lindgren * Few boards still need to initialize some legacy devices with 366036582f7STony Lindgren * platform data until the drivers support device tree. 367036582f7STony Lindgren */ 3686a08e1e6STony Lindgren static struct pdata_init pdata_quirks[] __initdata = { 3696a08e1e6STony Lindgren #ifdef CONFIG_ARCH_OMAP3 370fb45105aSDmitry Lifshitz { "compulab,omap3-sbc-t3517", omap3_sbc_t3517_legacy_init, }, 37140ecc02eSDmitry Lifshitz { "compulab,omap3-sbc-t3530", omap3_sbc_t3530_legacy_init, }, 3720f0cfc69STony Lindgren { "compulab,omap3-sbc-t3730", omap3_sbc_t3730_legacy_init, }, 373deff82e6SSebastian Reichel { "nokia,omap3-n900", nokia_n900_legacy_init, }, 3746a08e1e6STony Lindgren { "nokia,omap3-n9", hsmmc2_internal_input_clk, }, 3756a08e1e6STony Lindgren { "nokia,omap3-n950", hsmmc2_internal_input_clk, }, 3766a08e1e6STony Lindgren { "isee,omap3-igep0020", omap3_igep0020_legacy_init, }, 37779b39f79STony Lindgren { "ti,omap3-evm-37xx", omap3_evm_legacy_init, }, 37879b39f79STony Lindgren { "ti,omap3-zoom3", omap3_zoom_legacy_init, }, 37971900314STony Lindgren { "ti,am3517-evm", am3517_evm_legacy_init, }, 3806a08e1e6STony Lindgren #endif 3816a08e1e6STony Lindgren #ifdef CONFIG_ARCH_OMAP4 3826a08e1e6STony Lindgren { "ti,omap4-sdp", omap4_sdp_legacy_init, }, 3836a08e1e6STony Lindgren { "ti,omap4-panda", omap4_panda_legacy_init, }, 38495eb894eSJoachim Eastwood { "variscite,var-dvk-om44", var_som_om44_legacy_init, }, 38595eb894eSJoachim Eastwood { "variscite,var-stk-om44", var_som_om44_legacy_init, }, 3866a08e1e6STony Lindgren #endif 38790f4f01bSImre Kaloz #ifdef CONFIG_SOC_AM33XX 38890f4f01bSImre Kaloz { "ti,am335x-evmsk", am335x_evmsk_legacy_init, }, 38990f4f01bSImre Kaloz #endif 3906a08e1e6STony Lindgren #ifdef CONFIG_SOC_OMAP5 3916a08e1e6STony Lindgren { "ti,omap5-uevm", omap5_uevm_legacy_init, }, 3926a08e1e6STony Lindgren #endif 3936a08e1e6STony Lindgren { /* sentinel */ }, 3946a08e1e6STony Lindgren }; 3956a08e1e6STony Lindgren 396036582f7STony Lindgren static void pdata_quirks_check(struct pdata_init *quirks) 3976a08e1e6STony Lindgren { 3986a08e1e6STony Lindgren while (quirks->compatible) { 3996a08e1e6STony Lindgren if (of_machine_is_compatible(quirks->compatible)) { 4006a08e1e6STony Lindgren if (quirks->fn) 4016a08e1e6STony Lindgren quirks->fn(); 4026a08e1e6STony Lindgren break; 4036a08e1e6STony Lindgren } 4046a08e1e6STony Lindgren quirks++; 4056a08e1e6STony Lindgren } 4066a08e1e6STony Lindgren } 407036582f7STony Lindgren 408*31957609SUwe Kleine-König void __init pdata_quirks_init(const struct of_device_id *omap_dt_match_table) 409036582f7STony Lindgren { 410036582f7STony Lindgren omap_sdrc_init(NULL, NULL); 411036582f7STony Lindgren pdata_quirks_check(auxdata_quirks); 412036582f7STony Lindgren of_platform_populate(NULL, omap_dt_match_table, 413036582f7STony Lindgren omap_auxdata_lookup, NULL); 414036582f7STony Lindgren pdata_quirks_check(pdata_quirks); 415036582f7STony Lindgren } 416