Repository navigation
soc: apple: sleep: T6030: GP PCIe wake from the loader's ADT tables - #4234
RyanTheTide wants to merge 2 commits into
Conversation
The ADT's /arm-io/apcie reg[2] (0x59e004000, 0xc000) is the window the loader's apple,tunable-phy records are relative to. The DT so far only named the phy-common and phy-shared parts of it. Add it to pcie0 as "phy-block", as other Apple PCIe hosts already do, so the T6030 sleep driver can apply that table after a deep sleep. pcie-apple maps its windows by index and doesn't use the new one. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
The T6030 wake replayed about 450 register writes of the GP PCIe AXI bridge, CIO3 PLL, clock generator, PHY, PHY PLL and lanes that were captured from a macOS wake. Those are the values the ADT holds in /arm-io/apcie's apcie-*-tunables, the same tables aura applies when it brings the block up at boot. On every other Apple PCIe block Linux gets them from the loader as apple,tunable-* properties. Do the same on T6030: read apple,tunable-axi2af, -cio3pll, -clkgen, -phy, -phy-ip-pll and -phy-ip-auspma from the PCIe host and apply them during the existing wake steps, writing only registers whose value differs, like macOS does. The sequence around them (clock generator start, PHY clock requests, reset, run enables, ready, root complex) is the same as T6040's in apple_sleep_raise_apcie(). Only the PHY reset and up bits differ (7 and 9). When the loader didn't publish all six tables, apple_sleep_undescribed() keeps s2idle the default and T6030 refuses deep sleep, as it does for ANS without its tunables. Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
|
J615 no-regression row (T8122, 27.2) at 9835b8d, booted with its own J615 DTB through aura-try (production aura b18, Stage 2 unchanged). The only shared change here is a T6030-only flag in sleep.c.
Still owed: the J516s row (aura#665 + this head, |
|
J516s row kit for this head is sealed; the M3 lead runs it.
|
|
Hardware verification on MacBook Pro 16-inch (M3 Pro, J516s, T6030, OS firmware 27.2) covering paired Stack
Result: PASS (all hardware & equivalence criteria met;
|
|
Merge readiness at
Areas: Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels. |
Problem: #4067 brought T6030 (M3 Pro, J516s) deep sleep with a GP PCIe wake that replays about 450 register writes captured from a macOS wake:
sleep-t6030-pcie-wake.hand the constants int6030_gp_clocks_wake(). They are the AXI bridge, CIO3 PLL, clock generator, PHY, PHY PLL and lane tables that the ADT holds in/arm-io/apcieand aura applies at boot. Ryan's rule: nothing hard-coded; values come from the ADT, as M1/M2 and M4/M5 already do (the loader copies the ADT tables intoapple,tunable-*properties and the driver applies them).Change:
arm64: dts: apple: t6030: add the ADT reg[2] window (0x59e004000, 0xc000) to pcie0 asphy-block, the windowapple,tunable-phyis relative to. The binding now allows 19 entries for T6030. pcie-apple maps by index and doesn't use the new window.soc: apple: sleep: T6030: readapple,tunable-axi2af/-cio3pll/-clkgen/-phy/-phy-ip-pll/-phy-ip-auspmafrom the PCIe host and apply them during the existing wake steps. Like macOS, a register is only written when its value differs. The steps around the tables are the same as T6040'sapple_sleep_raise_apcie(): clock generator start, PHY clock requests, reset release, run enables, ready, phy-common enable, PHY up, root complex ready. Only the PHY reset and up bits differ (7 and 9).sleep-t6030-pcie-wake.his deleted. The power-word steps, PERST# handling and timings measured on our own Macs are unchanged.apple_sleep_undescribed()keeps s2idle the default andt6030_sleep_begin()refuses deep sleep: the same refusal model as ANS without its tunables.Needs aurora-silicon/aura#665, which publishes the tables. Merge order: aura#665, then the J516s runs it, then this PR. On an older aura the J516s loses deep sleep (refused; s2idle stays).
Tested: J615 (T8122) at 9835b8d, no regression: deep sleep stays the default, 2/2 deep cycles, Wi-Fi back (comment below). No J516s yet. W=1 build of
drivers/soc/apple/is clean (no new warnings). CHECK_DTBS withapple,pcie.yamlis clean on t6030-j514s and t6030-j516s; the same check without the binding change flags the 19-entry reg. dt_binding_check passes. The J516s ADT values are not posted anywhere.Risk: Two-way (plain revert). J516s (T6030) deep sleep only. J514s gets the DT window only; its sleep node stays disabled.
Still to run:
deep sleep is the default, nono GP PCIe tunableswarning.gp_equiv.pybelow must print EQUIVALENT (counts only). Then 2-3 committed deep sleeps with Wi-Fi, SD and Bluetooth back and no WARNING/SError.Prior art and offset match
pcie_init_controller()appliesapcie-axi2af/-common/-phy/-phy-ip-pll/-phy-ip-auspma-tunablesfrom the ADT at boot and re-runs it after a sleep. T6040/T8140: auradt_set_t6040_sleep_apcie()publishes the same six tables plus windows, andapple_sleep_map_apcie()/apple_sleep_raise_apcie()apply them. T8142:dt_set_t8142_sleep_apcie(). Post-M4 ANS:pcie_apcie_tables_fdt()./arm-io/apcie. The offsets the J516s capture touched match them: all 13 axi2af offsets and all 7 cio3pll offsets exactly. The clkgen write is its single record's masked bits, followed by START go and OFF2 clear (the T6040 sequence). The phy table's 0x800c/0x8010 are the capture's phy-shared +0xc/+0x10 reads. The PHY-IP writes run the PLL table first, then the per-lane AUSPMA tables, in table order. The capture's 7 remaining phy writes are the sequence steps above.gp_equiv.py: check the published tables against the old capture (J516s, counts only)
Self-check: tables built from the capture's own writes give EQUIVALENT; flipping one bit in one lane record gives DIFFERENT.