[U-Boot] [PATCH 1/1] The GP timer is fixed for 1msec and CONFIG_SYS_HZ to 1000.

Wolfgang Denk wd at denx.de
Tue Mar 17 09:54:27 CET 2009


Dear "Pillai, Manikandan",

In message <19F8576C6E063C45BE387C64729E73940427CBF3D2 at dbde02.ent.ti.com> you wrote:
>
> > > -	ulong now = readl(&timer_base->tcrr); /* current tick value */
> > > -
> > > -	if (now >= lastinc)	/* normal mode (non roll) */
> > > -		/* move stamp fordward with absoulte diff ticks */
> > > -		timestamp += (now - lastinc);
> > > -	else	/* we have rollover of incrementer */
> > > -		timestamp += (0xFFFFFFFF - lastinc) + now;
> > > -	lastinc = now;
> > > -	return timestamp;
> > 
> > As already mentioned in
> > 
> > http://lists.denx.de/pipermail/u-boot/2009-March/048842.html
> > 
> > I don't understand why you remove the overflow handling here?
> [Pillai, Manikandan] Is overflow handling really required here ???

What makes you sure it is NOT needed?

> > With '>> 6' this will result in 793.457Hz, with '>> 5' we will get
> > 1586.914Hz. Correct?
> > 
> > Both doesn't fit
> [Pillai, Manikandan] I knew it doesn't give the correct values. This was tested
> using sleep() function. Since 5 gives a > time than 1 second, I picked up 5 here.

Argh... We don't need realy high precision, but I think we should
attempt to not worse than +/- 2% or so.  THis implementation is not
acceptable.

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 can call spirits from the vasty deep."
"Why so can I, or so can any man; but will they come when you do call
for them?"          - Shakespeare, 1 King Henry IV, Act III, Scene I.


More information about the U-Boot mailing list