Skip to content

Commit 9678f33

Browse files
robhancocksedgregkh
authored andcommitted
usb: dwc3: xilinx: Skip resets and USB3 register settings for USB2.0 mode
It appears that the PIPE clock should not be selected when only USB 2.0 is being used in the design and no USB 3.0 reference clock is used. Also, the core resets are not required if a USB3 PHY is not in use, and will break things if USB3 is actually used but the PHY entry is not listed in the device tree. Skip core resets and register settings that are only required for USB3 mode when no USB3 PHY is specified in the device tree. Fixes: 84770f0 ("usb: dwc3: Add driver for Xilinx platforms") Cc: stable <[email protected]> Signed-off-by: Robert Hancock <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 9df4784 commit 9678f33

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

drivers/usb/dwc3/dwc3-xilinx.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,18 @@ static int dwc3_xlnx_init_zynqmp(struct dwc3_xlnx *priv_data)
110110
usb3_phy = NULL;
111111
}
112112

113+
/*
114+
* The following core resets are not required unless a USB3 PHY
115+
* is used, and the subsequent register settings are not required
116+
* unless a core reset is performed (they should be set properly
117+
* by the first-stage boot loader, but may be reverted by a core
118+
* reset). They may also break the configuration if USB3 is actually
119+
* in use but the usb3-phy entry is missing from the device tree.
120+
* Therefore, skip these operations in this case.
121+
*/
122+
if (!usb3_phy)
123+
goto skip_usb3_phy;
124+
113125
crst = devm_reset_control_get_exclusive(dev, "usb_crst");
114126
if (IS_ERR(crst)) {
115127
ret = PTR_ERR(crst);
@@ -188,6 +200,7 @@ static int dwc3_xlnx_init_zynqmp(struct dwc3_xlnx *priv_data)
188200
goto err;
189201
}
190202

203+
skip_usb3_phy:
191204
/*
192205
* This routes the USB DMA traffic to go through FPD path instead
193206
* of reaching DDR directly. This traffic routing is needed to

0 commit comments

Comments
 (0)