Repository navigation
Conversation
…k back On every post-M4 Mac ANS runs on an APCIe block whose power an OS cycles in a deep sleep. Linux's deep sleep brings that block back by itself, and the ten tables it needs are only in the ADT. Copy them from the APCIe controller ANS is on (/arm-io/apcie, else /arm-io/apcie0) and its pci-bridge0 to the DT, each as <offset mask value> records relative to its window: - apcie-axi2af-tunables to apple,tunable-axi2af (reg[4], "axi2af") - apcie-phy-tunables to apple,tunable-phy (reg[2], "phy-block") - apcie-phy-ip-pll-tunables and apcie-phy-ip-auspma-tunables to apple,tunable-phy-ip-pll and -phy-ip-auspma (reg[3], "phy-ip") - apcie-cio3pllcore-tunables to apple,tunable-cio3pll (reg[5], "cio3pll") - apcie-pcieclkgen-tunables to apple,tunable-clkgen (reg[6], "clkgen") - the bridge's apcie-config-tunables to apple,tunable-port (reg[7], "port0") - the bridge's pcie-rc-tunables, pcie-rc-gen3-shadow-tunables and pcie-rc-gen4-shadow-tunables to apple,tunable-rc, -rc-gen3 and -rc-gen4 (reg[0], "config") The host's go on the DT PCIe host whose "rc" window is the controller's reg[1], and the bridge's on its pci@0,0. These are the names Linux's T8140 deep sleep reads. The J700, J713, J773g, J773s and J616c ADTs all carry the ten under these names. The J604 dump on macOS 27.0 has none, and gets none published. Every record must be 32 bits wide, aligned and inside its window, or no table is published. Each table goes in with one fdt_setprop(), and if one fails the ones already added are removed, so it is all ten or none. Adding to the host moves its port, so the port is looked up again for each table and for the rollback. A failure only logs. On a Mac whose ANS isn't the post-M4 kind (no nvme-secure-bar) nothing is published. On the Neo's live ADT (J700, September dumps) all ten pass: 274 records, 3.2 KiB of DT. Two host-model tests compile pcie_fdt.c and kboot_boot() with their own stubs, so they get stubs for the new code. Signed-off-by: Diljit Singh <hey@djdev.me>
prepare_dt() packs the device tree on every chip but T8140, so by the
time kboot_boot() publishes the APCIe tables there is no room left and
the J713 boots without them ("APCIe tables not published; deep sleep
stays refused"). Reopen the tree's spare capacity around the
publisher, as dt_disable_j713_pcie() already does, and pack it again.
Assisted-by: LLM
33d5068 to
c92637c
Compare
2224af0 to
5e7406f
Compare
|
Thanks for tracking this down on the J713. #112 was merged in a later revision, and its last commit, 5e7406f ("pcie: publish APCIe tables as a DT transaction"), fixes the same problem in a different way. If a J713 on current main (v1.0.0b11 or later) still prints |
|
Confirmed on the J713. With 1.0.0b11 as a one-boot |
Stacked on #112: this PR's base is that PR's branch.
On every chip but T8140,
prepare_dt()packs the device tree, so whenkboot_boot()later callspcie_apcie_tables_fdt()there is no room left and the tables aren't published. A J713 boots withkboot: APCIe tables not published; deep sleep stays refused. This reopens the tree's spare capacity around the publisher, asdt_disable_j713_pcie()already does, and packs it again.T8140 is unchanged: its tree is still unpacked at that point and is packed afterwards. On a chip whose ANS isn't behind APCIe the publisher returns at once, so there this only reopens and repacks the tree.
Tested on a J713 (MacBook Air M4), Linux at EL2, with this commit on 1.0.0b9 + #117 + #112, and a kernel device tree that no longer carries its own copy of the tables (aurora-silicon/linux#1314):
Not tested on any other chip. On this branch the J713 Stage 2 builds, and
test_smp_handoff_gate.pyandtest_m4_pcie_power_fdt.pypass.🤖 Generated with Claude Code