Skip to content

arm64: dts: apple: t8142: wire nub_spmi0 IRQ and Abbey PMU RTC - #3936

Merged
RyanTheTide merged 2 commits into
mainfrom
feat/t8142-j813-pmu-rtc
Dec 2, 2026
Merged

RyanTheTide merged 2 commits into
mainfrom
feat/t8142-j813-pmu-rtc

Conversation

@sithglan

@sithglan sithglan commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

What: Wire nub_spmi0 AIC IRQ 584 as an interrupt controller and add the Abbey PMU RTC child node (apple,t8142-pmu-rtc, apple,t6041-pmu-rtc, SPMI IRQ 2, shared rtc_offset NVMEM cell, wakeup-source) in t8142-j813-power.dtsi, plus document apple,t8142-pmu-rtc in apple,j700-pmu-rtc.yaml.
Tested: Live J813 (13-inch M5 MacBook Air, 27.2 mBoot-20457.41.3 stub) on 7.3.0+ (9177b2d474f8) with the exact DTB built from 16e59b300edc, boot_id=49eabf67:

  • apple-pmu-rtc 388714000.spmi:pmic@e:rtc registered as /dev/rtc0 matching macsmc-rtc (/dev/rtc1) UTC wall time to the second (2026-12-02 13:38:39), exposing writable /sys/class/rtc/rtc0/wakealarm and apple_spmi 2 Edge IRQ.
  • Awake alarm test (rtcwake -d /dev/rtc0 -m no -s 3): IRQ count incremented 0 -> 1.
  • 3/3 s2idle cycles (rtcwake -d /dev/rtc0 -m freeze -s 5): suspend_stats/success 0 -> 3, fail 0, IRQ count 1 -> 4, eDP-1 + DP-1 + N1 Wi-Fi (wlp1s0f0) intact after every wake, 0 BUG/Oops/WARN.
  • scripts/checkpatch.pl --strict --git HEAD~2..HEAD: 0 errors, 0 warnings, 0 checks; both apple/t8142-j813.dtb and apple/t8142-j815.dtb build cleanly.
    Risk: two-way · DTS + binding only; follows the exact t6040.dtsi / t8132-jxxx.dtsi Abbey PMU RTC pattern and #3933 (t602x) wiring.
    Not yet: J815 (15-inch M5 MacBook Air, shares t8142-j813-power.dtsi) hardware verification; deep-sleep (mem) wake test via rtc0.

@sithglan
sithglan requested review from a team as code owners December 2, 2026 13:40

@satchlj satchlj left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Verdict: FINISH, then merge (diff and hardware verification look clean; waiting only on queued CI to finish green).

Reviewed 16e59b300edc (a44b7f20 binding + 16e59b30 DTS):

  • Documentation/devicetree/bindings/rtc/apple,j700-pmu-rtc.yaml adds apple,t8142-pmu-rtc alongside apple,t6050-pmu-rtc and apple,t8132-pmu-rtc under the apple,t6041-pmu-rtc fallback.
  • arch/arm64/boot/dts/apple/t8142-j813-power.dtsi wires nub_spmi0 as an interrupt controller (AIC_IRQ 584, IRQ_TYPE_LEVEL_HIGH) and adds pmu_rtc: rtc on pmic@e with SPMI IRQ 2 (IRQ_TYPE_EDGE_RISING), shared rtc_offset NVMEM cell, and wakeup-source, matching the existing Abbey PMU RTC pattern on t6040/t8132/t602x.
  • Exact-head J813 hardware verification is included (UTC match against macsmc-rtc, awake alarm IRQ 0 -> 1, 3/3 rtcwake -d /dev/rtc0 -m freeze -s 5 cycles passing with suspend_stats/success 0 -> 3 and display + Wi-Fi intact), and Not yet clearly states J815 and mem wake coverage.
  • Remaining before approval: wait for queued dt-checks, host-tests, pr-text, and readiness checks on 16e59b30 to complete green, then ready to flip to APPROVE.

@github-actions github-actions Bot added area:bringup Area from CODEOWNERS (bot) blast:m4 Macs affected, from Merge risk (bot) changes-requested A reviewer requested changes (bot) door:two-way Revertible or not, from Merge risk (bot) needs-review No approving review from Core or Omarchy Mac yet (bot) labels Dec 2, 2026
@github-actions

