Skip to content

kboot: T6050: hand off a prewired internal panel and the combo PHY ports the tree takes - #282

Merged
RyanTheTide merged 15 commits into
mainfrom
j716c/t6050-display-handoff
Nov 29, 2026
Merged

RyanTheTide merged 15 commits into
mainfrom
j716c/t6050-display-handoff

Conversation

@erikwb

@erikwb erikwb commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

What: Extend t6050_handoff() and kboot_setup_atc() to support prewired T6050 device trees (matching the internal display by coprocessor address with prewired clocks and apple,bw-scratch, and copying combo PHY tunables by apple,t6050-combo-phy + apple,guest-port-reserved), validate/reject/version-stamp input-DT-enabled apple,t6050-dcpext external engines (t6050_ext_reject(), t6050_ext_version()), and place the T6050 display and ATC handoff helpers in .rodata.xtext (AURA_XTEXT).

Tested: J716c (M5 Max, T6050, 27.2 stub) and J313 (M1 Air, T8103, 27.2) Stage 2 aura-try boots at e6a3bcb13fca, plus CI (19 successes, 2 cancelled, 1 skipped) and local host/size checks (J713 was not booted; details and hashes in Evidence).

  • J716c (M5 Max, T6050, 27.2 stub) at e6a3bcb13fca: eDP-1 up at 3456x2234@120 (dpmsStatus: 1, vrrCapable: yes, DRM enabled), all 4 apple,t6050-dcpext engines at (27, 2, 0), and 4 apple,t6050-combo-phy nodes with tunables; GPU absent (#282 carries no GPU handoff). In the 2026-11-28 J716c pass (vs main a0504b2a376d control), 0 failed user units, 1 baseline failed system unit (aurora-peripherals.service, matching control and restored default), 0 LSM denials, and 41 err+ lines: 39 dcpext unable to match service lines, 1 systemd-gpt-auto-generator line, and 1 apple-pmp-report-entry ... -110 probe line (the main control has 7 err+ lines and lacks those 39 dcpext messages; a separate earlier e6a3bcb13fca run vs the installed default Stage 2 had 40 err+ lines vs 43).
  • J313 (M1 Air, T8103, 27.2, G13G B1) at e6a3bcb13fca: PASS — eDP-1, input, Wi-Fi, audio enumeration, Borealis compute (2670 runs, 0 wrong) and render checks pass, 0 failed units, 0 AVC denials, same 1 Wi-Fi ring err line as the main control (G13 path unchanged). J713 (M4 Air) was not booted for #282.
  • CI and host suites at e6a3bcb13fca: GitHub CI rollup is 19 successes, 2 cancelled, 1 skipped (build, format-check, esp-stage2-size, all 5 stage1-size toolchains, all 5 Pytest jobs, policy pass; both cancelled readiness/pr-text checks also have successful runs; selftest has 1 skipped and 1 success), plus local host pytest, 6 shell suites, formatting, and tools/stage1_size.sh pass.

Risk: one-way door (Stage 1 code in src/kboot_display_handoff.c and src/kboot_atc.c; Stage 2 on ESP is reversible) · all Macs via shared Stage 1 / Stage 2 build, specifically T6050 Macs (J716c, J714s, J775D, K114s, K116s) and Stage 1 image size. Combining main + #281 + #282 fails link with Code and data reach the DCP log buffer after stage 1! across the earlier 1458e4eb7cba check, the 2026-11-28 ESP Stage 2 attempt (9aae69b24, clang -Os/-Oz and gcc), and the separate Stage 1 (stage1 flavour) failure reproduced by @RyanTheTide on main 2c8fa8d8 (linker prints after stage 1! in both; #281 merges first and #282 reconciles .rodata.xtext/size after merging main).

Revert: For Stage 2 on ESP, restore the prior stage2 binary and clear aura-try. For main, revert the merge commit (git revert -m 1 <merge-sha>); reverting Stage 1 on hardware requires re-flashing Stage 1 with the machine owner in 1TR.

Not yet:

  • Post-#281 merge of main into #282 and green stage1-size / combined build check (once aurora-silicon/aura#281 lands first).
  • Stage 1 and T6050 board-owner sign-offs, plus @satchlj's re-review on GitHub (change request from superseded f6e5eace still blocks; @RyanTheTide approved e6a3bcb13fca, with owner sign-offs and the post-#281 size check still open).
  • Untested Mac families at e6a3bcb13fca: M2, M3, M4 (lab J713 currently awaiting human recovery), and external T6050 boards (J714s internal panel and J775D headless scanout with Type-C port 1–5 devices, K114s port 0, K116s, and J716c on the 27.0 stub; J714s/J775D/27.0 agreed as post-merge rows).
  • Live external-monitor check on J716c (no external monitor attached to lab J716c DP ports) and undocked s2idle resume (pending kernel apple,t6050-pmu-rtc alarm IRQ). GPU stays disabled because #282 carries no GPU handoff.
Details

Branch progression over main (26c1a85bb788, merged as 15191b3c2b06):

  • 39b5db2b / 0113c4ee: initial prewired T6050 internal-panel and combo PHY handoff plus external-engine firmware version stamping.
  • 4101923fe382: scoped the external-engine pass via t6050.ext_aura to input-DT-enabled engines.
  • be98aca94ec8 / f6e5eaceec09: required unique coprocessor register matches in t6050_node_at() and t6050_ext_index(), recorded ambiguous ADT indices up front in t6050_ext_reject(), and preserved the ADT index for scanout DART cleanup.
  • 15191b3c2b06: merged main (26c1a85bb788), updating t6041_headless_fb() -> t6041_headless_display(dt) in tests/python/test_t6050_handoff_bounds.py.
  • 9b661123e3d0: failed closed on external-engine version/allocation errors in t6050_ext_version().
  • 1458e4eb7cba: placed the T6050 display and ATC handoff helpers in .rodata.xtext via AURA_XTEXT.
  • d3184b1778fc: kept fdt_addresses.c out of fdt_harness.LIBFDT_SOURCES so tests/python/test_wdt_arm.py does not link it twice.
  • 1ddba986798f: extracted t6050_check_ext_live() so t6050_check_ext_adt() verifies live power, CPU run, and DART lock/TTBR state against the ADT roots before retaining scanout or version-stamping.
  • e6a3bcb13fca: if t6050_check_ext_adt() fails during t6050_ext_version() after passing t6050_ext_reject(), disabled the engine and stripped its scanout entry via t6050_ext_disable() instead of skipping it with original firmware properties intact, and deferred done |= 1u << n until a clean version update so rescans after enclosing display-subsystem deletion cannot skip an engine.

Design & integration notes:
Under the inherited chip_id != T6050 dispatch check in dt_set_display_handoff() (and directly from apple,t6050-combo-phy in kboot_setup_atc()), the new node matching tests no board compatible or chip sub-variant; each keys on the device tree or the ADT:

  • Prewired internal display (t6050_prewired(), t6050_handoff(), t6050_check_prewired(), t6050_disp_node()): Finds apple,t6050-dcp by its unique ADT coprocessor address (t6050_node_at()) and the single apple,display-subsystem node by compatible (refusing a second display subsystem). Verifies apple,clock-ids against disp0 clock IDs in order, checks that each clock is a distinct available fixed-clock with #clock-cells = <0>, and validates apple,bw-scratch against disp0 bandwidth agent metadata. Register windows for dcp, external engines (t6050_ext_index()), DARTs, and the PMC node must reach the CPU 1:1 with 2/2 address/size cells and identity ranges (t6050_identity_reg()).
  • External scanout DARTs, placement, and live DART root check (t6050_check_ext_scanout(), t6050_check_ext_adt(), t6050_check_ext_live(), t6050_check_placement(), t6050_publish_prewired()): External display DARTs listed in apple,display-subsystem iommus are matched to ADT dart-dispextN by CPU address, checked for page-aligned pt-region outside OS RAM holding the l1-tt root, and validated for iop-dcpextN-nub running == 1, valid/pinned UUID, non-__OS_LOG segment-ranges, pt-region-23 (dart-dcpextN), and pt-region-16 (dart-dispextN) outside OS RAM. t6050_check_ext_adt() then invokes t6050_check_ext_live() (shared with t6050_ext_one()) to check PMGR power domains, ASC_CPU_CONTROL_RUN, and both DART streams (DART_T8110_PROTECT_TTBR_TCR, four-level translate TCR, valid TTBR matching the ADT l1-tt root) under dcp6_guard_begin()/dcp6_guard_end() before t6050_publish_prewired() retains scanout or t6050_ext_version() stamps firmware properties. Failed external engines are dropped from apple,display-subsystem iommus while keeping the internal panel handoff intact.
  • Combo PHY tunables (kboot_setup_atc(), t6050_setup_atc()): Keyed on apple,t6050-combo-phy, copying tunables whole and in ADT order (including RX clock groups) for each port carrying apple,guest-port-reserved, including port 0 where the tree claims it.
  • External-engine rejection & fail-closed firmware version (t6050_ext_disable(), t6050_ext_reject(), t6050_drop_ext_scanout(), t6050_ext_walk(), t6050_available(), t6050_ext_version_one(), t6050_ext_version()): Before checking os_firmware, t6050_ext_reject() runs on a scratch copy (falling back to in-place edits if scratch allocation fails), skips engines Aura just enabled itself (t6050.ext_aura, recorded when t6050_ext_one() commits in t6050_headless_handoff() / t6050_ext_handoff()), uses first-string status matching (t6050_available()), and calls t6050_ext_disable() to strip any failing or unmatched input-DT-enabled apple,t6050-dcpext engine from apple,display-subsystem iommus in place via fdt_getprop_w() + fdt_setprop_placeholder() without a 128-byte cap and disable (or delete via fdt_del_node() on packed trees) the rejected node. For known os_firmware, t6050_ext_version() re-checks t6050_check_ext_adt(n) and updates apple,firmware-compat and existing apple,firmware-version per surviving engine via t6050_ext_version_one() in its own scratch transaction; if the live/ADT check fails or if scratch allocation, any property write, or commit fails, it calls t6050_ext_disable() so no input-enabled engine remains active advertising stale apple,firmware-compat.
  • Stage 1 .rodata.xtext placement (1458e4eb7cba): T6050_INIT / T6050_TEXT in src/kboot_display_handoff.c and T6050_ATC / T6050_ATC_INIT in src/kboot_atc.c expand to AURA_XTEXT (.rodata.xtext, noinline, mapped executable in src/memory.c) with __attribute__((minsize)) guarded by #ifdef __clang__, freeing .init + .text headroom before the DCP log buffer in aura-raw.ld.
  • Host test harness compatibility (d3184b1778fc): Keeps fdt_addresses.c out of fdt_harness.LIBFDT_SOURCES and appends it only inside fdt_harness.run(), because tests/python/test_wdt_arm.py::test_dt_set_wdt_reconfig (merged from main) appends fdt_addresses.c to LIBFDT_SOURCES itself and failed Pytest with duplicate-symbol linker errors when LIBFDT_SOURCES already contained it.
  • Merge-order & coordination notes: Combining main + #281 + #282 failed Stage 1 link at 1458e4eb7cba, failed the sweep's ESP Stage 2 link attempt at 9aae69b24 (main + #281 + #282 with ESP_STAGE2=1, clang -Os/-Oz and gcc), and failed the separate Stage 1 (stage1 flavour) link reproduced by @RyanTheTide on main 2c8fa8d8 (the linker prints Code and data reach the DCP log buffer after stage 1! in both; each PR links alone, and main 99b6dd13 + #282 merges cleanly with 7040 B clang stage1 headroom), so #281 merges first and #282 merges main afterward and re-checks stage1-size. t6050_check_placement() should also be reconciled with #471 if #471 lands first.
  • Test coverage notes: Duplicate-node, malformed external-engine, live-vs-ADT DART mismatch, post-rejection live failure, and fail-closed version-write paths are covered by the host pytest suites; unattended s2idle RTC wake on J716c is currently blocked because apple,t6050-pmu-rtc in t6050-j716c-sleep.dtsi has no interrupts and rtc-apple-pmu.c has no generation-4 SPMI alarm IRQ yet (confirmed by rtcwake -m no -s 5 leaving wakealarm set with alrm_pending: no).
Evidence

GitHub CI at e6a3bcb13fca:

  • 19 successes, 2 cancelled, 1 skipped (build, format-check, ESP stage 2 vital size, stage1-size gcc/clang-macos/fedora/alarm/nix, Pytest ubuntu-latest + gcc/ubuntu-latest + llvm/macos-15 + llvm-brew/macos-26 + llvm-brew/ubuntu-24.04-arm, policy; readiness / readiness and pr-text / pr-text each have a cancelled run alongside successful runs; selftest has 1 skipped and 1 success).

Local & container verification at e6a3bcb13fca:

  • pytest -q tests/python/test_wdt_arm.py tests/python/test_rtbuddyseg_logs.py tests/python/test_t6050_tree_shape.py tests/python/test_t6050_handoff_bounds.py: 167 passed (cc), 167 passed (CC=clang).
  • pytest -q tests/python/test_dcp6_max_brightness.py tests/python/test_t6041_display_handoff.py tests/python/test_t6041_27_display_handoff.py tests/python/test_oslog_reservation.py tests/python/test_dcp_fw27_clocks.py tests/python/test_dcp_typec_routes_adt.py tests/python/test_display_dart_view.py tests/python/test_m4_dcp_handoff.py tests/python/test_ave_handoff.py tests/python/test_t6031_runner_failures.py tests/python/test_stage1_room.py tests/python/test_rela_layout.py: 182 passed, 1 skipped (cc; CC=clang passes 153, skips 1, and fails setup on test_display_dart_view.py's pre-existing unused dart_gen3_tlbi_broadcast).
  • sh tests/run-t8122-display-handoff.sh, sh tests/run-fdt-disable.sh, sh tests/run-aop-os-ram.sh, sh tests/run-pmp-boot-data.sh, sh tests/run-t8122-gpu26-identity.sh, sh tests/run-rtkit-placed-buffer.sh (cc and CC=clang): all 6 pass under both compilers.
  • clang-format --dry-run -Werror src/kboot_display_handoff.c src/kboot_atc.c: pass.
  • make rustfmt-check: pass.
  • NM=llvm-nm sh tools/stage1_size.sh clang USE_CLANG=1 BUILTIN_LOGO=aurora: clang stage1 7608 B headroom (_file_vital_end 0x11d010), stage1-secure-audit and stage1-secure-enforce 77928 B, optional stage1-dev-audit 2376 B.
  • NM=aarch64-linux-gnu-nm sh tools/stage1_size.sh gcc ARCH=aarch64-linux- BUILTIN_LOGO=aurora EXTRA_CFLAGS='-Wstack-usage=2048 -Os': gcc stage1 6368 B headroom (_file_vital_end 0x11d228), stage1-secure-audit and stage1-secure-enforce 77448 B, optional stage1-dev-audit 1288 B.
  • Ubuntu 24.04 container (aarch64-linux-gnu-gcc 13.3.0): gcc13 stage1 6152 B headroom (_file_vital_end 0x11d1d8), stage1-secure-audit and stage1-secure-enforce 77528 B (optional stage1-dev-audit does not link).
  • esp-stage2-size (CARGO_PROFILE_RELEASE_OPT_LEVEL=z make -j$(nproc) USE_CLANG=1 BUILTIN_LOGO=aurora RELEASE=1 CHAINLOADING=1 EXTRA_CFLAGS=-Oz ESP_STAGE2=1 SPTM_VIRT=1 SPTM_VIRT_ESP=1 AURACTL=1 without BUILDSTD=1, plus tools/esp-macos/esp_vital_size.py build/aura-raw.elf --nm llvm-nm): ESP vital region: 811160 B (0xc6098), 368488 B free.
  • make -j$(nproc) ARCH=aarch64-linux-gnu- CHAINLOADING=1 EXTRA_CFLAGS='-Wstack-usage=2048 -Os', make -j$(nproc) ARCH=aarch64-linux-gnu- CHAINLOADING=1 ESP_STAGE2=1 EXTRA_CFLAGS='-Wstack-usage=2048 -Os', and make -j$(nproc) RELEASE=1 CHAINLOADING=1 USE_CLANG=1 ESP_STAGE2=1 (aura.bin sha256 prefix 24c2d8fde8eb620d, BUILD_TAG "1.0.0b17-ge6a3bcb1"): pass.
  • Combined link checks against main: earlier combined build at 1458e4eb7cba failed Stage 1 link (Code and data reach the DCP log buffer after stage 1!); main (99b6dd13) + #282 (e6a3bcb13fca) merges cleanly (clang stage1 7040 B headroom), while the 2026-11-28 ESP Stage 2 link attempt main + #281 (278bbd272e9e) + #282 (e6a3bcb13fca) (9aae69b24) failed link with ld.lld: error: Code and data reach the DCP log buffer after stage 1! under clang (-Os and -Oz) and gcc, and @RyanTheTide separately reproduced a Stage 1 (stage1 flavour) link failure on main 2c8fa8d8 (no combined image could be built or booted).

Earlier hardware run at e6a3bcb13fca (J716c M5 Max, T6050, 27.2 stub, Linux 7.3.0, default kernel command line, one-shot aura-try Stage 2 vs installed default Stage 2 21edee972e1ff171… and main 26c1a85bb788 control):

  • Build: make -j$(nproc) RELEASE=1 CHAINLOADING=1 USE_CLANG=1 ESP_STAGE2=1; PR aura.bin (3,997,696 B) sha256 24c2d8fde8eb620d…, control main 26c1a85bb788 aura.bin (3,997,696 B) sha256 ce40f9c41946f13b….

  • Trial boot 1.0.0b17-ge6a3bcb1:

    • Display: apple-drm card with eDP-1 at 3456x2234@120; dcp@48ae00000 status = "okay" with apple,bw-scratch present.
    • External engines: all 4 apple,t6050-dcpext nodes (dcp@2b2e00000, dcp@302e00000, dcp@306e00000, dcp@392e00000) status = "okay" with apple,firmware-version and apple,firmware-compat both (27, 2, 0).
    • Combo PHYs: 4 apple,t6050-combo-phy nodes (phy@2a3000000, phy@2ab000000, phy@383000000, phy@38b000000; the 3 active ones carry full apple,tunable-* sets) and 6 Type-C port nodes.
    • GPU disabled, as expected.
    • dmesg -l err,crit,alert,emerg: 40 lines vs 43 on the installed default Stage 2 (separate run from the 2026-11-28 sweep below). The trial-specific line apple-pmp-report-entry 284240000.pmp-report:report@f: probe failed -110 also appears in the main 26c1a85bb788 control (no GPU handoff). 0 new failed units.
  • Control boot of main (26c1a85bb788, 1.0.0b17-g26c1a85b) on the same Mac: simple-framebuffer card with Unknown-1 at 3456x2234@60; dcp@48ae00000 status = "disabled"; all 4 apple,t6050-dcpext engines left at (27, 0, 0); 2b2e00000.dcp and 302e00000.dcp probe failed with -110; apple-t6050-dp-phy 2a3000000.phy failed with -ENOENT (missing or invalid apple,tunable-axi2af).

  • Return to default: rebooted cleanly to the default Stage 2 (1.0.0b17-g00976384, eDP-1 at 3456x2234@120), trial binaries deleted, aura-try marker restored, default stage2.bin sha256 verified unchanged.

  • J313 (M1 MacBook Air, T8103, firmware 27.2) one-shot aura-try Stage 2 boot at e6a3bcb13fca:

    • Image: make BUILDSTD=1 RELEASE=1 CHAINLOADING=1 ESP_STAGE2=1 USE_CLANG=1 BUILTIN_LOGO=aurora (aura.bin sha256 61c60722c16858208b681e65794d131e7242d6189c13bb86c15268194a030197) followed by the Mac's installed device tree and U-Boot tail, written as a separate file on the ESP (sha256 cdc6e6a7dd86623f9a237a3210f77a5b1d033ead8fde7f79920ee3ffb089521a); chosen/asahi,m1n1-stage2-version read back as 1.0.0b17-ge6a3bcb1 and chosen/aurora,trial named the trial file. The Mac's default Stage 2 (sha256 1262bc5de585fc57e34c36f10560522d4b231be4f9ac7e45066bc4e364f95484) was not touched and the aura-try marker was spent by the single boot.
    • Kernel: the Mac's default Linux 7.3.0 build (sha256 7b4eda418e92d4403c7018894108026bb65ac9fe3958d80028fce549918306f7), default command line (rw rootflags=subvol=root plymouth.ignore-serial-consoles user4k=on loglevel=4 console=tty0).
    • Control: main 99b6dd13 Stage 2 (1.0.0b17-g99b6dd13, image sha256 24f52d5ec8509275039e32e642ae19effd5640988e889e20ce1a6e98e1289e27) booted the same way on the same kernel: the same smoke results.
    • Smoke (script run 60 s after boot): display eDP-1 connected/enabled/dpms=On, backlight 130; input Apple SPI Keyboard + Apple SPI Trackpad registered; network default gateway ping 3/3 over wlan0; audio aplay -l shows the MacBook Air J313 card and wpctl lists the Headphones and DisplayPort sinks (enumeration only, no playback; the speaker path stays held by the speaker-protection daemon); GPU compute-check 3 PASS (2670 runs, 0 wrong) and render-check PASS on Apple M1 (G13G B1); systemctl --failed: 0; ausearch -m avc and journal: 0 denials (SELinux not enabled on this image); 1 new err line (brcmfmac ... brcmf_pcie_ring_mb_update_rptr: ring 4: r_ptr 0 outside depth 0; also present in the main control boot, absent from the default boot and the other PR boots, so a boot-time Wi-Fi ring flake rather than a Stage 2 effect).
    • Redacted dmesg excerpt:
      [    0.000000] Machine model: Apple MacBook Air (M1, 2020)
      [    0.069000] apple-mcc 200100000.memory-controller: DCS dynamic clock and power gating enabled on 8 channels
      [    0.442821] apple-dcp 231c00000.dcp: panel ADT: parsed, panel node absent, dimensions 286x179 mm
      [    2.716911] aurora 206400000.gpu: Probing...
      
  • 2026-11-28 J716c (M5 Max, T6050, firmware 27.2) one-shot aura-try Stage 2 boot at e6a3bcb13fca:

    • Images: make USE_CLANG=1 ARCH=aarch64-linux-gnu- RELEASE=1 CHAINLOADING=1 ESP_STAGE2=1 BUILTIN_LOGO=aurora + default boot-config tail (1.0.0b17-ge6a3bcb1, trial Stage 2 sha256 c5c2a0dd8c70efbbd88bb4fc2c91331efea3cd9ab5f9b74669e500e29cd795b6) vs main a0504b2a376d control (1.0.0b17-ga0504b2a, sha256 942727abbccdad72196375774900d2f1efba90ebc4d18109fa98608c704420b9), booting the default Linux 7.3.0 kernel (sha256 bf2582ab357573db64031f39e7bc9d617eb574c6b221364ff417810bbddf4c87, default command line; default Stage 2 sha256 21edee972e1ff1718c6f41c32b91ee151afdc58cbb69f16f2f6a4d8d4c722170 untouched).
    • Display & smoke: eDP-1 up at 3456x2234@120 (dpmsStatus: 1, vrrCapable: yes, DRM enabled); 4 Hyprland input entries enumerated; wlan0 connected, 3/3 gateway ping (0% loss); AppleJ716 audio sinks enumerated (36. MacBook Pro J716 speaker protection hold, 87. Built-in Audio Headphones); GPU renderD128 absent (needs #281, as expected); 0 failed user units; 1 failed system unit (aurora-peripherals.service, baseline on every warm reboot of that session including the main control and restored default); 0 LSM denials (no SELinux/AppArmor); 0 Oops/BUG/faults. Control main a0504b2a376d falls back to Unknown-1 3456x2234@60 simplefb.
    • dmesg err+ (41 lines total): 1 systemd-gpt-auto-generator line, 1 apple-pmp-report-entry 284240000.pmp-report:report@f: probe failed -110 line (expected without GPU handoff), plus 39 apple-dcp (2b2e/302e/306e/392e) AFK ... unable to match service lines on the enabled dcpext nodes (AppleDCPDPTXController, dcpexpert-service, test-service, aop-test, md-manager). The main a0504b2a376d control (7 err+ lines) lacks those 39 dcpext service-match messages.
  • J713 (M4 Air, T8132) was not booted for #282 (and is currently awaiting human recovery).

Earlier hardware verification at superseded head 1458e4eb7cba (J716c M5 Max, 27.2 stub, one-shot aura-try Stage 2):

  • Built with make RELEASE=1 CHAINLOADING=1 USE_CLANG=1 ESP_STAGE2=1 (aura.bin sha256 prefix 34bfcaf4184d84ee, chosen/asahi,m1n1-stage2-version 1.0.0b17-g1458e4eb), staged with the default payload tail via aura-try into the default kernel (default stage2.bin untouched).
  • Control boot of main (26c1a85bb788, 1.0.0b17-g26c1a85b) without #282: no panel driver (simple framebuffer Unknown-1 at 60 Hz), GPU disabled, 6 kernel err lines.
  • #282 boot (1.0.0b17-g1458e4eb): eDP-1 up at 3456x2234@120; all 4 apple,t6050-dcpext engines handed over with apple,firmware-version and apple,firmware-compat = <0x1b 0x02 0x00> and apple,tunable present; 4 combo-PHY nodes and Type-C port0–port3 present; 39 unique kernel err lines vs 40 on the default Stage 2 (0 new, differing only by PID-numbered generator lines and one md-manager AFK message); 0 new failed units (aurora-peripherals.service pre-existing on default); GPU stays disabled because #282 alone has no GPU handoff.

Earlier hardware run (superseded, head 71708f74 on #427 2e2d7e71 + #281, Linux 7.3.0 with #2185 and #2187, default cmdline):

  • J716c (M5 Max, 27.2 stub): internal panel (3456x2234) and two 4K Thunderbolt dock monitors up; four apple,t6050-dcpext nodes carried apple,firmware-compat and apple,firmware-version <27 2 0>.

@erikwb erikwb closed this Nov 17, 2026
@erikwb erikwb reopened this Nov 17, 2026
@erikwb
erikwb force-pushed the j716c/t6050-display-handoff branch from 9efa489 to 3cb4003 Compare November 17, 2026 21:04
erikwb added a commit that referenced this pull request Nov 17, 2026
@RyanTheTide

Copy link
Copy Markdown
Contributor

Thanks for the J716c display and Type-C handoff; that's a big piece of work.

Several branches are selected by the board compatible rather than by a hardware property: src/kboot.c:770, :8150, :8186, src/kboot_atc.c:939, :1286 and src/kboot_display_handoff.c:4451 all test chip_id == T6050 plus apple,j716c. That also makes the J716c a second T6050 display path (dt_set_display_j716c()) next to t6050_handoff(), and a second ATC path next to t6050_setup_atc().

We select behaviour by a hardware property and extend one path. The comment at :8185 names the property: the tree "describes its inherited display by address, with clocks and scratch prewired". Could the T6050 handoff branch on that tree shape, and could the ATC copy key on the apple,t6050-combo-phy node alone? Naming RTBuddySeg firmware logs no-map (dt_reserve_j716c_oslogs()) holds on every chip whose ADT has RTBuddySeg.

We can't run a T6050 ourselves, but are glad to help line up owner rows.

@DjDeveloperr DjDeveloperr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for the J716c display and Type-C handoff. The 27.2 row with all three displays and a deep-sleep resume is great, and rewriting apple,firmware-compat on each apple,t6050-dcpext node from the stub's version is a good catch.

I agree with Ryan's comment, and it is what holds the merge. Six branches are chosen by chip_id == T6050 plus apple,j716c:

  • src/kboot.c:770, :8150, :8186
  • src/kboot_atc.c:939, :1286
  • src/kboot_display_handoff.c:4451

That gate also creates a second T6050 display path (dt_set_display_j716c()) next to t6050_handoff(), and a second ATC path next to t6050_setup_atc().

What would make it mergeable:

  • Key the T6050 handoff on the tree shape that the comment at :8185 already names: the inherited display is described by address, with clocks and scratch prewired.
  • Key the combo-PHY tunable copy on the apple,t6050-combo-phy node alone.
  • Reserve RTBuddySeg logs as no-map on every chip whose ADT has them (dt_reserve_j716c_oslogs()). The overlap rules you wrote (inside the retained heap or image reservation, refused otherwise) are the right ones to keep.
  • The dcpext firmware-version rewrite already keys on the node, so it needs no board check either.

New: the red format-check is base drift, not this PR. Every violation is in src/sptm_virt_s2r.c, which main has since fixed, and the four files you touch pass clang-format 20.1.8 at this head.

Once reworked and green, it merges. These rows come after the merge, with a revert ready:

  • your J716c display and deep-sleep rows on 27.0 and 27.2;
  • a J714s and J775D display no-regression row for the shared T6050 path.

@erikwb erikwb changed the title kboot: T6050: hand off the J716c internal panel and Type-C display PHYs kboot: T6050: hand off a prewired internal panel and the combo PHY ports the tree takes Nov 21, 2026
@erikwb
erikwb force-pushed the j716c/t6050-display-handoff branch from dba81b8 to dcb82ac Compare November 21, 2026 03:42
@erikwb
erikwb changed the base branch from main to j716c/rtbuddyseg-logs-no-map November 21, 2026 03:42
@erikwb

erikwb commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor Author

[!NOTE]

Thanks @RyanTheTide and @DjDeveloperr. Reworked along those lines; no branch tests chip_id plus apple,j716c any more:

  • Display: dt_set_display_j716c() is gone. t6050_handoff() now also takes the prewired tree shape (dcp found by its coprocessor address, clocks/apple,clock-ids/apple,bw-scratch already present). It checks those properties against the ADT instead of refusing them, and otherwise shares the aliased tree's checks and publication.
  • ATC: the second path is gone. The combo PHY tunable copy is selected by the apple,t6050-combo-phy node and runs for each port the tree hands to the OS (apple,guest-port-reserved).
  • RTBuddySeg logs: moved to their own PR, kboot: name the RTBuddySeg firmware logs no-map #427, which applies on every chip whose ADT has RTBuddySeg, with the same overlap rules. This PR is now stacked on it.
  • dcpext version: unchanged in spirit; it keys on the available apple,t6050-dcpext nodes only.

The J716c rows on the 27.2 stub are in the description. 27.0 and the J714s/J775D no-regression rows will follow after the merge, as you suggested.

@RyanTheTide RyanTheTide left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No blockers. Re-checked dcb82ac (on top of #427) against our 11-19 comment.

Earlier points, all resolved:

  • No branch tests chip_id == T6050 plus apple,j716c any more. dt_set_display_j716c() and the second ATC path are gone, and the only j716c left in src/ outside comments is the existing ISP table.
  • The handoff picks the prewired shape from the tree (t6050_prewired(): a dcp node at the ADT coprocessor address carrying clocks, apple,clock-ids and apple,bw-scratch). It is tried after the aliased and headless shapes, and the headless match needs exactly one iommus entry, so a prewired tree can't fall into the headless path.
  • kboot_setup_atc() (src/kboot_atc.c:1316) now keys on the apple,t6050-combo-phy node, and the RTBuddySeg logs moved to #427.

The new checks fail safe: a missing or mismatched clocks/apple,clock-ids, bad scratch cells, a non-identity ranges, a DART mismatch or a pt-region in OS RAM all bail before the scratch copy is committed, so the panel stays on the boot framebuffer.

Three smaller points:

  1. src/kboot_atc.c:1209-1210: the RX clock groups are now cut to 4 records. That table is shared with every T6050 board (J714s, J775D), so ports 1-5 there change too, not only the J716c. The fixed 4 also silently drops records if a later ADT lays the group out differently. Please derive the count from the group itself: for example, require the group to be exactly two halves of equal size and copy the first half, and keep the whole group (with a log line) otherwise. Please also move the J714s/J775D Type-C no-regression row ahead of the merge, since that path changes for them.
  2. src/kboot_display_handoff.c:3731: the prewired path takes the first apple,display-subsystem node, while the comment at t6050_check_dt() says there is one display subsystem. Refuse the prewired shape when a second one exists, so a multi-die tree can't hand off the wrong one.
  3. src/kboot_display_handoff.c:4311: when the stub's version is not three cells, the external engines the tree enables keep the tree's version, and the driver uses that version's method IDs. That is the mismatch this commit fixes. The edit is made on a dcp6_scratch() copy, and t6050_publish() already uses firmware_set_fdt() on such a copy for the internal dcp. Using it here too would handle a four-cell version, and a failed write would still change nothing. Otherwise, at least say in the log that those engines will use the wrong method IDs.

We can't run a T6050. The J716c rows in the description cover the new shape. The J714s and J775D rows (internal panel or headless scanout, plus a Type-C port 1-5 device) cover the shared path and point 1.

Assisted-by: LLM (Claude:Opus 5.5)

@RyanTheTide

Copy link
Copy Markdown
Contributor

Blockers: 2.

The tree-shape selection and the combo-phy keying look right to me. The three points in the 11-21 03:54Z review (the fixed 4 RX clock records at src/kboot_atc.c:1209-1210, a second display subsystem at src/kboot_display_handoff.c:3731, the non-three-cell version at :4311) are still open at dcb82ac. Two more:

  1. CI is red at this head. Pytest on macos-15 fails tests/python/test_rtbuddyseg_logs.py::test_rtbuddyseg_logs_named_from_the_adt with -Werror,-Wformat (%lx given a u64, which is unsigned long long on macOS). The other Pytest jobs were then cancelled and never ran. The test comes from kboot: name the RTBuddySeg firmware logs no-map #427, the base of this stack. Fix it there (the fdt_harness.py u64 typedef noted on kboot: name the RTBuddySeg firmware logs no-map #427), then rebase this PR and get a full green run.

  2. Both commit messages carry "Developed with Claude Code." and the PR description ends with the Claude Code emoji line. Please take the line out of the commits (keep the Signed-off-by) and end the description with Assisted-by: LLM (<Vendor>:<Model>).

Checked: apple,guest-port-reserved now gates ports 1-5 too (src/kboot_atc.c:1285-1287), where before they were always exported. The integration/aurora binding makes the property required on every apple,t6050-combo-phy node with a port index, and die0, dieX, ultra and j716c-left-usb4 carry it, so the current in-tree J714s/J775D trees keep their tunables. An older tree without it now gets no tunables on those ports, and the driver refuses such a port anyway (atc-t6050-dp.c:934). t6050_ext_version() (src/kboot_display_handoff.c:4302-4345) is transactional and only touches available apple,t6050-dcpext nodes. On J714s/J775D trees those nodes are disabled, so they are unchanged.

HW row: J714s (internal panel) and J775D (headless scanout), each with a Type-C device on a port 1-5, on this head: display up, the port enumerates, the same tunable set as main apart from the RX-clock change, 0 new kernel errors, 0 failed units. Run these before the merge, because the ATC table and the port filter change for them too. Plus the promised J716c row on 27.0.

Assisted-by: LLM (Claude:Opus 5.5)

@erikwb
erikwb force-pushed the j716c/rtbuddyseg-logs-no-map branch from 0ee24fc to 2e2d7e7 Compare November 21, 2026 21:01
@erikwb
erikwb force-pushed the j716c/t6050-display-handoff branch from dcb82ac to 71708f7 Compare November 21, 2026 21:01
@erikwb

erikwb commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor Author

[!NOTE]

@RyanTheTide, thanks. The stack is now 2e2d7e7 (#427) ← 6b8cc4a ← 71708f7, rebased onto main 58e712b. Both commits of this PR were amended in place.

  1. RX clock groups (src/kboot_atc.c): no group is cut any more, by a fixed count or by its layout. Every T6050 tunable group, the RX clock ones included, is copied whole and in the ADT's order, as main does.
    • An earlier revision cut "a setting and then its reverse", recognized by two halves that write the same registers, widths and masks. Matching fields don't prove an undo. A later record can just as well install the final value of a field written earlier, and the driver applies the records in order (atc_step() → apple_tunable_apply() in atc-t6050-dp.c), so cutting could drop exactly those writes.
    • On the J716c the group is four records on four different registers of the lane's RX clock bank, on every port and both lanes. The halves check never matched there, so the same records are copied as before, and the per-port log line it printed is gone.
    • test_t6050_rx_clock_groups_pass_whole (replacing test_t6050_rx_clock_setting_half) uses synthetic records with the same shape. It checks that a four-record group reaches the tree unchanged and in order, which is what the driver reads from apple,tunable-lane{0,1}-rx-clock. It also checks that an eight-record group revisiting the same registers and fields passes whole and in order (in both orders, and the group repeated whole), that an odd group passes whole, and that a record outside its bank fails the port.
    • The J714s and J775D rows stay listed as needed before merge, with your criteria: display up, the Type-C port 1-5 device enumerates, the same tunable set as main, 0 new kernel errors, 0 failed units. The J716c 27.0 row is listed as still to run. On those boards this path now copies the groups exactly as main does. Their ports 1-5 all carry apple,guest-port-reserved in the current integration/aurora trees, so they are selected as before.
  2. Second display subsystem: the prewired path refuses a tree with a second apple,display-subsystem node, and the aliased path still uses disp0. test_t6050_prewired_display_subsystem_is_the_only_one covers it.
  3. dcpext version: the edit now works as you suggested. It is made on a dcp6_scratch() copy and published with firmware_set_fdt(), like the internal dcp's, so the stub's version is serialized with all its cells (a four-cell version included), and a failed write leaves the whole tree as it was.
    • For a known stub version, every available apple,t6050-dcpext node gets apple,firmware-compat, added where the node has none, and apple,firmware-version where the node has one. The fixture covers the three-cell, four-cell, missing-compat, no-room and unknown-version cases and a disabled engine.
    • Whether the kernel can drive that firmware is a separate question: Linux's selector in iomfb_v27.c accepts only exactly registered versions, so an old kernel without the matching method table still can't drive it.

From your 06:15 comment:

  • CI: the u64 fix is in kboot: name the RTBuddySeg firmware logs no-map #427's fdt_harness.py (typedef unsigned long u64; with the _Static_assert, plus a u64 * shim for fdt_get_mem_rsv), and this PR is rebased onto it. The generated fixtures compile clean for arm64-apple-macos with -Werror in a local cross-compile on Linux. All four pytest jobs, the macos-* ones included, still have to run to completion on this head.

Other checks:

  • The full tests/python run: 815 passed, 25 skipped; the only failures are the two test_loadobjs.py cases that main 58e712b also fails on this host (806 passed there), where the host's nm prints symbols in another order.
  • Release builds with and without ESP_STAGE2=1 give the same 12 warnings as main 58e712b. make format-check with clang-format 20.1.8 is clean.

J716c row (this head, on #427 and with #281, 27.2 stub): panel and two 4K monitors over a Thunderbolt dock are up. The four apple,t6050-dcpext nodes carry <27 2 0>. Against the earlier revision on the same setup, every combo PHY, apple,t6050-dcpext and display subsystem property is byte-identical, the RX clock tunables included, apart from memory-region's phandle number (same framebuffer@ node). Docked deep sleep was refused by the dock's PCIe tunnel before sleep, the same way on the base Stage 2, so the resume row is still to run, undocked, along with the J716c 27.0 row.

@RyanTheTide RyanTheTide left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No blockers in the code. Re-checked 6b8cc4a and 71708f7 (on #427 at 2e2d7e7) against our 03:54Z and 16:57Z comments.

Resolved:

  • RX clock groups (src/kboot_atc.c): every T6050 tunable group is copied whole and in the ADT's order, as on main. The J714s and J775D tunables are therefore unchanged by this PR.
  • A second display subsystem: t6050_disp_node() (src/kboot_display_handoff.c:3736) refuses the prewired shape when a second apple,display-subsystem node exists. The aliased path keeps disp0.
  • dcpext version: t6050_ext_version() (:4329) writes through firmware_set_fdt() on a dcp6_scratch() copy, so a four-cell version is serialized whole and a failed write changes nothing. It touches only available apple,t6050-dcpext nodes, and those are disabled in the J714s/J775D trees.
  • The disclosure lines are out of both commits, and the description ends with the Assisted-by line.

Still open: CI. Because this PR's base is #427's branch, only the policy and size jobs ran on this head, not Pytest. test_t6050_tree_shape.py and test_rtbuddyseg_logs.py pass for us on a Linux host at 71708f7, but the macOS jobs haven't built these fixtures. After #427 merges, please retarget this PR to main and get a full green run before it merges.

HW rows still needed before merge, as you listed: J714s (internal panel) and J775D (headless scanout), each with a Type-C device on a port 1-5. Pass: display up, the port enumerates, the same tunable set as main, 0 new kernel errors, 0 failed units. Then the undocked J716c s2idle resume row and the J716c row on 27.0.

Assisted-by: LLM (Claude:Opus 5.5)

@DjDeveloperr DjDeveloperr left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Re-review at 71708f74110f (stacked on #427 2e2d7e71): 0 code, policy, or attribution blockers remain.

Our earlier CHANGES_REQUESTED blockers from dba81b8 and @RyanTheTide's follow-up items are all resolved:

  • No chip/board gates (§1): dt_set_display_j716c() and the second ATC path are gone. t6050_handoff(dt, true) keys on the prewired tree shape (t6050_prewired()), kboot_setup_atc() keys on apple,t6050-combo-phy, t6050_setup_atc() copies every port with apple,guest-port-reserved (0..5) whole and in ADT order (no RX-clock truncation), and RTBuddySeg log reservation moved to #427 for all chips.
  • Validation & fail-soft transactions (§2/§3): t6050_identity_reg(), t6050_check_prewired(), t6050_disp_node() (refusing a second apple,display-subsystem), t6050_check_ext_scanout() / t6050_ext_display_dart(), and the ADT pt-region alignment/bounds/OS-RAM checks all bail before committing the scratch copy. t6050_ext_version() updates available apple,t6050-dcpext nodes transactionally via firmware_set_fdt() (handling 3- and 4-cell versions and leaving disabled nodes untouched).
  • Attribution (§4): Both commits (6b8cc4a6, 71708f74) carry human author/committer and Signed-off-by: only.

Still owed before approval/merge:

  1. Stacked base & full CI: Merge #427 (2e2d7e71), retarget #282 onto main, and get a full green CI run on this head (only policy and ESP stage 2 vital size ran against #427's branch; build, format-check, stage1-size, and all Linux/macOS Pytest jobs still need to run on 71708f74).
  2. Hardware rows (§5): J714s (internal panel) and J775D (headless scanout) each with a Type-C device on port 1-5 (display up, port enumerates, same tunable set as main, 0 new kernel errors, 0 failed units), plus undocked J716c s2idle resume and the J716c 27.0 stub row.

@erikwb

erikwb commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor Author

[!NOTE]

Thanks @RyanTheTide and @DjDeveloperr for confirming zero code, policy, or attribution blockers on 71708f74110f.

@erikwb
erikwb force-pushed the j716c/rtbuddyseg-logs-no-map branch from e6e66a9 to 78337e0 Compare November 22, 2026 16:54
@erikwb
erikwb force-pushed the j716c/t6050-display-handoff branch from 8907fa6 to 545f0ef Compare November 22, 2026 16:54
@erikwb

erikwb commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor Author

[!NOTE]

Restacked cleanly onto the rebased #427 head (78337e0085b4, on main 56299352) as da106863ed60 → 545f0ef504f8, dropping the overnight gfya (0d0707a3, github-actions[bot]) and policy-restore (8907fa62) commits. Both commits remain human-signed with no code changes from 6b8cc4a6 / 71708f74.

  • Local checks on 545f0ef504f8: clang-format --dry-run -Werror src/kboot_atc.c src/kboot_display_handoff.c clean; pytest -q tests/python/test_t6050_tree_shape.py tests/python/test_rtbuddyseg_logs.py 9 passed; make RELEASE=1 CHAINLOADING=1 USE_CLANG=1 and ESP_STAGE2=1 build cleanly.
  • Still open: Retargeting onto main for a full CI run once kboot: name the RTBuddySeg firmware logs no-map #427 merges, plus the remaining §5 hardware rows (J716c undocked s2idle resume and 27.0 stub row on our side; J714s internal panel and J775D headless scanout with Type-C port 1–5 devices from lab/owners).

@RyanTheTide

Copy link
Copy Markdown
Contributor

Could the external engines this PR enables from the tree get the same placement checks as the internal display before they are handed over? On the internal side, t6050_check_adt() keeps every iop-dcp-nub segment except __OS_LOG out of [phys_base, +mem_size), and for a prewired tree t6050_check_darts() requires pt-region-23/0/16 to hold the l1-tt root and stay out of that range.

For an engine the tree enables itself, t6050_ext_one() returns early, t6050_ext_version() then rewrites apple,firmware-compat/-version on every available apple,t6050-dcpext node, and t6050_check_ext_scanout() accepts their display DARTs in disp0's iommus. None of these checks where that engine's firmware segments (iop-dcpextN-nub segment-ranges) or page tables (pt-region-23 of dart-dcpextN, pt-region-16 of dart-dispextN) lie.

Suggestion: run a per-engine placement check (segment-ranges and pt-regions against RAM, parameterised by the nub and DART paths) for each tree-enabled engine, and have t6050_ext_version() skip an engine that fails it, or that fails the uuid/running check t6050_ext_one() makes, with a log line. I'm adding that helper on main for the t6050_ext_one() path and the headless /vram check in a separate PR, so this PR could call it once that lands.

Assisted-by: LLM (Claude:Opus 5.5)

@DjDeveloperr DjDeveloperr left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Formal §1–§6 pre-PR re-review at 545f0ef504f8 (base j716c/rtbuddyseg-logs-no-map / #427, only 3 CI checks ran).

Stage 1 Impact

  • Touches Stage 1: Yes. Modifies src/kboot_atc.c and src/kboot_display_handoff.c (both in unconditional OBJECTS). Requires Stage 1 owner sign-off under §3 before merge — and stage1-size has not yet run on 545f0ef504f8.

Audit Summary

  • §1 No model gating: Pass. No chip/board gates (t6050_handoff(dt, true) keys on t6050_prewired(), kboot_setup_atc() keys on apple,t6050-combo-phy, RX clock tunable groups are copied whole in ADT order).
  • §4 Attribution: Pass. Both commits (da106863ed60, 545f0ef504f8) carry human author/committer Erik Bourget <erik@ebourget.net> and human Signed-off-by: only, with zero AI commit trailers; PR body ends with Assisted-by:.
  • §2 / §6: Pass.

Blocking Findings

  1. Stacked base (#427) & incomplete CI:
    • Because this PR still targets #427's branch (j716c/rtbuddyseg-logs-no-map, which is still OPEN and DIRTY/conflicting with main), only aurora-agent-policy and esp-stage2-size ran (3 checks). All branches: [ main ] workflows (build, format-check, all 5 stage1-size toolchains, and all 5 Linux/macOS/arm64 Pytest jobs) never ran on 545f0ef504f8.
    • Land #427, retarget #282 onto main, and obtain a full green CI run on the resulting head.
  2. §3 Safety — External-engine placement checks (echoing @RyanTheTide's 2026-11-22 review):
    • While internal display handoff verifies that non-__OS_LOG iop-dcp-nub segment-ranges and pt-region-23/0/16 stay outside OS RAM [phys_base, +mem_size), DT-enabled apple,t6050-dcpext engines bypass t6050_ext_one() early (src/kboot_display_handoff.c:4195) and are accepted by t6050_check_ext_scanout() and version-stamped by t6050_ext_version() without checking iop-dcpextN-nub segment-ranges, dart-dcpextN pt-region-23, dart-dispextN pt-region-16, or engine running/UUID state.
    • Add per-engine placement/state checks (or call @RyanTheTide's shared helper once it lands on main) so any tree-enabled engine with segments/page tables in OS RAM or invalid state is skipped with a log message rather than handed over.
  3. §5 Hardware evidence (still owed before merge):
    • J714s (internal panel) and J775D (headless scanout), each with a Type-C device on port 1–5 (display up, port enumerates, same tunable set as main, 0 new kernel errors, 0 failed units).
    • J716c undocked s2idle resume row and J716c 27.0 stub row.

@RyanTheTide

Copy link
Copy Markdown
Contributor

The external-engine safety follow-up uses the shared placement check from #471 for DT-enabled engines. The candidate checks the engine's firmware identity, running state and live DART roots before stamping the firmware version or accepting its scanout stream. It refuses unsafe engines and their child nodes even with a packed tree, and drops their scanout references.

I tested the safety change locally with a clean merge of the #427 base and current main. The combined candidate passed 1,106 Python tests, linked both stages, and passed the GCC Stage 1 size checks, including dev-audit with 2,072 bytes of headroom.

The published head is still 545f0ef504f8 and still targets #427's branch. The base conflict has a local resolution, but #427 needs its remaining evidence and review before it lands. After that, #282 can target main and run the full CI matrix. The J714s and J775D Type-C/display rows, plus the J716c undocked resume and 27.0 rows, are still open.

erikwb added a commit that referenced this pull request Nov 27, 2026


With both #281 (T6050 G17C GPU handoff) and #282 (T6050 display handoff)
merged on top of main, placing both in .rodata.xtext pushes .rodata +
.rela.dyn 1,728 bytes past a 64 KiB boundary while .text still has
24 KiB free. Keep T6050_INIT and T6050_TEXT in .text so .text, .rodata,
and .data all fit cleanly below _file_limit (6,072 B headroom).

Signed-off-by: Erik Bourget <erik@ebourget.net>
…ioning

If an input-enabled apple,t6050-dcpext engine passes t6050_ext_reject() but fails t6050_check_ext_adt() (for example its live power, CPU run, or DART state changes before t6050_ext_version() stamps it), the versioning loop previously skipped it and left it enabled with its original firmware properties and display-subsystem scanout entry.

Disable and strip scanout via t6050_ext_disable() when t6050_check_ext_adt() fails in t6050_ext_version(), and only mark the engine done once its firmware properties update cleanly so a rescan after enclosing display-subsystem deletion cannot skip it. Add host tests covering an engine that passes rejection and stops running before versioning on both normal and packed device trees.

Signed-off-by: Erik Bourget <erik@ebourget.net>
@erikwb

erikwb commented Nov 27, 2026

Copy link
Copy Markdown
Contributor Author

Updated #282 with three commits on top of 1458e4eb7cba:

  • d3184b1778fc (tests/python/fdt_harness.py): moved fdt_addresses.c out of LIBFDT_SOURCES into fdt_harness.run() so tests/python/test_wdt_arm.py::test_dt_set_wdt_reconfig does not link it twice, while keeping test_t6050_tree_shape.py linked.
  • 1ddba986798f (src/kboot_display_handoff.c, tests/python/test_t6050_tree_shape.py, tests/python/test_t6050_handoff_bounds.py): extracted the guarded live hardware checks (PMGR power domains, ASC_CPU_CONTROL_RUN, and DART PROTECT_TTBR_TCR / four-level translate TCR / valid TTBR matching ADT l1-tt) from t6050_ext_one() into t6050_check_ext_live() and called it from t6050_check_ext_adt() so pre-enabled external engines verify live registers against the validated ADT roots before t6050_publish_prewired() retains scanout or t6050_ext_version() stamps firmware properties. Supplied external power and DART register state in the host fixtures and added coverage where a stale ADT passes placement checks while a live DART root differs (pointing into OS RAM), unlocked/stopped/unpowered/faulted cases, and the unknown-stub path.
  • e6a3bcb13fca (src/kboot_display_handoff.c, tests/python/test_t6050_tree_shape.py): when t6050_check_ext_adt() passes during t6050_ext_reject() and then fails during t6050_ext_version(), disabled the engine and stripped its scanout entry via t6050_ext_disable() instead of skipping it with original firmware properties intact, and deferred setting done until t6050_ext_version_one() succeeds so rescans after an enclosing display-subsystem deletion cannot skip an engine. Added host tests covering an engine that passes rejection and stops running before versioning on both normal and packed device trees.

Verified at e6a3bcb13fca:

  • pytest -q tests/python/test_wdt_arm.py tests/python/test_rtbuddyseg_logs.py tests/python/test_t6050_tree_shape.py tests/python/test_t6050_handoff_bounds.py: 167 passed (cc), 167 passed (CC=clang).
  • Other 12 display/handoff/OSLog/layout suites (test_dcp6_max_brightness.py, test_t6041_display_handoff.py, test_t6041_27_display_handoff.py, test_oslog_reservation.py, test_dcp_fw27_clocks.py, test_dcp_typec_routes_adt.py, test_display_dart_view.py, test_m4_dcp_handoff.py, test_ave_handoff.py, test_t6031_runner_failures.py, test_stage1_room.py, test_rela_layout.py): 182 passed, 1 skipped (cc; CC=clang: 153 passed, 1 skipped, test_display_dart_view.py hits the pre-existing unused-function setup error on dart_gen3_tlbi_broadcast).
  • All 6 host shell scripts (run-t8122-display-handoff.sh, run-fdt-disable.sh, run-aop-os-ram.sh, run-pmp-boot-data.sh, run-t8122-gpu26-identity.sh, run-rtkit-placed-buffer.sh): pass under both cc and CC=clang.
  • clang-format --dry-run -Werror src/kboot_display_handoff.c src/kboot_atc.c and make rustfmt-check: pass.
  • tools/stage1_size.sh: clang (7752 B stage1, 77928 B secure-audit/enforce), host gcc 16.2 (6584 B stage1, 77448 B secure-audit/enforce), and Ubuntu 24.04 container aarch64-linux-gnu-gcc 13.3 (6152 B stage1, 77528 B secure-audit/enforce; optional stage1-dev-audit does not link).
  • esp-stage2-size (without BUILDSTD=1): ESP vital region: 811160 B, 368488 B free; ARCH=aarch64-linux-gnu- Stage 1 + ESP_STAGE2=1 and RELEASE=1 CHAINLOADING=1 USE_CLANG=1 ESP_STAGE2=1 (1.0.0b17-ge6a3bcb1, aura.bin sha256 prefix 24c2d8fde8eb620d) build cleanly.

Hardware at e6a3bcb13fca (J716c, 27.2 stub, one-shot aura-try Stage 2 1.0.0b17-ge6a3bcb1, default payload tail, default stage2.bin unchanged):

  • eDP-1 up at 3456x2234@120; dcp@48ae00000 okay with apple,bw-scratch.
  • All 4 apple,t6050-dcpext engines okay with apple,firmware-version and apple,firmware-compat (27, 2, 0); 4 apple,t6050-combo-phy nodes (3 active, with full tunable sets).
  • dmesg error lines 40 vs 43 on the default Stage 2; 0 new display/DCP/ATC/DART errors; 0 new failed units. GPU stays disabled because #282 has no GPU handoff.
  • Control main (26c1a85bb788, 1.0.0b17-g26c1a85b) on the same Mac: 60 Hz simplefb (Unknown-1), dcp@48ae00000 disabled, engines at (27, 0, 0), two DCP probes failing -110, and apple-t6050-dp-phy missing apple,tunable-axi2af.
  • Rebooted cleanly back to the default Stage 2.

@satchlj @DjDeveloperr: the J716c aura-try row at e6a3bcb13fca is in the PR body now. Still open: full GitHub CI on this head, the Stage 1 and T6050 board owners' sign-off, and the live external-monitor and undocked s2idle checks. Ready for re-review.

RyanTheTide
RyanTheTide previously approved these changes Nov 28, 2026

@RyanTheTide RyanTheTide left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Verdict: MERGE at e6a3bcb13fca

Blockers: none

Checked: Re-checked against @satchlj's review at f6e5eace.

  1. Red Stage 1 CI: fixed. main is merged in, and the T6050 display and ATC helpers moved to .rodata.xtext. Every job at this head passes, including all five stage1-size jobs and the five Pytest jobs.
  2. J716c row at this head (27.2 stub, 1.0.0b17-ge6a3bcb1): it is in the description. eDP-1 is up at 3456x2234@120, all 4 apple,t6050-dcpext engines are okay at (27, 2, 0), and the 4 combo-PHY nodes carry tunables. There are 0 new kernel errors and 0 new failed units against a main control on the same Mac, which fell back to a 60 Hz simplefb. That is the row Dj asked for on 0113c4ee.
  3. New since f6e5eace (d3184b17, 1ddba986, e6a3bcb1): t6050_check_ext_live() is the old live check from t6050_ext_one() moved into its own function. It now also runs for tree-enabled engines before they are version-stamped or kept as scanout, and the power-word reads are inside the fault guard now. In t6050_ext_version(), an engine that fails the re-check or the version write is disabled and stripped from scanout, and done is only set on success. The rescan ends because a disabled engine is no longer available.

Not blocking:

  • Merge order with #281: main + #281 + #282 does not link Stage 1 (clang stage1 flavour, Code and data reach the DCP log buffer after stage 1!). This one has 7504 B alone with our clang 22. Whichever lands second has to merge main again and get stage1-size green before it merges.
  • The Stage 1 and T6050 board-owner sign-off is on our side. The J714s/J775D/27.0 rows come after the merge, as agreed. The undocked s2idle row waits on the PMU RTC alarm IRQ.

@satchlj: your points look fixed at this head. Could you re-review? Your change request still blocks the merge on GitHub.

Evidence
  • CI at e6a3bcb1: all checks pass.
  • Local, e6a3bcb1 merged into main 2c8fa8d8 (x86 host): pytest -q tests/python/test_wdt_arm.py test_rtbuddyseg_logs.py test_t6050_tree_shape.py test_t6050_handoff_bounds.py test_t6041_display_handoff.py test_m4_dcp_handoff.py test_oslog_reservation.py: 233 passed.
  • tools/stage1_size.sh with clang 22.1.6 (USE_CLANG=1 BUILTIN_LOGO=aurora BUILDSTD=1): stage1 7504 B, secure-audit 77928 B. main + #281 + #282: stage1 does not link.
  • Read the 1458e4eb..e6a3bcb1 source interdiff in full.

@RyanTheTide

Copy link
Copy Markdown
Contributor

Merge order for #281 and #282: main + #281 + #282 doesn't link Stage 1 ("Code and data reach the DCP log buffer"), although each links alone. #281 is older, so it goes first. After it lands, #282 needs main merged in again with a normal push, and the gcc/fedora/nix stage1-size jobs must show headroom no lower than main's (move any further new code to AURA_XTEXT if needed). Stage 1 sign-off from our side: OK for #281 at head, and for #282 once its post-#281 merge passes the size check. satchlj's change requests still block on GitHub until re-reviewed.

@erikwb

erikwb commented Nov 28, 2026

Copy link
Copy Markdown
Contributor Author

@RyanTheTide @satchlj @DjDeveloperr

Agreed on the merge order (#281 first, then #282). Checked against main: main (99b6dd13) + #282 (e6a3bcb13fca) merges cleanly and passes tools/stage1_size.sh clang (7040 B headroom), while combining main + #281 + #282 failed link with Code and data reach the DCP log buffer after stage 1! at 1458e4eb7cba, in the 2026-11-28 ESP Stage 2 link attempt (9aae69b24, main + #281 (278bbd272e9e) + #282 (e6a3bcb13fca) with ESP_STAGE2=1, clang -Os/-Oz and gcc), and in the separate Stage 1 (stage1 flavour) failure @RyanTheTide reproduced on main 2c8fa8d8 (the linker script prints after stage 1! in both builds; no combined image could be built or booted). Once #281 merges to main, we will merge main into j716c/t6050-display-handoff and resolve the size budget before #282 lands.

At e6a3bcb13fca, GitHub CI reports 19 successes, 2 cancelled, 1 skipped (build, format-check, ESP stage 2 vital size, all five stage1-size toolchains, all five Pytest jobs, and policy passed; both cancelled readiness and pr-text checks also have successful runs, and selftest has 1 skipped and 1 success). The PR body now includes **Revert:**, the CI rollup, the J313 (M1 Air) one-shot aura-try boot evidence at e6a3bcb13fca (smoke and Borealis checks pass, 0 failed units, one-off Wi-Fi ring line shared with the main control), the 2026-11-28 J716c (M5 Max) one-shot aura-try boot (c5c2a0dd..., default kernel bf2582ab... vs main a0504b2a376d control 942727ab...: eDP-1 up at 3456x2234@120 with dpmsStatus: 1 and vrrCapable: yes, 0 failed user units, 1 baseline failed system unit aurora-peripherals.service shared with control and restored default, 0 LSM denials, and 41 err+ lines consisting of 39 dcpext unable to match service lines, 1 systemd-gpt-auto-generator line, and 1 apple-pmp-report-entry ... -110 line — the main control lacks those 39 dcpext messages; GPU absent as expected without #281), and the updated **Not yet:** list (J713 was not booted for #282).

The CI and hardware findings from @satchlj's f6e5eace review are addressed at e6a3bcb13fca; @RyanTheTide approved e6a3bcb13fca, while @satchlj's re-review, Stage 1 / T6050 board-owner sign-offs, and the post-#281 size reconciliation remain open. Could you re-review when ready?

@github-actions github-actions Bot added blast:all Macs affected, from Merge risk (bot) and removed blast:m5 Macs affected, from Merge risk (bot) labels Nov 29, 2026
@RyanTheTide

Copy link
Copy Markdown
Contributor

@erikwb Stage 1 disposition: keep the validated native panel and external-engine handoff active by default where the ADT/DT describes it. Land after #281. Could you add the J716c display receipt to the #551-based combined run requested in #281? Please record the panel mode, external engines and PHYs, and compare the 39 dcpext service errors and the PMP timeout against the same saved main baseline. Include an owner-authorized installed Stage 1 cold boot, rollback verification and silent smoke. Please confirm your next test slot here.

Signed-off-by: Erik Bourget <erik@ebourget.net>
@RyanTheTide

Copy link
Copy Markdown
Contributor

Landing plan for #281 and #282: one consolidated list. Fix these and both merge.

Since the change requests:

Open items:

  1. J716c row of 0c21f793 (@erikwb, the only J716c). One aura-try ESP Stage 2 one-shot against your saved main control. Check G17C render and the 14 OPPs, the internal panel mode, the 4 dcpext engines and the combo PHYs, and the 5 user units that failed with kboot_gpu: T6050: hand the G17C (M5 Max) GPU over from the ADT #281 alone (pipewire.service/.socket, speakerguardd-v2-graph/-session, xdg-desktop-portal-hyprland). Keep the speakers silent. I expect the units to come back with the native panel from kboot: T6050: hand off a prewired internal panel and the combo PHY ports the tree takes #282, because with a render node but no KMS panel the session never settles. If they still fail combined, that is a real kboot_gpu: T6050: hand the G17C (M5 Max) GPU over from the ADT #281 bug, and we fix it before either lands.
  2. App review at both heads. Requested now.
  3. Merge order. If item 1 passes, kboot_gpu: T6050: hand the G17C (M5 Max) GPU over from the ADT #281 and kboot: T6050: hand off a prewired internal panel and the combo PHY ports the tree takes #282 merge back to back in the same window, so main never carries kboot_gpu: T6050: hand the G17C (M5 Max) GPU over from the ADT #281 without kboot: T6050: hand off a prewired internal panel and the combo PHY ports the tree takes #282. kboot: T6050: hand off a prewired internal panel and the combo PHY ports the tree takes #282 needs no second main merge for size, because the combined tree above already has aura-raw.ld: one read-execute region on 16 KiB steps #551's budget.

The installed Stage 1 cold boot from the 11-29 disposition is the owner's 1TR step. It doesn't block this.

@satchlj, every point from your 11-24 reviews is addressed (CI, owner sign-off, and exact-head rows for each PR alone). The combined row above is the last item, so please re-review or say if anything else blocks. @DjDeveloperr, FYI.

@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: FINISH at e6a3bcb

Checked: The standalone J716c row shows the internal panel and combophy handoff with no failed user services. The combined branch is a distinct landing tree and the earlier combined ESP Stage 2 failed to link. The reported clang Stage 1 margin on the new combined candidate is a separate check.

Blocker: For the paired landing, provide the combined ESP Stage 2 link result and a J716c run with both renderD128 and eDP-1 active and a working login session. Record the Stage 1 owner disposition and size results for whichever tree lands.

@erikwb

erikwb commented Nov 29, 2026

Copy link
Copy Markdown
Contributor Author

J716c results for #282 on post-#551 main are in the #281 thread: #281 (same run). For #282 specifically, booted as #281 + #282 (8c2bb4fed9a7, 1.0.0b17-g8c2bb4fe, one-shot aura-try, kernel 7.3.0-ewb342+, default cmdline):

  • Panel mode: apple-drm eDP-1 connected and enabled at 3456x2234, compositor up, vkcube --c 240 on Wayland rc 0, 0 GPU fault lines, 0 failed user units.
  • External engines and PHYs: internal DCP okay. Three apple,t6050-combo-phy nodes okay with 16 tunables, axi2af present and apple-t6050-dp-phy bound; the fourth (phy@38b000000) is disabled with no tunables, same as the default boot. All ATC USB, PHY-mux, CIO and PCIe domains off-0 with nothing attached.
  • dcpext service errors: 39 unable to match service lines (4 per engine and service, md-manager 3 times), against 40 on the default boot today with the same set of services and channels. They are the firmware's advertised services the driver has no client for (AppleDCPDPTXController channels, dcpexpert-service, test-service, aop-test, md-manager). No PMP -110 lines.
  • Speakers: silent, speakerguardd-v2 active, sinks SUSPENDED.

Stage 1 room: the combined tree links under clang and gcc for every flavour (before #551 it failed to link). Headroom is lower than main's: gcc stage1 77,712 B against 94,168 B on main; clang 78,312 B against 94,704 B.

Not run: an installed Stage 1 cold boot with rollback verification. That replaces Stage 1 on the Mac, so it waits for the owner's OK.

@RyanTheTide

Copy link
Copy Markdown
Contributor

Thanks @erikwb, that closes item 1. The combined J716c row (8c2bb4fe = #281 a6d319f2 + #282 b50e52c7) passes: G17C render, 14 OPPs, native eDP-1, 0 failed user units, speakers silent with speakerguardd-v2 active, and no PMP -110 lines. That arm also has one fewer dcpext service line than the default. With #281 alone, the one remaining failure is the expected in-between state: a GPU with no native panel means no compositor, so the Hyprland portal can't start.

That settles the landing: #281 and #282 merge back to back, never #281 alone. What's left is mechanical: App review at the new heads (a6d319f2, b50e52c7, requested) and hosted CI at both heads, which is queued behind the org's runner backlog. @satchlj, unless you object, I'll treat your 11-24 requests as answered once those are green.

@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: MERGE at b50e52c after the integration gates below.

Checked: Verified the forward-merge parents and the combined J716c boot at 8c2bb4fed9a7. The built Stage 2 exercised native eDP, the compositor and G17C rendering with zero failed user units. The combined size receipt reports links under clang and gcc. Approve as part of the owner-directed paired landing with #281, subject to current hosted CI and the exact landing tree's Stage 1 disposition.

Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com>

@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: MERGE at 2e2a9899

Blockers: none for code review — merge strictly back-to-back with #281, after queued hosted CI at 2e2a9899 completes green (and #570 lands or reconciles cleanly) with Stage 1 size/disposition checks on the landing tree.

Checked:

  • Audited the b50e52c7..2e2a9899 delta: clean merge of #570 (0188afd4, bringing current main 8c16c3f4 plus the 3 host-test fixes in tests/fuzz/build.sh, tests/python/test_fuzz_regress.py, and tests/python/test_t6041_atc_usb2_device.py).
  • Zero changes to #282's previously approved production code (src/kboot_atc.c, src/kboot_display_handoff.c) or its host tests (tests/python/fdt_harness.py, tests/python/test_t6050_handoff_bounds.py, tests/python/test_t6050_tree_shape.py).
  • Prior combined J716c Stage 2 receipt (8c2bb4fe = #281 a6d319f2 + #282 b50e52c7) carries over for the unchanged production code: native eDP-1, compositor + G17C render, and 0 failed user units.
  • DCO Signed-off-by: present on 2e2a9899; no Apple material or policy issues.
Evidence
  • Merge parents of 2e2a9899: b50e52c7 (previously approved head) and 0188afd4 (#570).
  • Diff files vs main: src/kboot_atc.c, src/kboot_display_handoff.c, tests/python/fdt_harness.py, tests/python/test_t6050_handoff_bounds.py, tests/python/test_t6050_tree_shape.py, plus #570's 3 host-test files.
  • CI at review time: 18 queued, 1 pending, 11 skipped (0 failures).

@github-actions github-actions Bot added the needs-hw-row No hardware row at the PR head (bot) label Nov 29, 2026
@RyanTheTide

Copy link
Copy Markdown
Contributor

Merging at 05c5ef6d (merge) under the 6-point rule. (1) The review App's verdict at this head: APPROVED. (2) CI is green at this head (readiness excluded). (3/4) Rows: erikwb combined J716c row with #281 PASS (8c2bb4fe); paired landing; combined main+281+282 fedora:44 size + pytest 1464 PASS. (5) No blocking review is open. (6) Dj was pinged with no objection. Revert: git revert -m 1 <commit>.

@RyanTheTide
RyanTheTide merged commit 1b52752 into main Nov 29, 2026
29 checks passed
@RyanTheTide
RyanTheTide deleted the j716c/t6050-display-handoff branch November 29, 2026 14:02
@RyanTheTide

Copy link
Copy Markdown
Contributor

Thanks @erikwb, merged #281 and #282 back to back. Your combined J716c row covers both. Before landing, the combined tree on current main passed the fedora:44 Stage 1 size job and the full host pytest.

RyanTheTide added a commit that referenced this pull request Nov 30, 2026
Conflicts in src/kboot_display_handoff.c against #282 (prewired T6050
tree, t6050_ext_version): the state keeps both dcp_fw and prewired, the
internal publish and both external paths write t6050.dcp_fw, and the
adopted-panel helpers sit beside t6050_ext_index().

tests/t6050_display_host.c: the t6041 harness now walks ADT children
(adt_tree.h), so the fixture's aborting traversal stubs are dropped.

Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com>
RyanTheTide added a commit that referenced this pull request Nov 30, 2026
The 27.3 beta 1 row names its DCP ABI (27.3.0), yet t6050_pick_image()
still required the running OS firmware enum to match it. The nub's ADT
uuid identifies the image exactly, and nothing else in the handoff reads
the OS firmware for such a row, so select it by that uuid alone. Rows
whose DCP nodes take the OS firmware's version keep pinning it (27.0 and
27.0.1 share an iBoot version).

t6050_ext_version(), which since #282 rewrites the version of the
external engines a tree enables itself, now writes the same ABI as the
internal dcp and t6050_ext_one(): the picked row's, or the OS firmware's
when no row was picked. Before, a prewired tree on that image would
have given its internal dcp 27.3.0 and its external engines 27.2.98.1.

Tests: t6050-27.3-any-os (the image on an unknown OS firmware is still
handed off with 27.3.0) and two ext-version cases (beta and unknown OS
firmware, engines get the row's ABI); both fail before this change and
pass after.

Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

blast:all Macs affected, from Merge risk (bot) changes-requested A reviewer requested changes (bot) door:one-way Revertible or not, from Merge risk (bot) needs-hw-row No hardware row at the PR head (bot) needs-review No approving review from Core or Omarchy Mac yet (bot)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants