aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-mx2
diff options
context:
space:
mode:
authorjavier Martin <javier.martin@vista-silicon.com>2009-07-15 09:26:21 -0400
committerSascha Hauer <s.hauer@pengutronix.de>2009-08-07 06:11:12 -0400
commit627fb3b9d260cb413d0ea2d179e319a20e2bd82b (patch)
treed7c86333c3ac55be48669c3e397b619c5d207b38 /arch/arm/mach-mx2
parent88e29a8d21fb9687ad6972a44571b295acaf0d74 (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.c9
-rw-r--r--arch/arm/mach-mx2/devices.c92
-rw-r--r--arch/arm/mach-mx2/devices.h4
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
372static 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
384static u64 otg_dmamask = 0xffffffffUL;
385
386/* OTG gadget device */
387struct 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 */
399struct 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
412static u64 usbh1_dmamask = 0xffffffffUL;
413
414static 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
426struct 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 */
438static u64 usbh2_dmamask = 0xffffffffUL;
439
440static 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
452struct 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 */
373static struct mxc_gpio_port imx_gpio_ports[] = { 465static 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;
19extern struct platform_device mxc_i2c_device1; 19extern struct platform_device mxc_i2c_device1;
20extern struct platform_device mxc_sdhc_device0; 20extern struct platform_device mxc_sdhc_device0;
21extern struct platform_device mxc_sdhc_device1; 21extern struct platform_device mxc_sdhc_device1;
22extern struct platform_device mxc_otg_udc_device;
23extern struct platform_device mxc_otg_host;
24extern struct platform_device mxc_usbh1;
25extern struct platform_device mxc_usbh2;