Skip to content

kboot: hand the J713 ISP its address filter windows from the ADT - #309

Merged
DjDeveloperr merged 1 commit into
mainfrom
j713/isp-dapf
Nov 19, 2026
Merged

DjDeveloperr merged 1 commit into
mainfrom
j713/isp-dapf

Conversation

@erikwb

@erikwb erikwb commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Ryan's merge notes on aurora-silicon/linux#531 asked for the T8132 ISP's DART address filter table to come from the loader reading the ADT, the way the firmware carveouts already do. The kernel had it as a table copied from one J713's ADT.

With the rest of the J713 ISP handoff, dt_set_j713_isp_one() now copies this boot's /arm-io/dart-isp DAPF records into the ISP's apple,dapf-ranges, as inclusive start and end pairs in record order. dapf_t8132_ranges() finds the DART's DAPF bank by its type in the instance metadata and refuses a DART with none or more than one. The kernel writes every slice with the same register words, named after the ISP driver's: J713_ISP_DAPF_CTRL0 (0x31, the window control word at 0x00), J713_ISP_DAPF_CTRL1 (0, at 0x04) and J713_ISP_DAPF_SIDMASK (1, the stream ID mask at 0x20). A record with other words is not used.

If the filter can't be read, the ISP is still handed over, without apple,dapf-ranges (a stale one in the tree is dropped), so the kernel decides: today's kernels keep their built-in table, and aurora-silicon/linux#2229 refuses with a message naming the missing property.

dapf_select_t8132() rejected the ISP DART: it lists two SMMU banks in its instance metadata, a type the validator didn't know. It now accepts SMMU instances.

Merge order: this goes first, with aurora-silicon/u-boot#52 (importer), before aurora-silicon/linux#2229, the kernel change that needs the property. Under this aura alone, today's kernels ignore the new property.

Tested

  • New tests/python/test_j713_isp_dapf.py runs the production dapf_t8132_ranges() on the J713's real dart-isp records, plus a moved DAPF bank, no DAPF bank, two DAPF banks, other register words, and source-mutation controls. test_j713_isp_handoff.py checks the property, every refusal, and the hand-off without the property (with and without a stale one).
  • The rest of tests/python matches main.
  • aarch64 clang build; clang-format clean on the changed lines.
  • J713, one-shot aura-try trial with this change and the U-Boot importer: the kernel DT got the 13 windows from that boot's ADT, and the camera streamed with no faults.
  • Not tested: a board whose filter can't be read (the fallback is covered by the unit tests only).

This change was developed and tested by Claude (Anthropic), working with me on the J713.

🤖 Generated with Claude Code

@RyanTheTide

Copy link
Copy Markdown
Contributor

Thanks, reading the filter from this boot's ADT is the right direction. Two requests. First, in dt_set_j713_isp_one() the call dapf_t8132_ranges("/arm-io/dart-isp", 5, 0x31, 0, 1, ...) relies on the DAPF bank being entry 5 of instance. Could dapf_t8132_ranges() find the bank by type (DAPF_INSTANCE_DAPF) instead, and could 0x31/0/1 become named constants with a line on what each field means? Second, dt_set_j713_isp() also runs on J604, and the new refusal there would turn the camera off if its dart-isp words differ. Do you have a J604 boot showing "N address filter windows", or a reason in the code why it must match? Happy to help test.

The T8132 ISP loses its DART's address filter whenever it powers down,
and the kernel programs it again before each firmware start. Its windows
were a table in the kernel copied from one J713's ADT. With the rest of
the camera handoff, copy them from this boot's ADT /arm-io/dart-isp
dapf-instance records into the ISP's apple,dapf-ranges, as inclusive
start and end pairs in record order.

The DART's DAPF bank is found in its instance metadata by type, not by
position; a DART with no DAPF bank, or more than one, has none to give.
The kernel writes every slice with the same register words: the window
control word, the second control word and the stream ID mask, named
after the driver's. A record with other words is refused. Without a
usable filter the ISP is still handed over, only without the property
(one already in the tree is dropped, as it is not this boot's):
a kernel with its own table keeps working, and one that needs the
property leaves the camera off and says why. The ISP DART also
lists its two SMMU banks in its instance metadata; accept that type when
validating a T8132 DART.

Developed with Claude Code.

Signed-off-by: Erik Bourget <erik@ebourget.net>
@erikwb

erikwb commented Nov 19, 2026

Copy link
Copy Markdown
Contributor Author

Both done. dapf_t8132_ranges() finds the DART's DAPF bank by type and refuses a DART with none or more than one. The words are named after the ISP driver's: J713_ISP_DAPF_CTRL0 (0x31, window control at 0x00, only bits 7:0 read back), J713_ISP_DAPF_CTRL1 (0, at 0x04) and J713_ISP_DAPF_SIDMASK (1, stream ID mask at 0x20). For the J604: I have no J604 boot, so instead of turning the camera off, an unusable filter now still hands the ISP over without apple,dapf-ranges (any stale one in the tree is dropped). Today's kernels keep their built-in table, and linux#2229 refuses with a message naming the missing property. Retested on the J713: 13 windows from this boot's ADT, and the camera streams.

@DjDeveloperr
DjDeveloperr merged commit 2a6803a into main Nov 19, 2026
16 checks passed
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.

3 participants