github-actions Bot commented Dec 2, 2026 •

Copy link
Copy Markdown

Merge readiness at 38947b3b: not ready yet

Check Detail
CI at head running running: host-tests, dt-checks
Review ok approved by RyanTheTide
Requested changes ok none
Hardware row at head no no line with the head SHA 38947b3b, a Mac and a result in the PR body or a comment
Conflicts ok none
PR text ok Risk: two-way · DTS + binding only; follows the exact t6040.dtsi / t8132-jxxx.dtsi Abbey PMU RTC pattern and #3933 (t602x) wiring.

Areas: area:bringup

Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels.

@github-actions github-actions Bot added the ci-failing A check failed at the PR head (bot) label Dec 2, 2026
satchlj
satchlj previously approved these changes Dec 2, 2026

@satchlj satchlj left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Verdict: APPROVE (16e59b300edc).

  • Binding (apple,t8142-pmu-rtc under apple,t6041-pmu-rtc fallback), t8142-j813-power.dtsi (nub_spmi0 AIC IRQ 584 + pmu_rtc SPMI IRQ 2 + rtc_offset + wakeup-source), and exact-head J813 3/3 rtcwake hardware verification are all clean.
  • Verified the host-tests failure log (run 46894045622): it failed solely in apple-dcp (provider-admission, ordered-rx) and display-sleep-merge-tests.py (no member named 'ext272' in 'struct apple_dcp'), which is an unrelated regression on main from #3815 (1ca91a159830) and does not touch DTS or bindings.
  • pr-text is green and dt-checks is still running (let dt-checks finish green before merging).

@gig3m

gig3m commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

