Repository navigation
arm64: dts: apple: t8132-j773g: USB4/Thunderbolt on the Mac mini's rear ports - #2641
DjDeveloperr wants to merge 4 commits into
Conversation
|
An early read before the J773g rows:
Assisted-by: LLM (Claude:Opus 5.5) |
|
Hardware row, Mac mini M4 (J773g), macOS 27.2 firmware, 2026-11-20: Back Middle USB4 PASS This PR's DT commits on the board's bring-up kernel, with aura #339 for the USB3 calibration. Back Left's router stayed disabled in this run. The pcie-apple.c commit was not in this kernel; ACIO0's tunnel doesn't need it.
|
6a67ca8 to
5cf253b
Compare
|
Force-pushed (5cf253b): rebased on current integration/aurora. ACIO3's router DART and tunnel DART now carry their engines' power domains (ps_atc3_cio, ps_atc3_cio_pcie), as ACIO0/1's do on integration. The dt-checks DART power-domain lint passes locally (0 new findings). No other change. |
5cf253b to
fa6585a
Compare
|
Re-review of fa6585a: Blockers: 1. From our last comment:
Since then: 5cf253b added the power domains, and fa6585a is a rebase with identical PR file contents. Nothing else changed. HW row: J773g on this head (with the pcie-apple.c commit) with a USB4 partner on Back Right: Assisted-by: LLM (Claude:Opus 5.5) |
Without the CIO calibration the ATC PHY driver serves a USB4 or
Thunderbolt partner on the Mac mini's rear ports as USB2 only. The boot
chain passes the SuperSpeed calibration on, but not the CIO one, so
describe it here as the J713 and J604 do.
The values are the J773g's own, converted from its ADT (macOS 27.2; the
26.6.2 ADT has the same tables) for atc-phy0, atc-phy1 and atc-phy3, the
PHYs of the three rear ports. ATC2 drives the front ports' on-board hub
and has no host router. Each property lists these ADT tunables in this
order, each entry at its ADT offset plus the block's offset in the bank:
cio-axi2af tunable_ATCAXI2AF, _WR_DIS, _LOCK_LOCK (axi2af bank)
cio-lioa tunable_ATCAXI2AF_LIOA_IOA (lioa bank)
cio-fabric tunable_ATC_FABRIC (fabric bank)
cio-config tunable_ATC_COMMON_CFG (common-config bank)
cio-common tunable_AUSCMN_DIG +0x800, AUSPLL_CORE +0x2200,
CIO3PLL_CORE +0x2a00, CIO3PLL_TOP +0x2800,
ACIOPHY_PLL_TOP +0x1000, CIO_SHIM +0x4000,
ACIOPHY_TOP +0x0 (core bank)
cio-laneN tunable_LNn_RX_TOP_CIO_DFLT, RX_SHM_CIO_DFLT,
TX_TOP_CIO_DFLT, TX_SHM_CIO_DFLT at +0x9000, +0xb000,
+0xc000, +0xd000 (lane 1: +0x7000 more)
cio-laneN-eq tunable_LNn_RX_EQ_CIO_EQA at +0xa000 (lane 1: +0x11000)
cio-post tunable_AUSCMN_SHM +0xa00, CLKMON_CFG +0x2600
This is the J713 file's layout: from the J773g ADT it gives the J713
file's register offsets entry for entry, and the J713's own values but
for the per-PHY PLL and common-block words (AUSPLL_CORE +0x40,
CIO3PLL_CORE +0x4c, AUSCMN_SHM +0x4). The J773g lists carry three more
entries per lane, kept in ADT order: RX_TOP_CIO_DFLT has a fifth one
(+0x280) and RX_EQ_CIO_EQA a 22nd one, a second write of +0xc0.
Every offset fits the bank the driver applies it to. Nothing on the boot
path changes: the CIO calibration is applied only when the port
controller reports a USB4 or Thunderbolt partner.
Signed-off-by: Diljit Singh <hey@djdev.me>
The T8132's ATC3 has a USB4/Thunderbolt host router of its own (ADT acio3), which the J773g's Back Right port uses. Describe it, disabled, next to the SoC's other ATC2/ATC3 nodes in t8132-atc23.dtsi, in the form of ACIO0 and ACIO1 in t8132-usb4.dtsi: the router with its mailbox, DART, NHI and LSTX pin, and its PCIe tunnel (ADT apciec3) with the tunnel's DART and calibration. ATC2 has no host router. From the J773g ADT (macOS 26.6.2 and 27.2 agree): - acio3, acio-cpu3, dart-acio3, apciec3, dart-apciec3 and apciec3-piodma: the same block offsets as ACIO0's, 0x18000000 above them, and interrupts 186 above, three times ACIO1's step. The NHI rings are listed as for ACIO0/ACIO1, the lower block (1473..1484) first. - The router's SRAM is the DATA segment of iop-acio3-nub. - LSTX is AOP GPIO 23 (acio3 gpio-lstx, as 17 and 19 for ACIO0/1). - The CIO reconfiguration is CIO3_RECONFIG (acio3 rid 3): reset 3. - PMGR: ATC3_CIO, ATC3_CIO_PCIE, ATC3_CIO_USB and ATC3_PCIE, the domains at 0x4a0, 0x4b0, 0x4b8 and 0x498. - MSI: the pcic3-bridge slice, vectors 0xc0..0xdf of the window at AIC 1506 (apciec3 msi-vector-offset). - PCIe-C, tunnel DART and OE fabric calibration: apciec3's atc-apcie-*-tunables and apcie-config-tunables, dart-apciec3's dart-tunables-instance-0 and apciec3-piodma's oe-fabric tunables. They match apciec0/1's (t8132-pciec-tunables.dtsi). The same check against the J773g ADT finds ACIO0 and ACIO1 in t8132-usb4.dtsi as the ADT has them. Boards that include this file get the new nodes disabled (the tunnel container is populated only by its router), so no DTB changes behaviour. Signed-off-by: Diljit Singh <hey@djdev.me>
The Mac mini's three rear USB-C ports have a USB4/Thunderbolt host router each, as its ADT's nub-spmi-a0 port controllers name them (acio-parent): Back Middle (hpm0, ATC0) is ACIO0, Back Left (hpm1, ATC1) ACIO1 and Back Right (hpm3, ATC3) ACIO3. Enable the three routers with their mailboxes, link each to its port controller's connector (port@2) as the J713 does, and give the routers' PMGR domains to Linux: without a board status the T8132 PMGR policy keeps them disabled. The front ports have no router. The routers' calibration and DROMs are the J773g's own, converted from its ADT (acio0, acio1, acio3; the 26.6.2 and 27.2 ADTs agree) the way the boot loader converts them: - apple,tunable-rc: top_tunables, hbw_fabric_tunables at +0x4000 and lbw_fabric_tunables at +0x8000; - apple,tunable-pcie-adapter: pcie_adapter_regs_tunables; - apple,tunable-nhi: hi_up_tx_desc (+0xf0000), hi_up_tx_data (+0xec000), hi_up_rx_desc (+0xe8000), hi_up_wr (+0xf4000), hi_up_merge (+0xf8000), hi_dn_merge (+0xfc000) and fw_int_ctl_management (+0x4000) fabric tunables; - apple,thunderbolt-drom: thunderbolt-drom as the ADT has it. They are the J713's values but for one top_tunables word (0xac: 0x80008000 here, 0x5ce75ce7 on the J713), and ACIO3's equal ACIO0's but for its DROM. The DROMs keep the ADT's router UUID field, which holds the router index; a boot loader that fills these through the usb4-N-* aliases replaces it with a per-machine UUID. Signed-off-by: Diljit Singh <hey@djdev.me>
The T8122, T8132 and T6040 PCIe-C hosts share one AIC MSI window, and each bridge owns a 32-vector slice of it: the ADT bridge's msi-vector-offset, which the device tree gives as apple,msi-vector-base, with the slice's first AIC interrupt in msi-ranges. apple_msi_init() refused any slice it could not find in a per-SoC table of ECAM apertures and AIC window bases, so a bridge the table left out never got MSIs. The T8132's third USB4 router (ACIO3, the Mac mini's Back Right port, ECAM 0x1c80000000, slice 0xc0) is one: its PCIe tunnel failed with "invalid or missing MSI slice", and so would any new bridge. Take the slice from the device tree, and check both its shape (32 vectors, 32-aligned, above the internal host's first slice, inside the 8-bit map target) and its alignment with the shared window: derive the window's first AIC interrupt from the internal PCIe host's msi-ranges on the same interrupt controller, and require msi-ranges_irq - apple,msi-vector-base to equal that window base. Every device tree that passed the table check passes this one with the same slice, while any DT whose apple,msi-vector-base and msi-ranges disagree is refused. The fix-up for the old experimental T6030 boot DTs, which gave every host the whole window and no apple,msi-vector-base, keeps its ECAM table: those DTs name the bridge only by its aperture. Signed-off-by: Diljit Singh <hey@djdev.me>
fa6585a to
07685b5
Compare
|
Rebased onto
The J773g ACIO3 and T6040 hardware rows remain pending. Assisted-by: LLM (Gemini:4 Neon) |
|
Re-review of 07685b5: No blockers. From our last comment:
Since our comment only pcie-apple.c changed (the three DT commits have the same patches as the previous head). The window lookup drops its node references on every path, including the early return, and it skips tunneled and HW row: J773g on 07685b5 with a USB4 partner on Back Right: no Assisted-by: LLM (Claude:Opus 5.5) |
Problem
On the Mac mini M4 (J773g), a USB4 or Thunderbolt partner on any of the three rear ports gets no data at all. The SN201202x port controllers enter USB4 by themselves, for example with a USB4 NVMe enclosure or another Mac. The ATC PHY has no CIO calibration, so it refuses the mux state, and the device tree has no host router to tunnel through. On the mini (macOS 27.2 firmware, 7.3.0-m4drv8), every boot logs this for Back Middle (USB4 NVMe enclosure: USB4_STATUS mode 0x07, EUDO 0x2667e000) and for Back Left (another Mac):
macOS runs all three rear ports as USB4/Thunderbolt.
Change
apple,msi-vector-base), not from a per-SoC table of ECAM apertures. The table had no entry for ACIO3's tunnel (0x1c80000000, slice 0xc0), so it would fail with "invalid or missing MSI slice". Every DT that passed the table passes this check with the same slice. The fix-up for old T6030 boot DTs keeps its table.No other T8132 board changes: J713 and J623 DTBs are byte-identical, and J604/J624 gain only the disabled ACIO3 nodes. The W=1 warnings are unchanged; on J604 one existing warning moves by three lines.
Testing
-19/cable revalidation failederrors on this port are gone.pcieport 0001:02:00.0: of_irq_parse_pci: failed with rc=-22(the enclosure's downstream bridge) is generic PCI core behaviour, not something this PR adds. WithCONFIG_PCI_DYNAMIC_OF_NODESa bridge's dynamicinterrupt-mapis built before its children are scanned, so INTx behind the tunnel can't be resolved. Every device there uses MSI/MSI-X, as on macOS.Related: #1702 and #1703 (USB2 fallback for USB4/TBT partners on T8132 ports without CIO calibration) remain the path for boards with no router or calibration.
Assisted-by: LLM (Claude:Opus 5.5)