summaryrefslogtreecommitdiffstats
path: root/commands/memtest.c
diff options
context:
space:
mode:
authorRenaud Barbier <renaud.barbier@ge.com>2014-02-28 12:58:54 +0000
committerSascha Hauer <s.hauer@pengutronix.de>2014-03-03 09:07:20 +0100
commit04e9bdbc533eee75452f50762212f6411fe1d408 (patch)
treecd025774ce59af442209fbfc6cb0d0afd11578b3 /commands/memtest.c
parent8c2f0bb041ffb417d03309e280ad4421052a031c (diff)
downloadbarebox-04e9bdbc533eee75452f50762212f6411fe1d408.tar.gz
barebox-04e9bdbc533eee75452f50762212f6411fe1d408.tar.xz
memtest: exclude page starting at address 0.
memtest fails when a reserved sdram region is at the bank start at address 0. This patch supports the exclusion of memory region at the bank start. Tested on P2020RDB and DA923RC, qemuarm versatilepb. Signed-off-by: Renaud Barbier <renaud.barbier@ge.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'commands/memtest.c')
-rw-r--r--commands/memtest.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/commands/memtest.c b/commands/memtest.c
index c82badc951..a71576eeb9 100644
--- a/commands/memtest.c
+++ b/commands/memtest.c
@@ -88,11 +88,11 @@ static int request_memtest_regions(struct list_head *list)
* remember last used element
*/
start = PAGE_ALIGN(bank->res->start);
- end = PAGE_ALIGN_DOWN(r->start) - 1;
- size = end - start + 1;
+ end = PAGE_ALIGN_DOWN(r->start);
r_prev = r;
- if (start >= end)
+ if (start == end)
continue;
+ size = end - start;
ret = alloc_memtest_region(list, start, size);
if (ret < 0)
@@ -103,12 +103,12 @@ static int request_memtest_regions(struct list_head *list)
* Between used regions
*/
start = PAGE_ALIGN(r_prev->end);
- end = PAGE_ALIGN_DOWN(r->start) - 1;
- size = end - start + 1;
+ end = PAGE_ALIGN_DOWN(r->start);
r_prev = r;
if (start >= end)
continue;
+ size = end - start;
ret = alloc_memtest_region(list, start, size);
if (ret < 0)
return ret;