Glauber Costa | 459121c9 | 2008-04-08 13:20:43 -0300 | [diff] [blame] | 1 | #include <linux/dma-mapping.h> |
Glauber Costa | cb5867a | 2008-04-08 13:20:51 -0300 | [diff] [blame^] | 2 | #include <linux/dmar.h> |
| 3 | |
| 4 | #include <asm/gart.h> |
| 5 | #include <asm/calgary.h> |
Glauber Costa | 459121c9 | 2008-04-08 13:20:43 -0300 | [diff] [blame] | 6 | |
Glauber Costa | 85c246e | 2008-04-08 13:20:50 -0300 | [diff] [blame] | 7 | const struct dma_mapping_ops *dma_ops; |
| 8 | EXPORT_SYMBOL(dma_ops); |
| 9 | |
Glauber Costa | f9c258d | 2008-04-08 13:20:52 -0300 | [diff] [blame] | 10 | #ifdef CONFIG_IOMMU_DEBUG |
| 11 | int panic_on_overflow __read_mostly = 1; |
| 12 | int force_iommu __read_mostly = 1; |
| 13 | #else |
| 14 | int panic_on_overflow __read_mostly = 0; |
| 15 | int force_iommu __read_mostly = 0; |
| 16 | #endif |
| 17 | |
Glauber Costa | 459121c9 | 2008-04-08 13:20:43 -0300 | [diff] [blame] | 18 | int dma_set_mask(struct device *dev, u64 mask) |
| 19 | { |
| 20 | if (!dev->dma_mask || !dma_supported(dev, mask)) |
| 21 | return -EIO; |
| 22 | |
| 23 | *dev->dma_mask = mask; |
| 24 | |
| 25 | return 0; |
| 26 | } |
| 27 | EXPORT_SYMBOL(dma_set_mask); |
| 28 | |
Glauber Costa | cb5867a | 2008-04-08 13:20:51 -0300 | [diff] [blame^] | 29 | static int __init pci_iommu_init(void) |
| 30 | { |
| 31 | #ifdef CONFIG_CALGARY_IOMMU |
| 32 | calgary_iommu_init(); |
| 33 | #endif |
Glauber Costa | 459121c9 | 2008-04-08 13:20:43 -0300 | [diff] [blame] | 34 | |
Glauber Costa | cb5867a | 2008-04-08 13:20:51 -0300 | [diff] [blame^] | 35 | intel_iommu_init(); |
| 36 | |
| 37 | #ifdef CONFIG_GART_IOMMU |
| 38 | gart_iommu_init(); |
| 39 | #endif |
| 40 | |
| 41 | no_iommu_init(); |
| 42 | return 0; |
| 43 | } |
| 44 | |
| 45 | void pci_iommu_shutdown(void) |
| 46 | { |
| 47 | gart_iommu_shutdown(); |
| 48 | } |
| 49 | /* Must execute after PCI subsystem */ |
| 50 | fs_initcall(pci_iommu_init); |