]> git.karo-electronics.de Git - linux-beck.git/commitdiff
MX27: Add USB platform devices and resources
authorjavier Martin <javier.martin@vista-silicon.com>
Wed, 15 Jul 2009 13:26:21 +0000 (15:26 +0200)
committerSascha Hauer <s.hauer@pengutronix.de>
Fri, 7 Aug 2009 10:11:12 +0000 (12:11 +0200)
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>
arch/arm/mach-mx2/clock_imx27.c
arch/arm/mach-mx2/devices.c
arch/arm/mach-mx2/devices.h

index a0c577f80d4cba83bf5d388a4e83d75e0892fb7e..4089951acb4719420cda1d86af0655172b0c0b96 100644 (file)
@@ -643,7 +643,14 @@ static struct clk_lookup lookups[] = {
        _REGISTER_CLOCK(NULL, "cspi3", cspi3_clk)
        _REGISTER_CLOCK("imx-fb.0", NULL, lcdc_clk)
        _REGISTER_CLOCK(NULL, "csi", csi_clk)
-       _REGISTER_CLOCK(NULL, "usb", usb_clk)
+       _REGISTER_CLOCK("fsl-usb2-udc", "usb", usb_clk)
+       _REGISTER_CLOCK("fsl-usb2-udc", "usb_ahb", usb_clk1)
+       _REGISTER_CLOCK("mxc-ehci.0", "usb", usb_clk)
+       _REGISTER_CLOCK("mxc-ehci.0", "usb_ahb", usb_clk1)
+       _REGISTER_CLOCK("mxc-ehci.1", "usb", usb_clk)
+       _REGISTER_CLOCK("mxc-ehci.1", "usb_ahb", usb_clk1)
+       _REGISTER_CLOCK("mxc-ehci.2", "usb", usb_clk)
+       _REGISTER_CLOCK("mxc-ehci.2", "usb_ahb", usb_clk1)
        _REGISTER_CLOCK(NULL, "ssi1", ssi1_clk)
        _REGISTER_CLOCK(NULL, "ssi2", ssi2_clk)
        _REGISTER_CLOCK("mxc_nand.0", NULL, nfc_clk)
index cbf42467466dd5ce7ec1459006c51f63a08c5f0b..4ecf0977beb4b600fcac3dd4f5ded20cd70732df 100644 (file)
@@ -369,6 +369,98 @@ struct platform_device mxc_sdhc_device1 = {
        .resource       = mxc_sdhc2_resources,
 };
 
+static struct resource otg_resources[] = {
+       {
+               .start  = OTG_BASE_ADDR,
+               .end    = OTG_BASE_ADDR + 0x1ff,
+               .flags  = IORESOURCE_MEM,
+       }, {
+               .start  = MXC_INT_USB3,
+               .end    = MXC_INT_USB3,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static u64 otg_dmamask = 0xffffffffUL;
+
+/* OTG gadget device */
+struct platform_device mxc_otg_udc_device = {
+       .name           = "fsl-usb2-udc",
+       .id             = -1,
+       .dev            = {
+               .dma_mask               = &otg_dmamask,
+               .coherent_dma_mask      = 0xffffffffUL,
+       },
+       .resource       = otg_resources,
+       .num_resources  = ARRAY_SIZE(otg_resources),
+};
+
+/* OTG host */
+struct platform_device mxc_otg_host = {
+       .name = "mxc-ehci",
+       .id = 0,
+       .dev = {
+               .coherent_dma_mask = 0xffffffff,
+               .dma_mask = &otg_dmamask,
+       },
+       .resource = otg_resources,
+       .num_resources = ARRAY_SIZE(otg_resources),
+};
+
+/* USB host 1 */
+
+static u64 usbh1_dmamask = 0xffffffffUL;
+
+static struct resource mxc_usbh1_resources[] = {
+       {
+               .start = OTG_BASE_ADDR + 0x200,
+               .end = OTG_BASE_ADDR + 0x3ff,
+               .flags = IORESOURCE_MEM,
+       }, {
+               .start = MXC_INT_USB1,
+               .end = MXC_INT_USB1,
+               .flags = IORESOURCE_IRQ,
+       },
+};
+
+struct platform_device mxc_usbh1 = {
+       .name = "mxc-ehci",
+       .id = 1,
+       .dev = {
+               .coherent_dma_mask = 0xffffffff,
+               .dma_mask = &usbh1_dmamask,
+       },
+       .resource = mxc_usbh1_resources,
+       .num_resources = ARRAY_SIZE(mxc_usbh1_resources),
+};
+
+/* USB host 2 */
+static u64 usbh2_dmamask = 0xffffffffUL;
+
+static struct resource mxc_usbh2_resources[] = {
+       {
+               .start = OTG_BASE_ADDR + 0x400,
+               .end = OTG_BASE_ADDR + 0x5ff,
+               .flags = IORESOURCE_MEM,
+       }, {
+               .start = MXC_INT_USB2,
+               .end = MXC_INT_USB2,
+               .flags = IORESOURCE_IRQ,
+       },
+};
+
+struct platform_device mxc_usbh2 = {
+       .name = "mxc-ehci",
+       .id = 2,
+       .dev = {
+               .coherent_dma_mask = 0xffffffff,
+               .dma_mask = &usbh2_dmamask,
+       },
+       .resource = mxc_usbh2_resources,
+       .num_resources = ARRAY_SIZE(mxc_usbh2_resources),
+};
+
+
 /* GPIO port description */
 static struct mxc_gpio_port imx_gpio_ports[] = {
        {
index c79ba7fed1b7e2e2e79b70b68a6cb2326d4713fc..6e91b4e3509dbc9b316fde8af3eb55fb1d3d93c3 100644 (file)
@@ -19,3 +19,7 @@ extern struct platform_device mxc_i2c_device0;
 extern struct platform_device mxc_i2c_device1;
 extern struct platform_device mxc_sdhc_device0;
 extern struct platform_device mxc_sdhc_device1;
+extern struct platform_device mxc_otg_udc_device;
+extern struct platform_device mxc_otg_host;
+extern struct platform_device mxc_usbh1;
+extern struct platform_device mxc_usbh2;