[U-Boot] [PATCH 1/2 V3] at91sam9261ek: make operational again

Wolfgang Denk wd at denx.de
Sat Feb 19 20:22:59 CET 2011


Dear Remy Bohmer,

In message <AANLkTinwsi4nNxkHfcNs19E7YBj78kqjYLGqG9LBaS+b at mail.gmail.com> you wrote:
> 
> > I'd recommend setting this to the very beginning of SDRAM(0x20000000),
> > note that initial SP and GD would be put into SRAM further down.
>
> The SRAM is used by the LCD controller. So, we cannot use it for the SP and GD.

Why not?

LCD is most probably only initialized and used after relocation, while
stack and GD are needed and used only before that...

> >>> +#define CONFIG_SYS_SDRAM_SIZE       0x04000000 /* 64 megs>  */
> >
> > It is up to you, but (64 << 20) might look "nicer".
>
> This is more a matter of taste I think. I will see what I do with it.

It's not only a matter of taste, but also a matter of readability.  If
I see 0x04000000 I cannot really tell immediately if this is a bit
mask or anything else, and even if I know from the context that it's a
size, I cannot immediately say how much it is.  On the other hand, a
notation like "64 * 1024 * 1024" or (shorter) "64 << 20" makes it
immediately clear that 1) it's some number, probably a size, and 2)
that it's 64 MiB.

In the interest of maitainability please chose a more readable way to
specify such numbers.

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
Es ist nicht genug zu wissen, man muß auch anwenden; es ist nicht ge-
nug zu wollen, man muß auch tun.   -- Goethe, Maximen und Reflexionen


More information about the U-Boot mailing list