Skip to content

arm64: dts: apple: t8132-apcie-port2: keep pcie0 sleep tunable register banks - #4007

Merged
DjDeveloperr merged 2 commits into
aurora-silicon:mainfrom
espentrydal:fix/t8132-apcie-port2-sleep-tunables
Dec 3, 2026
Merged

DjDeveloperr merged 2 commits into
aurora-silicon:mainfrom
espentrydal:fix/t8132-apcie-port2-sleep-tunables

Conversation

@espentrydal

Copy link
Copy Markdown
Contributor

What: Preserve the five sleep tunable register windows (axi2af, cio3pll, clkgen, phy-block, phy-ip) in &pcie0's reg and reg-names override in arch/arm64/boot/dts/apple/t8132-apcie-port2.dtsi.

t8132.dtsi defines those five windows on pcie0, but t8132-apcie-port2.dtsi overwrote reg and reg-names with only config, rc, port0, phy0, port2, phy2. On boards that include t8132-apcie-port2.dtsi (J604 and J773g), this strips those register banks and causes apple-sleep to log no PCIe tunables for ANS: suspend-to-RAM with it stopped will be refused. Related to #3629 and #1962.

Tested:

  • At PR head 3dbff5005e6 (base 53732c475cb):
    • scripts/checkpatch.pl --strict: 0 errors, 0 warnings, 0 checks.
    • make LLVM=1 ARCH=arm64 apple/t8132-j604.dtb apple/t8132-j713.dtb apple/t8132-j773g.dtb: 0 errors, 0 warnings.
  • Hardware (MacBook Pro 14" M4, apple,j604 / apple,t8132, OS/system fw 26.6.2, mBoot-18000.161.10, aura 1.0.0b18, Arch Linux ARM, 7.3.0-j604-dev+ carrying this commit): eliminated apple-sleep: no PCIe tunables for ANS and verified firmware suspend-to-RAM (deep) across both a short wake test and a 10.5-hour overnight deep sleep (boot object resumes 0 -> 1, NVMe/GPU/display/Wi-Fi/SEP all recovered cleanly), kernel taint 8196, 0 failed units, 0 new kernel errors.

Risk: two-way door · M4 (t8132) boards including t8132-apcie-port2.dtsi (J604, J773g). Restores the exact five windows already declared on pcie0 in t8132.dtsi.

Not yet: Standalone boot at this exact single-commit head 3dbff5005e6 and hardware verification on J773g.

…er banks

t8132-apcie-port2.dtsi overrides &pcie0's reg and reg-names to add
port2 and phy2, but omitted the five sleep tunable register banks
(axi2af, cio3pll, clkgen, phy-block, phy-ip) defined in t8132.dtsi.

On boards that include t8132-apcie-port2.dtsi (J604 and J773g), this
strips those register windows from pcie0 and causes apple-sleep to
refuse deep sleep with "no PCIe tunables for ANS: suspend-to-RAM with
it stopped will be refused".

Preserve axi2af, cio3pll, clkgen, phy-block, and phy-ip in &pcie0's
reg and reg-names.

Signed-off-by: Espen Trydal <espen@trydal.io>
@espentrydal
espentrydal requested review from a team as code owners December 2, 2026 22:21
@github-actions github-actions Bot added area:bringup Area from CODEOWNERS (bot) blast:m4 Macs affected, from Merge risk (bot) door:two-way Revertible or not, from Merge risk (bot) needs-review No approving review from Core or Omarchy Mac yet (bot) labels Dec 2, 2026
@github-actions

github-actions Bot commented Dec 2, 2026 •

Copy link
Copy Markdown

Merge readiness at c77edcca: not ready yet

Check Detail
CI at head ok 5 checks passed
Review ok approved by RyanTheTide
Requested changes ok none
Hardware row at head no no line with the head SHA c77edcca, a Mac and a result in the PR body or a comment
Conflicts ok none
PR text ok Risk: two-way · M4 (t8132) boards including t8132-apcie-port2.dtsi (J604, J773g). Restores the exact five windows already declared on pcie0 in t8132.dtsi.

Areas: area:bringup

Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels.

The T8132 pcie0 binding takes either the five shared windows or the third
port, so a board that lists both, as the J604, the J773g and the iMacs now
do, fails dtbs_check on reg and reg-names. Allow the shared windows after
the third port's.

Signed-off-by: DjDeveloperr <hey@djdev.me>

@DjDeveloperr DjDeveloperr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I pushed c77edccad388 on top of your 3dbff5005e62 (binding only, no rewrite), so someone else has to approve this head. The DT change itself is right. It must not land before a J773g deep-sleep row.

Binding, fixed: at 3dbff500, dt-validate fails on the J604, J773g, J623 and J624: reg ... is too long and reg-names: 'oneOf' conditional failed. apple,pcie.yaml allowed either the five shared windows or port 2, not both. With c77edcca, all six T8132 boards validate the same as main.

Addresses: the five windows match t8132.dtsi and entries 2 to 6 of /arm-io/apcie reg in the J604 and J773g device trees of the public 26.6.2 IPSW: 0x497000000/0x40000, 0x497040000/0x20000, 0x496000000/0x1000000, 0x495046200/0x4000 and 0x495044000/0x4000.

What it changes, per board:

  • J604, J623, J624: nothing yet. Their sleep controller is off on main, and nothing else reads these windows. The Risk line should name the iMacs, since t8132-desktop.dtsi includes this file.
  • J773g: a lot. #2763 enabled its sleep controller, so deep is already its default on main. Every deep suspend is refused at the last check (refused: no tunables to bring ANS's PCIe block back) and the Mac stays up. aura already publishes the tables there, so the missing windows are the only reason for that refusal. With this PR alone, every default suspend becomes a real deep sleep. ANS is stopped, and the APCIe block goes off with Wi-Fi (port 0) and Ethernet (port 2) behind it.
  • The earlier J773g passes (#2763, #3629) ran with #2770 for port 2, which was stacked on #2762. Both are closed. On main as it is now, the generic reinit in pcie-apple.c has to bring the two ports back, and I found no J773g row for that.

With #3629 (2c2788a9): alone, #3629 makes s2idle the J773g default, with ANS as the only part named as missing. With both, nothing is missing any more, so deep is the J773g default again and ANS is stopped in each sleep. J623 and J624 stay on s2idle (no CLKREQ#).

Order: #3629 first, with its own J773g row taken without this PR. Then this PR, after the row below. This is #2762 again, which I closed on 12-02 to wait for the multi-port deep sleep (it also had the binding change).

Checked on the merge with main b902937859ec: all six DTBs build, the J713 and J715 DTBs are unchanged, dt-validate matches main, checkpatch --strict is clean on both commits, and the full host tests pass on the series merged together (1028/1028).

Still owed at c77edcca, on top of #3629: J773g: boot shows deep sleep is the default and no deep sleep: or no PCIe tunables for ANS line. Then 3 deep sleeps by RTC (resumes 0 to 3, 0 failed). After each wake: NVMe read and write, end0 at 1000/full, Wi-Fi carrier, SEP hwrng, no SError or new warning. Last, one s2idle cycle. J604: one boot at this head, then one deep sleep chosen by hand with #3629, #4008 and #4009.

@aurora-silicon-review aurora-silicon-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: MERGE at c77edcc
Checked: I rebuilt the six affected and control T8132 DTBs. J604, J773g, J623 and J624 retain matching reg/name pairs for port 2 and all five shared windows. J713 and J715 retain the nine-window form. The shared addresses and lengths match the T8132 common node. The previous binding rejects the four port-2 name lists and register lengths. The current binding accepts them and passes dt-doc-validate. Hosted DT checks and host tests passed at this head.

The #3629 prerequisite is merged. The author reports J604 deep sleep on the earlier DT revision. The J773g classification and hardware check remain with merge readiness.

@DjDeveloperr

Copy link
Copy Markdown
Contributor

Schema validation at exact head c77edccad38852032d62f9d0b2b542c1d3f515f4:

  • make ARCH=arm64 DT_SCHEMA_FILES=Documentation/devicetree/bindings/pci/apple,pcie.yaml dt_binding_check (with dtschema + yamllint): PASS (CHKDT, LINT, STYLE, DTEX, DTC [C] apple,pcie.example.dtb — 0 warnings, 0 errors).
  • make ARCH=arm64 DT_SCHEMA_FILES=Documentation/devicetree/bindings/pci/apple,pcie.yaml CHECK_DTBS=y across all six T8132 boards (apple/t8132-j773g.dtb, t8132-j604.dtb, t8132-j713.dtb, t8132-j715.dtb, t8132-j623.dtb, t8132-j624.dtb): PASS (0 warnings, 0 errors).

J773g committed deep x3 row will follow once the T8132 deep-sleep wake investigation on ship1 finishes.

@RyanTheTide RyanTheTide left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The port-2 override retains all five shared windows in the same name order as the common controller. The exact binding and rebuilt DTBs passed schema validation. The J604 deep-sleep result came from an earlier integrated kernel, and the exact hardware row remains pending.

@github-actions github-actions Bot removed the needs-review No approving review from Core or Omarchy Mac yet (bot) label Dec 3, 2026
@DjDeveloperr

DjDeveloperr commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

J773g (Apple M4 Mac mini, Mac16,10, T8132, G16G B0, os-fw 27.2 / 26B123) committed deep x3 row on 7.3.0-j773g-ship1 #3 (Image b46c1c9933d001d8…, DTB 0bf95ef5430f53d8…, boot_id=cd32b8bc-004e-4a1b-b5fa-5d8464b07b4a, default s2idle [deep], pm_test=none): PASS (3/3).

Exact commits / DTB provenance on this boot (single J773g generation):

  • aurora-silicon/linux#4176 @ 40959794ea75b7b3e62fc84954e7237978f6ee37 (PCI: apple: set the T8132 ports up again after a deep sleep — J773g row only; shared T8132 reset table, J713 deep still owed)
  • aurora-silicon/linux#4007 @ c77edccad38852032d62f9d0b2b542c1d3f515f4 (t8132-apcie-port2: keep pcie0 sleep tunable register banks)
  • aurora-silicon/linux#3882 @ 491e031bb6808aa5d1568f71cf16c32cc15cfb22 (merged as 0c4c91bb7cc3)
  • aurora-silicon/linux#4031 @ 2fdae383ffa704b568a2c2302e995807538e7bb4 (merged as 9f672f0d9c85)
  • Correction on aurora-silicon/linux#4164: the booted boot3 DTB (0bf95ef5430f53d8…) was built from the earlier revision that included clkreq-gpios on pci@0,0, NOT 5a30f0960eab (which omitted clkreq-gpios). #4164 has since been updated to 0bc1cc98c029 to include clkreq-gpios on pci@0,0; an exact-head J773g DTB row at #4164 0bc1cc98c029 is queued next.

Verified results:

  • Committed deep sleep (3/3): suspend_stats/success=3, fail=0, last_failed_errno=0, boot_id unchanged across all 3 cycles (RTCWAKE rc=0 x3, apple-sleep: back from sleep, boot object resumes 0 -> 1 -> 2 -> 3, 302600000.gpu stop reported 1; physical sleep completed, 135 of 224 AP pins changed by the sleep, all put back, 0 SError / Call trace / BUG / Oops / WARNING).
  • PCIe & DART recovery (PCI: apple: set the T8132 ports up again after a deep sleep (J773g wake reset) #4176, arm64: dts: apple: t8132-apcie-port2: keep pcie0 sleep tunable register banks #4007): Boot logged pcie-apple 1cb0000000.pcie: T8132 multi-port deep sleep recovery registered. Every wake restored both DARTs and links in order: 490000000.iommu: restored after its host came back -> port 0: link restored after deep sleep; 492000000.iommu: restored after its host came back -> port 2: link restored after deep sleep. LnkSta unchanged pre-sleep = post-wake-1 = post-wake-3 (00:00.0 5GT/s x1, 00:02.0 2.5GT/s x1). Config space readable post-3 wakes (01:00.0 443414e4, 01:00.1 5f7214e4, 02:00.0 168214e4); end0 (tg3) returned 1000 Mbps full duplex after all 3 wakes. DT properties under /soc/pcie@1cb0000000: pci@0,0 has apple,tunable-{port,rc,rc-gen3,rc-gen4}, clkreq-gpios, reset-gpios; pci@2,0 has reset-gpios. (Note: brcmfmac/hci_bcm4377 returned -ENOENT at boot for absent firmware blobs on this rootfs, pre-sleep.)
  • External displays & PMC (arm64: dts: apple: t8132-j773g: wire display-power for deep sleep #4164 earlier rev, arm64: dts: apple: t8132: connect the external display pipes' PMC enables on every M4 Mac #4031): Both external DCPs (286e00000.dcp, 48ae00000.dcp) bound with 0 no apple,display-power warnings, returned RTKit: sleep return: ASC control 0x0, setting RUN across all 3 wakes, and restored card1-DP-3: status=connected enabled=enabled (3840x2160@60). Both pmc-dispext0-interface and pmc-dispext1-interface remained on in pm_genpd_summary after all 3 wakes (resume_early ran 3x, 0 errors).
  • GPU & CLPC (soc: apple: clpc: enable on-time idle sampling on T8132 #3882): aurora-g16 returned in 7653 / 9117 / 3879 us back to limit=S10. Post-wake-3 gpubench-vk passed (compute.light d=4 40.11 us, compute.uber d=4 486.40 us, crc=9963f56c valid=true); /sys/kernel/debug/aurora-g16/stats: health: failed 0 errno 0 degraded 0, jobs 43565 recoveries 0 hang_kills 0, sensor_errors 0; 0 CLPC errors in dmesg.
  • Type-C VDM routes: m5 (1-0a 0x731d3115) and neo (1-0c 0x73213102) both active post-wake-3.

@DjDeveloperr
DjDeveloperr merged commit f7e3388 into aurora-silicon:main Dec 3, 2026
6 checks passed
@DjDeveloperr

Copy link
Copy Markdown
Contributor

Merging at c77edccad388. Checked today on main 0c502a281195 (has #4176, #4181 and #4164):

Not covered here: J604 at this exact head (your 10.5 h deep run was at 3dbff5005e6, and the J604 has not run the merged result of #4176).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:bringup Area from CODEOWNERS (bot) blast:m4 Macs affected, from Merge risk (bot) door:two-way Revertible or not, from Merge risk (bot) needs-hw-row No hardware row at the PR head (bot)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants