Repository navigation
kboot: T6050: hand the M5 Ultra's GPU to Linux instead of refusing its firmware build - #261
Conversation
…s firmware build The T6050 GPU handoff admits the M5 Pro's (G17S) firmware builds: 26A428 (27.0) and, since sithglan's c3c72c0 ("kboot: T6050: admit the 27.2 (26B8125) G17S firmware of the K116s"), 26B8125 (27.2). On an M5 Ultra (J775D, G17D) the loaded GPU firmware is a different build, so the handoff stops at check 1 and the GPU, its power states and mailboxes stay disabled. This adds that build to the same table; it adds no second handoff. The G17D row has the values of Linux's drivers/gpu/drm/asahi/hw/t6050.rs CONFIG_ULTRA: fw-text 0xa8000 (the secondary role's __TEXT is 0x4000 longer than on the M5 Pro), its boot-filled ranges, and the digest of fw-text with them zeroed. Each row now carries its fw-text size, and its GPU letter for the log. fw-data is checked as before: gfx-data-base to the end of gfx1-data-shared-ro spans 0x184000 on J775D too. The table is still tried in order and the digest still decides. The two G17S rows are tried as before, on 0xa4000 bytes from the start of GFX's __TEXT, whatever the ADT says of GFX1. The G17D row is tried only when the ADT puts GFX1's __TEXT right after GFX's and the two reach 0xa8000, so its check reads no further than the loaded firmware; only then is the copy 0xa8000 bytes. The matched row's size is what fw-text reserves. All rows enable the same seven nodes: the Ultra's GPU firmware roles, mailboxes and the power states Linux's J775D description uses are all on die 0. Boards: only T6050 runs this code. J775D takes the new row. On J714s and K116s the two G17S rows are tried as before, in the same order on the same 0xa4000 bytes, and write the same properties with the same values. The G17D row is tried there only after both miss and only if the ADT's GFX1 __TEXT follows GFX's to 0xa8000; otherwise the one addition is a read of gfx1-asc's segment-ranges. Their log lines read the same. Size (clang/lld 23.1.4, RELEASE=1 CHAINLOADING=1 ESP_STAGE2=1): .init content +0x4, .rodata +0x28, .text's section size unchanged, with _file_vital_end 0x11b748 (+0x80) under the 0x120000 limit. Tested: the build above; clang-format clean on the file; the kboot_gpu.c host tests that run on the build host pass (test_t6040_gpu_fill, test_t6041_gpu_fill, test_siliconforest_handoff, test_m3_graphics_defaults). A host harness, not part of this change, ran this handoff and main's, extracted verbatim, against modelled J714s and J775D ADTs and device trees: the logs and device trees are identical in all sixteen J714s cases (26A428 accepted, 26B8125 accepted, both with and without a gfx1-asc range and with a GFX1 __TEXT 0x4000 shorter, other build, an ADT range missing, a mailbox missing, no GPU described, die-1 nodes present, Ultra firmware, GFX1's __TEXT below GFX's, after a gap or overlapping it). On J775D, with its ADT's ranges, the G17D row reserves 0xa8000 of fw-text and enables the GPU; with GFX1's __TEXT below GFX's, after a gap, overlapping it or 0x4000 shorter, the G17D row is not tried and the handoff is refused at check 1, as on main. On hardware: J775D, with this and the M5 Ultra's other loader changes on main, the kernel uploaded over USB, booting integration/aurora with the J775D GPU described (its own pull request): the loader reports "T6050 G17D 26A428 enabled", Linux probes the GPU with both firmware roles' initdata acknowledged, a render node appears, the GPU's compute and chained-submit checks and 46 concurrent clients pass, and the desktop runs on the GPU. An earlier form of this change, which tried the G17D row the same way on J775D, also passed a 628-case render CTS subset (571 pass, 57 not supported) on main alone. On this machine main starts 27 of the 30 CPUs and hands over no display yet; both are outside this change. Not booted on J714s or K116s. Signed-off-by: Jeff Queisser <funkzy@users.noreply.github.com>
6fe5ba3 to
0d421b1
Compare
…instead of refusing its 26B123 build The production boot stub is 27.2 (26B123). Its GPU firmware for the M5 Ultra (J775D, G17D) is another build than 27.0's (26A428), so the T6050 handoff stops at check 1 there and the GPU, its power states and mailboxes stay disabled. Add that build as a fourth row of the same table, with 27.0's G17D sizes (fw-text 0xa8000, fw-data 0x184000) and its own boot-filled ranges and digest. The row is validated on the J775D with the 27.2 stub: the handoff enables the GPU and Linux runs it. Only J775D-shaped ADTs reach the row: it is a G17D row, tried only when GFX1's __TEXT follows GFX's to 0xa8000 and after the rows before it miss. On every other board nothing changes. Signed-off-by: Jeff Queisser <funkzy@users.noreply.github.com>
0d421b1 to
182519c
Compare
|
@funkzy, thanks for the J775d GPU and boot work. Four rows from a J775d would close the remaining gaps there. Nothing here blocks this PR; I'm putting them here because this is where your J775d work lives.
dmesg plus the command output, here or in a new issue, is perfect. |
|
Thanks. Rows from the J775D (Mac Studio, M5 Ultra), one Linux boot through the 27.2 stub (26B123):
HDMI: modetest and dmesgHDMI audioSpeakers: Linux and ADT valuesAVE and scalerdEQP-VK |
What is missing
The T6050 GPU handoff admits the M5 Pro's (G17S) firmware builds, 26A428 and 26B8125 (sithglan's c3c72c0). On an M5
Ultra (Mac Studio, J775D, G17D) the loaded GPU firmware is a different build, on the 27.0 stub (26A428) and on the
27.2 production stub (26B123) alike, so the handoff stops at check 1 and the GPU, its power states and its mailboxes
stay disabled.
What this adds
Two rows in that handoff's build table, one per stub; no second handoff.
drivers/gpu/drm/asahi/hw/t6050.rsCONFIG_ULTRA: fw-text 0xa8000(the secondary role's text is 0x4000 longer than on the M5 Pro), its boot-filled ranges, and the digest of fw-text
with them zeroed. fw-data is checked as before.
positions (in the row). Its digest is of the 27.2 GPU firmware's text
with those ranges zeroed; the same derivation reproduces the 26A428 G17D row's digest.
the digest decides; any mismatch leaves everything disabled.
__TEXT, whatever the ADT saysof GFX1. The G17D rows are tried only when the ADT puts GFX1's
__TEXTright after GFX's and the two reach0xa8000, so their check reads no further than the loaded firmware. The matched row's size is what fw-text reserves.
J775D description uses are all on die 0.
Who runs the changed code
the same properties with the same values, whatever their ADT says of GFX1. The new code reads gfx1-asc's
segment-ranges. Only if that puts GFX1's
__TEXTright after GFX's and reaching 0xa8000 does it allocate a0xa8000-byte copy instead of 0xa4000 and, after both G17S rows miss, try the G17D rows as well. The log lines read
the same.
build to that path; the two do not overlap.
Size
clang/lld 23.1.4,
RELEASE=1 CHAINLOADING=1 ESP_STAGE2=1, against main at 3d517e6:.initcontent +0x4,.textcontent +0x80;
_file_vital_end0x11b980 (+0xf0, of which the 26B123 row is 0x70), under the 0x120000 limit with18048 bytes of headroom (
tools/stage1_room.py).aura.bin3997696 bytes as on main.Depends on
Nothing in git. For Linux to use it, the J775D device tree has to describe the GPU the way J714s's does (linux
pull request "arm64: dts: apple: t6050-j775d: a working GPU and CPU clusters for the Mac Studio (M5 Ultra)").
On 27.2, Linux also needs a 26B123 G17D build in
hw/t6050.rs; until then its driver refuses that build at probeand the boot goes on without the GPU.
Validation
diffs are unchanged, and
kboot_gpu.cis the same on both bases.tests/pythonand the two T8122 GPU tests): 750 passed, 56 skipped, as onmain at 3d517e6. Among them the
kboot_gpu.chost tests (test_t6040_gpu_fill,test_t6041_gpu_fill,test_siliconforest_handoff,test_m3_graphics_defaults).J775D ADTs and device trees, with a stand-in digest: the logs and device trees are identical in all sixteen J714s
cases (26A428 accepted, 26B8125 accepted, each with and without a gfx1-asc range and with a GFX1
__TEXT0x4000shorter, other build, an ADT range missing, a mailbox missing, no GPU described, die-1 nodes present, Ultra
firmware, GFX1's
__TEXTbelow GFX's, after a gap or overlapping it). On J775D, with its ADT's ranges, the G17Drow reserves 0xa8000 of fw-text and enables the GPU; with GFX1's
__TEXTbelow GFX's, after a gap, overlapping itor 0x4000 shorter, the G17D rows are not tried and the handoff is refused as on main.
layout the 27.0 pair is enabled as "G17D 26A428" and the 27.2 pair as "G17D 26B123" (main refuses it at check 1);
the 27.2 pair with one code byte changed, or with an ADT that gives GFX1's
__TEXT0x54000, is refused at check 1.On the J714s layout the 27.0 G17S pair is enabled and the 27.2 G17S pair refused, identically to main.
Hardware
These boots ran main at 03d120d with both commits and the other aura pull requests below (the same files as this
branch), booting integration/aurora at 1f38ff8f4dc9 with the linux pull request below and sithglan's 27.2
dfb_ready_querycommit (merged since, in #2063).with both firmware roles' initdata acknowledged, 30 CPUs are online, the GPU's compute, chained-submit, timestamp
and 46-client checks and a 628-case render CTS subset (571 pass, 57 not supported, two runs) pass with no GPU
recovery, fault or timeout, and the desktop runs on the GPU on HDMI and DisplayPort.
fw-text. Linux, which has no 26B123 G17D build on integration, refuses the firmware at probe and the boot goes on
without the GPU (30 CPUs, the display on HDMI).
integration/aurora at 1f38ff8f4dc9 with sithglan's #1650 (which carries rolotrealanis98's #1173) unchanged, the
linux pull request below, and a one-entry G17D 26B123 build in
hw/t6050.rs(not part of these pull requests; itfollows once #1173 lands). The firmware the loader admits is the build the kernel identifies, both firmware roles boot
and both roles' initdata are acknowledged. Compute, 300 chained submits, timestamps (10 of 10), 46 concurrent
clients, the 628-case subset (571 pass, 57 not supported) and the desktop on HDMI at 1920x1080@60 read the same as
the same kernel on the 27.0 stub, with no GPU fault, recovery or timeout; a light render submit on die 0 takes
32.30 us on 27.2 and 32.31 us on 27.0 (median of five passes). That run uses #1173's 27.2 values as they are; it
shows the firmware runs with them.
integration/aurora at fc050503ffcd with only the linux pull requests below, one boot on the 27.0 stub: "T6050 G17D
26A428 enabled", the GPU's compute and chained-submit checks and 46 concurrent clients pass with no GPU recovery,
fault or timeout, and the desktop runs on the GPU on HDMI and DisplayPort.
7c71d6df6563 with the J775D GPU described (and a compute-timestamp change that is no longer in this set): the
loader reports "T6050 G17D 26A428 enabled", Linux probes the GPU with both firmware roles' initdata
acknowledged, a render node appears, and the GPU's compute and chained-submit checks, 46 concurrent clients and
a 628-case render CTS subset (571 pass, 57 not supported) pass, with no GPU recovery, fault or timeout in the
kernel log.
checks pass (the subset in two runs), with no GPU recovery, fault or timeout in the kernel log.
runs say nothing changes there.
Question
On J775D the handoff also writes the leakage calibration words (9f501f3). Linux's Ultra configuration reads none.
Should the G17D rows skip them, or are they harmless to leave?
Part of the M5 Ultra platform pack
Each pull request below stands on its own; together they bring the Mac Studio (M5 Ultra, J775D) up from public
branches to the desktop.
Not covered by this pack: the USB-A ports. Their controller's driver is built in and asks for
asmedia/asm2214a-apple.binwhile the kernel starts, before any root filesystem is mounted, so on this machine thefile has to be in the initramfs. The loader does not supply it.