aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-mx5
diff options
context:
space:
mode:
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>2011-07-30 17:41:49 -0400
committerUwe Kleine-König <u.kleine-koenig@pengutronix.de>2011-08-01 05:16:55 -0400
commit7d92e8e6c4d45d33dd32a028081c89a6dedab032 (patch)
tree3c9329d9d2d30e99314294f605f74716c8f56162 /arch/arm/mach-mx5
parentb7ca83273d0f4dc160711727292a277522d5e4a1 (diff)
ARM: mx5: dynamically allocate mxc-ehci devices
Additionally make the usb related defines consistent with the other imx SoCs. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Diffstat (limited to 'arch/arm/mach-mx5')
-rw-r--r--arch/arm/mach-mx5/Kconfig6
-rw-r--r--arch/arm/mach-mx5/board-cpuimx51.c12
-rw-r--r--arch/arm/mach-mx5/board-cpuimx51sd.c12
-rw-r--r--arch/arm/mach-mx5/board-mx51_babbage.c12
-rw-r--r--arch/arm/mach-mx5/board-mx51_efikasb.c5
-rw-r--r--arch/arm/mach-mx5/devices-imx51.h7
-rw-r--r--arch/arm/mach-mx5/devices.c61
-rw-r--r--arch/arm/mach-mx5/devices.h3
-rw-r--r--arch/arm/mach-mx5/ehci.c2
-rw-r--r--arch/arm/mach-mx5/mx51_efika.c14
10 files changed, 41 insertions, 93 deletions
diff --git a/arch/arm/mach-mx5/Kconfig b/arch/arm/mach-mx5/Kconfig
index b4e7c58bbb38..2905110954c2 100644
--- a/arch/arm/mach-mx5/Kconfig
+++ b/arch/arm/mach-mx5/Kconfig
@@ -68,6 +68,7 @@ config MACH_MX51_BABBAGE
68 select IMX_HAVE_PLATFORM_IMX2_WDT 68 select IMX_HAVE_PLATFORM_IMX2_WDT
69 select IMX_HAVE_PLATFORM_IMX_I2C 69 select IMX_HAVE_PLATFORM_IMX_I2C
70 select IMX_HAVE_PLATFORM_IMX_UART 70 select IMX_HAVE_PLATFORM_IMX_UART
71 select IMX_HAVE_PLATFORM_MXC_EHCI
71 select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX 72 select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX
72 select IMX_HAVE_PLATFORM_SPI_IMX 73 select IMX_HAVE_PLATFORM_SPI_IMX
73 help 74 help
@@ -93,6 +94,7 @@ config MACH_EUKREA_CPUIMX51
93 select SOC_IMX51 94 select SOC_IMX51
94 select IMX_HAVE_PLATFORM_IMX_I2C 95 select IMX_HAVE_PLATFORM_IMX_I2C
95 select IMX_HAVE_PLATFORM_IMX_UART 96 select IMX_HAVE_PLATFORM_IMX_UART
97 select IMX_HAVE_PLATFORM_MXC_EHCI
96 select IMX_HAVE_PLATFORM_MXC_NAND 98 select IMX_HAVE_PLATFORM_MXC_NAND
97 select IMX_HAVE_PLATFORM_SPI_IMX 99 select IMX_HAVE_PLATFORM_SPI_IMX
98 help 100 help
@@ -120,9 +122,10 @@ config MACH_EUKREA_CPUIMX51SD
120 bool "Support Eukrea CPUIMX51SD module" 122 bool "Support Eukrea CPUIMX51SD module"
121 select SOC_IMX51 123 select SOC_IMX51
122 select IMX_HAVE_PLATFORM_IMX_I2C 124 select IMX_HAVE_PLATFORM_IMX_I2C
123 select IMX_HAVE_PLATFORM_SPI_IMX
124 select IMX_HAVE_PLATFORM_IMX_UART 125 select IMX_HAVE_PLATFORM_IMX_UART
126 select IMX_HAVE_PLATFORM_MXC_EHCI
125 select IMX_HAVE_PLATFORM_MXC_NAND 127 select IMX_HAVE_PLATFORM_MXC_NAND
128 select IMX_HAVE_PLATFORM_SPI_IMX
126 help 129 help
127 Include support for Eukrea CPUIMX51SD platform. This includes 130 Include support for Eukrea CPUIMX51SD platform. This includes
128 specific configurations for the module and its peripherals. 131 specific configurations for the module and its peripherals.
@@ -147,6 +150,7 @@ config MX51_EFIKA_COMMON
147 bool 150 bool
148 select SOC_IMX51 151 select SOC_IMX51
149 select IMX_HAVE_PLATFORM_IMX_UART 152 select IMX_HAVE_PLATFORM_IMX_UART
153 select IMX_HAVE_PLATFORM_MXC_EHCI
150 select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX 154 select IMX_HAVE_PLATFORM_SDHCI_ESDHC_IMX
151 select IMX_HAVE_PLATFORM_SPI_IMX 155 select IMX_HAVE_PLATFORM_SPI_IMX
152 select MXC_ULPI if USB_ULPI 156 select MXC_ULPI if USB_ULPI
diff --git a/arch/arm/mach-mx5/board-cpuimx51.c b/arch/arm/mach-mx5/board-cpuimx51.c
index 7c893fa70266..aa1ff79e5a74 100644
--- a/arch/arm/mach-mx5/board-cpuimx51.c
+++ b/arch/arm/mach-mx5/board-cpuimx51.c
@@ -167,7 +167,7 @@ static int initialize_otg_port(struct platform_device *pdev)
167 void __iomem *usb_base; 167 void __iomem *usb_base;
168 void __iomem *usbother_base; 168 void __iomem *usbother_base;
169 169
170 usb_base = ioremap(MX51_OTG_BASE_ADDR, SZ_4K); 170 usb_base = ioremap(MX51_USB_OTG_BASE_ADDR, SZ_4K);
171 if (!usb_base) 171 if (!usb_base)
172 return -ENOMEM; 172 return -ENOMEM;
173 usbother_base = usb_base + MX5_USBOTHER_REGS_OFFSET; 173 usbother_base = usb_base + MX5_USBOTHER_REGS_OFFSET;
@@ -190,7 +190,7 @@ static int initialize_usbh1_port(struct platform_device *pdev)
190 void __iomem *usb_base; 190 void __iomem *usb_base;
191 void __iomem *usbother_base; 191 void __iomem *usbother_base;
192 192
193 usb_base = ioremap(MX51_OTG_BASE_ADDR, SZ_4K); 193 usb_base = ioremap(MX51_USB_OTG_BASE_ADDR, SZ_4K);
194 if (!usb_base) 194 if (!usb_base)
195 return -ENOMEM; 195 return -ENOMEM;
196 usbother_base = usb_base + MX5_USBOTHER_REGS_OFFSET; 196 usbother_base = usb_base + MX5_USBOTHER_REGS_OFFSET;
@@ -206,7 +206,7 @@ static int initialize_usbh1_port(struct platform_device *pdev)
206 MXC_EHCI_ITC_NO_THRESHOLD); 206 MXC_EHCI_ITC_NO_THRESHOLD);
207} 207}
208 208
209static struct mxc_usbh_platform_data dr_utmi_config = { 209static const struct mxc_usbh_platform_data dr_utmi_config __initconst = {
210 .init = initialize_otg_port, 210 .init = initialize_otg_port,
211 .portsc = MXC_EHCI_UTMI_16BIT, 211 .portsc = MXC_EHCI_UTMI_16BIT,
212}; 212};
@@ -216,7 +216,7 @@ static struct fsl_usb2_platform_data usb_pdata = {
216 .phy_mode = FSL_USB2_PHY_UTMI_WIDE, 216 .phy_mode = FSL_USB2_PHY_UTMI_WIDE,
217}; 217};
218 218
219static struct mxc_usbh_platform_data usbh1_config = { 219static const struct mxc_usbh_platform_data usbh1_config __initconst = {
220 .init = initialize_usbh1_port, 220 .init = initialize_usbh1_port,
221 .portsc = MXC_EHCI_MODE_ULPI, 221 .portsc = MXC_EHCI_MODE_ULPI,
222}; 222};
@@ -270,12 +270,12 @@ static void __init eukrea_cpuimx51_init(void)
270 ARRAY_SIZE(eukrea_cpuimx51_i2c_devices)); 270 ARRAY_SIZE(eukrea_cpuimx51_i2c_devices));
271 271
272 if (otg_mode_host) 272 if (otg_mode_host)
273 mxc_register_device(&mxc_usbdr_host_device, &dr_utmi_config); 273 imx51_add_mxc_ehci_otg(&dr_utmi_config);
274 else { 274 else {
275 initialize_otg_port(NULL); 275 initialize_otg_port(NULL);
276 mxc_register_device(&mxc_usbdr_udc_device, &usb_pdata); 276 mxc_register_device(&mxc_usbdr_udc_device, &usb_pdata);
277 } 277 }
278 mxc_register_device(&mxc_usbh1_device, &usbh1_config); 278 imx51_add_mxc_ehci_hs(1, &usbh1_config);
279 279
280#ifdef CONFIG_MACH_EUKREA_MBIMX51_BASEBOARD 280#ifdef CONFIG_MACH_EUKREA_MBIMX51_BASEBOARD
281 eukrea_mbimx51_baseboard_init(); 281 eukrea_mbimx51_baseboard_init();
diff --git a/arch/arm/mach-mx5/board-cpuimx51sd.c b/arch/arm/mach-mx5/board-cpuimx51sd.c
index ff096d587299..bca3719e2726 100644
--- a/arch/arm/mach-mx5/board-cpuimx51sd.c
+++ b/arch/arm/mach-mx5/board-cpuimx51sd.c
@@ -149,7 +149,7 @@ static int initialize_otg_port(struct platform_device *pdev)
149 void __iomem *usb_base; 149 void __iomem *usb_base;
150 void __iomem *usbother_base; 150 void __iomem *usbother_base;
151 151
152 usb_base = ioremap(MX51_OTG_BASE_ADDR, SZ_4K); 152 usb_base = ioremap(MX51_USB_OTG_BASE_ADDR, SZ_4K);
153 if (!usb_base) 153 if (!usb_base)
154 return -ENOMEM; 154 return -ENOMEM;
155 usbother_base = usb_base + MX5_USBOTHER_REGS_OFFSET; 155 usbother_base = usb_base + MX5_USBOTHER_REGS_OFFSET;
@@ -172,7 +172,7 @@ static int initialize_usbh1_port(struct platform_device *pdev)
172 void __iomem *usb_base; 172 void __iomem *usb_base;
173 void __iomem *usbother_base; 173 void __iomem *usbother_base;
174 174
175 usb_base = ioremap(MX51_OTG_BASE_ADDR, SZ_4K); 175 usb_base = ioremap(MX51_USB_OTG_BASE_ADDR, SZ_4K);
176 if (!usb_base) 176 if (!usb_base)
177 return -ENOMEM; 177 return -ENOMEM;
178 usbother_base = usb_base + MX5_USBOTHER_REGS_OFFSET; 178 usbother_base = usb_base + MX5_USBOTHER_REGS_OFFSET;
@@ -189,7 +189,7 @@ static int initialize_usbh1_port(struct platform_device *pdev)
189 MXC_EHCI_ITC_NO_THRESHOLD); 189 MXC_EHCI_ITC_NO_THRESHOLD);
190} 190}
191 191
192static struct mxc_usbh_platform_data dr_utmi_config = { 192static const struct mxc_usbh_platform_data dr_utmi_config __initconst = {
193 .init = initialize_otg_port, 193 .init = initialize_otg_port,
194 .portsc = MXC_EHCI_UTMI_16BIT, 194 .portsc = MXC_EHCI_UTMI_16BIT,
195}; 195};
@@ -199,7 +199,7 @@ static struct fsl_usb2_platform_data usb_pdata = {
199 .phy_mode = FSL_USB2_PHY_UTMI_WIDE, 199 .phy_mode = FSL_USB2_PHY_UTMI_WIDE,
200}; 200};
201 201
202static struct mxc_usbh_platform_data usbh1_config = { 202static const struct mxc_usbh_platform_data usbh1_config __initconst = {
203 .init = initialize_usbh1_port, 203 .init = initialize_usbh1_port,
204 .portsc = MXC_EHCI_MODE_ULPI, 204 .portsc = MXC_EHCI_MODE_ULPI,
205}; 205};
@@ -303,7 +303,7 @@ static void __init eukrea_cpuimx51sd_init(void)
303 platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices)); 303 platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices));
304 304
305 if (otg_mode_host) 305 if (otg_mode_host)
306 mxc_register_device(&mxc_usbdr_host_device, &dr_utmi_config); 306 imx51_add_mxc_ehci_otg(&dr_utmi_config);
307 else { 307 else {
308 initialize_otg_port(NULL); 308 initialize_otg_port(NULL);
309 mxc_register_device(&mxc_usbdr_udc_device, &usb_pdata); 309 mxc_register_device(&mxc_usbdr_udc_device, &usb_pdata);
@@ -313,7 +313,7 @@ static void __init eukrea_cpuimx51sd_init(void)
313 gpio_direction_output(USBH1_RST, 0); 313 gpio_direction_output(USBH1_RST, 0);
314 msleep(20); 314 msleep(20);
315 gpio_set_value(USBH1_RST, 1); 315 gpio_set_value(USBH1_RST, 1);
316 mxc_register_device(&mxc_usbh1_device, &usbh1_config); 316 imx51_add_mxc_ehci_hs(1, &usbh1_config);
317 317
318#ifdef CONFIG_MACH_EUKREA_MBIMXSD51_BASEBOARD 318#ifdef CONFIG_MACH_EUKREA_MBIMXSD51_BASEBOARD
319 eukrea_mbimxsd51_baseboard_init(); 319 eukrea_mbimxsd51_baseboard_init();
diff --git a/arch/arm/mach-mx5/board-mx51_babbage.c b/arch/arm/mach-mx5/board-mx51_babbage.c
index e400b09109ce..1d15297ab8b4 100644
--- a/arch/arm/mach-mx5/board-mx51_babbage.c
+++ b/arch/arm/mach-mx5/board-mx51_babbage.c
@@ -249,7 +249,7 @@ static int initialize_otg_port(struct platform_device *pdev)
249 void __iomem *usb_base; 249 void __iomem *usb_base;
250 void __iomem *usbother_base; 250 void __iomem *usbother_base;
251 251
252 usb_base = ioremap(MX51_OTG_BASE_ADDR, SZ_4K); 252 usb_base = ioremap(MX51_USB_OTG_BASE_ADDR, SZ_4K);
253 if (!usb_base) 253 if (!usb_base)
254 return -ENOMEM; 254 return -ENOMEM;
255 usbother_base = usb_base + MX5_USBOTHER_REGS_OFFSET; 255 usbother_base = usb_base + MX5_USBOTHER_REGS_OFFSET;
@@ -272,7 +272,7 @@ static int initialize_usbh1_port(struct platform_device *pdev)
272 void __iomem *usb_base; 272 void __iomem *usb_base;
273 void __iomem *usbother_base; 273 void __iomem *usbother_base;
274 274
275 usb_base = ioremap(MX51_OTG_BASE_ADDR, SZ_4K); 275 usb_base = ioremap(MX51_USB_OTG_BASE_ADDR, SZ_4K);
276 if (!usb_base) 276 if (!usb_base)
277 return -ENOMEM; 277 return -ENOMEM;
278 usbother_base = usb_base + MX5_USBOTHER_REGS_OFFSET; 278 usbother_base = usb_base + MX5_USBOTHER_REGS_OFFSET;
@@ -288,7 +288,7 @@ static int initialize_usbh1_port(struct platform_device *pdev)
288 MXC_EHCI_ITC_NO_THRESHOLD); 288 MXC_EHCI_ITC_NO_THRESHOLD);
289} 289}
290 290
291static struct mxc_usbh_platform_data dr_utmi_config = { 291static const struct mxc_usbh_platform_data dr_utmi_config __initconst = {
292 .init = initialize_otg_port, 292 .init = initialize_otg_port,
293 .portsc = MXC_EHCI_UTMI_16BIT, 293 .portsc = MXC_EHCI_UTMI_16BIT,
294}; 294};
@@ -298,7 +298,7 @@ static struct fsl_usb2_platform_data usb_pdata = {
298 .phy_mode = FSL_USB2_PHY_UTMI_WIDE, 298 .phy_mode = FSL_USB2_PHY_UTMI_WIDE,
299}; 299};
300 300
301static struct mxc_usbh_platform_data usbh1_config = { 301static const struct mxc_usbh_platform_data usbh1_config __initconst = {
302 .init = initialize_usbh1_port, 302 .init = initialize_usbh1_port,
303 .portsc = MXC_EHCI_MODE_ULPI, 303 .portsc = MXC_EHCI_MODE_ULPI,
304}; 304};
@@ -384,14 +384,14 @@ static void __init mx51_babbage_init(void)
384 mxc_register_device(&mxc_hsi2c_device, &babbage_hsi2c_data); 384 mxc_register_device(&mxc_hsi2c_device, &babbage_hsi2c_data);
385 385
386 if (otg_mode_host) 386 if (otg_mode_host)
387 mxc_register_device(&mxc_usbdr_host_device, &dr_utmi_config); 387 imx51_add_mxc_ehci_otg(&dr_utmi_config);
388 else { 388 else {
389 initialize_otg_port(NULL); 389 initialize_otg_port(NULL);
390 mxc_register_device(&mxc_usbdr_udc_device, &usb_pdata); 390 mxc_register_device(&mxc_usbdr_udc_device, &usb_pdata);
391 } 391 }
392 392
393 gpio_usbh1_active(); 393 gpio_usbh1_active();
394 mxc_register_device(&mxc_usbh1_device, &usbh1_config); 394 imx51_add_mxc_ehci_hs(1, &usbh1_config);
395 /* setback USBH1_STP to be function */ 395 /* setback USBH1_STP to be function */
396 mxc_iomux_v3_setup_pad(usbh1stp); 396 mxc_iomux_v3_setup_pad(usbh1stp);
397 babbage_usbhub_reset(); 397 babbage_usbhub_reset();
diff --git a/arch/arm/mach-mx5/board-mx51_efikasb.c b/arch/arm/mach-mx5/board-mx51_efikasb.c
index 2e4d9d32a87c..10f0562c3c48 100644
--- a/arch/arm/mach-mx5/board-mx51_efikasb.c
+++ b/arch/arm/mach-mx5/board-mx51_efikasb.c
@@ -42,7 +42,6 @@
42#include <asm/mach/time.h> 42#include <asm/mach/time.h>
43 43
44#include "devices-imx51.h" 44#include "devices-imx51.h"
45#include "devices.h"
46#include "efika.h" 45#include "efika.h"
47 46
48#define EFIKASB_USBH2_STP IMX_GPIO_NR(2, 20) 47#define EFIKASB_USBH2_STP IMX_GPIO_NR(2, 20)
@@ -119,7 +118,7 @@ static int initialize_usbh2_port(struct platform_device *pdev)
119 return mx51_initialize_usb_hw(pdev->id, MXC_EHCI_ITC_NO_THRESHOLD); 118 return mx51_initialize_usb_hw(pdev->id, MXC_EHCI_ITC_NO_THRESHOLD);
120} 119}
121 120
122static struct mxc_usbh_platform_data usbh2_config = { 121static struct mxc_usbh_platform_data usbh2_config __initdata = {
123 .init = initialize_usbh2_port, 122 .init = initialize_usbh2_port,
124 .portsc = MXC_EHCI_MODE_ULPI, 123 .portsc = MXC_EHCI_MODE_ULPI,
125}; 124};
@@ -129,7 +128,7 @@ static void __init mx51_efikasb_usb(void)
129 usbh2_config.otg = imx_otg_ulpi_create(ULPI_OTG_DRVVBUS | 128 usbh2_config.otg = imx_otg_ulpi_create(ULPI_OTG_DRVVBUS |
130 ULPI_OTG_DRVVBUS_EXT | ULPI_OTG_EXTVBUSIND); 129 ULPI_OTG_DRVVBUS_EXT | ULPI_OTG_EXTVBUSIND);
131 if (usbh2_config.otg) 130 if (usbh2_config.otg)
132 mxc_register_device(&mxc_usbh2_device, &usbh2_config); 131 imx51_add_mxc_ehci_hs(2, &usbh2_config);
133} 132}
134 133
135static const struct gpio_led mx51_efikasb_leds[] __initconst = { 134static const struct gpio_led mx51_efikasb_leds[] __initconst = {
diff --git a/arch/arm/mach-mx5/devices-imx51.h b/arch/arm/mach-mx5/devices-imx51.h
index e11bc0e0ec49..f42acf5545e6 100644
--- a/arch/arm/mach-mx5/devices-imx51.h
+++ b/arch/arm/mach-mx5/devices-imx51.h
@@ -25,6 +25,13 @@ extern const struct imx_imx_uart_1irq_data imx51_imx_uart_data[];
25#define imx51_add_imx_uart(id, pdata) \ 25#define imx51_add_imx_uart(id, pdata) \
26 imx_add_imx_uart_1irq(&imx51_imx_uart_data[id], pdata) 26 imx_add_imx_uart_1irq(&imx51_imx_uart_data[id], pdata)
27 27
28extern const struct imx_mxc_ehci_data imx51_mxc_ehci_otg_data;
29#define imx51_add_mxc_ehci_otg(pdata) \
30 imx_add_mxc_ehci(&imx51_mxc_ehci_otg_data, pdata)
31extern const struct imx_mxc_ehci_data imx51_mxc_ehci_hs_data[];
32#define imx51_add_mxc_ehci_hs(id, pdata) \
33 imx_add_mxc_ehci(&imx51_mxc_ehci_hs_data[id - 1], pdata)
34
28extern const struct imx_mxc_nand_data imx51_mxc_nand_data; 35extern const struct imx_mxc_nand_data imx51_mxc_nand_data;
29#define imx51_add_mxc_nand(pdata) \ 36#define imx51_add_mxc_nand(pdata) \
30 imx_add_mxc_nand(&imx51_mxc_nand_data, pdata) 37 imx_add_mxc_nand(&imx51_mxc_nand_data, pdata)
diff --git a/arch/arm/mach-mx5/devices.c b/arch/arm/mach-mx5/devices.c
index 5fd8f0c7c844..88edf26299f4 100644
--- a/arch/arm/mach-mx5/devices.c
+++ b/arch/arm/mach-mx5/devices.c
@@ -40,8 +40,8 @@ static u64 usb_dma_mask = DMA_BIT_MASK(32);
40 40
41static struct resource usbotg_resources[] = { 41static struct resource usbotg_resources[] = {
42 { 42 {
43 .start = MX51_OTG_BASE_ADDR, 43 .start = MX51_USB_OTG_BASE_ADDR,
44 .end = MX51_OTG_BASE_ADDR + 0x1ff, 44 .end = MX51_USB_OTG_BASE_ADDR + 0x1ff,
45 .flags = IORESOURCE_MEM, 45 .flags = IORESOURCE_MEM,
46 }, 46 },
47 { 47 {
@@ -61,60 +61,3 @@ struct platform_device mxc_usbdr_udc_device = {
61 .coherent_dma_mask = DMA_BIT_MASK(32), 61 .coherent_dma_mask = DMA_BIT_MASK(32),
62 }, 62 },
63}; 63};
64
65struct platform_device mxc_usbdr_host_device = {
66 .name = "mxc-ehci",
67 .id = 0,
68 .num_resources = ARRAY_SIZE(usbotg_resources),
69 .resource = usbotg_resources,
70 .dev = {
71 .dma_mask = &usb_dma_mask,
72 .coherent_dma_mask = DMA_BIT_MASK(32),
73 },
74};
75
76static struct resource usbh1_resources[] = {
77 {
78 .start = MX51_OTG_BASE_ADDR + 0x200,
79 .end = MX51_OTG_BASE_ADDR + 0x200 + 0x1ff,
80 .flags = IORESOURCE_MEM,
81 },
82 {
83 .start = MX51_INT_USB_H1,
84 .flags = IORESOURCE_IRQ,
85 },
86};
87
88struct platform_device mxc_usbh1_device = {
89 .name = "mxc-ehci",
90 .id = 1,
91 .num_resources = ARRAY_SIZE(usbh1_resources),
92 .resource = usbh1_resources,
93 .dev = {
94 .dma_mask = &usb_dma_mask,
95 .coherent_dma_mask = DMA_BIT_MASK(32),
96 },
97};
98
99static struct resource usbh2_resources[] = {
100 {
101 .start = MX51_OTG_BASE_ADDR + 0x400,
102 .end = MX51_OTG_BASE_ADDR + 0x400 + 0x1ff,
103 .flags = IORESOURCE_MEM,
104 },
105 {
106 .start = MX51_INT_USB_H2,
107 .flags = IORESOURCE_IRQ,
108 },
109};
110
111struct platform_device mxc_usbh2_device = {
112 .name = "mxc-ehci",
113 .id = 2,
114 .num_resources = ARRAY_SIZE(usbh2_resources),
115 .resource = usbh2_resources,
116 .dev = {
117 .dma_mask = &usb_dma_mask,
118 .coherent_dma_mask = DMA_BIT_MASK(32),
119 },
120};
diff --git a/arch/arm/mach-mx5/devices.h b/arch/arm/mach-mx5/devices.h
index 55a5129bc29f..0f30a6e7138c 100644
--- a/arch/arm/mach-mx5/devices.h
+++ b/arch/arm/mach-mx5/devices.h
@@ -1,5 +1,2 @@
1extern struct platform_device mxc_usbdr_host_device;
2extern struct platform_device mxc_usbh1_device;
3extern struct platform_device mxc_usbh2_device;
4extern struct platform_device mxc_usbdr_udc_device; 1extern struct platform_device mxc_usbdr_udc_device;
5extern struct platform_device mxc_hsi2c_device; 2extern struct platform_device mxc_hsi2c_device;
diff --git a/arch/arm/mach-mx5/ehci.c b/arch/arm/mach-mx5/ehci.c
index 7ce12c804a32..c17fa131728b 100644
--- a/arch/arm/mach-mx5/ehci.c
+++ b/arch/arm/mach-mx5/ehci.c
@@ -52,7 +52,7 @@ int mx51_initialize_usb_hw(int port, unsigned int flags)
52 void __iomem *usbother_base; 52 void __iomem *usbother_base;
53 int ret = 0; 53 int ret = 0;
54 54
55 usb_base = ioremap(MX51_OTG_BASE_ADDR, SZ_4K); 55 usb_base = ioremap(MX51_USB_OTG_BASE_ADDR, SZ_4K);
56 if (!usb_base) { 56 if (!usb_base) {
57 printk(KERN_ERR "%s(): ioremap failed\n", __func__); 57 printk(KERN_ERR "%s(): ioremap failed\n", __func__);
58 return -ENOMEM; 58 return -ENOMEM;
diff --git a/arch/arm/mach-mx5/mx51_efika.c b/arch/arm/mach-mx5/mx51_efika.c
index 4435e03cea5d..e99dead65b38 100644
--- a/arch/arm/mach-mx5/mx51_efika.c
+++ b/arch/arm/mach-mx5/mx51_efika.c
@@ -41,7 +41,6 @@
41#include <asm/mach/time.h> 41#include <asm/mach/time.h>
42 42
43#include "devices-imx51.h" 43#include "devices-imx51.h"
44#include "devices.h"
45#include "efika.h" 44#include "efika.h"
46#include "cpu_op-mx51.h" 45#include "cpu_op-mx51.h"
47 46
@@ -133,7 +132,7 @@ static int initialize_otg_port(struct platform_device *pdev)
133 u32 v; 132 u32 v;
134 void __iomem *usb_base; 133 void __iomem *usb_base;
135 void __iomem *usbother_base; 134 void __iomem *usbother_base;
136 usb_base = ioremap(MX51_OTG_BASE_ADDR, SZ_4K); 135 usb_base = ioremap(MX51_USB_OTG_BASE_ADDR, SZ_4K);
137 if (!usb_base) 136 if (!usb_base)
138 return -ENOMEM; 137 return -ENOMEM;
139 usbother_base = (void __iomem *)(usb_base + MX5_USBOTHER_REGS_OFFSET); 138 usbother_base = (void __iomem *)(usb_base + MX5_USBOTHER_REGS_OFFSET);
@@ -150,7 +149,7 @@ static int initialize_otg_port(struct platform_device *pdev)
150 return mx51_initialize_usb_hw(pdev->id, MXC_EHCI_INTERNAL_PHY); 149 return mx51_initialize_usb_hw(pdev->id, MXC_EHCI_INTERNAL_PHY);
151} 150}
152 151
153static struct mxc_usbh_platform_data dr_utmi_config = { 152static const struct mxc_usbh_platform_data dr_utmi_config __initconst = {
154 .init = initialize_otg_port, 153 .init = initialize_otg_port,
155 .portsc = MXC_EHCI_UTMI_16BIT, 154 .portsc = MXC_EHCI_UTMI_16BIT,
156}; 155};
@@ -170,7 +169,7 @@ static int initialize_usbh1_port(struct platform_device *pdev)
170 gpio_set_value(EFIKAMX_USBH1_STP, 1); 169 gpio_set_value(EFIKAMX_USBH1_STP, 1);
171 msleep(1); 170 msleep(1);
172 171
173 usb_base = ioremap(MX51_OTG_BASE_ADDR, SZ_4K); 172 usb_base = ioremap(MX51_USB_OTG_BASE_ADDR, SZ_4K);
174 socregs_base = (void __iomem *)(usb_base + MX5_USBOTHER_REGS_OFFSET); 173 socregs_base = (void __iomem *)(usb_base + MX5_USBOTHER_REGS_OFFSET);
175 174
176 /* The clock for the USBH1 ULPI port will come externally */ 175 /* The clock for the USBH1 ULPI port will come externally */
@@ -189,7 +188,7 @@ static int initialize_usbh1_port(struct platform_device *pdev)
189 return mx51_initialize_usb_hw(0, MXC_EHCI_ITC_NO_THRESHOLD); 188 return mx51_initialize_usb_hw(0, MXC_EHCI_ITC_NO_THRESHOLD);
190} 189}
191 190
192static struct mxc_usbh_platform_data usbh1_config = { 191static struct mxc_usbh_platform_data usbh1_config __initdata = {
193 .init = initialize_usbh1_port, 192 .init = initialize_usbh1_port,
194 .portsc = MXC_EHCI_MODE_ULPI, 193 .portsc = MXC_EHCI_MODE_ULPI,
195}; 194};
@@ -217,9 +216,9 @@ static void __init mx51_efika_usb(void)
217 usbh1_config.otg = imx_otg_ulpi_create(ULPI_OTG_DRVVBUS | 216 usbh1_config.otg = imx_otg_ulpi_create(ULPI_OTG_DRVVBUS |
218 ULPI_OTG_DRVVBUS_EXT | ULPI_OTG_EXTVBUSIND); 217 ULPI_OTG_DRVVBUS_EXT | ULPI_OTG_EXTVBUSIND);
219 218
220 mxc_register_device(&mxc_usbdr_host_device, &dr_utmi_config); 219 imx51_add_mxc_ehci_otg(&dr_utmi_config);
221 if (usbh1_config.otg) 220 if (usbh1_config.otg)
222 mxc_register_device(&mxc_usbh1_device, &usbh1_config); 221 imx51_add_mxc_ehci_hs(1, &usbh1_config);
223} 222}
224 223
225static struct mtd_partition mx51_efika_spi_nor_partitions[] = { 224static struct mtd_partition mx51_efika_spi_nor_partitions[] = {
@@ -631,4 +630,3 @@ void __init efika_board_common_init(void)
631 get_cpu_op = mx51_get_cpu_op; 630 get_cpu_op = mx51_get_cpu_op;
632#endif 631#endif
633} 632}
634