Override timer interrupt

Rune Torgersen runet at innovsys.com
Tue Oct 16 02:49:38 EST 2007


> From: Benjamin Herrenschmidt
> In fact, I'm not sure what is your problem with the DEC 
> proper as the TB
> will be used ultimately and thus it shouldn't drift more than the TB
> does. Can your part use an externally clocked TB ?
> 
> If not, and you still have a drift despite calibration, you can always
> use NTP services to adjust timekeeping.

We use NTP, which is why I didn't see it until recently. (Happened to
have a board without NTP configured

The main couse is that our main bus frequency cannort be divided into
1kHz evently by the decrementer.
Main bus freq = 99532800 Hz.
Decrementer then becomes 24883, which gives us 999991.9624485600nsec per
jiffy.
That is not a number easilly converted into time without drift.

Changing HZ to 100 fixes it, but is for varous reasons not an option
right now.

What I did do is change the timer interrupt to be called by an ecxternal
1kHz interrupt source instead of the decrementer.

The TB register is only ued for offsets from the last jiffie, not as a
continous offset, so then it works out pretty good.
There is a discontinuity in the sub ms resolution of the clock that I
can live with. msec and up are dead accurate.


More information about the Linuxppc-embedded mailing list