Repository navigation
media: apple: ave: run the 6070 firmware on the M1 Pro and M2 (boot + lifecycle) - #1387
Merged
Merged
Conversation
Three things kept the M2 encoder firmware from starting:
- The loader writes the DATA address into one TEXT cell (+0x423c on
T8112) that is zero in the firmware image, so the live TEXT CRC never
matched the image CRC and probe refused the build. Hash TEXT with
that cell as the image has it, and refuse any other value in it.
- VCBAR reads back decoded (the code base with bit 0 set), so the
read == written check always failed with -EIO before RUN. macOS writes
it once and treats the first hello as the confirmation; do the same.
- Clear the SVE idle word in the mailbox before RUN, and restore DATA
from the boot snapshot before the first start as well.
With these the T8112 probes ("6070.11.1 (lifecycle only): TEXT
25bfd039") and reaches RUN; the firmware does not say hello yet, so
the encoder stays disabled in the device tree.
Assisted-by: LLM
Signed-off-by: Ryan Murray <[email protected]>
The M2 ADT gives the encoder the same two auxiliary banks as the M1 Pro: a PMGR page that the host maps for the 6070 firmware and hands over at Config, and the PIO window. The driver refuses to start the firmware without the first one. Describe both like t6000-peripherals does and let the binding accept them on T8112. The node stays disabled. Assisted-by: LLM Signed-off-by: Ryan Murray <[email protected]>
The M1 Pro loader fills TEXT +0x423c with the DATA address too: the live TEXT CRC is e689935f, and with that cell as zero it is 460c7a7c, the H13S image CRC. Normalise it on T6000 as on T8112. Assisted-by: LLM Signed-off-by: Ryan Murray <[email protected]>
The pre-M4 encoder firmware is mapped from DART address 0, TEXT first and DATA right after it, and VCBAR carries only its flags. The TEXT link cell holds the firmware's own alias of DATA, whose low 32 bits are DATA's DART address. Check the cell that way, and refuse a handoff that puts the firmware anywhere else: the M1 Pro's 32-bit AVE DART rejects the alias addresses outright. Assisted-by: LLM Signed-off-by: Ryan Murray <[email protected]>
The 6070.11.1 firmware numbers the M1 Pro encoder as device 14, type 11. 11 and 9 are the numbers of the later firmware generation. The firmware reads the device number from scratch 2 at boot and looks it up after the first handshake, so a wrong number cannot block the hello but selects the wrong device row afterwards. Assisted-by: LLM Co-Authored-By: Claude Opus 5.5 <[email protected]>
On the M1 Pro the 6070 firmware is preloaded by the bootloader, which also sets the coprocessor code base (+0x50000). The driver wrote that register before every start. The write does not change what the register reads back, but it breaks the boot: the core retires its reset stub and builds its boot page tables, then stops before its first device access, and the hello never comes. Measured on the M1 Pro with one change per start: no write gets the hello within 10 ms; a write of 0x0102000000000000, or of the value the register already holds, gets no hello. So do not write it at all. The bootloader value is the code base the firmware needs. The encoded-form fields of the two 6070 variants are now unused, so drop them and their test. Assisted-by: LLM Signed-off-by: Ryan Murray <[email protected]>
The T6000 6070 firmware says hello with {7, 0x9bc0, 0x100, 0xc0000}:
the last word is the size of a heap it wants from the host, as the 9003
firmware does. The driver required 0 there and gave up on the first
real hello from the M1 Pro.
Accept a heap request of up to 4 MiB on 6070 too, allocate it and hand
it over in the handshake block, with the layout 9003 already uses.
Assisted-by: LLM
Signed-off-by: Ryan Murray <[email protected]>
The T6000 6070 firmware publishes seven channels. The driver took the sixth descriptor, SHAREDMALLOC (8 slots), for its reply ring and then found no IO_T2H where it expected it, so the start-up stopped with -EPROTO right after the hello. Replies come on IO_T2H, the seventh descriptor (32 slots, the same doorbell as SHAREDMALLOC). Read the channels by name: IO and IO_T2H as before, and on 6070 also - SHAREDMALLOC, on which the firmware borrows shared memory from the host. A request without an address asks for a block of the given size; the host answers with the block's address and size. A request with an address returns that block; the host answers with the address and a size of zero. The blocks come from a part of the IPC window kept for this (3 MiB past the command buffers), handed out in 4 KiB units. The firmware asks for two 64 KiB blocks right after the channel hand-over, so the wait for the ready word serves the ring as well. - TERMINAL, the firmware's log. A line is read once the firmware has cleared bit 0 of its slot, the slot is handed back by setting it again, and lines in the IPC window go to the debug log. Rings may not overlap. The KUnit channel test now uses the descriptor table the firmware publishes and checks that the old reading is refused; a new test plays the firmware side of SHAREDMALLOC. Assisted-by: LLM Signed-off-by: Ryan Murray <[email protected]>
On the M2 iBoot points the encoder's code base at the AVE DART's vm-base (0x800000000), and the firmware addresses its DATA there too, so the firmware has to be mapped from vm-base, not from DART address zero as on the M1 Pro. Accept a handoff whose TEXT starts a 4 GiB-aligned DART window with DATA right after it, and compare only the low 32 bits of the TEXT link cell with DATA's DART address. Assisted-by: LLM Signed-off-by: Ryan Murray <[email protected]>
The 6070.11.1 firmware numbers the M2 encoder as device 18, type 15; 15 and 13 are the numbers of the later firmware generation. As on T6000, a wrong number does not block the hello: the firmware reads the device number from scratch 2 at boot and looks it up after the first handshake. On the M2 the start-up stopped there, after the hello. Assisted-by: LLM Signed-off-by: Ryan Murray <[email protected]>
The firmware start-up has three waits after the hello: the IPC window, the handshake block and the channel hand-over. All three ended in the same -ETIMEDOUT. Name the step that timed out. Assisted-by: LLM Signed-off-by: Ryan Murray <[email protected]>
…are rings The 6070 firmware publishes three host-to-firmware rings: IO, DEBUG and BUF_H2T. The driver handed only the IO slots to the host. The others stayed zero, and a zero slot reads to the firmware as a message posted to it. On the M1 Pro and M2 the firmware sent its last handshake message and then never took the ready word. Set the host ownership bit in every slot of every host-to-firmware ring, the ones the host does not use too. Assisted-by: LLM Signed-off-by: Ryan Murray <[email protected]>
This was referenced Nov 9, 2026
Closed
This was referenced Nov 10, 2026
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.
Brings the AVE encoder firmware (6070.11.1) up on the M1 Pro (T6000 ave0) and M2 (T8112): boot, channel hand-over and the Config/Open/Close/Halt lifecycle. Encoding stays disabled for 6070 (
encode_readyfalse); the AVE nodes stay disabled in the DTs.Tests
🤖 Generated with Claude Code