diff options
author | javier Martin <javier.martin@vista-silicon.com> | 2009-07-15 09:26:21 -0400 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2009-08-07 06:11:12 -0400 |
commit | 627fb3b9d260cb413d0ea2d179e319a20e2bd82b (patch) | |
tree | d7c86333c3ac55be48669c3e397b619c5d207b38 /arch/arm/mach-mx2 | |
parent | 88e29a8d21fb9687ad6972a44571b295acaf0d74 (diff) |
MX27: Add USB platform devices and resources
This adds clocks and resources for usb in i.mx27 SoC.
Signed-off-by: Javier Martin <javier.martin@vista-silicon.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/mach-mx2')
-rw-r--r-- | arch/arm/mach-mx2/clock_imx27.c | 9 | ||||
-rw-r--r-- | arch/arm/mach-mx2/devices.c | 92 | ||||
-rw-r--r-- | arch/arm/mach-mx2/devices.h | 4 |
3 files changed, 104 insertions, 1 deletions
diff --git a/arch/arm/mach-mx2/clock_imx27.c b/arch/arm/mach-mx2/clock_imx27.c index a0c577f80d4c..4089951acb47 100644 --- a/arch/arm/mach-mx2/clock_imx27.c +++ b/arch/arm/mach-mx2/clock_imx27.c | |||
@@ -643,7 +643,14 @@ static struct clk_lookup lookups[] = { | |||
643 | _REGISTER_CLOCK(NULL, "cspi3", cspi3_clk) | 643 | _REGISTER_CLOCK(NULL, "cspi3", cspi3_clk) |
644 | _REGISTER_CLOCK("imx-fb.0", NULL, lcdc_clk) | 644 | _REGISTER_CLOCK("imx-fb.0", NULL, lcdc_clk) |
645 | _REGISTER_CLOCK(NULL, "csi", csi_clk) | 645 | _REGISTER_CLOCK(NULL, "csi", csi_clk) |
646 | _REGISTER_CLOCK(NULL, "usb", usb_clk) | 646 | _REGISTER_CLOCK("fsl-usb2-udc", "usb", usb_clk) |
647 | _REGISTER_CLOCK("fsl-usb2-udc", "usb_ahb", usb_clk1) | ||
648 | _REGISTER_CLOCK("mxc-ehci.0", "usb", usb_clk) | ||
649 | _REGISTER_CLOCK("mxc-ehci.0", "usb_ahb", usb_clk1) | ||
650 | _REGISTER_CLOCK("mxc-ehci.1", "usb", usb_clk) | ||
651 | _REGISTER_CLOCK("mxc-ehci.1", "usb_ahb", usb_clk1) | ||
652 | _REGISTER_CLOCK("mxc-ehci.2", "usb", usb_clk) | ||
653 | _REGISTER_CLOCK("mxc-ehci.2", "usb_ahb", usb_clk1) | ||
647 | _REGISTER_CLOCK(NULL, "ssi1", ssi1_clk) | 654 | _REGISTER_CLOCK(NULL, "ssi1", ssi1_clk) |
648 | _REGISTER_CLOCK(NULL, "ssi2", ssi2_clk) | 655 | _REGISTER_CLOCK(NULL, "ssi2", ssi2_clk) |
649 | _REGISTER_CLOCK("mxc_nand.0", NULL, nfc_clk) | 656 | _REGISTER_CLOCK("mxc_nand.0", NULL, nfc_clk) |
diff --git a/arch/arm/mach-mx2/devices.c b/arch/arm/mach-mx2/devices.c index cbf42467466d..4ecf0977beb4 100644 --- a/arch/arm/mach-mx2/devices.c +++ b/arch/arm/mach-mx2/devices.c | |||
@@ -369,6 +369,98 @@ struct platform_device mxc_sdhc_device1 = { | |||
369 | .resource = mxc_sdhc2_resources, | 369 | .resource = mxc_sdhc2_resources, |
370 | }; | 370 | }; |
371 | 371 | ||
372 | static struct resource otg_resources[] = { | ||
373 | { | ||
374 | .start = OTG_BASE_ADDR, | ||
375 | .end = OTG_BASE_ADDR + 0x1ff, | ||
376 | .flags = IORESOURCE_MEM, | ||
377 | }, { | ||
378 | .start = MXC_INT_USB3, | ||
379 | .end = MXC_INT_USB3, | ||
380 | .flags = IORESOURCE_IRQ, | ||
381 | }, | ||
382 | }; | ||
383 | |||
384 | static u64 otg_dmamask = 0xffffffffUL; | ||
385 | |||
386 | /* OTG gadget device */ | ||
387 | struct platform_device mxc_otg_udc_device = { | ||
388 | .name = "fsl-usb2-udc", | ||
389 | .id = -1, | ||
390 | .dev = { | ||
391 | .dma_mask = &otg_dmamask, | ||
392 | .coherent_dma_mask = 0xffffffffUL, | ||
393 | }, | ||
394 | .resource = otg_resources, | ||
395 | .num_resources = ARRAY_SIZE(otg_resources), | ||
396 | }; | ||
397 | |||
398 | /* OTG host */ | ||
399 | struct platform_device mxc_otg_host = { | ||
400 | .name = "mxc-ehci", | ||
401 | .id = 0, | ||
402 | .dev = { | ||
403 | .coherent_dma_mask = 0xffffffff, | ||
404 | .dma_mask = &otg_dmamask, | ||
405 | }, | ||
406 | .resource = otg_resources, | ||
407 | .num_resources = ARRAY_SIZE(otg_resources), | ||
408 | }; | ||
409 | |||
410 | /* USB host 1 */ | ||
411 | |||
412 | static u64 usbh1_dmamask = 0xffffffffUL; | ||
413 | |||
414 | static struct resource mxc_usbh1_resources[] = { | ||
415 | { | ||
416 | .start = OTG_BASE_ADDR + 0x200, | ||
417 | .end = OTG_BASE_ADDR + 0x3ff, | ||
418 | .flags = IORESOURCE_MEM, | ||
419 | }, { | ||
420 | .start = MXC_INT_USB1, | ||
421 | .end = MXC_INT_USB1, | ||
422 | .flags = IORESOURCE_IRQ, | ||
423 | }, | ||
424 | }; | ||
425 | |||
426 | struct platform_device mxc_usbh1 = { | ||
427 | .name = "mxc-ehci", | ||
428 | .id = 1, | ||
429 | .dev = { | ||
430 | .coherent_dma_mask = 0xffffffff, | ||
431 | .dma_mask = &usbh1_dmamask, | ||
432 | }, | ||
433 | .resource = mxc_usbh1_resources, | ||
434 | .num_resources = ARRAY_SIZE(mxc_usbh1_resources), | ||
435 | }; | ||
436 | |||
437 | /* USB host 2 */ | ||
438 | static u64 usbh2_dmamask = 0xffffffffUL; | ||
439 | |||
440 | static struct resource mxc_usbh2_resources[] = { | ||
441 | { | ||
442 | .start = OTG_BASE_ADDR + 0x400, | ||
443 | .end = OTG_BASE_ADDR + 0x5ff, | ||
444 | .flags = IORESOURCE_MEM, | ||
445 | }, { | ||
446 | .start = MXC_INT_USB2, | ||
447 | .end = MXC_INT_USB2, | ||
448 | .flags = IORESOURCE_IRQ, | ||
449 | }, | ||
450 | }; | ||
451 | |||
452 | struct platform_device mxc_usbh2 = { | ||
453 | .name = "mxc-ehci", | ||
454 | .id = 2, | ||
455 | .dev = { | ||
456 | .coherent_dma_mask = 0xffffffff, | ||
457 | .dma_mask = &usbh2_dmamask, | ||
458 | }, | ||
459 | .resource = mxc_usbh2_resources, | ||
460 | .num_resources = ARRAY_SIZE(mxc_usbh2_resources), | ||
461 | }; | ||
462 | |||
463 | |||
372 | /* GPIO port description */ | 464 | /* GPIO port description */ |
373 | static struct mxc_gpio_port imx_gpio_ports[] = { | 465 | static struct mxc_gpio_port imx_gpio_ports[] = { |
374 | { | 466 | { |
diff --git a/arch/arm/mach-mx2/devices.h b/arch/arm/mach-mx2/devices.h index c79ba7fed1b7..6e91b4e3509d 100644 --- a/arch/arm/mach-mx2/devices.h +++ b/arch/arm/mach-mx2/devices.h | |||
@@ -19,3 +19,7 @@ extern struct platform_device mxc_i2c_device0; | |||
19 | extern struct platform_device mxc_i2c_device1; | 19 | extern struct platform_device mxc_i2c_device1; |
20 | extern struct platform_device mxc_sdhc_device0; | 20 | extern struct platform_device mxc_sdhc_device0; |
21 | extern struct platform_device mxc_sdhc_device1; | 21 | extern struct platform_device mxc_sdhc_device1; |
22 | extern struct platform_device mxc_otg_udc_device; | ||
23 | extern struct platform_device mxc_otg_host; | ||
24 | extern struct platform_device mxc_usbh1; | ||
25 | extern struct platform_device mxc_usbh2; | ||