From: Wolfgang Denk Date: Wed, 25 Nov 2009 17:30:17 +0100 Subject: [U-Boot] [PATCH] memsize: get correct memory size In-Reply-To: <1f3430fb0911241800m5c9f4837kd90af1ab8fafd303@mail.gmail.com> References: <4B037FFE.8030804@samsung.com> <1f3430fb0911222304pa45554epc7e46c49a9cc70f7@mail.gmail.com> <20091123183759.A5DAB3F6D6@gemini.denx.de> <1f3430fb0911232040k19ca1362r23664ec62ab8d158@mail.gmail.com> <20091124220817.A9CCCA87D0A@gemini.denx.de> <1f3430fb0911241800m5c9f4837kd90af1ab8fafd303@mail.gmail.com> Message-ID: <20091125163017.D33D73F6D6@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 Minkyu Kang, In message <1f3430fb0911241800m5c9f4837kd90af1ab8fafd303@mail.gmail.com> you wrote: > > > But size of a memory bank cannot be 80 MB. It must always be a power > > of 2. > > As I said, memory bank is not 80MB. And as I said, get_ram_size() is designed to operate on a single bank of memory only. It works only as expected when "maxsize" is a power of 2, too (also note that it is restricted to 32 bit address space, too). > > The purpose is to give it the maximum possible size of memory that > > may be populated in one bank of memory, and test how much of this is > > actually there. Say you have a board where one bank of memory can be > > populated with 256 MB, 512 MB or 1024 MB of RAM, then you will run > > the test with a max size of 1024 MB and find out which of the 3 > > versions you have - and if there are eventually any (gross) memory > > errors. > > So, is maxsize "maximum possible size"? or "bank size"? maximum possible bank size. > If you mean "maximum possible size", as I mentioned.. 1Gb OneDRAM's > maximum possible size is 80MB, > 32MB is used by CP (can't access by AP) and 16MB is share area (used > for special purposes). > If you mean "bank size" then I got 64MB ram size. > I don't want to get wrong size. Could you please try to explain what this is supposed to mean? I have no idea what "AP" or "CP" might mean, or how this is related to U-Boot or to this task. Where is U-Boot running? If U-Boot can access 80 MB of memory, this is probably _two_ banks: one bank of 64 MB and _another_ bank of 16 MB. Which means you should test both of them, using two sepoarate calls to get_ram_size(). > I just want to get memory size. > When I posted SMDKC100 codes, you said "please use get_ram_size function". > So, I tried it another board that uses OneDRAM. > But, I can't get correct memory size. > If you don't mind, I will not use this function if board uses OneDRAM. Why not? Just use it properly, please. > > This is caused by the fact that you misuse the code under conditions > > was not designed for. With a 80 MB region of memory, the whole theory > > it's function is based on does not apply. You want to use some > > different memory test, then (which one I don;t know, as I still fail > > to understand why you would want to "auto-size" 80 MB out of 1 GB of > > memory. This makes absolutely no sense to me. > > What means "auto-size"? "auto-size" means to automatically detect the real, currently available (= populated) size of a bank of RAM. > 1GB is wrong. I said 1Gb (128 MB). But this is NOT the size of a bank of memory that can be accessed by the CPU, right? 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 Der Dativ ist dem Genitiv sein Tod.