Skip to content

drm/asahi: g18: J873 G18G on the macOS 27.2 (26B123) firmware - #1652

Merged
RyanTheTide merged 2 commits into
aurora-silicon:integration/aurorafrom
sithglan:thomas/g18g-26b123
Nov 21, 2026
Merged

RyanTheTide merged 2 commits into
aurora-silicon:integration/aurorafrom
sithglan:thomas/g18g-26b123

Conversation

@sithglan

@sithglan sithglan commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

The J873 (Mac mini M6) G18 backend builds only the 26A428 (macOS 27.0, 27.0.1) InitData graph. A stub on macOS 27.2 (26B123) makes iBoot load the G18G firmware RTKit 3514.41.1, which rejects that graph at its first check. This series adds the 26B123 graph next to the 26A428 one, selected by the loader's receipt.

What 26B123 changes in the InitData the host writes (26B123 against 26A428, by InitData field):

  • Root version word: 0x0c8b_4339_83a0_04c0 → 0x0c8b_6339_83a0_04c0. Both firmware roles compare it at root +0.
  • Allocation sizes: the perf/policy block grows from 0x7800 to 0x7860 and the status config from 0x6d0 to 0x6d8. The other 22 allocations keep their sizes.
  • Policy:
    • +0x2f0c..+0x2f17 moves by 0x10, and +0x2fb4..+0x6d9f by 0x18.
    • The GPU power controller's parameters gain a word at +0x2f28. No machine source carries it (neither the ADT's GPU node nor the firmware data the loader passes), and the firmware boots and renders the same with it zero, so the host leaves it zero (see below).
    • The rest of the growth falls past +0x6da0, which the host doesn't write.
  • Status config: +0x59c is new, +0x59c..+0x5b3 moves by 4, +0x5b8 is new and carries the same power-controller parameter, and +0x5b4 to the end moves by 8. Both new words stay zero.
  • Unchanged: HW data, the roots, the main configs, status B and region C keep their field offsets.
  • UAT handoff: the 27.2 GFX firmware writes 0x4b1d000000000003 to the UAT handoff firmware magic during its own boot. The no-peer check refused that as a PPL peer, which commit 1 fixes.

Commits

  1. drm/asahi: mmu: tolerate the 27.2 G18G firmware boot marker
  2. drm/asahi: g18: InitData for the macOS 27.2 (26B123) G18G firmware
    • G18GLayouts: one per build, with RootProfile::J873G18G26B123 added.
    • Encoders: the 26A428 ones are unchanged; for 26B123 the policy and status config they produce are moved by relocation bands.
    • Receipts: G18G-RTKit-3514.0.15.release keeps the 26A428 behaviour; G18G-RTKit-3514.41.1.release selects 26B123.

Testing

  • Hardware: a Mac mini M6 (J873g) booted from a macOS 27.2 stub, with this change on the tree that drives its display.
    • The loader verified both loaded TEXT images against the 26B123 images and published the new receipt.

    • Both firmware roles accepted the graph, and stage 10 registered the render node.

    • sway composites on the GPU: EGL reports "Apple M6 (G18G B1)", OpenGL ES 3.2.

    • es2gears runs at ~147 FPS through sway's frame callbacks and ~300 FPS with vblank_mode=0.

    • No GPU faults or recoveries.

    • Power-controller words zero vs set, on the same M6 the same evening, each from a fresh boot:

      words zero words set
      asyncbench 1M triangles, 30 frames 20.2 / 20.1 fps 20.2 / 20.1 fps
      asyncbench 20k triangles, 600 frames 493.2 / 492.9 fps 495.2 / 495.3 fps
      compositor-like clear every 16.7 ms (gpulat), flush→signal p50 / p99 / max 0.39 / 0.43 / 0.96 ms and 0.39 / 0.41 / 1.77 ms 0.36 / 0.42 / 0.64 ms and 0.39 / 0.41 / 0.71 ms
      GPU job failures, kernel error lines 0, 0 0, 0

      I found nothing the word changes in these loads, so it stays zero rather than being written from a constant.

  • Build: integration/aurora builds with DRM_ASAHI_G18=y and DRM_ASAHI_M5=y (LLVM 22), with no warnings in the touched code.
  • checkpatch: one 101-column line, the size table, matching the 26A428 table next to it.
  • 26A428: its graph is unchanged by construction (identity layouts, no relayout), but it was not re-run on hardware with this exact tree. The M6 has no 27.0.1 Linux stub; its only 27.0.1 system is the main macOS, which I did not convert. So the 26A428 row from a 27.0.1 stub is not run.

