[U-Boot] [RFC][Timer API] Revised Specification - Implementation details

Graeme Russ graeme.russ at gmail.com
Fri May 27 00:44:40 CEST 2011


On Fri, May 27, 2011 at 3:28 AM, Wolfgang Denk <wd at denx.de> wrote:
> Dear Simon Glass,
>
> In message <BANLkTikWwuymrJtMEHBZkvNgNBK1e=RdWA at mail.gmail.com> you wrote:
>>
>> Can we have a microsecond one also please? Some sort of microsecond
>
> I guess you cannot, at least not in general.  In worst case that would
> mean we have to process 1e6 interrupts per second, which leaves little
> time for anything useful.

If we implemented a sync_us_timer(), we could either:

 a) Never kick it using an interrupt at all (only kick it in udelay())
 b) Kick it in a much slower interrupt (1ms+ period)

Remember, the kicking of the sync function does not need to correlate to
the incrementing of the tick counter - Only to the roll-over period
of the tick counter.

For a 64-bit sub microsecond tick counter, interrupts will probably not
ever be needed (unless the tick frequency is ludicrous - even a nanosecond
tick counter will take 213 days to wrap) so in this case, sync_us_timer()
would be fine

Regards,

Graeme


More information about the U-Boot mailing list