Skip to content

arm64: dts: apple: t6001, t6002: enable every video encoder - #2295

Draft
RyanTheTide wants to merge 1 commit into
mainfrom
spec12/ave-multi
Draft

RyanTheTide wants to merge 1 commit into
mainfrom
spec12/ave-multi

Conversation

@RyanTheTide

@RyanTheTide RyanTheTide commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Problem

The M1 Max has two video encoders and the M1 Ultra four, one pair per die. Linux used only encoder 0. Encoder 1 on t6001 and encoders 1 to 3 on t6002 were described but disabled, because the bootloader handed over only the first encoder's preloaded firmware. Encoder 1's description also had a "pmgr" range the driver refuses.

Change

  • Enable encoder 1 (t6001) and encoders 1 to 3 (t6002) with their two DARTs each, the same way encoder 0 is enabled. The bootloader change (aurora-silicon/aura tools: aurora: Notify about unsupported front-port displays (J700) #334) hands every encoder its own firmware copy, matched by address, and disables any encoder it cannot hand over. The bootloader does not enable nodes itself on these SoCs, so the DT has to enable them.
  • Fix encoder 1's and encoder 3's "pmgr" range (reg index 3). It is now pmgr_south + 0x8000, 0x24 bytes, which matches encoder 0's pmgr_east + 0x8000.
  • Drop the apple,t8110-dart fallback from the encoder 1 to 3 DARTs. These are T6000 DARTs, like encoder 0's.

Testing

  • make dtbs W=1: no warnings. Only t6001-j314c, t6001-j316c, t6001-j375c and t6002-j375d change. t6000-j314s and t6000-j316s are byte-identical.
  • I ran the aura handoff host harness on the new DTBs with a modelled ADT. With every encoder preloaded, all encoders are handed over and stay okay. If only encoder 0 is present, the others are disabled. If nothing is preloaded, every encoder is disabled.

Still to run

  • M1 Pro J316s: regression only, since its DTB is unchanged.
  • M1 Max (J314c, J316c, J375c): pending, needs a board owner.
  • M1 Ultra (J375d): pending, needs a board owner.
Old gate and why each board is safe
  • Old gate: t6001.dtsi and t6002.dtsi enabled only ave, ave_dart0 and ave_dart1, with the comment that only the die 0 encoder gets the bootloader handoff (c3e9035). The encoder 1 to 3 nodes came in with 43b9d8c ("describe dormant M1 Pro, Max and Ultra resources").
  • Selection: the bootloader now matches each enabled DT encoder to the ADT encoder at its address. A node with no ADT twin, no preload or invalid segments is set to disabled before Linux runs. That is the same fail-closed path encoder 0 already uses.
  • Driver: each instance checks its own two memory-region entries, the shared CRCs in /chosen and its extra0 (pmgr) range, which must be 16K aligned and at least 0x24 bytes. The old encoder 1 range, 0x28e680260 with 0x7dc4 bytes, failed the alignment check. The new value comes from this tree's own power-state nodes: ps_venc1_dma to ps_venc1_me1 sit at 0x8000 to 0x8020 in pmgr_south, and ps_venc_* sit at the same offsets in pmgr_east.
  • Die 1 (encoders 2 and 3) uses die-local addresses under soc@2200000000. Its ranges translate them to die 1's blocks, the same way the other die 1 nodes are translated.
  • With an older bootloader the extra encoders get no reservation, so the driver refuses them ("no preloaded firmware") and they stay unbound. The aura change should land first.
  • DMA fault reporter nodes are untouched, like encoder 0's.
DT diff (t6001-j316c)

ave1_dart1 and ave1_dart0: compatible "apple,t6000-dart", status okay. ave1: reg[3] <0x2 0x8e688000 0x0 0x24>, status okay. j375d adds the same changes for ave1, ave2 and ave3.

Hardware rows for the lead
  • J316s (T6000), unchanged DTB, combined with the aura branch: dmesg | grep -i ave shows apple-ave bound at 40d100000.video-codec as before. The fleet HEVC row (v4l2h265enc 1080p, 300 frames) gives rc=0 at about the same fps as before.
  • M1 Max owner: ls /sys/bus/platform/drivers/apple-ave/ lists 40d100000.video-codec and 507100000.video-codec. Run one encode on each /dev/video node.
  • M1 Ultra owner: four encoders bound, with one encode each.

The M1 Max has two video encoders and the M1 Ultra four, one pair per
die. Only encoder 0 was enabled: the bootloader handed over only the
first encoder's preloaded firmware. It now hands each encoder its own
copy, matched to the encoder by address, and disables an encoder it
cannot hand over, so enable encoder 1 on t6001 and encoders 1 to 3 on
t6002 with their DARTs, the same way encoder 0 is.

Describe them as encoder 0 is described:

- The driver maps the "pmgr" range (reg index 3) to the firmware as the
  encoder's power-state block and refuses one that is not 16K aligned.
  Encoder 0's is pmgr_east + 0x8000 (its dma, pipe4, pipe5, me0 and me1
  states, 0x24 bytes). Encoder 1's states sit at the same offsets in
  pmgr_south, so its range is 0x28e688000, 0x24 bytes, not 0x28e680260
  with 0x7dc4 bytes. Die 1's encoder 3 uses the same die-local value.
