diff options
author | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2010-11-05 13:52:09 -0400 |
---|---|---|
committer | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2010-11-17 04:01:31 -0500 |
commit | 2eb42d5c287f5e883a4b3ebe668ba880caa351e5 (patch) | |
tree | 05bba579ebdc9d945658f76f0b6476a65b69b3c3 /arch/arm | |
parent | 9d3d945a8d5be2c915f646e8dff8422486a77030 (diff) |
ARM: imx: dynamically allocate mxc-ehci devices
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/mach-imx/Kconfig | 4 | ||||
-rw-r--r-- | arch/arm/mach-imx/devices-imx27.h | 7 | ||||
-rw-r--r-- | arch/arm/mach-imx/devices.c | 73 | ||||
-rw-r--r-- | arch/arm/mach-imx/devices.h | 3 | ||||
-rw-r--r-- | arch/arm/mach-imx/mach-cpuimx27.c | 9 | ||||
-rw-r--r-- | arch/arm/mach-imx/mach-imx27_visstrim_m10.c | 6 | ||||
-rw-r--r-- | arch/arm/mach-imx/mach-pca100.c | 9 | ||||
-rw-r--r-- | arch/arm/mach-imx/mach-pcm038.c | 5 | ||||
-rw-r--r-- | arch/arm/plat-mxc/devices/Kconfig | 3 | ||||
-rw-r--r-- | arch/arm/plat-mxc/devices/Makefile | 1 | ||||
-rw-r--r-- | arch/arm/plat-mxc/devices/platform-mxc-ehci.c | 46 | ||||
-rw-r--r-- | arch/arm/plat-mxc/include/mach/devices-common.h | 10 | ||||
-rw-r--r-- | arch/arm/plat-mxc/include/mach/mx27.h | 12 |
13 files changed, 95 insertions, 93 deletions
diff --git a/arch/arm/mach-imx/Kconfig b/arch/arm/mach-imx/Kconfig index 8e9297b84830..025e96925561 100644 --- a/arch/arm/mach-imx/Kconfig +++ b/arch/arm/mach-imx/Kconfig | |||
@@ -102,6 +102,7 @@ config MACH_PCM038 | |||
102 | select IMX_HAVE_PLATFORM_IMX2_WDT | 102 | select IMX_HAVE_PLATFORM_IMX2_WDT |
103 | select IMX_HAVE_PLATFORM_IMX_I2C | 103 | select IMX_HAVE_PLATFORM_IMX_I2C |
104 | select IMX_HAVE_PLATFORM_IMX_UART | 104 | select IMX_HAVE_PLATFORM_IMX_UART |
105 | select IMX_HAVE_PLATFORM_MXC_EHCI | ||
105 | select IMX_HAVE_PLATFORM_MXC_NAND | 106 | select IMX_HAVE_PLATFORM_MXC_NAND |
106 | select IMX_HAVE_PLATFORM_MXC_W1 | 107 | select IMX_HAVE_PLATFORM_MXC_W1 |
107 | select IMX_HAVE_PLATFORM_SPI_IMX | 108 | select IMX_HAVE_PLATFORM_SPI_IMX |
@@ -130,6 +131,7 @@ config MACH_CPUIMX27 | |||
130 | select IMX_HAVE_PLATFORM_IMX2_WDT | 131 | select IMX_HAVE_PLATFORM_IMX2_WDT |
131 | select IMX_HAVE_PLATFORM_IMX_I2C | 132 | select IMX_HAVE_PLATFORM_IMX_I2C |
132 | select IMX_HAVE_PLATFORM_IMX_UART | 133 | select IMX_HAVE_PLATFORM_IMX_UART |
134 | select IMX_HAVE_PLATFORM_MXC_EHCI | ||
133 | select IMX_HAVE_PLATFORM_MXC_NAND | 135 | select IMX_HAVE_PLATFORM_MXC_NAND |
134 | select IMX_HAVE_PLATFORM_MXC_W1 | 136 | select IMX_HAVE_PLATFORM_MXC_W1 |
135 | select MXC_ULPI if USB_ULPI | 137 | select MXC_ULPI if USB_ULPI |
@@ -183,6 +185,7 @@ config MACH_IMX27_VISSTRIM_M10 | |||
183 | select IMX_HAVE_PLATFORM_IMX_I2C | 185 | select IMX_HAVE_PLATFORM_IMX_I2C |
184 | select IMX_HAVE_PLATFORM_IMX_UART | 186 | select IMX_HAVE_PLATFORM_IMX_UART |
185 | select IMX_HAVE_PLATFORM_MXC_MMC | 187 | select IMX_HAVE_PLATFORM_MXC_MMC |
188 | select IMX_HAVE_PLATFORM_MXC_EHCI | ||
186 | help | 189 | help |
187 | Include support for Visstrim_m10 platform and its different variants. | 190 | Include support for Visstrim_m10 platform and its different variants. |
188 | This includes specific configurations for the board and its | 191 | This includes specific configurations for the board and its |
@@ -202,6 +205,7 @@ config MACH_PCA100 | |||
202 | select IMX_HAVE_PLATFORM_IMX_I2C | 205 | select IMX_HAVE_PLATFORM_IMX_I2C |
203 | select IMX_HAVE_PLATFORM_IMX_SSI | 206 | select IMX_HAVE_PLATFORM_IMX_SSI |
204 | select IMX_HAVE_PLATFORM_IMX_UART | 207 | select IMX_HAVE_PLATFORM_IMX_UART |
208 | select IMX_HAVE_PLATFORM_MXC_EHCI | ||
205 | select IMX_HAVE_PLATFORM_MXC_MMC | 209 | select IMX_HAVE_PLATFORM_MXC_MMC |
206 | select IMX_HAVE_PLATFORM_MXC_NAND | 210 | select IMX_HAVE_PLATFORM_MXC_NAND |
207 | select IMX_HAVE_PLATFORM_MXC_W1 | 211 | select IMX_HAVE_PLATFORM_MXC_W1 |
diff --git a/arch/arm/mach-imx/devices-imx27.h b/arch/arm/mach-imx/devices-imx27.h index 646674485a0d..51b91553c590 100644 --- a/arch/arm/mach-imx/devices-imx27.h +++ b/arch/arm/mach-imx/devices-imx27.h | |||
@@ -43,6 +43,13 @@ extern const struct imx_mx2_camera_data imx27_mx2_camera_data __initconst; | |||
43 | #define imx27_add_mx2_camera(pdata) \ | 43 | #define imx27_add_mx2_camera(pdata) \ |
44 | imx_add_mx2_camera(&imx27_mx2_camera_data, pdata) | 44 | imx_add_mx2_camera(&imx27_mx2_camera_data, pdata) |
45 | 45 | ||
46 | extern const struct imx_mxc_ehci_data imx27_mxc_ehci_otg_data __initconst; | ||
47 | #define imx27_add_mxc_ehci_otg(pdata) \ | ||
48 | imx_add_mxc_ehci(&imx27_mxc_ehci_otg_data, pdata) | ||
49 | extern const struct imx_mxc_ehci_data imx27_mxc_ehci_hs_data[] __initconst; | ||
50 | #define imx27_add_mxc_ehci_hs(id, pdata) \ | ||
51 | imx_add_mxc_ehci(&imx27_mxc_ehci_hs_data[id - 1], pdata) | ||
52 | |||
46 | extern const struct imx_mxc_mmc_data imx27_mxc_mmc_data[] __initconst; | 53 | extern const struct imx_mxc_mmc_data imx27_mxc_mmc_data[] __initconst; |
47 | #define imx27_add_mxc_mmc(id, pdata) \ | 54 | #define imx27_add_mxc_mmc(id, pdata) \ |
48 | imx_add_mxc_mmc(&imx27_mxc_mmc_data[id], pdata) | 55 | imx_add_mxc_mmc(&imx27_mxc_mmc_data[id], pdata) |
diff --git a/arch/arm/mach-imx/devices.c b/arch/arm/mach-imx/devices.c index 7609e8a8f13c..2a6d70720e99 100644 --- a/arch/arm/mach-imx/devices.c +++ b/arch/arm/mach-imx/devices.c | |||
@@ -79,12 +79,12 @@ int __init imx1_register_gpios(void) | |||
79 | #ifdef CONFIG_MACH_MX27 | 79 | #ifdef CONFIG_MACH_MX27 |
80 | static struct resource otg_resources[] = { | 80 | static struct resource otg_resources[] = { |
81 | { | 81 | { |
82 | .start = MX27_USBOTG_BASE_ADDR, | 82 | .start = MX27_USB_OTG_BASE_ADDR, |
83 | .end = MX27_USBOTG_BASE_ADDR + 0x1ff, | 83 | .end = MX27_USB_OTG_BASE_ADDR + 0x1ff, |
84 | .flags = IORESOURCE_MEM, | 84 | .flags = IORESOURCE_MEM, |
85 | }, { | 85 | }, { |
86 | .start = MX27_INT_USB3, | 86 | .start = MX27_INT_USB_OTG, |
87 | .end = MX27_INT_USB3, | 87 | .end = MX27_INT_USB_OTG, |
88 | .flags = IORESOURCE_IRQ, | 88 | .flags = IORESOURCE_IRQ, |
89 | }, | 89 | }, |
90 | }; | 90 | }; |
@@ -102,71 +102,6 @@ struct platform_device mxc_otg_udc_device = { | |||
102 | .resource = otg_resources, | 102 | .resource = otg_resources, |
103 | .num_resources = ARRAY_SIZE(otg_resources), | 103 | .num_resources = ARRAY_SIZE(otg_resources), |
104 | }; | 104 | }; |
105 | |||
106 | /* OTG host */ | ||
107 | struct platform_device mxc_otg_host = { | ||
108 | .name = "mxc-ehci", | ||
109 | .id = 0, | ||
110 | .dev = { | ||
111 | .coherent_dma_mask = DMA_BIT_MASK(32), | ||
112 | .dma_mask = &otg_dmamask, | ||
113 | }, | ||
114 | .resource = otg_resources, | ||
115 | .num_resources = ARRAY_SIZE(otg_resources), | ||
116 | }; | ||
117 | |||
118 | /* USB host 1 */ | ||
119 | |||
120 | static u64 usbh1_dmamask = DMA_BIT_MASK(32); | ||
121 | |||
122 | static struct resource mxc_usbh1_resources[] = { | ||
123 | { | ||
124 | .start = MX27_USBOTG_BASE_ADDR + 0x200, | ||
125 | .end = MX27_USBOTG_BASE_ADDR + 0x3ff, | ||
126 | .flags = IORESOURCE_MEM, | ||
127 | }, { | ||
128 | .start = MX27_INT_USB1, | ||
129 | .end = MX27_INT_USB1, | ||
130 | .flags = IORESOURCE_IRQ, | ||
131 | }, | ||
132 | }; | ||
133 | |||
134 | struct platform_device mxc_usbh1 = { | ||
135 | .name = "mxc-ehci", | ||
136 | .id = 1, | ||
137 | .dev = { | ||
138 | .coherent_dma_mask = DMA_BIT_MASK(32), | ||
139 | .dma_mask = &usbh1_dmamask, | ||
140 | }, | ||
141 | .resource = mxc_usbh1_resources, | ||
142 | .num_resources = ARRAY_SIZE(mxc_usbh1_resources), | ||
143 | }; | ||
144 | |||
145 | /* USB host 2 */ | ||
146 | static u64 usbh2_dmamask = DMA_BIT_MASK(32); | ||
147 | |||
148 | static struct resource mxc_usbh2_resources[] = { | ||
149 | { | ||
150 | .start = MX27_USBOTG_BASE_ADDR + 0x400, | ||
151 | .end = MX27_USBOTG_BASE_ADDR + 0x5ff, | ||
152 | .flags = IORESOURCE_MEM, | ||
153 | }, { | ||
154 | .start = MX27_INT_USB2, | ||
155 | .end = MX27_INT_USB2, | ||
156 | .flags = IORESOURCE_IRQ, | ||
157 | }, | ||
158 | }; | ||
159 | |||
160 | struct platform_device mxc_usbh2 = { | ||
161 | .name = "mxc-ehci", | ||
162 | .id = 2, | ||
163 | .dev = { | ||
164 | .coherent_dma_mask = DMA_BIT_MASK(32), | ||
165 | .dma_mask = &usbh2_dmamask, | ||
166 | }, | ||
167 | .resource = mxc_usbh2_resources, | ||
168 | .num_resources = ARRAY_SIZE(mxc_usbh2_resources), | ||
169 | }; | ||
170 | #endif | 105 | #endif |
171 | 106 | ||
172 | #if defined(CONFIG_MACH_MX21) || defined(CONFIG_MACH_MX27) | 107 | #if defined(CONFIG_MACH_MX21) || defined(CONFIG_MACH_MX27) |
diff --git a/arch/arm/mach-imx/devices.h b/arch/arm/mach-imx/devices.h index a45d760f3c77..7a00bba3688e 100644 --- a/arch/arm/mach-imx/devices.h +++ b/arch/arm/mach-imx/devices.h | |||
@@ -1,8 +1,5 @@ | |||
1 | #if defined(CONFIG_MACH_MX21) || defined(CONFIG_MACH_MX27) | 1 | #if defined(CONFIG_MACH_MX21) || defined(CONFIG_MACH_MX27) |
2 | extern struct platform_device mxc_otg_udc_device; | 2 | extern struct platform_device mxc_otg_udc_device; |
3 | extern struct platform_device mxc_otg_host; | ||
4 | extern struct platform_device mxc_usbh1; | ||
5 | extern struct platform_device mxc_usbh2; | ||
6 | extern struct platform_device mx21_usbhc_device; | 3 | extern struct platform_device mx21_usbhc_device; |
7 | extern struct platform_device imx_kpp_device; | 4 | extern struct platform_device imx_kpp_device; |
8 | #endif | 5 | #endif |
diff --git a/arch/arm/mach-imx/mach-cpuimx27.c b/arch/arm/mach-imx/mach-cpuimx27.c index 06ff79a60901..c70b0382363e 100644 --- a/arch/arm/mach-imx/mach-cpuimx27.c +++ b/arch/arm/mach-imx/mach-cpuimx27.c | |||
@@ -40,7 +40,6 @@ | |||
40 | #include <mach/hardware.h> | 40 | #include <mach/hardware.h> |
41 | #include <mach/iomux-mx27.h> | 41 | #include <mach/iomux-mx27.h> |
42 | #include <mach/mxc_nand.h> | 42 | #include <mach/mxc_nand.h> |
43 | #include <mach/mxc_ehci.h> | ||
44 | #include <mach/ulpi.h> | 43 | #include <mach/ulpi.h> |
45 | 44 | ||
46 | #include "devices-imx27.h" | 45 | #include "devices-imx27.h" |
@@ -213,12 +212,12 @@ static struct platform_device serial_device = { | |||
213 | #endif | 212 | #endif |
214 | 213 | ||
215 | #if defined(CONFIG_USB_ULPI) | 214 | #if defined(CONFIG_USB_ULPI) |
216 | static struct mxc_usbh_platform_data otg_pdata = { | 215 | static struct mxc_usbh_platform_data otg_pdata __initdata = { |
217 | .portsc = MXC_EHCI_MODE_ULPI, | 216 | .portsc = MXC_EHCI_MODE_ULPI, |
218 | .flags = MXC_EHCI_INTERFACE_DIFF_UNI, | 217 | .flags = MXC_EHCI_INTERFACE_DIFF_UNI, |
219 | }; | 218 | }; |
220 | 219 | ||
221 | static struct mxc_usbh_platform_data usbh2_pdata = { | 220 | static struct mxc_usbh_platform_data usbh2_pdata __initdata = { |
222 | .portsc = MXC_EHCI_MODE_ULPI, | 221 | .portsc = MXC_EHCI_MODE_ULPI, |
223 | .flags = MXC_EHCI_INTERFACE_DIFF_UNI, | 222 | .flags = MXC_EHCI_INTERFACE_DIFF_UNI, |
224 | }; | 223 | }; |
@@ -281,13 +280,13 @@ static void __init eukrea_cpuimx27_init(void) | |||
281 | otg_pdata.otg = otg_ulpi_create(&mxc_ulpi_access_ops, | 280 | otg_pdata.otg = otg_ulpi_create(&mxc_ulpi_access_ops, |
282 | ULPI_OTG_DRVVBUS | ULPI_OTG_DRVVBUS_EXT); | 281 | ULPI_OTG_DRVVBUS | ULPI_OTG_DRVVBUS_EXT); |
283 | 282 | ||
284 | mxc_register_device(&mxc_otg_host, &otg_pdata); | 283 | imx27_add_mxc_ehci_otg(&otg_pdata); |
285 | } | 284 | } |
286 | 285 | ||
287 | usbh2_pdata.otg = otg_ulpi_create(&mxc_ulpi_access_ops, | 286 | usbh2_pdata.otg = otg_ulpi_create(&mxc_ulpi_access_ops, |
288 | ULPI_OTG_DRVVBUS | ULPI_OTG_DRVVBUS_EXT); | 287 | ULPI_OTG_DRVVBUS | ULPI_OTG_DRVVBUS_EXT); |
289 | 288 | ||
290 | mxc_register_device(&mxc_usbh2, &usbh2_pdata); | 289 | imx27_add_mxc_ehci_hs(2, &usbh2_pdata); |
291 | #endif | 290 | #endif |
292 | if (!otg_mode_host) | 291 | if (!otg_mode_host) |
293 | mxc_register_device(&mxc_otg_udc_device, &otg_device_pdata); | 292 | mxc_register_device(&mxc_otg_udc_device, &otg_device_pdata); |
diff --git a/arch/arm/mach-imx/mach-imx27_visstrim_m10.c b/arch/arm/mach-imx/mach-imx27_visstrim_m10.c index deef1fa1138e..c9f12e44a2ab 100644 --- a/arch/arm/mach-imx/mach-imx27_visstrim_m10.c +++ b/arch/arm/mach-imx/mach-imx27_visstrim_m10.c | |||
@@ -35,7 +35,6 @@ | |||
35 | #include <asm/mach/time.h> | 35 | #include <asm/mach/time.h> |
36 | #include <mach/common.h> | 36 | #include <mach/common.h> |
37 | #include <mach/iomux.h> | 37 | #include <mach/iomux.h> |
38 | #include <mach/mxc_ehci.h> | ||
39 | 38 | ||
40 | #include "devices-imx27.h" | 39 | #include "devices-imx27.h" |
41 | #include "devices.h" | 40 | #include "devices.h" |
@@ -215,7 +214,8 @@ static int otg_phy_init(struct platform_device *pdev) | |||
215 | return 0; | 214 | return 0; |
216 | } | 215 | } |
217 | 216 | ||
218 | static struct mxc_usbh_platform_data visstrim_m10_usbotg_pdata = { | 217 | static const struct mxc_usbh_platform_data |
218 | visstrim_m10_usbotg_pdata __initconst = { | ||
219 | .init = otg_phy_init, | 219 | .init = otg_phy_init, |
220 | .portsc = MXC_EHCI_MODE_ULPI | MXC_EHCI_UTMI_8BIT, | 220 | .portsc = MXC_EHCI_MODE_ULPI | MXC_EHCI_UTMI_8BIT, |
221 | .flags = MXC_EHCI_POWER_PINS_ENABLED, | 221 | .flags = MXC_EHCI_POWER_PINS_ENABLED, |
@@ -237,7 +237,7 @@ static void __init visstrim_m10_board_init(void) | |||
237 | imx27_add_imx_i2c(0, &visstrim_m10_i2c_data); | 237 | imx27_add_imx_i2c(0, &visstrim_m10_i2c_data); |
238 | imx27_add_imx_i2c(1, &visstrim_m10_i2c_data); | 238 | imx27_add_imx_i2c(1, &visstrim_m10_i2c_data); |
239 | imx27_add_mxc_mmc(0, &visstrim_m10_sdhc_pdata); | 239 | imx27_add_mxc_mmc(0, &visstrim_m10_sdhc_pdata); |
240 | mxc_register_device(&mxc_otg_host, &visstrim_m10_usbotg_pdata); | 240 | imx27_add_mxc_ehci_otg(&visstrim_m10_usbotg_pdata); |
241 | imx27_add_fec(NULL); | 241 | imx27_add_fec(NULL); |
242 | platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices)); | 242 | platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices)); |
243 | } | 243 | } |
diff --git a/arch/arm/mach-imx/mach-pca100.c b/arch/arm/mach-imx/mach-pca100.c index b05f528bfc00..683374d94024 100644 --- a/arch/arm/mach-imx/mach-pca100.c +++ b/arch/arm/mach-imx/mach-pca100.c | |||
@@ -40,7 +40,6 @@ | |||
40 | #include <mach/audmux.h> | 40 | #include <mach/audmux.h> |
41 | #include <mach/mxc_nand.h> | 41 | #include <mach/mxc_nand.h> |
42 | #include <mach/irqs.h> | 42 | #include <mach/irqs.h> |
43 | #include <mach/mxc_ehci.h> | ||
44 | #include <mach/ulpi.h> | 43 | #include <mach/ulpi.h> |
45 | 44 | ||
46 | #include "devices-imx27.h" | 45 | #include "devices-imx27.h" |
@@ -279,7 +278,7 @@ static int otg_phy_init(struct platform_device *pdev) | |||
279 | return 0; | 278 | return 0; |
280 | } | 279 | } |
281 | 280 | ||
282 | static struct mxc_usbh_platform_data otg_pdata = { | 281 | static struct mxc_usbh_platform_data otg_pdata __initdata = { |
283 | .init = otg_phy_init, | 282 | .init = otg_phy_init, |
284 | .portsc = MXC_EHCI_MODE_ULPI, | 283 | .portsc = MXC_EHCI_MODE_ULPI, |
285 | .flags = MXC_EHCI_INTERFACE_DIFF_UNI, | 284 | .flags = MXC_EHCI_INTERFACE_DIFF_UNI, |
@@ -291,7 +290,7 @@ static int usbh2_phy_init(struct platform_device *pdev) | |||
291 | return 0; | 290 | return 0; |
292 | } | 291 | } |
293 | 292 | ||
294 | static struct mxc_usbh_platform_data usbh2_pdata = { | 293 | static struct mxc_usbh_platform_data usbh2_pdata __initdata = { |
295 | .init = usbh2_phy_init, | 294 | .init = usbh2_phy_init, |
296 | .portsc = MXC_EHCI_MODE_ULPI, | 295 | .portsc = MXC_EHCI_MODE_ULPI, |
297 | .flags = MXC_EHCI_INTERFACE_DIFF_UNI, | 296 | .flags = MXC_EHCI_INTERFACE_DIFF_UNI, |
@@ -410,13 +409,13 @@ static void __init pca100_init(void) | |||
410 | otg_pdata.otg = otg_ulpi_create(&mxc_ulpi_access_ops, | 409 | otg_pdata.otg = otg_ulpi_create(&mxc_ulpi_access_ops, |
411 | ULPI_OTG_DRVVBUS | ULPI_OTG_DRVVBUS_EXT); | 410 | ULPI_OTG_DRVVBUS | ULPI_OTG_DRVVBUS_EXT); |
412 | 411 | ||
413 | mxc_register_device(&mxc_otg_host, &otg_pdata); | 412 | imx27_add_mxc_ehci_otg(&otg_pdata); |
414 | } | 413 | } |
415 | 414 | ||
416 | usbh2_pdata.otg = otg_ulpi_create(&mxc_ulpi_access_ops, | 415 | usbh2_pdata.otg = otg_ulpi_create(&mxc_ulpi_access_ops, |
417 | ULPI_OTG_DRVVBUS | ULPI_OTG_DRVVBUS_EXT); | 416 | ULPI_OTG_DRVVBUS | ULPI_OTG_DRVVBUS_EXT); |
418 | 417 | ||
419 | mxc_register_device(&mxc_usbh2, &usbh2_pdata); | 418 | imx27_add_mxc_ehci_hs(2, &usbh2_pdata); |
420 | #endif | 419 | #endif |
421 | if (!otg_mode_host) { | 420 | if (!otg_mode_host) { |
422 | gpio_set_value(OTG_PHY_CS_GPIO, 0); | 421 | gpio_set_value(OTG_PHY_CS_GPIO, 0); |
diff --git a/arch/arm/mach-imx/mach-pcm038.c b/arch/arm/mach-imx/mach-pcm038.c index b3340cd8ccdd..e209b28bee4d 100644 --- a/arch/arm/mach-imx/mach-pcm038.c +++ b/arch/arm/mach-imx/mach-pcm038.c | |||
@@ -37,7 +37,6 @@ | |||
37 | #include <mach/hardware.h> | 37 | #include <mach/hardware.h> |
38 | #include <mach/iomux-mx27.h> | 38 | #include <mach/iomux-mx27.h> |
39 | #include <mach/mxc_nand.h> | 39 | #include <mach/mxc_nand.h> |
40 | #include <mach/mxc_ehci.h> | ||
41 | #include <mach/ulpi.h> | 40 | #include <mach/ulpi.h> |
42 | 41 | ||
43 | #include "devices-imx27.h" | 42 | #include "devices-imx27.h" |
@@ -283,7 +282,7 @@ static struct spi_board_info pcm038_spi_board_info[] __initdata = { | |||
283 | } | 282 | } |
284 | }; | 283 | }; |
285 | 284 | ||
286 | static struct mxc_usbh_platform_data usbh2_pdata = { | 285 | static const struct mxc_usbh_platform_data usbh2_pdata __initconst = { |
287 | .portsc = MXC_EHCI_MODE_ULPI, | 286 | .portsc = MXC_EHCI_MODE_ULPI, |
288 | .flags = MXC_EHCI_POWER_PINS_ENABLED | MXC_EHCI_INTERFACE_DIFF_UNI, | 287 | .flags = MXC_EHCI_POWER_PINS_ENABLED | MXC_EHCI_INTERFACE_DIFF_UNI, |
289 | }; | 288 | }; |
@@ -320,7 +319,7 @@ static void __init pcm038_init(void) | |||
320 | spi_register_board_info(pcm038_spi_board_info, | 319 | spi_register_board_info(pcm038_spi_board_info, |
321 | ARRAY_SIZE(pcm038_spi_board_info)); | 320 | ARRAY_SIZE(pcm038_spi_board_info)); |
322 | 321 | ||
323 | mxc_register_device(&mxc_usbh2, &usbh2_pdata); | 322 | imx27_add_mxc_ehci_hs(2, &usbh2_pdata); |
324 | 323 | ||
325 | imx27_add_fec(NULL); | 324 | imx27_add_fec(NULL); |
326 | platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices)); | 325 | platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices)); |
diff --git a/arch/arm/plat-mxc/devices/Kconfig b/arch/arm/plat-mxc/devices/Kconfig index 6560cf5180b6..d2d096c44c4a 100644 --- a/arch/arm/plat-mxc/devices/Kconfig +++ b/arch/arm/plat-mxc/devices/Kconfig | |||
@@ -37,6 +37,9 @@ config IMX_HAVE_PLATFORM_MX1_CAMERA | |||
37 | config IMX_HAVE_PLATFORM_MX2_CAMERA | 37 | config IMX_HAVE_PLATFORM_MX2_CAMERA |
38 | bool | 38 | bool |
39 | 39 | ||
40 | config IMX_HAVE_PLATFORM_MXC_EHCI | ||
41 | bool | ||
42 | |||
40 | config IMX_HAVE_PLATFORM_MXC_MMC | 43 | config IMX_HAVE_PLATFORM_MXC_MMC |
41 | bool | 44 | bool |
42 | 45 | ||
diff --git a/arch/arm/plat-mxc/devices/Makefile b/arch/arm/plat-mxc/devices/Makefile index d2b7a9196ab4..c8734bd23cc4 100644 --- a/arch/arm/plat-mxc/devices/Makefile +++ b/arch/arm/plat-mxc/devices/Makefile | |||
@@ -11,6 +11,7 @@ obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_UART) += platform-imx-uart.o | |||
11 | obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_UDC) += platform-imx_udc.o | 11 | obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX_UDC) += platform-imx_udc.o |
12 | obj-$(CONFIG_IMX_HAVE_PLATFORM_MX1_CAMERA) += platform-mx1-camera.o | 12 | obj-$(CONFIG_IMX_HAVE_PLATFORM_MX1_CAMERA) += platform-mx1-camera.o |
13 | obj-$(CONFIG_IMX_HAVE_PLATFORM_MX2_CAMERA) += platform-mx2-camera.o | 13 | obj-$(CONFIG_IMX_HAVE_PLATFORM_MX2_CAMERA) += platform-mx2-camera.o |
14 | obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_EHCI) += platform-mxc-ehci.o | ||
14 | obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_MMC) += platform-mxc-mmc.o | 15 | obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_MMC) += platform-mxc-mmc.o |
15 | obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_NAND) += platform-mxc_nand.o | 16 | obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_NAND) += platform-mxc_nand.o |
16 | obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_PWM) += platform-mxc_pwm.o | 17 | obj-$(CONFIG_IMX_HAVE_PLATFORM_MXC_PWM) += platform-mxc_pwm.o |
diff --git a/arch/arm/plat-mxc/devices/platform-mxc-ehci.c b/arch/arm/plat-mxc/devices/platform-mxc-ehci.c new file mode 100644 index 000000000000..0cb67bb6e5b1 --- /dev/null +++ b/arch/arm/plat-mxc/devices/platform-mxc-ehci.c | |||
@@ -0,0 +1,46 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2010 Pengutronix | ||
3 | * Uwe Kleine-Koenig <u.kleine-koenig@pengutronix.de> | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify it under | ||
6 | * the terms of the GNU General Public License version 2 as published by the | ||
7 | * Free Software Foundation. | ||
8 | */ | ||
9 | #include <mach/hardware.h> | ||
10 | #include <mach/devices-common.h> | ||
11 | |||
12 | #define imx_mxc_ehci_data_entry_single(soc, _id, hs) \ | ||
13 | { \ | ||
14 | .id = _id, \ | ||
15 | .iobase = soc ## _USB_ ## hs ## _BASE_ADDR, \ | ||
16 | .irq = soc ## _INT_USB_ ## hs, \ | ||
17 | } | ||
18 | |||
19 | #ifdef CONFIG_SOC_IMX27 | ||
20 | const struct imx_mxc_ehci_data imx27_mxc_ehci_otg_data __initconst = | ||
21 | imx_mxc_ehci_data_entry_single(MX27, 0, OTG); | ||
22 | const struct imx_mxc_ehci_data imx27_mxc_ehci_hs_data[] __initconst = { | ||
23 | imx_mxc_ehci_data_entry_single(MX27, 1, HS1), | ||
24 | imx_mxc_ehci_data_entry_single(MX27, 2, HS2), | ||
25 | }; | ||
26 | #endif /* ifdef CONFIG_SOC_IMX27 */ | ||
27 | |||
28 | struct platform_device *__init imx_add_mxc_ehci( | ||
29 | const struct imx_mxc_ehci_data *data, | ||
30 | const struct mxc_usbh_platform_data *pdata) | ||
31 | { | ||
32 | struct resource res[] = { | ||
33 | { | ||
34 | .start = data->iobase, | ||
35 | .end = data->iobase + SZ_512 - 1, | ||
36 | .flags = IORESOURCE_MEM, | ||
37 | }, { | ||
38 | .start = data->irq, | ||
39 | .end = data->irq, | ||
40 | .flags = IORESOURCE_IRQ, | ||
41 | }, | ||
42 | }; | ||
43 | return imx_add_platform_device_dmamask("mxc-ehci", data->id, | ||
44 | res, ARRAY_SIZE(res), | ||
45 | pdata, sizeof(*pdata), DMA_BIT_MASK(32)); | ||
46 | } | ||
diff --git a/arch/arm/plat-mxc/include/mach/devices-common.h b/arch/arm/plat-mxc/include/mach/devices-common.h index bb3b29c7fc35..7df7a9f8c5ed 100644 --- a/arch/arm/plat-mxc/include/mach/devices-common.h +++ b/arch/arm/plat-mxc/include/mach/devices-common.h | |||
@@ -151,6 +151,16 @@ struct platform_device *__init imx_add_mx2_camera( | |||
151 | const struct imx_mx2_camera_data *data, | 151 | const struct imx_mx2_camera_data *data, |
152 | const struct mx2_camera_platform_data *pdata); | 152 | const struct mx2_camera_platform_data *pdata); |
153 | 153 | ||
154 | #include <mach/mxc_ehci.h> | ||
155 | struct imx_mxc_ehci_data { | ||
156 | int id; | ||
157 | resource_size_t iobase; | ||
158 | resource_size_t irq; | ||
159 | }; | ||
160 | struct platform_device *__init imx_add_mxc_ehci( | ||
161 | const struct imx_mxc_ehci_data *data, | ||
162 | const struct mxc_usbh_platform_data *pdata); | ||
163 | |||
154 | #include <mach/mmc.h> | 164 | #include <mach/mmc.h> |
155 | struct imx_mxc_mmc_data { | 165 | struct imx_mxc_mmc_data { |
156 | int id; | 166 | int id; |
diff --git a/arch/arm/plat-mxc/include/mach/mx27.h b/arch/arm/plat-mxc/include/mach/mx27.h index 2734d24e8e1c..45419b3a2d1e 100644 --- a/arch/arm/plat-mxc/include/mach/mx27.h +++ b/arch/arm/plat-mxc/include/mach/mx27.h | |||
@@ -64,8 +64,10 @@ | |||
64 | #define MX27_LCDC_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x21000) | 64 | #define MX27_LCDC_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x21000) |
65 | #define MX27_SLCDC_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x22000) | 65 | #define MX27_SLCDC_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x22000) |
66 | #define MX27_VPU_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x23000) | 66 | #define MX27_VPU_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x23000) |
67 | #define MX27_USBOTG_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x24000) | 67 | #define MX27_USB_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x24000) |
68 | #define MX27_OTG_BASE_ADDR MX27_USBOTG_BASE_ADDR | 68 | #define MX27_USB_OTG_BASE_ADDR (MX27_USB_BASE_ADDR + 0x0000) |
69 | #define MX27_USB_HS1_BASE_ADDR (MX27_USB_BASE_ADDR + 0x0200) | ||
70 | #define MX27_USB_HS2_BASE_ADDR (MX27_USB_BASE_ADDR + 0x0400) | ||
69 | #define MX27_SAHARA_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x25000) | 71 | #define MX27_SAHARA_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x25000) |
70 | #define MX27_EMMAPP_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x26000) | 72 | #define MX27_EMMAPP_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x26000) |
71 | #define MX27_EMMAPRP_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x26400) | 73 | #define MX27_EMMAPRP_BASE_ADDR (MX27_AIPI_BASE_ADDR + 0x26400) |
@@ -187,9 +189,9 @@ static inline void mx27_setup_weimcs(size_t cs, | |||
187 | #define MX27_INT_EMMAPRP 51 | 189 | #define MX27_INT_EMMAPRP 51 |
188 | #define MX27_INT_EMMAPP 52 | 190 | #define MX27_INT_EMMAPP 52 |
189 | #define MX27_INT_VPU 53 | 191 | #define MX27_INT_VPU 53 |
190 | #define MX27_INT_USB1 54 | 192 | #define MX27_INT_USB_HS1 54 |
191 | #define MX27_INT_USB2 55 | 193 | #define MX27_INT_USB_HS2 55 |
192 | #define MX27_INT_USB3 56 | 194 | #define MX27_INT_USB_OTG 56 |
193 | #define MX27_INT_SCC_SMN 57 | 195 | #define MX27_INT_SCC_SMN 57 |
194 | #define MX27_INT_SCC_SCM 58 | 196 | #define MX27_INT_SCC_SCM 58 |
195 | #define MX27_INT_SAHARA 59 | 197 | #define MX27_INT_SAHARA 59 |