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

Wolfgang Denk wd at denx.de
Fri May 21 23:03:18 CEST 2010


Dear Timur Tabi,

In message <4BF6ECD0.4060202 at freescale.com> you wrote:
> 
> 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.

Agreed.

> 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

Well, the function is "strMHZ", and it prints a frequency in MHz with
exactly 3 digits precision - so rounding to the nearest kHz is
exactly the right thing to do.

> it prints KHz, MHz, or GHz as appropriate, and rounds to the nearest 10th,
> instead of 1000th.

That would IMHO be less useful, and require changes to MANY boards
(essentially all of them) as the output format needs to be adjusted.

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
"The first rule of magic is simple. Don't waste your time waving your
hands and hoping when a rock or a club will do."
                                               - McCloctnik the Lucid


More information about the U-Boot mailing list