diff mbox series

[v2,1/2] MIPS: PCI: make phys_to_dma/dma_to_phys for pci-xtalk-bridge common

Message ID 20191024101829.12543-1-tbogendoerfer@suse.de (mailing list archive)
State Accepted
Delegated to: Paul Burton
Headers show
Series [v2,1/2] MIPS: PCI: make phys_to_dma/dma_to_phys for pci-xtalk-bridge common | expand

Commit Message

Thomas Bogendoerfer Oct. 24, 2019, 10:18 a.m. UTC
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 <tbogendoerfer@suse.de>
---
 arch/mips/pci/pci-ip27.c         | 13 -------------
 arch/mips/pci/pci-xtalk-bridge.c | 16 ++++++++++++++++
 2 files changed, 16 insertions(+), 13 deletions(-)

Comments

Paul Burton Nov. 1, 2019, 11:27 p.m. UTC | #1
Hello,

Thomas Bogendoerfer wrote:
> 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

Series applied to mips-next.

> MIPS: PCI: make phys_to_dma/dma_to_phys for pci-xtalk-bridge common
>   commit b9e9defb5e60
>   https://git.kernel.org/mips/c/b9e9defb5e60
>   
>   Signed-off-by: Thomas Bogendoerfer <tbogendoerfer@suse.de>
>   Signed-off-by: Paul Burton <paulburton@kernel.org>
> 
> MIPS: add support for SGI Octane (IP30)
>   commit 7505576d1c1a
>   https://git.kernel.org/mips/c/7505576d1c1a
>   
>   Signed-off-by: Thomas Bogendoerfer <tbogendoerfer@suse.de>
>   Signed-off-by: Paul Burton <paulburton@kernel.org>

Thanks,
    Paul

[ This message was auto-generated; if you believe anything is incorrect
  then please email paulburton@kernel.org to report it. ]
diff mbox series

Patch

diff --git a/arch/mips/pci/pci-ip27.c b/arch/mips/pci/pci-ip27.c
index 0d2eb86e8a1e..8e26b120f994 100644
--- a/arch/mips/pci/pci-ip27.c
+++ b/arch/mips/pci/pci-ip27.c
@@ -14,19 +14,6 @@ 
 #include <asm/sn/ioc3.h>
 #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)
 {
diff --git a/arch/mips/pci/pci-xtalk-bridge.c b/arch/mips/pci/pci-xtalk-bridge.c
index 0dd5edb76cbb..b475cf5aef2f 100644
--- a/arch/mips/pci/pci-xtalk-bridge.c
+++ b/arch/mips/pci/pci-xtalk-bridge.c
@@ -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