Repository navigation
accel/ane: T6050: admit the macOS 27.3 beta 1 (26C5035r) firmware - #1746
TripleU613 wants to merge 1 commit into
Conversation
On macOS 27.3 beta 1 (26C5035r, iBoot 20457.60.65) the ANE firmware
that iBoot preloads on T6050 has a different TEXT/DATA split. Apple
moved 0x2c000 bytes from DATA into TEXT; both layouts end at the same
DVA, so the firmware span (heap tail, pool, IPC) does not move:
27.0: TEXT 0xc0000 @ 0x10000000000, DATA 0x2ac000 @ 0x100000c0000
27.3: TEXT 0xec000 @ 0x10000000000, DATA 0x280000 @ 0x100000ec000
The hand-off check knows only the 27.0 layout and pin, so the driver
leaves the engine alone ("preload layout"). Once started, the 27.3
firmware also asks for a bigger IPC area: it reports 0x10440 (IPC size
minus one) where 27.0 reports 0xc440, and the boot path refused
anything other than 0xc440 and mapped only 64 KiB.
- Give a platform a table of admitted preload builds. The handed-off
segment layout selects the build, and the build supplies the TEXT
sha256 pin. T6050 admits 27.0 (its existing pin) and 27.3. Platforms
without a table keep their single layout and pin.
- Map the IPC window up to the heap (0x14000 bytes) and accept any IPC
size the firmware requests that holds the channel table and fits that
window, then pass that size back in the init block instead of the
fixed 0xc441. The H16 boot path already checks the request this way.
- Log the selected build and the measured TEXT digest, and name the
layout when no admitted build matches it.
- KUnit: the layout selects the build and its pin, and a mix of the two
layouts matches neither.
The H17 boot path is shared with T8140. Its firmware's 0xc440 request
still passes, and the IPC mapping grows from 64 KiB to the 80 KiB
window below the heap, which nothing else maps.
Tested on a J714s (M5 Pro) on 27.3 beta 1, booted through Aura with
the preloaded ANE handed over, on integration/aurora f1b79c4 and
later bases with this change (plus the 27.3 GPU and DCP changes that
are still out of tree):
H17 ANE: loader hand-off verified (27.3 build, TEXT sha256 115575864d4c8d02d48d83077170e7e16079aaf70dadd608c71910ac66dc6066); starting the engine
H17 ANE: READY; IPC 0x10441 bytes requested
The engine came up at bind and /dev/accel/accel0 was present on each
test boot where it was checked, on several kernels from these bases,
with no SError or Oops. No inference workload was run. The 27.0
firmware and T8140 were not re-tested with this change.
Signed-off-by: TripleU <182648541+TripleU613@users.noreply.github.com>
Assisted-by: LLM (Claude Code)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
9dd865f to
d927a32
Compare
RyanTheTide
left a comment
There was a problem hiding this comment.
The build table and pins look right and the layout check still refuses a mix of the two layouts. One request: the IPC window is now mapped to the heap, and the channel table is parsed against that whole window rather than the size the firmware asked for. Could the parse use the requested size (the value you now write at init + 0x50)? That keeps the T8140 bounds where they are today. We will run the T8140 side on our A18 Pro before merging: hand-off, READY with 0xc441, an inference job, and one suspend cycle.
On macOS 27.3 beta 1 (26C5035r, iBoot 20457.60.65) the T6050 ANE driver leaves the engine alone (
no loader hand-off (preload layout)). The firmware iBoot preloads has a different TEXT/DATA split:Apple moved 0x2c000 bytes from DATA into TEXT. Both layouts end at the same DVA, so the firmware span (heap tail, pool, IPC) does not move. Aura's hand-off (#169, #171) reads the segments from the ADT and is not version-gated, so it already hands the 27.3 preload over intact. With the layout admitted, the firmware then asks for a larger IPC area: its request is 0x10440 (IPC size minus one), where 27.0 asks for 0xc440.
ane_fw_boot()accepted only 0xc440 and mapped 64 KiB.Change (
drivers/accel/ane):struct ane_fw_preload_build: TEXT/DATA DVA and size, and the TEXT sha256 pin). The handed-off layout selects the build, and the build supplies the pin. T6050 admits 27.0 (its existing pin, unchanged) and 27.3 beta 1. Platforms without a table keep their single layout and pin through the same helpers.ane_h16_boot.h) already checks the request this way.Shared code.
ane_fw_boot()also runs for T8140 (ane_h17_platform). Its firmware's 0xc440 request still passes. Its IPC mapping grows from 64 KiB to the 80 KiB below the heap DVA, which nothing else maps.Tested on a J714s (M5 Pro) on 27.3 beta 1, booted through Aura with the ANE preload handed over. The kernels were integration/aurora f1b79c4, f8581cb, 2b4523c, 8679514 and 3766943, each with this change. They also carried the out-of-tree 27.3 GPU (#1173) and DCP changes, the Aura side of which is not on main either (cf. #172).
up at boot, accel node ready/dev/accel/accel0Not tested:
drivers/accel/ane/including the KUnit object, with no warnings. The KUnit case compiles but was not run.🤖 Generated with Claude Code