Repository navigation
nvme: apple: start a post-M4 ANS that a boot stage powered off - #1808
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 <noreply@anthropic.com> Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
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 <noreply@anthropic.com> Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
RyanTheTide: nvme: apple: start a post-M4 ANS that a boot stage powered off
…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 <nekreshen@yandex.ru>
|
Early note on this draft (no full review yet):
Assisted-by: LLM (Claude:Opus 5.5) |
|
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. |
|
Reopened and kept as a draft; the comment above lists what it still needs before review. |
|
Draft sweep 12-05: still parked. Blocker: no boot stage writes |
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).