J813 row (MacBook Air 13" M5) for the deep-sleep (mem) wake through rtc0, which "Not yet" lists: 3/3 deep sleeps woken by rtcwake -d rtc0 -m mem -s 20 alone, nothing pressed. Also 3/3 s2idle and the awake alarm.

Not the exact head. The DTB is this PR's two commits on our daily tree, and it runs under our daily kernel: main 859e8a29 plus open PRs #2328, #2385, #2401, #2398 and our local XRGB8888 primary-plane patch. t8142-j813-power.dtsi is byte-identical to 16e59b300edc, and its blob in our tree is the PR's base (6f4d9198a86e). Decompiled against our daily DTB, the only change is the PR's nub_spmi0 interrupt-controller properties and the rtc node; everything else is phandle renumbering. Stage 2 was composed by the bootchain from this DTB, one boot. apple_sleep.t8142_wake_s=0 (default), so the sleep driver re-sends the PMU's own compare and nothing else arms a timed wake.

Check Result
Probe apple-pmu-rtc 388714000.spmi:pmic@e:rtc: registered as rtc0, set the system clock; macsmc-rtc moves to rtc1; same UTC time to the second
Awake alarm (rtcwake -d rtc0 -m no -s 3) IRQ apple_spmi 2 Edge 0 → 1
s2idle (rtcwake -d rtc0 -m freeze -s 10) 3/3, rc 0, IRQ 1 → 4, suspend_stats success 0 → 3, fail 0
Deep (rtcwake -d rtc0 -m mem -s 20, mem_sleep = deep) 3/3, rc 0, success 3 → 6, fail 0; each rtcwake returned about 22 s after it started (20 s alarm plus entry and exit)
PMU compare at the commit counter + 21 on all three (e.g. counter 26751202, compare 26751223), i.e. the alarm rtcwake wrote through rtc0
Wake source NUB.SPMI0.SW3 on all three; nub-spmi0 source word 0 goes 00000000 → 00000004 (bit 2, the RTC's SPMI IRQ)
After the last wake /proc/driver/rtc alarm_IRQ: no, alrm_pending: no, wakealarm empty; Wi-Fi 0 % loss, BT powered, eDP-1 on, Hyprland up, 10 CPUs, 0 failed units, 0 WARN/BUG/Oops/SError in the boot's kernel log

One thing to know: on deep wakes the rtc0 IRQ count stays put (4 → 4 over the three). The sleep driver acknowledges the PMU's latched nub-spmi0 sources at the wake, so the RTC handler never runs; rtcwake still returns 0 and the RTC core shows no pending alarm. s2idle wakes do count.

Not run: the exact head kernel, J815, longer sleeps, or an alarm set while the lid is closed.

Assisted-by: LLM (Claude:Opus 5.5)

@github-actions github-actions Bot added ci-failing A check failed at the PR head (bot) merge-conflict Conflicts with the base branch (bot) and removed needs-review No approving review from Core or Omarchy Mac yet (bot) ci-failing A check failed at the PR head (bot) labels Dec 2, 2026
Document apple,t8142-pmu-rtc as compatible with apple,t6041-pmu-rtc for
the Abbey PMU RTC on T8142 (M5) boards, which shares the exact 0x2000
register layout and 0x2100 48-bit rtc_offset scratchpad.

Signed-off-by: Thomas Glanzmann <thomas@glanzmann.de>
Describe the nub_spmi0 AIC interrupt (IRQ 584 per the J813 ADT) as an
interrupt controller and add the Abbey PMU RTC child node
(apple,t8142-pmu-rtc, apple,t6041-pmu-rtc, SPMI IRQ 2, shared
rtc_offset NVMEM cell, wakeup-source) on pmic@e in
t8142-j813-power.dtsi.

This exposes /dev/rtc0 (apple-pmu-rtc) with hardware wakealarm support
so rtcwake can arm timed s2idle and deep-sleep wakes on J813/J815.

Signed-off-by: Thomas Glanzmann <thomas@glanzmann.de>

@RyanTheTide RyanTheTide 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.

Re-checked rebased head 38947b3bd54a after #3938: arch/arm64/boot/dts/apple/t8142-j813-power.dtsi is byte-identical (aaae5a70279bd) to 16e59b300edc (verified by satchlj's prior approval + J813 3/3 rtcwake rows including gig3m's deep-sleep mem wake row), and Documentation/devicetree/bindings/rtc/apple,j700-pmu-rtc.yaml keeps both apple,t8142-pmu-rtc and apple,t8152-pmu-rtc cleanly under apple,t6041-pmu-rtc.

@github-actions github-actions Bot added needs-hw-row No hardware row at the PR head (bot) and removed changes-requested A reviewer requested changes (bot) ci-failing A check failed at the PR head (bot) merge-conflict Conflicts with the base branch (bot) labels Dec 2, 2026

@satchlj satchlj left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Re-reviewed updated head 38947b3bd54a (arm64: dts: apple: t8142: wire nub_spmi0 IRQ and Abbey PMU RTC):

  • Both 4b4dc70fe6e9 (apple,t8142-pmu-rtc binding) and 38947b3bd54a (t8142-j813-power.dtsi nub_spmi0 IRQ controller + pmu_rtc wakeup-source) are clean, pr-text is green, DCO and Risk: are present, and the J813 M5 deep-sleep rtcwake -d rtc0 -m mem -s 20 3/3 PASS row landed.

Holding re-approval only for queued dt-checks and host-tests to finish green at 38947b3bd54a.

@RyanTheTide

Copy link
Copy Markdown
Contributor

Merging at 38947b3bd54a (B2 merge train, 12-01 merge bar). Approval at this head: RyanTheTide. Row: J813 3/3 rtcwake rows in PR body + comment 7350157723 (t8142-j813-power.dtsi byte-identical aaae5a70279bd across rebase onto #3938). CI: linux train L25 (candidate 9a7e32597c82 on main 515377d): Apple driver build pass + changed .c objs pass + DTBs pass + KUnit pass (dcp-topology, asahi; confirms #3153 -Werror,-Wunused-function fix) + host tests pass (g17 329/329). Revert: git revert -m 1 <merge commit>.

@RyanTheTide
RyanTheTide merged commit bfe0462 into main Dec 2, 2026
6 of 8 checks passed
@RyanTheTide
RyanTheTide deleted the feat/t8142-j813-pmu-rtc branch December 2, 2026 16:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:bringup Area from CODEOWNERS (bot) blast:m4 Macs affected, from Merge risk (bot) door:two-way Revertible or not, from Merge risk (bot) needs-hw-row No hardware row at the PR head (bot)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants