Skip to content

Commit bbb718e

Browse files
committed
usb: dwc3: core: do not use 3.0 clock when operating in 2.0 mode
In the 3.0 device core, if the core is programmed to operate in 2.0 only, then setting the GUCTL1.DEV_FORCE_20_CLK_FOR_30_CLK makes the internal 2.0(utmi/ulpi) clock to be routed as the 3.0 (pipe) clock. Enabling this feature allows the pipe3 clock to be not-running when forcibly operating in 2.0 device mode. Signed-off-by: William Wu <william.wu@rock-chips.com> Signed-off-by: Bin Yang <yangbin@rock-chips.com> Change-Id: I217a380815c21903c1090bd003c1d8ba2fadbe7c
1 parent 918ad13 commit bbb718e

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

drivers/usb/dwc3/core.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -727,6 +727,10 @@ static int dwc3_core_init(struct dwc3 *dwc)
727727
if (dwc->tx_ipgap_linecheck_dis_quirk)
728728
reg |= DWC3_GUCTL1_TX_IPGAP_LINECHECK_DIS;
729729

730+
if (dwc->maximum_speed == USB_SPEED_HIGH ||
731+
dwc->maximum_speed == USB_SPEED_FULL)
732+
reg |= DWC3_GUCTL1_DEV_FORCE_20_CLK_FOR_30_CLK;
733+
730734
dwc3_writel(dwc->regs, DWC3_GUCTL1, reg);
731735

732736
if (dwc->grxthrcfg[0] > 0) {

drivers/usb/dwc3/core.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,7 @@
202202

203203
/* Global User Control 1 Register */
204204
#define DWC3_GUCTL1_TX_IPGAP_LINECHECK_DIS BIT(28)
205+
#define DWC3_GUCTL1_DEV_FORCE_20_CLK_FOR_30_CLK BIT(26)
205206
#define DWC3_GUCTL1_DEV_L1_EXIT_BY_HW (1 << 24)
206207

207208
/* Global USB2 PHY Configuration Register */

0 commit comments

Comments
 (0)