Skip to content

arm64: dts: apple: t8122: PMU RTC alarm and P-core boost states - #2562

Merged
DjDeveloperr merged 2 commits into
integration/aurorafrom
j615pwr/t8122-pmu-rtc
Nov 20, 2026
Merged

DjDeveloperr merged 2 commits into
integration/aurorafrom
j615pwr/t8122-pmu-rtc

Conversation

@RyanTheTide

Copy link
Copy Markdown
Contributor

Problem

The M3 machines (T8122) have no RTC wake alarm: the only RTC is the SMC one, which has no alarm, so a planned suspend has nothing to wake it. Their P-core boost states are also not marked as such in the device tree.

Change

  • t8122.dtsi: describe the nub SPMI controller as an interrupt controller and add the PMU RTC under the PMIC. The PMIC is the same Stowe part as on T8112, with the RTC block at the same registers (65536 Hz counter, whole-second comparator, six-byte offset shared with the SMC RTC), so the node falls back to apple,t8112-pmu-rtc and needs no driver change.
  • Binding: accept apple,t8122-pmu-rtc with that fallback.
  • t8122.dtsi: mark the P-cluster states from 3720 to 4056 MHz turbo-mode. On a J615 these only run with one or two busy P cores; with three or four, every core runs at about 3625 MHz whatever is requested. apple-soc-cpufreq starts with boost on for this SoC, so nothing changes by default; boost can now be turned off.

Testing

On a J615 (MacBook Air 15", M3):

  • The PMU RTC registers as rtc0 and sets the system clock. A wakealarm 15 s ahead reads back exactly, fires once through the nub SPMI interrupt and clears itself.
  • 7/7 suspend-to-idle cycles (30-60 s) woke on the alarm, 0.12-0.15 s after the deadline; suspend_stats 7 success, 0 fail; resume devices 0.05-0.06 s.
  • Read-only check of the RTC registers before the change: the counter advances at 65536 Hz and counter + offset gives the wall clock to 0.01 s.
  • Measured P-core clock (dependent-add chain per core): one busy core 4053 MHz, two 3948 MHz, three or four 3579-3629 MHz; with the max frequency capped at 3144/3288 MHz the cores measure 3134/3279 MHz.
  • Boost is on by default (max 4056 MHz). Writing 0 to cpufreq/boost limits the P policy to 3636 MHz and lists the five boost states; writing 1 restores 4056 MHz.
  • make dt_binding_check (this binding) and make CHECK_DTBS=y for t8122-j613/j615 against the RTC and SPMI schemas: no warnings.

Still to run

  • J613 (same SoC, different board).
Details
  • nub SPMI AP interrupt: AIC 437 (the J615's live ADT; the a0 controller's entry in the same list matches the dtsi's AIC 461).
  • PMU alarm event: SPMI interrupt 2 of usid 0xe, as on T8112.
  • Kernel used for the hardware rows: a 7.3.0 lab build of integration/aurora with the J615 bring-up patches; the board DTB tested differs from the running one only by these two commits.

Assisted-by: LLM (Claude:Opus 5.5)

The T8122 nub SPMI bus carries the same Stowe PMIC as the T8112, with the
RTC block at the same registers: a 65536 Hz counter, a whole-second
comparator and the six-byte rtc_offset cell the SMC RTC already uses.
Only the alarm was missing, so the M3 machines had no RTC wakealarm.

Describe the nub SPMI controller as an interrupt controller (its AP
interrupt is AIC 437) and add the PMU RTC under the PMIC, falling back
to the T8112 match data. The binding gets the t8122 compatible.

Signed-off-by: Ryan Murray <[email protected]>
The T8122 P cluster only reaches its top five states with one or two
cores busy. With four busy P cores each core runs at about 3625 MHz (the
3636 MHz state) whatever state is requested; with two, at about 3950 MHz;
with one, at 4053 MHz. The other Apple SoCs mark such states turbo-mode,
T8122 marks none.

Mark 3720 to 4056 MHz turbo-mode. apple-soc-cpufreq starts with boost on
for this SoC, so the default does not change; boost can now be switched
off to hold the P cores at the all-core state.

Signed-off-by: Ryan Murray <[email protected]>

@DjDeveloperr DjDeveloperr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving and merging. Thanks, this is a clean port of the T8112 arrangement.

  • PMU RTC: the nub_spmi interrupt controller (t8122.dtsi:1028-1031) and the pmu_rtc node (:1037-1044) match t8112.dtsi line for line: Stowe on usid 0xe, SPMI interrupt 2 rising, the shared rtc_offset cell, and wakeup-source. AIC 437 comes from the J615's ADT, so it's a SoC fact rather than a board one. The apple,t8122-pmu-rtc / apple,t8112-pmu-rtc fallback means no driver change is needed, and the binding item (apple,j700-pmu-rtc.yaml:44-46) accepts exactly that pair.
  • Boost states: turbo-mode on opp16-opp20 (:351-379) changes nothing by default. apple-soc-cpufreq.c:1664-1665 starts with boost on for every SoC except T8112, which fits your 4056 MHz default reading and the 3636 MHz cap with boost off. Your clock measurements (4053 MHz on one core, about 3600 on three or four) back up calling these states boost.

Optional follow-up: neither J613 nor J615 has an rtc0 alias, so the PMU RTC is rtc0 only because it probes before the SMC RTC. rtcwake and hctosys default to rtc0, and the SMC RTC has no alarm. An alias pinning rtc0 to &pmu_rtc (plus a label on the SMC RTC node at :1185 if you want it as rtc1) would make the tested setup deterministic. Note that J413 does it the other way round (t8112-j413.dts:26-27).

CI on 1135a0a: Device tree checks and Host tests are green. All commits are signed off.

Post-merge row: one J613 boot with an alarm wake from s2idle. It's the same SoC, but a different board.

@DjDeveloperr
DjDeveloperr merged commit 8f18229 into integration/aurora Nov 20, 2026
2 checks passed
@RyanTheTide
RyanTheTide deleted the j615pwr/t8122-pmu-rtc branch November 27, 2026 13:21
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.

2 participants