[PATCH 2/2] ARM pbl: actually create cached mappings in the decompressor
Sascha Hauer
s.hauer at pengutronix.de
Tue Oct 2 09:06:57 EDT 2012
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 at 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
More information about the barebox
mailing list