Skip to content

kboot: describe the J773g display frontend's inherited regions - #258

Closed
techmore wants to merge 8 commits into
aurora-silicon:mainfrom
techmore:upstream/aura-j773g-disp0-regions-tested-tree-20261114
Closed

techmore wants to merge 8 commits into
aurora-silicon:mainfrom
techmore:upstream/aura-j773g-disp0-regions-tested-tree-20261114

Conversation

@techmore

@techmore techmore commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Publish J773g's inherited external-display mappings in the Linux device tree when aura hands off the locked display DART.

On T8132/J773g with firmware 26.6.2, Linux must be told about every inherited translation before it can adopt the display frontend. This change walks the locked DART read-only, validates the expected SID0 and SID16 translations, and transactionally publishes the disp0, PIODMA and retained-framebuffer reservations. It does not enable, reset, invalidate or write the DART. The walker is not built into Stage 1.

Stacked draft

Head d6f6a470f2c68ac3dc07b9b07addbcef61ec8e1c (tree 380d92e644dafc1954dbe82758ae0844c4e1d9ba) on aura main eb66d6cd79a46ddcff85628599135a607fd70648:

  1. the four kboot: T8132 USB3 calibration, AOP handoff and absent-ISP rule by ADT property #113 commits (b3b52c0c..24812c55);
  2. kboot: hand off a T8132 HDMI DCP and its display frontend through the M4 DCP path #199's DCP mapping commit (0ad3c86b) and its two fixes (531da3a8, ab6f3611), authored by Sean Dolbec with Assisted-by: LLM;
  3. this change (d6f6a470).

It does not contain or depend on #244. It is not mergeable until #113 and #199 land and this delta is restacked on their then-current heads. The Linux side depends on linux #1192.

The top commit is the Stage-1-guarded revision: its stable patch-id is 7110eb2985fb, the same as 7c0e93cd/45ef54cf, and not the unguarded 7fdadb3e patch-id e03c9e886433. The guard keeps the display-DART walker out of Stage 1 and leaves it in ESP Stage 2. The deterministic preview also adds Sean Dolbec's Signed-off-by to all eight commits without changing their patches; this fixes the first #258 push, whose commits were unsigned.

Tests

  • pytest, Ubuntu 24.04 container on this tree: gcc leg 737 passed (main 733), clang leg 676 passed (main 672); the 31 and 91 failing IDs are the same set as main's in that container (LeakSanitizer cannot attach there).
  • pytest, macOS: 739 passed (main 735); the 6 remaining items are main's own host-toolchain items.
  • Stage 1 headroom: gcc 18152 B (main 18152), clang 18384 B (main 83920). CI fails the shipped Stage 1 below 4,096 B and warns below 8,192 B; its secure audit/enforce variants fail below 8,192 B. Both measured values are above the 8,192 B threshold.
  • make format-check (clang-format 20.1.8) clean.

Hardware

J773g (Mac mini M4, Stage 1 1.0.0b8): spec 22 recorded one exact-head PASS as a one-shot ESP Stage 2 (aura-try; the live Stage 2 untouched) with the stock Aurora U-Boot e1ef8b636fc9 appended (our own build from that commit with apple_m1_defconfig), on the installed default kernel and its run-59 device tree. The boot reached Linux with DMI aura 1.0.0b13-gd6f6a470 / U-Boot 2026.07-ge1ef8b636fc9, Ethernet up, no RTKit crash, HDMI-A-1 connected and enabled with 1080p and 4K modes on apple-drm, and Stage 2's log admitting the inherited SID0/SID16 frontend and publishing the disp0/PIODMA regions.

This first exact-head boot makes the package review-ready. Four planned repeats of the same spec remain in the boot queue and are not claimed here.

