Skip to content

Commit

Permalink
post, memorytest: add support for none powerpc archs
Browse files Browse the repository at this point in the history
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 <[email protected]>
cc: Wolfgang Denk <[email protected]>
cc: Mike Frysinger <[email protected]>
  • Loading branch information
hsdenx authored and wdenx committed Jul 27, 2011
1 parent 90ea601 commit 4204298
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions post/drivers/memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 4204298

Please sign in to comment.