aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mm/mmu.c
diff options
context:
space:
mode:
authorRussell King <rmk@dyn-67.arm.linux.org.uk>2007-07-04 21:16:33 +0100
committerRussell King <rmk+kernel@arm.linux.org.uk>2007-07-04 21:16:33 +0100
commit7b9c7b4d07fd8981193a2c4ecb650566f42d1219 (patch)
treebd80d48a0d024588571b9c9d30d3f8ee8cbe1418 /arch/arm/mm/mmu.c
parent1f750a782c0e9593a8d0981ea972f22334980955 (diff)
downloadkernel_samsung_crespo-7b9c7b4d07fd8981193a2c4ecb650566f42d1219.zip
kernel_samsung_crespo-7b9c7b4d07fd8981193a2c4ecb650566f42d1219.tar.gz
kernel_samsung_crespo-7b9c7b4d07fd8981193a2c4ecb650566f42d1219.tar.bz2
[ARM] Fix non-page aligned boot time mappings
AT91SAM9260 stopped booting with the recent changes to MM initialisation - it was asking for a non-aligned virtual address which caused loops to be non-terminal. Fix this by rounding virtual addresses down, but remember to include the offset in the length, and round the length up to the following page. This means that asking for a mapping of 4K starting at 2K into a page maps two pages as one would expect. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mm/mmu.c')
-rw-r--r--arch/arm/mm/mmu.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c
index 02e050a..3b5e47d 100644
--- a/arch/arm/mm/mmu.c
+++ b/arch/arm/mm/mmu.c
@@ -527,9 +527,9 @@ void __init create_mapping(struct map_desc *md)
return;
}
- addr = md->virtual;
+ addr = md->virtual & PAGE_MASK;
phys = (unsigned long)__pfn_to_phys(md->pfn);
- length = PAGE_ALIGN(md->length);
+ length = PAGE_ALIGN(md->length + (md->virtual & ~PAGE_MASK));
if (type->prot_l1 == 0 && ((addr | phys | length) & ~SECTION_MASK)) {
printk(KERN_WARNING "BUG: map for 0x%08lx at 0x%08lx can not "