aboutsummaryrefslogtreecommitdiff
path: root/arch/arm/mm/init.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2005-10-29 14:02:16 -0700
committerLinus Torvalds <torvalds@g5.osdl.org>2005-10-29 14:02:16 -0700
commitbe15cd72d256e5eb3261a781b8507fac83ab33f6 (patch)
tree1a8f95a9960e03149d27d935da25b768878feb3e /arch/arm/mm/init.c
parente9d52234e35b27ea4ea5f2ab64ca47b1a0c740ab (diff)
parent37d07b72ef58f2d5ec7701ab75084fbeee0e503e (diff)
Merge master.kernel.org:/home/rmk/linux-2.6-arm
Diffstat (limited to 'arch/arm/mm/init.c')
-rw-r--r--arch/arm/mm/init.c30
1 files changed, 19 insertions, 11 deletions
diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c
index f4496813615..fd079ff1fc5 100644
--- a/arch/arm/mm/init.c
+++ b/arch/arm/mm/init.c
@@ -363,20 +363,16 @@ static void __init bootmem_init(struct meminfo *mi)
memcpy(&meminfo, mi, sizeof(meminfo));
-#ifdef CONFIG_XIP_KERNEL
-#error needs fixing
- p->pfn = __phys_to_pfn(CONFIG_XIP_PHYS_ADDR & PMD_MASK);
- p->virtual = (unsigned long)&_stext & PMD_MASK;
- p->length = ((unsigned long)&_etext - p->virtual + ~PMD_MASK) & PMD_MASK;
- p->type = MT_ROM;
- p ++;
-#endif
-
/*
* Clear out all the mappings below the kernel image.
- * FIXME: what about XIP?
*/
- for (addr = 0; addr < PAGE_OFFSET; addr += PGDIR_SIZE)
+ for (addr = 0; addr < MODULE_START; addr += PGDIR_SIZE)
+ pmd_clear(pmd_off_k(addr));
+#ifdef CONFIG_XIP_KERNEL
+ /* The XIP kernel is mapped in the module area -- skip over it */
+ addr = ((unsigned long)&_etext + PGDIR_SIZE - 1) & PGDIR_MASK;
+#endif
+ for ( ; addr < PAGE_OFFSET; addr += PGDIR_SIZE)
pmd_clear(pmd_off_k(addr));
/*
@@ -436,6 +432,18 @@ static void __init devicemaps_init(struct machine_desc *mdesc)
pmd_clear(pmd_off_k(addr));
/*
+ * Map the kernel if it is XIP.
+ * It is always first in the modulearea.
+ */
+#ifdef CONFIG_XIP_KERNEL
+ map.pfn = __phys_to_pfn(CONFIG_XIP_PHYS_ADDR & PGDIR_MASK);
+ map.virtual = MODULE_START;
+ map.length = ((unsigned long)&_etext - map.virtual + ~PGDIR_MASK) & PGDIR_MASK;
+ map.type = MT_ROM;
+ create_mapping(&map);
+#endif
+
+ /*
* Map the cache flushing regions.
*/
#ifdef FLUSH_BASE