Skip to content

drm/asahi: g16: Admit the 25G83 B0 image with iBoot's ranges zeroed - #2232

Open
DjDeveloperr wants to merge 1 commit into
integration/aurorafrom
djdev/j773g-g16-boot-parameters
Open

DjDeveloperr wants to merge 1 commit into
integration/aurorafrom
djdev/j773g-g16-boot-parameters

Conversation

@DjDeveloperr

@DjDeveloperr DjDeveloperr commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Summary

G16 refuses the 25G83 GPU firmware on a 24 GB Mac mini (J773g) with loaded GFX TEXT identity mismatch: EINVAL.

I compared the TEXT loaded on two boots with Apple's file: build b000 (G16G B0) of armfw_g16g.im4p, taken from the macOS 26.6.2 stub's Preboot (Restore/Firmware/agx/). iBoot writes into these ranges:

Range What
0x224 (4) header word, different on every boot
0x23c (8) DATA physical address
values of the 39 TLV records at 0x5c8df..0x5cb10 (the header at 0x22c gives offset and size) carveout addresses below the top of DRAM (follow the memory size), SLID slide (per boot), GKTS/ECAP entropy, SoC id/revision, …
0x5cb13 (1), 0x5cb14 (0x34c), 0x5ce63 (1), 0x5ce64 (0x34c) two iBoot-filled tables (count byte and body), which the shipped image leaves empty

Every other byte matches Apple's file. This adds a T8132 entry that zeroes exactly those ranges. Its digest b9ea7e6b2aca… equals the shipped b000 TEXT with the same ranges zeroed, so the entry pins Apple's 25G83 B0 code rather than one machine's memory map, slide or per-machine tables. Record tags/lengths, table headers and the rest of TEXT are still compared exactly. Existing entries are unchanged.

#1718's J773g entry zeroes only 0x224 and the slide, so it fits one machine: on this mini that normalization gives 9b100498…, not 9154c7f8….

Test (Mac mini M4 J773g, 24 GB, macOS 26.6.2 stub, aura 1.0.0b13 + boot-HDMI Stage 2)

Kernel: the linux-aurora 7.3.0-40 pin (9125b31) + #1898 + #1191 (with #1718) + this commit + the T8132 cluster fix for apple-pmp-thermal. Distribution config, release 7.3.0-ARCH-m4gpu1, Arch Linux ARM, Mesa 26.3.0-devel d4ad4a4dce, KWin 6.8.2.

  • Host check, two boots: 19 bytes differ between boots (0x224, slide, entropy). With the ranges zeroed, both boots and Apple's b000 TEXT hash to b9ea7e6b….
  • Driver log: GPU firmware build: Apple GFX 25G83 (build b000, iBoot-filled ranges zeroed), M4: firmware identity accepted, firmware at READY, [drm] Initialized aurora 1.0.0 … on minor 1.
  • APIs: EGL (surfaceless/GBM), Vulkan and KWin report Apple M4 (G16G B0) (GL 4.6, ES 3.2).
  • Compositing: KWin reports "Compositing Type: OpenGL ES". Its buffers are imported into simpledrm, and reading the HDMI scanout memory back shows the Plasma desktop.
  • glmark2-es2-drm --off-screen (build/texture/shading/refract, 10 s each, 1920x1080): rc 0, score 453. No GPU errors, faults or timeouts in the kernel log.
  • An earlier revision of this PR (39 record values only, digest d0d2a026…) also admitted the image on this machine. It was replaced because the per-machine tables could differ between chips.

The GPU still needs #1191's J773g PMP/DVFS commits. This PR replaces only #1718's firmware-identity part.

Assisted-by: LLM (Gemini:4 Neon)

@DjDeveloperr
DjDeveloperr force-pushed the djdev/j773g-g16-boot-parameters branch from 1e9eb0c to 6dfa2ac Compare November 19, 2026 06:56
@DjDeveloperr DjDeveloperr changed the title drm/asahi: g16: Admit J773g 25G83 images with any boot parameters drm/asahi: g16: Admit the 25G83 B0 image with iBoot's ranges zeroed Nov 19, 2026
@RyanTheTide

Copy link
Copy Markdown
Contributor

No blockers.

