diff options
author | Matt Fleming <matt@console-pimps.org> | 2009-10-06 17:22:24 -0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2009-10-10 08:51:02 -0400 |
commit | 8bd642b17bea31f8361b61c16c8d154638414df4 (patch) | |
tree | f501b9cc5c7d129f27a5904086a5cafdbe1b711f | |
parent | 067784f6239e08a084b4d8d597e14435331eae51 (diff) |
sh: Obliterate the P1 area macros
Replace the use of PHYSADDR() with __pa(). PHYSADDR() is based on the
idea that all addresses in P1SEG are untranslated, so we can access an
address's physical page as an offset from P1SEG. This doesn't work for
CONFIG_PMB/CONFIG_PMB_FIXED because pages in P1SEG and P2SEG are used
for PMB mappings and so can be translated to any physical address.
Likewise, replace a P1SEGADDR() use with virt_to_phys().
Signed-off-by: Matt Fleming <matt@console-pimps.org>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-rw-r--r-- | arch/sh/boot/compressed/misc.c | 2 | ||||
-rw-r--r-- | arch/sh/include/asm/addrspace.h | 3 | ||||
-rw-r--r-- | arch/sh/kernel/machine_kexec.c | 2 | ||||
-rw-r--r-- | arch/sh/mm/cache-sh4.c | 2 | ||||
-rw-r--r-- | arch/sh/mm/cache-sh7705.c | 2 |
5 files changed, 4 insertions, 7 deletions
diff --git a/arch/sh/boot/compressed/misc.c b/arch/sh/boot/compressed/misc.c index fd56a71ca9d9..b51b1fc4baae 100644 --- a/arch/sh/boot/compressed/misc.c +++ b/arch/sh/boot/compressed/misc.c | |||
@@ -131,7 +131,7 @@ void decompress_kernel(void) | |||
131 | #ifdef CONFIG_SUPERH64 | 131 | #ifdef CONFIG_SUPERH64 |
132 | output_addr = (CONFIG_MEMORY_START + 0x2000); | 132 | output_addr = (CONFIG_MEMORY_START + 0x2000); |
133 | #else | 133 | #else |
134 | output_addr = PHYSADDR((unsigned long)&_text+PAGE_SIZE); | 134 | output_addr = __pa((unsigned long)&_text+PAGE_SIZE); |
135 | #ifdef CONFIG_29BIT | 135 | #ifdef CONFIG_29BIT |
136 | output_addr |= P2SEG; | 136 | output_addr |= P2SEG; |
137 | #endif | 137 | #endif |
diff --git a/arch/sh/include/asm/addrspace.h b/arch/sh/include/asm/addrspace.h index 80d40813e057..ebd6e49ba39e 100644 --- a/arch/sh/include/asm/addrspace.h +++ b/arch/sh/include/asm/addrspace.h | |||
@@ -28,9 +28,6 @@ | |||
28 | /* Returns the privileged segment base of a given address */ | 28 | /* Returns the privileged segment base of a given address */ |
29 | #define PXSEG(a) (((unsigned long)(a)) & 0xe0000000) | 29 | #define PXSEG(a) (((unsigned long)(a)) & 0xe0000000) |
30 | 30 | ||
31 | /* Returns the physical address of a PnSEG (n=1,2) address */ | ||
32 | #define PHYSADDR(a) (((unsigned long)(a)) & 0x1fffffff) | ||
33 | |||
34 | #if defined(CONFIG_29BIT) || defined(CONFIG_PMB_FIXED) | 31 | #if defined(CONFIG_29BIT) || defined(CONFIG_PMB_FIXED) |
35 | /* | 32 | /* |
36 | * Map an address to a certain privileged segment | 33 | * Map an address to a certain privileged segment |
diff --git a/arch/sh/kernel/machine_kexec.c b/arch/sh/kernel/machine_kexec.c index 7ea2704ea033..de7cf5477d3f 100644 --- a/arch/sh/kernel/machine_kexec.c +++ b/arch/sh/kernel/machine_kexec.c | |||
@@ -49,7 +49,7 @@ int machine_kexec_prepare(struct kimage *image) | |||
49 | /* older versions of kexec-tools are passing | 49 | /* older versions of kexec-tools are passing |
50 | * the zImage entry point as a virtual address. | 50 | * the zImage entry point as a virtual address. |
51 | */ | 51 | */ |
52 | if (image->start != PHYSADDR(image->start)) | 52 | if (image->start != __pa(image->start)) |
53 | return -EINVAL; /* upgrade your kexec-tools */ | 53 | return -EINVAL; /* upgrade your kexec-tools */ |
54 | 54 | ||
55 | return 0; | 55 | return 0; |
diff --git a/arch/sh/mm/cache-sh4.c b/arch/sh/mm/cache-sh4.c index 60588c5bf7f9..639bb329fc81 100644 --- a/arch/sh/mm/cache-sh4.c +++ b/arch/sh/mm/cache-sh4.c | |||
@@ -97,7 +97,7 @@ static inline void flush_cache_4096(unsigned long start, | |||
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, |
100 | P1SEGADDR(phys), exec_offset); | 100 | virt_to_phys(phys), exec_offset); |
101 | local_irq_restore(flags); | 101 | local_irq_restore(flags); |
102 | } | 102 | } |
103 | 103 | ||
diff --git a/arch/sh/mm/cache-sh7705.c b/arch/sh/mm/cache-sh7705.c index 2601935eb589..f527fb70fce6 100644 --- a/arch/sh/mm/cache-sh7705.c +++ b/arch/sh/mm/cache-sh7705.c | |||
@@ -141,7 +141,7 @@ static void sh7705_flush_dcache_page(void *arg) | |||
141 | if (mapping && !mapping_mapped(mapping)) | 141 | if (mapping && !mapping_mapped(mapping)) |
142 | set_bit(PG_dcache_dirty, &page->flags); | 142 | set_bit(PG_dcache_dirty, &page->flags); |
143 | else | 143 | else |
144 | __flush_dcache_page(PHYSADDR(page_address(page))); | 144 | __flush_dcache_page(__pa(page_address(page))); |
145 | } | 145 | } |
146 | 146 | ||
147 | static void __uses_jump_to_uncached sh7705_flush_cache_all(void *args) | 147 | static void __uses_jump_to_uncached sh7705_flush_cache_all(void *args) |