Repository navigation
media: apple: isp: Power the T8140 ISP down between streams - #1580
Merged
Merged
Conversation
…segments The two camera sensor power domains follow the ISP CVM domain, as on T8132. The boot loader lists the firmware text and data segments it loaded after the heap region, so allow up to three memory regions. Assisted-by: LLM Signed-off-by: Ryan Murray <[email protected]>
…domains The first ISP DART has its address filter registers at +0x10000, as on T8132; the ISP driver programs them after each power-up. ISPSENS0 and ISPSENS1 power the camera sensor and belong to the ISP: list them with its other domains so they are on only while the ISP is. Assisted-by: LLM Signed-off-by: Ryan Murray <[email protected]>
T8140 runs the coprocessor and firmware interface that T8132 runs, and its firmware starts again the same way: from its data segment as loaded, after the coprocessor was quiesced before the power-down, with STOP and POWER_DOWN instead of SUSPEND. Until now T8140 kept its firmware resident, so the ISP domains stayed on from boot to shutdown, also when no application used the camera. Use T8132's model on T8140: start the firmware at the first stream, stop it and power the ISP down after the camera is no longer used, and put the data segment back before each start. The bootloader also provides the firmware's heap memory on T8140; keep a copy of it and put it back too. The first ISP DART loses its address filter with the ISP system domain, so program the windows the bootloader set after each power-up. A firmware start costs about 430 ms before the first frame. Keep the firmware up for 2 s after a stream, so that an application that stops and starts the stream again, or opens the camera again soon, gets its first frame as fast as before; stop it at once for system sleep, hibernation, shutdown and unbind. The bootloader lists the firmware segments without names. Where no region is named "data", take the one that ends where the heap starts. A device tree without the address filter registers or the data segment keeps the firmware resident, as before. Assisted-by: LLM Signed-off-by: Ryan Murray <[email protected]>
DjDeveloperr
added a commit
that referenced
this pull request
Nov 12, 2026
Nine conflicts: - media: apple: isp: T8140 keeps this series' firmware model, the one the sleep stack was validated with: resident, stopped with each stream and started again from its own memory, run bit kept for the DRAM-kept wake. #1580's T8132-style model (quiesce, data and heap restore, ISP driver DAPF writes, 2 s idle) stays available to other chips; T8140 doesn't select it. Suspend stops resident firmware and flushes idling firmware; probe sets up both work items. - arm64: dts: apple: t8140: the ISP's sensor domains stay after FE, as this series has them, not appended a second time; the first ISP DART keeps its tunables and address filter ranges. The binding and its example list them once, and accept #1580's firmware segment regions. - dt-bindings: mailbox: both new entries, the secure RTBuddy proxy and the later AOP setup-port mailboxes. - dmaengine: apple-admac: a resume whose registers were lost restarts from the last reclaimed period; otherwise integration's capture realign, otherwise a plain restart. - soc: apple: aop: every configuration has both the sleep and wake endpoint orders and the setup-port EPMAP fields; T8152 and T8142 take the endpoint order, as the other chips do. - drm/asahi: both g17/sleep.o and g17/pmpdash.o, and both the warm restart and the log buffer hand-over. Integration's new T8142 GPU configuration takes this series' sleep_restart as false, as every SoC but T8140 does. Signed-off-by: Diljit Singh <[email protected]>
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.
T8140 kept its ISP firmware resident, so the ISP domains stayed on from boot to shutdown even when nothing used the camera. Its firmware turns out to start again the way T8132's does (quiesce the coprocessor, STOP + POWER_DOWN, restore the data segment), so this switches T8140 to the T8132 model and powers the ISP down between streams.
Changes:
dapfat +0x10000, as on T8132). ISPSENS0/1 join the ISP's power domains, so they are on only while the firmware runs.fw_restore+deferred_startwith the coprocessor status/quiesce registers. The DART address filter windows are programmed after each power-up, because the DART sits in the ISP system domain. The bootloader-provided heap is copied at probe and restored along with the data segment. When no region is nameddata, the driver takes the one that ends where the heap starts, which is how the bootloader lists the segments today.system_unbound_wqbecause the stop path flushes the driver's own workqueue.dapfregisters or a data segment keeps the firmware resident, as before. The kernel can therefore land before the Stage 2 DTB update.Tested on J700 (Neo). The test kernel was fleet65 (716670b) plus these commits. The Stage 2 trial image was the live one with only its DTB swapped for the one from this branch.
Total system power at idle moved by less than the boot-to-boot spread (4.2-4.4 W on either side), so only the ISP rails are listed. Frame statistics match the resident driver (Y mean 16.8 vs 16.9 in a dark room). Booting the same kernel with the old DTB logs the resident fallback, and its rows match fleet64.
Build gates on the buildbox: ISP KUnit 39/39 (arm64 QEMU), host tests 224/224, W=1 clean for the changed files (the two remaining warnings come from isp-ipc.c, which this doesn't touch), checkpatch --strict clean, dt_binding_check clean for apple,t8140-isp and apple,dart, CHECK_DTBS on the T8140/T8142 DTBs reports the same warnings as the base.
🤖 Generated with Claude Code