Skip to content

drm/asahi: m5: unify 26B123 status-config encoder and admit G17D 27.2 firmware - #2866

Draft
funkzy wants to merge 2 commits into
aurora-silicon:mainfrom
funkzy:pr/g17d-272
Draft

funkzy wants to merge 2 commits into
aurora-silicon:mainfrom
funkzy:pr/g17d-272

Conversation

@funkzy

@funkzy funkzy commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

What: Converge the 27.2 (26B123) M5 status-config encoder into a single build-wide policy-derived encoder across all M5 core types (G17S, G17C, G17D — removing the core-type key and M5_26B123_STATUS_CONFIG_INSERTED), and admit the 27.2 (26B123) G17D GPU firmware build in CONFIG_ULTRA so the Mac Studio (M5 Ultra, J775D) brings up its GPU under the 27.2 boot stub.

Tested: J775D (Mac Studio, M5 Ultra) at d7cf90bd9a9e on bare main (8c6992db4b9f) under published Aura aura-main-7bf44a63 on both 27.2 and 27.0 stubs: 27.2 admits 26B123 for T6050, primary and secondary InitData acknowledged, /dev/dri/renderD128 active, gpubench-vk render.light d8 14,863 submits ok (0 GPU errors/faults/recoveries); 27.0 admits 26A428 identically (gpubench-vk render.light d8 14,939 submits ok, 0 GPU errors); KUnit 92 suites, 480/484 pass, 0 fail, 4 skip (including asahi_g17_m5_build_words and m5_ultra_identifies_each_build).

Risk: Two-way door · affects all M5 GPUs on 27.2 (26B123/26B8125: G17S, G17C, G17D); every M5 board on 27.0 (26A428) and common26 (J813) serializes byte-for-byte identically.

Not yet: G17S (J714/J716s/K116s) and G17C (J716c/K114c) 27.2 convergence rows at d7cf90bd9a9e confirming firmware accepts the unified policy-derived status config (86 words change on G17S/G17C on 27.2), including binned-part USC slot count (clusters * cores_per_cluster vs enabled count) and the literal 900 status-config word; stays draft until G17S/G17C 27.2 rows pass.

Details

Why this shape

  • Where it lived. Previously, the 26B123 status config band-relocated the 25G76 word table and appended M5_26B123_STATUS_CONFIG_INSERTED, while the earlier draft of this PR added a second per-core-type policy-derived table keyed on G17D. Keeping two encoders for the same 26B123 firmware build left a second hand-maintained copy of policy words and an unnecessary core-type gate.
  • The narrower alternative. Keying the policy-derived encoder on M5PolicyMap::core_words (G17D only) would keep M5_26B123_STATUS_CONFIG_INSERTED alive for G17S/G17C and split one firmware build across two status-config paths.
  • The one source used. Commit 1 replaces M5_26B123_STATUS_CONFIG_INSERTED with one build-wide M5_26B123_BUILD_WORDS / M5_26B123_STATUS_CONFIG_WORDS table on M5_26B123_POLICY (policy_derived: true, skipped for common26 and 26A428), building all 80 status-config words from the laid-out policy (75 words), four compile-time lookups from M5_25G76_STATUS_CONFIG_WORDS, and one literal 900 validated compatible with 26B123 on J775D. The USC count written to HwData (via shared M5_HW_USC_COUNT) and the policy USC field uses the GPU's core slot count (num_clusters * num_cores), and boards without controller defaults fail explicitly (EINVAL). Commit 2 admits the 27.2 G17D Build in CONFIG_ULTRA on V26B123_M5 layouts after the encoder is in place so bisecting never boots 26B123 G17D without it.
  • Scope across boards. 26A428 (J714, J716C, J775D) and common26 (J813) are byte-for-byte unchanged (build_words: None, policy_derived: false). G17S and G17C on 27.2 (26B123/26B8125) switch to the same policy-derived encoder (86 words change on host diff) and need hardware rows before this comes out of draft.

Change

Two commits on main (8c6992db4b9f):

  1. 44ecaa554b1e — drm/asahi: g17: m5: build 26B123 status config from policy across M5: unify 26B123 status-config encoding into M5BuildWords / encode_m5_build_words() for all non-common26 M5 boards, remove M5_26B123_STATUS_CONFIG_INSERTED, guard missing controller defaults, and add KUnit suite asahi_g17_m5_build_words.
  2. d7cf90bd9a9e — drm/asahi: t6050: admit M5 Ultra 26B123 (27.2) G17D firmware: add the 26B123 Build to CONFIG_ULTRA on V26B123_M5 layouts, fold CONFIG_ULTRA into m5_builds_name_their_layouts(), and verify mutual digest and record-offset discrimination in m5_ultra_identifies_each_build.
