Subject: Re: clock drift
To: Simon Burge <simonb@wasabisystems.com>
From: Marius Strobl <marius@alchemy.franken.de>
List: port-cobalt
Date: 08/14/2003 00:45:51
On Wed, Aug 13, 2003 at 12:57:49PM +1000, Simon Burge wrote:
> On Mon, Aug 11, 2003 at 03:47:09AM +0200, Marius Strobl wrote:
> > On Sun, Aug 03, 2003 at 09:11:14AM -0700, Jason Meinzer wrote:
> > > I am using a RaQ 1 and my clock drifts almost 30 seconds too fast every 
> > > five minutes.  Is this happening for anyone else?  All I can find is an 
> > 
> > This is a long standig bug. The NetBSD kernel doesn't initialise the
> > timers/counters of the Galileo system controller but then reads the
> > current value of the write-only timer0 register in microtime().
> 
> I wonder if it isn't easier/better/whatever to switch to a microtime()
> that uses the CPU's cycle counter instead?  A number of other MIPS ports
> do this.
> 

I thought about it but didn't look into it, so I'm not aware of pros
and cons of that approach.
Beside the CPU's cycle counter (the CPUs run at 150 or 250MHz) there
are 4 timers/counters available in the Galileo chip. The later run
at 50MHz, three take 24bit values, one 32bit. On terminal count they
issue an interrupt, if they are set for timer mode they'll reload
themselves and continue counting. What mapping for hardlock, microtime,
statclock regarding precision, interrupt load etc. would you suggest?
I guess as the statclock has to be adjustible during runtime it can
be only done with a Galileo timer, or at least a lot easier.