Skip to content

arm64: dts: apple: j700: SMC RTC in whole seconds and the full SMC sensor set - #39

Merged
RyanTheTide merged 5 commits into
aurora-wipfrom
feat/j700-rtc-and-smc-sensors
Sep 26, 2026
Merged

RyanTheTide merged 5 commits into
aurora-wipfrom
feat/j700-rtc-and-smc-sensors

Conversation

@RyanTheTide

@RyanTheTide RyanTheTide commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

Five patches, tested on the J700 on 2026-09-26 as candidates 6 and 7 of the qualification (on top of the thermal walk b884471).

RTC. The T8140 PMU keeps the 65536 Hz counter at 0xf802 and Apple stores the wall-clock offset as whole seconds at 0xf704, not as 32768 Hz ticks as on M1/M2. Patches 1–3 add the apple,rtc-offset-seconds binding, teach rtc-macsmc the whole-seconds format (explicit little-endian read/write, a zero offset reported as invalid), and describe the RTC in t8140.dtsi.

  • Boot: macsmc-rtc: registered as rtc0, kernel sets the system clock from it at 3.5 s.
  • hwclock -r vs system: 1 s; hwclock --systohc lands (delta 1 s).
  • Offset survives a reboot: at the next boot the RTC-set system clock matched the host's clock to 0 s before anything on the target touched the clock.

SMC sensors. The tree exposed six die temperatures plus battery hotspot and two power keys. Patch 4 adds the other 77 read-only temperature keys from the machine's SMC key table (84 in total; the six policy sensors stay first, the apple-smc-selected zone is unchanged). Patch 5 adds every other current, power and voltage key (116 channels) labelled by raw key because what each rail measures is not known; it can be dropped on its own.

  • After boot: temp 84, curr 33, power 45, in 43 channels, 0 read errors; CPU maxima unchanged (4044/2424 MHz).
  • Named labels in patch 4 beyond the raw keys (Storage, Wi-Fi Module, USB-C Port, Ambient, Charger, Chassis 1–3) are descriptive guesses from the key groups and read plausibly at idle (36/39/35/33/77/53–58 C); treat them as unverified.

Review, 2026-09-26 (merge audit)

Reviewed against the same standards as the earlier merge campaign and merged from a branch that
differs from the audited head bb28e04bcc07 only in metadata:

  • Rebased onto aurora-wip after HID: dockchannel: bound empty GET_REPORT response buffers #33 and arm64: dts: apple: t8140-j700: enable the USB DARTs #34 (44ed24a). All five patches are identical by
    git patch-id to the audited head, and the resulting tree is
    bac923ab36c5b471e5065b35f8a4fa07da4c05e5: exactly the source tree of qualification candidate 7
    (built and booted on the J700 on 2026-09-26) and the
    base under candidate 8d. So aurora-wip after this merge is the tested tree, not an
    approximation of it.
  • Trailers put in the tree's canonical form (Co-authored-by:; Assisted-by: LLM with the tools
    run per patch). Author, committer and Signed-off-by: Ryan Murray <[email protected]>.
  • Order and scope are right for upstream: binding, driver, SoC node, then two board patches;
    the 116 raw-labelled current/power/voltage channels are reporting-only and can be dropped on
    their own, as the description says.

Checks on the merged branch: checkpatch --strict 0 errors / 0 checks on all five (only the known Assisted-by format and Co-authored-by signature notes); diff --check clean; dt_binding_check on rtc/apple,smc-rtc.yaml clean; at every commit rtc-macsmc.o with W=1 C=1 (upstream sparse) warning-free and CHECK_DTBS=y apple/t8140-j700.dtb with only the five inherited CS42L83 supply notes; dtc W=2 only the known dr_mode property-name warning; the built DTB carries 210 sensor nodes with 210 distinct apple,key-id values (no duplicates) and the RTC node with apple,rtc-offset-seconds.

Nothing in the code changed, so the hardware results above stand.

🤖 Generated with Claude Code

RyanTheTide and others added 5 commits September 26, 2026 22:37
The SMC RTC is a free-running counter in the PMU (read through the SMC
CLKM key at 32768 Hz) plus an offset kept in PMU NVMEM. On M1 and M2
the offset is a 48-bit count of 32768 Hz ticks.

