aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/pdata-quirks.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-omap2/pdata-quirks.c')
-rw-r--r--arch/arm/mach-omap2/pdata-quirks.c138
1 files changed, 119 insertions, 19 deletions
diff --git a/arch/arm/mach-omap2/pdata-quirks.c b/arch/arm/mach-omap2/pdata-quirks.c
index 3d5b24dcd9a4..b04c5f0fc278 100644
--- a/arch/arm/mach-omap2/pdata-quirks.c
+++ b/arch/arm/mach-omap2/pdata-quirks.c
@@ -16,12 +16,16 @@
16#include <linux/wl12xx.h> 16#include <linux/wl12xx.h>
17 17
18#include <linux/platform_data/pinctrl-single.h> 18#include <linux/platform_data/pinctrl-single.h>
19#include <linux/platform_data/iommu-omap.h>
19 20
20#include "am35xx.h" 21#include "am35xx.h"
21#include "common.h" 22#include "common.h"
22#include "common-board-devices.h" 23#include "common-board-devices.h"
23#include "dss-common.h" 24#include "dss-common.h"
24#include "control.h" 25#include "control.h"
26#include "omap_device.h"
27#include "omap-secure.h"
28#include "soc.h"
25 29
26struct pdata_init { 30struct pdata_init {
27 const char *compatible; 31 const char *compatible;
@@ -31,20 +35,6 @@ struct pdata_init {
31struct of_dev_auxdata omap_auxdata_lookup[]; 35struct of_dev_auxdata omap_auxdata_lookup[];
32static struct twl4030_gpio_platform_data twl_gpio_auxdata; 36static struct twl4030_gpio_platform_data twl_gpio_auxdata;
33 37
34/*
35 * Create alias for USB host PHY clock.
36 * Remove this when clock phandle can be provided via DT
37 */
38static void __init __used legacy_init_ehci_clk(char *clkname)
39{
40 int ret;
41
42 ret = clk_add_alias("main_clk", NULL, clkname, NULL);
43 if (ret)
44 pr_err("%s:Failed to add main_clk alias to %s :%d\n",
45 __func__, clkname, ret);
46}
47
48#if IS_ENABLED(CONFIG_WL12XX) 38#if IS_ENABLED(CONFIG_WL12XX)
49 39
50static struct wl12xx_platform_data wl12xx __initdata; 40static struct wl12xx_platform_data wl12xx __initdata;
@@ -92,6 +82,12 @@ static void __init hsmmc2_internal_input_clk(void)
92 omap_ctrl_writel(reg, OMAP343X_CONTROL_DEVCONF1); 82 omap_ctrl_writel(reg, OMAP343X_CONTROL_DEVCONF1);
93} 83}
94 84
85static struct iommu_platform_data omap3_iommu_pdata = {
86 .reset_name = "mmu",
87 .assert_reset = omap_device_assert_hardreset,
88 .deassert_reset = omap_device_deassert_hardreset,
89};
90
95static int omap3_sbc_t3730_twl_callback(struct device *dev, 91static int omap3_sbc_t3730_twl_callback(struct device *dev,
96 unsigned gpio, 92 unsigned gpio,
97 unsigned ngpio) 93 unsigned ngpio)
@@ -99,7 +95,7 @@ static int omap3_sbc_t3730_twl_callback(struct device *dev,
99 int res; 95 int res;
100 96
101 res = gpio_request_one(gpio + 2, GPIOF_OUT_INIT_HIGH, 97 res = gpio_request_one(gpio + 2, GPIOF_OUT_INIT_HIGH,
102 "wlan rst"); 98 "wlan pwr");
103 if (res) 99 if (res)
104 return res; 100 return res;
105 101
@@ -108,6 +104,23 @@ static int omap3_sbc_t3730_twl_callback(struct device *dev,
108 return 0; 104 return 0;
109} 105}
110 106
107static void __init omap3_sbc_t3x_usb_hub_init(int gpio, char *hub_name)
108{
109 int err = gpio_request_one(gpio, GPIOF_OUT_INIT_LOW, hub_name);
110
111 if (err) {
112 pr_err("SBC-T3x: %s reset gpio request failed: %d\n",
113 hub_name, err);
114 return;
115 }
116
117 gpio_export(gpio, 0);
118
119 udelay(10);
120 gpio_set_value(gpio, 1);
121 msleep(1);
122}
123
111static void __init omap3_sbc_t3730_twl_init(void) 124static void __init omap3_sbc_t3730_twl_init(void)
112{ 125{
113 twl_gpio_auxdata.setup = omap3_sbc_t3730_twl_callback; 126 twl_gpio_auxdata.setup = omap3_sbc_t3730_twl_callback;
@@ -115,10 +128,17 @@ static void __init omap3_sbc_t3730_twl_init(void)
115 128
116static void __init omap3_sbc_t3730_legacy_init(void) 129static void __init omap3_sbc_t3730_legacy_init(void)
117{ 130{
131 omap3_sbc_t3x_usb_hub_init(167, "sb-t35 usb hub");
118 legacy_init_wl12xx(WL12XX_REFCLOCK_38, 0, 136); 132 legacy_init_wl12xx(WL12XX_REFCLOCK_38, 0, 136);
119 omap_ads7846_init(1, 57, 0, NULL); 133 omap_ads7846_init(1, 57, 0, NULL);
120} 134}
121 135
136static void __init omap3_sbc_t3530_legacy_init(void)
137{
138 omap3_sbc_t3x_usb_hub_init(167, "sb-t35 usb hub");
139 omap_ads7846_init(1, 57, 0, NULL);
140}
141
122static void __init omap3_igep0020_legacy_init(void) 142static void __init omap3_igep0020_legacy_init(void)
123{ 143{
124 omap3_igep2_display_init_of(); 144 omap3_igep2_display_init_of();
@@ -160,7 +180,7 @@ static struct emac_platform_data am35xx_emac_pdata = {
160 .interrupt_disable = am35xx_disable_emac_int, 180 .interrupt_disable = am35xx_disable_emac_int,
161}; 181};
162 182
163static void __init am3517_evm_legacy_init(void) 183static void __init am35xx_emac_reset(void)
164{ 184{
165 u32 v; 185 u32 v;
166 186
@@ -169,6 +189,59 @@ static void __init am3517_evm_legacy_init(void)
169 omap_ctrl_writel(v, AM35XX_CONTROL_IP_SW_RESET); 189 omap_ctrl_writel(v, AM35XX_CONTROL_IP_SW_RESET);
170 omap_ctrl_readl(AM35XX_CONTROL_IP_SW_RESET); /* OCP barrier */ 190 omap_ctrl_readl(AM35XX_CONTROL_IP_SW_RESET); /* OCP barrier */
171} 191}
192
193static struct gpio cm_t3517_wlan_gpios[] __initdata = {
194 { 56, GPIOF_OUT_INIT_HIGH, "wlan pwr" },
195 { 4, GPIOF_OUT_INIT_HIGH, "xcvr noe" },
196};
197
198static void __init omap3_sbc_t3517_wifi_init(void)
199{
200 int err = gpio_request_array(cm_t3517_wlan_gpios,
201 ARRAY_SIZE(cm_t3517_wlan_gpios));
202 if (err) {
203 pr_err("SBC-T3517: wl12xx gpios request failed: %d\n", err);
204 return;
205 }
206
207 gpio_export(cm_t3517_wlan_gpios[0].gpio, 0);
208 gpio_export(cm_t3517_wlan_gpios[1].gpio, 0);
209
210 msleep(100);
211 gpio_set_value(cm_t3517_wlan_gpios[1].gpio, 0);
212}
213
214static void __init omap3_sbc_t3517_legacy_init(void)
215{
216 omap3_sbc_t3x_usb_hub_init(152, "cm-t3517 usb hub");
217 omap3_sbc_t3x_usb_hub_init(98, "sb-t35 usb hub");
218 am35xx_emac_reset();
219 hsmmc2_internal_input_clk();
220 omap3_sbc_t3517_wifi_init();
221 legacy_init_wl12xx(WL12XX_REFCLOCK_38, 0, 145);
222 omap_ads7846_init(1, 57, 0, NULL);
223}
224
225static void __init am3517_evm_legacy_init(void)
226{
227 am35xx_emac_reset();
228}
229
230static void __init nokia_n900_legacy_init(void)
231{
232 hsmmc2_internal_input_clk();
233
234 if (omap_type() == OMAP2_DEVICE_TYPE_SEC) {
235 if (IS_ENABLED(CONFIG_ARM_ERRATA_430973)) {
236 pr_info("RX-51: Enabling ARM errata 430973 workaround\n");
237 /* set IBE to 1 */
238 rx51_secure_update_aux_cr(BIT(6), 0);
239 } else {
240 pr_warning("RX-51: Not enabling ARM errata 430973 workaround\n");
241 pr_warning("Thumb binaries may crash randomly without this workaround\n");
242 }
243 }
244}
172#endif /* CONFIG_ARCH_OMAP3 */ 245#endif /* CONFIG_ARCH_OMAP3 */
173 246
174#ifdef CONFIG_ARCH_OMAP4 247#ifdef CONFIG_ARCH_OMAP4
@@ -182,15 +255,28 @@ static void __init omap4_sdp_legacy_init(void)
182static void __init omap4_panda_legacy_init(void) 255static void __init omap4_panda_legacy_init(void)
183{ 256{
184 omap4_panda_display_init_of(); 257 omap4_panda_display_init_of();
185 legacy_init_ehci_clk("auxclk3_ck");
186 legacy_init_wl12xx(WL12XX_REFCLOCK_38, 0, 53); 258 legacy_init_wl12xx(WL12XX_REFCLOCK_38, 0, 53);
187} 259}
188#endif 260#endif
189 261
262#if defined(CONFIG_ARCH_OMAP4) || defined(CONFIG_SOC_OMAP5)
263static struct iommu_platform_data omap4_iommu_pdata = {
264 .reset_name = "mmu_cache",
265 .assert_reset = omap_device_assert_hardreset,
266 .deassert_reset = omap_device_deassert_hardreset,
267};
268#endif
269
270#ifdef CONFIG_SOC_AM33XX
271static void __init am335x_evmsk_legacy_init(void)
272{
273 legacy_init_wl12xx(WL12XX_REFCLOCK_38, 0, 31);
274}
275#endif
276
190#ifdef CONFIG_SOC_OMAP5 277#ifdef CONFIG_SOC_OMAP5
191static void __init omap5_uevm_legacy_init(void) 278static void __init omap5_uevm_legacy_init(void)
192{ 279{
193 legacy_init_ehci_clk("auxclk1_ck");
194} 280}
195#endif 281#endif
196 282
@@ -239,7 +325,10 @@ struct of_dev_auxdata omap_auxdata_lookup[] __initdata = {
239#endif 325#endif
240#ifdef CONFIG_ARCH_OMAP3 326#ifdef CONFIG_ARCH_OMAP3
241 OF_DEV_AUXDATA("ti,omap3-padconf", 0x48002030, "48002030.pinmux", &pcs_pdata), 327 OF_DEV_AUXDATA("ti,omap3-padconf", 0x48002030, "48002030.pinmux", &pcs_pdata),
328 OF_DEV_AUXDATA("ti,omap3-padconf", 0x480025a0, "480025a0.pinmux", &pcs_pdata),
242 OF_DEV_AUXDATA("ti,omap3-padconf", 0x48002a00, "48002a00.pinmux", &pcs_pdata), 329 OF_DEV_AUXDATA("ti,omap3-padconf", 0x48002a00, "48002a00.pinmux", &pcs_pdata),
330 OF_DEV_AUXDATA("ti,omap2-iommu", 0x5d000000, "5d000000.mmu",
331 &omap3_iommu_pdata),
243 /* Only on am3517 */ 332 /* Only on am3517 */
244 OF_DEV_AUXDATA("ti,davinci_mdio", 0x5c030000, "davinci_mdio.0", NULL), 333 OF_DEV_AUXDATA("ti,davinci_mdio", 0x5c030000, "davinci_mdio.0", NULL),
245 OF_DEV_AUXDATA("ti,am3517-emac", 0x5c000000, "davinci_emac.0", 334 OF_DEV_AUXDATA("ti,am3517-emac", 0x5c000000, "davinci_emac.0",
@@ -249,6 +338,12 @@ struct of_dev_auxdata omap_auxdata_lookup[] __initdata = {
249 OF_DEV_AUXDATA("ti,omap4-padconf", 0x4a100040, "4a100040.pinmux", &pcs_pdata), 338 OF_DEV_AUXDATA("ti,omap4-padconf", 0x4a100040, "4a100040.pinmux", &pcs_pdata),
250 OF_DEV_AUXDATA("ti,omap4-padconf", 0x4a31e040, "4a31e040.pinmux", &pcs_pdata), 339 OF_DEV_AUXDATA("ti,omap4-padconf", 0x4a31e040, "4a31e040.pinmux", &pcs_pdata),
251#endif 340#endif
341#if defined(CONFIG_ARCH_OMAP4) || defined(CONFIG_SOC_OMAP5)
342 OF_DEV_AUXDATA("ti,omap4-iommu", 0x4a066000, "4a066000.mmu",
343 &omap4_iommu_pdata),
344 OF_DEV_AUXDATA("ti,omap4-iommu", 0x55082000, "55082000.mmu",
345 &omap4_iommu_pdata),
346#endif
252 { /* sentinel */ }, 347 { /* sentinel */ },
253}; 348};
254 349
@@ -258,8 +353,10 @@ struct of_dev_auxdata omap_auxdata_lookup[] __initdata = {
258 */ 353 */
259static struct pdata_init pdata_quirks[] __initdata = { 354static struct pdata_init pdata_quirks[] __initdata = {
260#ifdef CONFIG_ARCH_OMAP3 355#ifdef CONFIG_ARCH_OMAP3
356 { "compulab,omap3-sbc-t3517", omap3_sbc_t3517_legacy_init, },
357 { "compulab,omap3-sbc-t3530", omap3_sbc_t3530_legacy_init, },
261 { "compulab,omap3-sbc-t3730", omap3_sbc_t3730_legacy_init, }, 358 { "compulab,omap3-sbc-t3730", omap3_sbc_t3730_legacy_init, },
262 { "nokia,omap3-n900", hsmmc2_internal_input_clk, }, 359 { "nokia,omap3-n900", nokia_n900_legacy_init, },
263 { "nokia,omap3-n9", hsmmc2_internal_input_clk, }, 360 { "nokia,omap3-n9", hsmmc2_internal_input_clk, },
264 { "nokia,omap3-n950", hsmmc2_internal_input_clk, }, 361 { "nokia,omap3-n950", hsmmc2_internal_input_clk, },
265 { "isee,omap3-igep0020", omap3_igep0020_legacy_init, }, 362 { "isee,omap3-igep0020", omap3_igep0020_legacy_init, },
@@ -271,6 +368,9 @@ static struct pdata_init pdata_quirks[] __initdata = {
271 { "ti,omap4-sdp", omap4_sdp_legacy_init, }, 368 { "ti,omap4-sdp", omap4_sdp_legacy_init, },
272 { "ti,omap4-panda", omap4_panda_legacy_init, }, 369 { "ti,omap4-panda", omap4_panda_legacy_init, },
273#endif 370#endif
371#ifdef CONFIG_SOC_AM33XX
372 { "ti,am335x-evmsk", am335x_evmsk_legacy_init, },
373#endif
274#ifdef CONFIG_SOC_OMAP5 374#ifdef CONFIG_SOC_OMAP5
275 { "ti,omap5-uevm", omap5_uevm_legacy_init, }, 375 { "ti,omap5-uevm", omap5_uevm_legacy_init, },
276#endif 376#endif