From: Stefan Roese <stefan.roese@esd-electronics.com>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] Q about automatic dram size detection in sdram_init()
Date: Thu, 15 Jul 2004 09:30:23 +0200 [thread overview]
Message-ID: <001501c46a3d$9705b720$0212000a@PCSTEFAN> (raw)
In-Reply-To: <20040715100012.40f5d71c00027b490053c837.188@empal.com>
SYLee!
The code works fine on all different memory configutations. This is
because of the mirroring of the written values. For example on a system
with 64MByte SDRAM a write to "ADDR_64MB" will mirror to one of the
smaller addresses and the current test will fail! So this is perfectly
OK.
Best regards,
Stefan Roese
-----Original Message-----
From: u-boot-users-admin@lists.sourceforge.net [mailto:u-boot-users-
admin at lists.sourceforge.net] On Behalf Of SYLee
Sent: Thursday, July 15, 2004 3:00 AM
To: u-boot-users at lists.sourceforge.net
Subject: [U-Boot-Users] Q about automatic dram size detection in
sdram_init()
Hi,
In cpu/ppc4xx/sdram.c, in sdram_init(), the following seems to be
wrong.
/*
* Test if 128 MByte are equipped (mirror test)
*/
*(volatile ulong *)ADDR_ZERO = MAGIC0;
*(volatile ulong *)ADDR_08MB = MAGIC1;
*(volatile ulong *)ADDR_16MB = MAGIC2;
*(volatile ulong *)ADDR_32MB = MAGIC3;
*(volatile ulong *)ADDR_64MB = MAGIC4;
if ((*(volatile ulong *)ADDR_ZERO == MAGIC0) &&
(*(volatile ulong *)ADDR_08MB == MAGIC1) &&
(*(volatile ulong *)ADDR_16MB == MAGIC2) &&
(*(volatile ulong *)ADDR_32MB == MAGIC3)) {
/*
* OK, 128MB detected -> all done
*/
return;
}
I think the following conditional expression must be inserted at if
statement:
(*(volatile ulong *)ADDR_64MB == MAGIC4)
The above case is also applied to 64MB and 32MB detection.
Thanks.
SYLee.
Get your own 200MB free email at http://www.empal.com
NH????u\x10n??????u?????y?l??????vv
next prev parent reply other threads:[~2004-07-15 7:30 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-07-15 1:00 [U-Boot-Users] Q about automatic dram size detection in sdram_init() "SYLee"
2004-07-15 7:30 ` Stefan Roese [this message]
2004-07-15 7:55 ` Wolfgang Denk
2004-07-15 8:40 ` Stefan Roese
2004-07-15 7:35 ` 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='001501c46a3d$9705b720$0212000a@PCSTEFAN' \
--to=stefan.roese@esd-electronics.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.