Loader: aura main's T8152 hand-off still publishes only the 26A428 receipt. aurora-silicon/aura#189 pins the 26B123 TEXT identities and publishes the new receipt (tested on the M6).

cc @DjDeveloperr @RyanTheTide @Acelogic @LiamRay10

Assisted-by: LLM (Claude:Opus 5.5)

sithglan added a commit to sithglan/aura that referenced this pull request Nov 12, 2026
The J873 GPU hand-off pins one firmware build, 26A428 (macOS 27.0,
27.0.1), and refuses anything else. A stub on macOS 27.2 makes iBoot
load the 26B123 G18G images (RTKit 3514.41.1), so the hand-off refused
the GPU and Linux got no receipt.

Keep one entry per build: the receipt it publishes and both roles'
identities. The iop nub uuids in the ADT, which iBoot fills in from the
images it loaded, select the entry; the TEXT digest, TLV and region
checks then run against that entry as before. The 26B123 images use the
same 40 patchbay TLVs; their patchbay sits at 0x4a670 (GFX) and 0x4e590
(GFX1).

tools/g18g_firmware_identity.py prints a build's entry from the decoded
FUD payloads. It reproduces the pinned 26A428 entry from the 26A434
images byte for byte. boot_j873.py accepts either receipt in the
prepared DT.

