Skip to content

kboot: hand off the AVE firmware on the M4 Pro too - #25

Merged
RyanTheTide merged 2 commits into
mainfrom
ave/t6040-firmware-handoff
Oct 31, 2026
Merged

RyanTheTide merged 2 commits into
mainfrom
ave/t6040-firmware-handoff

Conversation

@RyanTheTide

@RyanTheTide RyanTheTide commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

dt_set_ave() only ran on the T8140 and found the encoder by its A18 Pro path. The T6040 kernel DT already describes the encoder (apple,t6041-ave at /video-codec@283100000, disabled), and iBoot preloads its firmware the same way: ADT /arm-io/ave0 is pre-loaded with __TEXT and __DATA segments remapped at 0x100_0000_0000, like /arm-io/ave on the A18 Pro.

This finds the DT node by its compatible instead of a chip check and a fixed path, and takes the ADT node from /arm-io/ave or /arm-io/ave0. The segment checks, the reservation and the CRC export are unchanged. The node is only ever disabled here, never enabled, so the T6040 encoder stays off until the kernel driver supports it (the T6040 command differences are still being collected).

Testing

  • Builds on the buildbox (make, toolchain env), no new warnings.
  • Not booted. It needs two boots before merge, each with a way back armed:
    • Neo: /chosen still carries aurora,ave-text-crc32 and aurora,ave-data-crc32, /proc/device-tree/reserved-memory/ has the two asc-firmware@ nodes the encoder points at, and v4l2-ctl --list-devices shows the encoder as before.
    • J616s, with a kernel DT that has the T6040 AVE node: the Stage 2 log has no FDT: AVE disabled line, /proc/device-tree/video-codec@283100000/memory-region exists, two asc-firmware@ reserved nodes appear, and /chosen has both aurora,ave-*-crc32 values. The node stays disabled.

Second commit: the M1 Pro (apple,t6000-ave, ADT /arm-io/ave0) and M2 (apple,t8112-ave, ADT /arm-io/ave) get the same hand-off. Their DTs already carry the disabled node. On the M2 the segment remap address differs from the physical one; the reservation already uses the ADT remap.

Expected /chosen/aurora,ave-text-crc32 values, computed on the host as the CRC32 of the __TEXT segment of each firmware image (the same method gives the live J700 value 69c54454 for the 26.6.2 AppleAVE2FW_H17):

Machine Stub OS firmware Firmware TEXT size TEXT CRC32
J700 26.6.2 H17 0x14c000 69c54454
J616s 26.6.2 H16S 0x14c000 68d5f9f6
M1 Pro (J316s) 13.5 H13S, 6070.11.1 0xd0000 460c7a7c
M2 (J413) 13.5 H14G, 6070.11.1 0xd0000 25bfd039

The head builds reproducibly: gmake RELEASE=1 CHAINLOADING=1 ESP_STAGE2=1 of the merge base gives the exact loader bytes now running on the J616s (sha256 972507e6...), so a test Stage 2 differs from the running one only by this change.

🤖 Generated with Claude Code

dt_set_ave() only ran on the T8140 and looked the encoder up by its A18
Pro path. The T6040 DT already describes the encoder (apple,t6041-ave at
/video-codec@283100000, disabled), and iBoot preloads its firmware the
same way: the ADT node /arm-io/ave0 is pre-loaded with __TEXT and __DATA
segments remapped at 0x100_0000_0000, like /arm-io/ave on the A18 Pro.

Find the DT node by its compatible instead of a chip check and a fixed
path, and take the ADT node from /arm-io/ave or /arm-io/ave0. The checks,
the reservation and the CRC export are unchanged, and the node is only
ever disabled here, never enabled, so the T6040 encoder stays off until
the kernel driver supports it.

Assisted-by: LLM
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
The T6000 and T8112 DTs describe the encoder (apple,t6000-ave and
apple,t8112-ave, disabled), and iBoot preloads its firmware the same way
as on the A18 Pro and M4 Pro: /arm-io/ave0 on the M1 Pro, /arm-io/ave on
the M2, pre-loaded, with __TEXT and __DATA segment ranges. On the M2 the
remap address differs from the physical one, which the reservation
already takes from the ADT.

Reserve the segments and export their CRCs on these SoCs too, so the
driver can tell which firmware build it is talking to. The node is still
only ever disabled here, never enabled.

Assisted-by: LLM
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
@RyanTheTide
RyanTheTide marked this pull request as ready for review October 31, 2026 11:55
@RyanTheTide
RyanTheTide merged commit a1d4b49 into main Oct 31, 2026
9 checks passed
@RyanTheTide
RyanTheTide deleted the ave/t6040-firmware-handoff branch October 31, 2026 12:02
@RyanTheTide RyanTheTide mentioned this pull request Nov 1, 2026
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