aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnurag Kumar Vulisha <anurag.kumar.vulisha@xilinx.com>2018-07-27 03:41:20 -0400
committerFelipe Balbi <felipe.balbi@linux.intel.com>2018-07-30 03:39:18 -0400
commitb138e23d3dff90c0494925b4c1874227b81bddf7 (patch)
treef6f383735e528ea9cbaedfe200101492b98ba576
parenta77004681148f5773c20370812ca7d14443fb091 (diff)
usb: dwc3: core: Enable AutoRetry feature in the controller
By default when core sees any transaction error (CRC or overflow) it replies with terminating retry ACK (Retry=1 and Nump == 0). Enabling this Auto Retry feature in controller will make the core send a non-terminanting ACK upon such transaction errors. That is, ACK TP with Retry=1 and Nump != 0. Doing so will give controller a chance to recover from transient error conditions. Signed-off-by: Anurag Kumar Vulisha <anurag.kumar.vulisha@xilinx.com> Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
-rw-r--r--drivers/usb/dwc3/core.c16
-rw-r--r--drivers/usb/dwc3/core.h3
2 files changed, 19 insertions, 0 deletions
diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
index 64ba664d467c..88c80fcc39f5 100644
--- a/drivers/usb/dwc3/core.c
+++ b/drivers/usb/dwc3/core.c
@@ -985,6 +985,22 @@ static int dwc3_core_init(struct dwc3 *dwc)
985 dwc3_writel(dwc->regs, DWC3_GUCTL1, reg); 985 dwc3_writel(dwc->regs, DWC3_GUCTL1, reg);
986 } 986 }
987 987
988 if (dwc->dr_mode == USB_DR_MODE_HOST ||
989 dwc->dr_mode == USB_DR_MODE_OTG) {
990 reg = dwc3_readl(dwc->regs, DWC3_GUCTL);
991
992 /*
993 * Enable Auto retry Feature to make the controller operating in
994 * Host mode on seeing transaction errors(CRC errors or internal
995 * overrun scenerios) on IN transfers to reply to the device
996 * with a non-terminating retry ACK (i.e, an ACK transcation
997 * packet with Retry=1 & Nump != 0)
998 */
999 reg |= DWC3_GUCTL_HSTINAUTORETRY;
1000
1001 dwc3_writel(dwc->regs, DWC3_GUCTL, reg);
1002 }
1003
988 /* 1004 /*
989 * Must config both number of packets and max burst settings to enable 1005 * Must config both number of packets and max burst settings to enable
990 * RX and/or TX threshold. 1006 * RX and/or TX threshold.
diff --git a/drivers/usb/dwc3/core.h b/drivers/usb/dwc3/core.h
index 5f14fb7121b1..5bfb62533e0f 100644
--- a/drivers/usb/dwc3/core.h
+++ b/drivers/usb/dwc3/core.h
@@ -238,6 +238,9 @@
238#define DWC3_GCTL_GBLHIBERNATIONEN BIT(1) 238#define DWC3_GCTL_GBLHIBERNATIONEN BIT(1)
239#define DWC3_GCTL_DSBLCLKGTNG BIT(0) 239#define DWC3_GCTL_DSBLCLKGTNG BIT(0)
240 240
241/* Global User Control Register */
242#define DWC3_GUCTL_HSTINAUTORETRY BIT(14)
243
241/* Global User Control 1 Register */ 244/* Global User Control 1 Register */
242#define DWC3_GUCTL1_TX_IPGAP_LINECHECK_DIS BIT(28) 245#define DWC3_GUCTL1_TX_IPGAP_LINECHECK_DIS BIT(28)
243#define DWC3_GUCTL1_DEV_L1_EXIT_BY_HW BIT(24) 246#define DWC3_GUCTL1_DEV_L1_EXIT_BY_HW BIT(24)