Repository navigation
rtc/spmi/dts: t600x PMU RTC wake alarm - #1312
Merged
Merged
Conversation
The controller numbers its peripheral interrupts first and puts the RX
FIFO notification right after them. On t8103, t8112 and t8140 that is
256 peripheral interrupts with the notification at 256, which the
driver hard-codes. The M1 Pro, Max and Ultra (t6000) controller has 192
peripheral interrupts and raises the notification as interrupt 192, as
the firmware device tree for the nub SPMI bus lists it.
With the nub SPMI controller described as an interrupt controller, the
driver unmasked bit 256 and waited for a completion that never came,
so every transfer on an M1 Pro timed out ("failed to wait for RX FIFO
not empty") and the SMC RTC, the reboot nvmem cells and the PMU RTC all
failed to read.
Add the interrupt count to the per-SoC data, use it for the
notification index, the mask/ack ranges and the domain bounds, and
match apple,t6000-spmi with a 192-interrupt layout. Other SoCs keep 256.
Signed-off-by: Ryan Murray <[email protected]>
Assisted-by: LLM
Make the nub SPMI controller an interrupt controller and add the Maverick PMU RTC under the PMIC, so rtcwake can wake M1 Pro, Max and Ultra systems from s2idle. The PMU raises SPMI interrupt 2 for the alarm. Keep rtc0 on the SMC clock and give the alarm rtc1 on every t600x board. The t602x boards share the board files but not this PMU, so the aliases go in the t600x board files. Signed-off-by: Ryan Murray <[email protected]> Assisted-by: LLM
Maverick keeps a second fired-event latch in control bit 1, next to the event register. The arm path preserved that bit, so after one alarm had fired (or firmware had left the latch set) the alarm was armed as 0x43. The comparator still matched and cleared ARM, but no new event edge latched and the SPMI interrupt never fired. Clear the control event bit on every control write, so the alarm is armed as 0x41 and each match raises interrupt 2. On a J316s (M1 Pro) with this series, two awake alarms each raised the RTC interrupt once and cleared wakealarm, and six 15 s s2idle suspends woke on the RTC interrupt after 15.5-16.0 s. Extend the host model with Maverick's write-zero-to-clear control latch and its stale-edge suppression. Stowe keeps its exact control value checks, so the T8112 path is unchanged. Assisted-by: LLM Signed-off-by: Ryan Murray <[email protected]>
This was referenced Nov 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a wake-capable RTC to the M1 Pro, Max and Ultra (t600x), so
rtcwakeand timed wake from s2idle work there. It uses the sameapple-pmu-rtcdriver, DT shape and wake path as the M2 (t8112), M4 Pro (t6041) and J700 (t8140). This replaces #1284 (rebased onto the current integration tip, with the commit message for the third patch rewrapped). The code is unchanged.Before this series the t600x machines have only
rtc0(macsmc-rtc), which has no wakealarm.Wake path
This is the same path the other PMU RTCs use: the nub SPMI controller is an interrupt controller on its AIC line, and the PMIC
rtcchild hasinterrupts = <2 IRQ_TYPE_EDGE_RISING>, the sharedrtc_offsetcell andwakeup-source. The RTC core arms the wake interrupt in suspend. On t600x only two things differ:rtcchild.rtc0stays on the SMC clock andrtc1is the alarm.0x43and no new edge latched. It now arms as0x41. On the other PMUs the new field is 0, so their writes don't change.Tests
checkpatch.pl --strict: 0/0/0 on all three patches.tools/asahi/pmu-rtc-tests.py: Baku, Abbey, Stowe and Maverick arithmetic, W1C transactions and fault injection pass. The stale-latch negative control is detected.Image modules dtbsbuild withLLVM=1.Hardware: J316s (16-inch M1 Pro)
Test kernel: this series plus a lab-only watchdog patch that keeps the watchdog counting in suspend (it is not part of this PR). The DTB is the series'
t6000-j316s.dtb.apple-pmu-rtc, wakealarm, wakeup enabledrtcwake -m no -s 6, x2rtcwake -d rtc1 -m freeze -s 15s2idle_rtc: n/as2idle_rtc: success +3 fail +0, all other rows equal (GPU, camera, ANE, AVD, Wi-Fi/BT reconnect, 6+6 pm_test sleeps); 0 AVC, enforcingWith PMP on (base including #1302), the same kernel and DTB give: awake alarms 2/2, real s2idle 5/5 (woke at 15.35-15.96 s), devices back after each wake, and idle power 3.45 W before the sleeps and 3.43 W after.
Hardware: J413 (M2), the existing Stowe path
Same test kernel; the M2's DTB is unchanged. On the base kernel, rtc1
apple-pmu-rtcalready raises interrupt 2 for awake alarms (2/2). With this series: SPMI 0 errors, awake alarms 2/2, and real s2idle 15 s 6/6 woke on the RTC interrupt (suspend_stats 6/0). After each wake, Wi-Fi, Thunderbolt, NVMe, display, Bluetooth, ANE and GPU were all ok, with no kernel errors.The regression suite's back-to-back sleeps also showed
magicmouse ...: unable to request touch data (-19). This is a trackpad resume race outside the RTC path, and it is fixed in #1317.🤖 Generated with Claude Code