diff options
author | George G. Davis <davis_g@mvista.com> | 2006-09-22 13:36:38 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2006-09-27 04:35:05 -0400 |
commit | 4052ebb7a2729bd7c28260cdf8e470c0d81b9c56 (patch) | |
tree | be3d93df979ab49c9607f290265f955f2198ddd9 | |
parent | 4b053e7a320882fbdbc6613cec60a929553b4215 (diff) |
[ARM] 3859/1: Fix devicemaps_init() XIP_KERNEL odd 1MiB XIP_PHYS_ADDR translation error
The ARM XIP_KERNEL map created in devicemaps_init() is wrong.
The map.pfn is rounded down to an even 1MiB section boundary
which results in va/pa translations errors when XIP_PHYS_ADDR
starts on an odd 1MiB boundary and this causes the kernel to
hang. This patch fixes ARM XIP_KERNEL translation errors for
the odd 1MiB XIP_PHYS_ADDR boundary case.
Signed-off-by: George G. Davis <gdavis@mvista.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
-rw-r--r-- | arch/arm/mm/init.c | 4 | ||||
-rw-r--r-- | include/asm-arm/pgtable.h | 7 |
2 files changed, 9 insertions, 2 deletions
diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c index 1099af6d470a..64262bda8e54 100644 --- a/arch/arm/mm/init.c +++ b/arch/arm/mm/init.c | |||
@@ -434,9 +434,9 @@ static void __init devicemaps_init(struct machine_desc *mdesc) | |||
434 | * It is always first in the modulearea. | 434 | * It is always first in the modulearea. |
435 | */ | 435 | */ |
436 | #ifdef CONFIG_XIP_KERNEL | 436 | #ifdef CONFIG_XIP_KERNEL |
437 | map.pfn = __phys_to_pfn(CONFIG_XIP_PHYS_ADDR & PGDIR_MASK); | 437 | map.pfn = __phys_to_pfn(CONFIG_XIP_PHYS_ADDR & SECTION_MASK); |
438 | map.virtual = MODULE_START; | 438 | map.virtual = MODULE_START; |
439 | map.length = ((unsigned long)&_etext - map.virtual + ~PGDIR_MASK) & PGDIR_MASK; | 439 | map.length = ((unsigned long)&_etext - map.virtual + ~SECTION_MASK) & SECTION_MASK; |
440 | map.type = MT_ROM; | 440 | map.type = MT_ROM; |
441 | create_mapping(&map); | 441 | create_mapping(&map); |
442 | #endif | 442 | #endif |
diff --git a/include/asm-arm/pgtable.h b/include/asm-arm/pgtable.h index 8d3919c6458c..38b2b55688e2 100644 --- a/include/asm-arm/pgtable.h +++ b/include/asm-arm/pgtable.h | |||
@@ -136,6 +136,13 @@ extern void __pgd_error(const char *file, int line, unsigned long val); | |||
136 | #define USER_PTRS_PER_PGD ((TASK_SIZE/PGDIR_SIZE) - FIRST_USER_PGD_NR) | 136 | #define USER_PTRS_PER_PGD ((TASK_SIZE/PGDIR_SIZE) - FIRST_USER_PGD_NR) |
137 | 137 | ||
138 | /* | 138 | /* |
139 | * section address mask and size definitions. | ||
140 | */ | ||
141 | #define SECTION_SHIFT 20 | ||
142 | #define SECTION_SIZE (1UL << SECTION_SHIFT) | ||
143 | #define SECTION_MASK (~(SECTION_SIZE-1)) | ||
144 | |||
145 | /* | ||
139 | * ARMv6 supersection address mask and size definitions. | 146 | * ARMv6 supersection address mask and size definitions. |
140 | */ | 147 | */ |
141 | #define SUPERSECTION_SHIFT 24 | 148 | #define SUPERSECTION_SHIFT 24 |