diff options
Diffstat (limited to 'arch/arm/mach-mx2/devices.c')
-rw-r--r-- | arch/arm/mach-mx2/devices.c | 63 |
1 files changed, 44 insertions, 19 deletions
diff --git a/arch/arm/mach-mx2/devices.c b/arch/arm/mach-mx2/devices.c index a4b809b82fa3..b91e412f7b3e 100644 --- a/arch/arm/mach-mx2/devices.c +++ b/arch/arm/mach-mx2/devices.c | |||
@@ -31,6 +31,7 @@ | |||
31 | #include <linux/init.h> | 31 | #include <linux/init.h> |
32 | #include <linux/platform_device.h> | 32 | #include <linux/platform_device.h> |
33 | #include <linux/gpio.h> | 33 | #include <linux/gpio.h> |
34 | #include <linux/dma-mapping.h> | ||
34 | 35 | ||
35 | #include <mach/irqs.h> | 36 | #include <mach/irqs.h> |
36 | #include <mach/hardware.h> | 37 | #include <mach/hardware.h> |
@@ -197,7 +198,7 @@ struct platform_device mxc_fb_device = { | |||
197 | .num_resources = ARRAY_SIZE(mxc_fb), | 198 | .num_resources = ARRAY_SIZE(mxc_fb), |
198 | .resource = mxc_fb, | 199 | .resource = mxc_fb, |
199 | .dev = { | 200 | .dev = { |
200 | .coherent_dma_mask = 0xFFFFFFFF, | 201 | .coherent_dma_mask = DMA_BIT_MASK(32), |
201 | }, | 202 | }, |
202 | }; | 203 | }; |
203 | 204 | ||
@@ -267,9 +268,6 @@ struct platform_device mxc_pwm_device = { | |||
267 | .resource = mxc_pwm_resources, | 268 | .resource = mxc_pwm_resources, |
268 | }; | 269 | }; |
269 | 270 | ||
270 | /* | ||
271 | * Resource definition for the MXC SDHC | ||
272 | */ | ||
273 | #define DEFINE_MXC_MMC_DEVICE(n, baseaddr, irq, dmareq) \ | 271 | #define DEFINE_MXC_MMC_DEVICE(n, baseaddr, irq, dmareq) \ |
274 | static struct resource mxc_sdhc_resources ## n[] = { \ | 272 | static struct resource mxc_sdhc_resources ## n[] = { \ |
275 | { \ | 273 | { \ |
@@ -287,14 +285,14 @@ struct platform_device mxc_pwm_device = { | |||
287 | }, \ | 285 | }, \ |
288 | }; \ | 286 | }; \ |
289 | \ | 287 | \ |
290 | static u64 mxc_sdhc ## n ## _dmamask = 0xffffffffUL; \ | 288 | static u64 mxc_sdhc ## n ## _dmamask = DMA_BIT_MASK(32); \ |
291 | \ | 289 | \ |
292 | struct platform_device mxc_sdhc_device ## n = { \ | 290 | struct platform_device mxc_sdhc_device ## n = { \ |
293 | .name = "mxc-mmc", \ | 291 | .name = "mxc-mmc", \ |
294 | .id = n, \ | 292 | .id = n, \ |
295 | .dev = { \ | 293 | .dev = { \ |
296 | .dma_mask = &mxc_sdhc ## n ## _dmamask, \ | 294 | .dma_mask = &mxc_sdhc ## n ## _dmamask, \ |
297 | .coherent_dma_mask = 0xffffffff, \ | 295 | .coherent_dma_mask = DMA_BIT_MASK(32), \ |
298 | }, \ | 296 | }, \ |
299 | .num_resources = ARRAY_SIZE(mxc_sdhc_resources ## n), \ | 297 | .num_resources = ARRAY_SIZE(mxc_sdhc_resources ## n), \ |
300 | .resource = mxc_sdhc_resources ## n, \ | 298 | .resource = mxc_sdhc_resources ## n, \ |
@@ -316,18 +314,18 @@ static struct resource otg_resources[] = { | |||
316 | }, | 314 | }, |
317 | }; | 315 | }; |
318 | 316 | ||
319 | static u64 otg_dmamask = 0xffffffffUL; | 317 | static u64 otg_dmamask = DMA_BIT_MASK(32); |
320 | 318 | ||
321 | /* OTG gadget device */ | 319 | /* OTG gadget device */ |
322 | struct platform_device mxc_otg_udc_device = { | 320 | struct platform_device mxc_otg_udc_device = { |
323 | .name = "fsl-usb2-udc", | 321 | .name = "fsl-usb2-udc", |
324 | .id = -1, | 322 | .id = -1, |
325 | .dev = { | 323 | .dev = { |
326 | .dma_mask = &otg_dmamask, | 324 | .dma_mask = &otg_dmamask, |
327 | .coherent_dma_mask = 0xffffffffUL, | 325 | .coherent_dma_mask = DMA_BIT_MASK(32), |
328 | }, | 326 | }, |
329 | .resource = otg_resources, | 327 | .resource = otg_resources, |
330 | .num_resources = ARRAY_SIZE(otg_resources), | 328 | .num_resources = ARRAY_SIZE(otg_resources), |
331 | }; | 329 | }; |
332 | 330 | ||
333 | /* OTG host */ | 331 | /* OTG host */ |
@@ -335,7 +333,7 @@ struct platform_device mxc_otg_host = { | |||
335 | .name = "mxc-ehci", | 333 | .name = "mxc-ehci", |
336 | .id = 0, | 334 | .id = 0, |
337 | .dev = { | 335 | .dev = { |
338 | .coherent_dma_mask = 0xffffffff, | 336 | .coherent_dma_mask = DMA_BIT_MASK(32), |
339 | .dma_mask = &otg_dmamask, | 337 | .dma_mask = &otg_dmamask, |
340 | }, | 338 | }, |
341 | .resource = otg_resources, | 339 | .resource = otg_resources, |
@@ -344,7 +342,7 @@ struct platform_device mxc_otg_host = { | |||
344 | 342 | ||
345 | /* USB host 1 */ | 343 | /* USB host 1 */ |
346 | 344 | ||
347 | static u64 usbh1_dmamask = 0xffffffffUL; | 345 | static u64 usbh1_dmamask = DMA_BIT_MASK(32); |
348 | 346 | ||
349 | static struct resource mxc_usbh1_resources[] = { | 347 | static struct resource mxc_usbh1_resources[] = { |
350 | { | 348 | { |
@@ -362,7 +360,7 @@ struct platform_device mxc_usbh1 = { | |||
362 | .name = "mxc-ehci", | 360 | .name = "mxc-ehci", |
363 | .id = 1, | 361 | .id = 1, |
364 | .dev = { | 362 | .dev = { |
365 | .coherent_dma_mask = 0xffffffff, | 363 | .coherent_dma_mask = DMA_BIT_MASK(32), |
366 | .dma_mask = &usbh1_dmamask, | 364 | .dma_mask = &usbh1_dmamask, |
367 | }, | 365 | }, |
368 | .resource = mxc_usbh1_resources, | 366 | .resource = mxc_usbh1_resources, |
@@ -370,7 +368,7 @@ struct platform_device mxc_usbh1 = { | |||
370 | }; | 368 | }; |
371 | 369 | ||
372 | /* USB host 2 */ | 370 | /* USB host 2 */ |
373 | static u64 usbh2_dmamask = 0xffffffffUL; | 371 | static u64 usbh2_dmamask = DMA_BIT_MASK(32); |
374 | 372 | ||
375 | static struct resource mxc_usbh2_resources[] = { | 373 | static struct resource mxc_usbh2_resources[] = { |
376 | { | 374 | { |
@@ -388,7 +386,7 @@ struct platform_device mxc_usbh2 = { | |||
388 | .name = "mxc-ehci", | 386 | .name = "mxc-ehci", |
389 | .id = 2, | 387 | .id = 2, |
390 | .dev = { | 388 | .dev = { |
391 | .coherent_dma_mask = 0xffffffff, | 389 | .coherent_dma_mask = DMA_BIT_MASK(32), |
392 | .dma_mask = &usbh2_dmamask, | 390 | .dma_mask = &usbh2_dmamask, |
393 | }, | 391 | }, |
394 | .resource = mxc_usbh2_resources, | 392 | .resource = mxc_usbh2_resources, |
@@ -481,3 +479,30 @@ int __init mxc_register_gpios(void) | |||
481 | #endif | 479 | #endif |
482 | return 0; | 480 | return 0; |
483 | } | 481 | } |
482 | |||
483 | #ifdef CONFIG_MACH_MX21 | ||
484 | static struct resource mx21_usbhc_resources[] = { | ||
485 | { | ||
486 | .start = MX21_BASE_ADDR, | ||
487 | .end = MX21_BASE_ADDR + 0x1FFF, | ||
488 | .flags = IORESOURCE_MEM, | ||
489 | }, | ||
490 | { | ||
491 | .start = MX21_INT_USBHOST, | ||
492 | .end = MX21_INT_USBHOST, | ||
493 | .flags = IORESOURCE_IRQ, | ||
494 | }, | ||
495 | }; | ||
496 | |||
497 | struct platform_device mx21_usbhc_device = { | ||
498 | .name = "imx21-hcd", | ||
499 | .id = 0, | ||
500 | .dev = { | ||
501 | .dma_mask = &mx21_usbhc_device.dev.coherent_dma_mask, | ||
502 | .coherent_dma_mask = DMA_BIT_MASK(32), | ||
503 | }, | ||
504 | .num_resources = ARRAY_SIZE(mx21_usbhc_resources), | ||
505 | .resource = mx21_usbhc_resources, | ||
506 | }; | ||
507 | #endif | ||
508 | |||