Skip to content

arm64: dts: apple: t6040-j614s: deep sleep, wired as on the J616s - #4158

Draft
DjDeveloperr wants to merge 1 commit into
mainfrom
feat/t6040-j614s-deep-sleep
Draft

DjDeveloperr wants to merge 1 commit into
mainfrom
feat/t6040-j614s-deep-sleep

Conversation

@DjDeveloperr

Copy link
Copy Markdown
Contributor

What: Deep sleep on the 14-inch M4 Pro MacBook Pro (J614s). Its tree gets the J616s wiring the T6040 sleep needs: the APCIE power states held on, the DCP's sleep-host stop and display power, the sleep controller, the SMC wake type and the VDD_CIO request (apple,sleep-pmvc).
Tested: Build only. cpp + dtc of all twelve M4 boards at main f5bf8bf8a2 and at the head: the J616s, J773s and all other DTBs are byte-identical, only the J614s changes. checkpatch --strict clean. The public 27.2 restore trees of the J614s and J616s differ only in the model names and the Wi-Fi module-instance, so the sleep, PCIe, display and SMC nodes are the same hardware.
Risk: two-way · J614s (M4 Pro 14") only. Deep sleep becomes its default sleep state. A sleep that fails ends in a watchdog reset, so the first run needs saved work and a way back. A plain revert undoes it.
Not yet: the J614s row at this head: boot (deep sleep is the default), s2idle x1, rtcwake -d rtc1 -m mem -s 20 x3 with no USB4 partner, then x3 with one; after each: panel, HDMI/USB-C display, Wi-Fi, Bluetooth, SD, NVMe, keyboard, trackpad, 0 new kernel errors. If the first deep sleep resets, the pmVC value macOS writes on a J614s is the missing measurement.

Details

#2215 enabled the sleep on the J616s only. A J614s test on that PR enabled the controller, apple,sleep-wake-type and the two DCP properties, and the Mac reset in its first deep sleep (row). That test left out two things the J616s tree has:

  • apple,sleep-pmvc = <0x101>. Without it the commit does not write pmVC, and the J614s boots with pmVC 0 (read). Every M4 Pro/Max laptop tree that has the property (J616s, J614c, J616c) uses 0x101.
  • ps_apcie_phy_sw held on and pcie0's power domains. The J614s leaves that state disabled, while the sleep's commit clock-gates it and the wake raises it.

The J616s blocks move to t604x-j614-j616.dtsi, which only these two boards include. Tracked in #4155.

The T6040 sleep driver and its windows are in t6040.dtsi, but only the
J616s enables it. The two 14- and 16-inch M4 Pro MacBook Pros share their
PCIe, display and sleep wiring, so move the J616s parts to the shared tree:
the APCIE power states held on, the DCP's sleep-host stop and display
power, and the sleep controller. The J614s also gets the SMC's wake type
and the VDD_CIO request that the J616s, J614c and J616c use.

An earlier J614s test of the controller alone reset the Mac in its first
deep sleep. It had neither the VDD_CIO request nor the APCIE_PHY_SW state
described here.

The J616s device tree is byte-identical.

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

philmes commented Dec 3, 2026

Copy link
Copy Markdown

Hardware test report + three findings from a J614s running the equivalent DTB wiring on linux-aurora 7.3.0.aurora1-51 (662680a4) + aura Stage 2 1.0.0b19.

Hardware / Firmware:

  • MacBook Pro 14" M4 Pro (Mac16,8, apple,j614s, Board-ID: 0x4, Chip-ID: 0x6040)
  • 14-core CPU (4E + 5P0 + 5P1), 20-core GPU (10+10, max power 67037 mW)
  • OS FW 26.6.2 (mBoot-18000.161.10), System FW 27.2 (mBoot-20457.41.3)
  • Stock kernel cmdline, no USB4 partner or external display attached

1. Core wiring validated (apple,sleep-pmvc = <0x101> works on J614s):
Using the same &smc (apple,sleep-wake-type, apple,sleep-pmvc = <0x101>), &ps_apcie_{gp,sys_gp,phy_sw}, &pcie0, &t6040_sleep, and &dcp (apple,sleep-host-stop, apple,display-power = <&dcp_power>) changes — plus the two items in #3 below:

  • Boot: apple-sleep 502888000.sleep-controller: deep sleep is the default: boot object resumes 0, /sys/power/mem_sleep = s2idle [deep], macsmc logged pmVC 0x0 at boot; the sleep commit writes 0x101.
  • 9/9 real deep-sleep cycles across 2 boots, 0 failures (suspend_stats/fail == 0):
    • 15 s timed wake (rtcwake -d /dev/rtc1 -m mem -s 15): Timekeeping suspended for 15.582 seconds, boot object resumes 0 -> 1, 14 cores up in ~17 ms, 184/197 AP pins restored, power words: 0 written back, 0 not on in time, 598 ms device resume.
    • 5 consecutive 10 s rtcwake stress cycles (boot object resumes 2 -> 7, 10.1–10.4 s each, 567–598 ms device resume).
    • 17 min 36 s lid-close deep sleep on battery (Timekeeping suspended for 1056.393 seconds in one continuous interval, boot object resumes 7 -> 8, lid-open wake in 564 ms, 100% -> 100%, charge_now settled 6076 -> 6064 mAh).
    • Default systemctl suspend on stock cmdline after reboot (boot object resumes 0 -> 1, suspend_stats: success=1 fail=0).
  • Post-wake health: internal mini-LED panel + backlight + GPU session, keyboard, trackpad, Touch ID (apple_sep: verify: enclave matched identity), Wi-Fi (brcmfmac, link retrained, wlan0 UP), Bluetooth (hci0), NVMe (nvme0n1), GL9755 SD reader (02:00.0, link retrained), speakers (speakerguardd-v2 active, audio playback confirmed), 0 failed units, 0 new err-level kernel lines.
  • Not yet tested here: USB4 partner attached, external USB-C display, or HDMI.

2. Important warning for dcpext2-variant J614s units (see #1581):
Dumping this unit's live ADT (/dev/mtd2ro) showed that this J614s actually has live dcpext0 (0x3a2e00000, pre-loaded=1, running=1) + dcpext1 (0x602e00000) and NO dcpext2 (DISPEXT2_* are NO_PS=0x10), which is why t6040.dtsi's stock &dcp_power (ext1, ext0, main) worked cleanly here.

Earlier in testing, when we overrode &dcp_power chain@1 from ext0 to ext2 (assuming all J614s matched t6040-j614s-extdisp-hdmi.dtsi), dcp_t6041_word_try() skipped real DISPEXT0 and left iBoot's running dcpext0 up across DISP_EXT power-down — causing an immediate hardware reset within seconds (exact same symptom @petrskuta saw in #2215). On a dcpext1 + dcpext2 J614s unit (where dcpext2 is the live second block instead of dcpext0), #4158's stock &dcp_power (ext1, ext0, main) may hit the mirror reset unless dcp_power also covers ext2 / matches the boot ADT's active dcpext* blocks. (Full ADT details posted in #1581.)

3. Two small omissions vs J616s / #2371:

Deep-sleep kernel log excerpt (15 s rtcwake)
[  362.428026] PM: suspend entry (deep)
[  362.790407] apple-dcp 602e00000.dcp: T6041 S2R: down by the host stop, own suspend skipped
[  362.791871] apple-dcp 402e00000.dcp: T6041 S2R: down by the host stop, own suspend skipped
[  362.792732] PM: suspend of devices complete after 308.643 msecs
[  362.895307] apple-sleep 502888000.sleep-controller: 0 coprocessors up and stopped
[  362.895307] apple-sleep 502888000.sleep-controller: 184 of 197 AP pins changed by the sleep, all put back
[  362.895307] apple-sleep 502888000.sleep-controller: wake: PMC display interfaces BWR 0x0 boost 0x0, put back to 0x0 0x7
[  362.913255] apple-sleep 502888000.sleep-controller: back from sleep, boot object resumes 0 -> 1
[  362.913261] apple-sleep 502888000.sleep-controller: PMGR: all words on at the commit were on at the wake
[  362.913265] apple-sleep 502888000.sleep-controller: AON PMGR: all words on at the commit were on at the wake
[  362.913267] apple-sleep 502888000.sleep-controller: power words: 0 written back, 0 not on in time
[  362.915964] macsmc 50c600000.smc: wake record: MBSE 0x10650, MBSW 00 00 00 00 00 00 00 00
[  363.161441] pcie-apple 1cb0000000.pcie: S2R: /pcie@1cb0000000/pci@0,0 link back before its functions resume
[  363.161454] pcie-apple 1cb0000000.pcie: S2R: /pcie@1cb0000000/pci@1,0 link back before its functions resume
[  363.771302] PM: resume of devices complete after 598.188 msecs
[  363.795418] PM: suspend exit

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants