mirror of https://lore.kernel.org/linux-amlogic/
 help / color / mirror / Atom feed
* [PATCH] arm64: dts: amlogic: odroid-go-ultra: use the RK818 RTC as rtc0
@ 2026-10-17 11:07 Shigeaki Asai
  2026-10-19  7:29 ` Neil Armstrong
  0 siblings, 1 reply; 4+ messages in thread
From: Shigeaki Asai @ 2026-10-17 11:07 UTC (permalink / raw)
  To: Neil Armstrong, Kevin Hilman
  Cc: Jerome Brunet, Martin Blumenstingl, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, devicetree, linux-arm-kernel,
	linux-amlogic, linux-kernel, Shigeaki Asai

The ODROID-GO Ultra has two PMICs with an RTC each, RK818 and RK817,
and the SoC has the meson virtual RTC. Only vrtc has an alias, rtc0.

An RTC without an alias takes the lowest free number, and the RK817
RTC registers early, so it usually becomes rtc0, the RTC the system
time is set from at boot. The RK817 RTC seems to run without a 32kHz
crystal on this board: it ran about 1.5% fast while the board was on
and 14-17% slow while it was off. The RK818 RTC keeps time well:
with it as rtc0, the clock was off by less than a second after the
board was off, with no charger connected, for 12 hours 40 minutes.

Use the RK818 RTC as rtc0, and give the other two RTCs an alias as
well, so that the numbering does not depend on probe order.

Fixes: 62e73f000696 ("arm64: dts: amlogic: add initial Odroid Go Ultra DTS")
Assisted-by: claude-opus-5-5
Signed-off-by: Shigeaki Asai <y-asai.0816@docomonet.jp>
---
 arch/arm64/boot/dts/amlogic/meson-g12b-odroid-go-ultra.dts | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-go-ultra.dts b/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-go-ultra.dts
index 348baa4e6d84..86902f68d7d4 100644
--- a/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-go-ultra.dts
+++ b/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-go-ultra.dts
@@ -18,7 +18,9 @@ / {
 
 	aliases {
 		serial0 = &uart_AO;
-		rtc0 = &vrtc;
+		rtc0 = &rk818;
+		rtc1 = &vrtc;
+		rtc2 = &rk817;
 	};
 
 	adc-joystick-left {
-- 
2.43.0


_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

^ permalink raw reply	[flat|nested] 4+ messages in thread
* [PATCH] arm64: dts: amlogic: odroid-go-ultra: use the RK818 RTC as rtc0
@ 2026-10-13 22:49 Shigeaki Asai
  0 siblings, 0 replies; 4+ messages in thread
From: Shigeaki Asai @ 2026-10-13 22:49 UTC (permalink / raw)
  To: Neil Armstrong, Kevin Hilman
  Cc: Jerome Brunet, Martin Blumenstingl, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, devicetree, linux-arm-kernel,
	linux-amlogic, linux-kernel, Shigeaki Asai

The ODROID-GO Ultra has two PMICs with an RTC each, RK818 and RK817,
and the SoC has the meson virtual RTC. Only vrtc has an alias, rtc0.

An RTC without an alias takes the lowest free number, and the RK817
RTC registers early, so it usually becomes rtc0, the RTC the system
time is set from at boot. The RK817 RTC seems to run without a 32kHz
crystal on this board: it ran about 1.5% fast while the board was on
and 14-17% slow while it was off. The RK818 RTC keeps time well:
with it as rtc0, the clock was off by less than a second after the
board was off, with no charger connected, for 12 hours 40 minutes.

Use the RK818 RTC as rtc0, and give the other two RTCs an alias as
well, so that the numbering does not depend on probe order.

Fixes: 62e73f000696 ("arm64: dts: amlogic: add initial Odroid Go Ultra DTS")
Assisted-by: claude-opus-5-5
Signed-off-by: Shigeaki Asai <y-asai.0816@docomonet.jp>
---
 arch/arm64/boot/dts/amlogic/meson-g12b-odroid-go-ultra.dts | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-go-ultra.dts b/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-go-ultra.dts
index 348baa4e6d84..86902f68d7d4 100644
--- a/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-go-ultra.dts
+++ b/arch/arm64/boot/dts/amlogic/meson-g12b-odroid-go-ultra.dts
@@ -18,7 +18,9 @@ / {
 
 	aliases {
 		serial0 = &uart_AO;
-		rtc0 = &vrtc;
+		rtc0 = &rk818;
+		rtc1 = &vrtc;
+		rtc2 = &rk817;
 	};
 
 	adc-joystick-left {
-- 
2.43.0


_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-10-19 13:05 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-17 11:07 [PATCH] arm64: dts: amlogic: odroid-go-ultra: use the RK818 RTC as rtc0 Shigeaki Asai
2026-10-19  7:29 ` Neil Armstrong
2026-10-19 13:04   ` Asai, Shigeaki
  -- strict thread matches above, loose matches on Subject: below --
2026-10-13 22:49 Shigeaki Asai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®