I am trying to get my 64GB AGX Orin on JP5.1.1 to use RTC0 but after a reboot the system time is incorrect and /proc/driver/rtc information conflicts with timedatectl rtc infomation.
what I have done:
Confirm JP version to show RTC0 is supported:
apt-cache show nvidia-jetpack | grep "Version"
Confirm System is using RTC0 with Udev rule:
cat /lib/udev/rules.d/50-udev-default.rules | grep "rtc"
I have changed this Udev rule as I don’t really want to rebuild the Kernel to change from the default rtc1 to rtc0.
Confirm system has access to rtc0 and correct symbolic link:
ls -l /dev/ | grep rtc
ls -al /dev/rtc
This symbolic link also persist between power cycles so should always use rtc0
I then set the system time and then set the hardware clock from the current system time:
NEW_TIME="$(wget -qSO- --max-redirect=0 google.com 2>&1 | grep Date: | cut -d' ' -f5-8)Z"
sudo date -s "$NEW_TIME"
sudo hwclock -w
timedatectl
cat /proc/driver/rtc
sudo hwclock --show
I believe this has worked as the system, RTC and hwclock all agree with each other:
I then disconnect form the internet and power cycle the device. I then test to see if the RTC , system and hwclock are still correct:
timedatectl show
cat /proc/driver/rtc
sudo hwclock --show
It looks like the hardware clock is correct after a power cycle but the system time does not automatically update from it. I am also a bit confused why /proc/driver/rtc shows 1970 or is that because this only reports rtc1? If so it would make sense.
I can then run the command hwclock -s to set the system time from the RTC and it works. I can even have this scripted so it does this automatically every reboot, but the problem is that all the time stamps at boot before this sync is done are incorrect.
so my question are:
-
How can I get the system time to automatically use the hwclock?
-
Is it possible to do this without rebuilding the kernel?
-
if I rebuild the kernel to use rtc0 by default will the system time to automatically use the hwclock?