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

Simon Glass sjg at chromium.org
Fri May 27 16:58:54 CEST 2011


On Fri, May 27, 2011 at 12:45 AM, Wolfgang Denk <wd at denx.de> wrote:
> Dear Graeme Russ,
>
> In message <4DDF53D3.1060504 at gmail.com> you wrote:
>>
>> > No. At least not unless you also provide other get_<some unit>_timer()
>> > functions which we most likely will not do.
>>
>> I think you will find most platforms will support get_us_timer() trivially.
>> Those that can't can use get_ms_timer() * 1000 (plus taking wrapping into
>> consideration)
>
> To use common code, we have to assume the "cannot" case, and be
> prepared to get only millisecond resolution - when can then simply use
> get_timer() right away and keep the code simple.

Hi Wolfgang,

Can we just assume for a minute that some people want to make use of
the microsecond-resolution timers available on some SOC?

If so then we can either say:

1. Sorry, you're on your own, this is an SOC-specific feature and we
won't accept patches which use it.  Why do you need it anyway, etc.

2. Yes sure, we have a basic framework, please plumb in here.

I would love to see U-Boot take the second approach. It could be as
simple as CONFIG_MICROSECOND_TIMER whereupon the library code avoids
defining (and the board code must define) get_timer_us(). I don't even
believe it needs to be 64-bit, since microsecond timing is obviously
not about time of day. Let's keep it simple, but we should have
something IMO.

Regards,
Simon

>
> Best regards,
>
> Wolfgang Denk
>
> --
> DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
> HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
> Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
> "Plan to throw one away. You will anyway."
>                              - Fred Brooks, "The Mythical Man Month"
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot
>


More information about the U-Boot mailing list