[U-Boot-Users] memsize.c patch
Wolfgang Denk
wd at denx.de
Fri Apr 2 10:29:43 CEST 2004
In message <000c01c41868$34814910$212d4cdc at smkim> you wrote:
>
> When get_ram_size(common/memsize.c) is called on a MPC8245 board which has
> 256MB SDRAM, booting stops.
> This is because the function tries to read outside BAT boundary.
This is intentional. You can only find out how much mempory is
installed when you test beyound the end - otrherwise there might be
more memory, right? You must map more memory, then.
> This patch fixes the problem.
> I tested it on our board(board/etin/debris).
But it breaks many other boards.
> for (cnt = 1; cnt < maxsize / sizeof (long); cnt <<= 1) {
> addr = base + cnt; /* pointer arith! */
> - val = *addr;
> - *addr = save[--i];
> - if (val != ~cnt) {
> + if (addr < maxsize) {
> + val = *addr;
> + *addr = save[--i];
> + }
Just a simple question: what happens if base != 0 ?
Rejected.
Wolfgang Denk
--
Software Engineering: Embedded and Realtime Systems, Embedded Linux
Phone: (+49)-8142-4596-87 Fax: (+49)-8142-4596-88 Email: wd at denx.de
An armed society is a polite society.
More information about the U-Boot
mailing list