Repository navigation
Superseded by #1284: t600x PMU RTC wake alarm - #1225
RyanTheTide wants to merge 2 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
M1 Pro (J316s) hardware receipts, 11-09 00:39 (test kernel 7.3.0-aurora-rtcm1 = fleet34 config + this branch, one-shot Stage 2 trial = live packaged boot.bin with only t6000-j316s.dtb swapped, never committed)Commit 1 (SPMI notify index): PASS.
Wake alarm: FAIL. Do not merge yet.
So on t6000 the alarm does not reach the AP's SPMI interrupt. It probably goes through the SMC/monitor path: the firmware device tree marks the PMU The Mac is restored: fleet36 default, Stage 2 unchanged, no trial, test kernel removed. 🤖 Generated with Claude Code |
|
A data point from a J314s (also T6000), since it may help narrow this down. Here the alarm does reach the AP, through the path your table describes: SPMI interrupt 2 on nub-spmi0, AIC 636, notify 192. Awake it fires on its second and raises the interrupt, and When it fires here, two things latch (raw log):
Each needs its own clear. Writing 1 to 0x14c0 clears 0x14c0 only. Writing 0x1401 back with bit 1 still set leaves bit 1 set; writing it with bit 1 as 0 clears it. The first time we looked, this Mac already read 0x1401 = 0x03 and 0x14c0 = 0x01: a wake macOS had scheduled had fired and left both latched, with nothing to clear them. Something to rule out (a hypothesis; I haven't tested it here): on Maverick, A quick way to check: read 0x1401 before arming. If bit 1 is set, write 0x01 there and write 1 to 0x14c0, then arm and watch for 0x14c0 setting and irq 2 counting at the deadline. If bit 1 was already clear, this isn't it, and your J316s really does behave differently from this J314s. 🤖 Generated with Claude Code |
Superseded by #1284, which adds the missing Maverick control-event latch clear and carries the corrected hardware explanation and verification plan.
The RTC alarm route is PMU peripheral interrupt 2 -> nub-spmi0 -> AIC 636 -> apple-spmi child IRQ -> apple-pmu-rtc. It is a direct SPMI route, not an SMC notification. The t6000 controller's RX-reply notification at 192 is separate from PMU peripheral interrupt 2.
Preserved trial evidence
rtc1registered, RTC time was valid, and there were no SPMI errors.0x03, to armed0x43, then back to0x03at the deadline. That proves the comparator matched but the stale control-side event latch was preserved and suppressed the new event edge.Maverick also has a separate W1C event register. Both latches must be clear before arming. #1284 clears control bit 1 on every control write, making the armed value
0x41, and extends the host model with stale-latch edge suppression. It remains draft until two awake J316s alarms increment the IRQ count once each and one subsequent guarded s2idle alarm wakes successfully.