[U-Boot] [PATCH] memsize: get correct memory size
Minkyu Kang
promsoft at gmail.com
Wed Nov 25 03:00:38 CET 2009
Dear Wolfgang,
2009/11/25 Wolfgang Denk <wd at denx.de>:
> Dear Minkyu Kang,
>
> In message <1f3430fb0911232040k19ca1362r23664ec62ab8d158 at mail.gmail.com> you wrote:
>>
>> > Well, could you please explain what "some cases" are, and how exactly
>> > the code is failing for you? And especially, what "80M" has to do with
>> > it?
>>
>> If memory size is 80M, cnt is decrease 0xa00000 -> 0x500000 ->
>> 0x280000 ... 0xa -> 0x5 -> 0x2 -> 0x1 when first for loop (line 49 to
>> 55).
>
> 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.
>
>> > I guess you are aware that the code silently assumes that the size of
>> > any memory bank is always a power of two, aren't you? So a size of
>> > "80M" does not make any sense to me. If you have such a memory
>> > configuration, it is most probably assembled from two separate memory
>> > banks (64 + 16 MB), which of course need to be sized independently.
>>
>> No, we use 1Gb OneDRAM,
>> 80M is used by AP, 32M is used by CP and 16M is shared area.
>> As you mentioned, size of memory bank is always a power of two,
>> but, size of "available" memory is not always a power of two.
>
> This doe snot make any sense to me. It seems you are misunderstanding
> or misinterpreting the purpose of this code.
>
> 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"?
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.
And my patch support you purpose also.
>
> I have no idea what you mean by "available memory", nor why you think
> you could use this function to test it.
I don't want memory test.
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.
>
>> > Frankly, I don't understand which problem you're trying to fix, nor
>> > what your fix is supposed to be, nor your changes.
>>
>> My patch is fixing wrong address comparison.
>
> 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"?
1GB is wrong. I said 1Gb (128 MB).
>
> 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
> backups: always in season, never out of style.
>
Thanks
Minkyu Kang
--
from. prom.
www.promsoft.net
More information about the U-Boot
mailing list