AGX Orin: rtc0 vs rtc1

There are 2 real time clocks on Orin: rtc0 and rtc1. The rtc0 can be supported by the battery, but rtc1 cannot. The kernel however is configured to sync time with rtc1, which causes the time to be incorrect at the boot, until it is synced with network time.

Are there specific reasons for kernel using rtc1?
Are there any known issues with re-configuring the kernel to use rtc0?

1 Like

Hi,

rtc0 is supported by other power management IC, while rtc1 is inside the Tegra SoC itself. We set rtc1 as default because it runs on TSC (Time Stamp Counter), and has higher accuracy.

You may config the udev rules as follow if you want to use rtc0:
inside /lib/udev/rules.d/50-udev-default.rules

SUBSYSTEM==“rtc”, ATTR{hctosys}==“0”, SYMLINK+=“rtc”
SUBSYSTEM==“rtc”, KERNEL==“rtc0”, SYMLINK+=“rtc”, OPTIONS+=“link_priority=-100”

Or change CONFIG_RTC_HCTOSYS_DEVICE in kernel config and build again to use rtc0.

2 Likes

Thank you for the info.

Changing the udev rule will only affect some tools, for example timedatectl. To have kernel sync with rtc0, you have to redefine CONFIG_RTC_HCTOSYS_DEVICE and rebuild.

Could you please provide more info (or point me to the resource) on the TSC (Time Stamp Counter) - where and how it is used?

2 Likes

Hi,

You may refer to the Wiki page:

It’s basically a register which count CPU clock cycles.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.