From: Heiko Schocher <hs@denx.de>
Date: Thu, 2 Jun 2011 19:38:24 +0000 (+0000)
Subject: post, memorytest: add support for none powerpc archs
X-Git-Tag: v2025.01-rc5-pxa1908~19188
X-Git-Url: http://git.dujemihanovic.xyz/img/%7B%7B%20.RelPermalink%20%7D%7D?a=commitdiff_plain;h=4204298db0c5fcf14de852c9b2c6ac3324b106b1;p=u-boot.git

post, memorytest: add support for none powerpc archs

change bd->bi_memsize to gd->ram_size, as this is defined
on all archs, so this post test can used on none powerpc
archs too.

Signed-off-by: Heiko Schocher <hs@denx.de>
cc: Wolfgang Denk <hs@denx.de>
cc: Mike Frysinger <vapier@gentoo.org>
---

diff --git a/post/drivers/memory.c b/post/drivers/memory.c
index 8f46eef879..c2b711e2f4 100644
--- a/post/drivers/memory.c
+++ b/post/drivers/memory.c
@@ -452,13 +452,17 @@ static int memory_post_tests (unsigned long start, unsigned long size)
 	return ret;
 }
 
+/*
+ * !! this is only valid, if you have contiguous memory banks !!
+ */
 __attribute__((weak))
 int arch_memory_test_prepare(u32 *vstart, u32 *size, phys_addr_t *phys_offset)
 {
 	bd_t *bd = gd->bd;
+
 	*vstart = CONFIG_SYS_SDRAM_BASE;
-	*size = (bd->bi_memsize >= 256 << 20 ?
-			256 << 20 : bd->bi_memsize) - (1 << 20);
+	*size = (gd->ram_size >= 256 << 20 ?
+			256 << 20 : gd->ram_size) - (1 << 20);
 
 	/* Limit area to be tested with the board info struct */
 	if ((*vstart) + (*size) > (ulong)bd)