Skip to content
Snippets Groups Projects
Commit 9c02defc authored by Yuri Tikhonov's avatar Yuri Tikhonov Committed by Stefan Roese
Browse files

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: default avatarYuri Tikhonov <yur@emcraft.com>
Signed-off-by: default avatarStefan Roese <sr@denx.de>
parent 75e1a84d
No related branches found
No related tags found
No related merge requests found
...@@ -461,6 +461,9 @@ int memory_post_test (int flags) ...@@ -461,6 +461,9 @@ int memory_post_test (int flags)
unsigned long memsize = (bd->bi_memsize >= 256 << 20 ? unsigned long memsize = (bd->bi_memsize >= 256 << 20 ?
256 << 20 : bd->bi_memsize) - (1 << 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) { if (flags & POST_SLOWTEST) {
ret = memory_post_tests (CFG_SDRAM_BASE, memsize); ret = memory_post_tests (CFG_SDRAM_BASE, memsize);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment