]> err.no Git - linux-2.6/blobdiff - arch/powerpc/platforms/pasemi/iommu.c
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc
[linux-2.6] / arch / powerpc / platforms / pasemi / iommu.c
index 6c42787fb38263659c0c43824ee60a5cf374402e..9916a0f3e431955ba78117207e96038841b22ce6 100644 (file)
@@ -25,6 +25,7 @@
 #include <asm/iommu.h>
 #include <asm/machdep.h>
 #include <asm/abs_addr.h>
+#include <asm/firmware.h>
 
 
 #define IOBMAP_PAGE_SHIFT      12
@@ -175,13 +176,17 @@ static void pci_dma_dev_setup_pasemi(struct pci_dev *dev)
 {
        pr_debug("pci_dma_dev_setup, dev %p (%s)\n", dev, pci_name(dev));
 
-       /* DMA device is untranslated, but all other PCI-e goes through
-        * the IOMMU
+#if !defined(CONFIG_PPC_PASEMI_IOMMU_DMA_FORCE)
+       /* For non-LPAR environment, don't translate anything for the DMA
+        * engine. The exception to this is if the user has enabled
+        * CONFIG_PPC_PASEMI_IOMMU_DMA_FORCE at build time.
         */
-       if (dev->vendor == 0x1959 && dev->device == 0xa007)
+       if (dev->vendor == 0x1959 && dev->device == 0xa007 &&
+           !firmware_has_feature(FW_FEATURE_LPAR))
                dev->dev.archdata.dma_ops = &dma_direct_ops;
-       else
-               dev->dev.archdata.dma_data = &iommu_table_iobmap;
+#endif
+
+       dev->dev.archdata.dma_data = &iommu_table_iobmap;
 }
 
 static void pci_dma_bus_setup_null(struct pci_bus *b) { }