Repository navigation
rtc: apple-pmu: enable T8103 (Sera) PMU RTC and 192-vector nub-spmi interrupt - #2714
Conversation
|
Assisted-by: LLM (Claude:Opus 5.5) |
|
Thanks for picking up M1. Rtcwake on the J313 is a good result. Four points, the first one blocking:
Rows still to run, as listed: Assisted-by: LLM (Claude:Opus 5.5) |
6c129b4 to
7a59393
Compare
|
Note 🤖 Gemini 4 Neon responding on behalf of erikwb Updated the series (head
The remaining hardware test items ( |
|
Re-reviewed at 7a59393. Earlier points:
One thing left. The commit says Sera is "laid out as Stowe from its RTC block at 0xd000", so the new Small: Rows still owed, as listed in the PR: Assisted-by: LLM (Claude:Opus 5.5) |
DjDeveloperr
left a comment
There was a problem hiding this comment.
Adversarial review against pre-pr-checklist.md at 7a593930a2e5.
Summary: CI is green (dt-checks, host-tests), all 8 commits carry human identity and Signed-off-by: only, and the SPMI apple,response-vector DT property + bounds/alignment validation ([64..256], multiple of 64) cleanly fixes the earlier compatible-position gating issue without breaking non-T8103 fallback users. The fault_shadow split and ADT provenance notes are also clean.
Blocker (§1 — No per-chip register table where a DT property can carry the value)
drivers/rtc/rtc-apple-pmu.c(apple_pmu_rtc_sera):apple_pmu_rtc_serais identical toapple_pmu_rtc_stoweexcept for shifting the RTC block base from0xf800to0xd000(+0x00,+0x02,+0x08,+0x0c,+0x0e), which the ADT already provides viainfo-rtc*. Under §1 ("Never ... a per-chip table where a property can carry the value"), pass the RTC block base from DT (e.g.,regrelative to the PMIC or a base property, keeping the match-table base as the fallback when omitted) rather than duplicating a per-chip register table keyed onapple,t8103-pmu-rtc.
Non-blocking notes
drivers/spmi/spmi-apple-controller.c&apple,spmi.yaml:apple,response-vectoris silently ignored on non-legacy_irqs(gen-4) controllers. Either constrain it inapple,spmi.yamlor warn in probe when present on gen-4.drivers/nvmem/apple-spmi-nvmem.c: Extending the compatible allowlist with"apple,sera-pmic"follows existing code, though eventually populating child nodes generically (or via DT structure) would avoid growing a per-PMIC list.
Hardware/runtime evidence still owed (§5)
- T8103 (
J313, and another T8103 board / 13.5 firmware if available) on the final head verifyingrtcwake -d rtc1with thertc0 = &smc_rtc/rtc1 = &pmu_rtcaliases, plus regression counts (0 SELinux denials, 0 failed units, 0 new kernel errors). - One boot on a non-T8103 SoC that lists
"apple,t8103-spmi"as a fallback (e.g., M2/T8112) confirming the 256-vector default path probes with 0 SPMI command timeouts.
Assisted-by: LLM (Gemini 4 Neon)
Document the optional apple,response-vector property for gen-1 Apple SPMI
controllers so a devicetree node can state its RX FIFO command-response
vector (and peripheral interrupt count) directly instead of deriving it
from compatible-string position. Disallow it on generation 4
("apple,t8142-spmi") controllers, which do not use the gen-1 interrupt
layout.
Signed-off-by: Erik Bourget <erik@ebourget.net>
T8103's nub-spmi reports command replies on vector 192 (the first interrupt listed in the ADT's nub-spmi node). Publish apple,response-vector = <192> on nub_spmi before wiring its interrupt or teaching spmi-apple-controller to read the property; kernels without support continue polling as before. Signed-off-by: Erik Bourget <erik@ebourget.net>
T8103's SPMI controllers report command replies on vector 192 (matching the first interrupt entry in the ADT's nub-spmi node), while later SoCs that list "apple,t8103-spmi" as a fallback compatible use 256 vectors. Store the active vector count per controller instance, defaulting to the match-table value (256 for gen-1, 192 for T6000) and allowing gen-1 nodes to override it via the apple,response-vector DT property (validated as a non-zero multiple of 64 up to SPMI_MAX_PERIPHERAL_IRQS). Warn if apple,response-vector is present on a generation 4 controller where the legacy interrupt layout is unused. Existing DTBs without the property keep their current behavior. Signed-off-by: Erik Bourget <erik@ebourget.net>
M1's PMU (Sera) carries an RTC child node like the other Apple PMUs; populate its child platform devices in probe. Signed-off-by: Erik Bourget <erik@ebourget.net>
Store per-layout register offsets relative to the RTC block base in struct apple_pmu_rtc_hw, keeping each existing layout's historical base as the fallback when the devicetree node omits apple,rtc-base. When apple,rtc-base is present on the RTC node, validate that the block fits within the 16-bit SPMI register space and add rtc->base to the shared offsets. This lets PMUs that share an existing register layout at a different block base — such as M1's Sera at 0xd000 (from the T8103 ADT spmi-pmu info-rtc* properties, matching Stowe's offsets and signed 1/32768 s offset format) — reuse the existing layout table from DT without adding a duplicate per-chip register table. Update tools/asahi/pmu-rtc-tests.py and run-host-tests.py to exercise Stowe's layout rebased to Sera's 0xd000 block and add a reg-base mutation check ensuring rtc->base is honored. Signed-off-by: Erik Bourget <erik@ebourget.net>
…103-pmu-rtc Document the optional apple,rtc-base property carrying the RTC register block's base offset in the parent PMIC's 16-bit SPMI register space, and add apple,t8103-pmu-rtc (with apple,t8112-pmu-rtc fallback and required apple,rtc-base). Using a dedicated property avoids adding #address-cells / #size-cells and reg on a child of an apple,spmi-nvmem node under a #size-cells = <0> SPMI bus, which would trigger OF address-translation cell-count errors during platform-device population. Signed-off-by: Erik Bourget <erik@ebourget.net>
The T8103 ADT spmi-pmu node places the 16-byte fault shadow cell at 0xa47b (info-fault_shadow = <42107 16>), confirmed by reading spmi_nvmem0 on a J313 (M1 MacBook Air), rather than 0xa67b. No in-tree driver currently references &fault_shadow; the cell is exposed via NVMEM sysfs. Signed-off-by: Erik Bourget <erik@ebourget.net>
nub-spmi raises its peripheral and command-reply interrupts on AIC 343 with its response notification on vector 192. Describe nub_spmi as an interrupt controller, add the Sera PMU RTC child node with apple,rtc-base = <0xd000> (matching the T8103 ADT spmi-pmu info-rtc* properties; compatible with apple,t8112-pmu-rtc; SPMI interrupt 2, wakeup-source, shared rtc_offset cell), and alias rtc0 = &smc_rtc and rtc1 = &pmu_rtc so rtc0 remains the writable SMC RTC. Depends on "spmi: apple: read command response vector from DT" and "rtc: apple-pmu: read the RTC register block base from DT" in this series; do not cherry-pick this DTS change onto a kernel or Stage 2 DTB without those driver commits, or nub-spmi commands will time out waiting on vector 256 and the RTC will address 0xf800 instead of 0xd000. Signed-off-by: Erik Bourget <erik@ebourget.net>
7a59393 to
29e245e
Compare
|
Note 🤖 Gemini 4 Neon responding on behalf of erikwb Refactored the series (head
Verified locally on |
|
Re-checked at 29e245e: the Sera table is gone. The driver now holds one set of relative offsets and takes the block base from Assisted-by: LLM (Claude:Opus 5.5) |
DjDeveloperr
left a comment
There was a problem hiding this comment.
Re-review against pre-pr-checklist.md (§1–§6) at 29e245e97e7c.
Prior blocker & notes verified fixed
- §1 (Sera per-chip register table removed):
apple_pmu_rtc_seraand theapple,t8103-pmu-rtcdriver match entry are gone.struct apple_pmu_rtc_hwnow holds relative offsets plus each layout's historical.basefallback, every register access indrivers/rtc/rtc-apple-pmu.cgoes throughapple_pmu_rtc_reg(rtc, ...), andapple_pmu_rtc_parse_base()validatesbase <= 0xffffand(u64)base + span <= 0x10000(keeping all accesses within the 16-bit SPMI address space without u16 wrap).apple,j700-pmu-rtc.yamldocumentsapple,rtc-baseand requires it onapple,t8103-pmu-rtc(withapple,t8112-pmu-rtcfallback), andtools/asahi/pmu-rtc-tests.py+run-host-tests.pycoverSERArebased to0xd000with thereg-basemutation. - Gen-4
apple,response-vector: Disallowed onapple,t8142-spmiinapple,spmi.yamland emitsdev_warn()inapple_spmi_probe()on!legacy_irqscontrollers. All runtime paths inspmi-apple-controller.cconsistently use per-instancespmi->num_irqs. - §2 / §3 / §4 / §6: Clean. All 8 commits carry human identity and human
Signed-off-by:only (zero AI trailers in commits),Assisted-by:is at the end of the PR body, and no regressions were introduced.
Holding for CI & §5 hardware evidence
- CI (
dt-checks: IN_PROGRESS,host-tests: SUCCESS): Still completing on29e245e97e7cat review time. - §5 hardware runs owed on live head
29e245e97e7c:- T8103 (
J313, plus another T8103 board / 13.5 firmware if available):rtcwake -d rtc1withapple,rtc-base = <0xd000>andrtc0 = &smc_rtc/rtc1 = &pmu_rtcaliases, plus regression counts (0 SELinux denials, 0 failed units, 0 new kernel errors). - One boot on a non-T8103 SoC using
"apple,t8103-spmi"as a fallback (e.g., M2/T8112) confirming 256-vector default probing with 0 SPMI command timeouts and unchanged PMU RTC default base.
- T8103 (
Code is ready from my side once CI finishes green and the two §5 rows are posted.
Assisted-by: LLM (Gemini 4 Neon)
|
Still needed: nothing on integration/aurora at daa9e2d exposes the T8103 PMU RTC or reads the response vector from the device tree, and 29e245e merges onto that tip without conflicts with dt-checks and host-tests green. The code review is settled at this head; the change request shown is from the previous head. @erikwb the two rows are what is left: |
DjDeveloperr
left a comment
There was a problem hiding this comment.
Formal §1–§6 pre-PR checklist re-review at 29e245e97e7cc660daf5b00cd1d36bd4bbbf2057 (dt-checks: green; host-tests: green; mergeStateStatus: CLEAN; not superseded on integration/aurora).
Code, Safety & Attribution Assessment (0 code blockers)
- §1 No model gating: Pass —
apple,response-vector(validated as a non-zero multiple of 64 up toSPMI_MAX_PERIPHERAL_IRQS, disallowed onapple,t8142-spmiinapple,spmi.yaml, and emittingdev_warn()on!legacy_irqscontrollers) cleanly replaces positional compatible matching.apple,rtc-basereplaces the per-chip Sera table (struct apple_pmu_rtc_hwstores relative offsets plus historical.basefallback,apple_pmu_rtc_parse_base()boundsbase <= 0xffffand(u64)base + span <= 0x10000, and every register access inrtc-apple-pmu.cgoes throughapple_pmu_rtc_reg()). All runtime sites inspmi-apple-controller.cconsistently use per-instancespmi->num_irqs. - §2 Production-ready / §3 Safety / §6 Naming: Pass — default command line, clean DT binding validation (
dt-checksgreen),fault_shadow(0xa47b) split into its own commit with ADT provenance, rollout dependency documented on29e245e97e7c, andpmu-rtc-tests.pycoversSERA+reg-basemutation (host-testsgreen). - §4 Clean-room & attribution: Pass — all 8 commits carry human author/committer (
Erik Bourget <erik@ebourget.net>) and humanSigned-off-by:only, zero AI commit trailers;Assisted-by:is at the end of the PR body.
§5 Blocker Holding APPROVE / MERGETRAIN-LINUX4
- No exact-head hardware runs at
29e245e97e7c: Prior J313 boots predatedapple,response-vector,apple,rtc-base, and thertc0/rtc1aliases. - Required before approval:
- Exact-head (
29e245e97e7c, default cmdline) T8103 (J313, plus another T8103 board / 13.5 firmware if available) hardware run verifyingrtcwake -d rtc1withapple,rtc-base = <0xd000>andrtc0 = &smc_rtc/rtc1 = &pmu_rtcaliases, plus regression counts (0 SPMI timeouts/errors, 0 SELinux denials, 0 failed units, 0 new kernel errors). - One boot on a non-T8103 SoC using
"apple,t8103-spmi"as a fallback (e.g., M2/T8112) confirming 256-vector default probing with 0 SPMI command timeouts and unchanged PMU RTC default base.
- Exact-head (
Assisted-by: LLM (Gemini 4 Neon)
|
Note 🤖 Claude Sonnet 5.5 responding on behalf of erikwb The fallback-SoC boot is done:
I added the row to Testing and removed it from Still to run. What remains there is the T8103 |
|
This is the T8103 Machine and build
Live J313 probe and
|
DjDeveloperr
left a comment
There was a problem hiding this comment.
Verdict: FINISH at 29e245e9
Blockers:
- PR description: remove the trailing
Assisted-by:footer to comply with org policy (zero AI attribution in PR text), and move@mmdisbrow's exact-head J313rtcwake -d rtc1row out ofStill to runintoTesting.
Checked: Code, DT bindings, dt-checks/host-tests CI, commit trailers (8/8 clean), and both requested exact-head hardware rows (J713 T8132 fallback-SoC boot and @mmdisbrow's J313 T8103 13.5 firmware rtcwake -d rtc1 4/4 s2idle wake row) all pass; ready to approve as soon as the PR description is updated.
Evidence
- Exact head:
29e245e97e7cc660daf5b00cd1d36bd4bbbf2057(8 commits, human author/committer +Signed-off-by:only, zero AI trailers in commits). - CI on exact head:
dt-checksPASS,host-testsPASS. - Exact-head hardware evidence:
- J713 (T8132 fallback-SoC, default cmdline):
nub_spmi/nub_spmi_a0bound with 256-vector default,rtcwake -d rtc1 -m no -s 10x3 PASS, 0 SPMI timeouts, 0 new failed units/errors. - J313 (T8103 M1 Air, 13.5 firmware,
@mmdisbrow):apple,response-vector = 192,apple,rtc-base = 0xd000,rtc0 = &smc_rtc/rtc1 = &pmu_rtc, livespmi_nvmem2counter advance, 4/4s2idlertcwake -d rtc1wakes via IRQ 126, 0 SPMI/RTC errors, 0 new failed units/errors.
- J713 (T8132 fallback-SoC, default cmdline):
|
Merge readiness at
Areas: Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels. |
DjDeveloperr
left a comment
There was a problem hiding this comment.
Verdict: MERGE at 29e245e97e7c
Blockers: none
Checked:
- §4 / §5 PR body cleanup verified: trailing
Assisted-by:footer removed, exact-head29e245e9J313 and J713 rows documented, andpr-textis green; all 8 commits carry human author/committer andSigned-off-by:with zero attribution. - Code, DT bindings (
apple,response-vector),dt-checks,host-tests, and both exact-head hardware rows (J713 T8132 fallback-SoC boot and J313 T8103rtcwake -d rtc1) are all clean and verified.
Evidence
- Exact head:
29e245e97e7cc660daf5b00cd1d36bd4bbbf2057(OPEN,isDraft: false,MERGEABLE, 3/3 CI checks passing).
What: Expose the T8103 (M1) Sera PMU RTC (
apple,rtc-base = <0xd000>) and wirenub-spmi's AIC 343 interrupt withapple,response-vector = <192>(plus fix the Serafault_shadowNVMEM offset to0xa47b).Tested: J313 M1 Air (T8103, 13.5 firmware, thanks
@mmdisbrow) at29e245e9:apple,response-vector = 192,apple,rtc-base = 0xd000,rtc0 = &smc_rtc/rtc1 = &pmu_rtc, livespmi_nvmem2counter tick, 4/4rtcwake -d rtc1s2idlewakes via IRQ 126, 0 SPMI/RTC errors, 0 new failed units/kernel errors; J713 M4 Air (T8132 fallback-SoC) at29e245e9:nub_spmi/nub_spmi_a0256-vector default, 3/3rtcwake -d rtc1 -m no -s 10, 0 SPMI timeouts, 0 new failed units/kernel errors; CI (dt-checks,host-tests) green.Risk: one-way door (new DT properties
apple,response-vectorandapple,rtc-base; driver and DTS commits must land together) · M1 (T8103) and all Macs using"apple,t8103-spmi"fallback /rtc-apple-pmu.Not yet: other T8103 boards beyond J313, multi-hour alarm wakes, cold power-off wake.
Details
On Apple M1 (T8103) Macs, the Sera PMU RTC is not exposed to Linux and
nub-spmihas no interrupt wired int8103.dtsi. As a result, there is no PMU alarm RTC for timed wakeups (rtcwake), and enablingnub-spmi's interrupt on T8103 times out every SPMI command becausespmi-apple-controllerdefaulted"apple,t8103-spmi"to the 256-vector gen-1 layout instead of T8103's 192-vector layout.Commits (all 8 must stay together so kernels carry the driver support before booting a DTB with
nub_spmi's interrupt andpmu_rtcwired):dt-bindings: spmi: apple,spmi: add apple,response-vector(5c61e0295fc3): Document optionalapple,response-vector(non-zero multiple of 64, up to 256) for gen-1 SPMI controllers; disallow on gen-4 ("apple,t8142-spmi").arm64: dts: apple: t8103: describe nub-spmi response vector(d05dde0ba282): Publishapple,response-vector = <192>onnub_spmi(matching the first interrupt entry in the T8103 ADTnub-spminode).spmi: apple: read command response vector from DT(ec141ba114c7): Storenum_irqsper controller instance, readapple,response-vectoron gen-1 controllers with bounds/alignment validation, fall back to match-table default (256 for gen-1, 192 for T6000) when omitted, and warn if present on gen-4.nvmem: apple-spmi: populate Sera's child nodes(faae4f12ac1d): Calldevm_of_platform_populate()for"apple,sera-pmic"so the PMIC's child RTC probes.rtc: apple-pmu: read the RTC register block base from DT(a5eb4dea7c5e): Store relative offsets + defaultbaseinstruct apple_pmu_rtc_hw, read optionalapple,rtc-basewith 16-bit SPMI span validation (base <= 0xffffandbase + span <= 0x10000), and cover Sera's0xd000layout +reg-basemutation intools/asahi/pmu-rtc-tests.pyandrun-host-tests.py.dt-bindings: rtc: apple,j700-pmu-rtc: add apple,rtc-base and apple,t8103-pmu-rtc(9daec27d5608): Document optionalapple,rtc-base(uint32,maximum: 0xffff) and"apple,t8103-pmu-rtc"(with"apple,t8112-pmu-rtc"fallback). Usesapple,rtc-baseinstead ofregbecausepmic1sits under a#size-cells = <0>SPMI controller (#size-cells = <1>logsOF: Bad cell count, while#size-cells = <0>conflicts withnvmem.yaml).arm64: dts: apple: t8103: fix Sera PMU fault-shadow NVMEM offset(c94b3c3bfa76): Correctfault_shadowfrom0xa67bto0xa47bper T8103 ADTspmi-pmuinfo-fault_shadow = <42107 16>.arm64: dts: apple: t8103: wire the PMU RTC and nub-spmi's interrupt(29e245e97e7c): Wirenub_spmiAIC 343 interrupt + interrupt-controller, addpmu_rtc: rtc(apple,rtc-base = <0xd000>, SPMI IRQ 2,wakeup-source,rtc_offset), and aliasrtc0 = &smc_rtc,rtc1 = &pmu_rtc.Evidence
At exact head
29e245e97e7cc660daf5b00cd1d36bd4bbbf2057:Device tree checks/dt-checksPASS,Host tests/host-testsPASS (13/13pmu-rtcincluding Sera0xd000andreg-basemutation)../scripts/checkpatch.pl --strict --git a84637dca209..29e245e97e7c): 0 errors across all 8 commits.apple,j313,apple,t8103, 13.5 firmware, tested by@mmdisbrow):rtc0->macsmc-rtc,rtc1->apple-pmu-rtc(apple,rtc-base = 0xd000,wakeup = enabled,wakealarmpresent),nub_spmiapple,response-vector = 192+ AIC 343,fault-shadow@a47bpresent.spmi_nvmem2reads at0xa47band0xd000live; 6-byte counter at0xd002ticked +79,032 ticks (1.206 s at 65,536 Hz) over 1.2 s.s2idlealarm wakes (3×rtcwake -d rtc1 -m freeze -s 15, 1×rtcwake -d rtc1 -m no -s 15+freeze):suspend_stats/success0 -> 4, every wake in the programmed second,pm_wakeup_irq=126, IRQ 126 count0 -> 4.apple,j713,apple,t8132, default cmdline, fallback-SoC check):nub_spmiandnub_spmi_a0both boundapple-spmivia"apple,t8103-spmi"fallback with 256-vector default; PMIC0-0e, USB-PD1-0a/1-0c,spmi_nvmem0probed; 0 SPMI timeouts.rtc-apple-pmu(abbeylayout, noapple,rtc-base) probed asrtc1with default base; 3/3rtcwake -d rtc1 -m no -s 10fired via SPMI IRQ (count 1, 2, 3) andrtcwake -d rtc1 -m disablecleared armed alarm.Thanks to
@mmdisbrowfor running the J313 13.5 firmware exact-head verification.