[U-Boot] [RFC] Review of U-Boot timer API

Graeme Russ graeme.russ at gmail.com
Tue May 24 06:35:40 CEST 2011


Mike,

On Tue, May 24, 2011 at 2:24 PM, Mike Frysinger <vapier at gentoo.org> wrote:
> rather than inventing our own set of terms, how about piggybacking what Linux
> has already done ?  they have "cycle counters" and "timer counters" (which
> bubble up into "clock sources", but i dont think we need those).

I only put the terms in to clarify them within the scope of the document
to avoid the inevitable 'but that means x' arguments ;)

> further, Linux probably already has implementations we can steal for the arch-
> specific "cycle counters", and the common code which takes care of scaling
> those into actual measurements of time.

Maybe - but I think the Linux implementation might be a bit too heavy
handed - We only need a very lightweight, simple implementation. Despite
the appearance of my write-up, the suggested implementation is very
simple:

 - A common software prescaler in /lib/ (not needed if hardware provides
   an exact 1ms period counter)
 - Arch specific implementation of tick counter (already there)
 - Arch specific hook into prescaler (not needed if tick counter has a
   'long enough' roll-over period or is 1ms, otherwise a tiny ISR which
   simply calls the prescaler)

Regards,

Graeme


More information about the U-Boot mailing list