arm64: dts: meson: enable rtc node on Khadas VIM1/VIM2 boards
authorChristian Hewitt <christianshewitt@gmail.com>
Mon, 16 Nov 2020 06:41:47 +0000 (06:41 +0000)
committerKevin Hilman <khilman@baylibre.com>
Mon, 30 Nov 2020 23:54:24 +0000 (15:54 -0800)
Enable the rtc node on VIM1/VIM2 boards so users can simply attach a power
cell and use the on-board RTC without modifying the device-tree.

Cold boot with no cell attached is gracefully handled:

VIM2:~ # dmesg | grep rtc
[    7.716150] rtc-hym8563 1-0051: no valid clock/calendar values available
[    7.716957] rtc-hym8563 1-0051: registered as rtc0
[    7.729850] rtc-hym8563 1-0051: no valid clock/calendar values available
[    7.729877] rtc-hym8563 1-0051: hctosys: unable to read the hardware clock
[    8.126768] rtc-hym8563 1-0051: no valid clock/calendar values available

Warm boot (and any boot with cell attached) recalls stored values resulting
in consistently faster (re)boot times:

VIM2:~ # dmesg | grep rtc
[    7.441671] rtc-hym8563 1-0051: registered as rtc0
[    7.442663] rtc-hym8563 1-0051: setting system clock to 2020-11-16T05:49:59 UTC (1605505799)

Suggested-by: Artem Lapkin <art@khadas.com>
Signed-off-by: Christian Hewitt <christianshewitt@gmail.com>
Reviewed-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Kevin Hilman <khilman@baylibre.com>
Link: https://lore.kernel.org/r/20201116064147.12062-1-christianshewitt@gmail.com
arch/arm64/boot/dts/amlogic/meson-gxl-s905x-khadas-vim.dts
arch/arm64/boot/dts/amlogic/meson-gxm-khadas-vim2.dts

index 8bcdffdf55d084d1e7bb7c86b60995e167f79e59..638a5992d76064aaeac699211a9cd4044b91e76b 100644 (file)
@@ -97,8 +97,7 @@
        pinctrl-names = "default";
 
        rtc: rtc@51 {
-               /* has to be enabled manually when a battery is connected: */
-               status = "disabled";
+               status = "okay";
                compatible = "haoyu,hym8563";
                reg = <0x51>;
                #clock-cells = <0>;
index bff8ec2c1c70ce1d13367533c8390ed3c13c99c3..da000c10b945b04ef8f21135c465407b1d3237d5 100644 (file)
        pinctrl-names = "default";
 
        rtc: rtc@51 {
-               /* has to be enabled manually when a battery is connected: */
-               status = "disabled";
+               status = "okay";
                compatible = "haoyu,hym8563";
                reg = <0x51>;
                #clock-cells = <0>;