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

Remy Bohmer linux at bohmer.net
Sat Feb 19 20:59:11 CET 2011


Hi,

>> 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...

I think you are right. I did not thought about 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.

100% agreed.

> 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.

If it should be 64 * 1024 * 1024, I completely agree with you.
But, IMHO 64 << 20 is even less clear, this suggest a bitmask, while
it is a size.
I will change it to the longer style, since it only differs 8 characters...

Kind regards,

Remy


More information about the U-Boot mailing list