
Dear Reinhard Meyer,
In message 4CC6AADC.8050608@emk-elektronik.de you wrote:
Then the define CONFIG_SYS_HZ should not be in every <board>.h since that suggests that a board developer has some freedom there...
Agreed - there are historical reasons this has ever been changable at all.
and MOST IMPORTANT that some implementations of udelay() might call reset_timer() and therefore break an outer timeout loop !!!
Such implementations are inherently broken and need to be fixed.
It is also open if reset_timer() does actually reset the hardware timer (e.g. tbu/tbl at PPC) - which would be messing up any time difference calculation using get_ticks() - or does emulate that by remembering the hardware value and subtracting it later in every subsequent get_timer() call?
This is an implementation detail.
- get_ticks() and friends operate at a higher rate (tbu/tbl for PPC).
Since they are defined as having 64 bits they MUST not wrap at 32 bits, i.e. if the hardware provides only 32 bits, the upper 32 bits must be emulated by software.
Right.
Otherwise we have to document that get_ticks() cannot be used to get 64 bit time differences.
No. Such an implementation is broken and needs fixing.
If you really closely look at the various implementations of those timers, you will easyly see the wide variations implemented there.
Yes, I am aware of this :-(
Best regards,
Wolfgang Denk