[U-Boot-Users] PXA270 support

Woodruff, Richard r-woodruff2 at ti.com
Mon Mar 14 23:16:24 CET 2005


Wolfgang,

> Note: this is BROKEN.
> 
> CFG_HZ should be 1000 on all boards. it has NOTHING to  do  with  any
> clock  frequencies of your baord or processor (yes, I know that quite
> a lot of boards are broken this way).

Why is this?  The common use seems to be many flash drivers may get a
time source directly and need to normalize the number of ticks to a
second's value.  I know I set up my timer with the CFG_HZ value in mind
to gauge udelays.

void udelay (unsigned long usec)
{
  ulong tmo, tmp;

  if (usec >= 1000) {/* if "big" number, spread	normalization to seconds
*/
    tmo = usec / 1000;/* start to normalize for usec to ticks per sec */
    tmo *= CFG_HZ;/* find number of "ticks" to wait to achieve target */
    tmo /= 1000;/* finish normalize. */
  } else {/* else small number, don't kill it prior to HZ multiply */
    tmo = usec * CFG_HZ;
    tmo /= (1000*1000);
  }
  ...

How is 1000 correct?  That doesn't seem to follow.

Regards,
Richard W.






More information about the U-Boot mailing list