Patchwork [U-Boot,v2] post, memorytest: add support for none powerpc archs

login
register
mail settings
Submitter Heiko Schocher
Date June 3, 2011, 5:38 a.m.
Message ID <1307079504-5208-1-git-send-email-hs@denx.de>
Download mbox | patch
Permalink /patch/98522/
State Accepted
Commit 4204298db0c5fcf14de852c9b2c6ac3324b106b1
Headers show

Comments

Heiko Schocher - June 3, 2011, 5:38 a.m.
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>
---
changes for v2:
  added comment from Wolfgang Denk:
    - add comment, that this function is only valid
      for contiguous memory banks.
  added comment from Mike Frysinger:
    - use gd->ram_size instead of bd->bi_memsize
      -> no ifdef needed.

 post/drivers/memory.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
Wolfgang Denk - July 27, 2011, 9:38 p.m.
Dear Heiko Schocher,

In message <1307079504-5208-1-git-send-email-hs@denx.de> you wrote:
> 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>
> ---
> changes for v2:
>   added comment from Wolfgang Denk:
>     - add comment, that this function is only valid
>       for contiguous memory banks.
>   added comment from Mike Frysinger:
>     - use gd->ram_size instead of bd->bi_memsize
>       -> no ifdef needed.
> 
>  post/drivers/memory.c |    8 ++++++--
>  1 files changed, 6 insertions(+), 2 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

Patch

diff --git a/post/drivers/memory.c b/post/drivers/memory.c
index b7943ef..b286e3f 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)