Repository navigation
soc: apple: start and stop the T8140 MTP without a live handoff - #1764
RyanTheTide wants to merge 3 commits into
Conversation
The MTP's CPU and the SRAM its firmware runs from sit on the always-on die, and the device tree describes neither. In the ADT's PMGR devices table they are MTP_CPU (+0xc028) and MTP_SRAM (+0xc048). MTP_SRAM has MTP_CPU as a parent, so the CPU's power state has to stay as it is. An RTKit firmware that stopped for a sleep starts again only from its reset vector, and the run bit alone doesn't reset the CPU. Add apple_sleep_aon_cpu_reset() for rtkit-helper. It sets DEV_DISABLE, waits for BUSY to clear, pulses RESET and then clears both, as the PMGR driver's device reset does, and logs the words. It refuses unless both words target on, since the PMGR's own idling can lower the actual states. Signed-off-by: Diljit Singh <[email protected]>
U-Boot no longer hands the T8140 MTP over running. It stops the firmware with an RTKit sleep before the OS and publishes nothing, and a firmware stopped that way starts again only from its reset vector. For apple,t8140-mtp without a live handoff: - reset the CPU with apple_sleep_aon_cpu_reset() before the run bit and RTKit's wake. An image iBoot loaded and nobody started boots cold after the reset too. With no reset available it starts as before, which only brings up a never-started image. - stop it on remove with an RTKit sleep instead of QUIESCED, so a module reload can start it again. One that doesn't answer is left running. - free the DMA buffers given to the firmware when RTKit drops them after an answered sleep. Other helpers still keep theirs. - refuse hibernation, as for an adopted session, since the image can't recreate the firmware's DMA. The AP idle and AP on notices around a sleep don't change. A session from an older U-Boot (apple,rtkit-handoff) is still adopted, and other SoCs' helpers don't change. Signed-off-by: Diljit Singh <[email protected]>
Whether a helper can be restarted, and where the reset words of its CPU and firmware SRAM are, was decided by the apple,t8140-mtp compatible and a table keyed by the ASC's physical address. Another SoC with the same arrangement would need a new compatible check and a new table row. Describe it on the coprocessor node instead: apple,aon-pmgr points at the always-on PMGR, apple,aon-cpu-word and apple,aon-sram-word give the words of the CPU and of the SRAM holding its firmware, and apple,aon-power-words lists the whole power chain, parents first. apple_sleep_aon_cpu_reset() reads the words through the PMGR's syscon regmap, and a helper is restartable when its node has apple,aon-cpu-word. The reset sequence itself is unchanged. The T8140 MTP node gets the words the table had (MTP_CPU +0xc028, MTP_SRAM +0xc048) and its power chain, and pmgr_mini grows to 0x10000 to cover them. Nodes without the properties keep the quiesce path. Signed-off-by: Ryan <[email protected]>
commented
Nov 21, 2026
|
Blockers: 3.
HW row: J700 on the rebased head with u-boot#37: cold boot, MTP keyboard/trackpad input, Assisted-by: LLM (Claude:Opus 5.5) |
commented
Nov 22, 2026
|
Closing: the in-place MTP restart was not shown to work on the Neo, and production boots keep the live handoff; it can come back with the U-Boot change and a restart row. |
commented
Nov 22, 2026
|
Reopened and kept as a draft; the comment above lists what it still needs before review. |
commented
Nov 23, 2026
|
FYI from KUnit coverage work: #2941 adds an |
Carries two of Diljit Singh's T8140 commits unchanged (author, date and message kept). They let Linux start the Neo's MTP itself and stop it again, for a U-Boot that stops the MTP with an RTKit sleep before the OS instead of handing over a running session (aurora-silicon/u-boot#37).
soc: apple: t8140-sleep: reset the MTP's CPU in placeaddsapple_sleep_aon_cpu_reset(). The original targetedt8140-sleep.c, so the function now sits indrivers/soc/apple/sleep.cand reads the sharedapple_sleepstate. Nothing else changed.soc: apple: rtkit-helper: start and stop the T8140 MTP itself: forapple,t8140-mtpwithout a live handoff, the helper resets the CPU before the run bit and stops the MTP with an RTKit sleep on remove. It frees the DMA buffers the firmware dropped and refuses hibernation. Hunks were rebased onto the current helper (inventory handoff, PM notifier). The diff matches the original.A session handed over as
mtp-live-v1is still adopted, as current U-Boot does, so production Neos take the same path as before. Other SoCs' helpers are unchanged.Testing
Authored by Diljit Singh (@DjDeveloperr).
A third commit,
soc: apple: describe an always-on coprocessor CPU in the device tree, replaces the T8140 address table and theapple,t8140-mtpcheck with device tree properties on the MTP node (apple,aon-pmgr,apple,aon-power-words,apple,aon-cpu-word,apple,aon-sram-word) and their binding, so a helper is restartable when its node hasapple,aon-cpu-word; it builds with -fsyntax-only -Werror, the binding passes dt-doc-validate and t8140-j700.dtb compiles with no new dtc warnings.