The 26B123 receipt needs a kernel that builds the 26B123 InitData graph
(aurora-silicon/linux#1652).

Tested on a Mac mini M6 (J873g) booted from a macOS 27.2 stub: the live
ADT names 4930E685-1B70-3199-8FE5-75369B0DDF24 and
64573826-0202-3955-8CDC-8A2949B9D495, and kboot_prepare_dt on the
integration/aurora t8152-j873g.dtb reports "G18G eight regions and both
firmware TEXT identities verified (G18G-RTKit-3514.41.1.release)" and
publishes that receipt with both GFX mailboxes enabled.

Signed-off-by: Thomas Glanzmann <[email protected]>
@RyanTheTide

Copy link
Copy Markdown
Contributor

Reviewed the per-build layouts, the band relayout and the receipt selection. 26A428 keeps identity layouts, and the other profiles are untouched.

@sithglan two small things before this goes in: the new comments cite addresses inside the firmware image; please describe the layout by its fields only. And the "G18G: firmware receipt" line prints "absent or differentNone" when nothing matches.

The G18G GFX firmware of macOS 27.2 (RTKit 3514.41.1) writes
0x4b1d000000000003 to the handoff's firmware magic while it maps the
handoff region during its own boot, whether or not a peer exists. The
26A428 firmware (RTKit 3514.0.15) never writes the magic. The T8152
no-peer check took the marker for a PPL peer and refused the handoff:

  T8152 handoff: unexpected firmware peer; refusing no-peer mode

Accept that value as well as zero. A PPL reply (PPL_MAGIC) or a held
firmware lock still refuses no-peer mode.

Signed-off-by: Thomas Glanzmann <[email protected]>
@sithglan

Copy link
Copy Markdown
Contributor Author

@RyanTheTide both done, force-pushed as d5f18b0 (was c5f0f9f). The diff between them is comments, commit messages and the receipt print.

  • The new comments now describe the 26B123 layout by fields only: no firmware-image or kernelcache addresses (b000 0x216ac, the __const table offset, the copier and jump-table ranges, the 5000 store, the boot marker's PC in mmu.rs) and no kext function names. The KEXT_PROVEN tags stay, as elsewhere in g18. Both commit messages are reworded the same way.
  • The receipt line now prints G18G: firmware receipt admitted <build> or G18G: firmware receipt absent or different, without the None.

Built with CONFIG_DRM_ASAHI_G18=y.

@RyanTheTide

Copy link
Copy Markdown
Contributor

Blockers: 2.

  1. drivers/gpu/drm/asahi/g18/fw/initdata.rs:4325-4327, :4341-4343 and :4348 still describe the new fields by their offsets inside the macOS driver's accelerator object, and the PR body describes the method as an instruction-by-instruction comparison of the macOS kext and the firmware images. Please describe the 26B123 layout by InitData field and observed behaviour only, in the comments, the commit messages and the PR body.
  2. initdata.rs:4344 and :4356-4357: the new power-controller word is written as a constant taken from macOS's generic power and performance setup. A power-controller parameter for this GPU should come from the machine: the GPU node the loader fills from the ADT, or the firmware data the loader passes. If neither carries it, say in the commit what the field controls and why the firmware cannot start without it.

The rest checks out. relayout_by_bands() (initdata.rs:4407) refuses non-zero bytes that no band carries. It moves the bands highest first, so no source is overwritten before it moves, and it zeroes what each band leaves behind. The three bands fit the 0x7860 policy, and the compile-time asserts pin the shared/private cluster equalities. Selecting by the loader's receipt, which is written only after both TEXT images are verified, is the narrowest identity available for a per-build InitData layout. The 26A428 path stays the identity. The mmu.rs no-peer change still refuses PPL_MAGIC and a held firmware lock. Both commits carry a human Signed-off-by and no agent trailers. The PR body ends in "Generated with Claude Code"; its last line should be Assisted-by: LLM (<Vendor>:<Model>).

HW row: J873g on this tree twice, once from a 27.0.1 stub (26A428 receipt) and once from a 27.2 stub (26B123 receipt): render node up, a GLES CTS or es2gears run with no GPU faults or recoveries, and 0 AVC, 0 failed units, 0 new kernel errors.

Assisted-by: LLM (Claude:Opus 5.5)

@sithglan

Copy link
Copy Markdown
Contributor Author

@RyanTheTide both blockers are addressed in 2563da1a6612. The mmu commit e36c270fbe4d is unchanged.

  1. Field descriptions: the 26B123 comments, the commit message and the PR description now describe the layout by InitData field and observed behaviour only.
    • No accelerator-object offsets.
    • No macOS driver method or setup names.
    • No description of how the layout was compared.
  2. The power-controller word:
    • No machine source: neither the ADT's GPU node (perf states, gpu-power-sample-period, gpu-pwr-sample-period-aic-clks, the perf gains and so on) nor the firmware data the loader passes carries a matching value.

    • Test: I booted the J873g once with both new words (policy +0x2f28, status config +0x5b8) zero and once with them set. Each was a fresh boot on the 27.2 stub, in the same evening. With them zero the firmware boots, both roles accept the graph, and:

      zero set
      1M triangles 20.2 / 20.1 fps 20.2 / 20.1 fps
      20k triangles 493 fps 495 fps
      compositor-like clear every 16.7 ms, flush→signal p50 0.39 ms 0.36–0.39 ms
      GPU job failures, kernel error lines 0 0
    • Result: I found nothing it changes, and the firmware doesn't need it to start. So the host now leaves both words zero, as it does +0x59c, and as the 26A428 layout runs without them. There is no constant any more. If someone finds what the word controls, it should come from the machine.

HW row:

  • 27.2 (26B123): the J873g on the 27.2 stub, as above. The render node is up, the GL loads above run, and there are no GPU faults or recoveries. AVC 0 and failed units 0 on those boots.
  • 27.0.1 (26A428): not run. The M6 has no 27.0.1 Linux stub; its only 27.0.1 system is its main macOS, which I did not convert. The 26A428 graph is unchanged by construction.

The PR description now ends with the Assisted-by line instead of the "Generated with Claude Code" footer.

Assisted-by: LLM (Claude:Opus 5.5)

@RyanTheTide

Copy link
Copy Markdown
Contributor

Re-review of 2563da1: No blockers.

From our last comment:

  1. Provenance in the new text: resolved. The 26B123 comments (drivers/gpu/drm/asahi/g18/fw/initdata.rs:4273-4357) describe the layout by InitData field and observed behaviour only, with no accelerator-object offsets and no method description. The same goes for the reworded commit message and the PR body.
  2. The power-controller word: resolved. Nothing writes it now. In the 26A428 encoding, policy +0x2f28 lies in the unbanded [0x2f18, 0x2fb4) range, which relayout_by_bands() (initdata.rs:4402) requires to be zero. The bands at :4338-4342 move nothing onto it: the +0x10 band ends at 0x2f28 and the +0x18 band starts at 0x2fcc. In the status config, the +4 band (:4348-4352) fills 0x5a0..0x5b8 and the +8 band starts at 0x5bc, so +0x59c and +0x5b8 stay zero. Your zero-vs-set table shows no change in throughput, latency or job failures.
  3. PR body footer: resolved. The body now ends with the Assisted-by line.

The 26A428 path stays the same. layouts.shared.brn_table, layouts.policy_size and layouts.shared.main_config resolve to the same constants as the G18G_26A428_* ones they replace (initdata.rs:4155-4187), and that profile has no bands. Unknown receipts still fail closed: firmware_build is None, and both the probe and prepare_firmware_session return ENODEV.

  1. Nit: the commit message of 2563da1 says "for 26B123 the policy and status config they produce are moved by relocation bands and the new words are written". The code leaves the new words zero, and the same message says so a paragraph earlier. Please drop "and the new words are written".

HW row: J873g on this tree from a 27.0.1 (26A428) stub would still be worth running when one exists: render node up, no GPU faults or recoveries, 0 failed units and 0 new kernel errors. Until then the 26A428 path rests on the identity argument above.

Assisted-by: LLM (Claude:Opus 5.5)

The J873 backend builds only the 26A428 (macOS 27.0, 27.0.1) InitData
graph and admits only that firmware's loader receipt. macOS 27.2
(26B123) ships the G18G firmware RTKit 3514.41.1, which rejects that
graph at its first check.

Against 26A434, whose GPU firmware is the 26A428 one, 26B123 differs in
three places:

- the root version word gains bit 45 (0x0c8b_4339_83a0_04c0 ->
  0x0c8b_6339_83a0_04c0), which both roles compare with root +0;
- the perf/policy block grows from 0x7800 to 0x7860 and the status
  config from 0x6d0 to 0x6d8; the other 22 allocations keep their sizes.
  Everything after the policy in shared allocation #1 moves by 0x80, and
  the page total stays 0x28000. The private cluster keeps its layout, as
  0x6d8 packs to the same 0x700;
- inside those two objects fields move: policy +0x2f0c..+0x2f17 by 0x10
  and +0x2fb4..+0x6d9f by 0x18, with a new word at +0x2f28; status config
  +0x59c..+0x5b3 by 4 and +0x5b4 to the end by 8, with new words at
  +0x59c and +0x5b8. +0x2f28 and +0x5b8 carry a new parameter of the GPU
  power controller. Neither the ADT's GPU node nor the firmware data the
  loader passes carries it. With both words zero the firmware boots, and
  renders with the same throughput and latency, so they stay zero, as
  +0x59c does; the 26A428 layout runs without them.

hw_data, the roots, the main configs, status B and region C keep their
field offsets.

Describe a firmware build's layouts as G18GLayouts. The 26A428 encoders
stay as they are; for 26B123 the policy and status config they produce
are moved by relocation bands. The loader
receipt names the build: G18G-RTKit-3514.0.15.release selects 26A428 as
before, G18G-RTKit-3514.41.1.release selects 26B123. The 26A428 graph is
unchanged.

Tested on a J873 (Mac mini M6) booted from a macOS 27.2 stub, with this
change on the tree that drives its display: both firmware roles accept
the graph, stage 10 registers the render node, sway composites on the
GPU and es2gears runs at about 300 FPS without vsync. With the
power-controller words zero, a 1M-triangle scene runs at 20.2 fps, a
20k one at 493 fps and a compositor-like clear every 16.7 ms signals
after 0.39 ms (p50), the same as with them set, and no GPU job fails.

Signed-off-by: Thomas Glanzmann <[email protected]>
@sithglan

Copy link
Copy Markdown
Contributor Author

@RyanTheTide thanks. Head b4f7ddefa41b: the commit message no longer says "and the new words are written". The tree is unchanged.

A 27.0.1 (26A428) stub row on this tree will follow once there is one on the M6.

Assisted-by: LLM (Claude:Opus 5.5)

@RyanTheTide
RyanTheTide merged commit 4af8147 into aurora-silicon:integration/aurora Nov 21, 2026
1 check passed
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