Repository navigation
kboot: hand the J713 ISP firmware over to the kernel - #84
Merged
Merged
Conversation
iBoot loads the camera firmware outside the kernel's memory, at addresses that move with the boot firmware. The J713 device tree therefore describes the ISP and its DARTs disabled, with empty isp-firmware-text and isp-firmware-data placeholders and an isp-heap window for the firmware's main memory. Fill the placeholders from this boot's ADT isp segment-ranges: reserve each segment by physical address, and map it where the firmware runs it, from the base of the heap window. Then set apple,platform-id from the ADT isp node's sensor-type and enable the ISP and its DARTs. The segments must be the firmware's __TEXT and __DATA, 16K aligned and inside DRAM, with TEXT at the base of the heap window and DATA right above it. Otherwise the tree is left as it was, the camera stays disabled and the boot goes on. A tree whose ISP is already enabled reserves its own firmware and is left alone. Signed-off-by: Erik Bourget <erik@ebourget.net>
This was referenced Nov 6, 2026
The CI runners have no dtc, so the test failed there with FileNotFoundError. Skip it when dtc is missing, as the T6041 display handoff test does. Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com> Assisted-by: LLM
Merged
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.
On the M4 MacBook Air (J713, T8132), iBoot loads the camera (ISP) firmware outside the kernel's memory, at addresses that move with the boot firmware. The J713 camera series (aurora-silicon/linux#531) used to reserve them at fixed addresses in the DT. Now its DT describes the ISP and its DARTs disabled, with empty
isp-firmware-text/isp-firmware-dataplaceholders and theisp-heapwindow, and leaves this boot's values to the boot loader.Change
dt_set_j713_isp()runs right afterdt_set_isp(). It acts only on J713, and only on a disabledapple,t8132-ispthat has the placeholders:segment-ranges(__TEXT;__DATA) and fills each placeholder:regat the segment's physical address,no-map,status = "okay", andiommu-addresseswhere the firmware runs the segment (itsremap), set throughdt_device_set_reserved_mem().apple,platform-idcomes from the ADT isp node'ssensor-type.memory-region-namestext/data/heap pointing at the three nodes, empty (or zero) placeholders, an ISP-owned heap window at 0x100_0000_0000 of at most 64 MiB, and three DARTs.sensor-type.Depends on
Tests
New
tests/python/test_j713_isp_handoff.py. It builds the real kboot code against libfdt, with the J713 DT fragment and a fake ADT that carries this J713'ssegment-ranges, and checks that:sensor-typeor a zero one, DATA not right above TEXT, TEXT below DRAM, DRAM smaller than a segment, DATA past the heap top, overlapping segments, a heap window elsewhere, a non-empty placeholder, wrongmemory-region-names, and an unaligned segment;Removing the contiguity check or the transaction makes it fail.
Host suite (
tests/python), x86_64 Linux: 579 passed, 17 skipped.Builds:
USE_CLANG=1is clean;make ARCH=aarch64-linux-gnu- CHAINLOADING=1 EXTRA_CFLAGS='-Wstack-usage=2048 -Os'shows only the existing warnings.clang-format: the change is clean.
make format-checkalso fails on main here, onsrc/utils.hwith clang-format 23.1.4.Hardware
On a J713 with this commit on its boot loader, the U-Boot import and #531's DT:
developed and tested by Claude (Anthropic), working with me on the J713