[U-Boot-Users] Q about automatic dram size detection in sdram_init()

Stefan Roese stefan.roese at esd-electronics.com
Thu Jul 15 09:30:23 CEST 2004


SYLee!

The code works fine on all different memory configutations. This is
because of the mirroring of the written values. For example on a system
with 64MByte SDRAM a write to "ADDR_64MB" will mirror to one of the
smaller addresses and the current test will fail! So this is perfectly
OK.

Best regards,
Stefan Roese

-----Original Message-----
From: u-boot-users-admin at lists.sourceforge.net [mailto:u-boot-users-
admin at lists.sourceforge.net] On Behalf Of SYLee
Sent: Thursday, July 15, 2004 3:00 AM
To: u-boot-users at lists.sourceforge.net
Subject: [U-Boot-Users] Q about automatic dram size detection in
sdram_init()


Hi, 

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
NHµŠ²²un‰®?½µ?u–®–·­y?l‰®¢¶Ê§vv





More information about the U-Boot mailing list