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

Commit 0ae60d48 authored by Vamsi Krishna Samavedam's avatar Vamsi Krishna Samavedam Committed by Gerrit - the friendly Code Review server
Browse files

usb: dwc3: update HP timer as per new usb 3.1 ECN



This is the workaround for STAR 9001198391 which affects
dwc3 core version 3.20a only.  DWC3 core version:3.20a
supports usb 3.1 hp timer ECN but incorrectly sets hp timer
timeout to 3us. Update hp timer to 11us to pass usb link
layer compliance test: TD 7.1, TD 7.9, TD 7.11, TD 7.13,
TD 7.14, TD 7.18, TD 7.23, TD 7.26, TD 7.27, TD 7.28, and
TD 7.29.

Change-Id: Icdbc1550e96a7dfcbe85604b8c237f0a8730bb23
Signed-off-by: default avatarVamsi Krishna Samavedam <vskrishn@codeaurora.org>
parent cd4936b2
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -881,6 +881,19 @@ int dwc3_core_init(struct dwc3 *dwc)

	dwc3_notify_event(dwc, DWC3_CONTROLLER_POST_RESET_EVENT);

	/*
	 * Workaround for STAR 9001198391 which affects dwc3 core
	 * version 3.20a only. Default HP timer value is incorrectly
	 * set to 3us. Reprogram HP timer value to support USB 3.1
	 * HP timer ECN.
	 */
	if (!dwc3_is_usb31(dwc) &&  dwc->revision == DWC3_REVISION_320A) {
		reg = dwc3_readl(dwc->regs, DWC3_GUCTL2);
		reg &= ~DWC3_GUCTL2_HP_TIMER_MASK;
		reg |= DWC3_GUCTL2_HP_TIMER(11);
		dwc3_writel(dwc->regs, DWC3_GUCTL2, reg);
	}

	return 0;

err3:
+3 −0
Original line number Diff line number Diff line
@@ -326,6 +326,8 @@

/* Global User Control Register 2 */
#define DWC3_GUCTL2_RST_ACTBITLATER		BIT(14)
#define DWC3_GUCTL2_HP_TIMER(n)			((n) << 21)
#define DWC3_GUCTL2_HP_TIMER_MASK		DWC3_GUCTL2_HP_TIMER(0x1f)

/* Global User Control Register 3 */
#define DWC3_GUCTL3_USB20_RETRY_DISABLE		BIT(16)
@@ -1062,6 +1064,7 @@ struct dwc3 {
#define DWC3_REVISION_290A	0x5533290a
#define DWC3_REVISION_300A	0x5533300a
#define DWC3_REVISION_310A	0x5533310a
#define DWC3_REVISION_320A	0x5533320a

/*
 * NOTICE: we're using bit 31 as a "is usb 3.1" flag. This is really