All of lore.kernel.org
 help / color / mirror / Atom feed
From: Minkyu Kang <promsoft@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] memsize: get correct memory size
Date: Wed, 25 Nov 2009 11:00:38 +0900	[thread overview]
Message-ID: <1f3430fb0911241800m5c9f4837kd90af1ab8fafd303@mail.gmail.com> (raw)
In-Reply-To: <20091124220817.A9CCCA87D0A@gemini.denx.de>

Dear Wolfgang,

2009/11/25 Wolfgang Denk <wd@denx.de>:
> Dear Minkyu Kang,
>
> In message <1f3430fb0911232040k19ca1362r23664ec62ab8d158@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

  reply	other threads:[~2009-11-25  2:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-18  5:02 [U-Boot] [PATCH] memsize: get correct memory size Minkyu Kang
2009-11-23  7:04 ` Minkyu Kang
2009-11-23 18:37   ` Wolfgang Denk
2009-11-24  4:40     ` Minkyu Kang
2009-11-24 22:08       ` Wolfgang Denk
2009-11-25  2:00         ` Minkyu Kang [this message]
2009-11-25 16:30           ` Wolfgang Denk

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1f3430fb0911241800m5c9f4837kd90af1ab8fafd303@mail.gmail.com \
    --to=promsoft@gmail.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.