Skip to content

media: apple: isp: T8132 address filter from the loader; clean restored firmware memory - #2229

Merged
DjDeveloperr merged 4 commits into
aurora-silicon:integration/aurorafrom
erikwb:j713/isp-followups
Nov 19, 2026
Merged

DjDeveloperr merged 4 commits into
aurora-silicon:integration/aurorafrom
erikwb:j713/isp-followups

Conversation

@erikwb

@erikwb erikwb commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

Follow-ups from Ryan's merge notes on #531 (the J713 camera).

1. Clean the restored firmware memory to the PoC. isp_restore_fw_memory() copies the data segment and heap back through MEMREMAP_WB mappings, and clears the host-backed main memory, before each firmware start. That only works if the ISP snoops the CPU caches. What it wrote is now cleaned to the point of coherency before the coprocessor starts.

2. The T8132 address filter comes from the loader. The DAPF window table and the 1:1 firmware MMIO window table in isp-drv.c were copied from one J713's ADT. The driver now reads the windows from apple,dapf-ranges, which aura fills from this machine's ADT (aurora-silicon/aura#309) and U-Boot carries over (aurora-silicon/u-boot#52). The MMIO windows are made from them: the 16 KiB pages that contain them, sorted and merged. The binding gains the property, as the ANE's already has.

Merge order: aura#309 and u-boot#52 go first. Without apple,dapf-ranges, the T8132 camera is refused with an error saying so: the firmware could not start again after its first power-down.

Not changed: the IMX958 presets in the J713 DT. The ADT doesn't describe sensor modes, and configuration 5 is a choice (on the J715, configuration 6 needs distortion correction the driver doesn't do). The DSID clear bases also stay in the driver for now.

Tested

  • KUnit (--kunitconfig=drivers/media/platform/apple/isp, arm64): 50/50. That includes new tests deriving the MMIO windows from the J713's windows and merging shared or adjacent pages.
  • W=1 clean, checkpatch --strict clean, dt_binding_check clean. A J713 DTB with the property validates, and a malformed one doesn't.
  • J713, one-shot trial boot of aura#309 + u-boot#52 under linux-aurora 7.3.0-1-40, with this driver loaded as a module: 13 windows from that boot's ADT in the DT, and NV12 1080p and 720p streamed 6 × 60/60 frames. The ISP and its DARTs were runtime-suspended between streams. Without the property, the driver refuses as intended.

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

With fw_restore, the driver puts the firmware's data segment and heap
back from their copies, and clears the host-backed main memory above
the data, before every firmware start. It writes them through cacheable
mappings and relies on the ISP snooping the CPU caches.

Clean what it wrote to the point of coherency before the coprocessor
starts, so that the firmware finds the restored memory also where it
does not snoop.

Signed-off-by: Erik Bourget <erik@ebourget.net>
The T8132 ISP loses its DART's address filter whenever it powers down,
so the driver programs the filter again before each firmware start. The
windows come from the hardware description the bootloader reads, as
the firmware carveouts do. Describe them on the ISP: inclusive start and
end pairs, in record order, as on the ANE.

Signed-off-by: Erik Bourget <erik@ebourget.net>
The T8132 address filter windows and the MMIO windows mapped 1:1 for
the firmware were tables copied from one J713's ADT. Take the filter
windows from apple,dapf-ranges, which the bootloader fills from this
machine's ADT, and make the MMIO windows from them: the 16 KiB pages
that contain the filter windows, sorted and merged.

Without apple,dapf-ranges the firmware cannot run again after its first
power-down, so the camera is not used, with an error saying why.

Signed-off-by: Erik Bourget <erik@ebourget.net>
The bootloader now also copies the ISP DART's address filter windows
into apple,dapf-ranges. Say so where the T8132 ISP handoff is
described.

Signed-off-by: Erik Bourget <erik@ebourget.net>
@DjDeveloperr
DjDeveloperr merged commit 6ae9c3c into aurora-silicon:integration/aurora Nov 19, 2026
2 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.

2 participants