
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@lists.sourceforge.net [mailto:u-boot-users- admin@lists.sourceforge.net] On Behalf Of SYLee Sent: Thursday, July 15, 2004 3:00 AM To: u-boot-users@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