
On Thu, Jul 10, 2008 at 10:49:09AM +0200, Wolfgang Denk wrote:
In message 20080710081725.GP4595@pengutronix.de you wrote:
CFG_HZ is a constant and has to be 1000.
Why is it a board specific define then?
Historical reasons only. When PPCBoot was created, I played with that parameter to get a feeling for the involved overhead, etc. This should really be removed, but as you know too many boards depend on this.
You could add a software divider in get_timer(). But I think it's better to define CFG_HZ to whatever the timer frequency is. At least 49 boards do it.
That's what I mean: many boards need fixing.
How about using the Linux clocksource framework for U-Boot? I did this for V2 and it works like a charm. The timer implementation is straight forward. You only have to setup a free running timer and return its value, so there's not much to do wrong when implementing new timers. Currently U-Boot has many timing functions like get_timer, get_timer_masked, reset_timer, reset_timer_masked, udelay and I suppose most people do not understand the meaning of those functions, as the differing implementations show. Not that I volunteer to do this job though :(
Regards, Sascha