Commit be7f3f90 authored by Arnd Bergmann's avatar Arnd Bergmann
Browse files

ARM: footbridge: remove custom DMA address handling



Footbridge is the last Arm platform that has its own
__virt_to_bus()/__bus_to_virt()/phys_to_dma()/dma_to_phys() abstraction,
but this is just a simple offset now.

For PCI devices, the offset that is programmed into the PCI bridge must
also be set in each device using dma_direct_set_offset().  As Arm does
not have a pcibios_bus_add_device() helper yet, just use a bus notifier
for this.

For the ISA DMA, drivers now pass a non-translated physical address into
set_dma_addr(), so they have to be converted back with the corresponding
isa_bus_to_virt() function and then into the correct bus address with
the offset using the isa_dma_dev.

Tested-by: default avatarMarc Zyngier <maz@kernel.org>
Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
parent e7536617
Loading
Loading
Loading
Loading

arch/arm/include/asm/dma-direct.h

deleted100644 → 0
+0 −1
Original line number Diff line number Diff line
#include <mach/dma-direct.h>
+1 −1
Original line number Diff line number Diff line
@@ -106,7 +106,7 @@ extern void set_dma_sg(unsigned int chan, struct scatterlist *sg, int nr_sg);
 */
extern void __set_dma_addr(unsigned int chan, void *addr);
#define set_dma_addr(chan, addr)				\
	__set_dma_addr(chan, (void *)__bus_to_virt(addr))
	__set_dma_addr(chan, (void *)isa_bus_to_virt(addr))

/* Set the DMA byte count for this channel
 *
+7 −0
Original line number Diff line number Diff line
@@ -22,6 +22,13 @@
#define DC21285_IO(x)		(x)
#endif

/*
 * The footbridge is programmed to expose the system RAM at 0xe0000000.
 * The requirement is that the RAM isn't placed at bus address 0, which
 * would clash with VGA cards.
 */
#define BUS_OFFSET 0xe0000000

#define CSR_PCICMD		DC21285_IO(0x0004)
#define CSR_CLASSREV		DC21285_IO(0x0008)
#define CSR_PCICACHELINESIZE	DC21285_IO(0x000c)
+0 −11
Original line number Diff line number Diff line
@@ -369,17 +369,6 @@ static inline unsigned long __virt_to_idmap(unsigned long x)

#define virt_to_idmap(x)	__virt_to_idmap((unsigned long)(x))

/*
 * Virtual <-> DMA view memory address translations
 * Again, these are *only* valid on the kernel direct mapped RAM
 * 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

/*
 * Conversion between a struct page and a physical address.
 *
+0 −1
Original line number Diff line number Diff line
@@ -46,7 +46,6 @@ endmenu
# Footbridge support
config FOOTBRIDGE
	def_bool y
	select ARCH_HAS_PHYS_TO_DMA
	select ARCH_MIGHT_HAVE_PC_SERIO
	select ISA_DMA_API

Loading