
Dear "Pillai, Manikandan",
In message 19F8576C6E063C45BE387C64729E73940427CBF3D2@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