Repository navigation
media: apple: ave: M3 generation (T8122/T603x): name the encoder resources and bind probe-only - #2362
RyanTheTide wants to merge 3 commits into
Conversation
…er states The M3-generation encoder nodes (T8122, T6030, T6031 ave0/ave1, T6032 ave0-ave3, added disabled in 982f330 "arm64: dts: apple: describe disabled M3 peripheral resources") list the five register windows in ADT order (codec, coproc, mailbox, pmgr, pio) without names, and the power domains as sys, pipe4, pipe5, me0, me1, dma, again unnamed. The AVE driver and binding find the windows by name in the order codec, mailbox, coproc, and attach the domains by name as dma, pipe4, pipe5, me0, me1, as on T8112. Describe them as the T8112 node does: reorder the windows and add reg-names, list the five encoder power states with power-domain-names, and leave the VENC system state to the encoder DARTs, which is where the ADT puts it (ps_venc_dma has it as its parent). The T6031 ave1 and T6032 ave1/ave3 nodes, which already lacked the system state, now list the same five states as their ave0 siblings. Addresses, interrupts and power states are unchanged and match the ADT of every M3 board (J613, J615, J433, J434, J504, J514s, J516s, J514c, J516c, J514m, J516m, J575d both dies) and our own IODeviceTree capture of a J615 under macOS 27.2. The nodes stay disabled. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
T8122, T6030 and T6031 were listed as encoders the driver does not bind, with five unnamed register windows, and T6032 had a branch of its own with the same unnamed form. The driver now binds all four, by register and power-domain name. Move T6032 into the "<soc>-ave", "apple,ave" list and drop its branch, and require reg-names and power-domain-names (and at least five power domains) on all four M3 SoCs, as on the other bound encoders. T6020, T6021, T6022 and T8103 keep the unnamed form. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
The M3-generation encoders (T8122, T6030, T6031 ave0/ave1, T6032 ave0-ave3) have the T8112 encoder's register windows, interrupt order, power states and DART layout in the ADT, but iBoot preloads a firmware build of their own: on a J615 under macOS 27.2 the ADT segment-ranges give TEXT 0x134000 and DATA 0x128000 bytes, which matches none of the builds the driver knows (T8112: TEXT 0xd0000). So none of the existing match data can be reused: its sizes, TEXT CRC, boot sequence, device numbers and command layout all belong to other builds. Match the four M3 compatibles to one probe-only variant that pins no build: it takes any segment sizes from the bootloader's handoff, still checks the reservation, the DART mapping and both loader CRCs, and logs the sizes and CRCs so the build can be qualified. ave_fw_check_boot() refuses to start the coprocessor because the variant is not boot-qualified and has no registers, so no stream can start, whatever layout a TEXT CRC might select. The probe-only message now also names the segment sizes. A KUnit case checks that the M3 variant stays probe-only even with a TEXT CRC that selects a known layout. Builds on the probe-only path of the T6041 and T8140 bring-up and the AVE driver by the Aurora Silicon contributors. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
|
J615 row (MacBook Air 15" M3, T8122, macOS 27.2 firmware), kernel 7.3.0 d1 lab build + this PR's driver. Stage 2 is aura main + aura#354 (+#334, #227, #377). The DT is this PR's T8122 AVE node with status okay, plus both AVE DARTs okay with
|
|
Blockers: 1.
The J615 probe-only row in the comments was the first hardware evidence for that path. #2644 went further with real encode on the J615. Assisted-by: LLM (Claude:Opus 5.5) |
|
Superseded by #2644, which landed the same M3 encoder names, binding and match data and added T8122 encode on top. |
Problem
The M3 generation (T8122 Air/iMac/MBP14, T6030 M3 Pro, T6031/T6034 M3 Max, T6032 M3 Ultra) has disabled AVE encoder nodes in its SoC dtsi files, but the AVE driver has no match data for them. The nodes also could not bind as written: the register windows and power domains are unnamed and in ADT order, while the driver and the binding look them up by name (codec/mailbox/coproc, dma/pipe4/pipe5/me0/me1), as on T8112.
Change
apple,t8122-ave,apple,t6030-ave,apple,t6031-aveandapple,t6032-ave(the hardware compatibles) to one probe-only variant. The M3 hardware is laid out like T8112, but iBoot preloads a different firmware build (TEXT 0x134000 / DATA 0x128000 bytes on a J615 with macOS 27.2, against 0xd0000 / 0x128000 on T8112). So the T8112 data cannot be reused. The variant pins no build: it checks the handoff and logs the segment sizes and CRCs, and never starts the coprocessor. It sets no device number, boot sequence or command layout, because those are not known for this build.Testing
drivers/media/platform/apple/ave/built with W=1 (arm64, LLVM). See details for the result..kunitconfigin the driver directory), including a new case that checks the M3 variant stays probe-only even when its TEXT CRC selects a known layout.Still to run
dt_set_ave) does not list the M3 compatibles yet, so the nodes stay disabled. With that handoff in place, a J615 probe should logprobe only: firmware TEXT 0x134000 CRC ..., DATA 0x128000 CRC ....Per-SoC evidence (ADT layout compared with T8112 and T6041)
The encoder hardware is laid out like T8112. The DART window and the mailbox size match M4. The firmware build matches neither, which is why the driver gets new, probe-only data rather than a fallback to
apple,t8112-ave. The extra ADT power gates on the encoder (VENC-SYS-V, *-VNOM/VMAX, MEM-FAST, FAB-VMAX on T603x) are virtual performance/voltage requests, not pmgr power states. They are not described here, like on T8112. The optional "perf" domain can carry them later if qualification needs it.The M3 nodes were added disabled by 982f330 ("arm64: dts: apple: describe disabled M3 peripheral resources") and ad8135f. This PR only renames and reorders their properties.
Build and test logs
Base: integration/aurora 0abc2f3. arm64, LLVM=1, buildbox.
make W=1 drivers/media/platform/apple/ave/: all 18 objects andapple-ave.obuilt, no warnings (CONFIG_VIDEO_APPLE_AVE=m; CONFIG_RUST off because of an unrelated bindgen failure in this config).drivers/media/platform/apple/ave/.kunitconfig, arm64 QEMU): 45 tests, 45 passed, including the newapple-ave-abi.ave_m3_probe_only.CHECK_DTBS=y W=1 DT_SCHEMA_FILES=media/apple,t8140-ave.yamlon t8122-j433/j434/j504/j613/j613-25g83/j615/j615-25g83, t6030-j514s/j516s, t6031-j514c/j516c, t6034-j514m/j516m, t6032-j575d: all 14 built, exit 0, no schema findings. The only dtc warnings are existing alias_paths, unit_address_vs_reg and simple_bus_reg ones. A separate plain cpp+dtc build of base and branch gave the same warnings for every T8122/T6031/T6032/T6034 DTB. That script cannot preprocess t6030-gpu.dtsi on either tree, so T6030 was covered by the kernel build only. Because dtschema skips disabled nodes, the encoders were also forced to status "okay" in copies of the DTBs and validated with dt-validate. The new T8122/T6030/T6031/T6032/T6034 DTBs pass. The base T8122 DTB fails the new schema (reg-names and power-domain-names missing), which shows the schema is applied.dt_binding_checkfor the binding hit the 30 min limit on the loaded build box before finishing (it was still building tools). The schema itself was processed and used by the dtbs check above.J615 hardware test recipe (once aura hands over the M3 firmware)
apple,t8122-avein its AVE handoff and enables the node, its DARTs and their power states.dmesg | grep -i aveshould showprobe only: firmware TEXT 0x134000 CRC xxxxxxxx, DATA 0x128000 CRC yyyyyyyy needs qualificationand no DART faults./dev/video*exists for apple-ave.grep . /sys/firmware/devicetree/base/chosen/aurora,ave-*-crc32matches the logged CRCs.v4l2-ctl -d <ave> --stream-mmap(or an ffmpeg h264_v4l2m2m run) is refused with EOPNOTSUPP and the "encoding refused" message, the coprocessor is never started, and runtime suspend/resume plus a suspend-to-RAM cycle leave no warnings.Assisted-by: LLM (Claude:Opus 5.5)