[ARM] tegra: stingray: Add USB host devices
authorBenoit Goby <benoit@android.com>
Mon, 12 Jul 2010 22:31:22 +0000 (15:31 -0700)
committerColin Cross <ccross@android.com>
Wed, 6 Oct 2010 23:33:20 +0000 (16:33 -0700)
Change-Id: I6775193fa1c8f7ddf3bb38d0addc29b8e5dbac2d
Signed-off-by: Benoit Goby <benoit@android.com>
arch/arm/mach-tegra/board-stingray.c
arch/arm/mach-tegra/tegra2_clocks.c

index 9410c8be5730878318879395f7f3c8bd1a1cd5df..1bf1127fced163ea75cd00d8274049de480e3325 100644 (file)
@@ -182,10 +182,9 @@ static struct platform_device hs_uarte = {
 };
 
 /* OTG gadget device */
-static u64 tegra_otg_dmamask = DMA_BIT_MASK(32);
+static u64 tegra_gadget_dmamask = DMA_BIT_MASK(32);
 
-
-static struct resource tegra_otg_resources[] = {
+static struct resource tegra_gadget_resources[] = {
        [0] = {
                .start  = TEGRA_USB_BASE,
                .end    = TEGRA_USB_BASE + TEGRA_USB_SIZE - 1,
@@ -198,21 +197,117 @@ static struct resource tegra_otg_resources[] = {
        },
 };
 
-static struct fsl_usb2_platform_data tegra_otg_pdata = {
+static struct fsl_usb2_platform_data tegra_gadget_pdata = {
        .operating_mode = FSL_USB2_DR_DEVICE,
        .phy_mode       = FSL_USB2_PHY_UTMI,
 };
 
-static struct platform_device tegra_otg = {
+static struct platform_device tegra_gadget = {
        .name = "fsl-tegra-udc",
        .id   = -1,
        .dev  = {
-               .dma_mask               = &tegra_otg_dmamask,
+               .dma_mask               = &tegra_gadget_dmamask,
                .coherent_dma_mask      = 0xffffffff,
-               .platform_data = &tegra_otg_pdata,
+               .platform_data = &tegra_gadget_pdata,
+       },
+       .resource = tegra_gadget_resources,
+       .num_resources = ARRAY_SIZE(tegra_gadget_resources),
+};
+
+/* OTG transceiver */
+static struct resource cpcap_otg_resources[] = {
+       [0] = {
+               .start  = TEGRA_USB_BASE,
+               .end    = TEGRA_USB_BASE + TEGRA_USB_SIZE - 1,
+               .flags  = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start  = INT_USB,
+               .end    = INT_USB,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device cpcap_otg = {
+       .name = "cpcap-otg",
+       .id   = -1,
+       .resource = cpcap_otg_resources,
+       .num_resources = ARRAY_SIZE(cpcap_otg_resources),
+};
+
+/* USB host devices */
+static u64 tegra_hcd_dmamask = DMA_BIT_MASK(32);
+
+static struct resource tegra_hcd_resources[][2] = {
+       [0] = {
+               [0] = {
+                       .flags = IORESOURCE_MEM,
+                       .start = TEGRA_USB_BASE,
+                       .end = TEGRA_USB_BASE + TEGRA_USB_SIZE - 1,
+               },
+               [1] = {
+                       .flags = IORESOURCE_IRQ,
+                       .start = INT_USB,
+                       .end = INT_USB,
+               },
+       },
+       [1] = {
+               [0] = {
+                       .flags = IORESOURCE_MEM,
+                       .start = TEGRA_USB2_BASE,
+                       .end = TEGRA_USB2_BASE + TEGRA_USB2_SIZE - 1,
+               },
+               [1] = {
+                       .flags = IORESOURCE_IRQ,
+                       .start = INT_USB2,
+                       .end = INT_USB2,
+               },
+       },
+       [2] = {
+               [0] = {
+                       .flags = IORESOURCE_MEM,
+                       .start = TEGRA_USB3_BASE,
+                       .end = TEGRA_USB3_BASE + TEGRA_USB3_SIZE - 1,
+               },
+               [1] = {
+                       .flags = IORESOURCE_IRQ,
+                       .start = INT_USB3,
+                       .end = INT_USB3,
+               },
+       },
+};
+
+static struct platform_device tegra_hcd[] = {
+       [0] = {
+               .name = "tegra-ehci",
+               .id = 0,
+               .dev = {
+                       .coherent_dma_mask = DMA_BIT_MASK(32),
+                       .dma_mask = &tegra_hcd_dmamask,
+               },
+               .resource = tegra_hcd_resources[0],
+               .num_resources = ARRAY_SIZE(tegra_hcd_resources[0]),
+       },
+       [1] = {
+               .name = "tegra-ehci",
+               .id = 1,
+               .dev = {
+                       .coherent_dma_mask = DMA_BIT_MASK(32),
+                       .dma_mask = &tegra_hcd_dmamask,
+               },
+               .resource = tegra_hcd_resources[1],
+               .num_resources = ARRAY_SIZE(tegra_hcd_resources[1]),
+       },
+       [2] = {
+               .name = "tegra-ehci",
+               .id = 2,
+               .dev = {
+                       .coherent_dma_mask = DMA_BIT_MASK(32),
+                       .dma_mask = &tegra_hcd_dmamask,
+               },
+               .resource = tegra_hcd_resources[2],
+               .num_resources = ARRAY_SIZE(tegra_hcd_resources[2]),
        },
-       .resource = tegra_otg_resources,
-       .num_resources = ARRAY_SIZE(tegra_otg_resources),
 };
 
 static char *usb_functions[] = { "mtp" };
@@ -378,7 +473,10 @@ static struct tegra_w1_platform_data tegra_w1_pdata = {
 
 static struct platform_device *stingray_devices[] __initdata = {
        &debug_uart,
-       &tegra_otg,
+       &cpcap_otg,
+       &tegra_gadget,
+       &tegra_hcd[0],
+       &tegra_hcd[2],
        &bq24617_device,
        &bcm4329_rfkill,
        &hs_uarta,
index 59ca5b0ec412d0c529009b0304951d24d648d401..5e32c0efb87f2f283736cf4c54dc2aa552602cb6 100644 (file)
@@ -1868,6 +1868,7 @@ struct clk_duplicate tegra_clk_duplicates[] = {
        CLK_DUPLICATE("pwm", "tegra_pwm.1", NULL),
        CLK_DUPLICATE("pwm", "tegra_pwm.2", NULL),
        CLK_DUPLICATE("pwm", "tegra_pwm.3", NULL),
+       CLK_DUPLICATE("usbd", "cpcap-otg", NULL),
 };
 
 #define CLK(dev, con, ck)      \