Evidence

Testing

Own-base A/B row on J775D (Mac Studio, M5 Ultra): kit pr2866-4 (window pr2866r4@20261126-1020, pr-row superseded cleanly after Commit 1 message-only wording polish) is bare main 8c6992db4b9f plus these two commits (44ecaa554b1e, d7cf90bd9a9e, no other PRs carried), compared against baseline kit pr2866-4b (window pr2866r4@20261126-1020), bare main 8c6992db4b9f alone. All three arms ran one-shot with a read-only root on the default J775D command line under published Aura aura-main-7bf44a63 (ALARM has no SELinux):

  • pr2866-272 (kit pr2866-4, 27.2 stub): BOOT-OK (58 s), GPU firmware build: 26B123 for T6050, primary and secondary InitData acknowledged, /dev/dri/renderD128 active, card0-DP-1 and card0-HDMI-A-1 connected, gpubench-vk render.light d8 14,863 submits status=ok (33.66 us/submit), 0 GPU errors/faults/recoveries, 2 baseline read-only failed units (0 new).
  • pr2866-270 (kit pr2866-4, 27.0 stub): BOOT-OK (60 s), 26A428 firmware admitted identically, /dev/dri/renderD128 active, gpubench-vk render.light d8 14,939 submits status=ok (33.43 us/submit), 0 GPU errors/faults/recoveries, 2 baseline read-only failed units (0 new).
  • pr2866-base (kit pr2866-4b, 27.2 stub): BOOT-OK (61 s), confirmed baseline main refuses the 27.2 G17D GPU firmware (Unsupported GPU firmware image, version 27.2).
  • KUnit (kunit-vz): 92 suites; 480/484 pass, 0 fail, 4 skip (including asahi_g17_m5_build_words and asahi_fwid/m5_ultra_identifies_each_build).

@RyanTheTide

Copy link
Copy Markdown
Contributor

Review at 25ab384 (non-author, draft). No blocker found in the two commits of this PR (fe5e85c, 25ab384); it stays blocked on #1173 and #1650 underneath it, and the core-type key of the new status config is the one thing I would want settled before it leaves draft.

What I checked:

Before this is ready:

  • One 26B123 object, two encoders, picked by core type. For the same firmware layout, the G17D gets the policy-derived status config and the G17S/G17C keep the band-moved one, selected by board.core_revision.0 == M5_CORE_TYPE_G17D in M5_26B123_POLICY.core_words. Your own host comparison (86 differing words, 85 of them shared) points at this being the layout of the build and not a property of the core type. If that is right, the key should be the firmware build alone, and the band map plus inserted words for the status config go away. I agree that only a G17S or G17C 27.2 row can decide it, and that it should not be guessed; but I would rather see that row before this lands than have the core-type split merged and converge later, since after the merge nothing forces the convergence. If the row shows the firmware really takes different layouts per core type, a sentence in the commit message saying so is enough.
  • The same question for usc_slots: slots (80) instead of enabled cores (64) in HwData +0x10a4 and the policy, for the G17D on 26B123 only, while the G17D on 26A428 and every other M5 keep the enabled count. On an unbinned G17S/G17C the two numbers are equal, so those machines cannot tell the rules apart; a part with masked cores can. Is the 26A428 value for the G17D known to be the enabled count, or just unexamined?

