From: Jun Sun <jsun@mvista.com>
To: Ralf Baechle <ralf@oss.sgi.com>
Cc: linux-mips@oss.sgi.com
Subject: Re: calibrating MIPS counter frequency
Date: Thu, 29 Nov 2001 10:17:56 -0800 [thread overview]
Message-ID: <3C067BD4.6B132389@mvista.com> (raw)
In-Reply-To: 20011130020240.F638@dea.linux-mips.net
Ralf Baechle wrote:
>
> On Wed, Nov 28, 2001 at 02:25:47PM -0800, Jun Sun wrote:
>
> > In the future, I think mips counter frequency really should go to mips_cpu
> > structure. If we always know the counter frequency, either by board setup
> > routine or runtime calibration, we can get rid of the gettimeoffset
> > calibration routines.
>
> Better stick with the calibration procedure. The crystal oscilators used
> in most computer systems don't provide the high accuracy of frequency
> that is required to keep the clock accurately over long time.
The drifting clock effect won't happen here because the base value (timerlo)is
reset at each jiffies change. So it is as accurate as your system timer, plus
minor skew within a jiffy period.
The existing calibration routines actually use the same oscilator and a
similar algorithm, except calibration is done in an "amortized" fashion. It
will suffer the same within-jiffy skew caused by irregular osilator.
The existing code calibrates over a longer time. So potentially it can be
more accurate. On the other hand, the calibration routine takes a longer
time, which affects the accuracy the other way.
My current patch uses 20 jiffy cycles as the calibration period. On ddb5476
board, the result is off by 1/100,000, which should well preserve the 1us
resolution.
It would be interesting to see the actual result from existing calibrations.
In any case, the skews are probably so small that it won't be an issue here.
Jun
prev parent reply other threads:[~2001-11-29 19:23 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-11-28 22:25 calibrating MIPS counter frequency Jun Sun
2001-11-29 15:02 ` Ralf Baechle
2001-11-29 15:21 ` Maciej W. Rozycki
2001-11-29 15:34 ` Alan Cox
2001-11-29 15:34 ` Alan Cox
2001-11-29 15:59 ` Ralf Baechle
2001-11-29 18:17 ` Jun Sun [this message]
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=3C067BD4.6B132389@mvista.com \
--to=jsun@mvista.com \
--cc=linux-mips@oss.sgi.com \
--cc=ralf@oss.sgi.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.