summaryrefslogtreecommitdiff
path: root/arch/arm/mach-tegra/tegra3_usb_phy.c
diff options
context:
space:
mode:
authorVinod Atyam <vatyam@nvidia.com>2012-08-17 14:33:47 +0530
committerSimone Willett <swillett@nvidia.com>2012-08-21 14:09:40 -0700
commit6e32ab70de901e3a30fc269a2758f958c2c40abb (patch)
treebc29b056d6b51cb3bb24de4e2e6de55b805e73d7 /arch/arm/mach-tegra/tegra3_usb_phy.c
parentc7b8e1d6e46bd788d0d360c9fb9087f14a70c8bb (diff)
ARM: tegra: usb_phy: Fix HSIC resume code
1) During remote wakeup resume, no need to keep 25 msec delay after resume bit is cleared. Updated the code now. 2) PSPD bit in HOSTPC register is read only, but bymistake it is getting set in our code. Corrected the code now. 3) During AP resume, no need to set RUN bit 2 times. Corrected the code to do it once. Bug 1028940 Bug 1024592 Change-Id: I872886f4cef6058d3de9d488321aa5b0925fd62a Signed-off-by: Vinod Atyam <vatyam@nvidia.com> Reviewed-on: http://git-master/r/124051 Reviewed-by: Simone Willett <swillett@nvidia.com> Tested-by: Simone Willett <swillett@nvidia.com>
Diffstat (limited to 'arch/arm/mach-tegra/tegra3_usb_phy.c')
-rw-r--r--arch/arm/mach-tegra/tegra3_usb_phy.c41
1 files changed, 14 insertions, 27 deletions
diff --git a/arch/arm/mach-tegra/tegra3_usb_phy.c b/arch/arm/mach-tegra/tegra3_usb_phy.c
index b02e9b646284..1020e5d35f89 100644
--- a/arch/arm/mach-tegra/tegra3_usb_phy.c
+++ b/arch/arm/mach-tegra/tegra3_usb_phy.c
@@ -2060,16 +2060,11 @@ static void uhsic_phy_restore_start(struct tegra_usb_phy *phy)
/* check whether we wake up from the remote resume */
if (UHSIC_WALK_PTR_VAL & val) {
phy->remote_wakeup = true;
- pr_info("%s: uhsic remote wakeup detected\n", __func__);
} else {
- if (!((UHSIC_STROBE_VAL_P0 | UHSIC_DATA_VAL_P0) & val)) {
- uhsic_phy_disable_pmc_bus_ctrl(phy);
- } else {
- DBG("%s(%d): setting pretend connect\n", __func__, __LINE__);
- val = readl(base + UHSIC_CMD_CFG0);
- val |= UHSIC_PRETEND_CONNECT_DETECT;
- writel(val, base + UHSIC_CMD_CFG0);
- }
+ DBG("%s(%d): setting pretend connect\n", __func__, __LINE__);
+ val = readl(base + UHSIC_CMD_CFG0);
+ val |= UHSIC_PRETEND_CONNECT_DETECT;
+ writel(val, base + UHSIC_CMD_CFG0);
}
}
@@ -2096,8 +2091,6 @@ static void uhsic_phy_restore_end(struct tegra_usb_phy *phy)
wait_time_us--;
} while (val & (USB_PORTSC_RESUME | USB_PORTSC_SUSP));
- /* wait for 25 ms to port resume complete */
- msleep(25);
/* disable PMC master control */
uhsic_phy_disable_pmc_bus_ctrl(phy);
@@ -2110,19 +2103,19 @@ static void uhsic_phy_restore_end(struct tegra_usb_phy *phy)
pr_warn("%s: timeout waiting for SOF\n", __func__);
}
uhsic_phy_post_resume(phy);
+
+ /* Set RUN bit */
+ val = readl(base + USB_USBCMD);
+ val |= USB_USBCMD_RS;
+ writel(val, base + USB_USBCMD);
+ if (usb_phy_reg_status_wait(base + USB_USBCMD, USB_USBCMD_RS,
+ USB_USBCMD_RS, 2000)) {
+ pr_err("%s: timeout waiting for USB_USBCMD_RS\n", __func__);
+ return;
+ }
} else {
uhsic_phy_disable_pmc_bus_ctrl(phy);
}
-
- /* Set RUN bit */
- val = readl(base + USB_USBCMD);
- val |= USB_USBCMD_RS;
- writel(val, base + USB_USBCMD);
- if (usb_phy_reg_status_wait(base + USB_USBCMD, USB_USBCMD_RS,
- USB_USBCMD_RS, 2000)) {
- pr_err("%s: timeout waiting for USB_USBCMD_RS\n", __func__);
- return;
- }
}
static int hsic_rail_enable(struct tegra_usb_phy *phy)
@@ -2292,8 +2285,6 @@ static int uhsic_phy_power_on(struct tegra_usb_phy *phy)
val = readl(base + HOSTPC1_DEVLC);
val &= ~HOSTPC1_DEVLC_PTS(HOSTPC1_DEVLC_PTS_MASK);
val |= HOSTPC1_DEVLC_PTS(HOSTPC1_DEVLC_PTS_HSIC);
- val &= ~HOSTPC1_DEVLC_PSPD(HOSTPC1_DEVLC_PSPD_MASK);
- val |= HOSTPC1_DEVLC_PSPD(HOSTPC1_DEVLC_PSPD_HIGH_SPEED);
val &= ~HOSTPC1_DEVLC_STS;
writel(val, base + HOSTPC1_DEVLC);
@@ -2387,8 +2378,6 @@ int uhsic_phy_bus_port_power(struct tegra_usb_phy *phy)
val = readl(base + HOSTPC1_DEVLC);
val &= ~(HOSTPC1_DEVLC_PTS(HOSTPC1_DEVLC_PTS_MASK));
val |= HOSTPC1_DEVLC_PTS(HOSTPC1_DEVLC_PTS_HSIC);
- val &= ~(HOSTPC1_DEVLC_PSPD(HOSTPC1_DEVLC_PSPD_MASK));
- val |= HOSTPC1_DEVLC_PSPD(HOSTPC1_DEVLC_PSPD_HIGH_SPEED);
writel(val, base + HOSTPC1_DEVLC);
val = readl(base + UHSIC_MISC_CFG0);
@@ -2428,8 +2417,6 @@ static int uhsic_phy_bus_reset(struct tegra_usb_phy *phy)
val = readl(base + HOSTPC1_DEVLC);
val &= ~HOSTPC1_DEVLC_PTS(HOSTPC1_DEVLC_PTS_MASK);
val |= HOSTPC1_DEVLC_PTS(HOSTPC1_DEVLC_PTS_HSIC);
- val &= ~HOSTPC1_DEVLC_PSPD(HOSTPC1_DEVLC_PSPD_MASK);
- val |= HOSTPC1_DEVLC_PSPD(HOSTPC1_DEVLC_PSPD_HIGH_SPEED);
val &= ~HOSTPC1_DEVLC_STS;
writel(val, base + HOSTPC1_DEVLC);
/* wait here, otherwise HOSTPC1_DEVLC_PSPD will timeout */