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

Wolfgang Denk
2010-05-21T20:16:43Z

Dear Timur Tabi,

In message <4BF6E5DF.5020306@freescale.com> you wrote:
>
> >> So here's a better version of that function that rounds to the nearest
> >> MHz and is of a proper coding style:
> >
> > Why do we need that?
>
> Um, because you complained about it?

I mean, why do we need that function? strmhz() already includes
rounding. Are you really rounding, or cutting off precsion?

> Also, because this is silly:
>
> Clock Configuration:
> CPU0:799.992 MHz, CPU1:799.992 MHz,
> CCB:399.996 MHz,
> DDR:299.997 MHz (599.994 MT/s data rate) (Asynchronous), LBC:25 MHz
>
> Why display 799.992 MHZ when 800 MHz makes more sense?

Hm... does it really make more sense? Or is it just less precise, or
do you hush up an error?

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 ?

> >> Clock Configuration:
> >> CPU0:800 MHz, CPU1:800 MHz,
> >> CCB:400 MHz,
> >> DDR:300 MHz (600 MT/s data rate) (Asynchronous), LBC:25 MHz
> >
> > The result looks ugly (why do we have double spaces after the
> > numbers?, why do the numbers not align vertically?).
>
> > This makes me wonder why you use a "%-4s" format in
> > arch/powerpc/cpu/mpc8?xx/cpu.c - may I recommend changing this into
> > "%s" (if you don't care about vertical alignment), or something like
> > "%4s" else?
>
> I'm okay with that.

Fine.

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
You can fool some of the people all of the time, and You can fool all
of the people some of the time, but You can't fool mom.