ARM: tegra: usb: Set TXFILLTUNING after CMD_RESET
Suresh Mangipudi [Tue, 10 Sep 2013 06:06:49 +0000 (11:06 +0530)]
Program the TXFILLTUNING value after CMD_RESET. CMD_RESET clears
the value of TXFILLTUNING, this needs to be reprogrammed again.

Bug 1318125

Change-Id: I34dcad888ad11f8471cfcfa72dbe20f17527f695
Signed-off-by: Suresh Mangipudi <smangipudi@nvidia.com>
Reviewed-on: http://git-master/r/272332
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Venkat Moganty <vmoganty@nvidia.com>

arch/arm/mach-tegra/tegra11x_usb_phy.c

index 706e76d..c4921f7 100644 (file)
@@ -1349,6 +1349,12 @@ static int utmi_phy_resume(struct tegra_usb_phy *phy)
                        DBG("USB_USBSTS[0x%x] USB_PORTSC[0x%x]\n",
                        readl(base + USB_USBSTS), readl(base + USB_PORTSC));
                }
+               val = readl(base + USB_TXFILLTUNING);
+               if ((val & USB_FIFO_TXFILL_MASK) !=
+                       USB_FIFO_TXFILL_THRES(0x10)) {
+                       val = USB_FIFO_TXFILL_THRES(0x10);
+                       writel(val, base + USB_TXFILLTUNING);
+               }
        }
 
        return status;
@@ -1979,12 +1985,6 @@ static int uhsic_phy_power_on(struct tegra_usb_phy *phy)
        phy->phy_clk_on = true;
        phy->hw_accessible = true;
 
-       val = readl(base + USB_TXFILLTUNING);
-       if ((val & USB_FIFO_TXFILL_MASK) != USB_FIFO_TXFILL_THRES(0x10)) {
-               val = USB_FIFO_TXFILL_THRES(0x10);
-               writel(val, base + USB_TXFILLTUNING);
-       }
-
        if (!readl(base + USB_ASYNCLISTADDR))
                _usb_phy_init(phy);
 
@@ -1997,6 +1997,11 @@ static int uhsic_phy_power_on(struct tegra_usb_phy *phy)
                phy->pmc_sleepwalk = false;
        }
 
+       val = readl(base + USB_TXFILLTUNING);
+       if ((val & USB_FIFO_TXFILL_MASK) != USB_FIFO_TXFILL_THRES(0x10)) {
+               val = USB_FIFO_TXFILL_THRES(0x10);
+               writel(val, base + USB_TXFILLTUNING);
+       }
        return 0;
 }