MIPS: PCI: make phys_to_dma/dma_to_phys for pci-xtalk-bridge common

All platforms using pci-xtalk-bridge can share common phys_to_dma/
dma_to_phys function. So we move it form ip27 specific file to
pci-xtalk-bridge.c

Signed-off-by: Thomas Bogendoerfer <[email protected]>
Signed-off-by: Paul Burton <[email protected]>
Cc: Ralf Baechle <[email protected]>
Cc: Paul Burton <[email protected]>
Cc: James Hogan <[email protected]>
Cc: [email protected]
Cc: [email protected]
This commit is contained in:
Thomas Bogendoerfer authored and Paul Burton committed 2019-11-01 14:58:49 -07:00
1 parent 02fce139fd
commit b9e9defb5e
2 files changed
+16 -13

No files matched your search

-13
View File
@@ -9,19 +9,6 @@
*/
#include <asm/pci/bridge.h>
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);
}
#ifdef CONFIG_NUMA
int pcibus_to_node(struct pci_bus *bus)
{
+16
View File
@@ -22,6 +22,22 @@
#define CRC16_INIT 0
#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