[ARM] remove a common set of __virt_to_bus definitions
authorNicolas Pitre <nico@cam.org>
Sat, 6 Sep 2008 01:53:30 +0000 (21:53 -0400)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Fri, 28 Nov 2008 15:36:49 +0000 (15:36 +0000)
Let's provide an overridable default instead of having every machine
class define __virt_to_bus and __bus_to_virt to the same thing.  What
most platforms are using is bus_addr == phys_addr so such is the default.

One exception is ebsa110 which has no DMA what so ever, so the actual
definition is not important except only for proper compilation.  Also
added a comment about the special footbridge bus translation.

Let's also remove comments alluding to set_dma_addr which is not
(and should not) be commonly used.

Signed-off-by: Nicolas Pitre <nico@marvell.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
39 files changed:
arch/arm/include/asm/memory.h
arch/arm/mach-aaec2000/include/mach/memory.h
arch/arm/mach-at91/include/mach/memory.h
arch/arm/mach-clps711x/include/mach/memory.h
arch/arm/mach-clps7500/include/mach/memory.h
arch/arm/mach-davinci/include/mach/memory.h
arch/arm/mach-ebsa110/include/mach/memory.h
arch/arm/mach-ep93xx/include/mach/memory.h
arch/arm/mach-footbridge/include/mach/memory.h
arch/arm/mach-h720x/include/mach/memory.h
arch/arm/mach-imx/include/mach/memory.h
arch/arm/mach-integrator/include/mach/memory.h
arch/arm/mach-iop13xx/include/mach/memory.h
arch/arm/mach-iop32x/include/mach/memory.h
arch/arm/mach-iop33x/include/mach/memory.h
arch/arm/mach-ixp2000/include/mach/memory.h
arch/arm/mach-ixp23xx/include/mach/memory.h
arch/arm/mach-ixp4xx/include/mach/memory.h
arch/arm/mach-kirkwood/include/mach/memory.h
arch/arm/mach-ks8695/include/mach/memory.h
arch/arm/mach-l7200/include/mach/memory.h
arch/arm/mach-lh7a40x/include/mach/memory.h
arch/arm/mach-loki/include/mach/memory.h
arch/arm/mach-msm/include/mach/memory.h
arch/arm/mach-mv78xx0/include/mach/memory.h
arch/arm/mach-netx/include/mach/memory.h
arch/arm/mach-ns9xxx/include/mach/memory.h
arch/arm/mach-orion5x/include/mach/memory.h
arch/arm/mach-pnx4008/include/mach/memory.h
arch/arm/mach-pxa/include/mach/memory.h
arch/arm/mach-realview/include/mach/memory.h
arch/arm/mach-rpc/include/mach/memory.h
arch/arm/mach-s3c2400/include/mach/memory.h
arch/arm/mach-s3c2410/include/mach/memory.h
arch/arm/mach-sa1100/include/mach/memory.h
arch/arm/mach-shark/include/mach/memory.h
arch/arm/mach-versatile/include/mach/memory.h
arch/arm/plat-mxc/include/mach/memory.h
arch/arm/plat-omap/include/mach/memory.h

index 7238b3b..0202a7c 100644 (file)
@@ -178,6 +178,11 @@ static inline void *phys_to_virt(unsigned long x)
  * memory.  Use of these is *deprecated* (and that doesn't mean
  * use the __ prefixed forms instead.)  See dma-mapping.h.
  */