An earlier run of the same guarded display patch at 7c0e93cd used the exact linux #1192 kernel (7.3.0-prheads+), its paired exact-#1192 DTB and U-Boot 1b60b47ef6a2. It reached Linux without Atlantic/Ethernet and did not self-return. The initial summary said only simpledrm registered; the recovered persistent journal later showed simpledrm first and then one apple-drm external output with appledrmfb at 1920x1080@120. By contrast, spec 22 used the installed default kernel (7.3.0-m4atlrx+), the run-59 DTB and stock U-Boot e1ef8b636fc9, and returned cleanly with Ethernet and apple-drm HDMI. These are the recorded kernel, DTB and U-Boot-tail differences; neither run is used as evidence for the other's exact artifact set.

Earlier evidence for the unguarded display patch (7fdadb3e, a different tree on the #244 stack and U-Boot 1b60b47ef6a2): three boots with the inherited SID0/SID16 admitted, the external DCP adopted, HDMI-A-1 connected on apple-drm and G16 READY. Separately, GitHub user FatBoy721 reported 3/3 supporting boots on a second J773g with stock U-Boot and without #244: #199 comment 6885045626. That is attributed third-party evidence, not this package's receipt.

The U-Boot pairing is deliberate: with Stage 1 1.0.0b10 or earlier, this no-#244 stack boots with stock e1ef8b63, which adopts the inherited live ANS session. A U-Boot from the #38/#40 restart series, including the tested 1b60b47e tail, refuses that live adoption and therefore needs #244's compatibility fix.

Not covered

This exact rebased head with the exact linux #1192 kernel and DTS; HDMI on the installed kernel beyond what the boot rows above state; cold entry, 4K60, HDMI audio, hotplug, other firmware versions and other boards.

The J773g admissions that follow were checked against one J773g ADT,
that of macOS 26.6.2: target-type J773gAP, board-id 0x2a, chip-id
0x8132 and iBoot mBoot-18000.161.10. Add kboot_is_j773g(), which is
true only when the live ADT, the OS firmware and the OS tree all match
that: the root compatible J773gAP, board-id 0x2a, os_firmware 26.6.2,
and an OS tree that is both apple,j773g and apple,t8132. A J713 tree on
a Mac mini, a Mac mini on 26.7, or any other T8132 board fails it.

It goes in a new kboot_t8132.c, which the T8132 rules that follow
share: kboot.c's code is linked into Stage 1's .init slot (aura-raw.ld),
which has 96 bytes left in the GCC build. The host test breaks each of
those facts in turn.

Booted six times on one J773g (26.6.2, Stage 1 1.0.0b8), loaded into RAM
through the Stage 1 proxy: each time the gate admitted the machine (the
USB3 calibration copy that uses it later in this series ran). A J713 or
a non-26.6.2 boot was not run.

Assisted-by: LLM
Signed-off-by: Sean Dolbec <sdolbec1@gmail.com>
The T8132 USB3 bundle (apple,tunable-usb3-*, the lane groups and the
optional AUX group) was copied only for the J713 and the J604. On
every other T8132 board the T8132 PHY nodes fell through to the older
t8122 tunable path, whose properties the T8132 PHY driver does not
read.

The J773g's 26.6.2 ADT has all 27 groups of the bundle and
tunable_AUX_TOP on each of atc-phy0..3 (compatible atc-phy,t8132), and
every record is a 32-bit write inside its group's window. Most groups
are byte for byte the J713's; the AUSPLL core, CIO3 PLL core, AUSCMN
SHM and both lanes' RX EQ groups are the machine's own. The J773g tree
describes atcphy0..3 as apple,t8132-atcphy with aliases.

Copy the bundle on a live J773g on 26.6.2 too. The copy is unchanged:
a missing or malformed required group still removes the whole bundle
and leaves USB2. This only fills properties: whether a port runs USB3
stays the tree's choice.

The existing J713 fixture exercises the T8132 USB3 copy and rejection
path. There is no J773g fixture: J773g-specific calibration data is not
covered by a host test.

Booted six times on one J773g (26.6.2, Stage 1 1.0.0b8): the tree
Linux received carried the bundle (seven apple,tunable-usb3-*
properties) on each of atcphy0..3. USB3 link speed was not tested.

Assisted-by: LLM
Signed-off-by: Sean Dolbec <sdolbec1@gmail.com>
dt_set_t8132_aop() returned early on every T8132 board but the J713
and the J604 and left the OS tree's AOP node as it found it. The shared
M4 trees (t8132-jxxx.dtsi, so the J623, J624 and J773g) enable the AOP,
its DART and its mailbox, and ask for its handoff in
linux-enablement-mac,dapf-handoff, on the promise that the loader
"programs the AOP DART's DAPF and reserves its firmware and DAPF
windows ... or disables the AOP". On those boards aura did neither, so
Linux started an AOP whose DAPF was empty and whose __ETEXT and
__OS_LOG were not reserved.

Disable the AOP there, as the J713 and J604 path already does on any
failure, without reading the AOP or programming its DART. The J713 and
J604 path is unchanged.

The new host test runs the production gate on J713 and J604 trees
(handoff, every refused step, a running AOP, no request) and on J623,
J624, J715 and J773g trees with and without the request: the AOP ends
disabled and nothing touches it.

The shared source DTS enables the AOP, but the shipped 26.6.2 J773g OS
DT used for the normal boots has it disabled; the TEST-DTB boot changed
that node to `okay` and observed it return `disabled`. Booted on one
J773g (26.6.2) with a test tree that enables the AOP: Linux received the
AOP disabled and its DART as the tree had it. Not booted on the J623,
J624 or J715.

Assisted-by: LLM
Signed-off-by: Sean Dolbec <sdolbec1@gmail.com>
The J773g (Mac mini) has no camera: its 26.6.2 ADT has no isp, isp0 or
dart-isp node. t8132.dtsi describes the ISP and its three DARTs
disabled and the J773g tree leaves them so, but nothing in aura held
that: the J713 handoff only runs on the J713, and dt_set_isp() acts
only through an "isp" alias. A tree that enabled the ISP would have the
OS probe a camera and ISP power domains that are not there.

On T8132, when the ADT has neither isp nor isp0, disable every enabled
apple,t8132-isp node and the DARTs in its iommus list that no other
node uses. A tree that already leaves the ISP disabled is not changed,
and a Mac whose ADT has an ISP (the J713) is not touched.
The rule goes in kboot_t8132.c, out of Stage 1's full .init slot.

It runs before dt_set_isp(). On such a Mac that step cannot reserve
the ISP firmware and disables the node the isp alias names, but not its
DARTs; run after it, the rule would find the ISP already disabled and
leave those DARTs enabled.

The host tests cover an enabled ISP, a disabled one, a DART shared
with another device, a malformed iommus list, a Mac with isp or isp0
in its ADT, and another SoC. A second test runs the real dt_set_isp()
and the rule in kboot_prepare_dt()'s order.

Booted on one J773g (26.6.2) with a test tree that adds an enabled ISP
over three DARTs, one of them also used by another node: Linux received
the ISP and its two unshared DARTs disabled and the shared DART enabled.
The shipped 26.6.2 J773g OS DT used for normal boots has no ISP node;
the TEST-DTB boot added an enabled one.

Assisted-by: LLM
Signed-off-by: Sean Dolbec <sdolbec1@gmail.com>
The J773g (M4 Mac mini) has no panel: its main DCP drives the fixed
HDMI port, and the ADT marks /arm-io/disp0 external. The existing
handoff rejected every non-J713 board with that flag, so the DCP
firmware reservations never reached the kernel DT.

For an admitted J773g whose DCP declares an HDMI-A connector, publish
one reservation per ADT segment. Keep the OS log physical-only and map
every other segment through the DCP at its remap address. Validate linked
pre-existing reservations, refuse unlinked overlaps, and apply the J773g
firmware metadata and reservation set as one FDT transaction.

The J773g path does not read or write live DART tables; panel M4 Macs
continue to use the existing path. Extend the production-code host
fixture for existing reservations, publication, end-to-end rollback,
and a non-HDMI refusal.

Assisted-by: LLM
Signed-off-by: Sean Dolbec <sdolbec1@gmail.com>
A J773g DT that already describes some DCP firmware segments names them
the usual way, by node name without the unit address:

    memory-region-names = "asc-firmware", "dcp_data", "region57", ...

The handoff compared each label with the full node name
("asc-firmware@100002a8000"), so it refused that tree as a whole and
published nothing. Without the OS-log reservation the kernel then
refuses the inherited SID23 domain, and HDMI stays on the boot
framebuffer.

Accept the label with or without the unit address. The OS-log label
stays exactly "dcp-os-log", and range and DART checks are unchanged.

Seen on a J773g (26.6.2) with the run-59 DTB: no apple,dcp-os-log node
after the handoff. This change alone was not enough there (the next
patch fixes the second refusal); with both, the OS-log reservation is
published (asc-firmware@1000cc90000, 0x24000, apple,dcp-os-log).

Assisted-by: LLM
Signed-off-by: Sean Dolbec <sdolbec1@gmail.com>
Before adding a DCP firmware reservation, the J773g handoff refuses any
existing /reserved-memory node it could overlap. A J773g DT carries
zero-size placeholders (gpu-fw-text, gpu-fw-data and the uat-* nodes)
that dt_set_gpu() fills in only after dt_set_display(). The scan took
each of them for an invalid reservation and refused the whole handoff,
so the DCP's OS-log reservation was never published and the kernel
refused the inherited SID23 domain.

An empty placeholder reserves nothing and cannot overlap a segment; skip
it, as the kernel's DART handoff does. A reservation that wraps still
refuses.

Tested on a J773g (26.6.2) with the run-59 DTB: the handoff now
publishes the OS-log reservation, and Fedora boots with NVMe, USB,
Ethernet and the GPU as before.

Assisted-by: LLM
Signed-off-by: Sean Dolbec <sdolbec1@gmail.com>
On the J773g the main DCP drives the HDMI port, and its display frontend
(disp0, SID0 of the display DART) and PIODMA child (SID16) keep running on
the tables iBoot left. A kernel that adopts them needs every inherited
page described. Only the DCP's own regions were published, so a kernel
DT without hand-copied reservations gave disp0 no memory-region and the
display DART refused the frontend.

Read both streams' tables, locked and read only, after the DCP handoff.
SID0 must map exactly one whole DCP firmware segment plus pages of the
retained scanout framebuffer (/vram); SID16 exactly one whole segment.
Give disp0 that segment's reservation with its own iommu-addresses tuple
and a no-map "framebuffer" reservation of /vram, and the PIODMA child
(when the DT has the disp0_piodma alias) its segment. A page that is
neither refuses the step, which runs as its own transaction after the
DCP handoff: on refusal the DCP mappings are kept and the frontend is
left undescribed, as before. A DT that already describes disp0's regions
is left as it is.

The host harness models the J773g streams as read on the hardware (SID0:
segment 4, SID16: segment 5, the framebuffer unmapped after a reset) and
checks the frontend against what the kernel's DART admission requires,
plus a still-scanning-out framebuffer and a refused stray page.

Assisted-by: LLM
Signed-off-by: Sean Dolbec <sdolbec1@gmail.com>
@techmore
techmore force-pushed the upstream/aura-j773g-disp0-regions-tested-tree-20261114 branch from 8f4f387 to d6f6a47 Compare November 15, 2026 01:00
@techmore

Copy link
Copy Markdown
Contributor Author

Restacked to d6f6a470f2c68ac3dc07b9b07addbcef61ec8e1c, still a draft. What changed against the previous head 8f4f3873:

# commit previous now stable patch-id
1 #113 06432693 b3b52c0c fd0dc528adbe
2 #113 045abce1 b3503625 0f864646fb07
3 #113 27516e52 c53ae6bc 206e32bcff32
4 #113 a793eaa8 24812c55 b71e84071fae
5 #199 35bc21b2 0ad3c86b e655d0899b52
6 #199 fix 3e79bcec 531da3a8 9039f8080128
7 #199 fix cbc7e532 ab6f3611 1393b0b4df27
8 display 8f4f3873 d6f6a470 7110eb2985fb

J773g (Stage 1 1.0.0b8): spec 22 recorded one exact-head PASS as a one-shot ESP Stage 2 with the stock Aurora U-Boot e1ef8b636fc9 appended. The body has the per-boot rows. This first PASS makes the package review-ready; four planned repeats remain in the boot queue and are not claimed here.

@RyanTheTide

Copy link
Copy Markdown
Contributor

The production boot stub pins at macOS 27.2 (26B123), so please retarget this to 27.2. The frontend walk is validated on 26.6.2 only; please validate it on the 27.2 stub.

@DjDeveloperr

Copy link
Copy Markdown
Contributor

A data point from a second J773g, where iBoot does not light HDMI. On that unit, your boot-HDMI Stage 2 series lights the port by itself.

The unit
Mac mini M4 with stub 26.6.2 and board-id 0x2a. A Samsung Odyssey G81SF (4K240) is connected over HDMI. On every boot iBoot hands over only the 640x1136 placeholder framebuffer. macOS lights the display later, through dispext0 (DP to HDMI). So the adoption path here (#199/#258 + linux#1192) has nothing to adopt on this machine.

Tree
aura 1.0.0b13 (5dcf62d0) plus the 15 display commits of techmore/aura backup/20261118/wip/aura-boot-hdmi-v7-fix-ans-takeover-20261117 (37f064c2..d0da0c19). I left out the untested WIP a90c2b9b (ANS takeover); this unit boots fine without it on Stage 1 1.0.0b13 and U-Boot 250385f8. Built with clang. The exact tested head is aurora-silicon/aura branch test/j773g-boot-hdmi-b13-20261119.

Result: 3/3 boots (two aura-try trials and one plain boot as the configured Stage 2), identical every time:

DPTXV2: active lane count 4
display: waited 8100 ms for display status
display: connected:1 timing_cnt:47 color_cnt:39
display: timing mode: valid=1 1920x1080 60.00 Hz
display: swapped! (swap_id=0)
display: Modeset took 8894 ms
display: Quiescing DCP (external, no reset)
fb init: 1920x1080 (30) [s=1920] @0x105e5300000
  • The sink's own list includes 3840x2160@60, 2560x1440@119.9 and 1920x1080@239.98, and the converter adds its standard modes.
  • Linux (installed 7.3.0-1-40) comes up on simpledrm at 1920x1080.
  • After the workaround in the last section, Plasma's first-run screen scans out on HDMI.

One commit on top: fdf65101
A plain boot runs Stage 2 with no watchdog, so this commit arms the primary watchdog for 90 s around the J773g display_configure() and disarms it afterwards. A trial keeps its own watchdog. On the plain boot the log shows the disarm right after Modeset took 8894 ms, and Linux stays up past the window. The host tests that compile display.c/wdt.c are updated. The only failures are the 7 in test_m3_defaults_optout.py, which fail the same way at the base.

Linux-side note for anyone else testing this without a GPU driver

  • 9125b314's G16 rejects this unit's loaded image (loaded GFX TEXT identity mismatch, which is what linux#1718 addresses).
  • KWin 6.8 then picks /dev/udmabuf (softpipe) as its primary render device. simpledrm cannot import those buffers, so KWin logs Applying output configuration failed: Preparing test buffer failed and Plasma reports no outputs.
  • Taking udmabuf off the seat (udev KERNEL=="udmabuf", TAG-="uaccess") makes KWin choose /dev/dri/card0 itself, and the desktop shows.

Most of the series has no Signed-off-by yet, so I haven't opened a PR with it. It's yours to send. fdf65101 is signed off if you want to carry it.

@DjDeveloperr

Copy link
Copy Markdown
Contributor

Tested #199 + #258 on the owner's Mac mini J773g (26.6.2 stub, HDMI to a 4K240 monitor whose sink offers 1080p), 2026-11-19, with Linux #1192, as aura-try trials.

The Stage 2 was techmore's boot-HDMI series (fdf6510, the one that trains HDMI on this unit) + #113 + this stack, then two fixes. The full stack is public as aurora-silicon/aura test/j773g-hdmi-kms-20261119, head e553f9d.

  • The handoff works. The DCP gets its UUID, version and memory regions. disp0 SID0, PIODMA SID16 and the retained framebuffer are published (J773g disp0 SID0: segment 4 + framebuffer [0x105e5300000, +0x854000) published).
  • The kernel then refused the DCP's own DART (SID23) twice. Both causes are aura's, not this PR's:
    1. root[8] ... child outside ADT: the boot modeset's RTKit buffers and IOVAs (DVA 0x10000000+) live under heap L2 tables that aura never freed on a locked DART. Fixed in dart: release aura's L2 tables from a locked DART at shutdown #311.
    2. DCP inherited SID23 leaf[0][1] targets Linux RAM: the boot modeset maps the framebuffer in the DCP's DART as well as disp0's. Linking the framebuffer reservation to dcp doesn't work, because the kernel then fails iommu_device_register (every dcp memory-region must be an ADT segment). Fixed instead by unmapping that alias from the DCP DART after the modeset (e553f9d, on top of the boot-HDMI series).
  • With both fixes, Linux adopts the DCP:
    • external DCP adopted, IOMFB startup complete: 347 callbacks; external;
    • card1-HDMI-A-1 connected with 26 modes (1920x1080 ... 3840x2160);
    • fbcon modeset 1920x1080@120 Hz, 297000 kHz.
  • Still open, on the kernel side (#1192):
    • KWin's atomic modeset on card1 returns EINVAL for every mode it tries, and Plasma falls back to "no outputs";
    • fbcon frames got frame not shown: -16;
    • no EDID (#2166 needs a newer base). I'm debugging the EINVAL next.

🤖 Generated with Claude Code

@RyanTheTide

Copy link
Copy Markdown
Contributor

Thanks for the detailed rows, and for keeping the walker out of Stage 1. Three things before this can leave draft. (1) kboot_is_j773g() (src/kboot_t8132.c:26-30) admits the path by board-id 0x2a, J773gAP and firmware 26.6.2, and it gates the DCP region publishing (kboot.c:7944-7948, 8332-8345) and the USB3 calibration (kboot_atc.c:879). Could these select on what the ADT and DT describe instead: disp0 external, the HDMI-A connector, the DCP segment ranges and the locked DART contents you already validate? Any M4 with an externally driven main DCP would then take it. (2) Please validate on 27.2 (26B123) and drop the 26.6.2 pins at kboot_t8132.c:29 and kboot.c:8332/8421. (3) The two aura-side fixes for the SID23 refusal from the 11-19 test row should be folded in. Glad to help with a restack once #113/#199 settle.

@techmore

Copy link
Copy Markdown
Contributor Author

Closing: folded into #199 as its second commit (an HDMI mode of dt_set_j713_display_maps(), selected by the tree's HDMI-A connector and the ADT's external disp0, no 26.6.2 pin, validated on 27.2). The three review points here are answered in #199's description.

@techmore techmore closed this Nov 19, 2026
@techmore

Copy link
Copy Markdown
Contributor Author

Your tested boot-HDMI series, reworked to property selection, is on https://github.com/techmore/aura/tree/staging/27.2/v10/aura-boot-hdmi (head ee7e1c50, on #199's b3e74135). It is not a PR yet: nothing has run it.

  • Your three commits are carried. Two are modified, noted in brackets above your sign-off, and need your ack.
  • One bug fixed versus what you booted: the temporary framebuffer IOVA was freed with the DART window bits set.
  • Our unit is on a 27.2 stub and skips the path; only a 26.6.2 unit can run it.
  • First run: an aura-try trial with someone present. A DCP that will not quiesce stops at "Display handoff failed" and waits for the power button.
  • Please capture the display: last boot record line and the bring-up lines.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants