| Message ID | 20261014082037.1774672-3-wenst@chromium.org |
|---|---|
| State | New |
| Headers | show |
| Series | dt-bindings: usb: downstream host ports for hcd and dwc3 | expand |
On 10/15/26 11:00 AM, Chen-Yu Tsai wrote: > (Cc-ed Mathias, the xHCI driver maintainer in case I misunderstood xHCI.) > > On Thu, Oct 15, 2026 at 4:44 PM Neil Armstrong > <neil.armstrong@linaro.org> wrote: >> >> On 10/14/26 18:36, Konrad Dybcio wrote: >>> On 10/14/26 11:44 AM, Neil Armstrong wrote: >>>> On 10/14/26 11:29, Chen-Yu Tsai wrote: >>>>> On Wed, Oct 14, 2026 at 5:28 PM Neil Armstrong >>>>> <neil.armstrong@linaro.org> wrote: [...] >> How about the USB4, does it use the USB3.0 port ? > > I'm not familiar with USB4. A quick search says that it can tunnel > USB 3.x, DP, and PCIe, and it doesn't have its own USB HCI defined. > > So I'm thinking the USB4 controller would be more like a nexus node > or multiplexing node, or perhaps like a USB C connector. It has input > ports for all the protocols it can tunnel, connected to their respective > controllers (XHCI, DP, PCIe). The binding probably would be very messy > if one controller supported multiple outgoing ports, as each downstream > port has a 3-to-1 relationship with its respective upstream protocol > interfaces. Yeah that is more or less it. There needs to be a connection between the USB4 router and the native (USB3 *port*, not hub | PCIe *port*, not RC | DPTX) protocol adapter where the tunneled packets end up at to create a PM devlink between it and the USB4 router. ACPI does that by adding a `usb4-host-interface = &reference_to_router` property, for DT that's still undecided: https://github.com/devicetree-org/dt-schema/pull/196 As far as the Qualcomm implementation goes, I was hoping we could go forward with base1 numbering as the DWC3 is an XHCI controller: https://lore.kernel.org/linux-usb/20260929-topic-dwc3_tunneling_state-v4-0-63e296346d57@oss.qualcomm.com/ Konrad
On Wed, Oct 21, 2026 at 5:44 PM Konrad Dybcio <konrad.dybcio@oss.qualcomm.com> wrote: > > On 10/15/26 11:00 AM, Chen-Yu Tsai wrote: > > (Cc-ed Mathias, the xHCI driver maintainer in case I misunderstood xHCI.) > > > > On Thu, Oct 15, 2026 at 4:44 PM Neil Armstrong > > <neil.armstrong@linaro.org> wrote: > >> > >> On 10/14/26 18:36, Konrad Dybcio wrote: > >>> On 10/14/26 11:44 AM, Neil Armstrong wrote: > >>>> On 10/14/26 11:29, Chen-Yu Tsai wrote: > >>>>> On Wed, Oct 14, 2026 at 5:28 PM Neil Armstrong > >>>>> <neil.armstrong@linaro.org> wrote: > > [...] > > > >> How about the USB4, does it use the USB3.0 port ? > > > > I'm not familiar with USB4. A quick search says that it can tunnel > > USB 3.x, DP, and PCIe, and it doesn't have its own USB HCI defined. > > > > So I'm thinking the USB4 controller would be more like a nexus node > > or multiplexing node, or perhaps like a USB C connector. It has input > > ports for all the protocols it can tunnel, connected to their respective > > controllers (XHCI, DP, PCIe). The binding probably would be very messy > > if one controller supported multiple outgoing ports, as each downstream > > port has a 3-to-1 relationship with its respective upstream protocol > > interfaces. > > Yeah that is more or less it. > > There needs to be a connection between the USB4 router and the native > (USB3 *port*, not hub | PCIe *port*, not RC | DPTX) protocol adapter > where the tunneled packets end up at to create a PM devlink between it > and the USB4 router. > > ACPI does that by adding a `usb4-host-interface = &reference_to_router` > property, for DT that's still undecided: > > https://github.com/devicetree-org/dt-schema/pull/196 > > As far as the Qualcomm implementation goes, I was hoping we could > go forward with base1 numbering as the DWC3 is an XHCI controller: > > https://lore.kernel.org/linux-usb/20260929-topic-dwc3_tunneling_state-v4-0-63e296346d57@oss.qualcomm.com/ I don't have DWC3 manuals, but assuming its internal numbering follows that of XHCI, you can't just use "udev->portnum - 1" in patch 4. That is the logical port number on the root hub. Instead you need raw_port = usb_hcd_find_raw_port_number(bus_to_hcd(hub->bus), port1); to get the 1-based port number for XHCI. ChenYu
diff --git a/Documentation/devicetree/bindings/usb/snps,dwc3-common.yaml b/Documentation/devicetree/bindings/usb/snps,dwc3-common.yaml index 6c0b8b653824..4b6304bd2ec1 100644 --- a/Documentation/devicetree/bindings/usb/snps,dwc3-common.yaml +++ b/Documentation/devicetree/bindings/usb/snps,dwc3-common.yaml @@ -410,11 +410,11 @@ properties: property is used. properties: - port@0: + port@1: $ref: /schemas/graph.yaml#/properties/port description: High Speed (HS) data bus. - port@1: + port@2: $ref: /schemas/graph.yaml#/properties/port description: Super Speed (SS) data bus.
The DWC3 controller can operate in host mode. It does so with a XHCI compliant host controller. The XHCI has two downstream ports, one for HS and one for SS. USB downstream ports start from 1, not 0. Reconcile the downstream port numbering with the common USB host binding, renumbering the downstream port numbers from 0 and 1 to 1 and 2. This is non-backwards compatible, however it won't break current major implementations: - dwc3 "gadget mode" in Linux kernel only requires a connection to be present; it doesn't matter which port it is - dwc3 "host mode" OF graph connections aren't supported yet [1] - FreeBSD doesn't use the OF graph for anything - U-boot doesn't use the OF graph for USB - OpenBSD doesn't support dwc3, only the XHCI in dwc3, and doesn't use the OF graph for USB - coreboot doesn't use the OF graph for anything - Zephyr doesn't support dwc3 - TF-A doesn't use the OF graph for anything - EDK2 doesn't support dwc3 and doesn't support OF graph - OP-TEE doesn't support dwc3 and doesn't support OF graph [1] WIP to tie OF graph port node to USB port device Fixes: a33113f73693 ("dt-bindings: usb: snps,dwc3: document HS & SS OF graph ports") Signed-off-by: Chen-Yu Tsai <wenst@chromium.org> --- It is unclear to me whether the HS/SS numbering is fixed for all dwc3 variants. I checked Allwinner H616 and Rockchip RK3588 and they both have HS as port 1 and SS as port 2. This also doesn't cover a potential "multi-port" DWC3 implementation, which Qualcomm seems to have. --- Documentation/devicetree/bindings/usb/snps,dwc3-common.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)