Repository navigation
t600x: PMU RTC wake alarm (SPMI notify index, latch clear + DT) - #1284
Closed
RyanTheTide wants to merge 3 commits into
Closed
RyanTheTide wants to merge 3 commits into
RyanTheTide wants to merge 3 commits into
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 an additional fired-event latch in control bit 1. If that latch is stale when the alarm is armed, the next comparator match does not produce a new event edge. Clear it on every control write so the normal armed value is 0x41 instead of 0x43. Extend the host model with Maverick's write-zero-to-clear control latch and its stale-edge suppression. Keep exact Stowe control-value checks to cover the unchanged T8112 path. Assisted-by: LLM Signed-off-by: Ryan Murray <[email protected]>
This was referenced Nov 9, 2026
Contributor
Author
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.
Supersedes #1225 with the Maverick event-latch fix added. This remains a draft until the J316s awake and s2idle checks below pass.
Before this series, the M1 Pro has only
rtc0(macsmc-rtc, no wakealarm), sortcwake, scheduled wake, and suspend-then-wake cannot use the retained-power PMU alarm.Interrupt route
The alarm route is direct SPMI, not an SMC notification:
The t6000 SPMI controller's RX-reply notification is controller event 192. That event is separate from the RTC's PMU peripheral interrupt 2.
Commits
wakeup-source.0x03was preserved during arm, producing0x43; after the comparator matched, ARM cleared but no new event edge could latch. The driver now clears the Maverick control-event bit on every control write, so it arms as0x41.The new control-event field is zero for T8112/Stowe, and the host model retains exact Stowe control-value checks, so the working M2 path is unchanged.
Checks
checkpatch.pl --strict: 0 errors, 0 warnings, 0 checks.Buildbox arm64 focused build with
LLVM=1 W=1:rtc-apple-pmu.oandspmi-apple-controller.ocompiled with no diagnostics.Buildbox arm64
Image modules dtbsbuild withLLVM=1 W=1: completed successfully.Host model:
The model starts Maverick with control
0x03and separate event clear, proves that the stale control latch suppresses a new edge, then proves the driver clears bit 1 and arms as exactly0x41.All nine mutation controls are detected, including the new
control-event-clearnegative control.J316s hardware gate
No target hardware was used for this update. The owner lane should:
rtcwaketwice and require the RTC IRQ count to increase by exactly one each time. Immediately after each arm, require control0x41(bit 1 clear), separate event clear, and the alarm unmasked; after each interrupt, require both event latches clear.The earlier J316s trial already established that notification 192 makes the interrupt-driven SPMI FIFO work and that
rtc1probes. The missing alarm edge was the stale Maverick control latch addressed by commit 3.