+#ifndef __virt_to_bus
+#define __virt_to_bus  __virt_to_phys
+#define __bus_to_virt  __phys_to_virt
+#endif
+
 static inline __deprecated unsigned long virt_to_bus(void *x)
 {
        return __virt_to_bus((unsigned long)x);
index 56ae900..c008225 100644 (file)
@@ -14,9 +14,6 @@
 
 #define PHYS_OFFSET    UL(0xf0000000)
 
-#define __virt_to_bus(x)       __virt_to_phys(x)
-#define __bus_to_virt(x)       __phys_to_virt(x)
-
 /*
  * The nodes are the followings:
  *
index 9dd1b8c..14f4ef4 100644 (file)
 
 #define PHYS_OFFSET    (AT91_SDRAM_BASE)
 
-
-/*
- * Virtual view <-> DMA view memory address translations
- * virt_to_bus: Used to translate the virtual address to an
- *              address suitable to be passed to set_dma_addr
- * bus_to_virt: Used to convert an address for DMA operations
- *              to an address that the kernel can use.
- */
-#define __virt_to_bus(x) __virt_to_phys(x)
-#define __bus_to_virt(x) __phys_to_virt(x)
-
 #endif
index 98ec30c..e522b20 100644 (file)
  */
 #define PHYS_OFFSET    UL(0xc0000000)
 
-/*
- * Virtual view <-> DMA view memory address translations
- * virt_to_bus: Used to translate the virtual address to an
- *              address suitable to be passed to set_dma_addr
- * bus_to_virt: Used to convert an address for DMA operations
- *              to an address that the kernel can use.
- */
-
-#if defined(CONFIG_ARCH_CDB89712)
-
-#define __virt_to_bus(x)       (x)
-#define __bus_to_virt(x)       (x)
-
-#elif defined (CONFIG_ARCH_AUTCPU12)
-
-#define __virt_to_bus(x)       (x)
-#define __bus_to_virt(x)       (x)
-
-#else
+#if !defined(CONFIG_ARCH_CDB89712) && !defined (CONFIG_ARCH_AUTCPU12)
 
 #define __virt_to_bus(x)       ((x) - PAGE_OFFSET)
 #define __bus_to_virt(x)       ((x) + PAGE_OFFSET)
index 87b32db..05ea76b 100644 (file)
 #define PHYS_OFFSET    UL(0x10000000)
 
 /*
- * These are exactly the same on the RiscPC as the
- * physical memory view.
- */
-#define __virt_to_bus(x) __virt_to_phys(x)
-#define __bus_to_virt(x) __phys_to_virt(x)
-
-/*
  * Cache flushing area - ROM
  */
 #define FLUSH_BASE_PHYS                0x00000000
index dd1625c..3a33533 100644 (file)
@@ -55,10 +55,4 @@ __arch_adjust_zones(int node, unsigned long *size, unsigned long *holes)
 
 #endif
 
-/*
- * Bus address is physical address
- */
-#define __virt_to_bus(x)       __virt_to_phys(x)
-#define __bus_to_virt(x)       __phys_to_virt(x)
-
 #endif /* __ASM_ARCH_MEMORY_H */
index eea4b75..0ca66d0 100644 (file)
 #define PHYS_OFFSET    UL(0x00000000)
 
 /*
- * We keep this 1:1 so that we don't interfere
- * with the PCMCIA memory regions
- */
-#define __virt_to_bus(x)       (x)
-#define __bus_to_virt(x)       (x)
-
-/*
  * Cache flushing area - SRAM
  */
 #define FLUSH_BASE_PHYS                0x40000000
index f1b6335..5c80c3c 100644 (file)
@@ -7,8 +7,4 @@
 
 #define PHYS_OFFSET            UL(0x00000000)
 
-#define __bus_to_virt(x)       __phys_to_virt(x)
-#define __virt_to_bus(x)       __virt_to_phys(x)
-
-
 #endif
index 6ae2f1a..cb16e59 100644 (file)
 extern unsigned long __virt_to_bus(unsigned long);
 extern unsigned long __bus_to_virt(unsigned long);
 #endif
+#define __virt_to_bus  __virt_to_bus
+#define __bus_to_virt  __bus_to_virt
 
 #elif defined(CONFIG_FOOTBRIDGE_HOST)
 
+/*
+ * The footbridge is programmed to expose the system RAM at the corresponding
+ * address.  So, if PAGE_OFFSET is 0xc0000000, RAM appears at 0xe0000000.
+ * If 0x80000000, then its exposed at 0xa0000000 on the bus. etc.
+ * The only requirement is that the RAM isn't placed at bus address 0 which
+ * would clash with VGA cards.
+ */
 #define __virt_to_bus(x)       ((x) - 0xe0000000)
 #define __bus_to_virt(x)       ((x) + 0xe0000000)
 
index cb26f49..83a2fa0 100644 (file)
@@ -7,23 +7,6 @@
 #ifndef __ASM_ARCH_MEMORY_H
 #define __ASM_ARCH_MEMORY_H
 
-/*
- * Page offset:
- *    ( 0xc0000000UL )
- */
 #define PHYS_OFFSET    UL(0x40000000)
 
-/*
- * Virtual view <-> DMA view memory address translations
- * virt_to_bus: Used to translate the virtual address to an
- *              address suitable to be passed to set_dma_addr
- * bus_to_virt: Used to convert an address for DMA operations
- *              to an address that the kernel can use.
- *
- * There is something to do here later !, Mar 2000, Jungjun Kim
- */
-
-#define __virt_to_bus(x)       __virt_to_phys(x)
-#define __bus_to_virt(x)       __phys_to_virt(x)
-
 #endif
index 5c45306..a93df7c 100644 (file)
 
 #define PHYS_OFFSET    UL(0x08000000)
 
-/*
- * Virtual view <-> DMA view memory address translations
- * virt_to_bus: Used to translate the virtual address to an
- *              address suitable to be passed to set_dma_addr
- * bus_to_virt: Used to convert an address for DMA operations
- *              to an address that the kernel can use.
- */
-#define __virt_to_bus(x)       (x - PAGE_OFFSET + PHYS_OFFSET)
-#define __bus_to_virt(x)       (x - PHYS_OFFSET + PAGE_OFFSET)
-
 #endif
index be7e63c..30d41d0 100644 (file)
  * Physical DRAM offset.
  */
 #define PHYS_OFFSET    UL(0x00000000)
-#define BUS_OFFSET     UL(0x80000000)
 
-/*
- * Virtual view <-> DMA view memory address translations
- * virt_to_bus: Used to translate the virtual address to an
- *              address suitable to be passed to set_dma_addr
- * bus_to_virt: Used to convert an address for DMA operations
- *              to an address that the kernel can use.
- */
+#define BUS_OFFSET     UL(0x80000000)
 #define __virt_to_bus(x)       (x - PAGE_OFFSET + BUS_OFFSET)
 #define __bus_to_virt(x)       (x - BUS_OFFSET + PAGE_OFFSET)
 
index b82602d..e012bf1 100644 (file)
 #define IOP13XX_PMMR_P_START (IOP13XX_PMMR_PHYS_MEM_BASE)
 #define IOP13XX_PMMR_P_END   (IOP13XX_PMMR_PHYS_MEM_BASE + IOP13XX_PMMR_SIZE)
 
-/*
- * Virtual view <-> PCI DMA view memory address translations
- * virt_to_bus: Used to translate the virtual address to an
- *             address suitable to be passed to set_dma_addr
- * bus_to_virt: Used to convert an address for DMA operations
- *             to an address that the kernel can use.
- */
-
-/* RAM has 1:1 mapping on the PCIe/x Busses */
-#define __virt_to_bus(x)       (__virt_to_phys(x))
-#define __bus_to_virt(x)       (__phys_to_virt(x))
-
 static inline dma_addr_t __virt_to_lbus(unsigned long x)
 {
        return x + IOP13XX_PMMR_PHYS_MEM_BASE - IOP13XX_PMMR_VIRT_MEM_BASE;
@@ -55,7 +43,7 @@ static inline unsigned long __lbus_to_virt(dma_addr_t x)
                if (is_lbus_device(dev) && __is_lbus_dma(__dma))        \
                        __virt = __lbus_to_virt(__dma);                 \
                else                                                    \
-                       __virt = __bus_to_virt(__dma);                  \
+                       __virt = __phys_to_virt(__dma);                 \
                (void *)__virt;                                         \
        })
 
