Repository navigation
nvme: apple: start a post-M4 ANS that a boot stage powered off - #1808
Draft
RyanTheTide wants to merge 2 commits into
Draft
RyanTheTide wants to merge 2 commits into
RyanTheTide wants to merge 2 commits into
Conversation
A boot stage that powers a post-M4 coprocessor off loses its SART entries with the power, while the firmware keeps the buffers they cover. The stage passes the entries on, and the next owner has to write them back before the run bit. Add apple_sart_restore_entry(). It writes one entry, reads it back, and marks it protected like an entry the boot loader left, so Linux never clears it and apple_sart_is_inherited_region() covers it. Assisted-by: LLM Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Ryan Murray <[email protected]>
aura idles a post-M4 ANS when it is done with it, powers it and its PCIe block off, and passes the SART entries on in apple,sart-entries (three 64-bit cells per entry: index << 8 | flags, address, size). U-Boot starts ANS from that state. Linux could only adopt a running session, so every stage before it had to hand ANS over live. When the probe finds ANS stopped and apple,sart-entries present, the first reset work now starts it from off: reset ANS if its CPU isn't in its reset state or its boot status survived the power cycle, write the entries back, and start the firmware as after a power loss (no INIT, the endpoint map's last part masked to endpoint 0x20, no endpoint started again). The controller is then set up as on any start. A firmware that doesn't answer gets one more reset and start. Without the property nothing changes: a running session is adopted and iBoot's session gets its handshake as before. Assisted-by: LLM Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Ryan Murray <[email protected]>
This was referenced Nov 13, 2026
Closed
m0d16l14n1
added a commit
to m0d16l14n1/linux
that referenced
this pull request
Nov 15, 2026
RyanTheTide: nvme: apple: start a post-M4 ANS that a boot stage powered off
m0d16l14n1
added a commit
to m0d16l14n1/linux
that referenced
this pull request
Nov 15, 2026
…merges aurora-silicon#1941 brought a second copy of struct dcp_s2r_layout (this tree had it from the J815 sleep work); aurora-silicon#1808 names nvme's sleep_traced, which this tree calls sleep_coproc (with sleep_untested, from the aurora-silicon#1477 rework). Assisted-by: Claude Opus 5.5 Signed-off-by: Nick <[email protected]>
Contributor
Author
|
Early note on this draft (no full review yet):
Assisted-by: LLM (Claude:Opus 5.5) |
Contributor
Author
|
Closing for now: no boot stage powers ANS off before Linux yet, so this path can't run; it can come back with that stage and a hardware row. |
Contributor
Author
|
Reopened and kept as a draft; the comment above lists what it still needs before review. |
This branch has not been deployed
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.
Lets Linux start a post-M4 ANS (M4, M4 Pro/Max, T8140, T8142, T6050) that the previous boot stage idled and powered off. Until now it could only adopt a running session, so every stage before Linux had to hand ANS over live.
The contract
aura already does this between its own stages, and U-Boot reads the same property (aurora-silicon/u-boot#48): when a stage is done with a post-M4 ANS it shuts the controller down, idles the firmware, powers ANS and its PCIe block off, and writes the SART entries the firmware's buffers need on the ANS
nvmenode:What changes
soc: apple: sart:apple_sart_restore_entry()writes an entry back, reads it back and protects it like a boot loader's entry.nvme: apple: when the probe finds ANS stopped (RUN clear) and the property present, the first reset work starts it from off:0xde71ce55, the CPU was only stopped since it last ran, so ANS is reset through its PMGR reset first.apple_rtkit_power_cycled_return()): no INIT, HELLO from the firmware, the endpoint map's last part masked to endpoint 0x20, no endpoint started again, IOP then AP power on.Without the property nothing changes: a running session is still adopted, and iBoot's session still gets its handshake. No boot stage writes the property for Linux yet (aura's
boot=path still leaves ANS running), so this path stays unused until the stage before Linux powers ANS off.Tested
defconfig+asahi.configwithNVME_APPLE,APPLE_SARTandWERROR,W=1:sart.oandapple.obuild with no warnings. checkpatch--strict: nothing but the trailer form.boot=, then the T8140 when it's available, and an M1 Pro/M2 regression boot (pre-M4 doesn't take this path).