The t8140 (A18 Pro, MacBook Neo J700) PMU keeps it differently: the
system firmware stores a 64-bit little-endian count of whole seconds in
the PMU's legacy scratchpad, and the register the device tree for older
SoCs would point at holds the running counter itself, which ignores
writes.

Add a boolean property selecting the whole-second format for the
rtc_offset cell, and describe both formats in the cell description.

Assisted-by: LLM checkpatch dt_binding_check
Co-authored-by: Claude Opus 5.5 <[email protected]>
Signed-off-by: Ryan Murray <[email protected]>
On the t8140 (A18 Pro, MacBook Neo J700) the system firmware keeps the
RTC offset in the PMU's legacy scratchpad as a 64-bit little-endian
count of whole seconds, not as the 48-bit count of 32768 Hz ticks used
on M1 and M2. The wall-clock time is the counter's integer seconds plus
that offset. On a J700 today the scratchpad at 0xf704 holds 1773779187,
and that plus the PMU counter's seconds matched the NTP-synchronised
system clock to within 0.01 s.

When the device tree sets apple,rtc-offset-seconds, read and write the
offset in that format. Writing now minus the counter's whole seconds
stores the same value the system firmware keeps, so the two operating
systems agree on the time. Report an all-zero offset as an invalid
time: nothing has been stored yet and the counter alone would put the
clock in 1970. The representable range starts at the epoch.

The tick format and its behaviour are unchanged.

Assisted-by: LLM checkpatch sparse
Co-authored-by: Claude Opus 5.5 <[email protected]>
Signed-off-by: Ryan Murray <[email protected]>
Describe the SMC RTC and the PMU NVMEM cell that holds its offset.

The t8140 PMU (USID 0xe on nub-spmi0) keeps the offset at 0xf704 in its
legacy scratchpad (0xf700), as 8 bytes little-endian of whole seconds;
the counter the device tree for M1 and M2 would point at (0xf802 here)
holds the running 65536 Hz counter and ignores writes. Mark the cell
format with apple,rtc-offset-seconds.

Without an RTC the J700 boots with no wall-clock time until the network
comes up.

Assisted-by: LLM checkpatch dtbs_check
Co-authored-by: Claude Opus 5.5 <[email protected]>
Signed-off-by: Ryan Murray <[email protected]>
The J700 SMC hwmon node lists the six CPU die temperatures, plus the
Battery Hotspot key from hwmon-laptop.dtsi. The SMC's own key table
holds 84 live temperature channels: every read-only float T* key that
reads between 10 and 99 C and changes between samples.

Add the other 77. Eight get a name after the SMC key group they belong
to (storage, Wi-Fi module, USB-C port, ambient, charger and three
chassis sensors); the rest are labelled with their raw key, since their
placement is not known.

They follow the six die temperatures, which the J700 CPU thermal
policy expects as the first temperature channels, and are reported
only; the policy does not read them.

Assisted-by: LLM checkpatch dtbs_check
Co-authored-by: Claude Opus 5.5 <[email protected]>
Signed-off-by: Ryan Murray <[email protected]>
…ltage rails

hwmon-common.dtsi and hwmon-laptop.dtsi give the J700 its AC input
current, voltage and power, total system power and battery voltage.
The SMC's key table has 120 read-only float keys in the I*, P* and V*
groups; add the 116 not already described, as current, power and
voltage channels.

The units follow the key prefix, as for the keys the common files
already use; on this machine the battery keys agree with each other
(VBat x IBat = PBat), as do the AC input keys (VD0R x ID0R = PDTR).
Which rail each key measures is not known, so they are labelled with
the raw key. Some read zero while the machine is idle.

Assisted-by: LLM checkpatch dtbs_check
Co-authored-by: Claude Opus 5.5 <[email protected]>
Signed-off-by: Ryan Murray <[email protected]>
@RyanTheTide
RyanTheTide force-pushed the feat/j700-rtc-and-smc-sensors branch from bb28e04 to 23b613d Compare September 26, 2026 12:41
@RyanTheTide
RyanTheTide merged commit 7f5fe6f into aurora-wip Sep 26, 2026
@RyanTheTide
RyanTheTide deleted the feat/j700-rtc-and-smc-sensors branch September 26, 2026 12:45
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