]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commitdiff
tegra: usb: phy: Pullup HSIC strobe at idle
authorVinayak Pane <vpane@nvidia.com>
Wed, 14 Dec 2011 04:34:30 +0000 (20:34 -0800)
committerDan Willemsen <dwillemsen@nvidia.com>
Sat, 14 Sep 2013 08:14:53 +0000 (01:14 -0700)
Correcting the strobe and SOFs behaviour. This avoids run-stop
bit to start before actual bus_reset. Also, pullup the
strobe signal during idle and wait for connect detect
after bus idle.

Bug 898008
Bug 922444

Reviewed-on: http://git-master/r/73261

Change-Id: I01999521013677f159ee9c12f2d7bcb453c3b39d
Signed-off-by: Vinayak Pane <vpane@nvidia.com>
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
Reviewed-on: http://git-master/r/77748
Reviewed-by: Automatic_Commit_Validation_User
Rebase-Id: R90d0a646111b295a583b33b08c10d1408ed3f703

drivers/usb/host/ehci-tegra.c
drivers/usb/phy/phy-tegra-usb.c

index 508d3e555addceece9dff4a56b076b6a72f5cc23..bb80f1c4bbedf060f2441618ca6cde883b7b860b 100644 (file)
@@ -483,7 +483,11 @@ static void tegra_ehci_restart(struct usb_hcd *hcd, bool is_dpd)
        ehci_writel(ehci, (u32)ehci->async->qh_dma, &ehci->regs->async_next);
        /* setup the command register and set the controller in RUN mode */
        ehci->command &= ~(CMD_LRESET|CMD_IAAD|CMD_PSE|CMD_ASE|CMD_RESET);
-       ehci->command |= CMD_RUN;
+#ifndef CONFIG_ARCH_TEGRA_2x_SOC
+       /* dont start RS here for HSIC, it will be set by bus_reset */
+       if (tegra->phy->usb_phy_type != TEGRA_USB_PHY_TYPE_HSIC)
+#endif
+               ehci->command |= CMD_RUN;
        ehci_writel(ehci, ehci->command, &ehci->regs->command);
 
        /* Enable the root Port Power */
index 26f53d1f3e7bc484a066a1c63a983788b2d6d51a..b2d34e648e27ee0c62aa008e9b2fad83ad0d9e61 100644 (file)
@@ -2850,14 +2850,26 @@ int tegra_usb_phy_bus_idle(struct tegra_usb_phy *phy)
 
                val = readl(base + UHSIC_PADS_CFG1);
                val &= ~UHSIC_RPD_STROBE;
-#ifdef CONFIG_ARCH_TEGRA_2x_SOC
+               /* safe to enable RPU on STROBE at all times during idle */
                val |= UHSIC_RPU_STROBE;
-#endif
                writel(val, base + UHSIC_PADS_CFG1);
 
+               val = readl(base + USB_USBCMD);
+               val &= ~USB_USBCMD_RS;
+               writel(val, base + USB_USBCMD);
+
                if (uhsic_config->usb_phy_ready &&
                                        uhsic_config->usb_phy_ready())
                        return -EAGAIN;
+
+               /* wait for connect detect */
+               if (utmi_wait_register(base + UHSIC_STAT_CFG0,
+                           UHSIC_CONNECT_DETECT, UHSIC_CONNECT_DETECT) < 0) {
+                       pr_err("%s: timeout waiting for hsic connect detect\n",
+                               __func__);
+                       return -ETIMEDOUT;
+               }
+
        }
        return 0;
 }