arm: tegra: usb: Enable Host mode on USB2-UTMI port
Suresh Mangipudi [Fri, 11 Feb 2011 06:02:08 +0000 (11:02 +0530)]
Enable the host mode on usb2 UTMI phy interface

Bug 787810

Original-Change-Id: Ia7da2a0d196f900f80812b987c9fb5302412e751
Reviewed-on: http://git-master/r/18729
Reviewed-by: Suresh Mangipudi <smangipudi@nvidia.com>
Tested-by: Suresh Mangipudi <smangipudi@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
Original-Change-Id: I2e7306b82926f2ca566d595dc75252d4881306fb

Rebase-Id: R0ad349bfa552a877c7df80e7aa093b73f7a2ad21

arch/arm/mach-tegra/board-cardhu.c

index 4e22c3a..ac37375 100644 (file)
@@ -52,7 +52,6 @@
 #include "gpio-names.h"
 #include "fuse.h"
 
-#define ENABLE_USB_HOST 0
 
 static struct plat_serial8250_port debug_uart_platform_data[] = {
        {
@@ -93,19 +92,21 @@ static struct tegra_utmip_config utmi_phy_config[] = {
                        .idle_wait_delay = 17,
                        .elastic_limit = 16,
                        .term_range_adj = 6,
+                       .xcvr_setup = 15,
+                       .xcvr_lsfslew = 2,
+                       .xcvr_lsrslew = 2,
+       },
+       [2] = {
+                       .hssync_start_delay = 0,
+                       .idle_wait_delay = 17,
+                       .elastic_limit = 16,
+                       .term_range_adj = 6,
                        .xcvr_setup = 8,
                        .xcvr_lsfslew = 2,
                        .xcvr_lsrslew = 2,
        },
 };
 
-/* !!!TODO: Change for cardhu (Taken from Ventana) */
-static struct tegra_ulpi_config ulpi_phy_config = {
-       /* !!!TODO!!! CABLE DETECT? if so GPIO_PC7 on cardhu */
-       .reset_gpio = TEGRA_GPIO_PG2,
-       .clk = "clk_dev2",
-};
-
 #ifdef CONFIG_BCM4329_RFKILL
 static struct resource cardhu_bcm4329_rfkill_resources[] = {
        {
@@ -155,17 +156,6 @@ static __initdata struct tegra_clk_init_table cardhu_clk_init_table[] = {
        { NULL,         NULL,           0,              0},
 };
 
-static struct tegra_ulpi_config cardhu_ehci2_ulpi_phy_config = {
-       .reset_gpio = TEGRA_GPIO_PV1,
-       .clk = "clk_dev2",
-};
-
-static struct tegra_ehci_platform_data cardhu_ehci2_ulpi_platform_data = {
-       .operating_mode = TEGRA_USB_HOST,
-       .power_down_on_bus_suspend = 0,
-       .phy_config = &cardhu_ehci2_ulpi_phy_config,
-};
-
 static struct tegra_i2c_platform_data cardhu_i2c1_platform_data = {
        .adapter_nr     = 0,
        .bus_count      = 1,
@@ -246,9 +236,6 @@ static struct platform_device *cardhu_devices[] __initdata = {
        &pmu_device,
        &tegra_rtc_device,
        &tegra_udc_device,
-#if ENABLE_USB_HOST
-       &tegra_ehci2_device,
-#endif
 #if defined(CONFIG_SND_HDA_TEGRA)
        &tegra_hda_device,
 #endif
@@ -271,16 +258,19 @@ static struct tegra_ehci_platform_data tegra_ehci_pdata[] = {
                        .phy_config = &utmi_phy_config[0],
                        .operating_mode = TEGRA_USB_HOST,
                        .power_down_on_bus_suspend = 0,
+                       .usb_phy_type = TEGRA_USB_PHY_TYPE_UTMIP,
        },
        [1] = {
-                       .phy_config = &ulpi_phy_config,
+                       .phy_config = &utmi_phy_config[1],
                        .operating_mode = TEGRA_USB_HOST,
-                       .power_down_on_bus_suspend = 1,
+                       .power_down_on_bus_suspend = 0,
+                       .usb_phy_type = TEGRA_USB_PHY_TYPE_UTMIP,
        },
        [2] = {
-                       .phy_config = &utmi_phy_config[1],
+                       .phy_config = &utmi_phy_config[2],
                        .operating_mode = TEGRA_USB_HOST,
                        .power_down_on_bus_suspend = 0,
+                       .usb_phy_type = TEGRA_USB_PHY_TYPE_UTMIP,
        },
 };
 
@@ -341,6 +331,9 @@ static void cardhu_usb_init(void)
        tegra_otg_device.dev.platform_data = &tegra_otg_pdata;
        platform_device_register(&tegra_otg_device);
 
+       tegra_ehci2_device.dev.platform_data = &tegra_ehci_pdata[1];
+       platform_device_register(&tegra_ehci2_device);
+
        tegra_ehci3_device.dev.platform_data = &tegra_ehci_pdata[2];
        platform_device_register(&tegra_ehci3_device);
 }
@@ -365,8 +358,6 @@ static void __init tegra_cardhu_init(void)
        tegra_clk_init_from_table(cardhu_clk_init_table);
        cardhu_pinmux_init();
 
-       tegra_ehci2_device.dev.platform_data
-               = &cardhu_ehci2_ulpi_platform_data;
        platform_add_devices(cardhu_devices, ARRAY_SIZE(cardhu_devices));
 
        cardhu_sdhci_init();