diff options
Diffstat (limited to 'arch/mips/pci/pci-xtalk-bridge.c')
-rw-r--r-- | arch/mips/pci/pci-xtalk-bridge.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/arch/mips/pci/pci-xtalk-bridge.c b/arch/mips/pci/pci-xtalk-bridge.c index 312632171832..72e60df505f4 100644 --- a/arch/mips/pci/pci-xtalk-bridge.c +++ b/arch/mips/pci/pci-xtalk-bridge.c @@ -23,6 +23,22 @@ #define CRC16_VALID 0xb001 /* + * Common phys<->dma mapping for platforms using pci xtalk bridge + */ +dma_addr_t __phys_to_dma(struct device *dev, phys_addr_t paddr) +{ + struct pci_dev *pdev = to_pci_dev(dev); + struct bridge_controller *bc = BRIDGE_CONTROLLER(pdev->bus); + + return bc->baddr + paddr; +} + +phys_addr_t __dma_to_phys(struct device *dev, dma_addr_t dma_addr) +{ + return dma_addr & ~(0xffUL << 56); +} + +/* * Most of the IOC3 PCI config register aren't present * we emulate what is needed for a normal PCI enumeration */ |