Using realtime clock?

Gabriel Paubert paubert at
Wed Jan 10 20:30:57 EST 2001

On Wed, 10 Jan 2001, Jari Nguyen Trung Thanh wrote:

> Hello,
> I'm a junior, pls help me...
> I'm using Hardhat 2.2.14, and I ported it in a custom board
> successfully.
> This board has its own realtime clock, pls tell me where I can modify in
> the kernel
> so that all of the time function in linux can use my realtime
> clock...such as
> date function...or filesystem....

You don't want to use the real time clock for this. Getting the time is a
very frequent opeartion and you don't want to do I/O on every
gettimeofday. even if your RTC is (hopefully) in UTC, it  probably does
not keep time in the right format for the kernel (it is much more likely
to use a split format with year, month, day, hour, minutes and seconds in
different registers). Many do not provide subseconds fields and run off a
32768kHz watch cystal which provides only 30 microseconds or so

In one word, the RTC is good to save time across reboots and in some cases
to measure the CPU timebase rate by measuring the number timebase ticks
between two second boundaries.


** Sent via the linuxppc-embedded mail list. See

More information about the Linuxppc-embedded mailing list