From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kumar Gala Date: Sat, 13 Dec 2008 17:20:30 -0600 Subject: [U-Boot] [PATCH v4 4/4] ppc: Use addrmap in virt_to_phys and map_physmem. In-Reply-To: <1229210430-4522-3-git-send-email-galak@kernel.crashing.org> References: <1229210430-4522-1-git-send-email-galak@kernel.crashing.org> <1229210430-4522-2-git-send-email-galak@kernel.crashing.org> <1229210430-4522-3-git-send-email-galak@kernel.crashing.org> Message-ID: <1229210430-4522-4-git-send-email-galak@kernel.crashing.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de If we have addr map support enabled use the mapping functions to implement virt_to_phys() and map_physmem(). Signed-off-by: Kumar Gala --- * No change, just reposting as part of the sequence include/asm-ppc/io.h | 12 ++++++++++++ 1 files changed, 12 insertions(+), 0 deletions(-) diff --git a/include/asm-ppc/io.h b/include/asm-ppc/io.h index c00de45..a8003ef 100644 --- a/include/asm-ppc/io.h +++ b/include/asm-ppc/io.h @@ -10,6 +10,10 @@ #include #include +#ifdef CONFIG_ADDR_MAP +#include +#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)(vaddr); +#endif } #endif -- 1.5.6.5