Skip to content

Allow disabling USB3 ports in xHCI/DWC3

Sam Edwards linux-usb lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 11 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2xhci: Introduce "disable-usb3" DT property/quirkDocumentation/devicetree/bindings/usb/usb-xhci.yaml drivers/usb/host/xhci-mem.c drivers/usb/host/xhci-plat.c +1 more+12 -06 replies
2/2usb: dwc3: host: Disable USB3 ports if maximum-speed doesn't permit USB3drivers/usb/dwc3/host.c+4 -12 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/2] Allow disabling USB3 ports in xHCI/DWC3

Hi USB devs,

This patchset is a semi-RFC: I haven't discussed this change yet, and it may turn out to be a bad idea. But if there is a consensus that this change is appropriate, these patches are the ones I'd submit for inclusion.

These patches were developed while working with a SoC (Rockchip RK3588) that contains DWC3-OTG controllers and accompanying USB2 + USB3/DP PHYs. My target (Turing RK1) uses its first bus in USB2.0-OTG mode only: the associated USB3 PHY is reserved for DP. Worse, a driver for the USBDP block (though it exists) has not been merged to mainline. Without lighting up the PHY side of the PIPE, the DWC3 behaves erratically, even for USB2 operation.

This could be addressed by patching in the (out-of-tree) USBDP driver and enabling only its USB backend. However, I found it cleaner (also from a user-friendliness standpoint) just to disable the unusable USB3 port. These patches achieve that by (1) making it possible to tell the xHCI driver to ignore any USB3 port(s), and (2) (perhaps more controversially) making the DWC3 driver disable USB3 host ports when maximum-speed isn't set high enough.

There are other ways to disable the USB3 ports on RK3588, such as via some syscon registers. I figured I would start with the most general solution (benefitting other SoCs) first, getting more specific only if necessary. :)

Thank you for your attention,
Sam

Sam Edwards (2):
xhci: Introduce "disable-usb3" DT property/quirk
usb: dwc3: host: Disable USB3 ports if maximum-speed doesn't permit
USB3

 Documentation/devicetree/bindings/usb/usb-xhci.yaml | 4 ++++
 drivers/usb/dwc3/host.c                             | 5 ++++-
 drivers/usb/host/xhci-mem.c                         | 4 ++++
 drivers/usb/host/xhci-plat.c                        | 3 +++
 drivers/usb/host/xhci.h                             | 1 +
 5 files changed, 16 insertions(+), 1 deletion(-)
Signature · 1 line
2.41.0