mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH 2/2] ARM pbl: actually create cached mappings in the decompressor
Date: Tue,  2 Oct 2012 15:06:57 +0200	[thread overview]
Message-ID: <1349183217-19639-3-git-send-email-s.hauer@pengutronix.de> (raw)
In-Reply-To: <1349183217-19639-1-git-send-email-s.hauer@pengutronix.de>

We called create_sections with 4096MB as size argument, but create_sections
expected the argument in bytes, so create sections was completely optimized
away due to the size >>= 20. This patch changes the size argument to be in
megabytes and adjusts map_cachable to pass the argument in megabytes.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 arch/arm/cpu/start-pbl.c |    7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/arch/arm/cpu/start-pbl.c b/arch/arm/cpu/start-pbl.c
index 2cd33ce..1626eb3 100644
--- a/arch/arm/cpu/start-pbl.c
+++ b/arch/arm/cpu/start-pbl.c
@@ -56,14 +56,13 @@ extern void *input_data_end;
 
 static unsigned long *ttb;
 
-static void create_sections(unsigned long addr, int size, unsigned int flags)
+static void create_sections(unsigned long addr, int size_m, unsigned int flags)
 {
 	int i;
 
 	addr >>= 20;
-	size >>= 20;
 
-	for (i = size; i > 0; i--, addr++)
+	for (i = size_m; i > 0; i--, addr++)
 		ttb[addr] = (addr << 20) | flags;
 }
 
@@ -72,7 +71,7 @@ static void map_cachable(unsigned long start, unsigned long size)
 	start &= ~(SZ_1M - 1);
 	size = (size + (SZ_1M - 1)) & ~(SZ_1M - 1);
 
-	create_sections(start, size, PMD_SECT_AP_WRITE |
+	create_sections(start, size >> 20, PMD_SECT_AP_WRITE |
 			PMD_SECT_AP_READ | PMD_TYPE_SECT | PMD_SECT_WB);
 }
 
-- 
1.7.10.4


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

  parent reply	other threads:[~2012-10-02 13:07 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-02 13:06 [PATCH] pbl updates Sascha Hauer
2012-10-02 13:06 ` [PATCH 1/2] ARM pbl: Provide a dummy error function for the decompressor Sascha Hauer
2012-10-02 13:06 ` Sascha Hauer [this message]
2012-10-02 14:30 ` [PATCH] pbl updates Jean-Christophe PLAGNIOL-VILLARD
2012-10-02 16:50   ` Sascha Hauer
2012-10-02 18:36     ` Jean-Christophe PLAGNIOL-VILLARD
2012-10-03 10:06       ` Sascha Hauer
2012-10-03 11:37         ` Jean-Christophe PLAGNIOL-VILLARD

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=1349183217-19639-3-git-send-email-s.hauer@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --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