@@ -66,7 +54,7 @@ static inline unsigned long __lbus_to_virt(dma_addr_t x)
                if (is_lbus_device(dev) && __is_lbus_virt(__virt))      \
                        __dma = __virt_to_lbus(__virt);                 \
                else                                                    \
-                       __dma = __virt_to_bus(__virt);                  \
+                       __dma = __virt_to_phys(__virt);                 \
                __dma;                                                  \
        })
 
index 42cd4bf..61c7bdb 100644 (file)
  */
 #define PHYS_OFFSET    UL(0xa0000000)
 
-/*
- * Virtual view <-> PCI DMA view memory address translations
- * virt_to_bus: Used to translate the virtual address to an
- *             address suitable to be passed to set_dma_addr
- * bus_to_virt: Used to convert an address for DMA operations
- *             to an address that the kernel can use.
- */
-#define __virt_to_bus(x)       (__virt_to_phys(x))
-#define __bus_to_virt(x)       (__phys_to_virt(x))
-
-
 #endif
index 2cef0bb..c46c6ba 100644 (file)
  */
 #define PHYS_OFFSET    UL(0x00000000)
 
-/*
- * Virtual view <-> PCI DMA view memory address translations
- * virt_to_bus: Used to translate the virtual address to an
- *             address suitable to be passed to set_dma_addr
- * bus_to_virt: Used to convert an address for DMA operations
- *             to an address that the kernel can use.
- */
-#define __virt_to_bus(x)       (__virt_to_phys(x))
-#define __bus_to_virt(x)       (__phys_to_virt(x))
-
-
 #endif