Small points, not blocking:

  • 18 of the 80 table entries read zero from the J775D policy as built (status config +0x00c, +0x0d0, +0x0e0, +0x0e4, +0x0f8, +0x108, +0x10c, +0x120, +0x14c, +0x164, +0x168, +0x1ec, +0x208, +0x218, +0x234, +0x658, +0x6d8, +0x6ec). A boot cannot tell a correct source that holds 0 from a wrong one, so the J775D row does not cover those source offsets. They are harmless today; they start to matter when a shared encoder begins writing one of those policy words, or when the table is applied to another core type. A note in the table on which entries are known zero on the validating machine would help whoever generalizes it.
  • encode_m5_core_words takes the build's layout and map as parameters, but writes the policy USC count at a literal 0x490c. That offset is the same in 26A428 and 26B123 today; it would sit better in M5CoreWords beside the other policy words (or the function should say it is 26B123-only).
  • The doc comment on usc_slots says the shared encoder writes the enabled cores "there" for both HwData +0x10a4 and policy +0x490c. In the build order only HwData is written by set_m5_enabled_cores_for_layout; the policy word is 0 before this PR for every M5 (the host run shows 0 -> 80).
  • StatusConfigWord::Value(900): the one literal of the table, beside 1600 from drm/asahi: M5: InitData for the macOS 27.2 and 27.3 firmware (G17S bring-up on J716s) #1173's controller words. If either is a limit the power controller enforces, and the machine's ADT GPU node carries it, it should be read from there like the sample periods you list as a follow-up. If the ADT does not have it, say so in the comment.
  • Since the table is all-or-nothing (fill(0) first), the 26B123 map's inserted words are dropped for the G17D. That reads as intended; one line in the commit message would make it explicit.
  • m5_ultra_identifies_each_build indexes builds[0] as 27.2 and builds[1] as 27.0. Matching on os_version instead would keep the test valid when a third build is added at the front.
  • I did not compile the kernel at this head; the checks above are host-side on the M5 InitData file, plus reading build_m5.

