From: Wolfgang Denk Date: Thu, 05 May 2011 20:24:40 +0200 Subject: [U-Boot] Memory size detection on P1011 In-Reply-To: <1304602168.21927.16.camel@oslab-l1> References: <4DC2A352.8080505@embedded-sol.com> <1304602168.21927.16.camel@oslab-l1> Message-ID: <20110505182440.867B0D60EB7@gemini.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 Dear York Sun, In message <1304602168.21927.16.camel@oslab-l1> you wrote: > > I don't think get_ram_size works for your case. If you want to test the You are wrong. We have been doing this for a long time on many boards with similar properties. > DDR to find the correct size, you have to initialize the DDR first. But > you cannot do this correctly without knowing the number of banks. You > may be able to blindly set the bank number and test the DDR to catch the Incorrect number of banks will give different results than correct number, so try both. The correct configuration is simply the one that gives the maximum total memory size. > error if there is any, but you have to run this code somewhere else, for > example, in the flash (before relocation). Of course the RAM init code runs before relocation. > There might be another way. Do you have any board ID to distinguish > these two kinds? The recommended way is to use get_ram_size(). Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de Overdrawn? But I still have checks left!