Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c81de8ee authored by Vamsi Krishna Samavedam's avatar Vamsi Krishna Samavedam Committed by Hemant Kumar
Browse files

usb: dwc3: Disable USB20 internal retry feature



Disable USB20 internal retry feature for dwc3 version 170A-GA to avoid
controller lockup due to snps star:'9001346572:Host stops transfers
to other EPs when a single USB2.0 EP NAKs continuously'

Change-Id: I71f1d272f74dc51fed4617b7ea12c044160a69c7
Signed-off-by: default avatarVamsi Krishna Samavedam <vskrishn@codeaurora.org>
Signed-off-by: default avatarHemant Kumar <hemantk@codeaurora.org>
parent 4ee3d5aa
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -927,6 +927,18 @@ int dwc3_core_init(struct dwc3 *dwc)
		}
	}

	/*
	 * STAR: 9001346572:Host stops transfers to other EPs when a single
	 * USB2.0 EP NAKs continuously requires to disable internal retry
	 * feature
	 */
	if ((dwc->revision == DWC3_USB31_REVISION_170A) &&
		(dwc->versiontype == DWC3_USB31_VER_TYPE_GA)) {
		reg = dwc3_readl(dwc->regs, DWC3_GUCTL3);
		reg |= DWC3_GUCTL3_USB20_RETRY_DISABLE;
		dwc3_writel(dwc->regs, DWC3_GUCTL3, reg);
	}

	dwc3_notify_event(dwc, DWC3_CONTROLLER_POST_RESET_EVENT);

	return 0;
+5 −0
Original line number Diff line number Diff line
@@ -115,6 +115,7 @@
#define DWC3_GPRTBIMAP_FS0	0xc188
#define DWC3_GPRTBIMAP_FS1	0xc18c
#define DWC3_GUCTL2		0xc19c
#define DWC3_GUCTL3		0xc60c

#define DWC3_VER_NUMBER		0xc1a0
#define DWC3_VER_TYPE		0xc1a4
@@ -362,6 +363,9 @@
/* Global User Control Register 2 */
#define DWC3_GUCTL2_RST_ACTBITLATER		BIT(14)

/* Global User Control Register 3 */
#define DWC3_GUCTL3_USB20_RETRY_DISABLE		BIT(16)

/* Device Configuration Register */
#define DWC3_DCFG_DEVADDR(addr)	((addr) << 3)
#define DWC3_DCFG_DEVADDR_MASK	DWC3_DCFG_DEVADDR(0x7f)
@@ -1200,6 +1204,7 @@ struct dwc3 {
	/* valid only for dwc31 configuraitons */
	u32			versiontype;
#define DWC3_USB31_VER_TYPE_EA06	0x65613036
#define DWC3_USB31_VER_TYPE_GA		0x67612a2a

	enum dwc3_ep0_next	ep0_next_event;
	enum dwc3_ep0_state	ep0state;