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, …
count byte + body of the 0x350-byte tables at 0x5cb10 and 0x5ce60 (headers 01 03 2a / 03 03 2a) tunables (register, mask, value lists); the shipped image leaves these 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 tunables. 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 tunable tables could differ between chips.

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

🤖 Generated with Claude Code

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;
- the entry count and body of the two 0x350-byte tunable tables 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 tunables. 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 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
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.

1 participant