Re: [PATCH 4/5] rtc: Add basic support for RTC via Surface System Aggregator Module
From: Val Packett
Date: Tue Nov 24 2026 - 13:31:01 EST
On 11/23/26 10:11 AM, Emfox Zhou wrote:
Hi Val,Didn't think anyone else would be interested though :) as the SPX is the only machine with *no other working RTC at all*.
Tested on a Surface Pro 8 (x86, Tiger Lake): this is not SPX/ARM-only, the
same SAM RTC sits behind the aggregator there. Two things came out of it.
First, as posted the driver cannot bind on the x86 machines: 5/5 adds
ssam_node_rtc only to ssam_node_group_spx[], while the x86 devices come
from the ACPI-matched groups. With one line in ssam_node_group_sp8[],
&ssam_node_rtc,
"ssam:01:01:01:00:00" appears and the driver registers rtc2:
surface_rtc 01:01:01:00:00: registered as rtc2
It would be good to have the node in the other x86 groups as well. Note
that the node name will collide with the SPX one, so whichever lands
first keeps it.
Well, I don't have all these machines to test on, so I wasn't very confident about adding it to other groups. I could do it though, sure.
Second, set_time() needs a timezone compensation. The EC keeps UTC in theAck
SAM timestamp (CID 0x10), but also exposes _GRT (CID 0x1f), the same clock
plus the zone stored in the EC, and the firmware copies _GRT into rtc_cmos
at POST. Right after a cold boot here:
rtc0 read at boot 1795199717
true UTC at boot 1795170940
EC _GRT at boot 1795199714 (zone +28800)
so CMOS came from _GRT, 8 h ahead of UTC. The write side shows the same:
after "hwclock -w -f /dev/rtc2" the SAM timestamp equals system UTC and
_GRT is then UTC + zone, so the next cold boot is off by the zone again.
Either write (UTC - zone), taking the zone from _GRT minus the timestamp,
or state that this RTC is local time and leave the conversion to user
space.
Tested-by: Emfox Zhou <emfox@xxxxxxxxxx> # Surface Pro 8 (x86), with ssam_node_rtc added
Since the same RTC is on the x86 machines, the descriptions are no longer
accurate either: the commit message, the Kconfig help and the MAINTAINERS
entry all name the Pro X: [..]
Sure, I'll change the names!
Thanks,
~val