Repository navigation
media: apple: ave: T8132: start the macOS 27.2 encoder firmware (on #1489) - #2643
DjDeveloperr wants to merge 8 commits into
Conversation
|
The driver change reads well. The 26B123 variant is selected by the preloaded image's TEXT CRC, through the build table, and swapped in before the start, so 25G83 boots keep The M4 Air (J713/J715) DTs in this stack also enable the encoder, and those boards boot the same 27.2 image, so an H.264/HEVC encode on a J713 with this stack would cover a second T8132 board. Assisted-by: LLM (Claude:Opus 5.5) |
The T8132 (M4) encoder was only allowed in the whole-block "apple,ave" placeholder form, which the apple-ave driver cannot bind. It is the same encoder generation as the T6041 (M4 Pro) and T8140 (A18 Pro): describe it the same way, with the codec, mailbox and coprocessor windows by name, the five named power domains and the firmware memory regions. Drop the T8132 branch of the placeholder form, and list T8132 with the T6041 and T8140 in the named form. The remaining conditions move up one level, which is most of the diff (re-indentation only). Assisted-by: LLM Signed-off-by: Akhil <akhile76@gmail.com>
On the MacBook Air M4 (J713, OS firmware 26.6.2), iBoot preloads the encoder firmware with TEXT 0x148000 and DATA 0x12c000 (ADT ave segment-ranges), TEXT CRC 9308d2ab (AppleAVE2FW 9003.78.0). The capability table in that TEXT has device 26, type 24 as its default target. Started with the T6041 (M4 Pro) coprocessor registers and start sequence, from the code base the bootloader left (checked, not written), the firmware boots as device 26, accepts the handshake for type 24 and runs H.264 and HEVC sessions with the 9003.78.0 command layout. On the Mac mini M4 (J773g) the same build's TEXT CRC changes on every boot: two boots' TEXT differ only in the word at 0x4224, and with that word zeroed the CRC is 9308d2ab, as on the T6041 (M4 Max) preload. The J713 has read 9308d2ab on every boot tested so far, but give the variant the same per-boot word so either form is accepted. Add the variant, its TEXT CRC, and map that CRC to the 9003.78.0 layout. Tested on J713 with this driver (integration/aurora 0abc2f3 plus this commit) built against the running 7.3.0 kernel, the encoder described as in the following DT commits, and the firmware handed over by aura with the T8132 handoff: - FFmpeg VA-API H.264 720p/1080p/2160p, CBR/VBR and Constrained Baseline: 41.5-45.3 dB PSNR against the source, all frames decodable; - HEVC Main 720p/1080p (43.5/43.8 dB) and Main 10 1080p (46.7 dB); - Chrome 156 WebCodecs H.264 hardware encode: 44.7 dB. Assisted-by: LLM Signed-off-by: Akhil <akhile76@gmail.com>
Describe the T8132 encoder like the T6041 (M4 Pro) one, as the binding now asks: - bind through "apple,t8132-ave"; - give the codec, mailbox and coprocessor windows by name, and drop the pmgr and fabric windows, which the driver does not use on this generation; - list the five encoder power domains by name, dropping venc_sys, which is the DARTs' domain and the parent of venc_dma; - give both encoder DARTs venc_sys and the encoder's DMA range. The nodes stay disabled. The bootloader adds the firmware memory regions. Tested on a MacBook Air M4 (J713) by applying the same properties at runtime as an overlay: FFmpeg VA-API H.264 and HEVC (Main, Main 10) and Chrome WebCodecs H.264 encode, 43.5-45.5 dB PSNR against the source. Assisted-by: LLM Signed-off-by: Akhil <akhile76@gmail.com>
Enable the AVE encoder, its two DARTs and the six VENC power domains on the MacBook Air M4, 13-inch (J713) and 15-inch (J715). t8132-j713-pmgr.dtsi, shared by the two, had disabled the domains. The encoder needs the bootloader's firmware handoff for T8132 (aura: "apple,t8132-ave" in the AVE compatible list). Without it, the bootloader leaves the node disabled. Tested on J713 with the equivalent runtime overlay (see the previous commit). J715 is untested. Assisted-by: LLM Signed-off-by: Akhil <akhile76@gmail.com>
Enable the AVE encoder, its two DARTs and its six VENC power domains on the Mac mini (M4, J773g). State the VENC domains in the board tree rather than relying on the T8132 PMGR policy, which gives a domain the board leaves without a status the policy's own status: on a J773g in review the VENC domains came up disabled that way, and the encoder DARTs deferred until the probe timed out. Tested on a J773g in review (with the per-boot TEXT word in the T8132 variant): H.264 and HEVC 1080p encode, all frames decodable, no DART faults. It needs the bootloader's T8132 AVE firmware handoff. Assisted-by: LLM Signed-off-by: Akhil <akhile76@gmail.com>
Enable the AVE encoder, its two DARTs and its six VENC power domains on the MacBook Pro (14-inch, M4, J604). State the VENC domains in the board tree rather than relying on the T8132 PMGR policy, which gives a domain the board leaves without a status the policy's own status: on the Mac mini M4 (J773g) the VENC domains came up disabled that way, and the encoder DARTs deferred until the probe timed out. Untested on J604: the encoder and its resources are SoC blocks, the same as on the MacBook Air M4 (J713) and the Mac mini M4 (J773g), where this configuration encodes. It needs the bootloader's T8132 AVE firmware handoff. Assisted-by: LLM Signed-off-by: Akhil <akhile76@gmail.com>
Enable the AVE encoder, its two DARTs and its six VENC power domains on the iMac (24-inch, M4, J623 and J624). State the VENC domains in the board tree rather than relying on the T8132 PMGR policy, which gives a domain the board leaves without a status the policy's own status: on the Mac mini M4 (J773g) the VENC domains came up disabled that way, and the encoder DARTs deferred until the probe timed out. Untested on J623/J624: the encoder and its resources are SoC blocks, the same as on the MacBook Air M4 (J713) and the Mac mini M4 (J773g), where this configuration encodes. It needs the bootloader's T8132 AVE firmware handoff. Assisted-by: LLM Signed-off-by: Akhil <akhile76@gmail.com>
macOS 27.2 (26B123) preloads the M4's build of AppleAVE2FW 9013.55.1, the release the M5 runs on 27.2: TEXT 0x154000 and DATA 0x12c000 (J773g ADT ave segment-ranges and uuid 03aa5171-556b-39a3-b4ae-e08520c39f82, the IPSW's AppleAVE2FW_H16G image), TEXT CRC 99fc929a, the zlib CRC32 of the image's __TEXT. The 25G83 sizes are pinned, so the probe refused it: "unexpected firmware segment sizes". macOS 27.2.1 ships the same image. AppleAVE2 27.2 numbers the chips anew. Its soc-id table (AVE_FindByDevStr) gives "t8132" device 23, and its device table (AVE_DevCap_Find) device type 23 and chip type 13. The 26.6.2 kext's tables give device 26 and type 24, the values the 25G83 build starts with, and "t6040", "t8140", "t8142" and "t6050" read back as their variants start (27/25, 29/27, 27/27, 28/28), which checks the reading. AVE_SVECtrl gives chip types 12 to 23 one SVE register block, so the idle word at mailbox +0x118 is cleared before the start, as on T8142 and T6050. The 26B123 command layout is already mapped for this CRC. Give T8132 a build table: 25G83 keeps its values, and a build may name the variant it starts with (NULL keeps the platform's matched variant), here device 23, type 23 and the SVE idle word. The per-boot TEXT word at 0x4224 is zero in the 27.2 image too. Signed-off-by: Diljit Singh <hey@djdev.me>
8f509f0 to
3e35182
Compare
|
Rebased cleanly onto
Local checks: Assisted-by: LLM (Gemini:4 Neon) |
|
Status check against integration/aurora 4a17f73: T8132 encode on the macOS 27.2 firmware is on the tip through #2675 (merged 2026-11-22): the driver has the T8132 entry with the 27.2 image, the retry with the per-boot word zeroed that the J773g needs, the binding, and the encoder enabled on J713/J715. That is why this branch now conflicts in the driver, the binding and the T8132 device trees. What the tip does not have from this stack is #1489's part: enabling the encoder on the J773g, J604 and J623/J624 boards, and the 26.6.2 variant. @DjDeveloperr, could you check on the J773g whether the tip's driver starts the 27.2 image there once the board enables the node; if so, only the board enables remain and they can go through a rebased #1489. |
Stacked on #1489 (T8132 AVE support), rebased onto
integration/aurora(2701db12c, after#2644). Only the last commit,media: apple: ave: T8132: start the macOS 27.2 encoder firmware, is new. It can be folded into #1489 if @EdupugantiAkhil prefers.Problem
On the Mac mini M4 (J773g) with macOS 27.2 (26B123) firmware, the encoder probe fails:
27.2 preloads
AppleAVE2FW_H16G9013.55.1, the release the M5 runs on 27.2 (26.6.2: 9003.78.0):03aa5171-…matches the ADTavenode;99fc929a(zlib CRC32 of the image's__TEXT). The per-boot word at 0x4224 is zero in the image too.What macOS 27.2 starts it as
AppleAVE2 in the 27.2 kernelcache numbers the chips anew:
AVE_FindByDevStr(soc-id → DevID) andAVE_DevCap_Find(DevID → DevType, ChipType).AVE_SVECtrl_GetReggives chip types 12–23 one SVE block, so the idle word at mailbox +0x118 is cleared before the start, as on T8142/T6050.26B123command layout already mapped onintegration/auroraforAVE_FW_TEXT_CRC_T8132_26B123.Change
struct ave_fw_buildmay name the variant it starts with (documented inave.h:NULLkeeps the platform's matched variant).ave_layout_26b123.ave_t8132_build_layoutspins both T8132 CRCs to their layouts (ave_layout_9003_78_0andave_layout_26b123) and confirms 26B123 has no MCTF layout.Testing
Mac mini J773g, 27.2 (26B123) firmware, kernel 7.3.0 (m4drv8), with this driver as a module. The probe logs
firmware build 26B123 (TEXT 0x154000 CRC 99fc929a, DATA 0x12c000).1080p30 testsrc2, 60 frames, scored frame by frame against the source on the host:
checkpatch --strict: 0 errors, 0 warnings on commit 8.tools/asahi/run-host-tests.py --only ave) pass (6/6), plus LLVM/clang compile ofave-{drv,fw,layout,abi-test}.oand all 6 T8132 DTBs.Assisted-by: LLM (Gemini:4 Neon)