diff options
27 files changed, 191 insertions, 117 deletions
diff --git a/arch/arm/mach-imx/mach-cpuimx27.c b/arch/arm/mach-imx/mach-cpuimx27.c index cabb800adbb6..6b724c2ed0a7 100644 --- a/arch/arm/mach-imx/mach-cpuimx27.c +++ b/arch/arm/mach-imx/mach-cpuimx27.c | |||
@@ -210,14 +210,24 @@ static struct platform_device serial_device = { | |||
210 | #endif | 210 | #endif |
211 | 211 | ||
212 | #if defined(CONFIG_USB_ULPI) | 212 | #if defined(CONFIG_USB_ULPI) |
213 | static int eukrea_cpuimx27_otg_init(struct platform_device *pdev) | ||
214 | { | ||
215 | return mx27_initialize_usb_hw(pdev->id, MXC_EHCI_INTERFACE_DIFF_UNI); | ||
216 | } | ||
217 | |||
213 | static struct mxc_usbh_platform_data otg_pdata __initdata = { | 218 | static struct mxc_usbh_platform_data otg_pdata __initdata = { |
219 | .init = eukrea_cpuimx27_otg_init, | ||
214 | .portsc = MXC_EHCI_MODE_ULPI, | 220 | .portsc = MXC_EHCI_MODE_ULPI, |
215 | .flags = MXC_EHCI_INTERFACE_DIFF_UNI, | ||
216 | }; | 221 | }; |
217 | 222 | ||
223 | static int eukrea_cpuimx27_usbh2_init(struct platform_device *pdev) | ||
224 | { | ||
225 | return mx27_initialize_usb_hw(pdev->id, MXC_EHCI_INTERFACE_DIFF_UNI); | ||
226 | } | ||
227 | |||
218 | static struct mxc_usbh_platform_data usbh2_pdata __initdata = { | 228 | static struct mxc_usbh_platform_data usbh2_pdata __initdata = { |
229 | .init = eukrea_cpuimx27_usbh2_init, | ||
219 | .portsc = MXC_EHCI_MODE_ULPI, | 230 | .portsc = MXC_EHCI_MODE_ULPI, |
220 | .flags = MXC_EHCI_INTERFACE_DIFF_UNI, | ||
221 | }; | 231 | }; |
222 | #endif | 232 | #endif |
223 | 233 | ||
diff --git a/arch/arm/mach-imx/mach-eukrea_cpuimx25.c b/arch/arm/mach-imx/mach-eukrea_cpuimx25.c index 439167dbe8f6..9da8d18eeb00 100644 --- a/arch/arm/mach-imx/mach-eukrea_cpuimx25.c +++ b/arch/arm/mach-imx/mach-eukrea_cpuimx25.c | |||
@@ -84,15 +84,25 @@ static struct i2c_board_info eukrea_cpuimx25_i2c_devices[] = { | |||
84 | }, | 84 | }, |
85 | }; | 85 | }; |
86 | 86 | ||
87 | static int eukrea_cpuimx25_otg_init(struct platform_device *pdev) | ||
88 | { | ||
89 | return mx25_initialize_usb_hw(pdev->id, MXC_EHCI_INTERFACE_DIFF_UNI); | ||
90 | } | ||
91 | |||
87 | static const struct mxc_usbh_platform_data otg_pdata __initconst = { | 92 | static const struct mxc_usbh_platform_data otg_pdata __initconst = { |
93 | .init = eukrea_cpuimx25_otg_init, | ||
88 | .portsc = MXC_EHCI_MODE_UTMI, | 94 | .portsc = MXC_EHCI_MODE_UTMI, |
89 | .flags = MXC_EHCI_INTERFACE_DIFF_UNI, | ||
90 | }; | 95 | }; |
91 | 96 | ||
97 | static int eukrea_cpuimx25_usbh2_init(struct platform_device *pdev) | ||
98 | { | ||
99 | return mx25_initialize_usb_hw(pdev->id, MXC_EHCI_INTERFACE_SINGLE_UNI | | ||
100 | MXC_EHCI_INTERNAL_PHY | MXC_EHCI_IPPUE_DOWN); | ||
101 | } | ||
102 | |||
92 | static const struct mxc_usbh_platform_data usbh2_pdata __initconst = { | 103 | static const struct mxc_usbh_platform_data usbh2_pdata __initconst = { |
104 | .init = eukrea_cpuimx25_usbh2_init, | ||
93 | .portsc = MXC_EHCI_MODE_SERIAL, | 105 | .portsc = MXC_EHCI_MODE_SERIAL, |
94 | .flags = MXC_EHCI_INTERFACE_SINGLE_UNI | MXC_EHCI_INTERNAL_PHY | | ||
95 | MXC_EHCI_IPPUE_DOWN, | ||
96 | }; | 106 | }; |
97 | 107 | ||
98 | static const struct fsl_usb2_platform_data otg_device_pdata __initconst = { | 108 | static const struct fsl_usb2_platform_data otg_device_pdata __initconst = { |
diff --git a/arch/arm/mach-imx/mach-imx27_visstrim_m10.c b/arch/arm/mach-imx/mach-imx27_visstrim_m10.c index 494723bf7ea7..ffff2d03f782 100644 --- a/arch/arm/mach-imx/mach-imx27_visstrim_m10.c +++ b/arch/arm/mach-imx/mach-imx27_visstrim_m10.c | |||
@@ -30,6 +30,7 @@ | |||
30 | #include <linux/gpio_keys.h> | 30 | #include <linux/gpio_keys.h> |
31 | #include <linux/input.h> | 31 | #include <linux/input.h> |
32 | #include <linux/gpio.h> | 32 | #include <linux/gpio.h> |
33 | #include <linux/delay.h> | ||
33 | #include <asm/mach-types.h> | 34 | #include <asm/mach-types.h> |
34 | #include <asm/mach/arch.h> | 35 | #include <asm/mach/arch.h> |
35 | #include <asm/mach/time.h> | 36 | #include <asm/mach/time.h> |
@@ -210,14 +211,16 @@ static struct i2c_board_info visstrim_m10_i2c_devices[] = { | |||
210 | static int otg_phy_init(struct platform_device *pdev) | 211 | static int otg_phy_init(struct platform_device *pdev) |
211 | { | 212 | { |
212 | gpio_set_value(OTG_PHY_CS_GPIO, 0); | 213 | gpio_set_value(OTG_PHY_CS_GPIO, 0); |
213 | return 0; | 214 | |
215 | mdelay(10); | ||
216 | |||
217 | return mx27_initialize_usb_hw(pdev->id, MXC_EHCI_POWER_PINS_ENABLED); | ||
214 | } | 218 | } |
215 | 219 | ||
216 | static const struct mxc_usbh_platform_data | 220 | static const struct mxc_usbh_platform_data |
217 | visstrim_m10_usbotg_pdata __initconst = { | 221 | visstrim_m10_usbotg_pdata __initconst = { |
218 | .init = otg_phy_init, | 222 | .init = otg_phy_init, |
219 | .portsc = MXC_EHCI_MODE_ULPI | MXC_EHCI_UTMI_8BIT, | 223 | .portsc = MXC_EHCI_MODE_ULPI | MXC_EHCI_UTMI_8BIT, |
220 | .flags = MXC_EHCI_POWER_PINS_ENABLED, | ||
221 | }; | 224 | }; |
222 | 225 | ||
223 | static void __init visstrim_m10_board_init(void) | 226 | static void __init visstrim_m10_board_init(void) |
diff --git a/arch/arm/mach-imx/mach-mx25_3ds.c b/arch/arm/mach-imx/mach-mx25_3ds.c index cd18a0c91b83..aafc6f7f1816 100644 --- a/arch/arm/mach-imx/mach-mx25_3ds.c +++ b/arch/arm/mach-imx/mach-mx25_3ds.c | |||
@@ -185,9 +185,14 @@ static const struct matrix_keymap_data mx25pdk_keymap_data __initconst = { | |||
185 | .keymap_size = ARRAY_SIZE(mx25pdk_keymap), | 185 | .keymap_size = ARRAY_SIZE(mx25pdk_keymap), |
186 | }; | 186 | }; |
187 | 187 | ||
188 | static int mx25pdk_usbh2_init(struct platform_device *pdev) | ||
189 | { | ||
190 | return mx25_initialize_usb_hw(pdev->id, MXC_EHCI_INTERNAL_PHY); | ||
191 | } | ||
192 | |||
188 | static const struct mxc_usbh_platform_data usbh2_pdata __initconst = { | 193 | static const struct mxc_usbh_platform_data usbh2_pdata __initconst = { |
194 | .init = mx25pdk_usbh2_init, | ||
189 | .portsc = MXC_EHCI_MODE_SERIAL, | 195 | .portsc = MXC_EHCI_MODE_SERIAL, |
190 | .flags = MXC_EHCI_INTERNAL_PHY, | ||
191 | }; | 196 | }; |
192 | 197 | ||
193 | static const struct fsl_usb2_platform_data otg_device_pdata __initconst = { | 198 | static const struct fsl_usb2_platform_data otg_device_pdata __initconst = { |
diff --git a/arch/arm/mach-imx/mach-mx27_3ds.c b/arch/arm/mach-imx/mach-mx27_3ds.c index 4e0e225ca4a2..ba88417345ab 100644 --- a/arch/arm/mach-imx/mach-mx27_3ds.c +++ b/arch/arm/mach-imx/mach-mx27_3ds.c | |||
@@ -160,10 +160,14 @@ static int otg_phy_init(void) | |||
160 | } | 160 | } |
161 | 161 | ||
162 | #if defined(CONFIG_USB_ULPI) | 162 | #if defined(CONFIG_USB_ULPI) |
163 | static int mx27_3ds_otg_init(struct platform_device *pdev) | ||
164 | { | ||
165 | return mx27_initialize_usb_hw(pdev->id, MXC_EHCI_INTERFACE_DIFF_UNI); | ||
166 | } | ||
163 | 167 | ||
164 | static struct mxc_usbh_platform_data otg_pdata __initdata = { | 168 | static struct mxc_usbh_platform_data otg_pdata __initdata = { |
169 | .init = mx27_3ds_otg_init, | ||
165 | .portsc = MXC_EHCI_MODE_ULPI, | 170 | .portsc = MXC_EHCI_MODE_ULPI, |
166 | .flags = MXC_EHCI_INTERFACE_DIFF_UNI, | ||
167 | }; | 171 | }; |
168 | #endif | 172 | #endif |
169 | 173 | ||
diff --git a/arch/arm/mach-imx/mach-pca100.c b/arch/arm/mach-imx/mach-pca100.c index 3514178caeda..f754bab040b6 100644 --- a/arch/arm/mach-imx/mach-pca100.c +++ b/arch/arm/mach-imx/mach-pca100.c | |||
@@ -271,25 +271,29 @@ static const struct imxmmc_platform_data sdhc_pdata __initconst = { | |||
271 | static int otg_phy_init(struct platform_device *pdev) | 271 | static int otg_phy_init(struct platform_device *pdev) |
272 | { | 272 | { |
273 | gpio_set_value(OTG_PHY_CS_GPIO, 0); | 273 | gpio_set_value(OTG_PHY_CS_GPIO, 0); |
274 | return 0; | 274 | |
275 | mdelay(10); | ||
276 | |||
277 | return mx27_initialize_usb_hw(pdev->id, MXC_EHCI_INTERFACE_DIFF_UNI); | ||
275 | } | 278 | } |
276 | 279 | ||
277 | static struct mxc_usbh_platform_data otg_pdata __initdata = { | 280 | static struct mxc_usbh_platform_data otg_pdata __initdata = { |
278 | .init = otg_phy_init, | 281 | .init = otg_phy_init, |
279 | .portsc = MXC_EHCI_MODE_ULPI, | 282 | .portsc = MXC_EHCI_MODE_ULPI, |
280 | .flags = MXC_EHCI_INTERFACE_DIFF_UNI, | ||
281 | }; | 283 | }; |
282 | 284 | ||
283 | static int usbh2_phy_init(struct platform_device *pdev) | 285 | static int usbh2_phy_init(struct platform_device *pdev) |
284 | { | 286 | { |
285 | gpio_set_value(USBH2_PHY_CS_GPIO, 0); | 287 | gpio_set_value(USBH2_PHY_CS_GPIO, 0); |
286 | return 0; | 288 | |
289 | mdelay(10); | ||
290 | |||
291 | return mx27_initialize_usb_hw(pdev->id, MXC_EHCI_INTERFACE_DIFF_UNI); | ||
287 | } | 292 | } |
288 | 293 | ||
289 | static struct mxc_usbh_platform_data usbh2_pdata __initdata = { | 294 | static struct mxc_usbh_platform_data usbh2_pdata __initdata = { |
290 | .init = usbh2_phy_init, | 295 | .init = usbh2_phy_init, |
291 | .portsc = MXC_EHCI_MODE_ULPI, | 296 | .portsc = MXC_EHCI_MODE_ULPI, |
292 | .flags = MXC_EHCI_INTERFACE_DIFF_UNI, | ||
293 | }; | 297 | }; |
294 | #endif | 298 | #endif |
295 | 299 | ||
diff --git a/arch/arm/mach-imx/mach-pcm038.c b/arch/arm/mach-imx/mach-pcm038.c index 9656ef38ca96..38c77084b615 100644 --- a/arch/arm/mach-imx/mach-pcm038.c +++ b/arch/arm/mach-imx/mach-pcm038.c | |||
@@ -281,9 +281,15 @@ static struct spi_board_info pcm038_spi_board_info[] __initdata = { | |||
281 | } | 281 | } |
282 | }; | 282 | }; |
283 | 283 | ||
284 | static int pcm038_usbh2_init(struct platform_device *pdev) | ||
285 | { | ||
286 | return mx27_initialize_usb_hw(pdev->id, MXC_EHCI_POWER_PINS_ENABLED | | ||
287 | MXC_EHCI_INTERFACE_DIFF_UNI); | ||
288 | } | ||
289 | |||
284 | static const struct mxc_usbh_platform_data usbh2_pdata __initconst = { | 290 | static const struct mxc_usbh_platform_data usbh2_pdata __initconst = { |
291 | .init = pcm038_usbh2_init, | ||
285 | .portsc = MXC_EHCI_MODE_ULPI, | 292 | .portsc = MXC_EHCI_MODE_ULPI, |
286 | .flags = MXC_EHCI_POWER_PINS_ENABLED | MXC_EHCI_INTERFACE_DIFF_UNI, | ||
287 | }; | 293 | }; |
288 | 294 | ||
289 | static void __init pcm038_init(void) | 295 | static void __init pcm038_init(void) |
diff --git a/arch/arm/mach-mx3/mach-armadillo5x0.c b/arch/arm/mach-mx3/mach-armadillo5x0.c index 835e2a082b41..34e619e811e6 100644 --- a/arch/arm/mach-mx3/mach-armadillo5x0.c +++ b/arch/arm/mach-mx3/mach-armadillo5x0.c | |||
@@ -176,8 +176,10 @@ static int usbotg_init(struct platform_device *pdev) | |||
176 | gpio_set_value(OTG_RESET, 0/*LOW*/); | 176 | gpio_set_value(OTG_RESET, 0/*LOW*/); |
177 | mdelay(5); | 177 | mdelay(5); |
178 | gpio_set_value(OTG_RESET, 1/*HIGH*/); | 178 | gpio_set_value(OTG_RESET, 1/*HIGH*/); |
179 | mdelay(10); | ||
179 | 180 | ||
180 | return 0; | 181 | return mx31_initialize_usb_hw(pdev->id, MXC_EHCI_POWER_PINS_ENABLED | |
182 | MXC_EHCI_INTERFACE_DIFF_UNI); | ||
181 | 183 | ||
182 | otg_free_reset: | 184 | otg_free_reset: |
183 | gpio_free(OTG_RESET); | 185 | gpio_free(OTG_RESET); |
@@ -233,8 +235,10 @@ static int usbh2_init(struct platform_device *pdev) | |||
233 | gpio_set_value(USBH2_RESET, 0/*LOW*/); | 235 | gpio_set_value(USBH2_RESET, 0/*LOW*/); |
234 | mdelay(5); | 236 | mdelay(5); |
235 | gpio_set_value(USBH2_RESET, 1/*HIGH*/); | 237 | gpio_set_value(USBH2_RESET, 1/*HIGH*/); |
238 | mdelay(10); | ||
236 | 239 | ||
237 | return 0; | 240 | return mx31_initialize_usb_hw(pdev->id, MXC_EHCI_POWER_PINS_ENABLED | |
241 | MXC_EHCI_INTERFACE_DIFF_UNI); | ||
238 | 242 | ||
239 | h2_free_reset: | 243 | h2_free_reset: |
240 | gpio_free(USBH2_RESET); | 244 | gpio_free(USBH2_RESET); |
@@ -246,13 +250,11 @@ h2_free_cs: | |||
246 | static struct mxc_usbh_platform_data usbotg_pdata __initdata = { | 250 | static struct mxc_usbh_platform_data usbotg_pdata __initdata = { |
247 | .init = usbotg_init, | 251 | .init = usbotg_init, |
248 | .portsc = MXC_EHCI_MODE_ULPI | MXC_EHCI_UTMI_8BIT, | 252 | .portsc = MXC_EHCI_MODE_ULPI | MXC_EHCI_UTMI_8BIT, |
249 | .flags = MXC_EHCI_POWER_PINS_ENABLED | MXC_EHCI_INTERFACE_DIFF_UNI, | ||
250 | }; | 253 | }; |
251 | 254 | ||
252 | static struct mxc_usbh_platform_data usbh2_pdata __initdata = { | 255 | static struct mxc_usbh_platform_data usbh2_pdata __initdata = { |
253 | .init = usbh2_init, | 256 | .init = usbh2_init, |
254 | .portsc = MXC_EHCI_MODE_ULPI | MXC_EHCI_UTMI_8BIT, | 257 | .portsc = MXC_EHCI_MODE_ULPI | MXC_EHCI_UTMI_8BIT, |
255 | .flags = MXC_EHCI_POWER_PINS_ENABLED | MXC_EHCI_INTERFACE_DIFF_UNI, | ||
256 | }; | 258 | }; |
257 | #endif /* CONFIG_USB_ULPI */ | 259 | #endif /* CONFIG_USB_ULPI */ |
258 | 260 | ||
diff --git a/arch/arm/mach-mx3/mach-cpuimx35.c b/arch/arm/mach-mx3/mach-cpuimx35.c index 3eedf0fcaedd..0f2305626e17 100644 --- a/arch/arm/mach-mx3/mach-cpuimx35.c +++ b/arch/arm/mach-mx3/mach-cpuimx35.c | |||
@@ -111,15 +111,25 @@ static const struct mxc_nand_platform_data | |||
111 | .flash_bbt = 1, | 111 | .flash_bbt = 1, |
112 | }; | 112 | }; |
113 | 113 | ||
114 | static int eukrea_cpuimx35_otg_init(struct platform_device *pdev) | ||
115 | { | ||
116 | return mx35_initialize_usb_hw(pdev->id, MXC_EHCI_INTERFACE_DIFF_UNI); | ||
117 | } | ||
118 | |||
114 | static const struct mxc_usbh_platform_data otg_pdata __initconst = { | 119 | static const struct mxc_usbh_platform_data otg_pdata __initconst = { |
120 | .init = eukrea_cpuimx35_otg_init, | ||
115 | .portsc = MXC_EHCI_MODE_UTMI, | 121 | .portsc = MXC_EHCI_MODE_UTMI, |
116 | .flags = MXC_EHCI_INTERFACE_DIFF_UNI, | ||
117 | }; | 122 | }; |
118 | 123 | ||
124 | static int eukrea_cpuimx35_usbh1_init(struct platform_device *pdev) | ||
125 | { | ||
126 | return mx35_initialize_usb_hw(pdev->id, MXC_EHCI_INTERFACE_SINGLE_UNI | | ||
127 | MXC_EHCI_INTERNAL_PHY | MXC_EHCI_IPPUE_DOWN); | ||
128 | } | ||
129 | |||
119 | static const struct mxc_usbh_platform_data usbh1_pdata __initconst = { | 130 | static const struct mxc_usbh_platform_data usbh1_pdata __initconst = { |
131 | .init = eukrea_cpuimx35_usbh1_init, | ||
120 | .portsc = MXC_EHCI_MODE_SERIAL, | 132 | .portsc = MXC_EHCI_MODE_SERIAL, |
121 | .flags = MXC_EHCI_INTERFACE_SINGLE_UNI | MXC_EHCI_INTERNAL_PHY | | ||
122 | MXC_EHCI_IPPUE_DOWN, | ||
123 | }; | 133 | }; |
124 | 134 | ||
125 | static const struct fsl_usb2_platform_data otg_device_pdata __initconst = { | 135 | static const struct fsl_usb2_platform_data otg_device_pdata __initconst = { |
diff --git a/arch/arm/mach-mx3/mach-mx31_3ds.c b/arch/arm/mach-mx3/mach-mx31_3ds.c index 3d0ded92a8a2..2d744b27f63c 100644 --- a/arch/arm/mach-mx3/mach-mx31_3ds.c +++ b/arch/arm/mach-mx3/mach-mx31_3ds.c | |||
@@ -245,7 +245,13 @@ usbotg_free_reset: | |||
245 | return err; | 245 | return err; |
246 | } | 246 | } |
247 | 247 | ||
248 | static int __maybe_unused mx31_3ds_host2_init(struct platform_device *pdev) | 248 | #if defined(CONFIG_USB_ULPI) |
249 | static int mx31_3ds_otg_init(struct platform_device *pdev) | ||
250 | { | ||
251 | return mx31_initialize_usb_hw(pdev->id, MXC_EHCI_POWER_PINS_ENABLED); | ||
252 | } | ||
253 | |||
254 | static int mx31_3ds_host2_init(struct platform_device *pdev) | ||
249 | { | 255 | { |
250 | int err; | 256 | int err; |
251 | 257 | ||
@@ -276,23 +282,24 @@ static int __maybe_unused mx31_3ds_host2_init(struct platform_device *pdev) | |||
276 | 282 | ||
277 | mdelay(1); | 283 | mdelay(1); |
278 | gpio_set_value(USBH2_RST_B, 1); | 284 | gpio_set_value(USBH2_RST_B, 1); |
279 | return 0; | 285 | |
286 | mdelay(10); | ||
287 | |||
288 | return mx31_initialize_usb_hw(pdev->id, MXC_EHCI_POWER_PINS_ENABLED); | ||
280 | 289 | ||
281 | usbotg_free_reset: | 290 | usbotg_free_reset: |
282 | gpio_free(USBH2_RST_B); | 291 | gpio_free(USBH2_RST_B); |
283 | return err; | 292 | return err; |
284 | } | 293 | } |
285 | 294 | ||
286 | #if defined(CONFIG_USB_ULPI) | ||
287 | static struct mxc_usbh_platform_data otg_pdata __initdata = { | 295 | static struct mxc_usbh_platform_data otg_pdata __initdata = { |
296 | .init = mx31_3ds_otg_init, | ||
288 | .portsc = MXC_EHCI_MODE_ULPI, | 297 | .portsc = MXC_EHCI_MODE_ULPI, |
289 | .flags = MXC_EHCI_POWER_PINS_ENABLED, | ||
290 | }; | 298 | }; |
291 | 299 | ||
292 | static struct mxc_usbh_platform_data usbh2_pdata __initdata = { | 300 | static struct mxc_usbh_platform_data usbh2_pdata __initdata = { |
293 | .init = mx31_3ds_host2_init, | 301 | .init = mx31_3ds_host2_init, |
294 | .portsc = MXC_EHCI_MODE_ULPI, | 302 | .portsc = MXC_EHCI_MODE_ULPI, |
295 | .flags = MXC_EHCI_POWER_PINS_ENABLED, | ||
296 | }; | 303 | }; |
297 | #endif | 304 | #endif |
298 | 305 | ||
diff --git a/arch/arm/mach-mx3/mach-mx31lilly.c b/arch/arm/mach-mx3/mach-mx31lilly.c index 1c3f4913d1ea..be79a0d6301e 100644 --- a/arch/arm/mach-mx3/mach-mx31lilly.c +++ b/arch/arm/mach-mx3/mach-mx31lilly.c | |||
@@ -24,6 +24,7 @@ | |||
24 | #include <linux/init.h> | 24 | #include <linux/init.h> |
25 | #include <linux/clk.h> | 25 | #include <linux/clk.h> |
26 | #include <linux/gpio.h> | 26 | #include <linux/gpio.h> |
27 | #include <linux/delay.h> | ||
27 | #include <linux/platform_device.h> | 28 | #include <linux/platform_device.h> |
28 | #include <linux/interrupt.h> | 29 | #include <linux/interrupt.h> |
29 | #include <linux/smsc911x.h> | 30 | #include <linux/smsc911x.h> |
@@ -156,7 +157,9 @@ static int usbotg_init(struct platform_device *pdev) | |||
156 | gpio_request(IOMUX_TO_GPIO(MX31_PIN_DTR_DCE2), "USBH1 CS"); | 157 | gpio_request(IOMUX_TO_GPIO(MX31_PIN_DTR_DCE2), "USBH1 CS"); |
157 | gpio_direction_output(IOMUX_TO_GPIO(MX31_PIN_DTR_DCE2), 0); | 158 | gpio_direction_output(IOMUX_TO_GPIO(MX31_PIN_DTR_DCE2), 0); |
158 | 159 | ||
159 | return 0; | 160 | mdelay(10); |
161 | |||
162 | return mx31_initialize_usb_hw(pdev->id, MXC_EHCI_POWER_PINS_ENABLED); | ||
160 | } | 163 | } |
161 | 164 | ||
162 | static int usbh1_init(struct platform_device *pdev) | 165 | static int usbh1_init(struct platform_device *pdev) |
@@ -183,7 +186,10 @@ static int usbh1_init(struct platform_device *pdev) | |||
183 | 186 | ||
184 | mxc_iomux_set_gpr(MUX_PGP_USB_SUSPEND, true); | 187 | mxc_iomux_set_gpr(MUX_PGP_USB_SUSPEND, true); |
185 | 188 | ||
186 | return 0; | 189 | mdelay(10); |
190 | |||
191 | return mx31_initialize_usb_hw(pdev->id, MXC_EHCI_POWER_PINS_ENABLED | | ||
192 | MXC_EHCI_INTERFACE_SINGLE_UNI); | ||
187 | } | 193 | } |
188 | 194 | ||
189 | static int usbh2_init(struct platform_device *pdev) | 195 | static int usbh2_init(struct platform_device *pdev) |
@@ -220,25 +226,24 @@ static int usbh2_init(struct platform_device *pdev) | |||
220 | gpio_request(IOMUX_TO_GPIO(MX31_PIN_DTR_DCE1), "USBH2 CS"); | 226 | gpio_request(IOMUX_TO_GPIO(MX31_PIN_DTR_DCE1), "USBH2 CS"); |
221 | gpio_direction_output(IOMUX_TO_GPIO(MX31_PIN_DTR_DCE1), 0); | 227 | gpio_direction_output(IOMUX_TO_GPIO(MX31_PIN_DTR_DCE1), 0); |
222 | 228 | ||
223 | return 0; | 229 | mdelay(10); |
230 | |||
231 | return mx31_initialize_usb_hw(pdev->id, MXC_EHCI_POWER_PINS_ENABLED); | ||
224 | } | 232 | } |
225 | 233 | ||
226 | static struct mxc_usbh_platform_data usbotg_pdata = { | 234 | static struct mxc_usbh_platform_data usbotg_pdata = { |
227 | .init = usbotg_init, | 235 | .init = usbotg_init, |
228 | .portsc = MXC_EHCI_MODE_ULPI | MXC_EHCI_UTMI_8BIT, | 236 | .portsc = MXC_EHCI_MODE_ULPI | MXC_EHCI_UTMI_8BIT, |
229 | .flags = MXC_EHCI_POWER_PINS_ENABLED, | ||
230 | }; | 237 | }; |
231 | 238 | ||
232 | static const struct mxc_usbh_platform_data usbh1_pdata __initconst = { | 239 | static const struct mxc_usbh_platform_data usbh1_pdata __initconst = { |
233 | .init = usbh1_init, | 240 | .init = usbh1_init, |
234 | .portsc = MXC_EHCI_MODE_UTMI | MXC_EHCI_SERIAL, | 241 | .portsc = MXC_EHCI_MODE_UTMI | MXC_EHCI_SERIAL, |
235 | .flags = MXC_EHCI_POWER_PINS_ENABLED | MXC_EHCI_INTERFACE_SINGLE_UNI, | ||
236 | }; | 242 | }; |
237 | 243 | ||
238 | static struct mxc_usbh_platform_data usbh2_pdata __initdata = { | 244 | static struct mxc_usbh_platform_data usbh2_pdata __initdata = { |
239 | .init = usbh2_init, | 245 | .init = usbh2_init, |
240 | .portsc = MXC_EHCI_MODE_ULPI | MXC_EHCI_UTMI_8BIT, | 246 | .portsc = MXC_EHCI_MODE_ULPI | MXC_EHCI_UTMI_8BIT, |
241 | .flags = MXC_EHCI_POWER_PINS_ENABLED, | ||
242 | }; | 247 | }; |
243 | 248 | ||
244 | static void lilly1131_usb_init(void) | 249 | static void lilly1131_usb_init(void) |
diff --git a/arch/arm/mach-mx3/mach-mx31lite.c b/arch/arm/mach-mx3/mach-mx31lite.c index 01e24b5045e4..e146f1a72daa 100644 --- a/arch/arm/mach-mx3/mach-mx31lite.c +++ b/arch/arm/mach-mx3/mach-mx31lite.c | |||
@@ -27,6 +27,7 @@ | |||
27 | #include <linux/usb/otg.h> | 27 | #include <linux/usb/otg.h> |
28 | #include <linux/usb/ulpi.h> | 28 | #include <linux/usb/ulpi.h> |
29 | #include <linux/mtd/physmap.h> | 29 | #include <linux/mtd/physmap.h> |
30 | #include <linux/delay.h> | ||
30 | 31 | ||
31 | #include <asm/mach-types.h> | 32 | #include <asm/mach-types.h> |
32 | #include <asm/mach/arch.h> | 33 | #include <asm/mach/arch.h> |
@@ -167,13 +168,14 @@ static int usbh2_init(struct platform_device *pdev) | |||
167 | gpio_request(IOMUX_TO_GPIO(MX31_PIN_DTR_DCE1), "USBH2 CS"); | 168 | gpio_request(IOMUX_TO_GPIO(MX31_PIN_DTR_DCE1), "USBH2 CS"); |
168 | gpio_direction_output(IOMUX_TO_GPIO(MX31_PIN_DTR_DCE1), 0); | 169 | gpio_direction_output(IOMUX_TO_GPIO(MX31_PIN_DTR_DCE1), 0); |
169 | 170 | ||
170 | return 0; | 171 | mdelay(10); |
172 | |||
173 | return mx31_initialize_usb_hw(pdev->id, MXC_EHCI_POWER_PINS_ENABLED); | ||
171 | } | 174 | } |
172 | 175 | ||
173 | static struct mxc_usbh_platform_data usbh2_pdata __initdata = { | 176 | static struct mxc_usbh_platform_data usbh2_pdata __initdata = { |
174 | .init = usbh2_init, | 177 | .init = usbh2_init, |
175 | .portsc = MXC_EHCI_MODE_ULPI | MXC_EHCI_UTMI_8BIT, | 178 | .portsc = MXC_EHCI_MODE_ULPI | MXC_EHCI_UTMI_8BIT, |
176 | .flags = MXC_EHCI_POWER_PINS_ENABLED, | ||
177 | }; | 179 | }; |
178 | #endif | 180 | #endif |
179 | 181 | ||
diff --git a/arch/arm/mach-mx3/mach-mx31moboard.c b/arch/arm/mach-mx3/mach-mx31moboard.c index fd988a0d9a5e..ea880330e839 100644 --- a/arch/arm/mach-mx3/mach-mx31moboard.c +++ b/arch/arm/mach-mx3/mach-mx31moboard.c | |||
@@ -401,10 +401,14 @@ static void usb_xcvr_reset(void) | |||
401 | } | 401 | } |
402 | 402 | ||
403 | #if defined(CONFIG_USB_ULPI) | 403 | #if defined(CONFIG_USB_ULPI) |
404 | static int moboard_usbh2_init_hw(struct platform_device *pdev) | ||
405 | { | ||
406 | return mx31_initialize_usb_hw(pdev->id, MXC_EHCI_POWER_PINS_ENABLED); | ||
407 | } | ||
404 | 408 | ||
405 | static struct mxc_usbh_platform_data usbh2_pdata __initdata = { | 409 | static struct mxc_usbh_platform_data usbh2_pdata __initdata = { |
410 | .init = moboard_usbh2_init_hw, | ||
406 | .portsc = MXC_EHCI_MODE_ULPI | MXC_EHCI_UTMI_8BIT, | 411 | .portsc = MXC_EHCI_MODE_ULPI | MXC_EHCI_UTMI_8BIT, |
407 | .flags = MXC_EHCI_POWER_PINS_ENABLED, | ||
408 | }; | 412 | }; |
409 | 413 | ||
410 | static int __init moboard_usbh2_init(void) | 414 | static int __init moboard_usbh2_init(void) |
diff --git a/arch/arm/mach-mx3/mach-mx35_3ds.c b/arch/arm/mach-mx3/mach-mx35_3ds.c index c5115dc5c0c5..dac1896a5b21 100644 --- a/arch/arm/mach-mx3/mach-mx35_3ds.c +++ b/arch/arm/mach-mx3/mach-mx35_3ds.c | |||
@@ -120,6 +120,11 @@ static iomux_v3_cfg_t mx35pdk_pads[] = { | |||
120 | MX35_PAD_SD1_DATA3__ESDHC1_DAT3, | 120 | MX35_PAD_SD1_DATA3__ESDHC1_DAT3, |
121 | }; | 121 | }; |
122 | 122 | ||
123 | static int mx35_3ds_otg_init(struct platform_device *pdev) | ||
124 | { | ||
125 | return mx35_initialize_usb_hw(pdev->id, MXC_EHCI_INTERNAL_PHY); | ||
126 | } | ||
127 | |||
123 | /* OTG config */ | 128 | /* OTG config */ |
124 | static const struct fsl_usb2_platform_data usb_otg_pdata __initconst = { | 129 | static const struct fsl_usb2_platform_data usb_otg_pdata __initconst = { |
125 | .operating_mode = FSL_USB2_DR_DEVICE, | 130 | .operating_mode = FSL_USB2_DR_DEVICE, |
@@ -127,15 +132,20 @@ static const struct fsl_usb2_platform_data usb_otg_pdata __initconst = { | |||
127 | }; | 132 | }; |
128 | 133 | ||
129 | static struct mxc_usbh_platform_data otg_pdata __initdata = { | 134 | static struct mxc_usbh_platform_data otg_pdata __initdata = { |
135 | .init = mx35_3ds_otg_init, | ||
130 | .portsc = MXC_EHCI_MODE_UTMI, | 136 | .portsc = MXC_EHCI_MODE_UTMI, |
131 | .flags = MXC_EHCI_INTERNAL_PHY, | ||
132 | }; | 137 | }; |
133 | 138 | ||
139 | static int mx35_3ds_usbh_init(struct platform_device *pdev) | ||
140 | { | ||
141 | return mx35_initialize_usb_hw(pdev->id, MXC_EHCI_INTERFACE_SINGLE_UNI | | ||
142 | MXC_EHCI_INTERNAL_PHY); | ||
143 | } | ||
144 | |||
134 | /* USB HOST config */ | 145 | /* USB HOST config */ |
135 | static const struct mxc_usbh_platform_data usb_host_pdata __initconst = { | 146 | static const struct mxc_usbh_platform_data usb_host_pdata __initconst = { |
147 | .init = mx35_3ds_usbh_init, | ||
136 | .portsc = MXC_EHCI_MODE_SERIAL, | 148 | .portsc = MXC_EHCI_MODE_SERIAL, |
137 | .flags = MXC_EHCI_INTERFACE_SINGLE_UNI | | ||
138 | MXC_EHCI_INTERNAL_PHY, | ||
139 | }; | 149 | }; |
140 | 150 | ||
141 | static int otg_mode_host; | 151 | static int otg_mode_host; |
diff --git a/arch/arm/mach-mx3/mach-pcm037.c b/arch/arm/mach-mx3/mach-pcm037.c index 7d444f714f30..55f95d42f71c 100644 --- a/arch/arm/mach-mx3/mach-pcm037.c +++ b/arch/arm/mach-mx3/mach-pcm037.c | |||
@@ -534,14 +534,24 @@ static struct platform_device pcm970_sja1000 = { | |||
534 | }; | 534 | }; |
535 | 535 | ||
536 | #if defined(CONFIG_USB_ULPI) | 536 | #if defined(CONFIG_USB_ULPI) |
537 | static int pcm037_otg_init(struct platform_device *pdev) | ||
538 | { | ||
539 | return mx31_initialize_usb_hw(pdev->id, MXC_EHCI_INTERFACE_DIFF_UNI); | ||
540 | } | ||
541 | |||
537 | static struct mxc_usbh_platform_data otg_pdata __initdata = { | 542 | static struct mxc_usbh_platform_data otg_pdata __initdata = { |
543 | .init = pcm037_otg_init, | ||
538 | .portsc = MXC_EHCI_MODE_ULPI, | 544 | .portsc = MXC_EHCI_MODE_ULPI, |
539 | .flags = MXC_EHCI_INTERFACE_DIFF_UNI, | ||
540 | }; | 545 | }; |
541 | 546 | ||
547 | static int pcm037_usbh2_init(struct platform_device *pdev) | ||
548 | { | ||
549 | return mx31_initialize_usb_hw(pdev->id, MXC_EHCI_INTERFACE_DIFF_UNI); | ||
550 | } | ||
551 | |||
542 | static struct mxc_usbh_platform_data usbh2_pdata __initdata = { | 552 | static struct mxc_usbh_platform_data usbh2_pdata __initdata = { |
553 | .init = pcm037_usbh2_init, | ||
543 | .portsc = MXC_EHCI_MODE_ULPI, | 554 | .portsc = MXC_EHCI_MODE_ULPI, |
544 | .flags = MXC_EHCI_INTERFACE_DIFF_UNI, | ||
545 | }; | 555 | }; |
546 | #endif | 556 | #endif |
547 | 557 | ||
diff --git a/arch/arm/mach-mx3/mach-pcm043.c b/arch/arm/mach-mx3/mach-pcm043.c index b03e19d65487..4fa07142a9bb 100644 --- a/arch/arm/mach-mx3/mach-pcm043.c +++ b/arch/arm/mach-mx3/mach-pcm043.c | |||
@@ -306,16 +306,26 @@ pcm037_nand_board_info __initconst = { | |||
306 | }; | 306 | }; |
307 | 307 | ||
308 | #if defined(CONFIG_USB_ULPI) | 308 | #if defined(CONFIG_USB_ULPI) |
309 | static int pcm043_otg_init(struct platform_device *pdev) | ||
310 | { | ||
311 | return mx35_initialize_usb_hw(pdev->id, MXC_EHCI_INTERFACE_DIFF_UNI); | ||
312 | } | ||
313 | |||
309 | static struct mxc_usbh_platform_data otg_pdata __initdata = { | 314 | static struct mxc_usbh_platform_data otg_pdata __initdata = { |
315 | .init = pcm043_otg_init, | ||
310 | .portsc = MXC_EHCI_MODE_UTMI, | 316 | .portsc = MXC_EHCI_MODE_UTMI, |
311 | .flags = MXC_EHCI_INTERFACE_DIFF_UNI, | ||
312 | }; | 317 | }; |
313 | #endif | 318 | #endif |
314 | 319 | ||
320 | static int pcm043_usbh1_init(struct platform_device *pdev) | ||
321 | { | ||
322 | return mx35_initialize_usb_hw(pdev->id, MXC_EHCI_INTERFACE_SINGLE_UNI | | ||
323 | MXC_EHCI_INTERNAL_PHY | MXC_EHCI_IPPUE_DOWN); | ||
324 | } | ||
325 | |||
315 | static const struct mxc_usbh_platform_data usbh1_pdata __initconst = { | 326 | static const struct mxc_usbh_platform_data usbh1_pdata __initconst = { |
327 | .init = pcm043_usbh1_init, | ||
316 | .portsc = MXC_EHCI_MODE_SERIAL, | 328 | .portsc = MXC_EHCI_MODE_SERIAL, |
317 | .flags = MXC_EHCI_INTERFACE_SINGLE_UNI | MXC_EHCI_INTERNAL_PHY | | ||
318 | MXC_EHCI_IPPUE_DOWN, | ||
319 | }; | 329 | }; |
320 | 330 | ||
321 | static const struct fsl_usb2_platform_data otg_device_pdata __initconst = { | 331 | static const struct fsl_usb2_platform_data otg_device_pdata __initconst = { |
diff --git a/arch/arm/mach-mx3/mx31moboard-devboard.c b/arch/arm/mach-mx3/mx31moboard-devboard.c index 94a0b9e4b7f3..6410b9c48a02 100644 --- a/arch/arm/mach-mx3/mx31moboard-devboard.c +++ b/arch/arm/mach-mx3/mx31moboard-devboard.c | |||
@@ -15,6 +15,7 @@ | |||
15 | #include <linux/gpio.h> | 15 | #include <linux/gpio.h> |
16 | #include <linux/init.h> | 16 | #include <linux/init.h> |
17 | #include <linux/interrupt.h> | 17 | #include <linux/interrupt.h> |
18 | #include <linux/delay.h> | ||
18 | #include <linux/platform_device.h> | 19 | #include <linux/platform_device.h> |
19 | #include <linux/slab.h> | 20 | #include <linux/slab.h> |
20 | #include <linux/types.h> | 21 | #include <linux/types.h> |
@@ -149,7 +150,10 @@ static int devboard_usbh1_hw_init(struct platform_device *pdev) | |||
149 | mxc_iomux_set_pad(MX31_PIN_CSPI1_SPI_RDY, USB_PAD_CFG); | 150 | mxc_iomux_set_pad(MX31_PIN_CSPI1_SPI_RDY, USB_PAD_CFG); |
150 | mxc_iomux_set_pad(MX31_PIN_SFS6, USB_PAD_CFG); | 151 | mxc_iomux_set_pad(MX31_PIN_SFS6, USB_PAD_CFG); |
151 | 152 | ||
152 | return 0; | 153 | mdelay(10); |
154 | |||
155 | return mx31_initialize_usb_hw(pdev->id, MXC_EHCI_POWER_PINS_ENABLED | | ||
156 | MXC_EHCI_INTERFACE_SINGLE_UNI); | ||
153 | } | 157 | } |
154 | 158 | ||
155 | #define USBH1_VBUSEN_B IOMUX_TO_GPIO(MX31_PIN_NFRE_B) | 159 | #define USBH1_VBUSEN_B IOMUX_TO_GPIO(MX31_PIN_NFRE_B) |
@@ -187,7 +191,6 @@ static int devboard_isp1105_set_vbus(struct otg_transceiver *otg, bool on) | |||
187 | static struct mxc_usbh_platform_data usbh1_pdata __initdata = { | 191 | static struct mxc_usbh_platform_data usbh1_pdata __initdata = { |
188 | .init = devboard_usbh1_hw_init, | 192 | .init = devboard_usbh1_hw_init, |
189 | .portsc = MXC_EHCI_MODE_UTMI | MXC_EHCI_SERIAL, | 193 | .portsc = MXC_EHCI_MODE_UTMI | MXC_EHCI_SERIAL, |
190 | .flags = MXC_EHCI_POWER_PINS_ENABLED | MXC_EHCI_INTERFACE_SINGLE_UNI, | ||
191 | }; | 194 | }; |
192 | 195 | ||
193 | static int __init devboard_usbh1_init(void) | 196 | static int __init devboard_usbh1_init(void) |
diff --git a/arch/arm/mach-mx3/mx31moboard-marxbot.c b/arch/arm/mach-mx3/mx31moboard-marxbot.c index f449a97ae1a2..57f7b00cb709 100644 --- a/arch/arm/mach-mx3/mx31moboard-marxbot.c +++ b/arch/arm/mach-mx3/mx31moboard-marxbot.c | |||
@@ -265,7 +265,10 @@ static int marxbot_usbh1_hw_init(struct platform_device *pdev) | |||
265 | mxc_iomux_set_pad(MX31_PIN_CSPI1_SPI_RDY, USB_PAD_CFG); | 265 | mxc_iomux_set_pad(MX31_PIN_CSPI1_SPI_RDY, USB_PAD_CFG); |
266 | mxc_iomux_set_pad(MX31_PIN_SFS6, USB_PAD_CFG); | 266 | mxc_iomux_set_pad(MX31_PIN_SFS6, USB_PAD_CFG); |
267 | 267 | ||
268 | return 0; | 268 | mdelay(10); |
269 | |||
270 | return mx31_initialize_usb_hw(pdev->id, MXC_EHCI_POWER_PINS_ENABLED | | ||
271 | MXC_EHCI_INTERFACE_SINGLE_UNI); | ||
269 | } | 272 | } |
270 | 273 | ||
271 | #define USBH1_VBUSEN_B IOMUX_TO_GPIO(MX31_PIN_NFRE_B) | 274 | #define USBH1_VBUSEN_B IOMUX_TO_GPIO(MX31_PIN_NFRE_B) |
@@ -303,7 +306,6 @@ static int marxbot_isp1105_set_vbus(struct otg_transceiver *otg, bool on) | |||
303 | static struct mxc_usbh_platform_data usbh1_pdata __initdata = { | 306 | static struct mxc_usbh_platform_data usbh1_pdata __initdata = { |
304 | .init = marxbot_usbh1_hw_init, | 307 | .init = marxbot_usbh1_hw_init, |
305 | .portsc = MXC_EHCI_MODE_UTMI | MXC_EHCI_SERIAL, | 308 | .portsc = MXC_EHCI_MODE_UTMI | MXC_EHCI_SERIAL, |
306 | .flags = MXC_EHCI_POWER_PINS_ENABLED | MXC_EHCI_INTERFACE_SINGLE_UNI, | ||
307 | }; | 309 | }; |
308 | 310 | ||
309 | static int __init marxbot_usbh1_init(void) | 311 | static int __init marxbot_usbh1_init(void) |
diff --git a/arch/arm/mach-mx3/mx31moboard-smartbot.c b/arch/arm/mach-mx3/mx31moboard-smartbot.c index bbec3c82264a..87d556f40ecf 100644 --- a/arch/arm/mach-mx3/mx31moboard-smartbot.c +++ b/arch/arm/mach-mx3/mx31moboard-smartbot.c | |||
@@ -123,9 +123,14 @@ static const struct fsl_usb2_platform_data usb_pdata __initconst = { | |||
123 | 123 | ||
124 | #if defined(CONFIG_USB_ULPI) | 124 | #if defined(CONFIG_USB_ULPI) |
125 | 125 | ||
126 | static int smartbot_otg_init(struct platform_device *pdev) | ||
127 | { | ||
128 | return mx31_initialize_usb_hw(pdev->id, MXC_EHCI_POWER_PINS_ENABLED); | ||
129 | } | ||
130 | |||
126 | static struct mxc_usbh_platform_data otg_host_pdata __initdata = { | 131 | static struct mxc_usbh_platform_data otg_host_pdata __initdata = { |
132 | .init = smartbot_otg_init, | ||
127 | .portsc = MXC_EHCI_MODE_ULPI | MXC_EHCI_UTMI_8BIT, | 133 | .portsc = MXC_EHCI_MODE_ULPI | MXC_EHCI_UTMI_8BIT, |
128 | .flags = MXC_EHCI_POWER_PINS_ENABLED, | ||
129 | }; | 134 | }; |
130 | 135 | ||
131 | static int __init smartbot_otg_host_init(void) | 136 | static int __init smartbot_otg_host_init(void) |
diff --git a/arch/arm/mach-mx5/board-cpuimx51.c b/arch/arm/mach-mx5/board-cpuimx51.c index 2d4199d37905..d0296a94c475 100644 --- a/arch/arm/mach-mx5/board-cpuimx51.c +++ b/arch/arm/mach-mx5/board-cpuimx51.c | |||
@@ -184,7 +184,10 @@ static int initialize_otg_port(struct platform_device *pdev) | |||
184 | v |= MX51_USB_PLL_DIV_19_2_MHZ; | 184 | v |= MX51_USB_PLL_DIV_19_2_MHZ; |
185 | __raw_writel(v, usbother_base + MXC_USB_PHY_CTR_FUNC2_OFFSET); | 185 | __raw_writel(v, usbother_base + MXC_USB_PHY_CTR_FUNC2_OFFSET); |
186 | iounmap(usb_base); | 186 | iounmap(usb_base); |
187 | return 0; | 187 | |
188 | mdelay(10); | ||
189 | |||
190 | return mx51_initialize_usb_hw(0, MXC_EHCI_INTERNAL_PHY); | ||
188 | } | 191 | } |
189 | 192 | ||
190 | static int initialize_usbh1_port(struct platform_device *pdev) | 193 | static int initialize_usbh1_port(struct platform_device *pdev) |
@@ -202,13 +205,16 @@ static int initialize_usbh1_port(struct platform_device *pdev) | |||
202 | v = __raw_readl(usbother_base + MX51_USB_CTRL_1_OFFSET); | 205 | v = __raw_readl(usbother_base + MX51_USB_CTRL_1_OFFSET); |
203 | __raw_writel(v | MX51_USB_CTRL_UH1_EXT_CLK_EN, usbother_base + MX51_USB_CTRL_1_OFFSET); | 206 | __raw_writel(v | MX51_USB_CTRL_UH1_EXT_CLK_EN, usbother_base + MX51_USB_CTRL_1_OFFSET); |
204 | iounmap(usb_base); | 207 | iounmap(usb_base); |
205 | return 0; | 208 | |
209 | mdelay(10); | ||
210 | |||
211 | return mx51_initialize_usb_hw(1, MXC_EHCI_POWER_PINS_ENABLED | | ||
212 | MXC_EHCI_ITC_NO_THRESHOLD); | ||
206 | } | 213 | } |
207 | 214 | ||
208 | static struct mxc_usbh_platform_data dr_utmi_config = { | 215 | static struct mxc_usbh_platform_data dr_utmi_config = { |
209 | .init = initialize_otg_port, | 216 | .init = initialize_otg_port, |
210 | .portsc = MXC_EHCI_UTMI_16BIT, | 217 | .portsc = MXC_EHCI_UTMI_16BIT, |
211 | .flags = MXC_EHCI_INTERNAL_PHY, | ||
212 | }; | 218 | }; |
213 | 219 | ||
214 | static struct fsl_usb2_platform_data usb_pdata = { | 220 | static struct fsl_usb2_platform_data usb_pdata = { |
@@ -219,7 +225,6 @@ static struct fsl_usb2_platform_data usb_pdata = { | |||
219 | static struct mxc_usbh_platform_data usbh1_config = { | 225 | static struct mxc_usbh_platform_data usbh1_config = { |
220 | .init = initialize_usbh1_port, | 226 | .init = initialize_usbh1_port, |
221 | .portsc = MXC_EHCI_MODE_ULPI, | 227 | .portsc = MXC_EHCI_MODE_ULPI, |
222 | .flags = (MXC_EHCI_POWER_PINS_ENABLED | MXC_EHCI_ITC_NO_THRESHOLD), | ||
223 | }; | 228 | }; |
224 | 229 | ||
225 | static int otg_mode_host; | 230 | static int otg_mode_host; |
diff --git a/arch/arm/mach-mx5/board-cpuimx51sd.c b/arch/arm/mach-mx5/board-cpuimx51sd.c index 6c3b445e3951..f38b341ac405 100644 --- a/arch/arm/mach-mx5/board-cpuimx51sd.c +++ b/arch/arm/mach-mx5/board-cpuimx51sd.c | |||
@@ -167,7 +167,10 @@ static int initialize_otg_port(struct platform_device *pdev) | |||
167 | v |= MX51_USB_PLL_DIV_19_2_MHZ; | 167 | v |= MX51_USB_PLL_DIV_19_2_MHZ; |
168 | __raw_writel(v, usbother_base + MXC_USB_PHY_CTR_FUNC2_OFFSET); | 168 | __raw_writel(v, usbother_base + MXC_USB_PHY_CTR_FUNC2_OFFSET); |
169 | iounmap(usb_base); | 169 | iounmap(usb_base); |
170 | return 0; | 170 | |
171 | mdelay(10); | ||
172 | |||
173 | return mx51_initialize_usb_hw(0, MXC_EHCI_INTERNAL_PHY); | ||
171 | } | 174 | } |
172 | 175 | ||
173 | static int initialize_usbh1_port(struct platform_device *pdev) | 176 | static int initialize_usbh1_port(struct platform_device *pdev) |
@@ -186,13 +189,16 @@ static int initialize_usbh1_port(struct platform_device *pdev) | |||
186 | __raw_writel(v | MX51_USB_CTRL_UH1_EXT_CLK_EN, | 189 | __raw_writel(v | MX51_USB_CTRL_UH1_EXT_CLK_EN, |
187 | usbother_base + MX51_USB_CTRL_1_OFFSET); | 190 | usbother_base + MX51_USB_CTRL_1_OFFSET); |
188 | iounmap(usb_base); | 191 | iounmap(usb_base); |
189 | return 0; | 192 | |
193 | mdelay(10); | ||
194 | |||
195 | return mx51_initialize_usb_hw(1, MXC_EHCI_POWER_PINS_ENABLED | | ||
196 | MXC_EHCI_ITC_NO_THRESHOLD); | ||
190 | } | 197 | } |
191 | 198 | ||
192 | static struct mxc_usbh_platform_data dr_utmi_config = { | 199 | static struct mxc_usbh_platform_data dr_utmi_config = { |
193 | .init = initialize_otg_port, | 200 | .init = initialize_otg_port, |
194 | .portsc = MXC_EHCI_UTMI_16BIT, | 201 | .portsc = MXC_EHCI_UTMI_16BIT, |
195 | .flags = MXC_EHCI_INTERNAL_PHY, | ||
196 | }; | 202 | }; |
197 | 203 | ||
198 | static struct fsl_usb2_platform_data usb_pdata = { | 204 | static struct fsl_usb2_platform_data usb_pdata = { |
@@ -203,7 +209,6 @@ static struct fsl_usb2_platform_data usb_pdata = { | |||
203 | static struct mxc_usbh_platform_data usbh1_config = { | 209 | static struct mxc_usbh_platform_data usbh1_config = { |
204 | .init = initialize_usbh1_port, | 210 | .init = initialize_usbh1_port, |
205 | .portsc = MXC_EHCI_MODE_ULPI, | 211 | .portsc = MXC_EHCI_MODE_ULPI, |
206 | .flags = (MXC_EHCI_POWER_PINS_ENABLED | MXC_EHCI_ITC_NO_THRESHOLD), | ||
207 | }; | 212 | }; |
208 | 213 | ||
209 | static int otg_mode_host; | 214 | static int otg_mode_host; |
diff --git a/arch/arm/mach-mx5/board-mx51_babbage.c b/arch/arm/mach-mx5/board-mx51_babbage.c index 2bd9c9e4e6ba..7874bcd41db5 100644 --- a/arch/arm/mach-mx5/board-mx51_babbage.c +++ b/arch/arm/mach-mx5/board-mx51_babbage.c | |||
@@ -259,7 +259,10 @@ static int initialize_otg_port(struct platform_device *pdev) | |||
259 | v |= MX51_USB_PLL_DIV_19_2_MHZ; | 259 | v |= MX51_USB_PLL_DIV_19_2_MHZ; |
260 | __raw_writel(v, usbother_base + MXC_USB_PHY_CTR_FUNC2_OFFSET); | 260 | __raw_writel(v, usbother_base + MXC_USB_PHY_CTR_FUNC2_OFFSET); |
261 | iounmap(usb_base); | 261 | iounmap(usb_base); |
262 | return 0; | 262 | |
263 | mdelay(10); | ||
264 | |||
265 | return mx51_initialize_usb_hw(0, MXC_EHCI_INTERNAL_PHY); | ||
263 | } | 266 | } |
264 | 267 | ||
265 | static int initialize_usbh1_port(struct platform_device *pdev) | 268 | static int initialize_usbh1_port(struct platform_device *pdev) |
@@ -277,13 +280,16 @@ static int initialize_usbh1_port(struct platform_device *pdev) | |||
277 | v = __raw_readl(usbother_base + MX51_USB_CTRL_1_OFFSET); | 280 | v = __raw_readl(usbother_base + MX51_USB_CTRL_1_OFFSET); |
278 | __raw_writel(v | MX51_USB_CTRL_UH1_EXT_CLK_EN, usbother_base + MX51_USB_CTRL_1_OFFSET); | 281 | __raw_writel(v | MX51_USB_CTRL_UH1_EXT_CLK_EN, usbother_base + MX51_USB_CTRL_1_OFFSET); |
279 | iounmap(usb_base); | 282 | iounmap(usb_base); |
280 | return 0; | 283 | |
284 | mdelay(10); | ||
285 | |||
286 | return mx51_initialize_usb_hw(1, MXC_EHCI_POWER_PINS_ENABLED | | ||
287 | MXC_EHCI_ITC_NO_THRESHOLD); | ||
281 | } | 288 | } |
282 | 289 | ||
283 | static struct mxc_usbh_platform_data dr_utmi_config = { | 290 | static struct mxc_usbh_platform_data dr_utmi_config = { |
284 | .init = initialize_otg_port, | 291 | .init = initialize_otg_port, |
285 | .portsc = MXC_EHCI_UTMI_16BIT, | 292 | .portsc = MXC_EHCI_UTMI_16BIT, |
286 | .flags = MXC_EHCI_INTERNAL_PHY, | ||
287 | }; | 293 | }; |
288 | 294 | ||
289 | static struct fsl_usb2_platform_data usb_pdata = { | 295 | static struct fsl_usb2_platform_data usb_pdata = { |
@@ -294,7 +300,6 @@ static struct fsl_usb2_platform_data usb_pdata = { | |||
294 | static struct mxc_usbh_platform_data usbh1_config = { | 300 | static struct mxc_usbh_platform_data usbh1_config = { |
295 | .init = initialize_usbh1_port, | 301 | .init = initialize_usbh1_port, |
296 | .portsc = MXC_EHCI_MODE_ULPI, | 302 | .portsc = MXC_EHCI_MODE_ULPI, |
297 | .flags = (MXC_EHCI_POWER_PINS_ENABLED | MXC_EHCI_ITC_NO_THRESHOLD), | ||
298 | }; | 303 | }; |
299 | 304 | ||
300 | static int otg_mode_host; | 305 | static int otg_mode_host; |
diff --git a/arch/arm/mach-mx5/board-mx51_efikamx.c b/arch/arm/mach-mx5/board-mx51_efikamx.c index 2aac4c5b7b51..b0fa55327c37 100644 --- a/arch/arm/mach-mx5/board-mx51_efikamx.c +++ b/arch/arm/mach-mx5/board-mx51_efikamx.c | |||
@@ -145,13 +145,15 @@ static int initialize_otg_port(struct platform_device *pdev) | |||
145 | v |= MX51_USB_PLL_DIV_24_MHZ; | 145 | v |= MX51_USB_PLL_DIV_24_MHZ; |
146 | __raw_writel(v, usbother_base + MXC_USB_PHY_CTR_FUNC2_OFFSET); | 146 | __raw_writel(v, usbother_base + MXC_USB_PHY_CTR_FUNC2_OFFSET); |
147 | iounmap(usb_base); | 147 | iounmap(usb_base); |
148 | return 0; | 148 | |
149 | mdelay(10); | ||
150 | |||
151 | return mx51_initialize_usb_hw(0, MXC_EHCI_INTERNAL_PHY); | ||
149 | } | 152 | } |
150 | 153 | ||
151 | static struct mxc_usbh_platform_data dr_utmi_config = { | 154 | static struct mxc_usbh_platform_data dr_utmi_config = { |
152 | .init = initialize_otg_port, | 155 | .init = initialize_otg_port, |
153 | .portsc = MXC_EHCI_UTMI_16BIT, | 156 | .portsc = MXC_EHCI_UTMI_16BIT, |
154 | .flags = MXC_EHCI_INTERNAL_PHY, | ||
155 | }; | 157 | }; |
156 | 158 | ||
157 | /* PCBID2 PCBID1 PCBID0 STATE | 159 | /* PCBID2 PCBID1 PCBID0 STATE |
diff --git a/arch/arm/plat-mxc/Makefile b/arch/arm/plat-mxc/Makefile index 5fd20e96876c..a1387875a491 100644 --- a/arch/arm/plat-mxc/Makefile +++ b/arch/arm/plat-mxc/Makefile | |||
@@ -13,7 +13,6 @@ obj-$(CONFIG_IMX_HAVE_IOMUX_V1) += iomux-v1.o | |||
13 | obj-$(CONFIG_ARCH_MXC_IOMUX_V3) += iomux-v3.o | 13 | obj-$(CONFIG_ARCH_MXC_IOMUX_V3) += iomux-v3.o |
14 | obj-$(CONFIG_IRAM_ALLOC) += iram_alloc.o | 14 | obj-$(CONFIG_IRAM_ALLOC) += iram_alloc.o |
15 | obj-$(CONFIG_MXC_PWM) += pwm.o | 15 | obj-$(CONFIG_MXC_PWM) += pwm.o |
16 | obj-$(CONFIG_USB_EHCI_MXC) += ehci.o | ||
17 | obj-$(CONFIG_MXC_ULPI) += ulpi.o | 16 | obj-$(CONFIG_MXC_ULPI) += ulpi.o |
18 | obj-$(CONFIG_MXC_USE_EPIT) += epit.o | 17 | obj-$(CONFIG_MXC_USE_EPIT) += epit.o |
19 | obj-$(CONFIG_ARCH_MXC_AUDMUX_V1) += audmux-v1.o | 18 | obj-$(CONFIG_ARCH_MXC_AUDMUX_V1) += audmux-v1.o |
diff --git a/arch/arm/plat-mxc/ehci.c b/arch/arm/plat-mxc/ehci.c deleted file mode 100644 index 06fb3a4d7c27..000000000000 --- a/arch/arm/plat-mxc/ehci.c +++ /dev/null | |||
@@ -1,46 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2009 Daniel Mack <daniel@caiaq.de> | ||
3 | * Copyright (C) 2010 Freescale Semiconductor, Inc. | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify it | ||
6 | * under the terms of the GNU General Public License as published by the | ||
7 | * Free Software Foundation; either version 2 of the License, or (at your | ||
8 | * option) any later version. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, but | ||
11 | * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY | ||
12 | * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
13 | * for more details. | ||
14 | */ | ||
15 | |||
16 | #include <linux/platform_device.h> | ||
17 | |||
18 | #include <mach/hardware.h> | ||
19 | #include <mach/mxc_ehci.h> | ||
20 | |||
21 | int mxc_initialize_usb_hw(int port, unsigned int flags) | ||
22 | { | ||
23 | #if defined(CONFIG_SOC_IMX25) | ||
24 | if (cpu_is_mx25()) | ||
25 | return mx25_initialize_usb_hw(port, flags); | ||
26 | #endif /* if defined(CONFIG_SOC_IMX25) */ | ||
27 | #if defined(CONFIG_ARCH_MX3) | ||
28 | if (cpu_is_mx31()) | ||
29 | return mx31_initialize_usb_hw(port, flags); | ||
30 | if (cpu_is_mx35()) | ||
31 | return mx35_initialize_usb_hw(port, flags); | ||
32 | #endif /* CONFIG_ARCH_MX3 */ | ||
33 | #ifdef CONFIG_MACH_MX27 | ||
34 | if (cpu_is_mx27()) | ||
35 | return mx27_initialize_usb_hw(port, flags); | ||
36 | #endif /* CONFIG_MACH_MX27 */ | ||
37 | #ifdef CONFIG_SOC_IMX51 | ||
38 | if (cpu_is_mx51()) | ||
39 | return mx51_initialize_usb_hw(port, flags); | ||
40 | #endif | ||
41 | printk(KERN_WARNING | ||
42 | "%s() unable to setup USBCONTROL for this CPU\n", __func__); | ||
43 | return -EINVAL; | ||
44 | } | ||
45 | EXPORT_SYMBOL(mxc_initialize_usb_hw); | ||
46 | |||
diff --git a/arch/arm/plat-mxc/include/mach/mxc_ehci.h b/arch/arm/plat-mxc/include/mach/mxc_ehci.h index 7e555a1f4a4a..2c159dc2398b 100644 --- a/arch/arm/plat-mxc/include/mach/mxc_ehci.h +++ b/arch/arm/plat-mxc/include/mach/mxc_ehci.h | |||
@@ -44,12 +44,9 @@ struct mxc_usbh_platform_data { | |||
44 | int (*exit)(struct platform_device *pdev); | 44 | int (*exit)(struct platform_device *pdev); |
45 | 45 | ||
46 | unsigned int portsc; | 46 | unsigned int portsc; |
47 | unsigned int flags; | ||
48 | struct otg_transceiver *otg; | 47 | struct otg_transceiver *otg; |
49 | }; | 48 | }; |
50 | 49 | ||
51 | int mxc_initialize_usb_hw(int port, unsigned int flags); | ||
52 | |||
53 | int mx51_initialize_usb_hw(int port, unsigned int flags); | 50 | int mx51_initialize_usb_hw(int port, unsigned int flags); |
54 | int mx25_initialize_usb_hw(int port, unsigned int flags); | 51 | int mx25_initialize_usb_hw(int port, unsigned int flags); |
55 | int mx31_initialize_usb_hw(int port, unsigned int flags); | 52 | int mx31_initialize_usb_hw(int port, unsigned int flags); |
diff --git a/drivers/usb/host/ehci-mxc.c b/drivers/usb/host/ehci-mxc.c index c8e360d7d975..25c8c10bb689 100644 --- a/drivers/usb/host/ehci-mxc.c +++ b/drivers/usb/host/ehci-mxc.c | |||
@@ -203,11 +203,6 @@ static int ehci_mxc_drv_probe(struct platform_device *pdev) | |||
203 | mdelay(10); | 203 | mdelay(10); |
204 | } | 204 | } |
205 | 205 | ||
206 | /* setup specific usb hw */ | ||
207 | ret = mxc_initialize_usb_hw(pdev->id, pdata->flags); | ||
208 | if (ret < 0) | ||
209 | goto err_init; | ||
210 | |||
211 | ehci = hcd_to_ehci(hcd); | 206 | ehci = hcd_to_ehci(hcd); |
212 | 207 | ||
213 | /* EHCI registers start at offset 0x100 */ | 208 | /* EHCI registers start at offset 0x100 */ |