From: Wolfgang Denk Date: Sun, 04 Jan 2004 10:33:40 +0100 Subject: [U-Boot-Users] Some puzzles on dram_size() In-Reply-To: Your message of "Sun, 04 Jan 2004 14:41:34 +0800." <20040104064134.64840.qmail@web15209.mail.bjs.yahoo.com> Message-ID: <20040104093345.9FE40C12DD@atlas.denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de In message <20040104064134.64840.qmail@web15209.mail.bjs.yahoo.com> you wrote: > > When porting u-boot on LITE_DW,I found that the > following code in RPXlite.c couldn't get through.I Can you please be a bit more specific? What does "couldn't get through" mean? Bad results? Crash? Which error / crash dump messages? > traced the code by BDI2000 and DDD and knew that the > problem perhaps was save[32].In the "for" cycle,the > dimension of save[] must beyond 32 limit by THis is impossible on a 32 bit system. You definitely don't have that much RAM on your box. > [maxsize/sizeof(long)]/2.I changed save[] dimension to > big enough but still in vain.I don't know > why.Finally,I masked the following code and booted How big is your SDRAM_MAX_SIZE #defined? And how big is your actual RAM? > successfully.How does the following code work > normally?If I masked the code,is there any potential > danger? The code works fine on all systems I know. If you remove it, you lose the feature that U-0Boot automatically adjusts itself to different RAM sizes. Best regards, Wolfgang Denk -- Software Engineering: Embedded and Realtime Systems, Embedded Linux Phone: (+49)-8142-4596-87 Fax: (+49)-8142-4596-88 Email: wd at denx.de "It is better for civilization to be going down the drain than to be coming up it." - Henry Allen