Skip to content

sio: hand the T6041 SIO its boot tables - #120

Merged
RyanTheTide merged 3 commits into
mainfrom
dpaj6/t6041-sio-handoff
Nov 8, 2026
Merged

RyanTheTide merged 3 commits into
mainfrom
dpaj6/t6041-sio-handoff

Conversation

@RyanTheTide

Copy link
Copy Markdown
Contributor

The M4 Pro/Max (T6041) SIO carries DisplayPort/HDMI audio. Its firmware reports protocol 10 like T6030's but takes its boot tables differently:

  • only the DMA shim records the ADT describes end in the all-ones selector; the empty slots stay all zero;
  • the response array (0x0b) belongs to the OS driver, which publishes it with the segment array as entry counts, so the loader no longer builds one;
  • the tables go into the SIO DART's address space, which on T6041 begins after the preloaded, remapped firmware segments. They now start on the first 16K page past those segments (from the live ADT) instead of 0x30000, which lies outside that space.

Map ranges, device types and tunables keep the T6030 layout. dt_setup_sio() is unchanged: it reserves the preloaded segments at their ADT remap addresses and enables the node only after every step has succeeded. The T6041 device tree gains the sio alias it looks the node up by (Linux side: the T6041 apple-sio backend). Other SoCs are unchanged.

The firmware stays where iBoot put it. Nothing is loaded or shipped.

Testing: an E2E trial on the J616s (aura-try Stage 2 trial with the Linux test kernel). Results get posted here before this leaves draft.

🤖 Generated with Claude Code

The M4 Pro/Max (T6041) SIO firmware reports protocol 10 like T6030's, but
takes its boot tables differently:

- only the DMA shim records the ADT describes end in the all-ones
  selector; the empty slots of the six-record table stay all zero;
- the response array (key 0x0b) is not the loader's: the OS driver
  allocates it and publishes it with the segment array, as entry counts;
- the tables live in the SIO DART's address space, which on T6041 starts
  after the firmware segments iBoot preloaded and remapped. Put them on the
  first 16K page past those segments, from the live ADT, instead of at
  0x30000, which is outside that space.

The map-range, device-type and tunables tables keep the T6030 layout.
dt_setup_sio() already reserves the preloaded segments at their ADT remap
addresses and enables the node only when every step succeeded; the T6041
device tree gains the "sio" alias it looks the node up by. Other SoCs are
unchanged.

Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com>
Assisted-by: LLM
The M4 Pro reports chip T6040 and runs the same SIO firmware as the M4
Max (T6041); its ADT is arm-io,t6041. The J616s trial showed the T6041
rules not applied there (the earlier layout and 0x30000 went out, which
the OS driver correctly refused). Select them for both.

Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com>
Assisted-by: LLM
Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com>
Assisted-by: LLM
@RyanTheTide

Copy link
Copy Markdown
Contributor Author

E2E on the J616s (M4 Pro; aura reports chip T6040). The trial was this change cherry-picked onto the live J616s head d83ee47 (branch dpaj6/t6041-sio-trial-d83, CI build dev-2a6be38a), booted as an aura-try Stage 2 trial with the linux#1256 DTB and test kernel.

  • Trial 1, the first build: the T6041 rules did not apply, because the M4 Pro reports chip T6040 (its ADT says arm-io,t6041). The old layout went out and Linux refused it, so the SIO stayed stopped (fail-closed, as intended). Fixed by selecting the rules for T6040 or T6041.
  • Trial 2: the published params match the T6041 contract exactly:
    • 0x1e/0x1f 0x30, 0x0f/0x10 0x1e000, 0x30d/0x30e 0x4000, 0x1a/0x1b 0x40, 0x22/0x23 0xd8, 0x1c/0x1d 0x48;
    • no 0x0b;
    • IOVA pages 0x10000118 to 0x10000142, inside the SIO DART window, with four sio-firmware-data regions mapped;
    • the node was enabled; Linux apple-sio reported protocol v10 and bound (every setup ACK succeeded), DMA registered, no DART fault.
  • The default boot (no hdmi_audio) also passed. Afterwards the Mac was put back on production Stage 2 b6133b33.

Other SoCs are unchanged: the new rules and the IOVA base apply only when the chip is T6040 or T6041. CI is green.

🤖 Generated with Claude Code

@RyanTheTide
RyanTheTide marked this pull request as ready for review November 8, 2026 20:59
@RyanTheTide
RyanTheTide merged commit 3e72189 into main Nov 8, 2026
10 checks passed
@RyanTheTide
RyanTheTide deleted the dpaj6/t6041-sio-handoff branch November 8, 2026 21:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant