Skip to content

kboot: hand the M4 Mac mini (J773g) display over on 27.2 (dcpext0/1, headless) - #383

Closed
DjDeveloperr wants to merge 4 commits into
mainfrom
djdev/j773g-27.2-display
Closed

DjDeveloperr wants to merge 4 commits into
mainfrom
djdev/j773g-27.2-display

Conversation

@DjDeveloperr

@DjDeveloperr DjDeveloperr commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

On macOS 27.2 (26B123) the M4 Mac mini's (J773g) HDMI port is driven by dcpext0. iBoot leaves dcp, dcpext0, and dcpext1 running the same DCP image (B3BA603C-3CA7-3E21-B393-44EB20BD2AEF), while /arm-io/disp0 carries external (no internal panel). macOS drives HDMI from dcpext0 alone (4K60, 4K120 with DSC) and parks the internal DCP. Without this handoff, a headless T8132 booted from 27.2 gets no display at all because every T8132 boot takes the M4 internal-panel handoff, which refuses headless machines.

This hands headless T8132 boards on 27.2 over through the same external-processor-only path used for headless T6041 (J575c Mac Studio), decided from the ADT rather than per-board root compatibles.

Commits

  1. Per-SoC external-processor table and ADT headless detection (875df50d0). Generalizes the dcpext handoff (exts, nexts, ext_compat on struct dcp_soc), drops the t6041_ prefix, and replaces the per-board apple,j575c headless check with dcp6_adt_headless() (/arm-io/disp0 absent or carrying external). Adds a j575c-headless host test scenario alongside the internal-panel T6041 suite.
  2. Clocks from any display pipe (1f3094150). Parameterizes the 27.2 clock reader and publisher over the pipe's ADT path, device tree path, and struct dcp6_clocks. An identical /clock-dcp-firmware-<id> node already in the device tree is reused; one with another rate refuses.
  3. T8132 headless display handoff on 27.2 (cd9011781).
    • Adds dcp_soc_t8132 (.headless_only = true, no board list) and t8132_exts[] (dcpext0, dcpext1).
    • Internal-panel T8132 boards (where /arm-io/disp0 lacks external) are rejected before reserving or touching anything.
    • The internal DCP is not handed over; its nodes stay unchanged and no MMIO is written (dart-dcp is not locked).
    • dcpext0 and dcpext1 (t8132-dcpext.dtsi, under /soc) receive ADT-filled placeholders, shared __TEXT, firmware 27.2.0 + pinned UUID, and stay disabled for the kernel's display gate; once one is published, the display subsystem and its DART are enabled with iBoot's boot framebuffer.
    • ext_clocks publishes each pipe's /arm-io/dispextN clocks on its processor so Linux can answer the firmware's clock-frequency request (533333328 Hz on J773g).
    • Each external-processor refusal logs its reason.
  4. Shared kboot routing helper (8b3ba98ed). Exports dt_t8132_external_display() from src/kboot_display_handoff.c and calls it in src/kboot.c before dt_set_m4_dcp_handoff(). Routing shares dcp6_adt_headless(), dcp6_select_fw(&dcp_soc_t8132), the single pinned UUID in dcp_fws_t8132[], and t8132_exts[], so routing and handoff cannot disagree. Any internal-panel T8132, unqualified OS firmware (e.g. 26.6.2, 27.0, unknown), or non-matching/stopped external nub keeps dt_set_m4_dcp_handoff().

Values from the J773g runtime 27.2 ADT:

  • addresses (dcp 0x30ae00000; dcpext0 0x286e00000; dcpext1 0x48ae00000) and their DARTs;
  • SIDs: 23, 0, 16 of 32 (matching T6040/T6041; reading SIDs from ADT mapper-* reg is a follow-up across T6040/T6041/T8132);
  • dcpext nub layout: __TEXT shared with dcp, plus __DATA, __OS_LOG, and heap;
  • dispext0/dispext1 clock-ids.

Tests

  • tests/python/test_t8132_j773g_27_display_handoff.py + tests/t8132_j773g_27_display_host.c: 27 scenarios, each required to reach its own log line (headless J773g, generic headless T8132 other-headless-board, internal-panel j713, chip/OS/UUID/disp0-clock/DT gates, all per-processor refusals, static clock reuse/conflict, pre-enabled display, repeat, and full DT).
  • tests/python/test_t8132_display_route.py: links src/kboot_display_handoff.c directly to exercise dt_t8132_external_display() across ADT and OS-firmware cases and verifies a single UUID definition.
  • tests/python/test_t6041_display_handoff.py + tests/t6041_display_host.c: includes j575c-headless verifying ADT-driven headless handoff on T6041 alongside internal-panel J616c/J614c/J616s/J614s.