Still to run, from the description: the G17S and G17C rows on this head (J716s, K116s, J716c, K114c: 27.2 boots as on #1650/#2185, 26A428 still identified on 27.0), and the G17S 27.2 status-config row that decides the first point above.

Assisted-by: LLM (Claude:Opus 5.5)

@funkzy funkzy changed the title drm/asahi: t6050: run the M5 Ultra's (J775D) GPU on the 27.2 firmware, with the G17D's own status config (on #1650) drm/asahi: t6050: run the M5 Ultra's (J775D) GPU on the 27.2 firmware, with the G17D's own status config Nov 24, 2026
@funkzy

funkzy commented Nov 24, 2026

Copy link
Copy Markdown
Contributor Author

Rebased onto main (bf03d7419ea8, now that #1173, #1650, #1973, and #2185 are all merged) at f910dcbd6dd9 (c04bb28c117e, f910dcbd6dd9) and addressed all six non-blocking review points:

  • Folded CONFIG_ULTRA into m5_builds_name_their_layouts() matching by os_version, and updated m5_ultra_identifies_each_build to verify both mutual record-offset and mutual digest rejection.
  • Moved the policy USC offset into M5CoreWords::policy_usc_slots_offset (Some(...)), extracted M5_HW_USC_COUNT so set_m5_enabled_cores and encode_m5_core_words share one constant, added compile-time bounds checks, and corrected the doc comment to reference set_m5_enabled_cores (and the policy field starting at 0).
  • Documented the 18 entries that read zero on the J775D policy, noted that 900 is absent from the J775D ADT GPU node, and explicitly noted in commit 2 that M5_26B123_STATUS_CONFIG's inserted words are replaced for G17D.

Re-verified on J775D (own-base A/B row: kit g17d272-r3 vs baseline kit g17d272-r3b, window qspi2866r3@20261124-1455, 27.2 stub, published Aura c0aaf3162ede): GPU firmware build: 26B123 for T6050, primary/secondary InitData acknowledged, /dev/dri/renderD128 + Hyprland GPU mode active, render CTS subset 571 Pass / 57 NotSupported / 0 Fail, 0 GPU errors/faults/recoveries, 0 new failed units; KUnit 85 suites, 439/443 pass, 0 fail, 4 skip.

Keeping this PR as a draft pending the two open questions on commit 2:

  1. Single build-wide 26B123 status-config encoder vs core-type key: we agree a G17S/G17C 27.2 row is needed to confirm whether G17S/G17C firmware accepts the policy-derived status config before unifying the 26B123 encoder. If preferred, we can also split commit 1 (c04bb28c117e, 27.2 G17D admission — matching drm/asahi: t6050: identify the M5 Max's 27.2 (26B123) G17C firmware (on #1650) #2185 for G17C) to land first while commit 2 waits for a G17S/G17C row.
  2. G17D 26A428 USC count: on 26A428, the J775D currently boots and passes all tests with the enabled count (64) from set_m5_enabled_cores; we have not separately verified whether 26A428 expects 80 (slots) vs 64 (enabled), so 26A428 is left unchanged here.

@RyanTheTide

Copy link
Copy Markdown
Contributor

@funkzy checking open drafts today. To come out of draft, this still needs:

  • A test run at the current head on a Mac with the hardware it touches, then mark it ready for review.

If it's no longer needed, say so here and we'll close it. Otherwise it stays open as a draft until these are done.

On the 27.2 (26B123) firmware, build the status config word by word from
the laid-out policy across all M5 core types (G17S, G17C, G17D) instead
of relocating the 26A428 word table and appending
M5_26B123_STATUS_CONFIG_INSERTED.

M5_26B123_STATUS_CONFIG_WORDS populates the two GPU power-controller
records, the two byte-packed records, the controller block, and the
boost block directly from the laid-out policy (75 words), four words
looked up at compile time from M5_25G76_STATUS_CONFIG_WORDS, and one
value (900, absent from the J775D ADT GPU node) validated compatible
with 26B123 on the J775D. M5StatusConfigMap::policy_derived skips the
25G76 band-relocation pass for 26B123 while keeping
M5_26B123_STATUS_CONFIG_BANDS for relocating link and submission-history
offsets, and removes M5_26B123_STATUS_CONFIG_INSERTED.

M5_26B123_BUILD_WORDS also writes the GPU's core slots (clusters times
cores per cluster from ID registers) to the HwData USC count field (via
shared constant M5_HW_USC_COUNT, replacing the enabled count from
set_m5_enabled_cores) and to the policy USC field, and copies the
temperature-sensor channel masks into the policy state block followed by
an enable flag (see M5_26B123_BUILD_WORDS). Boards without controller
defaults fail explicitly rather than emitting an empty policy-derived
status config.

Every M5 board on 26A428 (J714, J716C, J775D) and common26 (J813)
serializes byte-for-byte as before. On 27.2 (26B123/26B8125), G17S and
G17C change 86 status-config words to match the policy-derived encoder
and require G17S/G17C hardware validation (including binned-part USC
slot count and the remaining literal status-config word) before merge.

asahi_g17_m5_build_words verifies 26A428 stays unset, 26B123 populates
HwData/policy/status-config words while preserving the link tail, and
out-of-range core slot counts are rejected.

Signed-off-by: Jeff Queisser <[email protected]>
Booted through the 27.2 (26B123) stub, the M5 Ultra's GPU is refused at
probe: the only G17D build the driver identifies is 27.0's (26A428), so
the firmware found in `fw-text` measures as unknown and the desktop
comes up without a GPU.

Admit the 27.2 G17D build on the 26B123 InitData layouts, as the M5
Pro's 26B123 build already is. The digest and record offsets match the
ones listed for the G17D in an earlier revision of linux#1173's
description. They are validated compatible with the 27.2 firmware on the
M5 Ultra: its loaded image normalizes to that digest on every boot.

m5_ultra_identifies_each_build checks that each of the two G17D builds is
admitted only by its own digest and its own record offsets, and that each
names the layouts of its firmware.

Signed-off-by: Jeff Queisser <[email protected]>
@funkzy funkzy changed the title drm/asahi: t6050: run the M5 Ultra's (J775D) GPU on the 27.2 firmware, with the G17D's own status config drm/asahi: m5: unify 26B123 status-config encoder and admit G17D 27.2 firmware Nov 26, 2026
@funkzy

funkzy commented Nov 26, 2026

Copy link
Copy Markdown
Contributor Author

Converged the 26B123 status-config encoder into a single build-wide policy-derived encoder across all M5 core types (removing the core-type gate and M5_26B123_STATUS_CONFIG_INSERTED), reordered commits so the encoder lands ahead of G17D 26B123 admission, added KUnit asahi_g17_m5_build_words, and rebased onto main (8c6992db4b9f) at d7cf90bd9a9e.

Re-verified on J775D (kit pr2866-4 vs baseline kit pr2866-4b, window pr2866r4@20261126-1020, published Aura aura-main-7bf44a63): both 27.2 (26B123, 14,863 gpubench-vk submits ok) and 27.0 (26A428, 14,939 submits ok) boot and render cleanly with 0 GPU errors/faults/recoveries; KUnit 92 suites, 480/484 pass, 0 fail, 4 skip.

Keeping this PR as a draft until G17S (J714/J716s/K116s) and G17C (J716c/K114c) 27.2 convergence rows confirm firmware accepts the unified policy-derived status config (including binned-part USC slot count and the literal 900 word). If anyone with a G17S or G17C Mac on 27.2 can run a boot + GPU smoke row at d7cf90bd9a9e, that will settle whether we can mark this ready as-is.

This branch has not been deployed

No deployments
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