usb: dwc3: make sure UX_EXIT_PX is cleared
authorFelipe Balbi <felipe.balbi@linux.intel.com>
Wed, 3 Aug 2016 11:16:15 +0000 (14:16 +0300)
committerFelipe Balbi <felipe.balbi@linux.intel.com>
Mon, 27 Mar 2017 07:46:33 +0000 (10:46 +0300)
This bit is only supposed to be used with known
buggy PHYs, however some platforms might erroneously
set it. In order to avoid it, let's make sure this
bit is always cleared. If some PHY needs this, we
will need to add a quirk flag.

Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
drivers/usb/dwc3/core.c
drivers/usb/dwc3/core.h

index 369bab1..8173d06 100644 (file)
@@ -431,6 +431,12 @@ static int dwc3_phy_setup(struct dwc3 *dwc)
 
        reg = dwc3_readl(dwc->regs, DWC3_GUSB3PIPECTL(0));
 
+       /*
+        * Make sure UX_EXIT_PX is cleared as that causes issues with some
+        * PHYs. Also, this bit is not supposed to be used in normal operation.
+        */
+       reg &= ~DWC3_GUSB3PIPECTL_UX_EXIT_PX;
+
        /*
         * Above 1.94a, it is recommended to set DWC3_GUSB3PIPECTL_SUSPHY
         * to '0' during coreConsultant configuration. So default value
index 2b9e4ca..fd640f1 100644 (file)
 #define DWC3_GUSB3PIPECTL_PHYSOFTRST   (1 << 31)
 #define DWC3_GUSB3PIPECTL_U2SSINP3OK   (1 << 29)
 #define DWC3_GUSB3PIPECTL_DISRXDETINP3 (1 << 28)
+#define DWC3_GUSB3PIPECTL_UX_EXIT_PX   (1 << 27)
 #define DWC3_GUSB3PIPECTL_REQP1P2P3    (1 << 24)
 #define DWC3_GUSB3PIPECTL_DEP1P2P3(n)  ((n) << 19)
 #define DWC3_GUSB3PIPECTL_DEP1P2P3_MASK        DWC3_GUSB3PIPECTL_DEP1P2P3(7)