Skip to content

sio: the M4 (T8132) takes the T6041 SIO tables - #370

Open
DjDeveloperr wants to merge 1 commit into
mainfrom
djdev/t8132-sio-tables
Open

DjDeveloperr wants to merge 1 commit into
mainfrom
djdev/t8132-sio-tables

Conversation

@DjDeveloperr

Copy link
Copy Markdown
Contributor

This adds the M4 (T8132) to the T6041 SIO table path from #120 and #122, for HDMI audio on the M4 Mac mini (J773g).

Checked against the J773g ADT (stub firmware 26.6.2):

  • map-range: one MISC record.
  • device-type: dSPI, dUAR, dDPA.
  • dmashim: SSPI, SUAR, SAUD, 36 bytes each.
  • 48-byte asio-ascwrap-tunables.
  • Two segment-ranges records: phys 0x10000d20000, remap 0x10000000000, size 0x1c000; then phys 0x1000128c000, remap 0x1000001c000, size 0xf8000. They end at IOVA 0x10000114000, the same as T8140, inside the dart-sio window (vm-base 0x1000001c000).

dt_setup_sio() is unchanged. It acts only when the device tree has the sio alias, which the Linux side adds for the J773g in aurora-silicon/linux#2435.

Measured on the J773g, 2026-11-19. The test Stage 2 was the mini's configured stack (e553f9d + #260) plus this change, with the #2435 device tree:

  • Linux reserves the four sio-firmware-data regions.
  • The SIO firmware starts: apple-sio 3ade00000.dma-controller: SIO protocol v10, driver bound, DMA channels registered.
  • The rest of the boot was unchanged: HDMI, the GPU (G16 READY), Ethernet, both sound cards.

🤖 Generated with Claude Code

The M4 (T8132, J773g) SIO firmware reports protocol 10, and its ADT
describes the tables as T6041's and T8140's do, key for key: one MISC
map-range record; dSPI, dUAR and dDPA device types; SSPI, SUAR and SAUD
dmashims of 36 bytes; 48 bytes of asio-ascwrap-tunables; and two
segment-ranges records whose remapped end, 0x10000114000, lies inside the
dart-sio window (vm-base 0x1000001c000), as on T8140.

Add T8132 to the T6041 path. As before, dt_setup_sio() acts only when
the device tree has the sio alias.

Signed-off-by: Diljit Singh <hey@djdev.me>
@RyanTheTide

Copy link
Copy Markdown
Contributor

Thanks for this, and for checking it against the J773g ADT. The SIO firmware coming up with all four regions reserved is a good result.

One request about how the table layout is selected. In this project we choose behaviour by a hardware or ADT property, not by a list of chips that grows by one entry each time a new chip is tested. This PR adds T8132 to two such lists in src/sio.c:

  • 238-239: if (chip_id != T6040 && chip_id != T6041 && chip_id != T8132 && chip_id != T8140 && chip_id != T6050)
  • 302-303: } else if (chip_id == T6040 || chip_id == T6041 || chip_id == T8132 || chip_id == T8140 || chip_id == T6050) {

sio_iova_base() already reads segment-ranges from the SIO node, and the comment above it says what sets these SoCs apart: firmware that iBoot preloads and remaps. Could the presence of segment-ranges (or whichever ADT property really marks this firmware layout) select both the IOVA base and copy_rules_t6041? T6030 would keep its explicit case, with a comment saying why it differs. Then the next chip with the same firmware needs no change here.

If you make that change, we are happy to run boot rows on our M1 Pro, M2, M4 Pro and A18 Pro machines.

@RyanTheTide

Copy link
Copy Markdown
Contributor

The J773g measurements look good, and they confirm the T6041 table layout on T8132. One thought on the selection: dt_setup_sio()'s chip list at sio.c:238 and :301 grows by one SoC per change, while what decides the layout is visible in the ADT you quoted (the segment-ranges remap and where the IOVA window starts). #323 picks the table address and layout from where iBoot remapped the segments, with no chip list, so T8132 would be covered without an entry. Would you be OK folding the T8132 case into #323 (with your J773g row as its T8132 evidence), or rebasing this onto it? Happy to do the rebase.

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.

2 participants