Commit 8bd642b1 authored by Matt Fleming's avatar Matt Fleming Committed by Paul Mundt

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: default avatarMatt Fleming <matt@console-pimps.org>
Signed-off-by: default avatarPaul Mundt <lethal@linux-sh.org>
parent 067784f6
...@@ -131,7 +131,7 @@ void decompress_kernel(void) ...@@ -131,7 +131,7 @@ void decompress_kernel(void)
#ifdef CONFIG_SUPERH64 #ifdef CONFIG_SUPERH64
output_addr = (CONFIG_MEMORY_START + 0x2000); output_addr = (CONFIG_MEMORY_START + 0x2000);
#else #else
output_addr = PHYSADDR((unsigned long)&_text+PAGE_SIZE); output_addr = __pa((unsigned long)&_text+PAGE_SIZE);
#ifdef CONFIG_29BIT #ifdef CONFIG_29BIT
output_addr |= P2SEG; output_addr |= P2SEG;
#endif #endif
......
...@@ -28,9 +28,6 @@ ...@@ -28,9 +28,6 @@
/* Returns the privileged segment base of a given address */ /* Returns the privileged segment base of a given address */
#define PXSEG(a) (((unsigned long)(a)) & 0xe0000000) #define PXSEG(a) (((unsigned long)(a)) & 0xe0000000)
/* Returns the physical address of a PnSEG (n=1,2) address */
#define PHYSADDR(a) (((unsigned long)(a)) & 0x1fffffff)
#if defined(CONFIG_29BIT) || defined(CONFIG_PMB_FIXED) #if defined(CONFIG_29BIT) || defined(CONFIG_PMB_FIXED)
/* /*
* Map an address to a certain privileged segment * Map an address to a certain privileged segment
......
...@@ -49,7 +49,7 @@ int machine_kexec_prepare(struct kimage *image) ...@@ -49,7 +49,7 @@ int machine_kexec_prepare(struct kimage *image)
/* older versions of kexec-tools are passing /* older versions of kexec-tools are passing
* the zImage entry point as a virtual address. * the zImage entry point as a virtual address.
*/ */
if (image->start != PHYSADDR(image->start)) if (image->start != __pa(image->start))
return -EINVAL; /* upgrade your kexec-tools */ return -EINVAL; /* upgrade your kexec-tools */
return 0; return 0;
......
...@@ -97,7 +97,7 @@ static inline void flush_cache_4096(unsigned long start, ...@@ -97,7 +97,7 @@ static inline void flush_cache_4096(unsigned long start,
local_irq_save(flags); local_irq_save(flags);
__flush_cache_4096(start | SH_CACHE_ASSOC, __flush_cache_4096(start | SH_CACHE_ASSOC,
P1SEGADDR(phys), exec_offset); virt_to_phys(phys), exec_offset);
local_irq_restore(flags); local_irq_restore(flags);
} }
......
...@@ -141,7 +141,7 @@ static void sh7705_flush_dcache_page(void *arg) ...@@ -141,7 +141,7 @@ static void sh7705_flush_dcache_page(void *arg)
if (mapping && !mapping_mapped(mapping)) if (mapping && !mapping_mapped(mapping))
set_bit(PG_dcache_dirty, &page->flags); set_bit(PG_dcache_dirty, &page->flags);
else else
__flush_dcache_page(PHYSADDR(page_address(page))); __flush_dcache_page(__pa(page_address(page)));
} }
static void __uses_jump_to_uncached sh7705_flush_cache_all(void *args) static void __uses_jump_to_uncached sh7705_flush_cache_all(void *args)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment