]>
Commit | Line | Data |
---|---|---|
459121c9 | 1 | #include <linux/dma-mapping.h> |
cb5867a5 GC |
2 | #include <linux/dmar.h> |
3 | ||
4 | #include <asm/gart.h> | |
5 | #include <asm/calgary.h> | |
459121c9 | 6 | |
85c246ee GC |
7 | const struct dma_mapping_ops *dma_ops; |
8 | EXPORT_SYMBOL(dma_ops); | |
9 | ||
f9c258de GC |
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 | ||
459121c9 GC |
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 | ||
cb5867a5 GC |
29 | static int __init pci_iommu_init(void) |
30 | { | |
31 | #ifdef CONFIG_CALGARY_IOMMU | |
32 | calgary_iommu_init(); | |
33 | #endif | |
34 | ||
35 | intel_iommu_init(); | |
36 | ||
37 | #ifdef CONFIG_GART_IOMMU | |
38 | gart_iommu_init(); | |
39 | #endif | |
459121c9 | 40 | |
cb5867a5 GC |
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); |