]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
arm, post, memory: fix bug if sdram base != 0x00000000
authorHeiko Schocher <hs@denx.de>
Thu, 6 Oct 2011 20:40:00 +0000 (20:40 +0000)
committerWolfgang Denk <wd@denx.de>
Sun, 23 Oct 2011 21:32:44 +0000 (23:32 +0200)
commit 8d3fcb5e60b6c8e1d530dbc2e2e33ec6a44670da breaks post
memory support for sdram base != 0x00000000. Fix this.

Signed-off-by: Heiko Schocher <hs@denx.de>
Cc: Valentin Longchamp <valentin.longchamp@keymile.com>
Cc: Holger Brunck <holger.brunck@keymile.com>
Acked-by: Mike Frysinger <vapier@gentoo.org>
post/drivers/memory.c

index 69973c0f4427bd7be4a6c5e923967a567c411b33..d25e3235ca105ef8d5daec4782eb7180cff89271 100644 (file)
@@ -466,10 +466,11 @@ static int memory_post_test_regions(unsigned long start, unsigned long size)
 
        for (i = 0; i < (size >> 20) && (!ret); i++) {
                if (!ret)
-                       ret = memory_post_test_patterns(i << 20, 0x800);
-               if (!ret)
-                       ret = memory_post_test_patterns((i << 20) + 0xff800,
+                       ret = memory_post_test_patterns(start + (i << 20),
                                0x800);
+               if (!ret)
+                       ret = memory_post_test_patterns(start + (i << 20) +
+                               0xff800, 0x800);
        }
 
        return ret;