Repository navigation
kboot, dapf: hand over every video encoder, each matched to its ADT node by address - #334
Closed
RyanTheTide wants to merge 1 commit into
Closed
RyanTheTide wants to merge 1 commit into
RyanTheTide wants to merge 1 commit into
Conversation
…ode by address dt_set_ave() handed over the first DT node of the first matching encoder compatible and returned. Only T8140 walked all of its nodes and matched each to an ADT node by address; every other SoC took ADT /arm-io/ave or /arm-io/ave0 for that one node. The M1 Max has two encoders (ADT ave0 and ave1) and the M1 Ultra four, one pair per die, and iBoot preloads a firmware copy for each, so encoders after the first were never handed over. dapf.c likewise admitted the preloaded __TEXT only through dart-ave0. Hand over every encoder node of every compatible in ave_compatibles. Each node is matched to the /arm-io child named "ave" or "ave<N>" whose first register range is at the node's translated DT address (the T8140 matcher, now used everywhere, with dt_get_address() so that die 1's die-local addresses on the M1 Ultra resolve to die 1's encoders). A lone node is handled exactly as before; several nodes sharing a compatible are found again by phandle, as T8140's already were. The DART whose vm-base the M2 handoff reads is now named after the matched encoder (dart-ave for ave). Fail closed per encoder, as before: a node whose ADT twin is absent, not preloaded or has invalid segments is disabled. The driver checks every encoder against the one set of firmware CRCs in /chosen, so an encoder whose preloaded copy differs from one already handed over is disabled rather than overwrite them. dapf_preload_text() now admits encoder N's __TEXT through dart-ave<N>. dart-ave0 stays in dapf_entries; after the DT is final, kboot programs dart-ave<N> (N >= 1) for each encoder the DT still enables and disables the encoder if its filter cannot be programmed. Kept for T8140 only, with its hardware reason in the comment: an A18 Pro has one of its two encoders and only the ADT says which, so the DT leaves both off and aura enables the one handed over with its DARTs and power chain. T8140's inherited DAPF state stays untouched. The remap and DART window bases stay selected by compatible as before. A host test runs the handoff on every kernel DTB with an ADT modelled from it: the DT edits on T6000, T6041, T8112, T8132, T8140 and T8142 are byte-identical to before; only the multi-encoder T6001, T6002 and T6050 trees change. The address matcher and the phandle walk generalized here are Diljit Singh's T8140 handoff (f57127a). Fixes: 0954fe3 ("kboot: hand off the AVE firmware on the M4 Pro too") Fixes: 5933427 ("dapf: admit the preloaded AVE TEXT on the M1 Pro/Max CPU DART") Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
This was referenced Nov 19, 2026
Contributor
Author
|
Early note on this draft (no full review yet):
Assisted-by: LLM (Claude:Opus 5.5) |
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
dt_set_ave()handed over only the first DT node of the first matching encoder compatible. For every SoC except T8140 it took ADT/arm-io/aveor/arm-io/ave0for that node. The M1 Max has two encoders (ADT ave0 and ave1) and the M1 Ultra four. iBoot preloads a firmware copy for each, but the encoders after the first were never handed over.dapf.clikewise admitted the preloaded__TEXTonly through dart-ave0.Change
ave_compatibles. Each node is matched to the/arm-iochild namedaveorave<N>whose first register is at the node's translated DT address. This is the T8140 matcher, now generic asdt_ave_adt_path(). It usesdt_get_address(), so die 1's die-local addresses on the M1 Ultra resolve to die 1's encoders.dt_set_aves(), formerlydt_set_t8140_aves()).dapf_preload_text()admits encoder N's__TEXTthrough dart-ave. dart-ave0 stays indapf_entries. After the DT is final,dt_set_ave_dapf()programs dart-ave for N >= 1 for each encoder the DT still enables. It disables the encoder if its filter fails.Testing
makeis clean. kboot.c has no new warnings, and dapf.c loses one existing maybe-uninitialized warning.pytest tests/python: 700 passed. The same 8 tests fail before and after (test_run_guest_sptm, which depends on the environment).Still to run
Old gate
src/kboot.cdt_set_ave(): it returned after the first compatible with a node, and onlyapple,t8140-avewent to the all-nodes walk.dt_set_ave_node()picked ave or ave0 by name for every other SoC (0954fe3).src/dapf.c:dapf_preload_text()handled only/arm-io/dart-ave0and/arm-io/ave0(5933427).Why each SoC is safe
Hardware rows for the lead
/proc/device-tree/soc/video-codec@*/memory-regionhas 2 entries, and/proc/device-tree/chosen/aurora,ave-text-crc32is unchanged from production;dmesg | grep -i ave: apple-ave bound;gst-launch-1.0 videotestsrc num-buffers=300 ! video/x-raw,format=NV12,width=1920,height=1080 ! v4l2h265enc ! h265parse ! fakesink: rc=0, about 158 fps on J316s and about 124 fps on J413.Kernel side: aurora-silicon/linux #2295 enables encoders 1 to 3 on t6001/t6002 and fixes encoder 1's pmgr range. This PR should land first.
Assisted-by: LLM (Claude:Opus 5.5)