mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Renaud Barbier <renaud.barbier@ge.com>
To: barebox@lists.infradead.org
Subject: [PATCH 3/4] memtest: exclude page starting at address 0.
Date: Thu, 27 Feb 2014 13:46:58 +0000	[thread overview]
Message-ID: <1393508819-3693-4-git-send-email-renaud.barbier@ge.com> (raw)
In-Reply-To: <1393508819-3693-1-git-send-email-renaud.barbier@ge.com>

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>
---
 commands/memtest.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/commands/memtest.c b/commands/memtest.c
index c82badc..a71576e 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;
-- 
1.7.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  parent reply	other threads:[~2014-02-27 13:47 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-27 13:46 [PATCH 0/4] ppc: memory layout and memtest Renaud Barbier
2014-02-27 13:46 ` [PATCH 1/4] ppc: fix memory layout to prevent corruption during memtest Renaud Barbier
2014-02-27 20:09   ` Sascha Hauer
2014-02-27 13:46 ` [PATCH 2/4] ppc: add support for memtest with cache disabled Renaud Barbier
2014-02-27 13:46 ` Renaud Barbier [this message]
2014-02-27 20:44   ` [PATCH 3/4] memtest: exclude page starting at address 0 Alexander Aring
2014-02-27 13:46 ` [PATCH 4/4] ppc: P2020RDB and DA923RC configuration Renaud Barbier
2014-02-28 12:58 [PATCH v2 0/4] ppc: memory layout and memtest Renaud Barbier
2014-02-28 12:58 ` [PATCH 3/4] memtest: exclude page starting at address 0 Renaud Barbier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1393508819-3693-4-git-send-email-renaud.barbier@ge.com \
    --to=renaud.barbier@ge.com \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox