Skip to content

media: apple: ave: M3 generation (T8122/T603x): name the encoder resources and bind probe-only - #2362

Closed
RyanTheTide wants to merge 3 commits into
integration/aurorafrom
m3-media/ave
Closed

RyanTheTide wants to merge 3 commits into
integration/aurorafrom
m3-media/ave

Conversation

@RyanTheTide

Copy link
Copy Markdown
Contributor

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

  • dts (t8122, t6030, t6031, t6032 both dies): reorder the five register windows to codec, mailbox, coproc, pmgr, pio and name them; list the five encoder power states with their names and leave the VENC system state to the encoder DARTs, as the ADT does. Addresses, interrupts and power states are unchanged. The nodes stay disabled.
  • binding: require reg-names and power-domain-names on the four M3 SoCs and fold the separate T6032 branch into the common list.
  • driver: match apple,t8122-ave, apple,t6030-ave, apple,t6031-ave and apple,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

  • All M3 DTBs (t8122-j433/j434/j504/j613/j615 incl. 25g83, t6030-j514s/j516s, t6031-j514c/j516c, t6034-j514m/j516m, t6032-j575d) built with no new dtc warnings against the base. See details.
  • drivers/media/platform/apple/ave/ built with W=1 (arm64, LLVM). See details for the result.
  • AVE KUnit (.kunitconfig in the driver directory), including a new case that checks the M3 variant stays probe-only even when its TEXT CRC selects a known layout.
  • Values checked against the ADT of each 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.

Still to run

  • Hardware: nothing binds until the loader hands over the M3 firmware. aura's AVE handoff (dt_set_ave) does not list the M3 compatibles yet, so the nodes stay disabled. With that handoff in place, a J615 probe should log probe only: firmware TEXT 0x134000 CRC ..., DATA 0x128000 CRC ....
  • Encoding on M3 needs the build's boot sequence, device numbers and command layout. That is a qualification job, not part of this PR.
  • The encoder DARTs' power domains come from arm64: dts: apple: give every DART its engine's power domain, and lint it #2261. This PR does not touch the DART nodes.
Per-SoC evidence (ADT layout compared with T8112 and T6041)
T8112 (J413) T8122 (all 5 boards) T6030 (J514s/J516s) T6031/T6034 ave0, ave1 (and J575d die 0) T6032 die 1 ave2, ave3 T6041 (J614s ave1)
soc-id t8112 t8122 t6030 t6031 t6032 t6041
codec / coproc / mailbox +0x100000 0x45c000 / +0x800000 0x800000 / +0x50000 0x8000 same offsets, mailbox 0x4000 same, mailbox 0x4000 same, mailbox 0x4000 same, mailbox 0x4000 same, mailbox 0x4000
interrupts (mbox first) 692, 686, 685, 688, 687 701, 695, 694, 697, 696 810, 804, 803, 806, 805 1207.. / 1219.. die 1: 1207.. / 1219.. 1476..
pmgr encoder states VENC_DMA, PIPE4, PIPE5, ME0, ME1 (+ SYS on DART) same ids as T8112 same set VENC0_* / VENC1_* (+ VENC*-SYS-DART on DART) same on die 1 VENC1_*
dart-ave vm-base 0x800000000 0x10000000000 0x10000000000 0x10000000000 0x10000000000 0x10000000000
preloaded TEXT / DATA 0xd0000 / 0x128000 0x134000 / 0x128000 (J615 live) not in IPSW ADT (filled by iBoot) not in IPSW ADT not in IPSW ADT 0x14c000 / 0x12c000

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 and apple-ave.o built, no warnings (CONFIG_VIDEO_APPLE_AVE=m; CONFIG_RUST off because of an unrelated bindgen failure in this config).
  • KUnit (drivers/media/platform/apple/ave/.kunitconfig, arm64 QEMU): 45 tests, 45 passed, including the new apple-ave-abi.ave_m3_probe_only.
  • CHECK_DTBS=y W=1 DT_SCHEMA_FILES=media/apple,t8140-ave.yaml on 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_check for 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)
  1. Boot the J615 with this kernel and an aura that lists apple,t8122-ave in its AVE handoff and enables the node, its DARTs and their power states.
  2. dmesg | grep -i ave should show probe only: firmware TEXT 0x134000 CRC xxxxxxxx, DATA 0x128000 CRC yyyyyyyy needs qualification and no DART faults. /dev/video* exists for apple-ave. grep . /sys/firmware/devicetree/base/chosen/aurora,ave-*-crc32 matches the logged CRCs.
  3. Expected: 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.
  4. Pass: all three hold over 10 boots. Encode bit-exactness and fps are measured only once the M3 build is qualified (separate work).

Assisted-by: LLM (Claude:Opus 5.5)

…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>
@RyanTheTide

Copy link
Copy Markdown
Contributor Author

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 power-domains = <&ps_venc_sys>:

apple-dart 315030000.iommu: ... version 0200, 16 streams, AS 42 -> 42, ... 0 bypass streams
apple-dart 315040000.iommu: ... version 0200, 16 streams, AS 42 -> 42, ... 0 bypass streams
apple-ave 315100000.video-encoder: probe only: firmware TEXT 0x134000 CRC 918d70d3, DATA 0x128000 CRC fed1233a needs qualification

/dev/video13 = apple-ave. 0 SError/DART faults, 0 failed units, SELinux enforcing. Probe-only works as described. The DARTs need their power domain once they are enabled. Without it the J615 does not reach Linux.

@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Blockers: 1.

  1. This is superseded and should be closed. All three commits landed through media: apple: ave: hardware H.264/HEVC encode on the M3 (T8122, J615) with the macOS 27.2 firmware #2644 (merged 2026-11-21) as e30360c (DT names), 9540263 (binding) and eb9bfda (probe-only M3 variant). That PR also added the 26B123 command layout and T8122 encode on top. On current integration, ave_m3, the apple,t8122/t6030/t6031/t6032-ave matches and ave_m3_probe_only all exist. This branch now conflicts in apple-ave.rst, Kconfig, ave-abi-test.c and ave-drv.c. Nothing here is missing from integration, so close it rather than rebase.

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)

@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Superseded by #2644, which landed the same M3 encoder names, binding and match data and added T8122 encode on top.

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