Skip to content

Commit 9149c9b

Browse files
Faisal Hassangregkh
authored andcommitted
usb: dwc3: core: update LC timer as per USB Spec V3.2
This fix addresses STAR 9001285599, which only affects DWC_usb3 version 3.20a. The timer value for PM_LC_TIMER in DWC_usb3 3.20a for the Link ECN changes is incorrect. If the PM TIMER ECN is enabled via GUCTL2[19], the 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 acceptable for the link compliance test. Therefore, clear GUCTL2[19] to pass the USB link compliance test: TD 7.21. Cc: [email protected] Signed-off-by: Faisal Hassan <[email protected]> Acked-by: Thinh Nguyen <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 00dcf2f commit 9149c9b

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

drivers/usb/dwc3/core.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1386,6 +1386,21 @@ static int dwc3_core_init(struct dwc3 *dwc)
13861386
dwc3_writel(dwc->regs, DWC3_GUCTL2, reg);
13871387
}
13881388

1389+
/*
1390+
* STAR 9001285599: This issue affects DWC_usb3 version 3.20a
1391+
* only. If the PM TIMER ECM is enabled through GUCTL2[19], the
1392+
* link compliance test (TD7.21) may fail. If the ECN is not
1393+
* enabled (GUCTL2[19] = 0), the controller will use the old timer
1394+
* value (5us), which is still acceptable for the link compliance
1395+
* test. Therefore, do not enable PM TIMER ECM in 3.20a by
1396+
* setting GUCTL2[19] by default; instead, use GUCTL2[19] = 0.
1397+
*/
1398+
if (DWC3_VER_IS(DWC3, 320A)) {
1399+
reg = dwc3_readl(dwc->regs, DWC3_GUCTL2);
1400+
reg &= ~DWC3_GUCTL2_LC_TIMER;
1401+
dwc3_writel(dwc->regs, DWC3_GUCTL2, reg);
1402+
}
1403+
13891404
/*
13901405
* When configured in HOST mode, after issuing U3/L2 exit controller
13911406
* fails to send proper CRC checksum in CRC5 feild. Because of this

drivers/usb/dwc3/core.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -421,6 +421,7 @@
421421

422422
/* Global User Control Register 2 */
423423
#define DWC3_GUCTL2_RST_ACTBITLATER BIT(14)
424+
#define DWC3_GUCTL2_LC_TIMER BIT(19)
424425

425426
/* Global User Control Register 3 */
426427
#define DWC3_GUCTL3_SPLITDISABLE BIT(14)
@@ -1269,6 +1270,7 @@ struct dwc3 {
12691270
#define DWC3_REVISION_290A 0x5533290a
12701271
#define DWC3_REVISION_300A 0x5533300a
12711272
#define DWC3_REVISION_310A 0x5533310a
1273+
#define DWC3_REVISION_320A 0x5533320a
12721274
#define DWC3_REVISION_330A 0x5533330a
12731275

12741276
#define DWC31_REVISION_ANY 0x0

0 commit comments

Comments
 (0)