All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jari Nguyen Trung Thanh <jari.nguyen@serialsystem.com.sg>
To: Jerry Van Baren <vanbaren_gerald@si.com>
Cc: linuxppc-embedded@lists.linuxppc.org
Subject: Re: Using realtime clock?
Date: Wed, 10 Jan 2001 21:22:22 +0800 (SGT)	[thread overview]
Message-ID: <979132942.3a5c620ec53f9@mail1.serialsystem.com.sg> (raw)
In-Reply-To: <4.3.2.20010110072315.00bb5230@falcon.si.com>


Thank you, I think that it is the best way which I can do....
May be I'll try to make it simpler.
Thank again,
Jari


Quoting Jerry Van Baren <vanbaren_gerald@si.com>:

>
> The "proper" way to handle a RTC is to read it on power up and set the
> system clock based on it.  From then on, the system clock will be
> correct and everyone will use the system clock efficiently and
> accurately.
>
> On the x86 (PC host), the utility is "hwclock" (man hwclock).  Your
> best approach is to get the source for that, modify it to read your RTC
> hardware (which may be different from the PC RTC hardware, although you
> might get lucky and only have to deal with endian issues).  Then add a
> call to it in your startup scripts, typically in /etc/rc.d/rc.local.
>
> gvb
>
>
> At 10:30 AM 1/10/01 +0100, Gabriel Paubert wrote:
>
> >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
> >resolution.
> >
> >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.
> >
> >
> >         Regards,
> >         Gabriel.
> >
> >
>
>
>


** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

  reply	other threads:[~2001-01-10 13:22 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-01-10  4:16 Using realtime clock? Jari Nguyen Trung Thanh
2001-01-10  9:30 ` Gabriel Paubert
2001-01-10 12:33   ` Jerry Van Baren
2001-01-10 13:22     ` Jari Nguyen Trung Thanh [this message]
2001-01-10 15:06     ` Wolfgang Denk
2001-01-10 15:56       ` Jerry Van Baren
2001-01-10 16:22         ` Wolfgang Denk
2001-01-10 16:51           ` Jerry Van Baren
2001-01-10 16:59             ` Bill Roman
2001-01-10 19:16             ` Gabriel Paubert
2001-01-10 19:05         ` Gabriel Paubert

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=979132942.3a5c620ec53f9@mail1.serialsystem.com.sg \
    --to=jari.nguyen@serialsystem.com.sg \
    --cc=linuxppc-embedded@lists.linuxppc.org \
    --cc=vanbaren_gerald@si.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.