summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKumar Gala <galak@kernel.crashing.org>2008-12-16 14:59:21 -0600
committerAndrew Fleming-AFLEMING <afleming@freescale.com>2008-12-19 18:20:08 -0600
commit77c8115b1f1871811633eae77a5a700fac1f0e50 (patch)
tree2c08b20841cef7aa3156e7ed8eee27786b6987d2
parentecf5b98c7a6a2e2256dfddd48fab26678dcd6b90 (diff)
downloadu-boot-imx-77c8115b1f1871811633eae77a5a700fac1f0e50.zip
u-boot-imx-77c8115b1f1871811633eae77a5a700fac1f0e50.tar.gz
u-boot-imx-77c8115b1f1871811633eae77a5a700fac1f0e50.tar.bz2
ppc: Use addrmap in virt_to_phys and map_physmem.
If we have addr map support enabled use the mapping functions to implement virt_to_phys() and map_physmem(). Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
-rw-r--r--include/asm-ppc/io.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/asm-ppc/io.h b/include/asm-ppc/io.h
index 64cb746..4ddad26 100644
--- a/include/asm-ppc/io.h
+++ b/include/asm-ppc/io.h
@@ -10,6 +10,10 @@
#include <linux/config.h>
#include <asm/byteorder.h>
+#ifdef CONFIG_ADDR_MAP
+#include <addr_map.h>
+#endif
+
#define SIO_CONFIG_RA 0x398
#define SIO_CONFIG_RD 0x399
@@ -287,7 +291,11 @@ extern inline void out_be32(volatile unsigned __iomem *addr, int val)
static inline void *
map_physmem(phys_addr_t paddr, unsigned long len, unsigned long flags)
{
+#ifdef CONFIG_ADDR_MAP
+ return (void *)(addrmap_phys_to_virt(paddr));
+#else
return (void *)((unsigned long)paddr);
+#endif
}
/*
@@ -300,7 +308,11 @@ static inline void unmap_physmem(void *vaddr, unsigned long flags)
static inline phys_addr_t virt_to_phys(void * vaddr)
{
+#ifdef CONFIG_ADDR_MAP
+ return addrmap_virt_to_phys(vaddr);
+#else
return (phys_addr_t)((unsigned long)vaddr);
+#endif
}
#endif