Local verification (head 8b3ba98ed)

Check Result
Display & handoff pytest (14 suites incl. T8132 route/handoff, T6041 ×2, M4 DCP, J773g early HDMI, M3 defaults, T6030/T6031/T8140/T8152) 223 passed
make format-check CLANG_FORMAT="uvx clang-format==20.1.8" + make rustfmt-check clean
ESP Stage 2 (USE_CLANG=1 BUILDSTD=1 RELEASE=1 CHAINLOADING=1 ESP_STAGE2=1) links; _file_vital_end 0x11c188 of 0x120000, headroom 15,992 B

Not yet

  • M4 mini J773g: repeat the 27.2 display handoff at the head. Use a compatible T6040/T6041 Mac for the shared DCP regression row.

@DjDeveloperr

Copy link
Copy Markdown
Contributor Author

Kernel side: aurora-silicon/linux#2541 (draft). It runs the J773g dcpext on the v27 backend: firmware gate, display-gate admission, the HDMI route on dcpext0, and the J773g 27.2 DT with the text/data/heap placeholders this handoff fills. The built J773g DTB matches this PR's contract.

@RyanTheTide

Copy link
Copy Markdown
Contributor

Early note on this draft (no full review yet):

  1. src/kboot.c:8054 routes on the root compatible apple,j773g plus the OS firmware release, and src/kboot_display_handoff.c:547/561/599 add per-board headless and boards entries. Whether the internal DCP is parked and which processors drive the ports is something the machine describes: decide it from the ADT (for example which dcp/dcpext nodes are running with the pinned image, and whether the internal DCP has a panel/port attached), so another T8132 board in the same state takes the same path without a new table entry. Keep the firmware check to the DCP image/version the ADT reports rather than the board.
  2. src/kboot_display_handoff.c:554 (and the PR body) name the firmware's clock request method verbatim. Describe it as the firmware's clock-frequency request instead of quoting the method name.

Assisted-by: LLM (Claude:Opus 5.5)

@DjDeveloperr

Copy link
Copy Markdown
Contributor Author

Rebased onto main (07e90bb14) and addressed both notes (head 832c5279b):

  1. Removed the apple,j773g root-compatible and OS-release route in src/kboot.c (dt_t8132_external_display()) and removed the per-board boards/board_gate/headless entries from dcp_soc_t8132 in src/kboot_display_handoff.c. Routing and headless mode are now decided from the ADT: /arm-io/disp0 having no internal panel (external or absent) and a running external DCP nub carrying the pinned 27.2 image, so any headless T8132 board in that state takes this path without a board table entry while internal-panel T8132 boards stay untouched. Updated test_t8132_display_route.py and t8132_j773g_27_display_host.c (including a synthetic non-J773g headless T8132 scenario).
  2. Replaced the verbatim firmware clock method name in src/kboot_display_handoff.c, commit messages, and the PR body with "the firmware's clock-frequency request".
  3. Stripped all Co-Authored-By trailers (single Signed-off-by: Diljit Singh <hey@djdev.me> on all 4 commits) and removed the obsolete .oslog_in_rsv field after rebasing onto main.

Verified: clang-format --dry-run --Werror, test_t8132_display_route.py (3/3), test_t8132_j773g_27_display_handoff.py (27/27 scenarios), test_t6041_display_handoff.py (52/52 scenarios), and make USE_CLANG=1 BUILDSTD=1 RELEASE=1 CHAINLOADING=1 ESP_STAGE2=1.

Assisted-by: LLM (Gemini:4 Neon)

@RyanTheTide

Copy link
Copy Markdown
Contributor

Re-review of f7d663d. It is a rebase of 832c527 (range-diff identical), so this covers the 832c527 rework.

Earlier points:

  1. Routing by board and OS release: fixed. src/kboot.c:8489 dt_t8132_external_display() now decides from the ADT: /arm-io/disp0 is absent or external, and a dcpext nub is running the pinned image. adt_headless (src/kboot_display_handoff.c:3212) uses the same test, and the per-board entries are gone from dcp_soc_t8132.
  2. Firmware method name: fixed. Code, commits and body now say "clock-frequency request".

