diff options
author | Albert Herranz <albert_herranz@yahoo.es> | 2009-12-12 01:31:54 -0500 |
---|---|---|
committer | Grant Likely <grant.likely@secretlab.ca> | 2009-12-13 00:24:32 -0500 |
commit | c5df7f775148723de39274537a886e9502eef336 (patch) | |
tree | 548acbcef58b1d60308f7e7cd894d514583895a2 /arch/powerpc | |
parent | de32400dd26e743c5d500aa42d8d6818b79edb73 (diff) |
powerpc: allow ioremap within reserved memory regions
Add a flag to let a platform ioremap memory regions marked as reserved.
This flag will be used later by the Nintendo Wii support code to allow
ioremapping the I/O region sitting between MEM1 and MEM2 and marked
as reserved RAM in the patch "wii: use both mem1 and mem2 as ram".
This will no longer be needed when proper discontig memory support
for 32-bit PowerPC is added to the kernel.
Signed-off-by: Albert Herranz <albert_herranz@yahoo.es>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Diffstat (limited to 'arch/powerpc')
-rw-r--r-- | arch/powerpc/mm/init_32.c | 5 | ||||
-rw-r--r-- | arch/powerpc/mm/mmu_decl.h | 1 | ||||
-rw-r--r-- | arch/powerpc/mm/pgtable_32.c | 4 |
3 files changed, 9 insertions, 1 deletions
diff --git a/arch/powerpc/mm/init_32.c b/arch/powerpc/mm/init_32.c index 703c7c2e0d9f..4ec900af332f 100644 --- a/arch/powerpc/mm/init_32.c +++ b/arch/powerpc/mm/init_32.c | |||
@@ -82,6 +82,11 @@ extern struct task_struct *current_set[NR_CPUS]; | |||
82 | int __map_without_bats; | 82 | int __map_without_bats; |
83 | int __map_without_ltlbs; | 83 | int __map_without_ltlbs; |
84 | 84 | ||
85 | /* | ||
86 | * This tells the system to allow ioremapping memory marked as reserved. | ||
87 | */ | ||
88 | int __allow_ioremap_reserved; | ||
89 | |||
85 | /* max amount of low RAM to map in */ | 90 | /* max amount of low RAM to map in */ |
86 | unsigned long __max_low_memory = MAX_LOW_MEM; | 91 | unsigned long __max_low_memory = MAX_LOW_MEM; |
87 | 92 | ||
diff --git a/arch/powerpc/mm/mmu_decl.h b/arch/powerpc/mm/mmu_decl.h index 9aa39fe74f8a..34dacc32250d 100644 --- a/arch/powerpc/mm/mmu_decl.h +++ b/arch/powerpc/mm/mmu_decl.h | |||
@@ -115,6 +115,7 @@ extern void settlbcam(int index, unsigned long virt, phys_addr_t phys, | |||
115 | extern void invalidate_tlbcam_entry(int index); | 115 | extern void invalidate_tlbcam_entry(int index); |
116 | 116 | ||
117 | extern int __map_without_bats; | 117 | extern int __map_without_bats; |
118 | extern int __allow_ioremap_reserved; | ||
118 | extern unsigned long ioremap_base; | 119 | extern unsigned long ioremap_base; |
119 | extern unsigned int rtas_data, rtas_size; | 120 | extern unsigned int rtas_data, rtas_size; |
120 | 121 | ||
diff --git a/arch/powerpc/mm/pgtable_32.c b/arch/powerpc/mm/pgtable_32.c index b55bbe87acb8..177e4038b43c 100644 --- a/arch/powerpc/mm/pgtable_32.c +++ b/arch/powerpc/mm/pgtable_32.c | |||
@@ -26,6 +26,7 @@ | |||
26 | #include <linux/vmalloc.h> | 26 | #include <linux/vmalloc.h> |
27 | #include <linux/init.h> | 27 | #include <linux/init.h> |
28 | #include <linux/highmem.h> | 28 | #include <linux/highmem.h> |
29 | #include <linux/lmb.h> | ||
29 | 30 | ||
30 | #include <asm/pgtable.h> | 31 | #include <asm/pgtable.h> |
31 | #include <asm/pgalloc.h> | 32 | #include <asm/pgalloc.h> |
@@ -191,7 +192,8 @@ __ioremap_caller(phys_addr_t addr, unsigned long size, unsigned long flags, | |||
191 | * Don't allow anybody to remap normal RAM that we're using. | 192 | * Don't allow anybody to remap normal RAM that we're using. |
192 | * mem_init() sets high_memory so only do the check after that. | 193 | * mem_init() sets high_memory so only do the check after that. |
193 | */ | 194 | */ |
194 | if (mem_init_done && (p < virt_to_phys(high_memory))) { | 195 | if (mem_init_done && (p < virt_to_phys(high_memory)) && |
196 | !(__allow_ioremap_reserved && lmb_is_region_reserved(p, size))) { | ||
195 | printk("__ioremap(): phys addr 0x%llx is RAM lr %p\n", | 197 | printk("__ioremap(): phys addr 0x%llx is RAM lr %p\n", |
196 | (unsigned long long)p, __builtin_return_address(0)); | 198 | (unsigned long long)p, __builtin_return_address(0)); |
197 | return NULL; | 199 | return NULL; |