[U-Boot] RFC: get_ticks() + get_tbclk()

Reinhard Meyer u-boot at emk-elektronik.de
Tue Sep 21 14:12:23 CEST 2010


Dear Wolfgang Denk,
> In message <4C98536C.6010003 at emk-elektronik.de> you wrote:
>> For me it seems useful to keep both functions and have ticks
>> increment at a hardware-convenient rate.
>> If the hardware timer can be prescaled to increment at 1000 Hz that
>> is fine, but I see no immediate need for that. If the hardware cannot
>> be prescaled, and software would need to do a 64 bit multiply/divide
>> on each timer read, that would really be overkill.
> 
> Just FYI: the origin of these functions is (like usual) in the
> implementation for the Power Architecture.
> 
> There we have a 64 bit timebase register (split into two 32 bit
> registers, the upper half in tbu and the lower half in tbl). The
> timebase register gets incremented at a pretty high rate, usually
> every 4 or 16 system clocks).
> 
> get_ticks() just returns the content of the 64 bit timebase register.

Yes, of course. So the current ARM926EJS/AT91 implementation is actually
in the right direction, although not perfected yet. I am going to look
into that.

Reinhard



More information about the U-Boot mailing list