aboutsummaryrefslogtreecommitdiff
path: root/post/drivers
diff options
context:
space:
mode:
authorYuri Tikhonov2007-08-25 05:07:16 +0200
committerStefan Roese2007-08-25 05:07:16 +0200
commit9c02defc29b57945b600714cf61ddfd02b02fb14 (patch)
tree9977ca0ba7e1c24bbf2e480677b2bc5a1afcc83b /post/drivers
parent75e1a84d483e36be10e206e539b028c4889e1158 (diff)
POST: limit memory test area to not touch global data anymore
As experienced on lwmon5, on some boards the POST memory test can corrupt the global data buffer (bd). This patch fixes this issue by checking and limiting this area. Signed-off-by: Yuri Tikhonov <yur@emcraft.com> Signed-off-by: Stefan Roese <sr@denx.de>
Diffstat (limited to 'post/drivers')
-rw-r--r--post/drivers/memory.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/post/drivers/memory.c b/post/drivers/memory.c
index a2c088bad8d..fbc349a852f 100644
--- a/post/drivers/memory.c
+++ b/post/drivers/memory.c
@@ -461,6 +461,9 @@ int memory_post_test (int flags)
unsigned long memsize = (bd->bi_memsize >= 256 << 20 ?
256 << 20 : bd->bi_memsize) - (1 << 20);
+ /* Limit area to be tested with the board info struct */
+ if (CFG_SDRAM_BASE + memsize > (ulong)bd)
+ memsize = (ulong)bd - CFG_SDRAM_BASE;
if (flags & POST_SLOWTEST) {
ret = memory_post_tests (CFG_SDRAM_BASE, memsize);