On Wed, 20 Dec 2006 17:29:25 +0300, Sergei Shtylyov <sshtylyov@xxxxxxxxxxxxx> wrote: > > How about this? You should still fix pnx8550_hpt_read() anyway, but I > > suppose gettimeofday() on PNX8550 was broken long time. > > And nobody noticed. :-) I changed my mind a bit. The pre-clocksource gettimeofday() might work well on PNX8550. There was timerlo variable which hold COUNT value on last timer interrupt and fixed_gettimeoffset() subtracted timerlo from COUNT value at the time. On Wed, 20 Dec 2006 17:29:25 +0300, Sergei Shtylyov <sshtylyov@xxxxxxxxxxxxx> wrote: > > +static cycle_t pnx8550_hpt_read(void) > > +{ > > + /* FIXME: we should use timer2 or timer3 as freerun counter */ > > + return read_c0_count(); > > +} > > I'd suggest read_c0_count2() here, possibly adding an interrupt > handler for it since it will interrupt upon hitting compare2 > reg. value (but we could probably just mask the IRQ off), and > enabling the timer 2, of course (the current code disables it)... It would be right direction. And we should set set count2 frequency to mips_hpt_frequency. But I cannot test it by myself so I'd like to leave it for others. Good exercise ;) --- Atsushi Nemoto