Repository navigation
media: apple: ave: encode on the M4 Pro and enable it in the J616s DT - #748
Merged
Merged
Conversation
The M4 Pro boots Linux from a 26.6.2 (25G83) stub, so iBoot preloads the 25G83 build of the AVE firmware for its chip: TEXT 0x14c000, CRC 0x68d5f9f6. That is the build the A18 Pro runs (0x69c54454), compiled for the M4 Pro, and its command parser takes the same Config, Open, Start and Process layout. The macOS 25G83 driver builds identical commands for both chips. What differs is the chip identity. The M4 Pro is AVE device 27 with device type 25 (the A18 Pro is 29 and 27). Its coprocessor uses the same registers and start sequence as the A18 Pro. Select the existing layout for this CRC, and give the T6041 match data the coprocessor registers, device ID, device type, the A18 Pro boot argument, timebase and VCBAR encoding, and the qualified boot flag. Other firmware builds are still refused, the macOS 27.0 one included (TEXT 0x154000), whose commands are laid out differently. Assisted-by: LLM Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
Enable the AVE encoder on the J616s together with its two DARTs and the six VENC power domains it sits in. The loader disables the node again when the firmware is not preloaded or cannot be reserved. Both AVE DARTs get a 4 GiB DMA window above the firmware at 0x100_0000_0000. The ADT gives these DARTs a 0x100_0000_0000 + 0x300_0000_0000 VM range, and macOS keeps every encoder address in 0x100_xxxx_xxxx. A 4K session needs about 180 MiB of encoder buffers before its frame queues, so the 256 MiB the A18 Pro DT uses is not enough. Assisted-by: LLM Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
This was referenced Oct 31, 2026
This was referenced Nov 20, 2026
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Enables the AVE H.264/HEVC encoder on the M4 Pro (J616s), on top of #739 (merged: the 4 GiB window and buffer sizes). Replaces #740, which was based on the tree before #739.
The M4 Pro boots Linux from a 26.6.2 (25G83) stub, so iBoot preloads the 25G83 AVE firmware built for its chip (TEXT 0x14c000, CRC 0x68d5f9f6). It is the same firmware build as the A18 Pro's and takes the same command layout. What differs is the chip identity: AVE device 27, device type 25. The coprocessor registers and start sequence match the A18 Pro.
Commits:
Testing
J616s (M4 Pro), tt3, Stage 2 = aura main loader + this DTB (now the committed J616s Stage 2), module from this series, iommu group lazy (DMA-FQ), avebench 3 reps:
2 sessions 50.3 + 50.0. 0 DART faults, no AVE errors, firmware CRC 68d5f9f6. Before this series the J616s AVE was disabled in the DT (stock driver: probe only).
Earlier J616s run of the same driver and DT commits on the previous base (fleet12e, aura#25 Stage 2): 1080p H.264 99.5-100.0, HEVC 91.3-92.5; 4K H.264 27.0-29.6, HEVC 25.7-26.0; 2 sessions 50.7 + 50.3; 12-rep 4K fault hunt 24/24 clean, 0 DART faults; GStreamer v4l2h264enc 1080p 120/120 frames decoded by ffprobe.
Neo (J700) regression with this branch, tt3, 4 GiB DT trial, 3 reps: 1080p H.264 109.5-110.5, HEVC 100.6-100.7; 4K H.264 30.2, HEVC 28.7 (240/240); 2 sessions 55.0 + 54.9; 0 DART faults.
The aurora-wip t6040-j616s.dtb with this series differs from the current one in exactly the 11 AVE lines (6 power domains, 2 DARTs, 2 DMA windows, the encoder). W=1 AVE build 0 warnings; t6040-j616s.dtb and t8140-j700.dtb clean. run-host-tests on aurora-wip 65a2821 with this series: 148/158, the same 10 avd-av1-tail failures as the tip alone.
Both chips encode at about 43% (M4 Pro) and 62% (A18 Pro) of macOS on the same machine. Encoder performance votes are being worked on separately and are not part of this PR.
🤖 Generated with Claude Code