blob: 306454fbc52d7dab0464976f44ebcc237a54cd2b [file] [log] [blame]
Ohad Ben-Cohenab493a02011-06-02 02:48:05 +03001# IOMMU_API always gets selected by whoever wants it.
2config IOMMU_API
3 bool
Ohad Ben-Cohenb10f1272011-06-02 03:20:08 +03004
Joerg Roedel68255b62011-06-14 15:51:54 +02005menuconfig IOMMU_SUPPORT
6 bool "IOMMU Hardware Support"
7 default y
8 ---help---
9 Say Y here if you want to compile device drivers for IO Memory
10 Management Units into the kernel. These devices usually allow to
11 remap DMA requests and/or remap interrupts from other devices on the
12 system.
13
14if IOMMU_SUPPORT
15
Will Deaconfdb1d7b2014-11-14 17:16:49 +000016menu "Generic IOMMU Pagetable Support"
17
18# Selected by the actual pagetable implementations
19config IOMMU_IO_PGTABLE
20 bool
21
Will Deacone1d3c0f2014-11-14 17:18:23 +000022config IOMMU_IO_PGTABLE_LPAE
23 bool "ARMv7/v8 Long Descriptor Format"
24 select IOMMU_IO_PGTABLE
25 help
26 Enable support for the ARM long descriptor pagetable format.
27 This allocator supports 4K/2M/1G, 16K/32M and 64K/512M page
28 sizes at both stage-1 and stage-2, as well as address spaces
29 up to 48-bits in size.
30
Will Deaconfdb1d7b2014-11-14 17:16:49 +000031endmenu
32
Hiroshi Doyu4e0ee782012-06-25 14:23:54 +030033config OF_IOMMU
34 def_bool y
Will Deacon7eba1d52014-08-27 16:20:32 +010035 depends on OF && IOMMU_API
Hiroshi Doyu4e0ee782012-06-25 14:23:54 +030036
Varun Sethi695093e2013-07-15 10:20:57 +053037config FSL_PAMU
38 bool "Freescale IOMMU support"
39 depends on PPC_E500MC
40 select IOMMU_API
41 select GENERIC_ALLOCATOR
42 help
43 Freescale PAMU support. PAMU is the IOMMU present on Freescale QorIQ platforms.
44 PAMU can authorize memory access, remap the memory address, and remap I/O
45 transaction types.
46
Ohad Ben-Cohenb10f1272011-06-02 03:20:08 +030047# MSM IOMMU support
48config MSM_IOMMU
49 bool "MSM IOMMU Support"
50 depends on ARCH_MSM8X60 || ARCH_MSM8960
51 select IOMMU_API
52 help
53 Support for the IOMMUs found on certain Qualcomm SOCs.
54 These IOMMUs allow virtualization of the address space used by most
55 cores within the multimedia subsystem.
56
57 If unsure, say N here.
58
59config IOMMU_PGTABLES_L2
60 def_bool y
61 depends on MSM_IOMMU && MMU && SMP && CPU_DCACHE_DISABLE=n
Ohad Ben-Cohen29b68412011-06-05 18:22:18 +030062
63# AMD IOMMU support
64config AMD_IOMMU
65 bool "AMD IOMMU support"
66 select SWIOTLB
67 select PCI_MSI
Joerg Roedel52815b72011-11-17 17:24:28 +010068 select PCI_ATS
69 select PCI_PRI
70 select PCI_PASID
Ohad Ben-Cohen29b68412011-06-05 18:22:18 +030071 select IOMMU_API
Thomas Petazzoni0dbc6072013-10-03 11:59:14 +020072 depends on X86_64 && PCI && ACPI
Ohad Ben-Cohen29b68412011-06-05 18:22:18 +030073 ---help---
74 With this option you can enable support for AMD IOMMU hardware in
75 your system. An IOMMU is a hardware component which provides
76 remapping of DMA memory accesses from devices. With an AMD IOMMU you
Masanari Iida59bf8962012-04-18 00:01:21 +090077 can isolate the DMA memory of different devices and protect the
Ohad Ben-Cohen29b68412011-06-05 18:22:18 +030078 system from misbehaving device drivers or hardware.
79
80 You can find out if your system has an AMD IOMMU if you look into
81 your BIOS for an option to enable it or if you have an IVRS ACPI
82 table.
83
84config AMD_IOMMU_STATS
85 bool "Export AMD IOMMU statistics to debugfs"
86 depends on AMD_IOMMU
87 select DEBUG_FS
88 ---help---
89 This option enables code in the AMD IOMMU driver to collect various
90 statistics about whats happening in the driver and exports that
91 information to userspace via debugfs.
92 If unsure, say N.
Ohad Ben-Cohen166e9272011-06-10 21:42:27 +030093
Joerg Roedele3c495c2011-11-09 12:31:15 +010094config AMD_IOMMU_V2
Kees Cooka446e212013-01-16 18:53:39 -080095 tristate "AMD IOMMU Version 2 driver"
Borislav Petkove5cac322014-07-10 12:44:56 +020096 depends on AMD_IOMMU
Joerg Roedel8736b2c2011-11-24 16:21:52 +010097 select MMU_NOTIFIER
Joerg Roedele3c495c2011-11-09 12:31:15 +010098 ---help---
99 This option enables support for the AMD IOMMUv2 features of the IOMMU
100 hardware. Select this option if you want to use devices that support
Masanari Iida59bf8962012-04-18 00:01:21 +0900101 the PCI PRI and PASID interface.
Joerg Roedele3c495c2011-11-09 12:31:15 +0100102
Ohad Ben-Cohen166e9272011-06-10 21:42:27 +0300103# Intel IOMMU support
Suresh Siddhad3f13812011-08-23 17:05:25 -0700104config DMAR_TABLE
105 bool
106
107config INTEL_IOMMU
108 bool "Support for Intel IOMMU using DMA Remapping Devices"
Ohad Ben-Cohen166e9272011-06-10 21:42:27 +0300109 depends on PCI_MSI && ACPI && (X86 || IA64_GENERIC)
110 select IOMMU_API
Suresh Siddhad3f13812011-08-23 17:05:25 -0700111 select DMAR_TABLE
Ohad Ben-Cohen166e9272011-06-10 21:42:27 +0300112 help
113 DMA remapping (DMAR) devices support enables independent address
114 translations for Direct Memory Access (DMA) from devices.
115 These DMA remapping devices are reported via ACPI tables
116 and include PCI device scope covered by these DMA
117 remapping devices.
118
Suresh Siddhad3f13812011-08-23 17:05:25 -0700119config INTEL_IOMMU_DEFAULT_ON
Ohad Ben-Cohen166e9272011-06-10 21:42:27 +0300120 def_bool y
Suresh Siddhad3f13812011-08-23 17:05:25 -0700121 prompt "Enable Intel DMA Remapping Devices by default"
122 depends on INTEL_IOMMU
Ohad Ben-Cohen166e9272011-06-10 21:42:27 +0300123 help
124 Selecting this option will enable a DMAR device at boot time if
125 one is found. If this option is not selected, DMAR support can
126 be enabled by passing intel_iommu=on to the kernel.
127
Suresh Siddhad3f13812011-08-23 17:05:25 -0700128config INTEL_IOMMU_BROKEN_GFX_WA
Ohad Ben-Cohen166e9272011-06-10 21:42:27 +0300129 bool "Workaround broken graphics drivers (going away soon)"
Suresh Siddhad3f13812011-08-23 17:05:25 -0700130 depends on INTEL_IOMMU && BROKEN && X86
Ohad Ben-Cohen166e9272011-06-10 21:42:27 +0300131 ---help---
132 Current Graphics drivers tend to use physical address
133 for DMA and avoid using DMA APIs. Setting this config
134 option permits the IOMMU driver to set a unity map for
135 all the OS-visible memory. Hence the driver can continue
136 to use physical addresses for DMA, at least until this
137 option is removed in the 2.6.32 kernel.
138
Suresh Siddhad3f13812011-08-23 17:05:25 -0700139config INTEL_IOMMU_FLOPPY_WA
Ohad Ben-Cohen166e9272011-06-10 21:42:27 +0300140 def_bool y
Suresh Siddhad3f13812011-08-23 17:05:25 -0700141 depends on INTEL_IOMMU && X86
Ohad Ben-Cohen166e9272011-06-10 21:42:27 +0300142 ---help---
143 Floppy disk drivers are known to bypass DMA API calls
144 thereby failing to work when IOMMU is enabled. This
145 workaround will setup a 1:1 mapping for the first
146 16MiB to make floppy (an ISA device) work.
147
Suresh Siddhad3f13812011-08-23 17:05:25 -0700148config IRQ_REMAP
Kees Cooka446e212013-01-16 18:53:39 -0800149 bool "Support for Interrupt Remapping"
150 depends on X86_64 && X86_IO_APIC && PCI_MSI && ACPI
Suresh Siddhad3f13812011-08-23 17:05:25 -0700151 select DMAR_TABLE
Ohad Ben-Cohen166e9272011-06-10 21:42:27 +0300152 ---help---
153 Supports Interrupt remapping for IO-APIC and MSI devices.
154 To use x2apic mode in the CPU's which support x2APIC enhancements or
155 to support platforms with CPU's having > 8 bit APIC ID, say Y.
Joerg Roedel68255b62011-06-14 15:51:54 +0200156
Ohad Ben-Cohenfcf3a6e2011-08-15 23:21:41 +0300157# OMAP IOMMU support
158config OMAP_IOMMU
159 bool "OMAP IOMMU Support"
Arnd Bergmannae191582013-03-05 23:16:48 +0100160 depends on ARCH_OMAP2PLUS
Ohad Ben-Cohenfcf3a6e2011-08-15 23:21:41 +0300161 select IOMMU_API
162
Ohad Ben-Cohenfcf3a6e2011-08-15 23:21:41 +0300163config OMAP_IOMMU_DEBUG
Suman Anna61c75352014-10-22 17:22:30 -0500164 bool "Export OMAP IOMMU internals in DebugFS"
165 depends on OMAP_IOMMU && DEBUG_FS
166 ---help---
167 Select this to see extensive information about
168 the internal state of OMAP IOMMU in debugfs.
Ohad Ben-Cohenfcf3a6e2011-08-15 23:21:41 +0300169
Suman Anna61c75352014-10-22 17:22:30 -0500170 Say N unless you know you need this.
Ohad Ben-Cohenfcf3a6e2011-08-15 23:21:41 +0300171
Daniel Kurtzc68a2922014-11-03 10:53:27 +0800172config ROCKCHIP_IOMMU
173 bool "Rockchip IOMMU Support"
Joerg Roedel11175882014-11-03 18:16:56 +0100174 depends on ARM
175 depends on ARCH_ROCKCHIP || COMPILE_TEST
Daniel Kurtzc68a2922014-11-03 10:53:27 +0800176 select IOMMU_API
177 select ARM_DMA_USE_IOMMU
178 help
179 Support for IOMMUs found on Rockchip rk32xx SOCs.
180 These IOMMUs allow virtualization of the address space used by most
181 cores within the multimedia subsystem.
182 Say Y here if you are using a Rockchip SoC that includes an IOMMU
183 device.
Ohad Ben-Cohenab493a02011-06-02 02:48:05 +0300184
Hiroshi DOYUd53e54b2011-11-16 17:36:37 +0200185config TEGRA_IOMMU_GART
186 bool "Tegra GART IOMMU Support"
187 depends on ARCH_TEGRA_2x_SOC
188 select IOMMU_API
189 help
190 Enables support for remapping discontiguous physical memory
191 shared with the operating system into contiguous I/O virtual
192 space through the GART (Graphics Address Relocation Table)
193 hardware included on Tegra SoCs.
194
Hiroshi DOYU7a31f6f2011-11-17 07:31:31 +0200195config TEGRA_IOMMU_SMMU
Thierry Reding89184652014-04-16 09:24:44 +0200196 bool "NVIDIA Tegra SMMU Support"
197 depends on ARCH_TEGRA
198 depends on TEGRA_AHB
199 depends on TEGRA_MC
Hiroshi DOYU7a31f6f2011-11-17 07:31:31 +0200200 select IOMMU_API
201 help
Thierry Reding89184652014-04-16 09:24:44 +0200202 This driver supports the IOMMU hardware (SMMU) found on NVIDIA Tegra
203 SoCs (Tegra30 up to Tegra124).
Hiroshi DOYU7a31f6f2011-11-17 07:31:31 +0200204
KyongHo Cho2a965362012-05-12 05:56:09 +0900205config EXYNOS_IOMMU
206 bool "Exynos IOMMU Support"
Mark Brown20911ce2014-12-15 15:54:42 +0000207 depends on ARCH_EXYNOS && ARM
KyongHo Cho2a965362012-05-12 05:56:09 +0900208 select IOMMU_API
Tushar Behera4802c1d2014-07-04 15:01:08 +0530209 select ARM_DMA_USE_IOMMU
KyongHo Cho2a965362012-05-12 05:56:09 +0900210 help
Sachin Kamat5455d702014-05-22 09:50:55 +0530211 Support for the IOMMU (System MMU) of Samsung Exynos application
212 processor family. This enables H/W multimedia accelerators to see
213 non-linear physical memory chunks as linear memory in their
214 address space.
KyongHo Cho2a965362012-05-12 05:56:09 +0900215
216 If unsure, say N here.
217
218config EXYNOS_IOMMU_DEBUG
219 bool "Debugging log for Exynos IOMMU"
220 depends on EXYNOS_IOMMU
221 help
222 Select this to see the detailed log message that shows what
Sachin Kamat5455d702014-05-22 09:50:55 +0530223 happens in the IOMMU driver.
KyongHo Cho2a965362012-05-12 05:56:09 +0900224
Sachin Kamat5455d702014-05-22 09:50:55 +0530225 Say N unless you need kernel log message for IOMMU debugging.
KyongHo Cho2a965362012-05-12 05:56:09 +0900226
Hideki EIRAKUc2c460f2013-01-21 19:54:26 +0900227config SHMOBILE_IPMMU
228 bool
229
230config SHMOBILE_IPMMU_TLB
231 bool
232
233config SHMOBILE_IOMMU
234 bool "IOMMU for Renesas IPMMU/IPMMUI"
235 default n
Linus Torvaldsf63c4822013-11-15 18:57:42 -0800236 depends on ARM
Paul Bolleb8354432014-02-08 22:21:54 +0100237 depends on ARCH_SHMOBILE || COMPILE_TEST
Hideki EIRAKUc2c460f2013-01-21 19:54:26 +0900238 select IOMMU_API
239 select ARM_DMA_USE_IOMMU
240 select SHMOBILE_IPMMU
241 select SHMOBILE_IPMMU_TLB
242 help
243 Support for Renesas IPMMU/IPMMUI. This option enables
244 remapping of DMA memory accesses from all of the IP blocks
245 on the ICB.
246
247 Warning: Drivers (including userspace drivers of UIO
248 devices) of the IP blocks on the ICB *must* use addresses
249 allocated from the IPMMU (iova) for DMA with this option
250 enabled.
251
252 If unsure, say N.
253
254choice
255 prompt "IPMMU/IPMMUI address space size"
256 default SHMOBILE_IOMMU_ADDRSIZE_2048MB
257 depends on SHMOBILE_IOMMU
258 help
259 This option sets IPMMU/IPMMUI address space size by
260 adjusting the 1st level page table size. The page table size
261 is calculated as follows:
262
263 page table size = number of page table entries * 4 bytes
264 number of page table entries = address space size / 1 MiB
265
266 For example, when the address space size is 2048 MiB, the
267 1st level page table size is 8192 bytes.
268
269 config SHMOBILE_IOMMU_ADDRSIZE_2048MB
270 bool "2 GiB"
271
272 config SHMOBILE_IOMMU_ADDRSIZE_1024MB
273 bool "1 GiB"
274
275 config SHMOBILE_IOMMU_ADDRSIZE_512MB
276 bool "512 MiB"
277
278 config SHMOBILE_IOMMU_ADDRSIZE_256MB
279 bool "256 MiB"
280
281 config SHMOBILE_IOMMU_ADDRSIZE_128MB
282 bool "128 MiB"
283
284 config SHMOBILE_IOMMU_ADDRSIZE_64MB
285 bool "64 MiB"
286
287 config SHMOBILE_IOMMU_ADDRSIZE_32MB
288 bool "32 MiB"
289
290endchoice
291
292config SHMOBILE_IOMMU_L1SIZE
293 int
294 default 8192 if SHMOBILE_IOMMU_ADDRSIZE_2048MB
295 default 4096 if SHMOBILE_IOMMU_ADDRSIZE_1024MB
296 default 2048 if SHMOBILE_IOMMU_ADDRSIZE_512MB
297 default 1024 if SHMOBILE_IOMMU_ADDRSIZE_256MB
298 default 512 if SHMOBILE_IOMMU_ADDRSIZE_128MB
299 default 256 if SHMOBILE_IOMMU_ADDRSIZE_64MB
300 default 128 if SHMOBILE_IOMMU_ADDRSIZE_32MB
301
Laurent Pinchartd25a2a12014-04-02 12:47:37 +0200302config IPMMU_VMSA
303 bool "Renesas VMSA-compatible IPMMU"
304 depends on ARM_LPAE
305 depends on ARCH_SHMOBILE || COMPILE_TEST
306 select IOMMU_API
307 select ARM_DMA_USE_IOMMU
308 help
309 Support for the Renesas VMSA-compatible IPMMU Renesas found in the
310 R-Mobile APE6 and R-Car H2/M2 SoCs.
311
312 If unsure, say N.
313
Alexey Kardashevskiy4e13c1a2013-05-21 13:33:09 +1000314config SPAPR_TCE_IOMMU
315 bool "sPAPR TCE IOMMU Support"
Alexey Kardashevskiy5b251992013-05-21 13:33:11 +1000316 depends on PPC_POWERNV || PPC_PSERIES
Alexey Kardashevskiy4e13c1a2013-05-21 13:33:09 +1000317 select IOMMU_API
318 help
319 Enables bits of IOMMU API required by VFIO. The iommu_ops
320 is not implemented as it is not necessary for VFIO.
321
Will Deacon45ae7cf2013-06-24 18:31:25 +0100322config ARM_SMMU
323 bool "ARM Ltd. System MMU (SMMU) Support"
324 depends on ARM64 || (ARM_LPAE && OF)
325 select IOMMU_API
326 select ARM_DMA_USE_IOMMU if ARM
327 help
328 Support for implementations of the ARM System MMU architecture
329 versions 1 and 2. The driver supports both v7l and v8l table
330 formats with 4k and 64k page sizes.
331
332 Say Y here if your SoC includes an IOMMU device implementing
333 the ARM SMMU architecture.
334
Ohad Ben-Cohenab493a02011-06-02 02:48:05 +0300335endif # IOMMU_SUPPORT