diff options
author | Matt Fleming <matt@console-pimps.org> | 2009-10-06 17:22:25 -0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2009-10-10 08:51:12 -0400 |
commit | 1f69b6af9171f50135cce8023c84d82fbf42a8f5 (patch) | |
tree | 8d664d2d24f6f199e0b3af0afe18c85969a902fd /arch/sh/mm | |
parent | 8bd642b17bea31f8361b61c16c8d154638414df4 (diff) |
sh: Prepare for dynamic PMB support
To allow the MMU to be switched between 29bit and 32bit mode at runtime
some constants need to swapped for functions that return a runtime
value.
Signed-off-by: Matt Fleming <matt@console-pimps.org>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/mm')
-rw-r--r-- | arch/sh/mm/cache-sh4.c | 6 | ||||
-rw-r--r-- | arch/sh/mm/init.c | 8 |
2 files changed, 11 insertions, 3 deletions
diff --git a/arch/sh/mm/cache-sh4.c b/arch/sh/mm/cache-sh4.c index 639bb329fc81..56dd55a1b13e 100644 --- a/arch/sh/mm/cache-sh4.c +++ b/arch/sh/mm/cache-sh4.c | |||
@@ -88,12 +88,12 @@ static inline void flush_cache_4096(unsigned long start, | |||
88 | unsigned long flags, exec_offset = 0; | 88 | unsigned long flags, exec_offset = 0; |
89 | 89 | ||
90 | /* | 90 | /* |
91 | * All types of SH-4 require PC to be in P2 to operate on the I-cache. | 91 | * All types of SH-4 require PC to be uncached to operate on the I-cache. |
92 | * Some types of SH-4 require PC to be in P2 to operate on the D-cache. | 92 | * Some types of SH-4 require PC to be uncached to operate on the D-cache. |
93 | */ | 93 | */ |
94 | if ((boot_cpu_data.flags & CPU_HAS_P2_FLUSH_BUG) || | 94 | if ((boot_cpu_data.flags & CPU_HAS_P2_FLUSH_BUG) || |
95 | (start < CACHE_OC_ADDRESS_ARRAY)) | 95 | (start < CACHE_OC_ADDRESS_ARRAY)) |
96 | exec_offset = 0x20000000; | 96 | exec_offset = cached_to_uncached; |
97 | 97 | ||
98 | local_irq_save(flags); | 98 | local_irq_save(flags); |
99 | __flush_cache_4096(start | SH_CACHE_ASSOC, | 99 | __flush_cache_4096(start | SH_CACHE_ASSOC, |
diff --git a/arch/sh/mm/init.c b/arch/sh/mm/init.c index 8173e38afd38..c8af6c5fa586 100644 --- a/arch/sh/mm/init.c +++ b/arch/sh/mm/init.c | |||
@@ -323,4 +323,12 @@ int memory_add_physaddr_to_nid(u64 addr) | |||
323 | } | 323 | } |
324 | EXPORT_SYMBOL_GPL(memory_add_physaddr_to_nid); | 324 | EXPORT_SYMBOL_GPL(memory_add_physaddr_to_nid); |
325 | #endif | 325 | #endif |
326 | |||
326 | #endif /* CONFIG_MEMORY_HOTPLUG */ | 327 | #endif /* CONFIG_MEMORY_HOTPLUG */ |
328 | |||
329 | #ifdef CONFIG_PMB | ||
330 | int __in_29bit_mode(void) | ||
331 | { | ||
332 | return !(ctrl_inl(PMB_PASCR) & PASCR_SE); | ||
333 | } | ||
334 | #endif /* CONFIG_PMB */ | ||