UPSTREAM: usb: dwc3: Add support for device L1 exit
authorJohn Youn <johnyoun@synopsys.com>
Thu, 13 Oct 2016 01:00:55 +0000 (18:00 -0700)
committerHuang, Tao <huangtao@rock-chips.com>
Tue, 18 Apr 2017 09:55:12 +0000 (17:55 +0800)
For the usb31 IP and from version 2.90a of the usb3 IP, the core
supports HW exit from L1 in HS. Enable it, otherwise the controller may
never exit from LPM to do a transfer.

Conflicts:
drivers/usb/dwc3/core.c
drivers/usb/dwc3/core.h

Change-Id: I074d3ab2e386b872800e2c9898398d3696228527
Signed-off-by: John Youn <johnyoun@synopsys.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: William Wu <wulf@rock-chips.com>
(cherry picked from commit 0bb39ca1ad8758f109cd2e7b30a5316f3097346a)

drivers/usb/dwc3/core.c
drivers/usb/dwc3/core.h

index db5f8e056d293c30cf73f5b20f3885e1b8ff7953..de2de4e685c4626f99ab4989e13a9c239f065631 100644 (file)
@@ -701,6 +701,16 @@ static int dwc3_core_init(struct dwc3 *dwc)
                break;
        }
 
+       /*
+        * Enable hardware control of sending remote wakeup in HS when
+        * the device is in the L1 state.
+        */
+       if (dwc->revision >= DWC3_REVISION_290A) {
+               reg = dwc3_readl(dwc->regs, DWC3_GUCTL1);
+               reg |= DWC3_GUCTL1_DEV_L1_EXIT_BY_HW;
+               dwc3_writel(dwc->regs, DWC3_GUCTL1, reg);
+       }
+
        return 0;
 
 err4:
index 5a517f3946591b98b98e0dbe3a719ef8e03c4798..5f697c8f1ed1bb8a5a67f358888d48648d2f0e59 100644 (file)
 #define DWC3_GCTL_GBLHIBERNATIONEN     (1 << 1)
 #define DWC3_GCTL_DSBLCLKGTNG          (1 << 0)
 
+/* Global User Control 1 Register */
+#define DWC3_GUCTL1_DEV_L1_EXIT_BY_HW  (1 << 24)
+
 /* Global USB2 PHY Configuration Register */
 #define DWC3_GUSB2PHYCFG_PHYSOFTRST    (1 << 31)
 #define DWC3_GUSB2PHYCFG_U2_FREECLK_EXISTS     (1 << 30)
@@ -897,6 +900,7 @@ struct dwc3 {
 #define DWC3_REVISION_260A     0x5533260a
 #define DWC3_REVISION_270A     0x5533270a
 #define DWC3_REVISION_280A     0x5533280a
+#define DWC3_REVISION_290A     0x5533290a
 
 /*
  * NOTICE: we're using bit 31 as a "is usb 3.1" flag. This is really