]> err.no Git - linux-2.6/commitdiff
[POWERPC] Create and use set_pci_dma_ops
authorStephen Rothwell <sfr@canb.auug.org.au>
Sun, 4 Mar 2007 05:58:39 +0000 (16:58 +1100)
committerPaul Mackerras <paulus@samba.org>
Fri, 9 Mar 2007 04:03:25 +0000 (15:03 +1100)
This will allow us to build without PCI easier.

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
arch/powerpc/kernel/pci_64.c
arch/powerpc/platforms/cell/iommu.c
arch/powerpc/platforms/celleb/iommu.c
arch/powerpc/platforms/iseries/iommu.c
arch/powerpc/platforms/pasemi/iommu.c
arch/powerpc/platforms/pseries/iommu.c
arch/powerpc/sysdev/dart_iommu.c
include/asm-powerpc/pci.h

index 7e97d71a5f8fa17f08d04e01b623bca7534c1044..73d509343d5bc36073ee8a4f4fe6ef0ef22b276a 100644 (file)
@@ -70,6 +70,11 @@ int global_phb_number;               /* Global phb counter */
 struct pci_dev *ppc64_isabridge_dev = NULL;
 EXPORT_SYMBOL_GPL(ppc64_isabridge_dev);
 
+void set_pci_dma_ops(struct dma_mapping_ops *dma_ops)
+{
+       pci_dma_ops = dma_ops;
+}
+
 static void fixup_broken_pcnet32(struct pci_dev* dev)
 {
        if ((dev->class>>8 == PCI_CLASS_NETWORK_ETHERNET)) {
index 67d617b60a2344ab00a78a9b32e7fb508f1b05fc..d0e02ea1d538d80dd4e933f5e895f3a5b286bc19 100644 (file)
@@ -646,7 +646,7 @@ static int __init cell_iommu_init_disabled(void)
        unsigned long base = 0, size;
 
        /* When no iommu is present, we use direct DMA ops */
-       pci_dma_ops = &dma_direct_ops;
+       set_pci_dma_ops(&dma_direct_ops);
 
        /* First make sure all IOC translation is turned off */
        cell_disable_iommus();
@@ -734,7 +734,7 @@ static int __init cell_iommu_init(void)
        }
 
        /* Setup default PCI iommu ops */
-       pci_dma_ops = &dma_iommu_ops;
+       set_pci_dma_ops(&dma_iommu_ops);
 
  bail:
        /* Register callbacks on OF platform device addition/removal
index f63b94c65353218b28a913916818e1e8763fc3a9..fecc4ffd475e05162be5671ae3ae28d526485edb 100644 (file)
@@ -95,7 +95,7 @@ static int __init celleb_init_iommu(void)
                return -ENODEV;
 
        celleb_init_direct_mapping();
-       pci_dma_ops = &dma_direct_ops;
+       set_pci_dma_ops(&dma_direct_ops);
        bus_register_notifier(&of_platform_bus_type, &celleb_of_bus_notifier);
 
        return 0;
index d7a756d5135cf4ee0ba6366106f69a2b639658db..7df2902271d01c7795608cb010c8a7580bd8e8ad 100644 (file)
@@ -194,5 +194,5 @@ void iommu_init_early_iSeries(void)
        ppc_md.tce_build = tce_build_iSeries;
        ppc_md.tce_free  = tce_free_iSeries;
 
-       pci_dma_ops = &dma_iommu_ops;
+       set_pci_dma_ops(&dma_iommu_ops);
 }
index 459a53b7d24d33ff6edcd0bac3a6083399ad943d..4587c1dfeda5bfdbc884261b099d8b592b759a7b 100644 (file)
@@ -255,7 +255,7 @@ void iommu_init_early_pasemi(void)
                /* Direct I/O, IOMMU off */
                ppc_md.pci_dma_dev_setup = pci_dma_dev_setup_null;
                ppc_md.pci_dma_bus_setup = pci_dma_bus_setup_null;
-               pci_dma_ops = &dma_direct_ops;
+               set_pci_dma_ops(&dma_direct_ops);
 
                return;
        }
@@ -266,7 +266,7 @@ void iommu_init_early_pasemi(void)
        ppc_md.pci_dma_bus_setup = pci_dma_bus_setup_pasemi;
        ppc_md.tce_build = iobmap_build;
        ppc_md.tce_free  = iobmap_free;
-       pci_dma_ops = &dma_iommu_ops;
+       set_pci_dma_ops(&dma_iommu_ops);
 }
 
 void __init alloc_iobmap_l2(void)
index e6653a868b91c6177c79d60a97a542bd6e79a7fe..9322f74e1d8b90f333c2e0364025dc539bbbd76f 100644 (file)
@@ -562,7 +562,7 @@ void iommu_init_early_pSeries(void)
                /* Direct I/O, IOMMU off */
                ppc_md.pci_dma_dev_setup = NULL;
                ppc_md.pci_dma_bus_setup = NULL;
-               pci_dma_ops = &dma_direct_ops;
+               set_pci_dma_ops(&dma_direct_ops);
                return;
        }
 
@@ -588,6 +588,6 @@ void iommu_init_early_pSeries(void)
 
        pSeries_reconfig_notifier_register(&iommu_reconfig_nb);
 
-       pci_dma_ops = &dma_iommu_ops;
+       set_pci_dma_ops(&dma_iommu_ops);
 }
 
index 1488535b0e136ddea4452a16de9736395af73460..336186dd7f10d2933a4ef02db41f625b6e9a51f8 100644 (file)
@@ -333,7 +333,7 @@ void iommu_init_early_dart(void)
                ppc_md.pci_dma_bus_setup = pci_dma_bus_setup_dart;
 
                /* Setup pci_dma ops */
-               pci_dma_ops = &dma_iommu_ops;
+               set_pci_dma_ops(&dma_iommu_ops);
                return;
        }
 
@@ -343,7 +343,7 @@ void iommu_init_early_dart(void)
        ppc_md.pci_dma_bus_setup = NULL;
 
        /* Setup pci_dma ops */
-       pci_dma_ops = &dma_direct_ops;
+       set_pci_dma_ops(&dma_direct_ops);
 }
 
 
index ac656ee6bb193215db3cc9a9c6353726f3963a0e..ebf31f1c59158d6c1d42b699d0d3ac57e731f567 100644 (file)
@@ -70,8 +70,11 @@ static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel)
  */
 #define PCI_DISABLE_MWI
 
+#ifdef CONFIG_PCI
 extern struct dma_mapping_ops *pci_dma_ops;
 
+extern void set_pci_dma_ops(struct dma_mapping_ops *dma_ops);
+
 /* For DAC DMA, we currently don't support it by default, but
  * we let 64-bit platforms override this.
  */
@@ -82,7 +85,6 @@ static inline int pci_dac_dma_supported(struct pci_dev *hwdev,u64 mask)
        return 0;
 }
 
-#ifdef CONFIG_PCI
 static inline void pci_dma_burst_advice(struct pci_dev *pdev,
                                        enum pci_dma_burst_strategy *strat,
                                        unsigned long *strategy_parameter)
@@ -99,6 +101,8 @@ static inline void pci_dma_burst_advice(struct pci_dev *pdev,
        *strat = PCI_DMA_BURST_MULTIPLE;
        *strategy_parameter = cacheline_size;
 }
+#else  /* CONFIG_PCI */
+#define set_pci_dma_ops(d)
 #endif
 
 extern int pci_domain_nr(struct pci_bus *bus);