[U-Boot-Users] question about sdram size autodetection in sdram_init()

I'm so sorry for producing mailing list garbages.. due to email client problem.. My apology to you all for this..
In cpu/ppc4xx/sdram.c, in sdram_init(), the following seems to be wrong.
/* * Test if 128 MByte are equipped (mirror test) */ *(volatile ulong *)ADDR_ZERO = MAGIC0; *(volatile ulong *)ADDR_08MB = MAGIC1; *(volatile ulong *)ADDR_16MB = MAGIC2; *(volatile ulong *)ADDR_32MB = MAGIC3; *(volatile ulong *)ADDR_64MB = MAGIC4;
if ((*(volatile ulong *)ADDR_ZERO == MAGIC0) && (*(volatile ulong *)ADDR_08MB == MAGIC1) && (*(volatile ulong *)ADDR_16MB == MAGIC2) && (*(volatile ulong *)ADDR_32MB == MAGIC3)) { /* * OK, 128MB detected -> all done */ return; }
I think the following conditional expression must be inserted at if statement: (*(volatile ulong *)ADDR_64MB == MAGIC4)
The above case is also applied to 64MB and 32MB detection.
Thanks. SYLee.
--------------------------------------------------------------------- Get your own 200MB free email at http://www.empal.com

In message 20040715110453.40f5e6450007c87b0053c837.192@empal.com you wrote:
In cpu/ppc4xx/sdram.c, in sdram_init(), the following seems to be wrong.
...
I think the following conditional expression must be inserted at if statement: (*(volatile ulong *)ADDR_64MB == MAGIC4)
I think you are right. Please submit a patch.
The above case is also applied to 64MB and 32MB detection.
The whole code could be rewritten and simplified using a loop or even existing code. See get_ram_size() in "common/memsize.c"
Best regards,
Wolfgang Denk
participants (2)
-
SYLee
-
Wolfgang Denk