/dev/rtc0 vs /dev/rtc1

James Cameron quozl at laptop.org
Thu Sep 5 02:18:53 EDT 2013

(Context for devel@, Yioryos found that setting the system time from
/dev/rtc0 resulted in a year of 1970, which is because rtc0 is
internal to the SoC and has no backup battery, and rtc1 is external on
the motherboard and has good backup.  Our kernel already sets the time
during boot, because of CONFIG_RTC_HCTOSYS_DEVICE, so it isn't
necessary for user space to do so.)

On Wed, Sep 04, 2013 at 05:25:32AM -0700, Yioryos Asprobounitis wrote:
> Is there any case that ARM-XOs have the battery backed hwclock in
> rtc0?

The question rephrased;

- can a battery backup be added to the real-time clock usually
  enumerated as /dev/rtc0, or;

- will the battery backed real-time clock ever enumerate as /dev/rtc0
  instead of /dev/rtc1.

The answer to the first question is no, because there is no connection
from a battery for this, and the embedded controller switches off all
power input to the SoC.

The answer to the second question; we've not seen that happen
recently, it was fixed during development in #11400 in


but to be sure would require more research; look at the code in the
platform startup in the arm-3.0-wip and arm-3.5 branches of


And the device-tree structures in /proc/device-tree/i2c at d4031000 for
the rtc1, and /proc/device-tree/wakeup-rtc at d4010000 for the rtc0.

James Cameron

More information about the Devel mailing list