aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2019-02-13 02:01:19 -0500
committerMichael Ellerman <mpe@ellerman.id.au>2019-02-18 06:41:03 -0500
commit391133fd5adaba319795cd96882d1ea405c41cf6 (patch)
tree6ae53a126e71ecf6491f3a8b82960db47e38e9fe
parent7c1013b48778e203d4b17ea49ef0e450dd921664 (diff)
powerpc/dma: move pci_dma_dev_setup_swiotlb to fsl_pci.c
pci_dma_dev_setup_swiotlb is only used by the fsl_pci code, and closely related to it, so fsl_pci.c seems like a better place for it. Signed-off-by: Christoph Hellwig <hch@lst.de> Tested-by: Christian Zigotzky <chzigotzky@xenosoft.de> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
-rw-r--r--arch/powerpc/include/asm/swiotlb.h2
-rw-r--r--arch/powerpc/kernel/dma-swiotlb.c11
-rw-r--r--arch/powerpc/sysdev/fsl_pci.c9
3 files changed, 9 insertions, 13 deletions
diff --git a/arch/powerpc/include/asm/swiotlb.h b/arch/powerpc/include/asm/swiotlb.h
index f65ecf57b66c..26a0f12b835b 100644
--- a/arch/powerpc/include/asm/swiotlb.h
+++ b/arch/powerpc/include/asm/swiotlb.h
@@ -18,8 +18,6 @@ extern const struct dma_map_ops powerpc_swiotlb_dma_ops;
18extern unsigned int ppc_swiotlb_enable; 18extern unsigned int ppc_swiotlb_enable;
19int __init swiotlb_setup_bus_notifier(void); 19int __init swiotlb_setup_bus_notifier(void);
20 20
21extern void pci_dma_dev_setup_swiotlb(struct pci_dev *pdev);
22
23#ifdef CONFIG_SWIOTLB 21#ifdef CONFIG_SWIOTLB
24void swiotlb_detect_4g(void); 22void swiotlb_detect_4g(void);
25#else 23#else
diff --git a/arch/powerpc/kernel/dma-swiotlb.c b/arch/powerpc/kernel/dma-swiotlb.c
index 7d5fc9751622..42badc4bf536 100644
--- a/arch/powerpc/kernel/dma-swiotlb.c
+++ b/arch/powerpc/kernel/dma-swiotlb.c
@@ -62,17 +62,6 @@ const struct dma_map_ops powerpc_swiotlb_dma_ops = {
62 .get_required_mask = swiotlb_powerpc_get_required, 62 .get_required_mask = swiotlb_powerpc_get_required,
63}; 63};
64 64
65void pci_dma_dev_setup_swiotlb(struct pci_dev *pdev)
66{
67 struct pci_controller *hose;
68 struct dev_archdata *sd;
69
70 hose = pci_bus_to_host(pdev->bus);
71 sd = &pdev->dev.archdata;
72 sd->max_direct_dma_addr =
73 hose->dma_window_base_cur + hose->dma_window_size;
74}
75
76static int ppc_swiotlb_bus_notify(struct notifier_block *nb, 65static int ppc_swiotlb_bus_notify(struct notifier_block *nb,
77 unsigned long action, void *data) 66 unsigned long action, void *data)
78{ 67{
diff --git a/arch/powerpc/sysdev/fsl_pci.c b/arch/powerpc/sysdev/fsl_pci.c
index 918be816b097..561f97d698cc 100644
--- a/arch/powerpc/sysdev/fsl_pci.c
+++ b/arch/powerpc/sysdev/fsl_pci.c
@@ -114,6 +114,15 @@ static struct pci_ops fsl_indirect_pcie_ops =
114static u64 pci64_dma_offset; 114static u64 pci64_dma_offset;
115 115
116#ifdef CONFIG_SWIOTLB 116#ifdef CONFIG_SWIOTLB
117static void pci_dma_dev_setup_swiotlb(struct pci_dev *pdev)
118{
119 struct pci_controller *hose = pci_bus_to_host(pdev->bus);
120 struct dev_archdata *sd = &pdev->dev.archdata;
121
122 sd->max_direct_dma_addr =
123 hose->dma_window_base_cur + hose->dma_window_size;
124}
125
117static void setup_swiotlb_ops(struct pci_controller *hose) 126static void setup_swiotlb_ops(struct pci_controller *hose)
118{ 127{
119 if (ppc_swiotlb_enable) { 128 if (ppc_swiotlb_enable) {