diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-02-26 14:09:17 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-02-26 14:09:17 -0500 |
commit | f6c0ffa8f0b0781f4954cb06f0a81d6c10c1b434 (patch) | |
tree | f99190661706d18f129497a4ef2d37822c9c34db /include/linux | |
parent | 42a0a1b0fd343888c59afc8b243a77bcec2cc11c (diff) | |
parent | 604542b824f72fa5d7fd977af277538c1e15b5f0 (diff) |
Merge tag 'iommu-updates-v3.9' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu
Pull IOMMU Updates from Joerg Roedel:
"Besides some fixes and cleanups in the code there are three more
important changes to point out this time:
* New IOMMU driver for the ARM SHMOBILE platform
* An IOMMU-API extension for non-paging IOMMUs (required for
upcoming PAMU driver)
* Rework of the way the Tegra IOMMU driver accesses its
registetrs - register windows are easier to extend now.
There are also a few changes to non-iommu code, but that is acked by
the respective maintainers."
* tag 'iommu-updates-v3.9' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu: (23 commits)
iommu/tegra: assume CONFIG_OF in SMMU driver
iommu/tegra: assume CONFIG_OF in gart driver
iommu/amd: Remove redundant NULL check before dma_ops_domain_free().
iommu/amd: Initialize device table after dma_ops
iommu/vt-d: Zero out allocated memory in dmar_enable_qi
iommu/tegra: smmu: Fix incorrect mask for regbase
iommu/exynos: Make exynos_sysmmu_disable static
ARM: mach-shmobile: r8a7740: Add IPMMU device
ARM: mach-shmobile: sh73a0: Add IPMMU device
ARM: mach-shmobile: sh7372: Add IPMMU device
iommu/shmobile: Add iommu driver for Renesas IPMMU modules
iommu: Add DOMAIN_ATTR_WINDOWS domain attribute
iommu: Add domain window handling functions
iommu: Implement DOMAIN_ATTR_PAGING attribute
iommu: Check for valid pgsize_bitmap in iommu_map/unmap
iommu: Make sure DOMAIN_ATTR_MAX is really the maximum
iommu/tegra: smmu: Change SMMU's dependency on ARCH_TEGRA
iommu/tegra: smmu: Use helper function to check for valid register offset
iommu/tegra: smmu: Support variable MMIO ranges/blocks
iommu/tegra: Add missing spinlock initialization
...
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/iommu.h | 30 | ||||
-rw-r--r-- | include/linux/platform_data/sh_ipmmu.h | 18 |
2 files changed, 47 insertions, 1 deletions
diff --git a/include/linux/iommu.h b/include/linux/iommu.h index f3b99e1c1042..ba3b8a98a049 100644 --- a/include/linux/iommu.h +++ b/include/linux/iommu.h | |||
@@ -58,8 +58,10 @@ struct iommu_domain { | |||
58 | #define IOMMU_CAP_INTR_REMAP 0x2 /* isolates device intrs */ | 58 | #define IOMMU_CAP_INTR_REMAP 0x2 /* isolates device intrs */ |
59 | 59 | ||
60 | enum iommu_attr { | 60 | enum iommu_attr { |
61 | DOMAIN_ATTR_MAX, | ||
62 | DOMAIN_ATTR_GEOMETRY, | 61 | DOMAIN_ATTR_GEOMETRY, |
62 | DOMAIN_ATTR_PAGING, | ||
63 | DOMAIN_ATTR_WINDOWS, | ||
64 | DOMAIN_ATTR_MAX, | ||
63 | }; | 65 | }; |
64 | 66 | ||
65 | #ifdef CONFIG_IOMMU_API | 67 | #ifdef CONFIG_IOMMU_API |
@@ -100,6 +102,16 @@ struct iommu_ops { | |||
100 | enum iommu_attr attr, void *data); | 102 | enum iommu_attr attr, void *data); |
101 | int (*domain_set_attr)(struct iommu_domain *domain, | 103 | int (*domain_set_attr)(struct iommu_domain *domain, |
102 | enum iommu_attr attr, void *data); | 104 | enum iommu_attr attr, void *data); |
105 | |||
106 | /* Window handling functions */ | ||
107 | int (*domain_window_enable)(struct iommu_domain *domain, u32 wnd_nr, | ||
108 | phys_addr_t paddr, u64 size); | ||
109 | void (*domain_window_disable)(struct iommu_domain *domain, u32 wnd_nr); | ||
110 | /* Set the numer of window per domain */ | ||
111 | int (*domain_set_windows)(struct iommu_domain *domain, u32 w_count); | ||
112 | /* Get the numer of window per domain */ | ||
113 | u32 (*domain_get_windows)(struct iommu_domain *domain); | ||
114 | |||
103 | unsigned long pgsize_bitmap; | 115 | unsigned long pgsize_bitmap; |
104 | }; | 116 | }; |
105 | 117 | ||
@@ -157,6 +169,10 @@ extern int iommu_domain_get_attr(struct iommu_domain *domain, enum iommu_attr, | |||
157 | extern int iommu_domain_set_attr(struct iommu_domain *domain, enum iommu_attr, | 169 | extern int iommu_domain_set_attr(struct iommu_domain *domain, enum iommu_attr, |
158 | void *data); | 170 | void *data); |
159 | 171 | ||
172 | /* Window handling function prototypes */ | ||
173 | extern int iommu_domain_window_enable(struct iommu_domain *domain, u32 wnd_nr, | ||
174 | phys_addr_t offset, u64 size); | ||
175 | extern void iommu_domain_window_disable(struct iommu_domain *domain, u32 wnd_nr); | ||
160 | /** | 176 | /** |
161 | * report_iommu_fault() - report about an IOMMU fault to the IOMMU framework | 177 | * report_iommu_fault() - report about an IOMMU fault to the IOMMU framework |
162 | * @domain: the iommu domain where the fault has happened | 178 | * @domain: the iommu domain where the fault has happened |
@@ -239,6 +255,18 @@ static inline int iommu_unmap(struct iommu_domain *domain, unsigned long iova, | |||
239 | return -ENODEV; | 255 | return -ENODEV; |
240 | } | 256 | } |
241 | 257 | ||
258 | static inline int iommu_domain_window_enable(struct iommu_domain *domain, | ||
259 | u32 wnd_nr, phys_addr_t paddr, | ||
260 | u64 size) | ||
261 | { | ||
262 | return -ENODEV; | ||
263 | } | ||
264 | |||
265 | static inline void iommu_domain_window_disable(struct iommu_domain *domain, | ||
266 | u32 wnd_nr) | ||
267 | { | ||
268 | } | ||
269 | |||
242 | static inline phys_addr_t iommu_iova_to_phys(struct iommu_domain *domain, | 270 | static inline phys_addr_t iommu_iova_to_phys(struct iommu_domain *domain, |
243 | unsigned long iova) | 271 | unsigned long iova) |
244 | { | 272 | { |
diff --git a/include/linux/platform_data/sh_ipmmu.h b/include/linux/platform_data/sh_ipmmu.h new file mode 100644 index 000000000000..39f7405cdac5 --- /dev/null +++ b/include/linux/platform_data/sh_ipmmu.h | |||
@@ -0,0 +1,18 @@ | |||
1 | /* sh_ipmmu.h | ||
2 | * | ||
3 | * Copyright (C) 2012 Hideki EIRAKU | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify | ||
6 | * it under the terms of the GNU General Public License as published by | ||
7 | * the Free Software Foundation; version 2 of the License. | ||
8 | */ | ||
9 | |||
10 | #ifndef __SH_IPMMU_H__ | ||
11 | #define __SH_IPMMU_H__ | ||
12 | |||
13 | struct shmobile_ipmmu_platform_data { | ||
14 | const char * const *dev_names; | ||
15 | unsigned int num_dev_names; | ||
16 | }; | ||
17 | |||
18 | #endif /* __SH_IPMMU_H__ */ | ||