Repository navigation
Do DAPF properly - #22
Merged
Merged
Conversation
dapf_entries hardcodes the DAPF reg index of a fixed set of DARTs. On
T8132, dart-pmp, dart-dcp and dart-dcpext0 have no DAPF, and their reg
at that index is a PS_PROT page shared by many DARTs, which raises an
SError when written. Newer SoCs also have DAPFs on DARTs the table does
not name: dart-ave0/1 and dart-ane0 on T6040/T6041, dart-pmp0/1 on
T6050 and dart-ane1 on T8152.
Walk every DART under /arm-io and take the DAPF from its "instance"
property, which types each reg range by fourcc in one of two layouts:
{type, unit, name[8]} per range, or {type, name[8]} per DART range with
the DAPF in the range after them. The entry count tells them apart.
Fall back to the table for a DART with no instance list.
Assisted-By: LLM
Signed-off-by: Youwes09 <yuvi.shen@outlook.com>
Signed-off-by: Cody Ho <codyho@stanford.edu>
On T8132, T8142 and T8152, dart-ave has a DAPF but lists no filter data, so there is nothing to write, yet it was reported as an error. Look the data up before powering the device and skip the DAPF if there is none. Assisted-By: LLM Signed-off-by: Youwes09 <yuvi.shen@outlook.com> Signed-off-by: Cody Ho <codyho@stanford.edu>
The DAPF is clock gated with the device behind its DART. On T8132, T8140, T8142 and T8152, the DART lists no gates of its own; they are on the device named without "dart-" (isp, ane, ave, pmp), so those DAPFs were written unpowered. An empty clock-gates, as on T8132's mtp and aop, counts as none. Power the device only if it is off, and power it down again only then: the old code gated a device it found running. If the state cannot be read, power the device and leave it on rather than write to it unpowered. Assisted-By: LLM Signed-off-by: Youwes09 <yuvi.shen@outlook.com> Signed-off-by: Cody Ho <codyho@stanford.edu>
ADevWithAnIdea
force-pushed
the
PR_dapf_adt_power_restore
branch
from
November 15, 2026 10:14
23cb6e2 to
b3ebc7f
Compare
Snapshot the real clock gates and their parents before temporarily powering a device. Virtual gates have no register of their own, so save their real ancestors as well and deduplicate shared gates. Restore requested power modes and automatic-gating settings in reverse dependency order. Preserve gates that were already active, roll back partial enables, and keep parents powered if restoring a child fails. Co-authored-by: Youwes09 <yuvi.shen@outlook.com> Signed-off-by: Cody Ho <codyho@stanford.edu> Assisted-By: LLM
Save the device power tree before enabling an inactive DAPF owner and restore it after programming the filters, including on an enable failure. Disabling only the ADT clock-gates is insufficient for virtual gates: on the Neo, ANE-SYS-V enables ANE_SYS recursively, but the nonrecursive disable is a no-op. This left ANE powered after successful initialization. The snapshot restores the real domain without disabling active parents. Keep the existing behavior for an unknown initial state: power the device before writing registers and leave it powered when no snapshot exists. Signed-off-by: Cody Ho <codyho@stanford.edu> Assisted-By: LLM
Use dapf_init_all() on T8132 now that ADT instance discovery selects the correct registers and initialization powers the owning device safely. Remove the chip-wide bypass and the hardcoded MTP and AOP initializers in a single change. Keep the MTP firmware segment reservations: those DART mappings are still required before the coprocessor starts DMA, independently of DAPF setup. Signed-off-by: Cody Ho <codyho@stanford.edu> Assisted-By: LLM
ADevWithAnIdea
force-pushed
the
PR_dapf_adt_power_restore
branch
from
November 15, 2026 10:19
b3ebc7f to
3962fcd
Compare
niklassheth
approved these changes
Nov 15, 2026
niklassheth
left a comment
Contributor
There was a problem hiding this comment.
Tested, works on M4 Air and mini
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.
No description provided.