Repository navigation
kboot: M4 internal DCP on the 27.2 stub: firmware clocks and display maps - #404
Conversation
…isplay maps On the macOS 27.2 stub the M4 MacBook Air's internal DCP runs the 26B123 image, which Linux drives through the firmware-27 backend. That backend needs the firmware clocks the OS gives the firmware (apple,clock-ids from /arm-io/disp0) and the display subsystem with its inherited SID0/SID16 mappings, which the M4 handoff published on 26.6.2 only. - dt_set_dcp_fw27_clocks() also serves a processor whose tree has no clocks at all (T8132), not only one with the single legacy display clock; it still does nothing below firmware 27. - dt_set_m4_dcp_handoff() publishes /arm-io/disp0's clocks that way. - The display-map walk runs on 27.2 as on 26.6.2. It checks every inherited page against this image's segments and publishes nothing unless all of them match, so a 27.2 image laid out differently keeps the display subsystem disabled as before. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
Hand the J713 over on 27.2 with the 26B123 image: PIODMA, scanout and their inherited mappings as on 26.6.2, and /arm-io/disp0's firmware clocks (364 at 300 MHz, 431 at 0 Hz) as fixed clocks with clock-names firmware-0/1 and apple,clock-ids. A DART whose pages do not match the image's segments publishes no display mapping and keeps the firmware and its clocks. 26.x trees get no clocks; the other M4 Macs on 27.2 are still refused. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
DjDeveloperr
left a comment
There was a problem hiding this comment.
Reviewed bb3684b on top of #382. Approving the code:
dt_set_dcp_fw27_clocks()now also takes a DCP node with no clocks (T8132), and it still refuses a node with several clocks or withclock-names. Every M1/M2 legacy tree has its display clock, so the legacy path is unchanged.dt_set_m4_dcp_handoff()only gains the 27.2 map walk. It publishes nothing unless every inherited SID0/SID16 page matches the image.
Not mergeable yet:
- It's stacked on
satchlj/dcp-fw27-firmware-clocks, so the only checks that ran arepolicyandesp-stage2-size. I'm merging #382 now. aura doesn't delete merged branches, so please retarget this PR tomainafterwards (gh pr edit 404 --base main), so the full CI runs on the head. - The J713 boots were a lab compose (c61e11a + #382 + these two commits), not this head on main. Once retargeted, it needs a J713 (M4 Air) on 27.2 row on the head merged with main:
- clock-ids 364/431 published;
- the walk is accepted;
- appledrm binds eDP 2560x1600@60;
- 0 DART faults.
- As the description says, the kernel half (linux#2590) has to land with it. #2590 is stacked on the draft linux#2541, so this waits for that chain too.
Assisted-by: Claude Opus 5.5
RyanTheTide
left a comment
There was a problem hiding this comment.
No hard blocker, but one ordering question should be settled before merge. It's about the handoff's fail-safe, which Dj's review didn't cover.
-
src/kboot.c:8015 vs :8025: the firmware clocks (with
apple,clock-ids) are published before the SID0/SID16 walk, and whether or not it then succeeds. The PR says the kernel's firmware-27 admission is keyed onapple,clock-ids. On a J713 on 27.2 whose walk fails ("PIODMA handoff unqualified"), the DT therefore carries the admission property without the display maps. The same happens on any firmware-27 version other than 27.2: the version check at :8025 skips the walk, but the clocks at :8015 are still published. If linux#2590 admits onapple,clock-idsalone, that is a DCP adopted without its inherited mappings, which is the DART-fault case the walk exists to prevent. Fix: on firmware 27, publish the clocks only oncedt_set_j713_display_maps()returns 0 (move the call into the success branch), or make the kernel require the maps as well as the ids and say so here. -
src/kboot.c:8025:
os_firmware.version != V26_6_2 && != V27_2is a version list in front of a walk that already checks every inherited page against this image's segments. A future 27.x stub with the same DCP image is refused only because of the list, and with point 1 unfixed it still gets the clocks. Either let the walk alone decide (it is the property-based check), or keep the list but tie the clocks to it as in point 1. -
The partial-write point I raised on #382 (
clocksis written beforeclock-namesandapple,clock-ids) applies here too, now also for the no-clocks T8132 node.
Hardware row: on J713 on 27.2, on the head merged with main, with linux#2590, run Dj's row (clock-ids 364/431, walk accepted, eDP 2560x1600@60, 0 DART faults). Add one negative boot: force the walk to fail (one mismatching page, as the host test does). Pass: no apple,clock-ids in /proc/device-tree/.../dcp, the DCP is not adopted, the boot reaches Linux on simple-framebuffer, and there are 0 DART faults.
Assisted-by: LLM (Claude:Opus 5.5)
|
J713 (13" MacBook Air M4, T8132, 27.2 stub) row on bb3684b merged with main a4df613 (Stage 2
For comparison, main a4df613 on its own, same boot setup: Not run: the negative boot (one mismatching page) from the earlier review. Assisted-by: LLM (Claude:Opus 5.5) |
…y maps The kernel admits a T8132 DCP on the 27.2 image on apple,clock-ids. The clocks went out before the SID0/SID16 walk and whatever its result, so a J713 whose walk failed, or a firmware-27 version the walk does not run on, got the admission property without the inherited display maps: a DCP adopted without the mappings its DART needs. Run the walk first and publish the firmware clocks only when it succeeded. A failed walk now leaves the DCP with its firmware UUID and reserved segments but no clocks, and the kernel does not take it over. The success path is unchanged. The host test checks the failed walk publishes no apple,clock-ids, clocks or clock nodes, and that the older-image 27.0 case gets none. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
|
Pushed 7287170 for point 1 of the 02:04 review (no force push).
Host test: the mismatching-page case now checks there is no Still to run on the J713 (27.2 stub) with this head merged with main:
Point 3 (partial Assisted-by: LLM (Claude:Opus 5.5) |
|
J713 rows on 7287170 merged with main 4e52c30 (Stage 2
On a failed walk, display-subsystem, With this, the hardware rows are done. The PR still has to land together with linux#2590, as the description says. Assisted-by: LLM (Claude:Opus 5.5) |
|
No blockers. 7287170 only narrows the failure paths: the firmware-27 clocks now go out only when the SID0/SID16 walk succeeded, so a failed walk, a firmware-27 release other than 27.2, or a tree without the PIODMA property no longer gets apple,clock-ids. The success path is unchanged, and the J713 positive and forced-mismatch rows on this head cover both sides. CI is green on the head, and it merges cleanly with current main. Since the approval was given on bb3684b, it needs a re-approval on 7287170. Follow-ups, not for this PR: the release list in front of the walk (kboot.c:8019) could key on the image UUID published at :8001, or leave the decision to the walk, so a later 27.x with the same image is not refused by the list alone; and the walk's DART base and streams (kboot.c:7873) could come from /arm-io/dart-disp0's reg and its mapper children instead of constants. This lands together with linux#2590. |
DjDeveloperr
left a comment
There was a problem hiding this comment.
Re-reviewed at head 7287170 (delta from bb3684b): moving dt_set_dcp_fw27_clocks() behind maps ensures firmware-27 clocks are only published together with the inherited display maps, and the updated test_m4_dcp_handoff.py asserts clocks stay absent when !piodma or when the SID walk fails while keeping apple,firmware-uuid. All 15/15 CI checks pass. Approving.
Assisted-by: LLM (Google:Gemini 4 Neon)
dt_set_m4_dcp_handoff() handed the internal DCP over on the J713 on any firmware but on every other M4 Mac only on 26.6.2, and ran the inherited display-map walk only on 26.6.2 and the 27.2 stub. So the firmware-27 clocks and display maps reached the kernel on 27.2 for one board name, and an M4 MacBook Pro with the same DCP and the same image got nothing. Decide it from what the machine describes instead: - the internal panel from the ADT: /arm-io/disp0 present and not "external" (the rule the other boards already had). A Mac mini's disp0 drives a port and is still refused, on any firmware; - no firmware version list in front of the walk. It checks every inherited SID0/SID16 page against the segments of the image the DCP runs and publishes nothing unless all of them match, and the clocks still go out only together with the maps. The kernel then picks the backend from the firmware the DCP runs (apple,firmware-uuid/-compat). Nothing changes on the J713: its ADT has an internal disp0 and its inherited pages match on 26.6.2 and 27.2. The host test now runs the J604, J715 and an iMac-like board on every firmware, the J604 on 27.2 with the 27.2 image (maps + clocks), the Mac mini on 27.2 (refused), a J713 tree without disp0 (refused), and a skewed page on 26.6.2 (nothing published), and checks that the function names no board or firmware version. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
RyanTheTide
left a comment
There was a problem hiding this comment.
Re-review at 189253d, diffed against 7287170. No blockers in the code. One point is about the commit message and one about evidence.
Resolved: the release list in front of the walk is gone, as suggested in the last pass, and so is the J713 board-name gate. The handoff now goes on the ADT's internal /arm-io/disp0 (src/kboot.c:7961-7962) and on the walk. The clocks still go out only with the maps (:8028), so the fail-safe from 7287170 holds. The new host cases (Mac mini on 27.2, J713 tree without disp0, skewed page on 26.6.2) cover the refusals.
-
Commit message vs behaviour on the J713. "Nothing changes on the J713" is true only on 26.6.2 and 27.2. On the 26.5, 26.6 and 27.0 images the J713 used to stop at "PIODMA unqualified". Now the walk runs there, and if the pages match it enables the PIODMA DART, piodma and, through
apple,j713-native-scanout(:7931), the display subsystem with inherited mappings. On 27.0 it also getsapple,clock-ids, becausedt_set_dcp_fw27_clocks()gates on>= V27_0(:8050). The test changes show this: the threeoldcases went from false to true. linux#2590 admits the firmware-27 backend only on the 26B123 UUID, so apple-drm still refuses those images. But piodma and the display-subsystem node now bind on images that were never booted this way. Please correct the message, and either add a row on one of those images or say why those drivers stay inert when the kernel doesn't know the DCP image. -
Evidence for the other M4 laptops.
t8132-laptop.dtsicarries bothapple,j713-native-piodmaand-native-scanout, so the J604 and J715 now get the walk, PIODMA, scanout and, on 27.2 with the 26B123 image, the clocks. That means linux#2590 adopts their DCP. All of that has only host-test coverage. We only have the J713. Please ask a J604 or J715 owner on 27.2 for the same row as the J713 (walk accepted, clock-ids published, apple-drm on the internal panel, 0 DART faults), or say in the description that these boards are covered by the property and the host test only. With the board gate gone, thej713-prefix on those DT properties is now misleading. Renaming them is a follow-up together with the kernel side, not something for this PR. -
Still open from the last pass (follow-up, not for this PR): the walk's DART base and streams (:7873) are constants. They could come from
/arm-io/dart-disp0's reg and its mapper children.
HW row: J713 on the 27.2 stub, 189253d merged with main, default kernel with linux#2590. Pass: M4 DISP0 SID0/SID16 mappings preserved, clock-ids 364/431, apple-drm eDP 2560x1600@60, 0 DART faults, 0 failed units. The negative boot doesn't need to be run again: the walk itself is unchanged.
Assisted-by: LLM (Claude:Opus 5.5)
|
Follow-up pushed (fast-forward, head 189253d): the handoff is decided from the ADT on every M4 Mac ( J713 row at 189253d (Stage 2 This needs a re-approval at the new head. Assisted-by: LLM (Claude:Opus 5.5) |
…132-dcpext-adt # Conflicts: # src/kboot.c
|
Adversarial review of 189253d (the commit after the 7287170 approval). Verdict: MERGE-OK, 0 blockers. What it changes: Ways I tried to break it:
Testing: Not run: J604/J715 hardware (we have none). Their result rests on the host test only. |
|
@DjDeveloperr your approval is at 7287170; 189253d (the ADT panel decision, no board/firmware list) came after it. Could you re-approve at 189253d if you agree? Review and rows are in the comment above. |
DjDeveloperr
left a comment
There was a problem hiding this comment.
Re-reviewed delta commit 189253d24165d9647755835610cda7e500fed4e6 against the pre-PR checklist. Approve:
- §1 / §3: Replacing the
apple,j713board-name check andV26_6_2/V27_2firmware-version list with the ADT/arm-io/disp0(present and notexternal) check and an unconditional fail-closed SID0/SID16 page walk is strictly cleaner and removes both hard-coded gates.dt_set_dcp_fw27_clocks()remains gated onmaps == true, andtests/python/test_m4_dcp_handoff.pyadds explicit assertions thatdt_set_m4_dcp_handoff()names no board or firmware version and refuses J773g / missingdisp0/ skewed pages. - §4: All 4 commits carry human author/committer +
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>with no AI commit trailers; PR body ends withAssisted-by:. - §5 / CI: 15/15 CI checks green on
189253d2, plus J713 Stage 2 (1.0.0b14-gdefd23c1) 7/7 boots + t4 gate row (eDP + USB-C, 0 DART faults). Merging now.
Assisted-by: LLM (Gemini 4 Neon)
#404 has landed on main; bring the branch up to date so the PR can target main. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
Problem
On the macOS 27.2 stub, Linux drives the M4 MacBook Air's (J713) internal DCP through the firmware-27 backend. That backend needs the firmware clocks the OS hands the firmware, and the display subsystem with its inherited SID0/SID16 mappings. The M4 handoff published those mappings on 26.6.2 only, and no clocks at all.
Change
Stacked on #382 (firmware-27 DCP clocks from the ADT).
dt_set_m4_dcp_handoff()publishes/arm-io/disp0's firmware clocks on firmware 27, through aura#382'sdt_set_dcp_fw27_clocks().apple,clock-ids, so a failed walk leaves no admission property behind./arm-io/disp0present and notexternal(a Mac mini's disp0 drives a port and is still refused on any firmware). The walk needs no firmware list: it already refuses any inherited page that does not match the segments of the image the DCP runs, and the kernel picks the backend from that image. The J713's decisions do not change (its 27.2 ADT has an internal disp0).Testing
On the J713 (27.2 stub): Stage 2 = configured c2 + these commits, with the kernel from aurora-silicon/linux#2590. Eight one-shot boots tonight:
Host:
tests/python/test_m4_dcp_handoff.pypasses: J713 on 27.2 gets maps + clocks; a mismatching DART page publishes nothing (27.2 and 26.6.2); the J604, the J715 and a board without PIODMA are handed over on every firmware, the J604 on 27.2 with the 27.2 image gets maps + clocks; the Mac mini is refused on 26.6.2, 26.6 and 27.2; a tree without disp0 is refused; the test also checks that the function names no board and no firmware version. Against the previous kboot.c the new test fails (mutation check). The fulltests/pythonsuite gives the same result as #382's head (746 passed, the same failures and errors, all from the host environment). Clean build OK.Rows on 7287170 merged with main 4e52c30 (#404 (comment)): the walk is accepted, clocks 364/431 are published, apple-drm drives eDP 2560x1600 and there are 0 DART faults. A lab-only build with mismatching pages publishes no clocks, the DCP stays on simple-framebuffer, 0 DART faults.
Tip-based J713 candidate (integration tip + the J713 PR heads, one fleet cmdline) with this PR at 7287170 in its Stage 2: eDP connected at boot and on 3/3 warm boots, s2idle 3/3, 0 DART faults.
The follow-up 189253d makes the same decisions on the J713 (its 27.2 ADT has an internal
/arm-io/disp0withclock-ids364/431 and noexternal). J713 row with 189253d (Stage 21.0.0b14-gdefd23c1, tip-based kernel candidate t4, one fleet cmdline): the aura log showsM4 DISP0 SID0/SID16 mappings preserved; PIODMA enabled,dcp: 2 firmware clocks published from /arm-io/disp0andM4 DCP firmware mappings published; appledrm on eDP-1, 0 DART faults, 0 failed units, Enforcing, on 7 boots incl. warm 3/3 after it became the J713's configured Stage 2. Same decisions as at 7287170, as intended.Still to run
Reviewer / agent detail
1.0.0b13-g2870f0f0(= c61e11a + aura#382 + these two commits; lab compose, U-Boot tail unchanged)./arm-io/disp0clock-ids(364, 431). The kernel's firmware-27 admission requiresapple,clock-ids, so a main DCP left running idle without a handoff is never adopted.traces/display/20261121-j713-d2-oneshot/in the lab store.Assisted-by: LLM (Claude:Opus 5.5)