New, all small:

  • src/kboot_display_handoff.c:331 adds a headless root-compatible field, and T6041 fills it with apple,j575c (:560). Now that dcp6_adt_headless() exists, could T6041 use it too, if J575c's disp0 carries external like J773's? Then the board string and the field can go.
  • Routing (kboot.c:8491, its own copy of the UUID, any running dcpext nub) and the handoff's firmware row (dcp6_select_fw(), by OS firmware version, :684) are separate checks. If they ever disagree, kboot.c:8540 has already left the M4 path and the handoff refuses with no display. Routing on the same dcp6_select_fw() result, or one shared helper, keeps the UUID in one place.
  • The T8132 SIDs (:592-594: 23, 0, 16) are in the ADT as reg of mapper-dcp (under /arm-io/dart-dcp), mapper-disp0 and mapper-disp0-piodma (under /arm-io/dart-disp0). Reading them there would avoid another per-SoC constant (T6040/T6041 do the same today, so this can be a follow-up).
  • The PR body still describes the old routing ("Only the J773g whose OS firmware components are 27.2...", the J713/26.6.2/27.0 gate list, and the "chip, J713" test gates). Please update it to the ADT-based selection.

Rows at f7d663d: a J773g 27.2 Linux boot where the kernel takes dcpext0 from this handoff (the #445 runs show only the Stage 2 HDMI swap), and a J713 boot showing that internal-panel T8132 still takes the M4 handoff.

Assisted-by: LLM (Claude:Opus 5.5)

…ess detection

The external-processor handoff (memory placeholders filled from the ADT,
firmware version, UUID and clock-ids published, the processors left
disabled for the kernel's display gate) and its headless case (no
internal handoff, the first processor's __TEXT standing in for the
panel's, the display subsystem enabled once one is published) were
written for T6041 only: a hard-coded t6041_exts[] list, the
apple,t6041-dcpext compatible, and a J575c board-compatible check.

Make the external processor list and compatible fields of struct dcp_soc
(exts, nexts, ext_compat), drop the t6041_ prefix from the helpers, and
decide headless mode from the ADT (/arm-io/disp0 has `external` or is
absent) via dcp6_adt_headless() instead of carrying a per-board root
compatible string. Add a j575c-headless host test scenario covering the
ADT-driven headless path alongside the existing internal-panel T6041
tests.

Signed-off-by: DjDeveloperr <hey@djdev.me>
…locks

The 27.2 profile reads /arm-io/disp0's clock-ids, indexes /arm-io
clock-frequencies with them and publishes them on dcp as fixed-clock
providers plus clocks, clock-names and apple,clock-ids. Make the reader
and the publisher take the pipe's ADT path, the processor's device tree
path and a struct dcp6_clocks, so an external processor can be given
its own pipe's clocks (dispextN) the same way.

A /clock-dcp-firmware-<id> node the device tree already has is now used
when it is a fixed-clock of the same rate with #clock-cells 0, and
refuses the processor otherwise, instead of failing on the duplicate
node: a board tree may carry the same providers statically. No current
T6041 tree has such a node; its behaviour is unchanged (92 passed).

Signed-off-by: Diljit Singh <hey@djdev.me>
…0/1)

Hand over dcpext0 and dcpext1 on headless T8132 boards (such as the M4
Mac mini, J773g) running macOS 27.2 (26B123), with the internal DCP
untouched.

Instead of gating on a per-board compatible list or a per-board headless
entry, decide headless mode from the ADT (/arm-io/disp0 has the external
property or is absent), so any headless T8132 board in the same state
takes this path without a table entry while internal-panel boards stay
untouched. Each external processor gets its own pipe's firmware clocks
from /arm-io/dispextN so the kernel can answer the firmware's
clock-frequency request.

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

Route T8132 boots to dt_set_display_handoff() through a shared
dt_t8132_external_display() helper in src/kboot_display_handoff.c so
kboot routing and the handoff use the exact same dcp6_adt_headless(),
dcp6_select_fw(&dcp_soc_t8132), pinned UUID, and t8132_exts[] table and
cannot disagree.

Every other T8132 boot (internal-panel boards, unqualified OS firmware
releases, or external nubs not running the pinned image) keeps
dt_set_m4_dcp_handoff().

Signed-off-by: DjDeveloperr <hey@djdev.me>
@DjDeveloperr
DjDeveloperr force-pushed the djdev/j773g-27.2-display branch from f7d663d to 8b3ba98 Compare November 22, 2026 06:38
@DjDeveloperr

Copy link
Copy Markdown
Contributor Author

@RyanTheTide Thanks for the re-review! Addressed the four items in the updated 4-commit stack (875df50d0, 1f3094150, cd9011781, 8b3ba98ed):

  1. ADT-driven headless detection for T6041 as well (875df50d0, cd9011781): Removed const char *headless and .headless = "apple,j575c" from struct dcp_soc / dcp_soc_t6041_max. Both T6041 (J575c carries external on /arm-io/disp0, while J614s/J616s/J614c/J616c do not) and T8132 now use dcp6_adt_headless() via dcp6_headless() (dcp6.soc->exts && dcp6_adt_headless()), with .headless_only = true on dcp_soc_t8132 so internal-panel T8132 boards still bail early. Added a j575c-headless scenario to tests/t6041_display_host.c / tests/python/test_t6041_display_handoff.py alongside j713 and other-headless-board in tests/t8132_j773g_27_display_host.c.
  2. Single shared routing helper (8b3ba98ed): Moved dt_t8132_external_display() into src/kboot_display_handoff.c so src/kboot.c routes directly through the same dcp6_adt_headless(), dcp6_select_fw(&dcp_soc_t8132), single pinned UUID in dcp_fws_t8132[], and t8132_exts[] table used by dt_set_display_handoff(). Updated tests/python/test_t8132_display_route.py to link src/kboot_display_handoff.c directly, verify OS-firmware (26.6.2/27.0) and ADT cases, and assert a single UUID copy across src/.
  3. T8132 SIDs (23, 0, 16): Kept the struct dcp_soc constants matching dcp_soc_t6041 / dcp_soc_t6041_max for now since none of the existing T6040/T6041/T8132 host ADT fixtures model mapper-dcp/mapper-disp0/mapper-disp0-piodma; reading SIDs from ADT mapper-* reg across T6040/T6041/T8132 is a clean follow-up.
  4. PR body updated: Replaced the stale board-name/OS-release routing text and gate list with the ADT-based selection, shared routing helper, and current test/size numbers.

Local verification: 223 passed across the display/handoff pytest suites (including test_t6041_display_handoff.py with j575c-headless, test_t6041_27_display_handoff.py, test_t8132_display_route.py, test_t8132_j773g_27_display_handoff.py, and test_m4_dcp_handoff.py), clang-format==20.1.8 + rustfmt clean, and ESP Stage 2 links with 15,992 B vital-region headroom (_file_vital_end 0x11c188 of 0x120000).

Hardware boot rows:

  • J773g 27.2 Linux boot on 8b3ba98ed handoff (dcpext0): will run a fresh boot check right after our current benchmark run finishes.
  • J713 internal-panel regression boot: we don't have a J713 tethered locally right now, so that path is covered by the unit tests (j713 + test_t8132_display_route.py + test_m4_dcp_handoff.py) until a J713 lane is available.

Assisted-by: LLM (Gemini:4 Neon)

@DjDeveloperr

Copy link
Copy Markdown
Contributor Author

Live J773g (Mac16,10, macOS 27.2 26B123 firmware) hardware verification on unmodified Stage 2 built at 8b3ba98ed9d8 (aura 1.0.0b14-g8b3ba98e, sha256 f64af512d52f...): PASS across 4 consecutive Linux boots (7.3.0-ARCH-m4prod8).

  • ADT-based routing cleanly bypassed internal DCP (no panel), published dcpext0 firmware memory, refused dcpext1, and enabled the display subsystem and its DART for external processors.
  • Linux apple-dcp took over dcpext0 cleanly (UnifiedPipeline::mode_set_gated: 3840x2160@120 Hz DSC=YES VRR=NO link: 1, crtc-0 active=1, zero SErrors/BUGs/WARNs).

Verbatim Stage 2 / kboot handoff log (boot1):

TTY> [  7.823442]     display:    0x1
TTY> aura 1.0.0b14-g8b3ba98e
TTY> [  8.019101] display: Display is external
TTY> [  8.019112] display: preserving inherited display (640x1136)
TTY> [  8.073396] fb: display logo
TTY> [ 10.406346] FDT: ANS buffer [0x1000ef88000, 0x1000ef90000) reserved
TTY> [ 10.408247] FDT: ANS buffer [0x1000ef94000, 0x1000ef98000) reserved
TTY> [ 10.410148] FDT: ANS buffer [0x1000ef9c000, 0x1000efa0000) reserved
TTY> [ 10.659863] DCP: T8132: 3 __OS_LOG buffer(s) reserved, 0 already present
TTY> [ 10.662889] DCP: T8132: display power state (ADT /arm-io/dcp): DISP_CPU 0x380710000 = 0x1000030f, on
TTY> [ 10.665609] DCP: T8132: CPU_CONTROL 0x10 (running) STATUS 0x6c; PROTECT dart-dcp 0x1ff dart-disp0 0x1f9
TTY> [ 10.668593] DCP: T8132: dcp segments lack text, __DATA, __OS_LOG or /vram
TTY> [ 10.670611] DCP: T8132: no panel: the internal DCP is not handed over
TTY> [ 10.672941] DCP: T8132: no internal display handoff (no panel): external processors only
TTY> [ 10.688587] DCP: T8132: dcpext0 firmware memory published; processor remains disabled
TTY> [ 10.692554] DCP: T8132: dcpext1: no text, data and heap memory-region placeholders
TTY> [ 10.695242] DCP: T8132: dcpext1 firmware memory refused; placeholder remains disabled
TTY> [ 10.701069] DCP: T8132: display subsystem and its DART enabled for the external processors
TTY> [ 10.750228] FDT: Transferred T8132 ANS/NVMMU/SART resources from ADT
TTY> [ 10.753929] FDT: Transferred primary T8132 SPMI/PMU resources from ADT
GATE: nvme_keep_running_for_linux=1 ans_buf_reserved=True will_be_off=False dcpext0_mentioned=True
GATE: pass: ANS handed on running (aura-383-r3-stage2.bin)
TTY> [ 12.444424] FDT: /arm-io/apcie tables published, 261 records

Assisted-by: LLM (Gemini:4 Neon)

@DjDeveloperr
DjDeveloperr marked this pull request as ready for review November 30, 2026 20:44
@DjDeveloperr
DjDeveloperr requested review from a team as code owners November 30, 2026 20:45
@github-actions github-actions Bot added merge-conflict Conflicts with the base branch (bot) needs-review No approving review from Core or Omarchy Mac yet (bot) needs-template PR body lacks required sections (bot) labels Nov 30, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Merge readiness at 8b3ba98e: not ready yet

Check Detail
CI at head ok 15 checks passed
Review no needs one approving review from Core or Omarchy Mac (not the author)
Requested changes ok none
Hardware row at head ok comment at 8b3ba98e
Conflicts no merge conflicts with main: merge it in (no force push)
PR text adopt when you next edit add a 'Tested:' line; a 'Risk:' line (door and Macs) (guide)

Areas: none matched in CODEOWNERS

Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels.

@aurora-silicon-review aurora-silicon-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: REQUEST CHANGES at 8b3ba98e

Blockers:

  1. Branch is CONFLICTING with main. Rebase/merge current main (resolving conflicts across the 8 touched files, +1290/-115) so the PR is MERGEABLE, full CI runs cleanly at the new head, and an exact-head J773g (27.2) + non-T8132 regression boot row can be verified.

Checked:

  • Commit series (875df50d..8b3ba98e), CONFLICTING against main.
  • Prior J773g 27.2 4-boot pass at 8b3ba98e (2026-11-22).
Evidence
  • Rebase onto main to clear CONFLICTING (or close if superseded by newer display-handoff PRs on main), verify CI passes, and re-verify on J773g at the rebased head.

@aurora-silicon-review
aurora-silicon-review Bot dismissed their stale review December 1, 2026 04:55

Dismissed under the 12-01 merge bar: this review's blockers were not shown failures (CI/rows/rebase/design or re-run asks). Follow-ups, not blocking: Diff not reviewed, only conflict; follow-ups: rebase, CI, J773g + non-T8132 boot rows

@DjDeveloperr

Copy link
Copy Markdown
Contributor Author

Closing: #470, re-landed as #536, does this on main. It hands the T8132 external processors over on firmware 27 from the ADT (no panel included), with no image table or board test, and also keeps the memory of any processor it does not hand over, which this branch does not. The same ADT-driven headless choice is on main for T6041 (t6041_headless(), #546, and a9409822), and the five conflicting files are that code and its tests.

Seen on the J773g (27.2, Stage 2 1.0.0b18-g0745e344, 12-03): dcpext0 handed over and dcpext1 handed over (image B3BA603C, stream 23, 2 pipe clocks each), no panel: display subsystem and its DART enabled for the external processors. This branch's own Stage 2 handed over dcpext0 only on that Mac (dcpext1 was refused for missing DT placeholders). Not shown yet on main's handoff: a physical HDMI sink (aurora-silicon/linux#3874 ran with a USB-C DisplayPort monitor). The branch is kept; #445, stacked on it, is closed with its own reason.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-conflict Conflicts with the base branch (bot) needs-review No approving review from Core or Omarchy Mac yet (bot) needs-template PR body lacks required sections (bot)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants