Repository navigation
kboot: T6050: fill the M5 Pro GPU operating points from the ADT - #534
Conversation
32fd057 to
7cea19e
Compare
The M5 Pro driver took every part's GPU voltages from its board's table. They are per part: on the K116s the ADT differs from the J714 table at 13 of 14 main states and 5 CS/AFR states. Where the DT gives the GPU node operating-point tables (operating- points-v2 with one core and one SRAM cell per voltage table, apple,afr-opp, apple,cs-opp, apple,csafr-min-sram-microvolt), fill them in place from sgx perf-states and perf-states-sram (two tables), afr-perf-states and cs-perf-states (one die) and their SRAM floor. Linux keeps its board's states and takes these voltages where every frequency is its own. The shapes of the ADT properties and of every DT table are checked before the first write; anything that does not fit leaves the DT as it is and the driver on its board tables. A DT without the tables is left alone. Linux checks every state and voltage against its board's. It is in Stage 2 only, as the SRAM fill next to it: Stage 1 has little room left with some toolchains, and on these Macs it loads the ESP's Stage 2, which boots Linux. The two T6031 host tests that build kboot_gpu.c now give it an empty build_cfg.h, as the G15 one does. Signed-off-by: Jens Axboe <axboe@kernel.dk>
7cea19e to
46484c1
Compare
There was a problem hiding this comment.
Verdict: MERGE at 46484c11
Blockers: none (wait for the queued CI checks to finish green before merge)
Checked: no Apple material, no AI attribution, human DCO Signed-off-by, Stage 2 only (#ifdef ESP_STAGE2, 0 B Stage 1 delta), DT-driven selection (leaves DTs without operating-points-v2 untouched), two-pass atomic check-before-write (t6040_opp_table() + opp-microvolt-sram shape + apple,csafr-min-sram-microvolt + memcmp(aux, cs, alen) + rising frequency ladder check before any in-place write), T6031 host-test scripts given empty build/build_cfg.h, K116s end-to-end hardware verification (99 values filled identically to ADT, byte-identical Linux GPU HW data, 15 s & 30 s deep sleep, piglit 557/12) + run-kboot-gpu-g15.sh (136 scenarios) + run-t6031-unchanged.sh + clang-format clean, PR body has Tested: and Risk: two-way, branch is MERGEABLE against main.
Evidence
- Inspected full diff (
+108/-1acrosssrc/kboot_gpu.c,tests/run-t6031-handoff.sh,tests/run-t6031-unchanged.sh):t6050_gpu_opps()is strictly wrapped in#ifdef ESP_STAGE2, preserving Stage 1 room acrossgcc/fedora/nixbuilds.- Pass 0 validates all three OPP tables (
operating-points-v2,apple,afr-opp,apple,cs-opp), exact subnode count and cell sizes,opp-microvolt-srampresence/absence, andapple,csafr-min-sram-microvoltlength before Pass 1 performs anyfdt_setprop_inplace*()write; failures leave the DT untouched with a single diagnostic line. - Non-blocking nit:
st[2 * i](src/kboot_gpu.c:87) andsram_uv(src/kboot_gpu.c:103) areu64narrowed tou32(safe for valid ADT microvolt values; Linux side validates voltage bounds, and I flagged the missingfloor_uvslack check onlinux#3255).
- CI at
46484c11: 21 checks currentlyQUEUED/PENDING(org runner backlog).
|
Merge readiness at
Areas: none matched in CODEOWNERS Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels. |
… the speaker strap read test_t6041_atc_usb2_device asserted the old u64/s64 spellings of the uintptr_t, ptrdiff_t and ssize_t typedefs, which aurora-silicon#476 changed to the compiler's __UINTPTR_TYPE__/__PTRDIFF_TYPE__. Strip whichever spelling src/types.h uses, and still require exactly one of each. kboot_audio.c now reads the speaker ID strap through adt_gpio_by_phandle, so the DT fuzz replay (pytest and tests/fuzz/build.sh) failed to link. Build src/adt_gpio.c alongside it. Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com>
|
@DjDeveloperr code-owner ping: the review App approved this at |
… branch Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com>
|
Merging under the 6-point rule (fast merge policy), at |
…t-handoff Conflict in dt_set_gpu_t6050: keep this branch's AURA_XTEXT placement (the T6050_GPU_INIT/T6050_GPU_TEXT_FN macros are gone here) and main's ESP Stage 2 t6050_gpu_opps() fill, now also AURA_XTEXT. Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com>
Problem
Linux's M5 Pro driver gives every part its board's GPU voltages. They are per part: on the K116s (T6050, M5 Pro) the ADT differs from the J714 table the driver uses at 13 of 14 main states and 5 CS/AFR states.
Change
Where the DT gives the G17S GPU node operating-point tables (aurora-silicon/linux#3255 adds them for the J714s and K116s),
dt_set_gpu_t6050()fills them in place from/arm-io/sgx:perf-statesandperf-states-sram(two tables ofperf-state-countstates, one cell per table),afr-perf-statesandcs-perf-states(one die) and their SRAM floor. Linux keeps its board's states and takes these voltages where every frequency is its own.Every ADT value (counts, sizes, a shared rising frequency ladder, voltages up to 1.3 V, CS equal to AFR) and the shape of every DT table is checked before the first write. Anything that does not fit leaves the DT as it is, with a log line, and Linux stays on its board tables. A DT without the tables is left alone. It is built into Stage 2 only: Stage 1 room is tight with some toolchains (the nix job had 4032 B left, under the 4096 B minimum), and on these Macs Stage 1 loads the ESP's Stage 2, which boots Linux. A Stage 1 that boots Linux itself leaves the tables at zero and Linux on its board tables.
kboot_gpu.calready readsbuild_cfg.honmainfor the T8142 SRAM fill; the two T6031 host-test scripts that build it get an empty one here. One commit.Testing
Tested: K116s (T6050, M5 Pro), firmware 27.2, end to end below.
Risk: two-way · M5 Pro (J714s, K116s) with a DT that has the tables.
46484c112b80: rebased ontomain99b6dd1. termg's T8142 SRAM fill (kboot: G17: fill the GPU's SRAM voltages from perf-states-sram #545) made the samebuild_cfg.hinclude, FP-objectbuild-cfgdependency and G15 host-test stub, so those lines are dropped here; what is left is the fill insrc/kboot_gpu.c, byte-identical to the rowed head below apart from the includemainnow has, and the emptybuild_cfg.hfor the two T6031 host tests.run-kboot-gpu-g15.sh136 scenarios pass,run-t6031-unchanged.sh origin/mainpasses,clang-formatclean. The rows below are at7cea19ee35d3.7cea19ee35d3T6050 / K116s (M5 Pro), firmware 27.2: booted through a loader built frommain8521ad7 + this commit + kboot: T6050: hand off the K116s external display engines on 27.2 #535 (release build:RELEASE=1 CHAINLOADING=1 ESP_STAGE2=1), Linux with drm/asahi: g17: M5: take the part's GPU voltages from loader-filled operating points linux#3255 and the DT tables at zero. The loader filled all 99 values (14 main states x two core and two SRAM cells, 14 AFR and 14 CS states, the 775 mV floor), equal to the ADT; Linux loggedGPU voltages from the boot loader's ADT tables: 18 states differ from the board's, and its GPU HW data is byte-identical through every perf row to the previous head's boot. 0 error-level kernel lines at boot; one RTC deep sleep (15 s) resumed, Wi-Fi back.main(not6050_gpu_oppsin it); the Stage 2 build has the fill.32fd0577ab9b(same code, built into Stage 1 too) gave the same results end to end, with all five display engines bound.make format-checkclean.Still to run
J714s: a boot with the DT tables (its own states and voltages filled), and one with an older DT (nothing written).
Clean-room: no Apple code, strings, firmware, RE output or tuning values
No chip/board/firmware-version gate where a hardware property can decide
Works on the default kernel command line; no hacks, delays or lab-only paths (tested on my usual command line, not the default)
Safety limits come from the machine, not from constants in code
Hardware safety rules followed for every test boot
Third-party commits unchanged; reporters and testers credited
Commits: human Signed-off-by only; no AI attribution in commits or PR text
Tested on the affected hardware; no regression