Commit 391133fd authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Michael Ellerman

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: default avatarChristoph Hellwig <hch@lst.de>
Tested-by: default avatarChristian Zigotzky <chzigotzky@xenosoft.de>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
parent 7c1013b4
...@@ -18,8 +18,6 @@ extern const struct dma_map_ops powerpc_swiotlb_dma_ops; ...@@ -18,8 +18,6 @@ extern const struct dma_map_ops powerpc_swiotlb_dma_ops;
extern unsigned int ppc_swiotlb_enable; extern unsigned int ppc_swiotlb_enable;
int __init swiotlb_setup_bus_notifier(void); int __init swiotlb_setup_bus_notifier(void);
extern void pci_dma_dev_setup_swiotlb(struct pci_dev *pdev);
#ifdef CONFIG_SWIOTLB #ifdef CONFIG_SWIOTLB
void swiotlb_detect_4g(void); void swiotlb_detect_4g(void);
#else #else
......
...@@ -62,17 +62,6 @@ const struct dma_map_ops powerpc_swiotlb_dma_ops = { ...@@ -62,17 +62,6 @@ const struct dma_map_ops powerpc_swiotlb_dma_ops = {
.get_required_mask = swiotlb_powerpc_get_required, .get_required_mask = swiotlb_powerpc_get_required,
}; };
void pci_dma_dev_setup_swiotlb(struct pci_dev *pdev)
{
struct pci_controller *hose;
struct dev_archdata *sd;
hose = pci_bus_to_host(pdev->bus);
sd = &pdev->dev.archdata;
sd->max_direct_dma_addr =
hose->dma_window_base_cur + hose->dma_window_size;
}
static int ppc_swiotlb_bus_notify(struct notifier_block *nb, static int ppc_swiotlb_bus_notify(struct notifier_block *nb,
unsigned long action, void *data) unsigned long action, void *data)
{ {
......
...@@ -114,6 +114,15 @@ static struct pci_ops fsl_indirect_pcie_ops = ...@@ -114,6 +114,15 @@ static struct pci_ops fsl_indirect_pcie_ops =
static u64 pci64_dma_offset; static u64 pci64_dma_offset;
#ifdef CONFIG_SWIOTLB #ifdef CONFIG_SWIOTLB
static void pci_dma_dev_setup_swiotlb(struct pci_dev *pdev)
{
struct pci_controller *hose = pci_bus_to_host(pdev->bus);
struct dev_archdata *sd = &pdev->dev.archdata;
sd->max_direct_dma_addr =
hose->dma_window_base_cur + hose->dma_window_size;
}
static void setup_swiotlb_ops(struct pci_controller *hose) static void setup_swiotlb_ops(struct pci_controller *hose)
{ {
if (ppc_swiotlb_enable) { if (ppc_swiotlb_enable) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment