Repository navigation
soc: apple: sleep: cover T6021 (M2 Max) in the T6020 profile and enable it on J414c - #4360
Conversation
T6021 (M2 Max) has T6020's sleep registers and one more PMGR power-word block, which holds the words of the hardware the Max adds: its third and fourth external display and the bridges of two more IOAs. Add its compatible, with T6020's as the fallback, and the block as a sixteenth range, "ps-south". Signed-off-by: Muness Castle <931+muness@users.noreply.github.com>
T6021 is T6020's die-0 layout with more of the same blocks. When the sleep controller's node names the Max's power-word block, "ps-south", the commit also covers what macOS 13.5 does at its sleep entry on J414c: - the second display's complex goes down with the others; - memory controllers 4 to 7 take the memory side's writes to the fourth, and their error enables are off over the commit; - the error enables of IOAs 4 and 5 are cleared while their bridges are powered; - the third and fourth external display's system, front-end and CPU words are lowered, and five words are written zero. The wake puts all of them back. A dry run reads the new power words and reports them with the rest. Nothing changes for a node without "ps-south". Signed-off-by: Muness Castle <931+muness@users.noreply.github.com>
T6020's ranges and the Max's own power-word block. t6020.dtsi includes this file and describes its own node over it, so T6020 boards keep theirs unchanged. Disabled until a board enables it with its wake sources. Signed-off-by: Muness Castle <931+muness@users.noreply.github.com>
With the wake sources the board sleeps and wakes with: AOP, NUB (the PMU's RTC alarm), SMC, ATC and MTP. Signed-off-by: Muness Castle <931+muness@users.noreply.github.com>
|
Merge readiness at
Areas: Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels. |
There was a problem hiding this comment.
Verdict: REQUEST_CHANGES at 56c609a
Failure: A T6021 sleep node with a present ps-south range falls back to the T6020 sequence when that range cannot be mapped. I replayed the exact mapping helper and profile selection from sleep-t6020.h. A short named resource returned -EINVAL, and an injected mapping failure for the correctly sized resource returned -ENOMEM. Both selected four memory controllers and five cluster entries instead of failing the probe. t6020_sleep_map_regs() discards the error at lines 609–614 and continues. The real J414c DTB with a shortened ps-south range still passes the binding check, so the schema cannot catch the malformed-range case.
Please preserve the existing T6020 path when the range is absent and propagate the mapping error when a described ps-south fails. This prevents offering the T6020 commit sequence on an incompletely mapped T6021.
Checked: The binding document and submitted J414c, J416c and J414s DTBs passed the targeted schema checks. J414c has the 16 named resources and wake list, J416c stays disabled, and the T6020 J414s sleep resources and wake list match base. No local hardware run.
A node that names ps-south and has it too short, or whose mapping fails, was taken for a T6020: four memory controllers, five cluster words, none of the Max's steps. So was a T6021 node that doesn't name it at all. Only a node that neither names ps-south nor is a T6021's takes T6020's sequence. One that should have the block and can't have it mapped fails the probe with the mapping's error. Signed-off-by: Muness Castle <931+muness@users.noreply.github.com>
|
Fixed in ce0a693. • A node that neither names ps-south nor is a T6021's takes T6020's sequence, as before. The Max's other mappings in t6020_sleep_map_regs() (the extra memory controllers, the two IOAs, the zeroed words) already returned their error. Checked: t6020_map() and the selection block taken verbatim from the new source and run against stubs, five cases, results in the PR body. checkpatch --strict clean. Hardware row: ce0a693 on J414c (MacBook Pro 14", M2 Max, T6021), firmware 13.5: dry run passes on the T6021 path, deep sleep and wake pass. Run as 775e64f, which is this head with the two 13.5 stops and the step-notes commit on top; of the files this PR changes only sleep-t6020.h differs there, by the notes. |
There was a problem hiding this comment.
Verdict: MERGE at ce0a693
Checked: Replayed the mapping helper and profile selection with GCC and Clang. A missing T6021 ps-south or a short named resource returns EINVAL, and a failed mapping returns ENOMEM. A legacy T6020 node still selects four controllers and five clusters. A successful ps-south mapping selects eight controllers and six clusters. The DTS and binding are unchanged from the previously checked revision.
DjDeveloperr
left a comment
There was a problem hiding this comment.
Reviewed the T6021 south-bank correction at ce0a6933b667. The original T6020 setup keeps its existing loop bounds with no named south bank. T6021 rejects the missing bank, and a declared bank propagates the short range or mapping failure before the Max setup proceeds. I compiled the exact admission block with GCC and Clang and passed six cases with each, covering both successful profiles, a missing T6021 bank, short and unmappable banks, and capability selection by the named bank.
The updated J414c dry-run and deep-wake receipt covers the T6021 side. The T6020 shared-profile boot/wake control is the remaining hardware row.
What: The T6020 (M2 Pro) deep-sleep profile now covers T6021 (M2 Max), and the J414c gets its sleep controller.
Refs #3336 (the T602x suspend-to-RAM tracking issue, where
sleep.cwas settled as the way it lands). Builds on #3999 (the T6020 profile) and #4200; the wake side is aurora-silicon/aura#663.A T6021 node is a T6020 node with one more power-word block,
ps-south. When the node has it, the commit also does what macOS 13.5 does on the Max and the wake undoes it:Without
ps-southevery loop bound and table is what it was, so a T6020 node runs the same sequence as before. The J414c node is enabled with J414s's wake-source list and withoutapple,sleep-tested: deep sleep on it stays opt-in and stops before the commit unless that is asked for too.Tested: J414c (MacBook Pro 14", M2 Max, T6021), firmware 13.5, Hyprland desktop, undocked. Aura main (
2cf23900, which has aurora-silicon/aura#663) plus a test commit noting the wake's steps.Main does not idle this machine's GPU for a firmware sleep on 13.5 (
genpd_prepare returns -16), and its internal display coprocessor does not come back from the commit's cold halt on 13.5. So the sleeps below ran on this branch's head with those two stops carried on top, from JJRPF's work and this machine's daily kernel, plus a test commit that turns the profile's PMU step notes on:wip/t6021-s2r-test-stack-4. Nothing else was added.Hardware row:
ce0a6933b667on J414c (MacBook Pro 14", M2 Max, T6021), firmware 13.5: dry run passes on the T6021 path, deep sleep and wake pass. Run as775e64f4db4b, which is this head with the two 13.5 stops and the step-notes commit on top; of the files this PR changes onlysleep-t6020.hdiffers there, by the notes. The commit before it,56c609a8f91e, ran the rows below the same way (as615c43b0753c).apple_sleep.deep=1, no commit)cs42l84PLL lock errorNo driver reported a failure after any wake. Before #3999 merged, the same four commits on its earlier heads went through ten more deep sleeps on this machine, including one switched to each of: no AIC mask between the commit words, IRQ/FIQ mode 0 on the boot core, PCIe endpoints left bound.
The profile selection, with
t6020_map()and theps-southblock taken verbatim from the source and run against stubs:ps-south, not a T6021'sps-southnamed and mappedps-southnamed, too shortps-southnamed, mapping failsapple,t6021-sleepwithoutps-southAlso: arm64 build with
LLVM=1;checkpatch --strictclean on each commit;dt_binding_checkonapple,t6020-sleep.yamlandCHECK_DTBSont6021-j414c,t6021-j416candt6020-j414sclean.Risk: two-way.
ps-southtakes the old bounds and skips every new step; this was not run on T6020 hardware.status = "disabled"; nothing changes until a board enables it.Not yet:
apple,sleep-testedon J414c. It needs a sleep that works on main alone: either a 13.5 path for the G14 GPU and the display coprocessors, or the Max on firmware 27.2, where neither stop is needed. The 27.2 GPU hand-off covers T6020 only so far.apple-sioreportsfirmware did not come back from runtime suspend: -62each time DisplayPort audio asks for it, and unplugging the dock froze the session. None of it is in this profile's path.PS prores: resync after sleep failed: -5,17 words back (3 left), and a key or lid wake sometimes reported asATC0.USBWakeup.