]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/blame - arch/x86/kernel/pci-dma.c
x86: move initialization functions to pci-dma.c
[mirror_ubuntu-zesty-kernel.git] / arch / x86 / kernel / pci-dma.c
CommitLineData
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
7const struct dma_mapping_ops *dma_ops;
8EXPORT_SYMBOL(dma_ops);
9
f9c258de
GC
10#ifdef CONFIG_IOMMU_DEBUG
11int panic_on_overflow __read_mostly = 1;
12int force_iommu __read_mostly = 1;
13#else
14int panic_on_overflow __read_mostly = 0;
15int force_iommu __read_mostly = 0;
16#endif
17
459121c9
GC
18int 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}
27EXPORT_SYMBOL(dma_set_mask);
28
cb5867a5
GC
29static 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
45void pci_iommu_shutdown(void)
46{
47 gart_iommu_shutdown();
48}
49/* Must execute after PCI subsystem */
50fs_initcall(pci_iommu_init);