From: Daniel Ann <ktdann@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] get_ram_size() returns wrong value
Date: Wed, 6 Apr 2005 19:18:55 +0900 [thread overview]
Message-ID: <9b7ca65705040603187af7aa9c@mail.gmail.com> (raw)
Hiya folks,
Somehow I've missed this before, but just today noticed that u-boot is
reporting DRAM: 64 MB (BTW, machine is running with 128MB)
So, again, I had peaked inside the u-boot, and after doing some printf
statements, I can get it to detect 128MB but I cant seem to get to the
root of the problem. This is orginal code with my printf.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
for (cnt = 1; cnt < maxsize / sizeof (long); cnt <<= 1) {
printf("*addr(%x)\n",*(addr=base + 0x1000000));
addr = base + cnt; /* pointer arith! */
val = *addr;
*addr = save[--i];
if (val != ~cnt) {
size = cnt * sizeof (long);
/* Restore the original data before leaving the function.
*/
for (cnt <<= 1; cnt < maxsize / sizeof (long); cnt <<= 1) {
addr = base + cnt;
*addr = save[--i];
}
return (size);
}
}
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
I can see what the code does. It tries to write ~cnt value (first
backingup) then read it in to see if it had written it successfully.
But problem lies at (base + 0x1000000). If u-boot detects val != ~cnt,
then it will finish the loop right there and return size 64MB. If it
succeeds, returns 128MB (which is what I have).
So, natually, I wanted to see what exactly does it change it to, and
when, hence the printf. But guess WHAT? It reads back perfectly
correct and return 128MB.
Do you guys think its timing issue ? Having printf natually adds delay
factor to the code. Could this be HW problem ? (I can just throw it
back to the HW people to get it fixed if so :) )
If I get desperate, I might just leave the dummy printf or hardcode
the size, but for now, I wouldnt mind diving@it.
--
Daniel
next reply other threads:[~2005-04-06 10:18 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-04-06 10:18 Daniel Ann [this message]
2005-04-06 10:42 ` [U-Boot-Users] get_ram_size() returns wrong value Wolfgang Denk
2005-04-06 12:52 ` Daniel Ann
2005-04-06 13:20 ` Wolfgang Denk
2005-04-07 4:33 ` Daniel Ann
2005-04-07 22:21 ` Wolfgang Denk
2005-04-06 12:27 ` Jerry Van Baren
2005-04-06 13:05 ` Daniel Ann
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=9b7ca65705040603187af7aa9c@mail.gmail.com \
--to=ktdann@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox