diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2012-10-02 14:56:10 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2012-10-04 18:30:58 +0200 |
commit | 6bb06524d665b4fbcefddb6b914273466fe801dd (patch) | |
tree | 25f8536f4c2e6dfa38460924aa538a4ce43d5587 | |
parent | a86824b5ac0a1fe8c9951cf3298eedb8e3505d7e (diff) | |
download | barebox-6bb06524d665b4fbcefddb6b914273466fe801dd.tar.gz barebox-6bb06524d665b4fbcefddb6b914273466fe801dd.tar.xz |
ARM pbl: actually create cached mappings in the decompressor
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>
-rw-r--r-- | arch/arm/cpu/start-pbl.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/arch/arm/cpu/start-pbl.c b/arch/arm/cpu/start-pbl.c index 951735bc67..0467dfe832 100644 --- a/arch/arm/cpu/start-pbl.c +++ b/arch/arm/cpu/start-pbl.c @@ -71,14 +71,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; } @@ -87,7 +86,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); } |