Skip to content

arm64: dts: apple: t604x: enable ADT-present peripherals and move tunnel PIODMA (on #3512) - #3559

Merged
RyanTheTide merged 9 commits into
mainfrom
feat/dt-complete-t604x
Nov 29, 2026
Merged

RyanTheTide merged 9 commits into
mainfrom
feat/dt-complete-t604x

Conversation

@RyanTheTide

@RyanTheTide RyanTheTide commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

What: Enable safe ADT-present peripheral blocks across the T6040 (M4 Pro) and T6041 (M4 Max) shared device trees (t604x.dtsi, t6040*.dtsi, t6041*.dtsi, t6040-j616s.dts, t6040-j773s.dts) and move apciec0..2_piodma into their usb4-pcie-tunnel-{0..2} containers as dma@ nodes. Reduces disabled nodes by -113 across all 7 T604x DTBs (1639 -> 1526). Stacked on #3512 (638bd1cb34ba).

Tested:

  • Local build and schema validation at b4918049efe896 across all 7 T604x DTBs (and all 139/139 Apple DTBs): CHECK_DTBS=y 7 -> 7 (0 new warnings), apple-adt-coverage.py (t6040-j616s) MISSING=0 mapped=595 waived=307 broken=0, apple-dart-pd-check.py 13 -> 13 (0 new), apple-sibling-drift.py 146 -> 146 (0 new), scripts/checkpatch.pl --strict 0 errors / 0 warnings / 0 checks.
  • Primary target (J616s M4 Pro, t6040) guarded DT-only boot row at exact b4918049efe896: PASS (receipt): trial Stage 2 3b6f79f1a2f8a084 on saved 7.3.0-aurora-fleet89, FCHECK PASS (s2idle via rtc1 rc=0, ping 0% before/after, fault-lines=0, avc=0, deferred=0), TUNCHECK PASS acio_okay=3 tunnels_okay=3, row VERDICT PASS (baseline/trial/post-restore), 32/32 newly enabled nodes verified okay in live /sys/firmware/fdt, both review-protected nodes verified disabled, 0 new kernel errors (2 -> 2), restored clean (dc24e24452dfa082).
  • Second-family control (J615 M3 Air, t8122) guarded DT-only boot row at exact b4918049efe896: PASS (receipt): trial Stage 2 c5d7ef6ceb959d97 on saved 7.3.0-aurora-fleet90-airs2, FCHECK PASS (s2idle via rtc0 rc=0, fault-lines=0, avc=0), row VERDICT PASS (baseline/trial/post-restore), clean merge on main (4ffd63af1907) produces byte-identical t8122-j615.dtb (887035d64a0a95c5) and t6000-j316s.dtb (93578f4084e42da7), restored clean (dd01f13c34bbce63).

Risk: two-way · Apple M4 Pro / M4 Max (T6040/T6041, 7 boards); DT-only delta over #3512, zero changes to non-T604x DTBs or kernel code.

Not yet: Waiting on stacked base #3512 to merge and GitHub Actions CI checks to finish green at b4918049efe896.

Revert: git revert <merge-sha> restores every T604x DTB to main with no kernel/userspace/firmware state dependencies.

Before you request review
  • Checked for overlapping work and linked dependencies or stacked base (stacked on arm64: dts: apple: t6040: PCIe-C tunnels on every M4 Pro (on #2069) #3512 638bd1cb34ba; disjoint from active display/GPU/audio PRs).
  • Required CI is green at this head.
  • Feature row on the target Mac (J616s) and second-family control (J615) at this head with production defaults.
  • Exercised the failure paths that apply, including schema validation, ADT coverage manifest sync, DART power-domain checks, sibling drift checks, and keeping unsafe/loader-gated/unbacked/unhanded blocks disabled. Checked the full diff against the shared checklist.
Details

Shared .dtsi first across T6040 (M4 Pro) and T6041 (M4 Max):

  • t604x.dtsi: enable i2c4, i2c6, and i2c8 (ps_i2c4/6/8 and pinmux already active).
  • t6040.dtsi / t6040-pmgr.dtsi: enable nub_spmi3/nub_spmi4 (no interrupts, with apple,always-on ps_nub_spmi3/ps_nub_spmi4), aop_spmi0 (already enabled on j616s, j773s, j575c, j616c), and serial0 with ps_uart0. Keep pinctrl_smc disabled with its hardware interrupt description intact until a consumer and SMC IRQ handoff exist.
  • t6040-peripherals.dtsi: enable aon_ptd, cpu_debug, atc{0,1,2}_dpin{0,1}, battery_monitor (kept disabled on desktop Mac mini t6040-j773s.dts), and radio_pmu; document why peripheral_clocks stays disabled.
  • t6040-usb4.dtsi / t6040-pciec.dtsi / adt-coverage/t6040-j616s.txt: move apciec{0,1,2}_piodma into usb4_{0,1,2}_pcie_tunnel as dma@ nodes, enable via T6040_PCIEC(), and update the 3 J616s ADT coverage paths.
  • t6040-j616s.dts: enable sd_card_control, display_pcon, and retimer@18/19/1a; keep the DP855 downstream i2c bus and its three tmp103 sensors disabled (DP855 refuses AP accesses with ack 3 while the panel is on and reads zero while off).
  • t6041.dtsi / t6041-j614-j616-j575-scaler.dtsi: enable aop_spmi0, ps_aes/aes, aon_ptd, ps_scodec/ps_scodec_streaming/apr0_dart/apr0, and shared scaler0/scaler1 plus their DARTs and power domains; document why max_scaler_clocks stays disabled.
  • Kept disabled: unsafe dcuart, pinctrl_smc, DP855 downstream i2c/tmp103, loader-gated DCP/DCPEXT/SEP/SIO/AVE1/PMP reports, desktop-absent battery_monitor on j773s, and unbacked clock providers (peripheral_clocks, max_scaler_clocks).
Evidence

Local validation vs #3512 (638bd1cb34ba):

  • make ARCH=arm64 CHECK_DTBS=y across all 7 t604*.dtb (and all 139/139 Apple DTBs compile cleanly): 7 -> 7 (0 new warnings)
  • scripts/dtc/apple-adt-coverage.py (t6040-j616s): MISSING=0 mapped=595 waived=307 broken=0 total=902
  • scripts/dtc/apple-dart-pd-check.py: 13 -> 13 (0 new)
  • scripts/dtc/apple-sibling-drift.py: 146 -> 146 (0 new)
  • scripts/checkpatch.pl --strict: 0 errors, 0 warnings, 0 checks

Disabled-node counts (#3512 -> feat/dt-complete-t604x b4918049efe896, total -113):

Board Base Head Delta
t6040-j614s.dtb 205 183 -22
t6040-j616s.dtb 194 171 -23
t6040-j616s-tether.dtb 199 176 -23
t6040-j773s.dtb 223 203 -20
t6041-j575c.dtb 284 278 -6
t6041-j614c.dtb 277 261 -16
t6041-j616c.dtb 257 254 -3
Total (7 DTBs) 1639 1526 -113

petrskuta and others added 8 commits November 25, 2026 07:01
t6040_pciec_hw was modelled on T8132: the kernel_init (oe-fabric) cold
init, the T8132 port reset values and SID-indexed RID2SID slots. The
ADT's apciec,t6040 has no oe-fabric region (config, rc, port0, fabric,
debug, ioa, ltssm, intr2axi), so cold init failed mapping it (-ENODATA).
Its fabric, rc, debug, config and DART tunables are T6050's with small
value differences.

Make it an Intr2AXI controller with T6050's no_port_reset, and allocate
RID2SID slots as T6050 does: with iommu-map-mask 0xff the Studio
Display's xHCI (RID 0x300) and its Thunderbolt bridge (RID 0x100) share
SID 0, and an SID-indexed slot failed the xHCI's enable with a silent
-EBUSY ("Can't enable PCI device, BIOS handoff failed").

Tested on the J614s with a Studio Display (2022) on the left port: cold
init completes (link up), the display's Titan Ridge bridges and xHCI
enumerate and xhci_hcd binds, #1589.

Signed-off-by: Petr Škuta <[email protected]>
Enable the left port's tunneled PCIe (usb4_0_pcie_tunnel, apciec0_dart,
usb4_0_pcie) and keep the ACIO's apple,pcie-tunnel, so a Thunderbolt
device's PCIe functions reach a root port. No boot loader hands the port
over, so the kernel cold-initializes it (apple,pciec-kernel-init).

From the j614s ADT (macOS 26 IODeviceTree) apciec0 and dart-apciec0:
- the controller's fabric, rc and debug tunables and the port's config
  tunables;
- the DART's tunables and its DMA window: vm-base 1 TiB + 2 GiB, vm-size
  0x7ff00000, the first 16 KiB a dead mapping;
- bypass streams 253 and 255 (bypass-253, bypass-255): the port's own
  writes, its MSIs turned into AIC writes, use them. Without the bypass
  no MSI arrived (xHCI "Command Aborted") and the DART fault IRQ stormed.
As on T6050's PCIe-C DART: full error reporting, CTC flush and the ATC0
PCIe power domain.

Tested on the J614s with a Studio Display (2022): its USB2 and USB3 Gen2
hubs, speakers and microphones (snd-usb-audio), camera (uvcvideo), HID
and a USB-C port (a USB 3.1 drive at 5 Gb/s) work,
#1589.

Signed-off-by: Petr Škuta <[email protected]>
The ADT's apciec0-2 and dart-apciec0-2 carry identical tunables, DMA
windows and bypass streams, so describe the PCIe-C of the left port once
in t6040-j614s-pciec.dtsi and use it for all three ports. Port 0 is
unchanged; ports 1 and 2 keep their ACIO's apple,pcie-tunnel now.

Signed-off-by: Petr Škuta <[email protected]>
The PCIe-C DART window, bypass streams and the DART, controller and
port tunables are T6040 SoC data: the J616s ADT carries the same values
as the J614s for apciec0-2 and dart-apciec0-2. Move them from
t6040-j614s-pciec.dtsi to t6040-pciec.dtsi, included by t6040.dtsi, so
a T6040 board only enables the tunnel, DART and controller of each port.

The J614s DTB is unchanged. Other T6040 boards gain the properties on
nodes that stay disabled.

Signed-off-by: Petr Škuta <[email protected]>
Signed-off-by: Ryan Murray <[email protected]>

# Conflicts:
#	arch/arm64/boot/dts/apple/t6040.dtsi
The PCIe-C tunnels (apciec0-2 with dart-apciec0-2) are part of the T6040
and have no board wiring: the J614s, J616s and J773s ADTs all list the
same three controllers and DARTs with identical tunables. Enable the
tunnel, its DART and its controller in t6040-pciec.dtsi instead of in
each board, and stop deleting the routers' apple,pcie-tunnel link on the
J616s, which left an enclosure on any of its Thunderbolt ports without
PCIe.

Nothing comes up on its own: a controller is only populated when its
USB4 router, which the board enables, asks for a PCIe tunnel. On boards
whose routers are still off (J773s) the nodes stay idle.

The J614s and T6041 DTBs are unchanged; the J616s and J616s tether DTBs
gain the three tunnels.

Signed-off-by: Ryan Murray <[email protected]>
Each PCIe-C DART sits in its port's ATC PCIe power domain. Now that the
tunnels are enabled on every T6040 board, enable that domain with them,
so a board that does not enable it itself (J773s) does not carry an
enabled DART on a disabled domain. The J614s and J616s already enable
these domains; their DTBs are unchanged.

Signed-off-by: Ryan Murray <[email protected]>
Enable ADT-present peripherals across the T6040 (M4 Pro) and T6041
(M4 Max) shared device trees, and move the T6040 PCIe-C tunnel PIODMA
engines into their usb4-pcie-tunnel containers so ACIO populates and
tears them down with each tunnel:

- t604x.dtsi: enable i2c4, i2c6, and i2c8 (power domains and pinmux
  already active in shared files).
- t6040.dtsi / t6040-pmgr.dtsi: enable pinctrl_smc without
  interrupt-controller (SMC firmware owns its IRQ groups, matching
  pinctrl_nub), nub_spmi3/4 with ps_nub_spmi3/4, aop_spmi0, and
  serial0 with ps_uart0.
- t6040-peripherals.dtsi: enable aon_ptd, cpu_debug, atc0..2_dpin0/1,
  battery_monitor (disabled on desktop t6040-j773s), and radio_pmu;
  keep peripheral_clocks disabled (no clock provider driver yet).
- t6040-usb4.dtsi / t6040-pciec.dtsi / adt-coverage/t6040-j616s.txt:
  move apciec0..2_piodma into usb4_0..2_pcie_tunnel as dma@ nodes,
  enable them via T6040_PCIEC(), and update the J616s coverage paths.
- t6040-j616s.dts: enable sd_card_control, display_pcon, [email protected],
  and the read-only DP855 downstream i2c bus and TMP103 sensors.
- t6041.dtsi / t6041-j614-j616-j575-scaler.dtsi: enable aop_spmi0,
  ps_aes/aes, aon_ptd, ps_scodec/apr0, and shared scaler0/1 plus their
  DARTs and power domains; keep max_scaler_clocks disabled.

Unsafe (dcuart), loader-gated (DCP/DCPEXT/SEP/SIO/AVE1/PMP reports),
and unbacked clock providers remain disabled.

Signed-off-by: Ryan Murray <[email protected]>
@RyanTheTide
RyanTheTide requested review from a team as code owners November 28, 2026 18:44

@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: FINISH, then merge at 7954fa29

Blockers:

  1. t6040-j616s.dts (dp855 downstream i2c + ti,[email protected]): Re-enabling these nodes undoes an intentional hardware-verified disablement (with the panel on, DP855 refuses AP accesses with ack 3; with the panel off, registers read back zero). Although read-only avoids writing TMP103_CONF_REG at probe time, exposing three tmp103 hwmon devices causes userspace monitoring tools (sensors, etc.) to fail with transfer errors whenever the panel is on and read bogus zeros when it is off. Keep the DP855 downstream i2c bus and its tmp103 children disabled unless AP access is actually proven on J616s.
  2. t6040.dtsi (pinctrl_smc): Dropping interrupt-controller, #interrupt-cells, interrupt-parent, and all 7 interrupts (AIC_IRQ 985..991) strips accurate hardware description from pinctrl_smc solely to enable a node that has no consumers and still lacks SMC interrupt-group ownership handoff. Keep pinctrl_smc disabled with its hardware interrupt description intact until a consumer and handoff exist.
  3. Stack, CI, hardware row, and required review: Stacked on unmerged #3512 (638bd1cb); wait for #3512 to land (or rebase/retarget after merge), get the 22 queued CI checks green, add the live J616s (and T6041 check covering apr0/scaler0/scaler1 on J614c) exact-head boot row, and complete the required non-author review.

Checked:

  • Commit 7954fa29 across all modified DT files (t604x.dtsi, t6040*.dtsi, t6041*.dtsi, t6040-j616s.dts, t6040-j773s.dts, t6041-j614-j616-j575-scaler.dtsi, adt-coverage/t6040-j616s.txt):
    • Verified apciec0..2_piodma move cleanly into usb4_0..2_pcie_tunnel with matching adt-coverage/t6040-j616s.txt paths.
    • Verified aop_spmi0, apr0, and scaler0/scaler1 are already live on J616c/J575c (and aop_spmi0 on J616s/J773s), with ps_fab1/5/6_soc enabled in t6041-pmgr.dtsi and ps_msr0/1_dart aliasing ps_msr0/1, and battery_monitor disabled on desktop t6040-j773s.dts.
    • Verified nub_spmi3/nub_spmi4 carry no interrupts and have always-on power domains, while dcuart, peripheral_clocks, max_scaler_clocks, and loader-gated blocks remain disabled.
Evidence
  • Head: 7954fa29 (MERGEABLE on main, stacked on #3512 638bd1cb, 13 files).
  • CI at review time: 22 checks QUEUED.

…isabled

Keep the DP855 downstream i2c bus and its three TMP103 sensors disabled on
t6040-j616s (DP855 refuses AP accesses with ack 3 while the panel is on and
reads back zeros while off, so exposing hwmon nodes breaks userspace tools)
and keep pinctrl_smc disabled with its full hardware interrupt description
intact in t6040.dtsi until a consumer and SMC IRQ handoff exist.

Signed-off-by: Ryan Murray <[email protected]>
@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Addressed both review blockers in fast-forward commit b4918049efe896:

  1. t6040-j616s.dts (dp855 downstream i2c + ti,[email protected]): restored status = "disabled"; and the original hardware-verified comment on the DP855 downstream bus and its three TMP103 sensors.
  2. t6040.dtsi (pinctrl_smc): restored status = "disabled"; and the full hardware interrupt description (interrupt-controller, #interrupt-cells, interrupt-parent, AIC_IRQ 985..991).

Re-verified at b4918049efe896: 139/139 Apple DTBs build, CHECK_DTBS=y 0 new warnings across all 7 t604*.dtb, apple-adt-coverage.py (t6040-j616s) MISSING=0 mapped=595 waived=307 broken=0 total=902, checkpatch.pl --strict 0/0/0, disabled nodes 1639 -> 1526 (-113). Updated the PR body to match.

@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.

The revised commit restores disabled status for the DP855 downstream bus and temperature sensors and for the SMC pin controller. The targeted delta resolves those source findings. Current-head hosted checks and the live J616s DT-only boot remain due.

@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Pinging @aurora-silicon/omarchy-mac @aurora-silicon/aurora-maintainers for review notice at b4918049efe896 (source findings cleared in review 6099655701; queued for hosted CI and live J616s + M1 Pro DT-only boot rows).

@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Second-family (T8122 M3 MacBook Air J615) guarded DT-only control row at exact head b4918049efe896: PASS

  • Target: J615 (M3 MacBook Air, t8122), saved 7.3.0-aurora-fleet90-airs2, untouched committed aura/stage2.bin (dd01f13c34bbce63), trial Stage 2 c5d7ef6ceb959d97 carrying t8122-j615.dtb (3edb14c1631a5ae0) built from exact b4918049efe896.
  • Clean-merge parity on current main (4ffd63af1907): clean merge (010dee66bff9) builds byte-identical t8122-j615.dtb (887035d64a0a95c5) and t6000-j316s.dtb (93578f4084e42da7) vs main.
  • Results:
    • Baseline: FCHECK PASS | row VERDICT PASS
    • Trial (aura/dtcomplete-trial.bin, boot f14aebd8): FCHECK PASS (s2idle via rtc0 rc=0 success 1 fail 0, ping 0% loss before and after resume, fault-lines=0, avc=0, deferred=1 pre-existing apple-mcc waiting on PMP), row VERDICT PASS (display, GPU, USB, audio cards, Wi-Fi, hwmon, SELinux Enforcing, 0 failed units).
    • Post-restore (boot 87c93af5): row VERDICT PASS, 7.3.0-aurora-fleet90-airs2, Enforcing, failed=0, empty next_entry, boot_success=1, aura/stage2.bin dd01f13c34bbce63 unchanged, no aura-try or trial leftovers.
  • Next: Live J616s (T6040 M4 Pro) guarded DT-only row is queued right after the current J616s holder releases.

@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Primary target (T6040 M4 Pro MacBook Pro J616s) guarded DT-only boot row at exact head b4918049efe896: PASS

  • Target: J616s (M4 Pro MacBook Pro, t6040), saved 7.3.0-aurora-fleet89, untouched committed m1n1/boot-ctxr.bin (dc24e24452dfa082), trial Stage 2 3b6f79f1a2f8a084 replacing both J616s DTB blobs (t6040-j616s.dtb 18a60503e6fb2001 and t6040-j616s-tether.dtb de2ec29e8933f07f; aura head 848d853a81d554a4, gzip U-Boot 7097f36aa7aa7860, and config trailer byte-identical).
  • Results:
    • Baseline: FCHECK PASS | row VERDICT PASS (kerr=2).
    • Trial (m1n1/dtcomplete-trial.bin, boot fce003a9):
      • FCHECK PASS: s2idle via rtc1 rc=0 success 1 fail 0, ping 0% loss before and after resume, fault-lines=0, avc=0, deferred=0.
      • TUNCHECK PASS: acio_okay=3 tunnels_okay=3 (all 3 ACIO routers bound to thunderbolt-apple-acio with apple,pcie-tunnel, all 3 usb4-pcie-tunnel-{0,1,2} containers enabled with moved dma@ nodes, Thunderbolt peer enumerated).
      • row VERDICT PASS: display, GPU, USB, audio cards, Wi-Fi/net, hwmon, SELinux Enforcing, 0 failed units.
      • Live /sys/firmware/fdt verification: 32/32 newly enabled nodes verified status = "okay"; both review-protected nodes (/pinctrl@50c824000 and /spi@429110000/panel-controller@0/i2c) verified status = "disabled".
      • Kernel errors (journalctl -k -b -p 3): 2 -> 2 (0 new errors, diff vs baseline empty).
    • Post-restore (boot 818a7494): row VERDICT PASS, 7.3.0-aurora-fleet89, Enforcing, failed=0, empty next_entry, boot_success=1, m1n1/boot-ctxr.bin dc24e24452dfa082 unchanged, no aura-try or trial leftovers.

Both exact-head J616s (T6040) and J615 (T8122) guarded DT-only rows pass at b4918049efe896.

@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 b491804 after the base PR and hosted checks are green.

Checked: the patch keeps the DP855 downstream bus and SMC pin controller disabled. The J616s receipt verifies their live status, three PCIe tunnels, a successful RTC wake, and a clean return to fleet89. The J615 control also passed and restored its saved boot. Reviewed the reported seven-DTB schema comparison with no new warnings. Keep the #3512 dependency and hosted checks pending.

@github-actions github-actions Bot added 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) labels Nov 28, 2026
@github-actions

Copy link
Copy Markdown

Merge readiness at b4918049: not ready yet

Check Detail
CI at head no failing: pr-text / pr-text, pr-text / pr-text
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 b4918049
Conflicts ok none
PR text ok Risk: two-way · Apple M4 Pro / M4 Max (T6040/T6041, 7 boards); DT-only delta over #3512, zero changes to non-T604x DTBs or kernel code.

Areas: area:bringup

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

@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Merging under the 6-point rule (Ryan 09:29, permanent), at b4918049. (1) The review App approved at this head. (2) Full CI is green. (3/4) Rows: DT-only-guarded-rows;stacked-after-3512. (5) There's no blocking review. (6) Dj was pinged here 530 min ago with no objection. Revert: git revert -m 1 <merge>.

@RyanTheTide
RyanTheTide merged commit 3ba0883 into main Nov 29, 2026
22 of 28 checks passed
@RyanTheTide
RyanTheTide deleted the feat/dt-complete-t604x branch November 29, 2026 03:52
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