Skip to content

rtc: apple-pmu: M2 (T8112) Stowe PMU wake alarm - #1130

Closed
RyanTheTide wants to merge 3 commits into
integration/aurorafrom
bootlog2/t8112-pmu-rtc
Closed

RyanTheTide wants to merge 3 commits into
integration/aurorafrom
bootlog2/t8112-pmu-rtc

Conversation

@RyanTheTide

Copy link
Copy Markdown
Contributor

The M2 has no wake alarm on Linux: rtc0 is the SMC RTC, which cannot wake the system, so rtcwake and scheduled wakes from suspend-to-idle fail (/dev/rtc0 not enabled for wakeup events). The Neo and the J616s got a PMU alarm in rtc-apple-pmu; the M2's PMU has the same block.

From the M2's own ADT (/arm-io/nub-spmi0/pmu-main, hw-name stowe): clock at 0xf802, alarm comparator at 0xf808, alarm event at 0xf80c bit 0, arm bit 0x40 in the control register, PMU interrupt 2 on the SPMI nub; the nub's AIC line is 384 (its interrupts list has the same shape as the Neo's, where the AIC entry is 487). That is Baku's register block. The clock offset lives at 0xf900 as six bytes, the cell rtc-macsmc already uses (signed 33.15 fixed-point seconds), which is Abbey's format.

  • dt-bindings: add apple,t8112-pmu-rtc.
  • rtc: add Stowe match data (Baku registers, Abbey offset format).
  • arm64: dts: t8112: make the nub SPMI controller an interrupt controller on AIC 384 and describe the PMU alarm with the shared offset cell (J413 and J493 inherit it).

Checks: checkpatch --strict clean on all three; dt_binding_check for the binding passes; dtbs_check on t8112-j413/j493: 89 warnings before and after, none new (only phandle renumbering in unrelated lines).

Hardware: M2 test pending (aura-try one-shot DTB trial with this j413 DTB + one-shot test kernel; expect rtc1 apple-pmu-rtc with wakealarm, rtcwake -d rtc1 -m freeze wakes, time agrees with rtc0). The ref Macs boot the DTB set from boot.bin, so the DT part reaches them with the next DTB-set refresh (DT2). M1/M1 Pro PMUs are next once their ADT is checked.

🤖 Generated with Claude Code

The M2 (T8112) Stowe PMU has the Baku clock and alarm block and keeps
the SMC RTC's offset as six bytes of signed 33.15 fixed-point seconds,
like Abbey. Add apple,t8112-pmu-rtc.

Assisted-by: LLM
Signed-off-by: Ryan Murray <[email protected]>
The M2's Stowe PMU has the same clock and alarm block as the Neo's Baku
(control at 0xf800, 65536 Hz counter at 0xf802, alarm comparator at
0xf808, alarm event bit 0 at 0xf80c, arm bit 6), as its ADT node
describes, but keeps the SMC RTC's offset like Abbey: six bytes of
signed 33.15 fixed-point seconds at 0xf900, the cell the SMC RTC
already uses. Add Stowe match data for apple,t8112-pmu-rtc.

The M2 has had no wake alarm on Linux: rtc0 (SMC RTC) cannot wake the
system, so rtcwake and scheduled wakes from suspend-to-idle failed
("/dev/rtc0 not enabled for wakeup events").

Assisted-by: LLM
Signed-off-by: Ryan Murray <[email protected]>
Make the nub SPMI controller an interrupt controller on AIC 384, the
AIC line its ADT node lists, and describe the Stowe PMU's clock and
alarm (its SPMI interrupt 2) with the shared RTC offset cell, so the
J413 and J493 can wake from suspend-to-idle on an RTC alarm.

Assisted-by: LLM
Signed-off-by: Ryan Murray <[email protected]>
@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Superseded. Lane GAPREF has the superset on its branch rtc/m1m2-pmu-alarm: Stowe (M2) plus the M1 Pro PMU, the missing piece this PR lacks (apple-spmi-nvmem only populated children of the Baku/Abbey/Chapel PMICs, so this rtc node never became a device: confirmed on an M2 trial boot 11-08 00:56, no rtc1), rtc0/rtc1 aliases, a host model and binding/dtbs checks. It will open one PR from that branch and carry the M2 ADT facts from here (Stowe = Baku register block at 0xf800 + Abbey's 6-byte 33.15 offset at 0xf900, PMU interrupt 2, SPMI nub on AIC 384). This PR closes when that one is open.

@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Superseded by #1151 (same M2 PMU alarm plus the SPMI NVMEM child population this branch was missing, rtc0/rtc1 aliases, and the M1 Pro layout). Tested on the M2 there.

@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Superseded by #1151 (lane GAPREF: Stowe + M1 Pro, nvmem child population, rtc0/rtc1 aliases; M2 rtcwake via rtc1 4/4).

@RyanTheTide RyanTheTide closed this Nov 7, 2026
@RyanTheTide
RyanTheTide deleted the bootlog2/t8112-pmu-rtc branch November 7, 2026 15:23
RyanTheTide added a commit that referenced this pull request Nov 7, 2026
Merge train 11-08. GAPREF M2 one-shot (gapref1 + trial boot.bin with this j413 DTB): rtc1 apple-pmu-rtc bound, rtcwake s2idle 4/4 woke on the alarm, pm_test freeze 6/6, kernel err 0, 0 AVC, 0 failed, 0 new warnings. Baku/Abbey (Neo/J616s) layouts are the same absolute addresses as before the base+offset refactor (0xf800/02/08/0e, 0x2000/02/08/0e); the pmu-rtc host model covers all four layouts with 8 mutations caught; CI dt-checks + host-tests green. The t600x layout stays inert until its DT lands. Supersedes #1130.
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