Repository navigation
arm64: dts: apple: t6041: enable second AVE encoder (ave1) and per-node CRC lookup - #3304
Conversation
Enable the second H.264/HEVC video encoder (ave1), its two DARTs
(ave1_dart0/1), and its six PMGR power states (ps_venc1_sys through
ps_venc1_me1) on T6041 (M4 Max), where ave1 is SoC-wide with no board
wiring.
Verified against the J616c ADT:
- /arm-io/ave1 shares the same firmware UUID and register/IRQ layout
already described in t6041.dtsi, and lists VENC1-SOC-VMAX (0x1c4) in
power-gates matching ave0's VENC0-SOC-VMAX; add pmc_soc_max ("perf")
to ave1 to match ave0.
- /arm-io/dart-ave1 (dart,t8110, 2 DAPF slices at reg[3]) matches
dart-ave0.
- Add ave and ave1 aliases so the boot loader's DAPF pass programs
both dart-ave0 and dart-ave1; kboot's dt_set_aves() reserves both
firmware instances and disables ave1 automatically if absent in ADT.
Signed-off-by: AxxzyWasTaken <[email protected]>
Attach DART stream 12 alongside stream 0 on both ave (ave0_dart0/1) and ave1 (ave1_dart0/1) in t6041.dtsi. Both /arm-io/dart-ave0 and /arm-io/dart-ave1 in the J616c ADT expose streams 0 and 12 (sid = <0 12>), matching T8140. Because apple,t6041-dart remaps streams into the Linux domain (TCR[12] = REMAP_ENABLE | 0), ave_dart_audit() classifies stream 12 as AVE_DART_STREAM_OURS without affecting normal encode while satisfying ave_mctf_check_build() once T6041 MCTF is qualified. Keeping this in t6041.dtsi leaves T6040 (M4 Pro) unaffected. Signed-off-by: AxxzyWasTaken <[email protected]>
…fore /chosen
Multi-encoder Apple Silicon SoCs (such as T6041 with ave0 and ave1)
preload independent firmware copies whose per-instance CRCs can differ.
Read aurora,ave-{text,data}-crc32 from the encoder's own DT node first,
failing closed if the per-node property is present but malformed, and
falling back to /chosen only when absent (-EINVAL) for compatibility
with older Aura bootloaders.
Signed-off-by: AxxzyWasTaken <[email protected]>
|
Merge readiness at
Areas: Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels. |
DjDeveloperr
left a comment
There was a problem hiding this comment.
Verdict at 6ae0cdf8337a: no code blockers, and CI is green. It isn't ready to merge yet: the hardware rows need to be at this exact head, plus a second-generation AVE row for the shared ave-fw.c change (see below).
Checked
t6041.dtsi:ave1is enabled with its two DARTs and sixpmgr_auxdomains, and the parent chain is unchanged (venc1_sys→venc1_dma→ pipes and ME).ave1_dart0/ave1_dart1both nameps_venc1_sys.dt-checks, including the DART power-domain step, passes.ave1takespmc_soc_maxas"perf", likeave0.- DART stream 12 is added next to stream 0 on both DARTs of both encoders.
- The
ave/ave1aliases are for the loader's DAPF setup.
- With a loader that predates aura#538:
- Neither encoder node has a
memory-region; the loader adds it. - So
ave1stops at "no preloaded firmware" (-ENODEV) before any CRC or firmware step. - It can never run against
/chosen'save0CRCs or without its DAPF filter. It fails closed, at the cost of one probe error line.
- Neither encoder node has a
ave_fw_dt_crc():- The node's own property is tried first, and
/chosenis used only when that property is absent (-EINVAL). - A present but malformed property (
-ENODATA,-EILSEQ, or bad hex fromkstrtou32()) fails the probe instead of falling back. - On SoCs whose loader writes only
/chosen, behaviour is unchanged.
- The node's own property is tried first, and
- Commits: all three are signed off by the author, with no attribution.
checkpatch --strictgives 0/0/0 on each. - CI: all 20 checks pass at this head:
apple-build,dt-checks, every KUnit job includingKUnit ave,host-tests,pr-textandreadiness.
Before merge
- J616c at
6ae0cdf8337a. The encode row is fromc933b7518447, before the fail-closed property handling. One boot at this head is needed, with bothvideo16andvideo17probing and one encode on each. - A non-T6041 AVE Mac at this head, because
ave-fw.cis shared by every AVE-enabled Mac (for example J773g, J700 or J714s). It should show the encoder probing with its CRCs found (per node or/chosen, whichever its loader writes) and one encode. - J614c (14-inch M4 Max), which also gets
ave1fromt6041.dtsi. A boot row there would cover it; it is already underNot yet.
|
Completed the exact-head J616c boot and dual-encoder verification at
|
|
|
|
J813 (Apple MacBook Air 13-inch, M5 / T8142) non-T6041 peer row for the shared
|
|
J773g (M4 Mac mini, T8132, one AVE encoder) at How it was run: main has no AVE node in the J773g device tree, so neither stock nor this head exposes the encoder on this Mac. This head boots clean, with no video node for AVE and 0 failed units. To reach the encoder, the row used a lab-only kernel: this PR's head plus a 36-line J773g encoder node in Encodes: NV12 1280×720 in, 60 frames each, via
Concurrent HEVC: two 120-frame HEVC encodes run at the same time on the encoder, and both complete. Both streams decode all 120 frames and are byte-identical to each other and to the single-run stream. Kernel log: 0 AVE/DART error, fault or timeout lines, and 0 failed units. Compared with stock, the only new error-level lines are SEP sensor messages from the newer main base and one deferred USB probe ( |
There was a problem hiding this comment.
Verdict: FINISH, then merge at 6ae0cdf8337ad739500228cc6a966c6aef9b1005
Blocker: ave-fw.c now consumes two per-encoder DT properties that Documentation/devicetree/bindings/media/apple,t8140-ave.yaml does not define. The encoder schema is closed. The static DTBs checked by CI never contain these properties because Aura adds them at boot, so green dt-checks misses the effective DT contract. Document the checksum strings and legacy fallback, and validate an example or post-loader node containing the per-encoder properties.
Checked: Read the T6041 enablement, DART and power-domain changes and followed the per-node checksum fallback. Aura #538 has merged. The posted J616c dual-encoder result exercises the distinct checksums, and the exact-head J316s/J813/J773g results exercise the shared fallback. The enable is SoC-wide. No attribution or private data added in the patch.
…C properties Document the bootloader-injected aurora,ave-text-crc32 and aurora,ave-data-crc32 hexadecimal CRC32 string properties on encoder nodes (including the legacy /chosen fallback when absent) and add a post-loader example validated against the closed schema. Signed-off-by: AxxzyWasTaken <[email protected]>
|
Addressed the DT binding blocker in
|
There was a problem hiding this comment.
The current head adds only the missing binding properties and a post-loader example. I ran dt-doc-validate, compiled the example and validated it against the binding with no diagnostics. Changing the example's data checksum to a 0x-prefixed string produced the expected schema error. Both properties document the per-encoder override and the legacy fallback. The parent hardware results still support the unchanged runtime code. Code approved. Keep held for hosted DT/CI and the J614c row.
RyanTheTide
left a comment
There was a problem hiding this comment.
Verdict at 98dba80c: code OK, one row before merge.
Checked
ave1comes from the SoC dtsi with no board wiring, as the comment says, so there's no board gate.- The per-node CRC lookup takes precedence, and a present-but-invalid value fails.
- The loader side (aurora-silicon/aura#538) is merged.
- Your J616c rows cover
ave0+ave1encodes, and the J316s/J813/J773g rows cover the/chosenfallback. CI is green so far.
One case not covered: a T6041 booted by a Stage 2 older than aura#538. ave1 is now okay in t6041.dtsi, but that loader neither reserves its firmware nor sets up dart-ave1's DAPF filter, and it doesn't disable the node. The driver then falls back to /chosen/aurora,ave-*-crc32, which are ave0's values. If I read the CRC check right, ave1 should then fail its data-CRC check and not probe. Please confirm that on the J616c with a pre-#538 Stage 2: ave1 refused cleanly, 0 DART faults, ave0 unaffected.
A stricter option is no /chosen fallback for an encoder other than the first, i.e. when the node has a sibling AVE. Then the second encoder can't ever be checked against the first one's CRCs. Your call, but please say which in the commit message.
|
Thanks for the review. Queued a J616c boot test with a pre-aura#538 Stage 2 at |
|
Exact-head J616c (MacBook Pro 16" M4 Max, T6041) pre-
Ready for merge. |
|
Merge-train review at |
|
code-owner ping @DjDeveloperr: closeout merge at |
|
Merging under the 6-point rule (Ryan 09:29, permanent), at |
|
Merged. Thanks @AxxzyWasTaken: the second AVE encoder on T6041 is in. |
What: Enable the second video encoder (
ave1, its two DARTs, and its six PMGR domains) on T6041 (M4 Max), attach DART stream 12 to bothaveandave1, readaurora,ave-{text,data}-crc32from each encoder's own DT node before falling back to/chosen, and document both per-encoder bootloader-injected CRC properties inDocumentation/devicetree/bindings/media/apple,t8140-ave.yaml.Tested: Direct live boot of parent commit
6ae0cdf8337a(git diff 6ae0cdf8337a..98dba80cccd0is docs-only inapple,t8140-ave.yaml, zero runtime or DTB byte change) on Apple M4 Max (J616c) paired with Auraaura#538: bothave0(/dev/video14,data-crc32=d035f089) andave1(/dev/video15,data-crc32=6e66c376) probed firmware25G83(TEXT CRC 9a080cad) with DART0/1 streams0&12active and passed H.264, HEVC, and concurrentave0+ave1HEVC encodes with 0 errors/faults; non-T6041/chosenfallback also verified in comments on J316s, J813, and J773g at6ae0cdf8337a. At98dba80cccd0:DT_SCHEMA_FILES=media/apple,t8140-ave.yaml dt_binding_check(including the new post-loader example with both CRC properties),CHECK_DTBS=yacrosst6041-j616c,t6041-j614c,t8140-j700,t6050-j716s,t8132-j713,t6000-j316s, andt8112-j413,checkpatch.pl --strict, arm64 LLVMW=1build, and all 6 AVE host test suites pass with 0 errors/warnings.Risk: two-way door · T6041 (M4 Max) for the DTS changes; all AVE-enabled Macs for the
ave-fw.cper-node-before-/chosenlookup (preserves/chosenfallback when per-node properties are absent); docs-only DT schema addition in98dba80cccd0.Not yet: Live boot on J614c (14" M4 Max).
Details
arch/arm64/boot/dts/apple/t6041.dtsi:ps_venc1_sys..ps_venc1_me1,ave1_dart0/1, andave1, addspmc_soc_max("perf") toave1matchingave0, and addsave/ave1aliases for bootloader DAPF setup.sid = <0 12>, matching the J616c ADT) alongside stream 0 onaveandave1. Leaves T6040 (M4 Pro) unaffected.drivers/media/platform/apple/ave/ave-fw.c:ave_fw_chosen_crc()toave_fw_dt_crc()and readsaurora,ave-{text,data}-crc32fromave->dev->of_nodefirst. If present and valid, parses withkstrtou32(str, 16, crc); if present but malformed (-ENODATA,-EILSEQ, or invalid hex), fails closed instead of falling back to/chosen. Falls back to/chosenonly when the per-node property is absent (-EINVAL) so older Aura bootloaders continue working.Documentation/devicetree/bindings/media/apple,t8140-ave.yaml:aurora,ave-text-crc32andaurora,ave-data-crc32(hexadecimal CRC32 strings injected by the bootloader, with/chosenfallback when absent) inside the closed encoder schema and adds a validated post-loaderapple,t6041-aveexample carrying both properties.ave1disabled andave0continues probing via the/chosenfallback.Evidence
upstream/main(8c6992db4b9f):6f6d672bfd6aarm64: dts: apple: t6041: enable second video encoder (ave1)48c9893f0eebarm64: dts: apple: t6041: attach DART stream 12 to ave and ave16ae0cdf8337amedia: apple: ave: read per-encoder firmware CRCs from device node before /chosen98dba80cccd0dt-bindings: media: apple,t8140-ave: document per-encoder firmware CRC properties98dba80cccd0:git diff 6ae0cdf8337a..98dba80cccd0 --stat:Documentation/devicetree/bindings/media/apple,t8140-ave.yaml | 51 ++++++++++++++++++++++(zero runtime code or DTB change).scripts/checkpatch.pl --strict --git upstream/main..HEAD: 0 errors, 0 warnings, 0 checks across all 4 commits.make ARCH=arm64 LLVM=1 DT_SCHEMA_FILES=media/apple,t8140-ave.yaml dt_binding_check: 0 errors, 0 warnings (apple,t8140-ave.example.dtbcompiled and validated).make ARCH=arm64 LLVM=1 CHECK_DTBS=y DT_SCHEMA_FILES=media/apple,t8140-ave.yaml apple/{t6041-j616c,t6041-j614c,t8140-j700,t6050-j716s,t8132-j713,t6000-j316s,t8112-j413}.dtb: 0 errors, 0 warnings.make ARCH=arm64 LLVM=1 W=1 drivers/media/platform/apple/ave/: 0 errors, 0 warnings.drivers/media/platform/apple/ave/tests/{run,run-input,run-ipc,run-recovery}.py,tools/asahi/ave-pm-tests.py,tools/asahi/ave-probe-pm-tests.py: all pass.6ae0cdf8337a(identical kernel + DTB bytes to98dba80cccd0):7.3.0-pr3304-6ae0cdf8+, Auraaura#538stage2):/chosendata-crc32=d035f089,avedata-crc32=d035f089,ave1data-crc32=6e66c376, bothtext-crc32=9a080cad; both283100000.video-codec(/dev/video14,iommu group 20) and285100000.video-codec(/dev/video15,iommu group 23) probed firmware build25G83(TEXT 0x14c000 CRC 9a080cad, DATA 0x130000) with DART0/DART1 streams0and12(16 streams, 2 live, 0 unsafe); H.264 30/30 (516,470 B), HEVC 30/30 (618,128 B), and concurrentave0+ave1HEVC 60/60 (1,082,905 B) each decoded cleanly with 0 errors/faults.6ae0cdf8337a: J316s, J813, J773g PASS.