Repository navigation
arm64: dts: apple: j700: SMC RTC in whole seconds and the full SMC sensor set - #39
Merged
Merged
Conversation
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
force-pushed
the
feat/j700-rtc-and-smc-sensors
branch
from
September 26, 2026 12:41
bb28e04 to
23b613d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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-secondsbinding, teachrtc-macsmcthe whole-seconds format (explicit little-endian read/write, a zero offset reported as invalid), and describe the RTC int8140.dtsi.macsmc-rtc: registered as rtc0, kernel sets the system clock from it at 3.5 s.hwclock -rvs system: 1 s;hwclock --systohclands (delta 1 s).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-selectedzone 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.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:
aurora-wipafter 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 bygit patch-idto the audited head, and the resulting tree isbac923ab36c5b471e5065b35f8a4fa07da4c05e5: 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-wipafter this merge is the tested tree, not anapproximation of it.
Co-authored-by:;Assisted-by: LLMwith the toolsrun per patch). Author, committer and Signed-off-by:
Ryan Murray <[email protected]>.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 --strict0 errors / 0 checks on all five (only the knownAssisted-byformat andCo-authored-bysignature notes);diff --checkclean;dt_binding_checkonrtc/apple,smc-rtc.yamlclean; at every commitrtc-macsmc.owithW=1 C=1(upstream sparse) warning-free andCHECK_DTBS=y apple/t8140-j700.dtbwith only the five inherited CS42L83 supply notes;dtc W=2only the knowndr_modeproperty-name warning; the built DTB carries 210 sensor nodes with 210 distinctapple,key-idvalues (no duplicates) and the RTC node withapple,rtc-offset-seconds.Nothing in the code changed, so the hardware results above stand.
🤖 Generated with Claude Code