diff options
Diffstat (limited to 'arch/powerpc/platforms/pasemi/iommu.c')
-rw-r--r-- | arch/powerpc/platforms/pasemi/iommu.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/arch/powerpc/platforms/pasemi/iommu.c b/arch/powerpc/platforms/pasemi/iommu.c index 9014d55c717b..9916a0f3e431 100644 --- a/arch/powerpc/platforms/pasemi/iommu.c +++ b/arch/powerpc/platforms/pasemi/iommu.c | |||
@@ -25,6 +25,7 @@ | |||
25 | #include <asm/iommu.h> | 25 | #include <asm/iommu.h> |
26 | #include <asm/machdep.h> | 26 | #include <asm/machdep.h> |
27 | #include <asm/abs_addr.h> | 27 | #include <asm/abs_addr.h> |
28 | #include <asm/firmware.h> | ||
28 | 29 | ||
29 | 30 | ||
30 | #define IOBMAP_PAGE_SHIFT 12 | 31 | #define IOBMAP_PAGE_SHIFT 12 |
@@ -175,19 +176,23 @@ static void pci_dma_dev_setup_pasemi(struct pci_dev *dev) | |||
175 | { | 176 | { |
176 | pr_debug("pci_dma_dev_setup, dev %p (%s)\n", dev, pci_name(dev)); | 177 | pr_debug("pci_dma_dev_setup, dev %p (%s)\n", dev, pci_name(dev)); |
177 | 178 | ||
178 | /* DMA device is untranslated, but all other PCI-e goes through | 179 | #if !defined(CONFIG_PPC_PASEMI_IOMMU_DMA_FORCE) |
179 | * the IOMMU | 180 | /* For non-LPAR environment, don't translate anything for the DMA |
181 | * engine. The exception to this is if the user has enabled | ||
182 | * CONFIG_PPC_PASEMI_IOMMU_DMA_FORCE at build time. | ||
180 | */ | 183 | */ |
181 | if (dev->vendor == 0x1959 && dev->device == 0xa007) | 184 | if (dev->vendor == 0x1959 && dev->device == 0xa007 && |
185 | !firmware_has_feature(FW_FEATURE_LPAR)) | ||
182 | dev->dev.archdata.dma_ops = &dma_direct_ops; | 186 | dev->dev.archdata.dma_ops = &dma_direct_ops; |
183 | else | 187 | #endif |
184 | dev->dev.archdata.dma_data = &iommu_table_iobmap; | 188 | |
189 | dev->dev.archdata.dma_data = &iommu_table_iobmap; | ||
185 | } | 190 | } |
186 | 191 | ||
187 | static void pci_dma_bus_setup_null(struct pci_bus *b) { } | 192 | static void pci_dma_bus_setup_null(struct pci_bus *b) { } |
188 | static void pci_dma_dev_setup_null(struct pci_dev *d) { } | 193 | static void pci_dma_dev_setup_null(struct pci_dev *d) { } |
189 | 194 | ||
190 | int iob_init(struct device_node *dn) | 195 | int __init iob_init(struct device_node *dn) |
191 | { | 196 | { |
192 | unsigned long tmp; | 197 | unsigned long tmp; |
193 | u32 regword; | 198 | u32 regword; |
@@ -233,7 +238,7 @@ int iob_init(struct device_node *dn) | |||
233 | 238 | ||
234 | 239 | ||
235 | /* These are called very early. */ | 240 | /* These are called very early. */ |
236 | void iommu_init_early_pasemi(void) | 241 | void __init iommu_init_early_pasemi(void) |
237 | { | 242 | { |
238 | int iommu_off; | 243 | int iommu_off; |
239 | 244 | ||