Repository navigation
arm64: dts: apple: t6040: take the PCIe-C tunables from the ADT at boot - #3643
Conversation
The boot loader already copies the PCIe-C tunables from the Mac's ADT into the device tree: apciecN's atc-apcie-debug, -fabric and -rc tables and its apcie-config table onto the usb4-N-pcie controller and its port, and dart-apciecN's table into the DART's apple,tunable when the device tree carries none. On the J614s the controller and port tables arrived twice, the ADT's copy appended to identical literals. Drop the literal tables, so the values come from the machine at boot and none are in source. The DART window, its bypass streams, error reporting, CTC flush and power domain stay. Signed-off-by: Petr Škuta <20834920+petrskuta@users.noreply.github.com>
There was a problem hiding this comment.
Verdict: MERGE at b001214e8fe1
Blockers: None (clean DT cleanup removing duplicated/hardcoded PCIe-C tunable tables with exact-head J614s verification; approve and wait for fork PR dt-checks / readiness CI to complete green before merging).
Checked:
- Verified
arch/arm64/boot/dts/apple/t6040-pciec.dtsi: drops only the literalapple,tunable(DART and port) andapple,tunable-{debug,rc,fabric}(controller) arrays acrossT6040_PCIEC(0..2)while keeping the DART DMA window,apple,bypass-sids = <253 255>,apple,full-error-reporting,apple,ctc-flush,apple,pciec-kernel-init, andstatus = "okay"on the DART, controller, and PIO DMA nodes. - Verified
arch/arm64/boot/dts/apple/t6040-usb4.dtsi(shared by all T6040 boards viat6040.dtsi: J614s, J616s, J616s tether, J773s) already providesusb4-{0,1,2}-pciealiases andusb4_{0,1,2}_pcie_portchild nodes. - Verified
aurasrc/kboot.conmainexports all 5 tables per port from the Mac's ADT (dt_copy_pciec_tunables()foratc-apcie-{debug,fabric,rc}-tunables+apcie-config-tunablesviausb4-N-pcie, anddt_copy_dart_tunables()fordart-apciec), eliminating the doubled controller/port arrays (840/96/24/72->420/48/12/36bytes). - Verified DCO sign-off and J614s (
M4 Pro,T6040,aura 1.0.0b14) hardware evidence: all 15 ADT-supplied tables match the removed literals value-for-value, Studio Display on tunnel 2 enumerates (JHL7440 bridges, USB2/USB3 10 Gb/s hubs, camera, USB-Audio), 0 failed units.
Evidence
arch/arm64/boot/dts/apple/t6040-usb4.dtsiL12-21: definesusb4-0-pcie,usb4-1-pcie,usb4-2-pciealiases for all boards includingt6040.dtsi(L973includest6040-pciec.dtsi).aurasrc/kboot.cL4001-4072 (dt_copy_pciec_tunables) and L3696-3706 / L14130-14131 (dt_copy_dart_tunables): confirmed every dropped tunable property is supplied from the ADT at boot.- J614s hardware row: property byte lengths halved from doubled literals+ADT (
840/96/24/72) to single ADT copy (420/48/12/36),15/15tables identical to removed literals, tunnel 2 link up and Studio Display peripherals working.
|
Merge readiness at
Areas: Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels. |
|
The red |
|
code-owner ping <@422957901716652033> / @DjDeveloperr: merge train at |
|
Merging under the 6-point rule (Ryan 09:29, permanent), at |
What: drops the literal PCIe-C tunable tables from
t6040-pciec.dtsi. The boot loader already copies them from each Mac's ADT, so on T6040 the controller and port tables were applied twice (the ADT's copy appended to identical literals), and the values were in source instead of coming from the machine.Tested: J614s M4 Pro, the change at
b001214e(booted as the same commit on its previous base, whose J614s DTB is byte-identical to this unit's running one): every table arrives once from the ADT, all 15 values identical to the removed literals, and a Studio Display on tunnel 2 links up with its USB hubs, camera and audio as before, 0 failed units.Risk: two-way door · T6040 (J614s, J616s, J616s tether, J773s). With a boot loader that doesn't copy these tables, the DART has no table and the kernel doesn't cold-initialize the port, so PCIe-C stays off there rather than running on wrong values.
Not yet: J616s and J773s boots at this head; boot loaders older than aura 1.0.0b14.
Details
The boot loader (aura 1.0.0b14 here) copies, for each
apciecN, the ADT's debug, fabric and rc tables onto theusb4-N-pciecontroller (apple,tunable-debug,-fabric,-rc) and itsapcie-configtable onto the port (apple,tunable), appending to whatever the DT already has. Fordart-apciecNit fills the DART'sapple,tunableonly when the DT carries none. With the literals in place, the J614s ran with every controller and port table doubled. The DART window, its bypass streams, error reporting, CTC flush and power domain stay in the DT, as do#3512'sstatus = "okay"lines and the PIO DMA enable; the now-empty port node goes.Built DTBs,
main(de965eb5) vs this head, for every board that includes the file: J614s, J616s, J616s tether and J773s each differ by exactly 15 removed properties (per port: the controller'sapple,tunable-debug,-fabric,-rc, the port'sapple,tunableand the DART'sapple,tunable) and nothing else.Evidence
J614s, kernel
7.3.0-pr2069+, default command line, aura 1.0.0b14, one-shot aura-try Stage 2 (this Mac'sboot-ctxr.binwith only the J614s DTB swapped). The trial DTB was built at5e3fa331(this change onf5299c07);f5299c07's J614s DTB is byte-identical to the one in the unit's live Stage 2, so the boot differed from the normal one by this change only.Property sizes under
/proc/device-tree/usb4-pcie-tunnel-N/(bytes), all three tunnels alike:cold init done, status 0x3 link 0xa9000200andpcie-apple 1c70000000.pcie: Link up. JHL7440 bridges and USB controller0001:03:00.0present; Studio Display USB2 hub, USB3 Gen2 hub (10 Gb/s) and display device enumerated; camera nodes andUSB-Audio - Studio Displaypresent. Same as the normal boot with the same displays and cables.602300000.iommu, not a PCIe-C DART), which this unit's normal boots log 1 to 35 times each.