Enable RTC on Odroid N2
Subsystems (2)
cover Enable RTC on Odroid N2
Inoder for test suspend resume feature on Odroid N2 we need to enable RTC module on this device.
Following patches enable rtc on Odroid N2 but sill rtcwakeup is not working se bellow. Any inputs are welcome.
# sudo hwclock -r && date 2020-07-15 15:53:27.706883+00:00 Wed Jul 15 15:53:27 UTC 2020
# echo 1 > /sys/power/pm_debug_messages bash: /sys/power/pm_debug_messages: Permission denied # time rtcwake -s 30 -m mem rtcwake: /dev/rtc0 not enabled for wakeup events
real 0m0.003s user 0m0.003s sys 0m0.000s
#
-Anand
Anand Moon (3):
arm64: dts: meson-g12b-odroid-n2: Enable RTC controller node
arm64: dts: meson-g12b-odroid-n2: Disable virtual wake RTC
arm64: defconfig: Enable RTC devices for Amlogic boards
.../boot/dts/amlogic/meson-g12b-odroid-n2.dts | 18 ++++++++++++++++++ arch/arm64/configs/defconfig | 1 + 2 files changed, 19 insertions(+)
Signature · 7 lines
2.27.0 _______________________________________________ linux-amlogic mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-amlogic
PATCH 1/3 arm64: dts: meson-g12b-odroid-n2: Enable RTC controller node
Enable RTC PCF8563 node on Odroid-N2 SBC, In order to support the RTC wakealarm feature for suspend and resume.
---
$ sudo hwclock -r && date 2020-07-15 13:11:53.862508+00:00 Wed Jul 15 13:11:54 UTC 2020
$ hwclock --show 2020-07-15 13:17:30.903300+00:00
But RTC wake up is not working at my end. Any inputs are welcome.
$ time rtcwake -s 30 -m mem rtcwake: /dev/rtc0 not enabled for wakeup events
real 0m0.002s user 0m0.002s sys 0m0.000s --- .../boot/dts/amlogic/meson-g12b-odroid-n2.dts | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dts +14 -0
@@ -391,6 +391,20 @@ hdmi_tx_tmds_out: endpoint { }; }; +&i2c3 { + pinctrl-0 = <&i2c3_sda_a_pins>, <&i2c3_sck_a_pins>; + pinctrl-names = "default"; + status = "okay"; + + rtc: rtc@51 { + reg = <0x51>; + compatible = "nxp,pcf8563"; + #clock-cells = <0>; + clock-frequency = <32768>; + clock-output-names = "rtc_clkout"; + }; +}; + &ir { status = "okay"; pinctrl-0 = <&remote_input_ao_pins>;
Signature · 7 lines
2.27.0 _______________________________________________ linux-amlogic mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-amlogic
PATCH 2/3 arm64: dts: meson-g12b-odroid-n2: Disable virtual wake RTC
In reply to Anand MoonDisable virtual wake RTC node on Odroid N2.
[ 7.171149] meson-vrtc ff8000a8.rtc: registered as rtc0 [ 7.182875] meson-vrtc ff8000a8.rtc: setting system clock to 1970-01-01T00:00:07 UTC (7)
---
--- arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dts | 4 ++++ 1 file changed, 4 insertions(+)
arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dts +4 -0
@@ -517,3 +517,7 @@ &usb2_phy1 { /* Enable the hub which is connected to this port */ phy-supply = <&hub_5v>; }; + +&vrtc { + status = "disabled"; +};
Signature · 7 lines
2.27.0 _______________________________________________ linux-amlogic mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-amlogic
PATCH 3/3 arm64: defconfig: Enable RTC devices for Amlogic boards
In reply to Anand MoonEnables the RTC PCF8563 driver used on Amlogic Libretech-pc and Odroid-N2 boards supported in mainline kernel.
--- arch/arm64/configs/defconfig | 1 + 1 file changed, 1 insertion(+)
arch/arm64/configs/defconfig +1 -0
@@ -750,6 +750,7 @@ CONFIG_RTC_DRV_DS1307=m CONFIG_RTC_DRV_MAX77686=y CONFIG_RTC_DRV_RK808=m CONFIG_RTC_DRV_PCF85363=m +CONFIG_RTC_DRV_PCF8563=m CONFIG_RTC_DRV_RX8581=m CONFIG_RTC_DRV_S5M=y CONFIG_RTC_DRV_DS3232=y
Signature · 7 lines
2.27.0 _______________________________________________ linux-amlogic mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-amlogic
Hi Anand,
Only the vrtc is able to wakeup the device from suspend, the external RTC is not capable.
Neil
Quoted 32 lines · Anand Moon
Inoder for test suspend resume feature on Odroid N2 we need to enable RTC module on this device.
Following patches enable rtc on Odroid N2 but sill rtcwakeup is not working se bellow. Any inputs are welcome.
# sudo hwclock -r && date 2020-07-15 15:53:27.706883+00:00 Wed Jul 15 15:53:27 UTC 2020# echo 1 > /sys/power/pm_debug_messages bash: /sys/power/pm_debug_messages: Permission denied # time rtcwake -s 30 -m mem rtcwake: /dev/rtc0 not enabled for wakeup eventsreal 0m0.003s user 0m0.003s sys 0m0.000s#
-Anand
Anand Moon (3):
arm64: dts: meson-g12b-odroid-n2: Enable RTC controller node
arm64: dts: meson-g12b-odroid-n2: Disable virtual wake RTC
arm64: defconfig: Enable RTC devices for Amlogic boards.../boot/dts/amlogic/meson-g12b-odroid-n2.dts | 18 ++++++++++++++++++ arch/arm64/configs/defconfig | 1 + 2 files changed, 19 insertions(+)
Re: [PATCHv1 2/3] arm64: dts: meson-g12b-odroid-n2: Disable virtual wake RTC
In reply to Anand MoonHi,
Quoted 19 lines · Anand Moon
Disable virtual wake RTC node on Odroid N2.
[ 7.171149] meson-vrtc ff8000a8.rtc: registered as rtc0 [ 7.182875] meson-vrtc ff8000a8.rtc: setting system clock to 1970-01-01T00:00:07 UTC (7)Cc Neil Armstrong <[email protected]>Cc Kevin Hilman <[email protected]>Signed-off-by Anand Moon <[email protected]>---
--- arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dts | 4 ++++ 1 file changed, 4 insertions(+)arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dts +0
-0
arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dts &usb2_phy1 { · line 523
Quoted 7 lines
arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dts +4
-0@@ -517,3 +517,7 @@ &usb2_phy1 { /* Enable the hub which is connected to this port */ phy-supply = <&hub_5v>; }; + +&vrtc { + status = "disabled"; +};
Please don't, the vrtc is here to wake up the device.
Neil
Re: [PATCHv1 1/3] arm64: dts: meson-g12b-odroid-n2: Enable RTC controller node
In reply to Anand MoonHi,
Quoted 36 lines · Anand Moon
Enable RTC PCF8563 node on Odroid-N2 SBC, In order to support the RTC wakealarm feature for suspend and resume.
Cc Neil Armstrong <[email protected]>Cc Kevin Hilman <[email protected]>Signed-off-by Anand Moon <[email protected]>---
$ sudo hwclock -r && date 2020-07-15 13:11:53.862508+00:00 Wed Jul 15 13:11:54 UTC 2020$ hwclock --show 2020-07-15 13:17:30.903300+00:00But RTC wake up is not working at my end. Any inputs are welcome.
$ time rtcwake -s 30 -m mem rtcwake: /dev/rtc0 not enabled for wakeup eventsreal 0m0.002s user 0m0.002s sys 0m0.000s --- .../boot/dts/amlogic/meson-g12b-odroid-n2.dts | 14 ++++++++++++++ 1 file changed, 14 insertions(+)arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dts +1
-0@@ -391,6 +391,20 @@ hdmi_tx_tmds_out: endpoint { }; }; +&i2c3 {
arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dts hdmi_tx_tmds_out: endpoint { · line 404
Quoted 10 lines
arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dts +10
-0+ pinctrl-0 = <&i2c3_sda_a_pins>, <&i2c3_sck_a_pins>; + pinctrl-names = "default"; + status = "okay"; + + rtc: rtc@51 { + reg = <0x51>; + compatible = "nxp,pcf8563"; + #clock-cells = <0>; + clock-frequency = <32768>; + clock-output-names = "rtc_clkout";
The clkout output is not used, so I don't think these 3 lines are needed.
arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dts hdmi_tx_tmds_out: endpoint { · line 410
Quoted 7 lines
arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dts +3
-0+ }; +}; + &ir { status = "okay"; pinctrl-0 = <&remote_input_ao_pins>;
Neil
Re: [PATCHv1 3/3] arm64: defconfig: Enable RTC devices for Amlogic boards
In reply to Anand MoonQuoted 15 lines · Anand Moon
Enables the RTC PCF8563 driver used on Amlogic Libretech-pc and Odroid-N2 boards supported in mainline kernel.
Cc Kevin Hilman <[email protected]>Signed-off-by Anand Moon <[email protected]>--- arch/arm64/configs/defconfig | 1 + 1 file changed, 1 insertion(+)arch/arm64/configs/defconfig +0
-0
arch/arm64/configs/defconfig CONFIG_RTC_DRV_DS1307=m · line 756
Quoted 7 lines
arch/arm64/configs/defconfig +1
-0@@ -750,6 +750,7 @@ CONFIG_RTC_DRV_DS1307=m CONFIG_RTC_DRV_MAX77686=y CONFIG_RTC_DRV_RK808=m CONFIG_RTC_DRV_PCF85363=m +CONFIG_RTC_DRV_PCF8563=m CONFIG_RTC_DRV_RX8581=m CONFIG_RTC_DRV_S5M=y CONFIG_RTC_DRV_DS3232=y
Re: [PATCHv1 2/3] arm64: dts: meson-g12b-odroid-n2: Disable virtual wake RTC
In reply to Neil ArmstrongHi Neil,
Thanks for your review comments.
Quoted 33 lines · Neil Armstrong
Hi,
Quoted 19 lines · Anand Moon
Disable virtual wake RTC node on Odroid N2.
[ 7.171149] meson-vrtc ff8000a8.rtc: registered as rtc0 [ 7.182875] meson-vrtc ff8000a8.rtc: setting system clock to 1970-01-01T00:00:07 UTC (7)Cc Neil Armstrong <[email protected]>Cc Kevin Hilman <[email protected]>Signed-off-by Anand Moon <[email protected]>---
--- arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dts | 4 ++++ 1 file changed, 4 insertions(+)arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dts +0
-0arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dts &usb2_phy1 { · line 523
Quoted 7 lines
arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dts +4
-0@@ -517,3 +517,7 @@ &usb2_phy1 { /* Enable the hub which is connected to this port */ phy-supply = <&hub_5v>; }; + +&vrtc { + status = "disabled"; +};Please don't, the vrtc is here to wake up the device.
Quoted 1 line
Neil
Ok, I thought that there would be conflicts with the RTC module, that's why I disable this node. I will drop this patch.
-Anand
Re: [PATCHv1 1/3] arm64: dts: meson-g12b-odroid-n2: Enable RTC controller node
In reply to Neil ArmstrongHi Neil,
Thanks for your review comments.
Quoted 39 lines · Neil Armstrong
Hi,
Quoted 35 lines · Anand Moon
Enable RTC PCF8563 node on Odroid-N2 SBC, In order to support the RTC wakealarm feature for suspend and resume.
Cc Neil Armstrong <[email protected]>Cc Kevin Hilman <[email protected]>Signed-off-by Anand Moon <[email protected]>---
$ sudo hwclock -r && date 2020-07-15 13:11:53.862508+00:00 Wed Jul 15 13:11:54 UTC 2020$ hwclock --show 2020-07-15 13:17:30.903300+00:00But RTC wake up is not working at my end. Any inputs are welcome.
$ time rtcwake -s 30 -m mem rtcwake: /dev/rtc0 not enabled for wakeup eventsreal 0m0.002s user 0m0.002s sys 0m0.000s --- .../boot/dts/amlogic/meson-g12b-odroid-n2.dts | 14 ++++++++++++++ 1 file changed, 14 insertions(+)arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dts +0
-0@@ -391,6 +391,20 @@ hdmi_tx_tmds_out: endpoint { }; };
Quoted 13 lines
arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dts hdmi_tx_tmds_out: endpoint { · line 404
Quoted 11 lines
arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dts +11
-0+&i2c3 { + pinctrl-0 = <&i2c3_sda_a_pins>, <&i2c3_sck_a_pins>; + pinctrl-names = "default"; + status = "okay"; + + rtc: rtc@51 { + reg = <0x51>; + compatible = "nxp,pcf8563"; + #clock-cells = <0>; + clock-frequency = <32768>; + clock-output-names = "rtc_clkout";The clkout output is not used, so I don't think these 3 lines are needed.
Ok Thanks I will drop these 3 clock lines.
Quoted 10 lines
arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dts hdmi_tx_tmds_out: endpoint { · line 410
Quoted 8 lines
arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dts +3
-0+ }; +}; + &ir { status = "okay"; pinctrl-0 = <&remote_input_ao_pins>;Neil
-Anand
Jerome Brunet
reviewerRe: [PATCHv1 1/3] arm64: dts: meson-g12b-odroid-n2: Enable RTC controller node
In reply to Anand MoonQuoted 37 lines · Anand Moon
Enable RTC PCF8563 node on Odroid-N2 SBC, In order to support the RTC wakealarm feature for suspend and resume.
Cc Neil Armstrong <[email protected]>Cc Kevin Hilman <[email protected]>Signed-off-by Anand Moon <[email protected]>---
$ sudo hwclock -r && date 2020-07-15 13:11:53.862508+00:00 Wed Jul 15 13:11:54 UTC 2020$ hwclock --show 2020-07-15 13:17:30.903300+00:00But RTC wake up is not working at my end. Any inputs are welcome.
$ time rtcwake -s 30 -m mem rtcwake: /dev/rtc0 not enabled for wakeup eventsreal 0m0.002s user 0m0.002s sys 0m0.000s --- .../boot/dts/amlogic/meson-g12b-odroid-n2.dts | 14 ++++++++++++++ 1 file changed, 14 insertions(+)arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dts +2
-0@@ -391,6 +391,20 @@ hdmi_tx_tmds_out: endpoint { }; }; +&i2c3 { + pinctrl-0 = <&i2c3_sda_a_pins>, <&i2c3_sck_a_pins>;
arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dts hdmi_tx_tmds_out: endpoint { · line 405
Quoted 10 lines
arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dts +10
-0+ pinctrl-names = "default"; + status = "okay"; + + rtc: rtc@51 { + reg = <0x51>; + compatible = "nxp,pcf8563"; + #clock-cells = <0>; + clock-frequency = <32768>; + clock-output-names = "rtc_clkout"; + };
This rtc being on a connector, optional and not fitted by default, should it really be enabled for all odroid-n2 ?
We tend not do that usually
Quoted 5 lines
arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dts +2
-0+}; + &ir { status = "okay"; pinctrl-0 = <&remote_input_ao_pins>;
Hi Neil,
Thanks for your review comments.
Quoted 7 lines · Neil Armstrong
Hi Anand,
Only the vrtc is able to wakeup the device from suspend, the external RTC is not capable.
Neil
Now I have two RTC driver registered
$ dmesg | grep rtc [ 4.737315] rtc-pcf8563 0-0051: registered as rtc0 [ 4.738763] rtc-pcf8563 0-0051: setting system clock to 2020-07-16T08:00:46 UTC (1594886446) [ 4.790206] meson-vrtc ff8000a8.rtc: registered as rtc1
And there are two nodes
# ls /dev/rtc* /dev/rtc /dev/rtc0 /dev/rtc1
So it seames an issue that /dev/rtc0 is not able to handle wakeup events. How can we resolve this issue?
# time rtcwake -s 30 -m mem rtcwake: /dev/rtc0 not enabled for wakeup events
real 0m0.002s user 0m0.001s sys 0m0.002s
-Anand
Hi,
Quoted 22 lines · Anand Moon
Hi Neil,
Thanks for your review comments.
Quoted 7 lines · Neil Armstrong
Hi Anand,
Only the vrtc is able to wakeup the device from suspend, the external RTC is not capable.
Neil
Now I have two RTC driver registered
$ dmesg | grep rtc [ 4.737315] rtc-pcf8563 0-0051: registered as rtc0 [ 4.738763] rtc-pcf8563 0-0051: setting system clock to 2020-07-16T08:00:46 UTC (1594886446) [ 4.790206] meson-vrtc ff8000a8.rtc: registered as rtc1And there are two nodes
Quoted 8 lines
# ls /dev/rtc* /dev/rtc /dev/rtc0 /dev/rtc1So it seames an issue that
/dev/rtc0is not able to handle wakeup events. How can we resolve this issue?# time rtcwake -s 30 -m mem rtcwake: /dev/rtc0 not enabled for wakeup events
rtcwake -d /dev/rtc1 -s 30 -m mem
As Christian reported off-list, it may be necessary to keep the vrtc as rtc0, so you should add aliases in the odroid-n2 DT to have vrtc as rtc0 and the on-board rtc as rtc1, but it may break the hwclock tools, so the reverse may be better but you'll need to specify rtc1 to rtcwake.
Neil
Quoted 7 lines
real 0m0.002s user 0m0.001s sys 0m0.002s-Anand
Hi,
Quoted 34 lines · Neil Armstrong
Hi,
Quoted 22 lines · Anand Moon
Hi Neil,
Thanks for your review comments.
Quoted 7 lines · Neil Armstrong
Hi Anand,
Only the vrtc is able to wakeup the device from suspend, the external RTC is not capable.
Neil
Now I have two RTC driver registered
$ dmesg | grep rtc [ 4.737315] rtc-pcf8563 0-0051: registered as rtc0 [ 4.738763] rtc-pcf8563 0-0051: setting system clock to 2020-07-16T08:00:46 UTC (1594886446) [ 4.790206] meson-vrtc ff8000a8.rtc: registered as rtc1And there are two nodes
Quoted 8 lines
# ls /dev/rtc* /dev/rtc /dev/rtc0 /dev/rtc1So it seames an issue that
/dev/rtc0is not able to handle wakeup events. How can we resolve this issue?# time rtcwake -s 30 -m mem rtcwake: /dev/rtc0 not enabled for wakeup events
Quoted 6 lines
rtcwake -d
/dev/rtc1-s 30 -m memAs Christian reported off-list, it may be necessary to keep the vrtc as rtc0, so you should add aliases in the odroid-n2 DT to have vrtc as rtc0 and the on-board rtc as rtc1, but it may break the hwclock tools, so the reverse may be better but you'll need to specify rtc1 to rtcwake.
While looking closer to the Odroid-N2 schematics and U-Boot/SCP Firmware, the external on-board RTC can wake the device with the GPIO_AO 7, and wakeup is enabled in:
https://github.com/hardkernel/u-boot/blob/odroidn2-v2015.01/board/hardkernel/odroidn2/firmware/scp_task/pwr_ctrl.c#L143
So, something must be missing.
Neil
Quoted 11 lines
Neil
Quoted 7 lines
real 0m0.002s user 0m0.001s sys 0m0.002s-Anand
Re: [PATCHv1 1/3] arm64: dts: meson-g12b-odroid-n2: Enable RTC controller node
In reply to Jerome BrunetHi Jerome,
Thanks for your review comments.
Quoted 55 lines · Jerome Brunet
Quoted 37 lines · Anand Moon
Enable RTC PCF8563 node on Odroid-N2 SBC, In order to support the RTC wakealarm feature for suspend and resume.
Cc Neil Armstrong <[email protected]>Cc Kevin Hilman <[email protected]>Signed-off-by Anand Moon <[email protected]>---
$ sudo hwclock -r && date 2020-07-15 13:11:53.862508+00:00 Wed Jul 15 13:11:54 UTC 2020$ hwclock --show 2020-07-15 13:17:30.903300+00:00But RTC wake up is not working at my end. Any inputs are welcome.
$ time rtcwake -s 30 -m mem rtcwake: /dev/rtc0 not enabled for wakeup eventsreal 0m0.002s user 0m0.002s sys 0m0.000s --- .../boot/dts/amlogic/meson-g12b-odroid-n2.dts | 14 ++++++++++++++ 1 file changed, 14 insertions(+)arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dts +2
-0@@ -391,6 +391,20 @@ hdmi_tx_tmds_out: endpoint { }; }; +&i2c3 { + pinctrl-0 = <&i2c3_sda_a_pins>, <&i2c3_sck_a_pins>;arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dts hdmi_tx_tmds_out: endpoint { · line 405
Quoted 10 lines
arch/arm64/boot/dts/amlogic/meson-g12b-odroid-n2.dts +10
-0+ pinctrl-names = "default"; + status = "okay"; + + rtc: rtc@51 { + reg = <0x51>; + compatible = "nxp,pcf8563"; + #clock-cells = <0>; + clock-frequency = <32768>; + clock-output-names = "rtc_clkout"; + };This rtc being on a connector, optional and not fitted by default, should it really be enabled for all odroid-n2 ?
Quoted 1 line
We tend not do that usually
My thought process was there will be an Internal primary interrupt pin that handles
RTC wakeup and is connected to the CPU and IO peripherals..
-Anand
hi Neil,
Quoted 45 lines · Neil Armstrong
Hi,
Quoted 34 lines · Neil Armstrong
Hi,
Quoted 22 lines · Anand Moon
Hi Neil,
Thanks for your review comments.
Quoted 7 lines · Neil Armstrong
Hi Anand,
Only the vrtc is able to wakeup the device from suspend, the external RTC is not capable.
Neil
Now I have two RTC driver registered
$ dmesg | grep rtc [ 4.737315] rtc-pcf8563 0-0051: registered as rtc0 [ 4.738763] rtc-pcf8563 0-0051: setting system clock to 2020-07-16T08:00:46 UTC (1594886446) [ 4.790206] meson-vrtc ff8000a8.rtc: registered as rtc1And there are two nodes
Quoted 8 lines
# ls /dev/rtc* /dev/rtc /dev/rtc0 /dev/rtc1So it seames an issue that
/dev/rtc0is not able to handle wakeup events. How can we resolve this issue?# time rtcwake -s 30 -m mem rtcwake: /dev/rtc0 not enabled for wakeup eventsQuoted 6 lines
rtcwake -d
/dev/rtc1-s 30 -m memAs Christian reported off-list, it may be necessary to keep the vrtc as rtc0, so you should add aliases in the odroid-n2 DT to have vrtc as rtc0 and the on-board rtc as rtc1, but it may break the hwclock tools, so the reverse may be better but you'll need to specify rtc1 to rtcwake.
Quoted 6 lines
While looking closer to the Odroid-N2 schematics and U-Boot/SCP Firmware, the external on-board RTC can wake the device with the
GPIO_AO7, and wakeup is enabled in:
https://github.com/hardkernel/u-boot/blob/odroidn2-v2015.01/board/hardkernel/odroidn2/firmware/scp_task/pwr_ctrl.c#L143So, something must be missing.
Ok I have missed this setting.
But I could not find any more information on this configuration in S922X_Public_Datasheet_V0.2-Hardkernel,
But HK uses the same set up as we do.
https://github.com/hardkernel/linux/blob/odroidn2-4.9.y/arch/arm64/boot/dts/amlogic/mesong12_odroid_common.dtsi#L322-L333
I could not gather much input from this configration.
Does VIM3 support VRTC or do they prefer rtc wakeup via RTC ?
-Anand
Kevin Hilman
maintainerQuoted 44 lines · Neil Armstrong
Hi,
Quoted 34 lines · Neil Armstrong
Hi,
Quoted 22 lines · Anand Moon
Hi Neil,
Thanks for your review comments.
Quoted 7 lines · Neil Armstrong
Hi Anand,
Only the vrtc is able to wakeup the device from suspend, the external RTC is not capable.
Neil
Now I have two RTC driver registered
$ dmesg | grep rtc [ 4.737315] rtc-pcf8563 0-0051: registered as rtc0 [ 4.738763] rtc-pcf8563 0-0051: setting system clock to 2020-07-16T08:00:46 UTC (1594886446) [ 4.790206] meson-vrtc ff8000a8.rtc: registered as rtc1And there are two nodes
Quoted 8 lines
# ls /dev/rtc* /dev/rtc /dev/rtc0 /dev/rtc1So it seames an issue that
/dev/rtc0is not able to handle wakeup events. How can we resolve this issue?# time rtcwake -s 30 -m mem rtcwake: /dev/rtc0 not enabled for wakeup eventsQuoted 6 lines
rtcwake -d
/dev/rtc1-s 30 -m memAs Christian reported off-list, it may be necessary to keep the vrtc as rtc0, so you should add aliases in the odroid-n2 DT to have vrtc as rtc0 and the on-board rtc as rtc1, but it may break the hwclock tools, so the reverse may be better but you'll need to specify rtc1 to rtcwake.
Quoted 5 lines
While looking closer to the Odroid-N2 schematics and U-Boot/SCP Firmware, the external on-board RTC can wake the device with the
GPIO_AO7, and wakeup is enabled in:
https://github.com/hardkernel/u-boot/blob/odroidn2-v2015.01/board/hardkernel/odroidn2/firmware/scp_task/pwr_ctrl.c#L143So, something must be missing.
A couple possibilities come to mind (without looking at the specific RTC driver):
1) pinctrl for that GPIO needs proper settings
2) DT node for the RTC needs "wakeup-source" property
Kevin