]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
sh: Obliterate the P1 area macros
authorMatt Fleming <matt@console-pimps.org>
Tue, 6 Oct 2009 21:22:24 +0000 (21:22 +0000)
committerPaul Mundt <lethal@linux-sh.org>
Sat, 10 Oct 2009 12:51:02 +0000 (21:51 +0900)
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>
arch/sh/boot/compressed/misc.c
arch/sh/include/asm/addrspace.h
arch/sh/kernel/machine_kexec.c
arch/sh/mm/cache-sh4.c
arch/sh/mm/cache-sh7705.c

index fd56a71ca9d9bbf47c3080d2473f2d4ad2ac0478..b51b1fc4baae91cd8db937d5e28ad4594311d0ad 100644 (file)
@@ -131,7 +131,7 @@ void decompress_kernel(void)
 #ifdef CONFIG_SUPERH64
        output_addr = (CONFIG_MEMORY_START + 0x2000);
 #else
-       output_addr = PHYSADDR((unsigned long)&_text+PAGE_SIZE);
+       output_addr = __pa((unsigned long)&_text+PAGE_SIZE);
 #ifdef CONFIG_29BIT
        output_addr |= P2SEG;
 #endif
index 80d40813e057fc235c4f0f6b21bd57c6f671345e..ebd6e49ba39e137ebb5477db700f2dd4e2ce23df 100644 (file)
@@ -28,9 +28,6 @@
 /* Returns the privileged segment base of a given address  */
 #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)
 /*
  * Map an address to a certain privileged segment
index 7ea2704ea03326bd67ec5b85b85e41433abbe55c..de7cf5477d3f62e7c840d3fcca03040b165cdc84 100644 (file)
@@ -49,7 +49,7 @@ int machine_kexec_prepare(struct kimage *image)
        /* older versions of kexec-tools are passing
         * 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 0;
index 60588c5bf7f922e883baab120cf6ac767b58097d..639bb329fc813dd594a393cf3e38258ac2dc55c8 100644 (file)
@@ -97,7 +97,7 @@ static inline void flush_cache_4096(unsigned long start,
 
        local_irq_save(flags);
        __flush_cache_4096(start | SH_CACHE_ASSOC,
-                          P1SEGADDR(phys), exec_offset);
+                          virt_to_phys(phys), exec_offset);
        local_irq_restore(flags);
 }
 
index 2601935eb589a73e8e20514e09ed4ec33ff5bbfb..f527fb70fce63988b92e7c1eb0c48fc0908e49a3 100644 (file)
@@ -141,7 +141,7 @@ static void sh7705_flush_dcache_page(void *arg)
        if (mapping && !mapping_mapped(mapping))
                set_bit(PG_dcache_dirty, &page->flags);
        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)