index 241529a..aee7eb8 100644 (file)
 
 #define PHYS_OFFSET    UL(0x00000000)
 
-/*
- * Virtual view <-> DMA view memory address translations
- * virt_to_bus: Used to translate the virtual address to an
- *             address suitable to be passed to set_dma_addr
- * bus_to_virt: Used to convert an address for DMA operations
- *             to an address that the kernel can use.
- */
 #include <mach/ixp2000-regs.h>
 
 #define __virt_to_bus(v) \
index 9d40115..fdd1387 100644 (file)
  */
 #define PHYS_OFFSET            (0x00000000)
 
-
-/*
- * Virtual view <-> DMA view memory address translations
- * virt_to_bus: Used to translate the virtual address to an
- *             address suitable to be passed to set_dma_addr
- * bus_to_virt: Used to convert an address for DMA operations
- *             to an address that the kernel can use.
- */
-#ifndef __ASSEMBLY__
-
 #define __virt_to_bus(v)                                               \
        ({ unsigned int ret;                                            \
        ret = ((__virt_to_phys(v) - 0x00000000) +                       \
@@ -43,6 +33,3 @@
 #define arch_is_coherent()     1
 
 #endif
-
-
-#endif
index c4d2830..2e481db 100644 (file)
@@ -25,16 +25,4 @@ void ixp4xx_adjust_zones(int node, unsigned long *size, unsigned long *holes);
 
 #endif
 
-/*
- * Virtual view <-> DMA view memory address translations
- * virt_to_bus: Used to translate the virtual address to an
- *             address suitable to be passed to set_dma_addr
- * bus_to_virt: Used to convert an address for DMA operations
- *             to an address that the kernel can use.
- *
- * These are dummies for now.
- */
-#define __virt_to_bus(x)        __virt_to_phys(x)
-#define __bus_to_virt(x)        __phys_to_virt(x)
-
 #endif
index b5fb34b..45431e1 100644 (file)
@@ -7,8 +7,4 @@
 
 #define PHYS_OFFSET            UL(0x00000000)
 
-#define __virt_to_bus(x)       __virt_to_phys(x)
-#define __bus_to_virt(x)       __phys_to_virt(x)
-
-
 #endif
index 8fbc4c7..6d5887c 100644 (file)
@@ -37,11 +37,6 @@ extern struct bus_type platform_bus_type;
                                        (dma_addr_t)__virt_to_phys(x) : (dma_addr_t)__virt_to_bus(x); })
 #define __arch_page_to_dma(dev, x)     __arch_virt_to_dma(dev, page_address(x))
 
-#else
-
-#define __virt_to_bus(x)       __virt_to_phys(x)
-#define __bus_to_virt(x)       __phys_to_virt(x)
-
 #endif
 
 #endif
index f338cf3..9fb40ed 100644 (file)
@@ -17,9 +17,6 @@
  */
 #define PHYS_OFFSET     UL(0xf0000000)
 
-#define __virt_to_bus(x) __virt_to_phys(x)
-#define __bus_to_virt(x) __phys_to_virt(x)
-
 /*
  * Cache flushing area - ROM
  */
index 1da14ff..189d20e 100644 (file)
  */
 #define PHYS_OFFSET    UL(0xc0000000)
 
-/*
- * Virtual view <-> DMA view memory address translations
- * virt_to_bus: Used to translate the virtual address to an
- *             address suitable to be passed to set_dma_addr
- * bus_to_virt: Used to convert an address for DMA operations
- *             to an address that the kernel can use.
- */
-#define __virt_to_bus(x)        __virt_to_phys(x)
-#define __bus_to_virt(x)        __phys_to_virt(x)
-
 #ifdef CONFIG_DISCONTIGMEM
 
 /*
index a39533a..2ed7e6e 100644 (file)
@@ -7,8 +7,4 @@
 
 #define PHYS_OFFSET            UL(0x00000000)
 
-#define __virt_to_bus(x)       __virt_to_phys(x)
-#define __bus_to_virt(x)       __phys_to_virt(x)
-
-
 #endif
index 63fd47f..f4698ba 100644 (file)
@@ -19,9 +19,5 @@
 /* physical offset of RAM */
 #define PHYS_OFFSET            UL(0x10000000)
 
-/* bus address and physical addresses are identical */
-#define __virt_to_bus(x)       __virt_to_phys(x)
-#define __bus_to_virt(x)       __phys_to_virt(x)
-
 #endif
 
index 9e47a14..e663042 100644 (file)
@@ -7,8 +7,4 @@
 
 #define PHYS_OFFSET            UL(0x00000000)
 
-#define __virt_to_bus(x)       __virt_to_phys(x)
-#define __bus_to_virt(x)       __phys_to_virt(x)
-
-
 #endif
index 53745a1..9a363f2 100644 (file)
 
 #define PHYS_OFFSET UL(0x80000000)
 
-/*
- * Virtual view <-> DMA view memory address translations
- * virt_to_bus: Used to translate the virtual address to an
- *              address suitable to be passed to set_dma_addr
- * bus_to_virt: Used to convert an address for DMA operations
- *              to an address that the kernel can use.
- */
-#define __virt_to_bus(x)         __virt_to_phys(x)
-#define __bus_to_virt(x)         __phys_to_virt(x)
-
 #endif
 
index 649ee62..6107193 100644 (file)
@@ -21,7 +21,4 @@
 
 #define PHYS_OFFSET    UL(0x00000000)
 
-#define __virt_to_bus(x) __virt_to_phys(x)
-#define __bus_to_virt(x) __phys_to_virt(x)
-
 #endif
index 54dd76b..52a2955 100644 (file)
@@ -9,8 +9,4 @@
 
 #define PHYS_OFFSET    UL(0x00000000)
 
-#define __virt_to_bus(x)       __virt_to_phys(x)
-#define __bus_to_virt(x)       __phys_to_virt(x)
-
-
 #endif
index 5789a2d..b38d50c 100644 (file)
@@ -18,7 +18,4 @@
  */
 #define PHYS_OFFSET     (0x80000000)
 
-#define __virt_to_bus(x) ((x) - PAGE_OFFSET + PHYS_OFFSET)
-#define __bus_to_virt(x) ((x) + PAGE_OFFSET - PHYS_OFFSET)
-
 #endif
index 59aef89..eac491c 100644 (file)
 #define PHYS_OFFSET    UL(0xa0000000)
 
 /*
- * Virtual view <-> DMA view memory address translations
- * virt_to_bus: Used to translate the virtual address to an
- *             address suitable to be passed to set_dma_addr
- * bus_to_virt: Used to convert an address for DMA operations
- *             to an address that the kernel can use.
- */
-#define __virt_to_bus(x)        __virt_to_phys(x)
-#define __bus_to_virt(x)        __phys_to_virt(x)
-
-/*
  * The nodes are matched with the physical SDRAM banks as follows:
  *
  *     node 0:  0xa0000000-0xa3ffffff  -->  0xc0000000-0xc3ffffff
index 0e67348..65a0742 100644 (file)
  */
 #define PHYS_OFFSET            UL(0x00000000)
 
-/*
- * Virtual view <-> DMA view memory address translations
- * virt_to_bus: Used to translate the virtual address to an
- *              address suitable to be passed to set_dma_addr
- * bus_to_virt: Used to convert an address for DMA operations
- *              to an address that the kernel can use.
- */
-#define __virt_to_bus(x)       ((x) - PAGE_OFFSET)
-#define __bus_to_virt(x)       ((x) + PAGE_OFFSET)
-
 #endif
index 9bf7e43..78191bf 100644 (file)
 #define PHYS_OFFSET    UL(0x10000000)
 
 /*
- * These are exactly the same on the RiscPC as the
- * physical memory view.
- */
-#define __virt_to_bus(x) __virt_to_phys(x)
-#define __bus_to_virt(x) __phys_to_virt(x)
-
-/*
  * Cache flushing area - ROM
  */
 #define FLUSH_BASE_PHYS                0x00000000
index 8f4878e..cf5901f 100644 (file)
@@ -17,7 +17,4 @@
 
 #define PHYS_OFFSET    UL(0x0C000000)
 
-#define __virt_to_bus(x) __virt_to_phys(x)
-#define __bus_to_virt(x) __phys_to_virt(x)
-
 #endif
index 9378262..6f1e587 100644 (file)
@@ -13,7 +13,4 @@
 
 #define PHYS_OFFSET    UL(0x30000000)
 
-#define __virt_to_bus(x) __virt_to_phys(x)
-#define __bus_to_virt(x) __phys_to_virt(x)
-
 #endif
index 1c127b6..6984034 100644 (file)
@@ -28,18 +28,6 @@ void sa1111_adjust_zones(int node, unsigned long *size, unsigned long *holes);
 #endif
 
 /*
- * Virtual view <-> DMA view memory address translations
- * virt_to_bus: Used to translate the virtual address to an
- *             address suitable to be passed to set_dma_addr
- * bus_to_virt: Used to convert an address for DMA operations
- *             to an address that the kernel can use.
- *
- * On the SA1100, bus addresses are equivalent to physical addresses.
- */
-#define __virt_to_bus(x)        __virt_to_phys(x)
-#define __bus_to_virt(x)        __phys_to_virt(x)
-
-/*
  * Because of the wide memory address space between physical RAM banks on the
  * SA1100, it's much convenient to use Linux's SparseMEM support to implement
  * our memory map representation.  Assuming all memory nodes have equal access
index b7874ad..d00c05e 100644 (file)
@@ -36,9 +36,6 @@ static inline void __arch_adjust_zones(int node, unsigned long *zone_size, unsig
 
 #endif
 
-#define __virt_to_bus(x)       __virt_to_phys(x)
-#define __bus_to_virt(x)       __phys_to_virt(x)
-
 /*
  * Cache flushing area
  */
index b6315c0..79aeab8 100644 (file)
  */
 #define PHYS_OFFSET    UL(0x00000000)
 
-/*
- * Virtual view <-> DMA view memory address translations
- * virt_to_bus: Used to translate the virtual address to an
- *              address suitable to be passed to set_dma_addr
- * bus_to_virt: Used to convert an address for DMA operations
- *              to an address that the kernel can use.
- */
-#define __virt_to_bus(x)       ((x) - PAGE_OFFSET)
-#define __bus_to_virt(x)       ((x) + PAGE_OFFSET)
-
 #endif
index d7a8d3e..203688e 100644 (file)
 
 #include <mach/hardware.h>
 
-/*
- * Virtual view <-> DMA view memory address translations
- * This macro is used to translate the virtual address to an address
- * suitable to be passed to set_dma_addr()
- */
-#define __virt_to_bus(a)       __virt_to_phys(a)
-
-/*
- * Used to convert an address for DMA operations to an address that the
- * kernel can use.
- */
-#define __bus_to_virt(a)       __phys_to_virt(a)
-
 #endif /* __ASM_ARCH_MXC_MEMORY_H__ */
index d40cac6..211c9f6 100644 (file)
 #endif
 
 /*
- * Conversion between SDRAM and fake PCI bus, used by USB
- * NOTE: Physical address must be converted to Local Bus address
- *      on OMAP-1510 only
- */
-
-/*
  * Bus address is physical address, except for OMAP-1510 Local Bus.
- */
-#define __virt_to_bus(x)       __virt_to_phys(x)
-#define __bus_to_virt(x)       __phys_to_virt(x)
-
-/*
  * OMAP-1510 bus address is translated into a Local Bus address if the
  * OMAP bus type is lbus. We do the address translation based on the
  * device overriding the defaults used in the dma-mapping API.
 
 #define __arch_page_to_dma(dev, page)  ({is_lbus_device(dev) ? \
                                        (dma_addr_t)virt_to_lbus(page_address(page)) : \
-                                       (dma_addr_t)__virt_to_bus(page_address(page));})
+                                       (dma_addr_t)__virt_to_phys(page_address(page));})
 
 #define __arch_dma_to_virt(dev, addr)  ({ (void *) (is_lbus_device(dev) ? \
                                                lbus_to_virt(addr) : \
-                                               __bus_to_virt(addr)); })
+                                               __phys_to_virt(addr)); })
 
 #define __arch_virt_to_dma(dev, addr)  ({ unsigned long __addr = (unsigned long)(addr); \
                                           (dma_addr_t) (is_lbus_device(dev) ? \
                                                virt_to_lbus(__addr) : \
-                                               __virt_to_bus(__addr)); })
+                                               __virt_to_phys(__addr)); })
 
 #endif /* CONFIG_ARCH_OMAP15XX */