Repository navigation
kboot: M4 DCP handoff on 26.6.2 for every M4 Mac with a panel, J713 unchanged - #110
Merged
Merged
Conversation
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>
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
dt_set_j713_dcp_handoff()returned early unless the device-tree root wasapple,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:os_firmware.version == V26_6_2, which aura also publishes as/chosen/asahi,os-fw-version);A Mac other than the J713 also needs an internal panel. Its ADT must have
/arm-io/disp0, withoutexternal. The Mac mini'sdisp0isexternal = 1(4096x2160, with DP-switch links on itsdcp), so it is refused before anything is written. So is a Mac whose ADT has nodisp0. The J713 never readsdisp0.Everything the handoff reads is already SoC or firmware data, taken from each Mac's own ADT:
segment-rangesanduuid;/chosendram-baseanddram-size;dart-disp0at 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
apple,firmware-uuid,apple,firmware-version/-compat, oneasc-firmware@reservation per ADT segment (OS log markedapple,dcp-os-log, the rest withiommu-addresses), linked fromdcp'smemory-region. On 26.6.2 its DT also gets PIODMA and scanout:disp0_piodma,disp0and the disp0 DART setokaywithapple,j713-inherited-mappingst8132-j713-j715.dtsi) requests themdisp0isexternal)On the kernel side, linux
integration/aurora's J715 DT already enablesdcpand requests PIODMA and scanout. The J604 and iMac DTs still keepdcpdisabled, so their panels also need a kernel DT change before the J604 profile from linux#1178 is used.dcpkeeps its DT status, as before. External DCPs still need the boot.bin opt-inchosen.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.pyis 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:disp0in its ADT;disp0, get nothing;apple,t8132-dcpnode are refused;Local results:
disp0allowed, the panel check applied to the J713 too, and no chip check. The test caught all seven.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.cc.make RELEASE=1and thestage1-clangpair (RELEASE=1 CHAINLOADING=1 BUILTIN_LOGO=aurora, plusESP_STAGE2=1) all link..textgrows 88 B: 2596 B to 2508 B of room before its 64 KiB step.kboot.ccompiles 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.make format-checkwith clang-format 20.1.8 andmake rustfmt-checkare clean.Not tested on hardware: none was available for this change.
🤖 Generated with Claude Code