From e5ac50732aac6366a90bc9c8e9307cb10e37f20b Mon Sep 17 00:00:00 2001 From: Acelogic Date: Sun, 8 Nov 2026 02:33:35 -0500 Subject: [PATCH 1/4] arm64: dts: apple: j873: bring back the USB 2 hosts Restore the J873g USB 2 host description that linux#1197 set aside: the back-left controller (usb-drd1) and the front ports (usb-drd2, behind the on-board hub), each behind its two DART instances. aura prepares these ports before Linux starts (j873_usb_prep()). This is the description that worked on the M6, where both xHCI hosts and the front-port hub enumerated. It still describes the controllers as plain "snps,dwc3" with two iommus, which the generic dwc3 binding rejects. Before it can merge, the nodes need to move to the Apple dwc3 binding, or the binding needs an M6 USB 2 host variant. Signed-off-by: Acelogic --- arch/arm64/boot/dts/apple/t8152-j873-usb.dtsi | 67 +++++++++++++++++++ arch/arm64/boot/dts/apple/t8152-j873g.dts | 17 +---- 2 files changed, 69 insertions(+), 15 deletions(-) create mode 100644 arch/arm64/boot/dts/apple/t8152-j873-usb.dtsi diff --git a/arch/arm64/boot/dts/apple/t8152-j873-usb.dtsi b/arch/arm64/boot/dts/apple/t8152-j873-usb.dtsi new file mode 100644 index 0000000000000..5ecd42f9e7135 --- /dev/null +++ b/arch/arm64/boot/dts/apple/t8152-j873-usb.dtsi @@ -0,0 +1,67 @@ +// SPDX-License-Identifier: GPL-2.0+ OR MIT +/* + * J873g USB2 host bring-up: usb-drd1 (back-left port) and usb-drd2 + * (front ports via the on-board hub). + * The loader powers the controllers and initialises the eUSB2 PHYs in host + * mode before Linux starts (no PMGR, PHY or Type-C driver yet), so the + * controllers are described as plain DWC3 hosts behind their two DARTs. + * Resources are from the 26A434 ADT: dart-usb1/2, usb-drd1/2. + * + * dart-usb1 and dart-usb2 each have two DART instances (ADT reg[0] and + * reg[1], 0xc000 each, sharing one interrupt). t8152-peripherals.dtsi lists + * both windows on one node (dwc3_1_dart, dwc3_2_dart), but the DART driver + * drives one instance per node and the binding reads a second reg entry as + * DAPF or auxiliary registers. Keep instance 0 on the shared node, with its + * own window only, and describe instance 1 as a node of its own. + */ + +&dwc3_1_dart { + reg = <0x4 0x0b020000 0x0 0xc000>; + status = "okay"; +}; + +&dwc3_2_dart { + reg = <0x3 0x83020000 0x0 0xc000>; + status = "okay"; +}; + +/ { + soc { + dwc3_1_dart_1: iommu@40b040000 { + compatible = "apple,t8152-dart", "apple,t8110-dart"; + reg = <0x4 0x0b040000 0x0 0xc000>; + interrupts = ; + #iommu-cells = <1>; + }; + + usb1: usb@40a430000 { + compatible = "snps,dwc3"; + reg = <0x4 0x0a430000 0x0 0xcd00>; + interrupts = ; + dr_mode = "host"; + maximum-speed = "high-speed"; + iommus = <&dwc3_1_dart 0>, <&dwc3_1_dart_1 1>; + snps,dis_u2_susphy_quirk; + snps,dis_u3_susphy_quirk; + }; + + dwc3_2_dart_1: iommu@383040000 { + compatible = "apple,t8152-dart", "apple,t8110-dart"; + reg = <0x3 0x83040000 0x0 0xc000>; + interrupts = ; + #iommu-cells = <1>; + }; + + /* usb-drd2: on-board VL822 hub behind the two front USB-C ports. */ + usb2: usb@382430000 { + compatible = "snps,dwc3"; + reg = <0x3 0x82430000 0x0 0xcd00>; + interrupts = ; + dr_mode = "host"; + maximum-speed = "high-speed"; + iommus = <&dwc3_2_dart 0>, <&dwc3_2_dart_1 1>; + snps,dis_u2_susphy_quirk; + snps,dis_u3_susphy_quirk; + }; + }; +}; diff --git a/arch/arm64/boot/dts/apple/t8152-j873g.dts b/arch/arm64/boot/dts/apple/t8152-j873g.dts index d4900374f1470..0f98b07748b01 100644 --- a/arch/arm64/boot/dts/apple/t8152-j873g.dts +++ b/arch/arm64/boot/dts/apple/t8152-j873g.dts @@ -372,12 +372,6 @@ <0x4 0x3040000 0x0 0xc000>; }; -/* Retain the register view published by this board's live hardware capture. */ -&dwc3_1_dart { - reg = <0x4 0xb020000 0x0 0xc000>, - <0x4 0xb040000 0x0 0xc000>; -}; - /* Retain the register view published by this board's live hardware capture. */ &dwc3_3_dart { reg = <0x4 0x13020000 0x0 0xc000>, @@ -500,18 +494,11 @@ <0x3 0xa0000000 0x0 0x8000>; }; -/* Unexposed chassis port instances remain described and disabled. */ - -/* Retain the register view published by this board's live hardware capture. */ -&dwc3_2_dart { - reg = <0x3 0x83020000 0x0 0xc000>, - <0x3 0x83040000 0x0 0xc000>; -}; - /* * The J873g fragments enable and refine nodes of t8152-peripherals.dtsi - * (the apcie port 2 and dart-sbr DARTs), so they come after it. + * (the USB, apcie port 2 and dart-sbr DARTs), so they come after it. */ #include "t8152-j873-nvme.dtsi" +#include "t8152-j873-usb.dtsi" #include "t8152-j873-ethernet.dtsi" #include "t8152-j873-audio.dtsi" From 26670aa724b0ebf60114629d9c67e52e6180d588 Mon Sep 17 00:00:00 2001 From: Acelogic Date: Sun, 8 Nov 2026 03:58:53 -0500 Subject: [PATCH 2/4] dt-bindings: usb: apple,dwc3: Add T8152 The T8152 (M6) USB-C controllers are Apple DWC3 DRD controllers like those on earlier SoCs, each with its own ATC PHY. There is no T8152 USB power-domain, ATC PHY or Type-C support yet. Instead, the bootloader can hand a controller over already running: powered, with the USB2 side of its ATC PHY set up for host mode. Add a standalone "apple,t8152-dwc3" compatible for such a controller, following the T8132 exception already in this binding. It is described by its DWC3 core region, as a host, so dr_mode = "host" is required. The PHY reset and power domain, and on a Type-C port the USB role switch, exist on T8152 but are left to the bootloader, so they are optional there. Every other compatible still requires reg-names, resets, usb-role-switch and two reg entries. There is no apple,t8103-dwc3 fallback: the T8152 layout of the Apple region is not established, and without its ATC PHY the controller cannot switch roles, so the Apple dwc3 glue must not bind it. When T8152 ATC PHY and Type-C support lands, full Type-C operation can key on resets and usb-role-switch being present, so these minimal descriptions stay valid and the dr_mode rule can be relaxed. Signed-off-by: Acelogic --- .../devicetree/bindings/usb/apple,dwc3.yaml | 54 ++++++++++++++++--- 1 file changed, 48 insertions(+), 6 deletions(-) diff --git a/Documentation/devicetree/bindings/usb/apple,dwc3.yaml b/Documentation/devicetree/bindings/usb/apple,dwc3.yaml index d68a4b68d77ca..df755601429cd 100644 --- a/Documentation/devicetree/bindings/usb/apple,dwc3.yaml +++ b/Documentation/devicetree/bindings/usb/apple,dwc3.yaml @@ -13,6 +13,12 @@ description: Apple Silicon SoCs use a Synopsys DesignWare DWC3 based controller for each of their Type-C ports. + On T8152 the bootloader can hand a controller over already running, powered + and with the USB2 side of its ATC PHY set up for host mode. Such a controller + is described by its DWC3 core region, as a host. Its PHY reset and power + domain, and on a Type-C port its USB role switch, exist but are left to the + bootloader, so they are optional. + allOf: - $ref: snps,dwc3-common.yaml# - if: @@ -20,10 +26,33 @@ allOf: compatible: not: contains: - const: apple,t8132-dwc3 + enum: + - apple,t8132-dwc3 + - apple,t8152-dwc3 then: required: - power-domains + - if: + properties: + compatible: + contains: + const: apple,t8152-dwc3 + then: + properties: + dr_mode: + const: host + required: + - dr_mode + else: + properties: + reg: + minItems: 2 + reg-names: + minItems: 2 + required: + - reg-names + - resets + - usb-role-switch $defs: apple,tunable: @@ -56,16 +85,17 @@ properties: - const: apple,t8103-dwc3 - const: apple,t8103-dwc3 - const: apple,t8132-dwc3 + - const: apple,t8152-dwc3 reg: - minItems: 2 + minItems: 1 items: - description: Core DWC3 region - description: Apple-specific DWC3 region - description: Controller configuration block (T6040) reg-names: - minItems: 2 + minItems: 1 items: - const: dwc3-core - const: dwc3-apple @@ -106,11 +136,8 @@ properties: required: - compatible - reg - - reg-names - interrupts - iommus - - resets - - usb-role-switch unevaluatedProperties: false @@ -131,3 +158,18 @@ examples: usb-role-switch; }; + + - | + #include + #include + + usb@82430000 { + compatible = "apple,t8152-dwc3"; + reg = <0x82430000 0xcd00>; + interrupts = ; + iommus = <&dwc3_2_dart_0 0>, <&dwc3_2_dart_1 1>; + dr_mode = "host"; + maximum-speed = "high-speed"; + snps,dis_u2_susphy_quirk; + snps,dis_u3_susphy_quirk; + }; From 846d101cb4c7be32b91ece8890a7965ce3bfd030 Mon Sep 17 00:00:00 2001 From: Acelogic Date: Sun, 8 Nov 2026 03:58:53 -0500 Subject: [PATCH 3/4] usb: dwc3: core: Bind the Apple T8152 controller On T8152 (M6) the Apple dwc3 glue cannot drive the controller yet: it needs the ATC PHY as reset provider and a Type-C role switch, and T8152 has no driver for either. The bootloader powers the controller, sets up the USB2 side of its ATC PHY for host mode and selects the host role before the kernel starts, which leaves only the DWC3 core to the kernel. Match "apple,t8152-dwc3" in the dwc3 core driver. dwc3_probe() uses no match data, so the controller probes exactly as a "snps,dwc3" node does, and dr_mode, maximum-speed and the quirks are read from the node as before. dwc3-apple does not match this compatible, so only the core binds it. This entry is to move to dwc3-apple once that driver supports the T8152 ATC PHY and Type-C role switch, so that the two never match the same compatible. Signed-off-by: Acelogic --- drivers/usb/dwc3/core.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c index 7f68eba95e1f1..3566533dda5a2 100644 --- a/drivers/usb/dwc3/core.c +++ b/drivers/usb/dwc3/core.c @@ -2962,6 +2962,10 @@ static const struct of_device_id of_dwc3_match[] = { { .compatible = "synopsys,dwc3" }, + { + /* Handed over in host mode by the bootloader, see apple,dwc3.yaml */ + .compatible = "apple,t8152-dwc3" + }, { }, }; MODULE_DEVICE_TABLE(of, of_dwc3_match); From 35833f6358e400ef01d27c4ef38fb7ecf9b8d88d Mon Sep 17 00:00:00 2001 From: Acelogic Date: Sun, 8 Nov 2026 03:58:53 -0500 Subject: [PATCH 4/4] arm64: dts: apple: j873: Describe the USB 2 hosts as T8152 DWC3 The back-left (usb-drd1) and front (usb-drd2) USB 2 host nodes are "snps,dwc3" with two iommus, one per DART instance. The generic dwc3 binding allows a single iommu, so dtbs_check rejects both nodes. Use the T8152 Apple dwc3 compatible instead. It allows both DART instances and documents the bootloader handover these nodes rely on. Nothing else changes: the nodes keep their core region, interrupt, DARTs, host mode, speed limit and SUSPHY quirks, and the same dwc3 core driver binds them. Signed-off-by: Acelogic --- arch/arm64/boot/dts/apple/t8152-j873-usb.dtsi | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/arch/arm64/boot/dts/apple/t8152-j873-usb.dtsi b/arch/arm64/boot/dts/apple/t8152-j873-usb.dtsi index 5ecd42f9e7135..6f1a956bd68e3 100644 --- a/arch/arm64/boot/dts/apple/t8152-j873-usb.dtsi +++ b/arch/arm64/boot/dts/apple/t8152-j873-usb.dtsi @@ -2,9 +2,12 @@ /* * J873g USB2 host bring-up: usb-drd1 (back-left port) and usb-drd2 * (front ports via the on-board hub). - * The loader powers the controllers and initialises the eUSB2 PHYs in host - * mode before Linux starts (no PMGR, PHY or Type-C driver yet), so the - * controllers are described as plain DWC3 hosts behind their two DARTs. + * The loader powers the controllers and sets up the USB2 side of their ATC + * PHYs for host mode before Linux starts (there is no T8152 USB power-domain, + * ATC PHY or Type-C support yet). + * The controllers are described by their DWC3 core region, as hosts behind + * their two DARTs (apple,t8152-dwc3); their PHY reset and power domain, and on + * the Type-C port the role switch, exist but are left to the loader. * Resources are from the 26A434 ADT: dart-usb1/2, usb-drd1/2. * * dart-usb1 and dart-usb2 each have two DART instances (ADT reg[0] and @@ -35,7 +38,7 @@ }; usb1: usb@40a430000 { - compatible = "snps,dwc3"; + compatible = "apple,t8152-dwc3"; reg = <0x4 0x0a430000 0x0 0xcd00>; interrupts = ; dr_mode = "host"; @@ -54,7 +57,7 @@ /* usb-drd2: on-board VL822 hub behind the two front USB-C ports. */ usb2: usb@382430000 { - compatible = "snps,dwc3"; + compatible = "apple,t8152-dwc3"; reg = <0x3 0x82430000 0x0 0xcd00>; interrupts = ; dr_mode = "host";