Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b5ee9002 authored by Nicolas Pitre's avatar Nicolas Pitre Committed by Russell King
Browse files

[ARM] remove a common set of __virt_to_bus definitions



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: default avatarNicolas Pitre <nico@marvell.com>
Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent 75f4aa15
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -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);
+0 −3
Original line number Diff line number Diff line
@@ -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:
 *
+0 −11
Original line number Diff line number Diff line
@@ -25,15 +25,4 @@

#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
+1 −19
Original line number Diff line number Diff line
@@ -26,25 +26,7 @@
 */
#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)
+0 −7
Original line number Diff line number Diff line
@@ -19,13 +19,6 @@
 */
#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
 */
Loading