Skip to content

Commit 54aed4d

Browse files
Christoph Hellwigpaulburton
authored andcommitted
MIPS: IP27: use dma_direct_ops
IP27 is coherent and has a reasonably direct mapping, just with a little per-bus offset added into the dma address. Signed-off-by: Christoph Hellwig <hch@lst.de> Patchwork: https://patchwork.linux-mips.org/patch/19542/ Signed-off-by: Paul Burton <paul.burton@mips.com> Cc: Florian Fainelli <f.fainelli@gmail.com> Cc: David Daney <david.daney@cavium.com> Cc: Kevin Cernekee <cernekee@gmail.com> Cc: Jiaxun Yang <jiaxun.yang@flygoat.com> Cc: Tom Bogendoerfer <tsbogend@alpha.franken.de> Cc: Huacai Chen <chenhc@lemote.com> Cc: iommu@lists.linux-foundation.org Cc: linux-mips@linux-mips.org
1 parent dffbfde commit 54aed4d

File tree

3 files changed

+15
-71
lines changed

3 files changed

+15
-71
lines changed

arch/mips/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -683,11 +683,11 @@ config SGI_IP22
683683

684684
config SGI_IP27
685685
bool "SGI IP27 (Origin200/2000)"
686+
select ARCH_HAS_PHYS_TO_DMA
686687
select FW_ARC
687688
select FW_ARC64
688689
select BOOT_ELF64
689690
select DEFAULT_SGI_PARTITION
690-
select MIPS_DMA_DEFAULT
691691
select SYS_HAS_EARLY_PRINTK
692692
select HW_HAS_PCI
693693
select NR_CPUS_DEFAULT_64

arch/mips/include/asm/mach-ip27/dma-coherence.h

Lines changed: 0 additions & 70 deletions
This file was deleted.

arch/mips/pci/pci-ip27.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include <linux/export.h>
1212
#include <linux/pci.h>
1313
#include <linux/smp.h>
14+
#include <linux/dma-direct.h>
1415
#include <asm/sn/arch.h>
1516
#include <asm/pci/bridge.h>
1617
#include <asm/paccess.h>
@@ -182,6 +183,19 @@ int pcibios_plat_dev_init(struct pci_dev *dev)
182183
return 0;
183184
}
184185

186+
dma_addr_t __phys_to_dma(struct device *dev, phys_addr_t paddr)
187+
{
188+
struct pci_dev *pdev = to_pci_dev(dev);
189+
struct bridge_controller *bc = BRIDGE_CONTROLLER(pdev->bus);
190+
191+
return bc->baddr + paddr;
192+
}
193+
194+
phys_addr_t __dma_to_phys(struct device *dev, dma_addr_t dma_addr)
195+
{
196+
return dma_addr & ~(0xffUL << 56);
197+
}
198+
185199
/*
186200
* Device might live on a subordinate PCI bus. XXX Walk up the chain of buses
187201
* to find the slot number in sense of the bridge device register.

0 commit comments

Comments
 (0)