[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Hardware clock on dual G4 highly inaccurate?



On Thu, 2003-01-30 at 18:34, Gabriel Paubert wrote:

> Is the value taken from OF or from self calibration at boot? In the
> latter case increasing the time always improves precision. On PreP we
> wait for the seconds to roll over in the RTC to calibrate the decrementer and
> even then I see disturbingly large variations in the duration of a second.

OF on some machines, VIA timer on some others, but I'm considering
switching to KeyLargo Timer (like Darwin does) for all recent machines.
 
> I have not tested more recent code, which has been optimized to avoid
> rereading the whole set of RTC fields when you need only the seconds.
> Having a cursory look there are a few things that I don't understand, 
> a lot of outdated comments (many of which were originally mine) and so on.
> 
> The one thing I sure don't understand is the check for rollover of
> tbu in arch/ppc/kernel/todc_time.c(todc_calibrate_decr). Unless you
> have a 601 (and in this case processor specific code should have taken
> care of it), the computation of the duration of a second is done
> modulo 2^32 and is unaffected by a change of the TBU.

I never looked at the todc code, you may want to ask Tom Rini about it.

> > 
> >  - The hardware clock (hwclock output) is maintained by the PMU and is
> > _supposed_ to be relatively accurate. However, I noticed some recent
> > machines appear to show an "i2c-hwclock" node below the PMU node, and
> > I'm wondering if Apple added a stock hwclock chip on the PMU i2c bus in
> > order to replace the PMU's own (if any) or if this is just making an old
> > stuff visible in the device-tree. I'll investigate that when I get one
> > of the new machine.
> 
> It is supposed to be relatively accurate, but you have a problem with
> some of the RTC chips which have a correction factor register. I don't 
> remember the details, but instead of trying to spread out the correction
> evenly, they concentrate them in some sorts of bursts with occasionnally
> long or short seconds. 

Ouch. Ok, well, I'll investigate when I have such new HW at hand (soon
hopefully).




Reply to: