Repository navigation
soc: apple: rtkit-helper: start a parked T8140 MTP from its pristine image - #1813
RyanTheTide wants to merge 1 commit into
Conversation
…image The T8140 MTP keeps its firmware in SRAM, and a run changes the firmware's data there. A CPU reset in place starts it from its reset vector with that data dirty, and it never reads INIT. So a boot loader that used the MTP had to hand the running session over. A boot loader can instead park it: save the SRAM image before the firmware's first run, and at exit stop it and hold its CPU in reset and disabled. It passes the image's address and size in apple,sram-image and its CRC-32 in apple,sram-image-crc32. When those are present, write the image back before the run bit: check that the CPU is held, keep every word of the MTP's power chain in the always-on PMGR fully on with automatic power management off (the SRAM has two parents, the SCM fabric and the CPU), check the image's CRC, copy it into the firmware SRAM and read it back, then take the CPU out of reset and enable it. The firmware then starts as one nobody ran, with INIT, HELLO and its endpoints, and gets new buffers. The T8140 tree gets the firmware SRAM as reg "firmware" and its power chain as apple,aon-pmgr, apple,aon-power-words and apple,aon-cpu-word; pmgr_mini grows to cover those words. Without apple,sram-image nothing changes. Assisted-by: LLM Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Ryan Murray <[email protected]>
|
Blockers: 4.
There is also no producer yet. Link the U-Boot change, and keep this a draft until it exists and the row below has run. HW row: J700 with the parking U-Boot, on the head rebased onto #1764. Pass criteria: cold boot gives keyboard and trackpad input with the "image written back" line; Assisted-by: LLM (Claude:Opus 5.5) |
|
Closing for now: there is no boot loader that parks the MTP with a saved image yet, and a second start would fail; it can come back with that U-Boot change and a J700 row. |
|
Reopened and kept as a draft; the comment above lists what it still needs before review. |
|
Closing for now: there is no boot loader that parks the MTP with a saved image yet, and a second start would fail; it can come back with that U-Boot change and a J700 row. |
Stacked on #1764.
The T8140 MTP keeps its firmware in SRAM, and a run changes the firmware's data there. #1764 resets the CPU in place before the run bit, but a firmware that already ran then starts with dirty data and never reads INIT (
endpoint discovery failed: -62). So a boot loader that used the MTP for its own keyboard has had to hand the running session over (mtp-live-v1).This lets the boot loader park the MTP instead, and lets Linux start it as a firmware nobody ran.
The contract
The boot loader:
What Linux does with it
Before the run bit,
apple_rtkit_helper_restore():The firmware then gets the usual INIT, HELLO and endpoint start, with new buffers. Without
apple,sram-imagenothing changes: the CPU reset in place from #1764, or adoption of a live session.Device tree
The T8140
mtpnode gets the firmware SRAM asreg-names = "firmware"(1 MiB at0x314c00000) and its power chain asapple,aon-pmgr,apple,aon-power-words(parents first) andapple,aon-cpu-word.pmgr_minigrows to 0x10000 to cover those words. Binding updates will follow once the sequence is proven on hardware.Tested
rtkit-helper.o(W=1) andt8140-j700.dtbbuild. The only dtc warnings are ones the tree already had. checkpatch--strict: nothing but the trailer form.This should be rebased onto #1764's new third commit, which already adds the
apple,aon-*properties, their binding and the largerpmgr_miniwindow.