Open qzed opened 2 years ago
Some notes:
TLMM
pin 81 should be RTC wake interrupt pin, but that is not apparent in ACPI. ACPI only notifies the RTC via _WAK
method, but where does the wakeup signal originate from? _GWS
accesses some system memory region in DSDT and is not implemented in via SAM. What provides this region and sets the wake status?qcom,pm8941-rtc
?).There is indeed a qcom,pm8941-rtc
present (code here), but that shows a date of 1971 on my SPX and can't be changed. We can set the allow-set-time
property in DT, but then the set command stalls. So we should probably implement the SAM RTC as proper RTC device (unlike the ACPI TAD implementation), since it seems to be the only working RTC around.
More open questions:
- _GWS accesses some system memory region in DSDT and is not implemented in via SAM. What provides this region and sets the wake status?
Clarification on this: The respective SAM request still works (provided one gives the index to the timer as payload, i.e. 0 or 1 as u32, see ACPI spec). So do we actually need to access system memory or can we rely on SAM here?
Very basic RTC support has been implemented in https://github.com/linux-surface/kernel/commit/6b289bf17375b2c98292cd56d20bde7278560c82. This does not support any kind of alarms yet. For testing wake alarms/interrupts properly, we may need to make suspend work first.
Discussion on the built-in Qualcomm RTC and why that doesn't allow setting time: https://discuss.96boards.org/t/how-to-enable-rtc-on-dragonboard-410c-with-linaro-15-07/188/19.
The RTC used by Qualcomm uses an offset stored as UEFI variable for correction (882f8c2b-9646-435f-8de5-f208ff80c1bd-RTCInfo
). See https://lore.kernel.org/lkml/20230126142057.25715-20-johan+linaro@kernel.org/ for details.
A series to better support this RTC is being upstreamed: https://lore.kernel.org/lkml/20230202155448.6715-1-johan+linaro@kernel.org/ for details.
The Surface Pro X exposes a standard real-time clock ACPI interface (
ACPI000E
). This calls to the Surface Aggregator EC via the SAN interface. Add direct support for the RCT as SAM client device/driver combo. While not directly apparent in ACPI, there also seems to be a dedicated wake interrupt GPIO pin associated with the RTC.