Skip to content

drm/asahi: g17: t6041: the 27.2 GPU firmware on every M4 Max, with deep sleep on 40 cores - #4157

Draft
DjDeveloperr wants to merge 2 commits into
mainfrom
fix/t6041-26b123-every-board
Draft

DjDeveloperr wants to merge 2 commits into
mainfrom
fix/t6041-26b123-every-board

Conversation

@DjDeveloperr

Copy link
Copy Markdown
Contributor

What: On firmware 27.2 (26B123): (1) admit the GPU firmware image every M4 Max loads, not only two measured J616C ones, and (2) let a 40-core M4 Max deep-sleep.
Tested: Host only. g17-t6041-initdata-tests.py, g17-firmware-selection-tests.py and t6040-calibration-tests.py pass at the head; checkpatch --strict 0 errors. The digest was computed from the public 26B123 restore image (build b000 of armfw_g16c.im4p). The same script gives the digests main already has for T8132 (484c43cb..., measured on a J773g). No Mac has booted this.
Risk: two-way · M4 Max (T6041) on 27.2 firmware only. A J616C whose measured image is already listed runs the same configuration as before, except that the 40-core one now restarts its GPU after a deep sleep instead of refusing the sleep. A plain revert undoes it.
Not yet: rows on 27.2 at this head: (a) a 40-core J614c, J575c or J616c: boot log shows Apple GFX 26B123 for T6041 (build b000, iBoot-filled ranges zeroed), a GPU smoke, then rtcwake -d rtc1 -m mem -s 20 x3 with a GPU smoke after each; (b) a 32-core J616c: the same boot line and one deep sleep.

Details

Image. BUILD_26B123 lists two TEXT digests, each one Mac's measurement with only the two entropy records zeroed. iBoot also writes carveout addresses, a per-boot slide and per-board tunable tables into TEXT, so a J614c or J575c on a 27.2 stub matches neither entry and probe stops with "unsupported GPU firmware build". This adds the shipped image with every range iBoot fills zeroed, as T8132's and T8122's 26B123 entries do:

  • the header word at 0x224 and the DATA address at 0x23c;
  • the value of each of the 39 parameter records (tag, 32-bit length, value) from 0x5d88c to 0x5dabd;
  • the count byte and 0x34c-byte body of the two tunable tables at 0x5dabd and 0x5de0d.

The ranges were read by walking the records in the image, and they are T8132's list moved by 0x318f. J575c reports its GPU as G16C B1 (#1498), the B0 build. The per-Mac entries stay, below the new one, until a Mac has booted with only it.

Deep sleep. The 40-core part runs BASE on 26B123, and BASE has sleep_restart: false, so sleep_prepare() refuses each deep sleep ("no firmware restart on this chip"). 25G83 on 40 cores and 26B123 on 32 cores have it on, and the 32-core one sleeps and wakes on 27.2 (row).

Tracked in #4155.

The 26B123 list holds two measured TEXT digests, one 40-core J616C and one
32-core J616C. iBoot fills part of the loaded TEXT for each Mac, so a J614C
or a J575C on a 27.2 stub matches neither, and the GPU does not start.

List the shipped image (build b000 of armfw_g16c.im4p, the G16C B1 one) with
every range iBoot fills zeroed: the two header words, the values of the 39
boot parameter records and the two tunable tables. The ranges follow the
record tags and lengths in the image and are the ones T8132's 26B123 entry
zeroes, 0x318f bytes earlier. The per-Mac entries stay for now.

Signed-off-by: DjDeveloperr <hey@djdev.me>
…26B123

The 40-core M4 Max runs BASE on 26B123. BASE leaves sleep_restart off, so
sleep_prepare() refuses every deep sleep with "no firmware restart on this
chip". The 32-core part on 26B123 and both parts on 25G83 have it on, and
restart the GPU in every deep sleep they have run.

Signed-off-by: DjDeveloperr <hey@djdev.me>

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.

1 participant