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

Commit d344a7bd authored by Chandana Kishori Chiluveru's avatar Chandana Kishori Chiluveru Committed by Gerrit - the friendly Code Review server
Browse files

usb: dwc3: update LC timer as per new usb V3.20



This is the workaround for STAR 9001285599 which affects
dwc3 core version 3.20a only. The timer value for PM_LC_TIMER
in V3.20a for the Link ECN changes is not correct. If the PM TIMER
ECN is enabled thru GUCTL2[19], then link compliance test (TD7.21)
may fail. If the ECN is not enabled (GUCTL2[19] = 0), the controller
will use the old timer value (5us), which is still fine for Link
Compliance test. Hence Clear GUCTL2[19] to pass usb link compliance
test: TD 7.21.

Change-Id: I5fc535ef2bdd54764086a50cf9a3cb538f92a465
Signed-off-by: default avatarChandana Kishori Chiluveru <cchiluve@codeaurora.org>
parent 0ae60d48
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
@@ -894,6 +894,21 @@ int dwc3_core_init(struct dwc3 *dwc)
		dwc3_writel(dwc->regs, DWC3_GUCTL2, reg);
	}

	/*
	 * Workaround for STAR 9001285599 which affects dwc3 core version 3.20a
	 * only. If the PM TIMER ECN is enabled thru GUCTL2[19], then link
	 * compliance test (TD7.21) may fail. If the ECN is not enabled
	 * GUCTL2[19] = 0), the controller will use the old timer value (5us),
	 * which is still fine for Link Compliance test. Hence Do not enable
	 * PM TIMER ECN in V3.20a by setting GUCTL2[19] by default,
	 * instead use GUCTL2[19] = 0.
	 */
	if (dwc->revision == DWC3_REVISION_320A) {
		reg = dwc3_readl(dwc->regs, DWC3_GUCTL2);
		reg &= ~DWC3_GUCTL2_LC_TIMER;
		dwc3_writel(dwc->regs, DWC3_GUCTL2, reg);
	}

	return 0;

err3:
+1 −0
Original line number Diff line number Diff line
@@ -328,6 +328,7 @@
#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)
#define DWC3_GUCTL2_LC_TIMER			(1 << 19)

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