Repository navigation
Conversation
Stage 1 1.0.0b8 (installer Alpha 19) passes a T8132 ANS on running (nvme.adopt), with no SART entries. An ESP Stage 2 that boots an embedded payload such as U-Boot never initialises NVMe, so its nvme_shutdown() returns at once and the payload gets that live session. kboot_prepare_dt() then writes no apple,sart-entries, and a U-Boot that only starts a post-M4 ANS from off (aurora-silicon/u-boot aurora-silicon#38 with aurora-silicon#40) refuses it: no NVMe, so no ESP and no boot. On T8132, when this stage hasn't used NVMe and no earlier stage passed SART entries, call nvme_init() before nvme_shutdown(). nvme_init() already takes an older stage's session over (power off, start from off), so nvme_shutdown() then powers ANS off and kboot_prepare_dt() passes the entries on. If nvme_init() fails, payload_run() fails as it does for the other handoff errors. Linux payloads (boot=) still get a running ANS. Other SoCs are unchanged: T6050 now adopts a session passed on running (aurora-silicon#159), and powering one off late failed there. Assisted-by: LLM Signed-off-by: Sean Dolbec <sdolbec1@gmail.com>
test_m3_defaults_optout.py builds the real payload_run() on the host with the hardware calls stubbed. payload_run() now calls nvme_post_m4_untouched() and nvme_init() on T8132 before nvme_shutdown(), and the harness had no stubs for them, so every test in the file failed to compile with -Werror. Stub both. nvme_post_m4_untouched() returns false, so the harness keeps its old NVMe path and the tests check the boot-args handoff as before. Assisted-by: LLM
Contributor
Author
|
CI note for 88c3fd3, which stubs
|
Contributor
Author
|
Closing. |
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.
Draft: one comparison test is still pending. A Stage 1 from 1.0.0b10 or later already powers ANS off and passes
nvme.sart=, so with it this change shouldn't be needed. That boot (current Stage 1, Stage 2 without this change, same U-Boot) hasn't been run on the J773g yet. Until it has, I can't say whether this is needed beyond Stage 1 1.0.0b8 installs.On T8132 (M4), an ESP Stage 2 that boots its embedded U-Boot can hand ANS over still running, with no
apple,sart-entries, when Stage 1 predates the post-M4 power-off. A U-Boot with aurora-silicon/u-boot#38 and #40 only starts a post-M4 ANS from off, so it gets no NVMe. This change makes Stage 2 take that session over and power it off first. On a J773g (Mac mini M4) it was the missing piece for a native boot with no proxy: Stage 1, ESP Stage 2, U-Boot, shim, GRUB, then Linux with its root on NVMe.What happens today. Stage 1 1.0.0b8 (installer Alpha 19) hands ANS over still running (
nvme.adopt), with no SART entries:An ESP Stage 2 that boots its embedded U-Boot never initialises NVMe.
payload_run()callsnvme_shutdown()before kboot'spcie_init(), but it returns at once because this stage never rannvme_init().nvme_sart_entries()then has no session of its own and nonvme.sart=entries, so it reads the live SART and reports ANS as running, andkboot_prepare_dt()writes noapple,sart-entries. U-Boot with #40 refuses a running session that an earlier stage set up. On the J773g, natively, that U-Boot left no breadcrumb on the ESP and nothing came up.With ANS powered off first. Through the proxy, a b10 instance ran
nvme_init()andnvme_shutdown()itself and then booted the same U-Boot:U-Boot then wrote its first breadcrumb to the ESP (
M4 U-Boot alive: NVMe scan and ESP FAT write reached).The change. In
payload_run(), before a payload other thanboot=Linux on T8132: if this stage hasn't used NVMe and no earlier stage passed SART entries (nvme_post_m4_untouched()), callnvme_init()first.nvme_init()already takes an older stage's live session over, as in the log above.nvme_shutdown()then powers ANS off with its entries kept, andkboot_prepare_dt()passes them on. Ifnvme_init()fails,payload_run()fails as it does for the other handoff errors. A Stage 1 that already powers ANS off and passesnvme.sart=doesn't trigger it, andboot=is unchanged. For this one case it departs from #107's rule that a stage which doesn't use NVMe leaves ANS as it got it.It is limited to T8132 because that is the only post-M4 SoC we can test. On T6050, #159 now adopts such a running session instead, and its commit message says that powering such a session off late failed there. If you'd rather cover every post-M4 SoC, the check is easy to widen.
Compatibility. For T8132 with an older Stage 1 and a Stage 2 carrying this change, the rows of the table on u-boot#38 change as follows:
So this belongs in the same pin set as u-boot#38, and shouldn't ship in a Stage 2 that a distribution pairs with an adopt-only U-Boot.
Tested on one J773g (Mac16,10, OS firmware 26.6.2, system firmware 27.0), natively. First, three boots with an earlier form of this change:
iBoot → Stage 1 1.0.0b8 → ESP Stage 2 → U-Boot → shim → GRUB → Linux.
e1ef8b63with one local J773g commit (keepusb startat boot), kboot: name the product without its release date #38 at93f108a0, Release aura 1.0.0b2 #40 at0ac2fb76and TEST-ONLY breadcrumb commands.13f96a13is main atfb8e368cplus the four J773g commits of kboot: T8132 USB3 calibration, AOP handoff and absent-ISP rule by ADT property #113.nvme scan, and one after loadingEFI/BOOT/BOOTAA64.EFI(shim) from the ESP, just beforebootefi.efi: EFI v2.11 by Das U-Bootand mounted its btrfs root from NVMe. Its GPU driver reachedREADYand DRM initialised.Then, stacked with the J773g commits: runs 52–57 and 59 (run 58 was a CPU bring-up test I'm not counting here) used a Stage 2 built from aura
7df619d9, which is #113 (an earlier rebase), the J773g HDMI DCP mappings commit (separate PR) and this commit with the same patch-id as here, with the same U-Boot. Each booted natively through U-Boot to Linux (a TEST ONLY kernel based on aurora-silicon/linux#1192) with its root on NVMe, the GPU ready and HDMI up.Not tested:
main. It builds as an ESP Stage 2 (CHAINLOADING=1 ESP_STAGE2=1, Clang) and passesmake format-checkwith clang-format 20.1.8. The same commit ran in runs 52–57 and 59, on top of kboot: T8132 USB3 calibration, AOP handoff and absent-ISP rule by ADT property #113 and an oldermain(c583339d, which already had nvme: T6050: adopt a live session an earlier stage passed on #159); the eight non-merge commits merged tomainsince then didn't run with it. The first three boots used an earlier form whose helper made the same test asnvme_post_m4_untouched()under an earlier name, without the extrachip_id == T8132check inpayload_run(); on this SoC that makes no difference.nvme_init()would take over iBoot's session.Related: u-boot#38 and #40 (this needs them), #107 and #144 (the post-M4 power-off this relies on, in main since #144), #113 (the J773g support the tested image carried).