Skip to content

rtc: apple-pmu: M2 PMU wake alarm (M1 Pro next) - #1151

Merged
RyanTheTide merged 3 commits into
integration/aurorafrom
rtc/m1m2-pmu-alarm
Nov 7, 2026
Merged

RyanTheTide merged 3 commits into
integration/aurorafrom
rtc/m1m2-pmu-alarm

Conversation

@RyanTheTide

Copy link
Copy Markdown
Contributor

rtcwake now works on the M2. Its PMU has the same one-shot alarm as the Neo and M4 Pro PMUs: a 65536 Hz counter, a comparator in whole seconds, a mask, an arm bit and an event that clears on write. rtc-apple-pmu just needed the register layout, and the DT needed the SPMI interrupt.

  • dt-bindings: compatibles for the M2 (apple,t8112-pmu-rtc) and M1 Pro/Max/Ultra (apple,t6000-pmu-rtc) PMUs.
  • rtc: apple-pmu: each PMU is now described by absolute register addresses, which the M1 Pro needs because its event register is not next to the rest. Adds the M2 layout (Baku's register block, offset cell in 1/32768 s like Abbey) and the M1 Pro layout. The SPMI NVMEM provider now populates the RTC child on these PMICs. Without that, the node never becomes a device. The host model covers all four layouts, with new mutations for the control address, the M1 Pro event register and the M2 offset format.
  • arm64: dts: apple: t8112: the nub SPMI controller becomes an interrupt controller (AIC 384), and the PMU RTC sits under pmic@e with SPMI interrupt 2 and wakeup-source. rtc0 stays the SMC clock that userspace sets. The alarm is rtc1, same as on the Neo and M4 Pro.

The M1 Pro DT is ready on rtc/t600x-pmu-alarm and joins this PR once the M1 Pro is back on the network and passes the same test. The driver side is already here and does nothing without the DT.

Supersedes #1130.

Testing (M2 MacBook Air, j413)

Test kernel 7.3.0-aurora-gapref1 = integration/aurora a20af80 + this branch (+ unrelated test commits). Booted one-shot with the j413 DTB from this tree in a trial boot.bin; the default kernel and boot.bin were left untouched and restored afterwards. SELinux enforcing, no sound.

  • PMU counter rate, read over the PMIC nvmem before any change: 656,736 ticks in 10.025 s (65,512 Hz, so 65536 Hz).
  • Boot: rtc1: apple-pmu-rtc 23d714000.spmi:pmic@e:rtc, wakealarm present, wakeup enabled, time equal to rtc0 to the second. 0 SPMI errors with the controller now in interrupt mode, kernel err 0, kernel warnings same classes as the fleet kernel, 0 AVC, 0 failed units.
  • Alarm while awake: rtcwake -d rtc1 -m no -s 8 fires SPMI irq 2 once and clears wakealarm.
  • Real s2idle: rtcwake -d rtc1 -m freeze -s 15 x4, 4/4 woke on the alarm (irq count +4, PM: suspend entry (s2idle) / PM: suspend exit ~17 s apart), Wi-Fi back each time, 0 new warnings.
  • pm_test=platform freeze x6: 6/6, no brcmfmac D3 timeouts, 0 AVC.
  • checkpatch --strict clean on all commits, W=1 -Werror clean for rtc-apple-pmu.o and apple-spmi-nvmem.o, dt_binding_check clean for the binding, CHECK_DTBS for j413/j493/j316s/j375c adds nothing new, tools/asahi/pmu-rtc-tests.py passes, and all 8 mutations are caught.

🤖 Generated with Claude Code

The M1 Pro/Max/Ultra (t6000) and M2 (t8112) PMUs have the same alarm
as Baku and Abbey, and keep the clock offset in Abbey's format. Add
their compatibles.

Signed-off-by: Ryan Murray <[email protected]>
Assisted-by: LLM
The M1 Pro/Max/Ultra (Maverick) and M2 (Stowe) PMUs have the same
alarm as Baku and Abbey: a 65536 Hz counter, a comparator in whole
counter seconds, a mask, an arm bit in the control byte and an event
that is cleared by writing one. Only the register addresses and the
offset format differ. Stowe uses Baku's register block; Maverick has
its own. Both keep the clock offset as signed 1/32768 s ticks like
Abbey.

Describe each PMU by absolute register addresses instead of a base,
add the two PMUs, and let the SPMI NVMEM provider populate their RTC
child. Firmware leaves the monitor bit set on Stowe, so keep it set
on both, as on Abbey.

Extend the host model to all four layouts, with mutations for the
control address, Maverick's separate event register and Stowe's
offset format.

Signed-off-by: Ryan Murray <[email protected]>
Assisted-by: LLM
Make the nub SPMI controller an interrupt controller and add the PMU
RTC under the PMIC, so rtcwake can wake M2 systems from s2idle. The
PMU raises SPMI interrupt 2 for the alarm.

Keep rtc0 on the SMC clock, which is the one userspace sets, and give
the alarm rtc1, as on the Neo and the M4 Pro.

Signed-off-by: Ryan Murray <[email protected]>
Assisted-by: LLM
@RyanTheTide
RyanTheTide merged commit 597636c into integration/aurora Nov 7, 2026
2 checks passed
@RyanTheTide
RyanTheTide deleted the rtc/m1m2-pmu-alarm branch November 7, 2026 15:27
DjDeveloperr added a commit that referenced this pull request Nov 7, 2026
…check-every-adt-devi

Brings in #1142, #1141, #1144, #1094, #1151, #1140, #1161, #1097 and
#1163. No conflicts. The four inventories still resolve against the
merged DTBs: J316s, J616s, J413 and J700 keep their MISSING counts with
no broken paths.

Signed-off-by: Diljit Singh <[email protected]>
RyanTheTide added a commit that referenced this pull request Nov 7, 2026
Brings aurora-wip up to the 11-08 morning integration tip: DT
descriptions for every Mac family (#1094, #1097, #1111, #1131, #1132,
#1148, #1149, #1155, #1156, #1157, #1172), the J616s scaler (#1168), the
panel primaries from boot data (#1105), AVD macOS command parity
(#1116), AVD dma-coherent (#1169), the M2 PMU RTC alarm (#1151), G17
admission without spinning (#1146) and the AOP map wait (#1147).

Signed-off-by: Ryan Murray <[email protected]>
Assisted-by: LLM
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.

1 participant