[U-Boot] U-Boot Timer Qualification

Wolfgang Denk wd at denx.de
Thu Apr 23 00:18:00 CEST 2009


Dear Jean-Christophe PLAGNIOL-VILLARD,

In message <20090422212816.GA18705 at game.jcrosoft.org> you wrote:
>
> > Who needs this, and why and when, and why didn't we need it the past?
> a lot of actual timer are not correct and we have problem on network timeout
> as example.

Hm... how muich of precision do we actuually need?

> So we need to known the precision of the timer to known the impact on all
> timer depends part of u-boot as timeout or bitbanging stack
> 
> so when you have to respect some delay to init some chip or other you will to
> known the delay you will have in reality. This will avoid you a lots of pain
> during the dev

In my experience, no parts of the code actually care about precision
of the timers, especially not when implementing delay loops or
timeouts using udelay() which always includes static overhead. For
example, the following two snippets of code are only in theory
equivalent:

	for (i=0; i < 100; ++i)
		udelay (10000);

versus

	for (i=0; i < 1000; ++i) {
		for (j=0; j < 1000; ++j)
			udelay (1);
	}

But - is this really a problem? I am not aware of any place in the
code where a tolerance of +/- 10% or maybe even more would matter.


Note: when you are implementing a bit-banging protcol that requires
precise timings and run into problems, then this is not a problem with
U-Boot timer accuracy, but with incorrect system design on your
system.

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
I'm what passes for a Unix guru in my office. This is  a  frightening
concept. - Lee Ann Goldstein, in <3k55ba$c43 at butch.lmsc.lockheed.com>


More information about the U-Boot mailing list