Skip to content

kboot: M4 DCP handoff on 26.6.2 for every M4 Mac with a panel, J713 unchanged - #110

Merged
DjDeveloperr merged 1 commit into
mainfrom
display/m4-dcp-handoff-by-firmware
Nov 7, 2026
Merged

DjDeveloperr merged 1 commit into
mainfrom
display/m4-dcp-handoff-by-firmware

Conversation

@DjDeveloperr

Copy link
Copy Markdown
Contributor

dt_set_j713_dcp_handoff() returned early unless the device-tree root was apple,j713. On every other M4 Mac it published nothing, so the kernel's M4 DCP driver refused ("unqualified firmware 26.6.2 handoff") and the boot framebuffer stayed, even after linux#1171 moved the kernel's display gates to SoC plus firmware.

This PR follows #106 (the G16 handoff). The function is now dt_set_m4_dcp_handoff() and publishes on:

  • any T8132 Mac whose OS firmware is 26.6.2 (os_firmware.version == V26_6_2, which aura also publishes as /chosen/asahi,os-fw-version);
  • the J713 on any firmware, as before.

A Mac other than the J713 also needs an internal panel. Its ADT must have /arm-io/disp0, without external. The Mac mini's disp0 is external = 1 (4096x2160, with DP-switch links on its dcp), so it is refused before anything is written. So is a Mac whose ADT has no disp0. The J713 never reads disp0.

Everything the handoff reads is already SoC or firmware data, taken from each Mac's own ADT:

  • the DCP nub's segment-ranges and uuid;
  • /chosen dram-base and dram-size;
  • for the PIODMA path that a board's DT requests, the T8132 dart-disp0 at 0x30a300000. The J713, J604 (26.6.2 and 27.0), J715 and J773g ADTs all have it there.

Board data stays per board: each Mac's segment list comes from its own ADT, and the panel profile stays in the kernel. Only log strings changed from "J713" to "M4". The DT property names (apple,j713-native-piodma, apple,j713-inherited-mappings) are kernel ABI and are unchanged.

What each board gets

Board Firmware Published
J713 (13" Air) any Unchanged: apple,firmware-uuid, apple,firmware-version/-compat, one asc-firmware@ reservation per ADT segment (OS log marked apple,dcp-os-log, the rest with iommu-addresses), linked from dcp's memory-region. On 26.6.2 its DT also gets PIODMA and scanout: disp0_piodma, disp0 and the disp0 DART set okay with apple,j713-inherited-mappings
J715 (15" Air) 26.6.2 The same as the J713, PIODMA and scanout included, because its DT (t8132-j713-j715.dtsi) requests them
J604 (14" MacBook Pro) 26.6.2 UUID, firmware version/compat and the firmware reservations. Its DT doesn't request PIODMA or scanout, so those stay disabled
J623 / J624 (iMac) 26.6.2 The same as the J604 (internal panel, no PIODMA request in their DT)
J773g (Mac mini) any Nothing: no internal panel (ADT disp0 is external)
any Mac but the J713 not 26.6.2 Nothing, as before

On the kernel side, linux integration/aurora's J715 DT already enables dcp and requests PIODMA and scanout. The J604 and iMac DTs still keep dcp disabled, so their panels also need a kernel DT change before the J604 profile from linux#1178 is used.

dcp keeps its DT status, as before. External DCPs still need the boot.bin opt-in chosen.asahi,j713-dcpext=1, and they still follow a successful internal handoff. With the opt-in, that now includes the J604, J715 and iMacs on 26.6.2.

Tests

tests/python/test_m4_dcp_handoff.py is new. It runs the production handoff (dt_reserve_asc_firmware, dt_set_dcp_firmware, the reserved-memory helpers and the PIODMA path) against libfdt. Each board uses the DCP segment list from its own ADT: J713 26.5.1, J604 26.6.2, J715 27.0, J773g 26.6.2. It checks that:

  • the J713 publishes on 26.6.2 (with PIODMA and scanout), 26.5, 26.6 and 27.0, and still does with no disp0 in its ADT;
  • the J604, J715 and an iMac publish on 26.6.2, and the J715 also gets PIODMA and scanout;
  • the J604, J715 and iMac get nothing on 26.5, 26.6, 27.0 or 14.7;
  • the J773g, and a J604 whose ADT lacks disp0, get nothing;
  • a non-T8132 chip and a non-apple,t8132-dcp node are refused;
  • every refusal leaves the FDT byte-identical.

Local results:

  • Mutation check: I broke the gate in seven ways: main's board-only gate, no firmware check, the firmware check applied to the J713 too, no panel check, a missing disp0 allowed, the panel check applied to the J713 too, and no chip check. The test caught all seven.
  • J713 differential check: I compiled main's dt_set_j713_dcp_handoff() and the new function into one harness and ran 1428 cases: every J713 case (firmware, UUID, DT and ADT variants, and fault injections) and every other board off 26.6.2. Return values matched and every FDT was byte-identical. A J713-breaking variant does show differences.
  • pytest (CI's set, without LLVM first on PATH): 598 passed, 47 skipped (main: 597 passed, 47 skipped). The new test also passes with gcc 16 and LLVM clang as cc.
  • clang 23.1.1: make RELEASE=1 and the stage1-clang pair (RELEASE=1 CHAINLOADING=1 BUILTIN_LOGO=aurora, plus ESP_STAGE2=1) all link. .text grows 88 B: 2596 B to 2508 B of room before its 64 KiB step.
  • gcc 16.1: kboot.c compiles in the build VM with the same two T8140 stack-usage warnings as main. That gcc can't link aura (__popcountdi2), so the CI gcc job does the link.
  • Format: make format-check with clang-format 20.1.8 and make rustfmt-check are clean.

Not tested on hardware: none was available for this change.

🤖 Generated with Claude Code

The internal DCP handoff required the J713's root compatible, so on the
J715, the J604 and the iMacs it published nothing and the kernel's M4
DCP driver kept the boot framebuffer. Everything it reads is SoC and
firmware data from each Mac's own ADT: the DCP nub's segment list and
UUID, the DRAM bounds and, for the PIODMA path a board's DT asks for,
the SoC's disp0 DART, which the J604, J715 and J773g ADTs carry where
the J713's does.

Publish it on any T8132 Mac whose OS firmware is 26.6.2, as the G16
handoff does, and on the J713 on any firmware as before. A Mac other
than the J713 also needs an internal panel: the Mac mini's ADT disp0 is
"external", its DCP drives a port, so it is refused before anything is
written, as is a Mac without a disp0. The J713 never reads disp0.

The new host test runs the handoff with each board's ADT segment list:
the J713 publishes as before, the J604, J715 and an iMac publish on
26.6.2 (the J715 with PIODMA, which its DT asks for), and nothing is
written on other firmware or on the J773g.

Signed-off-by: Diljit Singh <hey@djdev.me>
@DjDeveloperr
DjDeveloperr merged commit 32580c9 into main Nov 7, 2026
10 checks passed
@DjDeveloperr DjDeveloperr mentioned this pull request Nov 7, 2026
@RyanTheTide
RyanTheTide deleted the display/m4-dcp-handoff-by-firmware branch November 16, 2026 05:19
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