
Sorry for the noise, but...
just looked in the timer implementation for arm926ejs based boards, and found that there is just the at91, davinci, nomadik timer implementation fixed in actual u-boot. I want to cleanup this timers too, but there are kirkwood, mb86r0x, orion5x, spear, versatile archs which use a lastdec var, which is not in global_data.h defined. So the question is should we add a lastdec to global_data.h or is it Ok, if I use lastinc for cleaning up?
I would suggest to take tbu, tbl, lastinc out of the AT91FAMILY #ifdef to the generic part.
maybe "unify" last{inc,dec} into last_hw ? Because they are supposedly the last (hardware) decrementer/incrementer values from the previous call.
define 4 u32's in the generic part:
u32 timer_use1; u32 timer_use2; u32 timer_use3; u32 timer_use4;
and have the timer implementations themselves use defines to make them more readable.
#define lastinc gd->timer_use1
A future AT91 timer might not use tbu/tbl, but would need 4 values to keep track of 2 independant timers for udelay() and a 1kHz base for *_timer().
Reinhard