Skip to content

arm64: dts: apple: t6040: take the PCIe-C tunables from the ADT at boot - #3643

Merged
RyanTheTide merged 1 commit into
aurora-silicon:mainfrom
petrskuta:fix/t6040-pciec-adt-tunables
Nov 30, 2026
Merged

RyanTheTide merged 1 commit into
aurora-silicon:mainfrom
petrskuta:fix/t6040-pciec-adt-tunables

Conversation

@petrskuta

Copy link
Copy Markdown
Contributor

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 the usb4-N-pcie controller (apple,tunable-debug, -fabric, -rc) and its apcie-config table onto the port (apple,tunable), appending to whatever the DT already has. For dart-apciecN it fills the DART's apple,tunable only 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's status = "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's apple,tunable-debug, -fabric, -rc, the port's apple,tunable and the DART's apple,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's boot-ctxr.bin with only the J614s DTB swapped). The trial DTB was built at 5e3fa331 (this change on f5299c07); 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:

fabric rc debug port DART
normal boot (literals + ADT copy) 840 96 24 72 72
this change (ADT copy only) 420 48 12 36 72
  • All 15 tables on the trial boot compared value by value with the removed literals: 15 identical, 0 different.
  • Tunnel 2: cold init done, status 0x3 link 0xa9000200 and pcie-apple 1c70000000.pcie: Link up. JHL7440 bridges and USB controller 0001:03:00.0 present; Studio Display USB2 hub, USB3 Gen2 hub (10 Gb/s) and display device enumerated; camera nodes and USB-Audio - Studio Display present. Same as the normal boot with the same displays and cables.
  • Kernel err-level lines: the SEP's "matching unavailable" (as on the release kernel) and 3 of the external display DART timeouts (602300000.iommu, not a PCIe-C DART), which this unit's normal boots log 1 to 35 times each.

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>
@petrskuta
petrskuta requested review from a team as code owners November 29, 2026 17:38

@aurora-silicon-review aurora-silicon-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 literal apple,tunable (DART and port) and apple,tunable-{debug,rc,fabric} (controller) arrays across T6040_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, and status = "okay" on the DART, controller, and PIO DMA nodes.
  • Verified arch/arm64/boot/dts/apple/t6040-usb4.dtsi (shared by all T6040 boards via t6040.dtsi: J614s, J616s, J616s tether, J773s) already provides usb4-{0,1,2}-pcie aliases and usb4_{0,1,2}_pcie_port child nodes.
  • Verified aura src/kboot.c on main exports all 5 tables per port from the Mac's ADT (dt_copy_pciec_tunables() for atc-apcie-{debug,fabric,rc}-tunables + apcie-config-tunables via usb4-N-pcie, and dt_copy_dart_tunables() for dart-apciec), eliminating the doubled controller/port arrays (840/96/24/72 -> 420/48/12/36 bytes).
  • 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.dtsi L12-21: defines usb4-0-pcie, usb4-1-pcie, usb4-2-pcie aliases for all boards including t6040.dtsi (L973 includes t6040-pciec.dtsi).
  • aura src/kboot.c L4001-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/15 tables identical to removed literals, tunnel 2 link up and Studio Display peripherals working.

@github-actions github-actions Bot added area:bringup Area from CODEOWNERS (bot) blast:m4 Macs affected, from Merge risk (bot) door:two-way Revertible or not, from Merge risk (bot) needs-review No approving review from Core or Omarchy Mac yet (bot) labels Nov 29, 2026
@github-actions

github-actions Bot commented Nov 29, 2026 •

Copy link
Copy Markdown

Merge readiness at b001214e: not ready yet

Check Detail
CI at head no failing: host-tests
Review no needs one approving review from Core or Omarchy Mac (not the author)
Requested changes ok none
Hardware row at head ok in the PR body at b001214e
Conflicts ok none
PR text ok Risk: two-way · 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.

Areas: area:bringup

Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels.

@github-actions github-actions Bot added the ci-failing A check failed at the PR head (bot) label Nov 29, 2026
@petrskuta petrskuta closed this Nov 30, 2026
@petrskuta petrskuta reopened this Nov 30, 2026
@petrskuta

Copy link
Copy Markdown
Contributor Author

The red host-tests run tested this PR merged onto de965eb5, which predates #3627. apple-scaler-recovery-tests failed there because the harness's extracted production.c stopped compiling (field 'hdl' has incomplete type, unknown type name 'u16'). #3627 fixed that harness and is on main. This PR changes only t6040-pciec.dtsi. I reopened it so CI runs against the current main; the head is still b001214e.

@RyanTheTide

Copy link
Copy Markdown
Contributor

code-owner ping <@422957901716652033> / @DjDeveloperr: merge train at b001214e. App approved; rows J614s, DT-only, DTB-identical-to-booted. Merges under the 6-point rule 1 h from now once hosted CI (and the KUnit proof) is green, unless you object.

@RyanTheTide

Copy link
Copy Markdown
Contributor

Merging under the 6-point rule (Ryan 09:29, permanent), at b001214e. (1) The review App approved at this head. (2) Full CI is green. Hosted pr-text is still queued; the canonical pr-text.sh passes locally on this body. (3/4) Rows: J614s;DT-only;DTB-identical-to-booted. (5) There's no blocking review. (6) Dj was pinged here 167 min ago with no objection. Revert: git revert -m 1 <merge>.

@RyanTheTide
RyanTheTide merged commit 27284bf into aurora-silicon:main Nov 30, 2026
8 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:bringup Area from CODEOWNERS (bot) blast:m4 Macs affected, from Merge risk (bot) ci-failing A check failed at the PR head (bot) door:two-way Revertible or not, from Merge risk (bot) needs-review No approving review from Core or Omarchy Mac yet (bot)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants