diff options
Diffstat (limited to 'arch/ia64/dig')
-rw-r--r-- | arch/ia64/dig/Makefile | 5 | ||||
-rw-r--r-- | arch/ia64/dig/dig_vtd_iommu.c | 59 | ||||
-rw-r--r-- | arch/ia64/dig/machvec_vtd.c | 3 |
3 files changed, 67 insertions, 0 deletions
diff --git a/arch/ia64/dig/Makefile b/arch/ia64/dig/Makefile index 971cd7870dd4..5c0283830bd6 100644 --- a/arch/ia64/dig/Makefile +++ b/arch/ia64/dig/Makefile | |||
@@ -6,4 +6,9 @@ | |||
6 | # | 6 | # |
7 | 7 | ||
8 | obj-y := setup.o | 8 | obj-y := setup.o |
9 | ifeq ($(CONFIG_DMAR), y) | ||
10 | obj-$(CONFIG_IA64_GENERIC) += machvec.o machvec_vtd.o dig_vtd_iommu.o | ||
11 | else | ||
9 | obj-$(CONFIG_IA64_GENERIC) += machvec.o | 12 | obj-$(CONFIG_IA64_GENERIC) += machvec.o |
13 | endif | ||
14 | obj-$(CONFIG_IA64_DIG_VTD) += dig_vtd_iommu.o | ||
diff --git a/arch/ia64/dig/dig_vtd_iommu.c b/arch/ia64/dig/dig_vtd_iommu.c new file mode 100644 index 000000000000..1c8a079017a3 --- /dev/null +++ b/arch/ia64/dig/dig_vtd_iommu.c | |||
@@ -0,0 +1,59 @@ | |||
1 | #include <linux/types.h> | ||
2 | #include <linux/kernel.h> | ||
3 | #include <linux/module.h> | ||
4 | #include <linux/intel-iommu.h> | ||
5 | |||
6 | void * | ||
7 | vtd_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle, | ||
8 | gfp_t flags) | ||
9 | { | ||
10 | return intel_alloc_coherent(dev, size, dma_handle, flags); | ||
11 | } | ||
12 | EXPORT_SYMBOL_GPL(vtd_alloc_coherent); | ||
13 | |||
14 | void | ||
15 | vtd_free_coherent(struct device *dev, size_t size, void *vaddr, | ||
16 | dma_addr_t dma_handle) | ||
17 | { | ||
18 | intel_free_coherent(dev, size, vaddr, dma_handle); | ||
19 | } | ||
20 | EXPORT_SYMBOL_GPL(vtd_free_coherent); | ||
21 | |||
22 | dma_addr_t | ||
23 | vtd_map_single_attrs(struct device *dev, void *addr, size_t size, | ||
24 | int dir, struct dma_attrs *attrs) | ||
25 | { | ||
26 | return intel_map_single(dev, (phys_addr_t)addr, size, dir); | ||
27 | } | ||
28 | EXPORT_SYMBOL_GPL(vtd_map_single_attrs); | ||
29 | |||
30 | void | ||
31 | vtd_unmap_single_attrs(struct device *dev, dma_addr_t iova, size_t size, | ||
32 | int dir, struct dma_attrs *attrs) | ||
33 | { | ||
34 | intel_unmap_single(dev, iova, size, dir); | ||
35 | } | ||
36 | EXPORT_SYMBOL_GPL(vtd_unmap_single_attrs); | ||
37 | |||
38 | int | ||
39 | vtd_map_sg_attrs(struct device *dev, struct scatterlist *sglist, int nents, | ||
40 | int dir, struct dma_attrs *attrs) | ||
41 | { | ||
42 | return intel_map_sg(dev, sglist, nents, dir); | ||
43 | } | ||
44 | EXPORT_SYMBOL_GPL(vtd_map_sg_attrs); | ||
45 | |||
46 | void | ||
47 | vtd_unmap_sg_attrs(struct device *dev, struct scatterlist *sglist, | ||
48 | int nents, int dir, struct dma_attrs *attrs) | ||
49 | { | ||
50 | intel_unmap_sg(dev, sglist, nents, dir); | ||
51 | } | ||
52 | EXPORT_SYMBOL_GPL(vtd_unmap_sg_attrs); | ||
53 | |||
54 | int | ||
55 | vtd_dma_mapping_error(struct device *dev, dma_addr_t dma_addr) | ||
56 | { | ||
57 | return 0; | ||
58 | } | ||
59 | EXPORT_SYMBOL_GPL(vtd_dma_mapping_error); | ||
diff --git a/arch/ia64/dig/machvec_vtd.c b/arch/ia64/dig/machvec_vtd.c new file mode 100644 index 000000000000..7cd3eb471cad --- /dev/null +++ b/arch/ia64/dig/machvec_vtd.c | |||
@@ -0,0 +1,3 @@ | |||
1 | #define MACHVEC_PLATFORM_NAME dig_vtd | ||
2 | #define MACHVEC_PLATFORM_HEADER <asm/machvec_dig_vtd.h> | ||
3 | #include <asm/machvec_init.h> | ||