[U-Boot] [PATCH] Move ICS CLK chip frequenty calculation code into a common board library

Timur Tabi timur at freescale.com
Fri May 21 22:28:00 CEST 2010


Wolfgang Denk wrote:

> 799.992 MHz seems to be 24 * 33,333,000 Hz. Are you sure this is the
> exact quartz frequency on your board? If yes, then the number printed
> should probably remain 799.992 MHz. Or is it 33,333,333 Hz? Or
> 33,000,000 ?

Ok, I see your point.  Technically, I am returning a less precise number.

However, the current code adds a 1 to the result, which is definitely wrong.
 On my board, for example, it returns 99999001, which is not correct.  So
the existing "rounding" algorithm is broken.

However, I believe that displaying 799.999 MHz instead of 800 MHz is silly.
 The problem is that strmhz() rounds to the nearest KHz.  I wonder if that's
really useful.  Perhaps we should make it act more like print_size(), where
it prints KHz, MHz, or GHz as appropriate, and rounds to the nearest 10th,
instead of 1000th.

-- 
Timur Tabi
Linux kernel developer at Freescale


More information about the U-Boot mailing list