- Their DARTs are T6000 DARTs like encoder 0's; drop the apple,t8110-dart
  fallback compatible.

The DMA fault reporters stay as they are, like encoder 0's.

Fixes: 43b9d8c ("arm64: dts: apple: describe dormant M1 Pro, Max and Ultra resources")
Signed-off-by: Ryan Murray <[email protected]>
@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Looks good; approve once aura#334 has merged and an M1 Max owner row is on this head.

Checked at f3d7f0f. The new encoder 1 "pmgr" range, 0x28e688000 + 0x24 (t6001-peripherals.dtsi:233, t6002-peripherals.dtsi:349 and die 1's :953), is pmgr_south (t600x-dieX.dtsi:240, 0x28e680000) + 0x8000. That covers the ps_venc1_dma..ps_venc1_me1 controllers at 0x8000-0x8020 (t600x-pmgr.dtsi:1949-1985), matching encoder 0's pmgr_east + 0x8000 (t6000-peripherals.dtsi:462, and VENC_DMA/VENC_ME1 in the J316s ADT coverage). It also fits ave-drv.c's .extra0_size = 0x24. Dropping apple,t8110-dart from the six encoder DARTs makes them match encoder 0's T6000 DARTs. The J316s DTB is byte-identical. CI is green and the PR merges cleanly.

  1. This is the first time encoders 1-3 run, and the firmware is given a power-state block the tree has never used: it writes to whatever reg[3] names. A wrong offset would hit another block's power state on pmgr_south rather than fail cleanly. The ADT coverage files have no M1 Max/Ultra entry for VENC1, so the value is derived from our own pmgr nodes, not checked against the machine. Before merge, either an owner row on an M1 Max, or an ADT dump from one showing VENC1_DMA at 0x28e688000.
  2. Merge order: aura#334 is still open. With today's boot loader the extra encoders are refused at probe ("no preloaded firmware"), which is safe but logs an error on every M1 Max/Ultra boot. Merge this after aura#334, or say in the body that the error is expected until then.

HW row: M1 Max (J314c/J316c/J375c) owner, on this head plus aura#334. Both 40d100000 and 507100000 bound to apple-ave, a 300-frame 1080p v4l2h265enc on each /dev/video node with rc=0, 0 DART faults, no new pmgr/power-domain errors, 0 AVC, 0 failed units. The same with four encoders on a J375d when an owner has one. J316s unchanged-DTB smoke on the fleet HEVC row.

Assisted-by: LLM (Claude:Opus 5.5)

@RyanTheTide

Copy link
Copy Markdown
Contributor Author

The boot loader change this waited for has landed (aura#420, which carries aura#334's encoder handoff). Still needed: an M1 Max row on f3d7f0f with encodes on encoders 1-3, or an ADT dump from an M1 Max showing VENC1_DMA at 0x28e688000.

This branch has not been deployed

No deployments
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