aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mm/init.c
diff options
context:
space:
mode:
authorNicolas Pitre <nico@cam.org>2005-10-29 11:28:29 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2005-10-29 11:28:29 -0400
commit1a47ebc0d971fbc47cd859a09956f7c7d001f5fd (patch)
tree7e1f083a72712f7bbc29829622683a5077927492 /arch/arm/mm/init.c
parentb4a1f67fbfb848ded8cf0c6c305224534144ab2d (diff)
[ARM] 3059/1: fix XIP support
Patch from Nicolas Pitre Fix XIP support after recent bootmem code refactoring. Signed-off-by: Nicolas Pitre <nico@cam.org> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
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 f4496813615a..fd079ff1fc53 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)
363 363
364 memcpy(&meminfo, mi, sizeof(meminfo)); 364 memcpy(&meminfo, mi, sizeof(meminfo));
365 365
366#ifdef CONFIG_XIP_KERNEL
367#error needs fixing
368 p->pfn = __phys_to_pfn(CONFIG_XIP_PHYS_ADDR & PMD_MASK);
369 p->virtual = (unsigned long)&_stext & PMD_MASK;
370 p->length = ((unsigned long)&_etext - p->virtual + ~PMD_MASK) & PMD_MASK;
371 p->type = MT_ROM;
372 p ++;
373#endif
374
375 /* 366 /*
376 * Clear out all the mappings below the kernel image. 367 * Clear out all the mappings below the kernel image.
377 * FIXME: what about XIP?
378 */ 368 */
379 for (addr = 0; addr < PAGE_OFFSET; addr += PGDIR_SIZE) 369 for (addr = 0; addr < MODULE_START; addr += PGDIR_SIZE)
370 pmd_clear(pmd_off_k(addr));
371#ifdef CONFIG_XIP_KERNEL
372 /* The XIP kernel is mapped in the module area -- skip over it */
373 addr = ((unsigned long)&_etext + PGDIR_SIZE - 1) & PGDIR_MASK;
374#endif
375 for ( ; addr < PAGE_OFFSET; addr += PGDIR_SIZE)
380 pmd_clear(pmd_off_k(addr)); 376 pmd_clear(pmd_off_k(addr));
381 377
382 /* 378 /*
@@ -436,6 +432,18 @@ static void __init devicemaps_init(struct machine_desc *mdesc)
436 pmd_clear(pmd_off_k(addr)); 432 pmd_clear(pmd_off_k(addr));
437 433
438 /* 434 /*
435 * Map the kernel if it is XIP.
436 * It is always first in the modulearea.
437 */
438#ifdef CONFIG_XIP_KERNEL
439 map.pfn = __phys_to_pfn(CONFIG_XIP_PHYS_ADDR & PGDIR_MASK);
440 map.virtual = MODULE_START;
441 map.length = ((unsigned long)&_etext - map.virtual + ~PGDIR_MASK) & PGDIR_MASK;
442 map.type = MT_ROM;
443 create_mapping(&map);
444#endif
445
446 /*
439 * Map the cache flushing regions. 447 * Map the cache flushing regions.
440 */ 448 */
441#ifdef FLUSH_BASE 449#ifdef FLUSH_BASE