[U-Boot] Subject: [PATCH] Fix for bug in memory sizing code

The original memory sizing code in get_ram_size clobbers the word at the base address, but forgets to restore it.
Signed-off-by: Iwo Mergler Iwo.Mergler@netcommwireless.com --- common/memsize.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/common/memsize.c b/common/memsize.c index 963e4f3..74cf075 100644 --- a/common/memsize.c +++ b/common/memsize.c @@ -73,6 +73,7 @@ long get_ram_size(long *base, long maxsize) } return (0); } + *addr = save[i];
for (cnt = 1; cnt < maxsize / sizeof (long); cnt <<= 1) { addr = base + cnt; /* pointer arith! */

On Sun, Sep 09, 2012 at 08:16:58PM -0000, Iwo Mergler wrote:
The original memory sizing code in get_ram_size clobbers the word at the base address, but forgets to restore it.
Signed-off-by: Iwo Mergler Iwo.Mergler@netcommwireless.com
Applied to u-boot/master, thanks!

Hi,
this patch actually breaks the mpc83xx board I am currently working on, leading to a detected size of 2 GiB (as opposed to the actual size of 128 MiB). I tried reviewing it and couldn't really figure out why, as it seems legitimate, and I currently don't have a chance to check it on other boards. But I just tripled checked it and I am sure it's the root cause of my AAAAAAAAAAAARGGGGGGGGGGGHHHHHHHHHHHHHHHH! :-)
Anyone ever tried it?
Thanks, Gerlando
On 09/18/2012 09:06 PM, Tom Rini wrote:
On Sun, Sep 09, 2012 at 08:16:58PM -0000, Iwo Mergler wrote:
The original memory sizing code in get_ram_size clobbers the word at the base address, but forgets to restore it.
Signed-off-by: Iwo MerglerIwo.Mergler@netcommwireless.com
Applied to u-boot/master, thanks!
U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot

On 09/21/12 04:15, Gerlando Falauto wrote:
Hi,
this patch actually breaks the mpc83xx board I am currently working on, leading to a detected size of 2 GiB (as opposed to the actual size of 128 MiB). I tried reviewing it and couldn't really figure out why, as it seems legitimate, and I currently don't have a chance to check it on other boards. But I just tripled checked it and I am sure it's the root cause of my AAAAAAAAAAAARGGGGGGGGGGGHHHHHHHHHHHHHHHH! :-)
Anyone ever tried it?
Confirmed, reverted. Thanks for the report.
participants (3)
-
Gerlando Falauto
-
Iwo Mergler
-
Tom Rini