Repository navigation
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>
|
Thanks, handing both encoders over through dt_set_ave_node and pairing each with its DART by MMIO address reads right, and it is selected by the encoder's compatible. Since the vm-base path is shared with T8112, we'll run a no-regression encode row on an M2 (T8112) and a J616s. The M2 Max row itself (both encoders bound, an H.264 encode per encoder, no DART faults) will need an owner's machine; a boot log from one would complete it. |
|
Thanks, and for the clear J475c write-up. The per-reservation #334 hands over every encoder of every compatible, matched to
We will move #334 forward so you have a base. After the rebase, one J475c boot with your earlier checks is enough: both encoders handed over, three reservations each with its CRC, both bound, one H.264 and one HEVC session per encoder. We will run M1 Pro and M2 no-regression boots for the single encoder. |
|
No-regression row on an M2 (T8112, J413) with this PR stacked on current main, as an aura-try Stage 2 trial: Enforcing, 0 kernel errors, 8/8 CPUs, s2idle 3/3, H.264 and HEVC 120-frame encodes byte-identical to the production Stage 2 (md5 f83a1801 / f05ab7ce), 0 DART faults. So the shared vm-base path is unchanged on T8112. The M2 Max row (both encoders) still needs an owner's machine. |
…rvation iBoot preloads AppleAVE2FW_H14C for both M2 Max encoders. Add apple,t6021-ave to ave_compatibles: dt_set_aves() then finds both nodes by phandle and matches each to ADT ave0 or ave1 by address, as for the other multi-encoder SoCs. Like T8112, the T6021 firmware runs at its DART's vm-base plus the segment iova; the DART is the one named after the matched encoder (dart-ave0, dart-ave1). The two encoders share one TEXT image, so the second appends its iommu-addresses tuple and memory-region phandle to the first's TEXT reservation. Their DATA images differ (on a J475c, CRC 7ae71157 for ave0 and c1d56196 for ave1), so one set of CRCs in /chosen cannot describe both, and refusing an encoder whose copy differs from the first would always leave the second M2 Max encoder off. Instead, on every SoC, each firmware reservation now carries aurora,crc32, the CRC of its own segment, and /chosen keeps the first encoder's values for a kernel that reads only /chosen. Such a kernel checks a later encoder against the first encoder's CRCs and refuses it if they differ, so it still fails closed. A shared reservation keeps the first value. Every SoC's reservations gain the property; nothing else in the DT changes for a SoC with one encoder. Assisted-by: Grok 4.7 Assisted-by: Claude Opus 5.5 Signed-off-by: Lucas Goossen <lucas.goossen@hey.com>
13fb868 to
0f59119
Compare
|
Thanks for the review. The updates are pushed; replies to each of your comments below. Re: vm-base path shared with T8112; the M2 Max row needs an owner's machine Thanks. The J475c is my Mac Studio, so I ran the M2 Max row on it ( Loader ( No Reservations (
Bind and encodes: both encoders bound ( Re: rebase onto #334; the three points Rebased onto #334 as it is now (
The one T6021-specific line left is the vm-base choice, by compatible as in #334 ( Tests (aarch64 build host): Re: M2 J413 no-regression result Thanks for running it. On T8112 the rebase adds only One thing to expect on #2375, not this PR: with its settings moved to the 6070.11.1 layout, T8112's encodes change by design (B-frames default to 0 for both codecs; H.264 P pictures become references and the lambdas change), so the production Stage 2 md5s (f83a1801 / f05ab7ce) will not match once #2375 is in. This PR alone does not change them. |
DjDeveloperr
left a comment
There was a problem hiding this comment.
Thanks, and for running the M2 Max row on your own J475c. Your commit (0f59119) reads right on top of #334:
apple,t6021-avejoinsave_compatibles, and the vm-base choice is made by compatible, as for T8112.- Every reservation gets its own
aurora,crc32, and/chosenkeeps the first encoder's values. A kernel that reads only/chosenstill refuses a second encoder whose DATA differs, so it fails closed. - The disabled-node skip is dropped instead of made general, which keeps the T8140 path working.
It can't merge yet. It's stacked on #334, which is a draft, and while the branch conflicts with main no CI runs on it. Once #334 lands, it needs only a rebase onto main and green CI. The J475c boot on the rebased head and Ryan's single-encoder M1 Pro and M2 rows can then come after the merge, with a revert ready.
RyanTheTide
left a comment
There was a problem hiding this comment.
No blockers in the top commit (0f59119). It can't merge until #334 (still a draft) lands. The branch conflicts with main today, so CI has not run.
Our 11-19 points:
apple,t6021-aveinave_compatibles: resolved.aurora,crc32on each AVE reservation on every SoC,/chosenkept for the first encoder, #334's disable-on-differing-copy removed: resolved (src/kboot.c:4544-4563, :4691-4711). A kernel that reads only/chosenstill refuses a second encoder whose DATA differs, so it fails closed.- No
t6021bool, nodt_ave_paired_dart(), nophandles[2]cap, no disabled-node skip: resolved. Dropping the skip instead of generalising it is right, given the T8140 path. - J475c boot of the rebased head: resolved by your 11-19 20:43 comment (Stage 2
g0f591198: both encoders handed over, both DARTs' DAPF initialised, three reservations each with its own CRC, both bound, H.264 and HEVC on each, 0 DART faults).
Findings:
- The description still says "This rebased version has not booted on the J475c", but your comment shows it did. Please update the "Not done yet" list so the merge commit's record matches.
- src/kboot.c:4699 rebuilds the reservation name as
asc-firmware@%lxto find it again. That matchesdt_reserve_asc_firmware()today (:4299). If the two ever drift,dt_ave_stamp_crc()fails and every encoder on every SoC is disabled: it fails closed, but it would be a silent regression everywhere. Having the reserve step return the node name (or offset), or a shared helper for the name format, would keep them in step. Not blocking. - Minor: when a later encoder fails after it has appended its tuple to the shared TEXT reservation (src/kboot.c:4702
goto disable), its phandle stays in that reservation'siommu-addresses/memory-regionwhile the node is disabled. That's harmless to the kernel, but it's worth a test case if #334's disable path is meant to leave the tree as if the encoder were never handed over.
Hardware rows we will run on the rebased head once #334 is in, as offered earlier:
- M2 (T8112) and M1 Pro (T6000): this head as a one-shot Stage 2. Pass if the AVE reservations carry
aurora,crc32equal to/chosen/aurora,ave-{text,data}-crc32, there is noAVE ... disabledline, H.264 and HEVC 120-frame encodes are byte-identical to the production Stage 2 (before #2375 changes the settings), and there are 0 DART faults. - J616s (T6040, remap-address path): same pass criteria for its encoder.
Assisted-by: LLM (Claude:Opus 5.5)
|
Blockers: 2. The per-reservation
The DT ABI is fine to land first. HW row: a J475c on the rebased head, as in the 11-19 row. Pass criteria: both Assisted-by: LLM (Claude:Opus 5.5) |
|
#420 is merged on main (07e90bb) and #334 is closed. This branch conflicts with main 4a6a093 in src/dapf.c, src/kboot.c, tests/python/test_ave_handoff.py and tests/python/test_t8140_ave_enable.py; it needs a rebase onto main. After #420, the apple,t6021-ave entry in ave_compatibles and the vm-base choice by compatible are no longer needed; the per-reservation aurora,crc32 is what remains. |
RyanTheTide
left a comment
There was a problem hiding this comment.
Review at 0f59119. The reservation-local CRC avoids selecting the wrong firmware copy when two encoders share a compatible. The first /chosen value remains a legacy fallback. Please verify handoff plus encode on both T6021 engines, and check the T8112 single-encoder path with an older consumer. Also add a refusal row that confirms a segment/CRC conflict cannot leave reachable stale memory-region references when only the second encoder fails.
|
@ludagoo a status note, since this has been waiting on the rebase since 11-22.
So this is no longer a mechanical merge of |
|
Merge readiness at
Areas: none matched in CODEOWNERS Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels. |
|
@ludagoo the 24 h window from the 11-27 status note has passed, so I'm closing this as superseded by #420 + #538. Here is why, so it's easy to reopen if I'm wrong:
What I couldn't check without an M2 Max: a boot of current |
Stacked on #334. Base: #334's head
0421b4e0(onmain3d517e63). One commit,0f591198bf7b, +41/-24 insrc/kboot.cand +94/-10 intests/python/test_ave_handoff.py. The Linux side is aurora-silicon/linux#2374 (it reads what this publishes).iBoot preloads AppleAVE2FW_H14C for both M2 Max encoders. The two share one TEXT image (0xf0000 bytes) and each has its own DATA (0x134000 bytes). On top of #334's handoff of every encoder:
apple,t6021-aveinave_compatibles. kboot, dapf: hand over every video encoder, each matched to its ADT node by address #334'sdt_set_aves()then finds both nodes, matches each to ADTave0orave1by address and its DART by name, and the second encoder appends itsiommu-addressestuple andmemory-regionphandle to the shared TEXT reservation. Nothing T6021-specific is added to that walk.aurora,crc32, the CRC of its own segment./chosenkeeps the first encoder's values, for a kernel that reads only/chosen. kboot, dapf: hand over every video encoder, each matched to its ADT node by address #334's refusal of an encoder whose copy differs from the first is removed: on the J475c the two DATA images differ (7ae71157 and c1d56196), so it would always leave the second encoder off. A kernel that reads only/chosenchecks the second encoder against the first encoder's CRC and does not bind it, so it still fails closed. A shared reservation keeps the first value, and a differing later value is logged (FDT: AVE: <name> aurora,crc32 is <a>, this segment is <b>).No disabled-node skip. #334 hands over every encoder node and leaves its status as the device tree has it, except on T8140, whose tree leaves both encoders off and where it enables the one the ADT has; any failure disables the node. A skip of disabled nodes on every SoC would break T8140, so there is none. Which M2 Max encoders Linux uses is therefore the device tree's choice: aurora-silicon/linux#2376 enables them in
t6021-peripherals.dtsi, for J414c, J416c and J475c. The handoff test covers both encoders with the nodes enabled and with them disabled.On a SoC with one encoder the only DT change is the new property on its two reservations, with the same values as in
/chosen.Tested
tests/python/test_ave_handoff.py: 4/4 at kboot, dapf: hand over every video encoder, each matched to its ADT node by address #334 and with this commit (aarch64 build host). The case with two encoders now expects a CRC on every reservation,/chosenwith the first encoder's values, and the second encoder handed over with differing DATA; noaurora,crc32 isline.pytest tests/python(with--continue-on-collection-errors): 699 passed, 8 failed, 20 skipped, 9 collection errors at kboot, dapf: hand over every video encoder, each matched to its ADT node by address #334 and with this commit, the same tests in each; none is a handoff test.make format-checkwith clang-format 23.1.3: no diff insrc/kboot.c. The 34 diffs it reports, insrc/sptm_virt_s2r.candsrc/utils.h, are the same at kboot, dapf: hand over every video encoder, each matched to its ADT node by address #334. CI uses 20.1.8, which I did not have.iommu-addressestuples, two DATA) each with itsaurora,crc32,/chosenwith ave0's values, both encoders bound, the driver checked each DATA CRC, and both encoders ran H.264 and HEVC.Not done yet
dart-ave1programmed bydt_set_ave_dapf()(new on T6021 with kboot, dapf: hand over every video encoder, each matched to its ADT node by address #334), three reservations each with its CRC, both bound, one H.264 and one HEVC session per encoder.🤖 Generated with Claude Code