I checked the matching path. Measured::find() tries the entries in order. For the existing entries, digest_at() (fwid.rs:121-139) zeroes the entropy values in place and restores them. For this entry it hashes a zeroed copy (fwid.rs:110-119), so the earlier candidates leave the TEXT unchanged. Record tags and lengths, and the table headers, are still compared, and the new test pins the layout of the ranges and that the digest selects this entry. identity() now reports refused images normalized with this entry's ranges, which is what you want for the next image. The commit carries a human Signed-off-by and no agent trailers.

  1. drivers/gpu/drm/asahi/g16/hw.rs:101-106 and the PR body describe what iBoot writes into the image's tables in more detail than the driver needs (the table header bytes, and that the tables are register/mask/value tunable lists). The driver only needs the offsets and that iBoot fills them. Trim the comment to "two iBoot-filled tables; count byte and body", and drop the header bytes and the tunable description from the PR text.
  2. This entry pins the shipped b000 code instead of one machine's loaded image, so the per-machine entries above it are the next thing to retire. Those are "normalized loaded image" and the 8-core and 10-core J713 entries. If the J713 images are a different build, the same normalization of that build gives one entry for both J713s instead of two per-board digests. Worth a follow-up once a J713 row exists.
  3. Nit: the PR body ends with the "Generated with Claude Code" footer. Make Assisted-by: LLM (...) its last line instead.

HW row: on 8-core and 10-core J713 with 25G83, this head. The driver log names which entry matched, or prints the refused identity with "boot-filled ranges zeroed". On J773g, 0 GPU faults and timeouts in a glmark2 run, 0 AVC, 0 failed units.

Assisted-by: LLM (Claude:Opus 5.5)

iBoot writes into the 25G83 GPU TEXT it loads, and part of what it
writes depends on the machine. Compared with build b000 (G16G B0) of
armfw_g16g.im4p in 25G83, a Mac mini (J773g, 24 GB) loads a TEXT that
differs in:

- the header word at 0x224, which changes from boot to boot, and the
  DATA address at 0x23c;
- the value of each of the 39 boot parameter records the header at 0x22c
  places from 0x5c8df to 0x5cb10 (a tag, a 32-bit length and the value):
  carveout addresses just below the top of DRAM, which follow the memory
  size, a per-boot slide and the entropy;
- two iBoot-filled tables (count byte and body) at 0x5cb10 and 0x5ce60,
  which the shipped image leaves empty.

The T8132 entries hash a loaded image with only the entropy or one
record zeroed, so each fits the machines it was measured on, and G16
refuses this Mac mini's image with EINVAL.

Add an entry that zeroes all of those ranges. Its digest is that of the
shipped build b000 TEXT with the same ranges zeroed, and two boots of the
Mac mini give the same digest, so it pins the 25G83 B0 code as Apple
ships it rather than one machine's memory map, slide or per-machine
tables. Every other byte, including the record tags and lengths and the
table headers, is compared as loaded. The existing entries are
unchanged. A test checks the ranges' layout and that the digest selects
the entry.

Signed-off-by: Diljit Singh <hey@djdev.me>
@DjDeveloperr
DjDeveloperr force-pushed the djdev/j773g-g16-boot-parameters branch from 6dfa2ac to 8344870 Compare November 21, 2026 23:12
@DjDeveloperr

Copy link
Copy Markdown
Contributor Author

Addressed points 1 and 3 in 8344870b2:

  • Trimmed the BOOT_FILLED_25G83_B000 comment in drivers/gpu/drm/asahi/g16/hw.rs, commit message, and PR body to describe the two iBoot-filled tables (count byte and body) without header bytes or tunable details.
  • Updated the PR body footer to Assisted-by: LLM (Gemini:4 Neon).

Verified scripts/checkpatch.pl --strict -g HEAD (0 errors, 0 warnings).

Assisted-by: LLM (Gemini:4 Neon)

@RyanTheTide

Copy link
Copy Markdown
Contributor

Thanks, points 1 and 3 are done: the comment at g16/hw.rs:99-105, the commit message and the PR body no longer give the table headers or what the tables hold. The code is otherwise unchanged from the head I reviewed, so the earlier check still holds.

  • One leftover: the test comment at drivers/gpu/drm/asahi/fwid.rs:566 still reads "each tunable table's count byte and body". Make it "each iBoot-filled table's count byte and body" to match hw.rs.

Still open: a J713 row (8-core and 10-core GPU, 25G83) on this head. The driver log should name the entry that matched, or print the refused identity with "boot-filled ranges zeroed", which is the input for collapsing the per-board J713 entries later.

Assisted-by: LLM (Claude:Opus 5.5)

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.

2 participants