blob: 3eb68fa1b8cc02949fc29468316df560ceaefc31 [file] [log] [blame]
Thomas Gleixnerec8f24b2019-05-19 13:07:45 +01001# SPDX-License-Identifier: GPL-2.0-only
Sakari Ailusbd3c2e62019-01-02 23:16:57 +02002# The IOVA library may also be used by non-IOMMU_API users
3config IOMMU_IOVA
4 tristate
5
Jean-Philippe Bruckerfa834332019-10-02 12:42:41 -07006# The IOASID library may also be used by non-IOMMU_API users
7config IOASID
8 tristate
9
Ohad Ben-Cohenab493a02011-06-02 02:48:05 +030010# IOMMU_API always gets selected by whoever wants it.
11config IOMMU_API
12 bool
Ohad Ben-Cohenb10f1272011-06-02 03:20:08 +030013
Joerg Roedel68255b62011-06-14 15:51:54 +020014menuconfig IOMMU_SUPPORT
15 bool "IOMMU Hardware Support"
Arnd Bergmanne5144c92015-01-28 15:45:53 +010016 depends on MMU
Joerg Roedel68255b62011-06-14 15:51:54 +020017 default y
Masahiro Yamadaa7f7f622020-06-14 01:50:22 +090018 help
Joerg Roedel68255b62011-06-14 15:51:54 +020019 Say Y here if you want to compile device drivers for IO Memory
20 Management Units into the kernel. These devices usually allow to
21 remap DMA requests and/or remap interrupts from other devices on the
22 system.
23
24if IOMMU_SUPPORT
25
Will Deaconfdb1d7b2014-11-14 17:16:49 +000026menu "Generic IOMMU Pagetable Support"
27
28# Selected by the actual pagetable implementations
29config IOMMU_IO_PGTABLE
30 bool
31
Will Deacone1d3c0f2014-11-14 17:18:23 +000032config IOMMU_IO_PGTABLE_LPAE
33 bool "ARMv7/v8 Long Descriptor Format"
34 select IOMMU_IO_PGTABLE
Geert Uytterhoeven48e6f76522018-04-17 19:49:09 +020035 depends on ARM || ARM64 || (COMPILE_TEST && !GENERIC_ATOMIC64)
Will Deacone1d3c0f2014-11-14 17:18:23 +000036 help
37 Enable support for the ARM long descriptor pagetable format.
38 This allocator supports 4K/2M/1G, 16K/32M and 64K/512M page
39 sizes at both stage-1 and stage-2, as well as address spaces
40 up to 48-bits in size.
41
Will Deaconfe4b9912014-11-17 23:31:12 +000042config IOMMU_IO_PGTABLE_LPAE_SELFTEST
43 bool "LPAE selftests"
44 depends on IOMMU_IO_PGTABLE_LPAE
45 help
46 Enable self-tests for LPAE page table allocator. This performs
47 a series of page-table consistency checks during boot.
48
49 If unsure, say N here.
50
Robin Murphye5fc9752016-01-26 17:13:13 +000051config IOMMU_IO_PGTABLE_ARMV7S
52 bool "ARMv7/v8 Short Descriptor Format"
53 select IOMMU_IO_PGTABLE
Geert Uytterhoeven48e6f76522018-04-17 19:49:09 +020054 depends on ARM || ARM64 || COMPILE_TEST
Robin Murphye5fc9752016-01-26 17:13:13 +000055 help
56 Enable support for the ARM Short-descriptor pagetable format.
57 This supports 32-bit virtual and physical addresses mapped using
58 2-level tables with 4KB pages/1MB sections, and contiguous entries
59 for 64KB pages/16MB supersections if indicated by the IOMMU driver.
60
61config IOMMU_IO_PGTABLE_ARMV7S_SELFTEST
62 bool "ARMv7s selftests"
63 depends on IOMMU_IO_PGTABLE_ARMV7S
64 help
65 Enable self-tests for ARMv7s page table allocator. This performs
66 a series of page-table consistency checks during boot.
67
68 If unsure, say N here.
69
Will Deaconfdb1d7b2014-11-14 17:16:49 +000070endmenu
71
Gary R Hookbad614b2018-06-12 16:41:21 -050072config IOMMU_DEBUGFS
73 bool "Export IOMMU internals in DebugFS"
74 depends on DEBUG_FS
75 help
76 Allows exposure of IOMMU device internals. This option enables
77 the use of debugfs by IOMMU drivers as required. Devices can,
78 at initialization time, cause the IOMMU code to create a top-level
79 debug/iommu directory, and then populate a subdirectory with
80 entries as required.
81
Zhen Lei712d8f22021-07-12 19:12:17 +080082choice
Robin Murphye96763e2021-08-11 13:21:37 +010083 prompt "IOMMU default domain type"
Olof Johansson58d11312018-07-20 11:02:23 -070084 depends on IOMMU_API
Robin Murphy8cc63312021-09-08 13:55:37 +010085 default IOMMU_DEFAULT_DMA_LAZY if X86 || IA64
Robin Murphye96763e2021-08-11 13:21:37 +010086 default IOMMU_DEFAULT_DMA_STRICT
Krzysztof Kozlowskid0432342019-11-21 04:19:30 +010087 help
Robin Murphye96763e2021-08-11 13:21:37 +010088 Choose the type of IOMMU domain used to manage DMA API usage by
89 device drivers. The options here typically represent different
90 levels of tradeoff between robustness/security and performance,
91 depending on the IOMMU driver. Not all IOMMUs support all options.
92 This choice can be overridden at boot via the command line, and for
93 some devices also at runtime via sysfs.
Olof Johansson58d11312018-07-20 11:02:23 -070094
Zhen Lei712d8f22021-07-12 19:12:17 +080095 If unsure, keep the default.
96
Robin Murphye96763e2021-08-11 13:21:37 +010097config IOMMU_DEFAULT_DMA_STRICT
98 bool "Translated - Strict"
Zhen Lei712d8f22021-07-12 19:12:17 +080099 help
Robin Murphye96763e2021-08-11 13:21:37 +0100100 Trusted devices use translation to restrict their access to only
101 DMA-mapped pages, with strict TLB invalidation on unmap. Equivalent
102 to passing "iommu.passthrough=0 iommu.strict=1" on the command line.
Zhen Lei712d8f22021-07-12 19:12:17 +0800103
Robin Murphye96763e2021-08-11 13:21:37 +0100104 Untrusted devices always use this mode, with an additional layer of
105 bounce-buffering such that they cannot gain access to any unrelated
106 data within a mapped page.
107
108config IOMMU_DEFAULT_DMA_LAZY
109 bool "Translated - Lazy"
Zhen Lei712d8f22021-07-12 19:12:17 +0800110 help
Robin Murphye96763e2021-08-11 13:21:37 +0100111 Trusted devices use translation to restrict their access to only
112 DMA-mapped pages, but with "lazy" batched TLB invalidation. This
113 mode allows higher performance with some IOMMUs due to reduced TLB
114 flushing, but at the cost of reduced isolation since devices may be
115 able to access memory for some time after it has been unmapped.
116 Equivalent to passing "iommu.passthrough=0 iommu.strict=0" on the
117 command line.
Zhen Lei712d8f22021-07-12 19:12:17 +0800118
Robin Murphye96763e2021-08-11 13:21:37 +0100119 If this mode is not supported by the IOMMU driver, the effective
120 runtime default will fall back to IOMMU_DEFAULT_DMA_STRICT.
121
122config IOMMU_DEFAULT_PASSTHROUGH
123 bool "Passthrough"
124 help
125 Trusted devices are identity-mapped, giving them unrestricted access
126 to memory with minimal performance overhead. Equivalent to passing
127 "iommu.passthrough=1" (historically "iommu=pt") on the command line.
128
129 If this mode is not supported by the IOMMU driver, the effective
130 runtime default will fall back to IOMMU_DEFAULT_DMA_STRICT.
Zhen Lei712d8f22021-07-12 19:12:17 +0800131
132endchoice
Olof Johansson58d11312018-07-20 11:02:23 -0700133
Hiroshi Doyu4e0ee782012-06-25 14:23:54 +0300134config OF_IOMMU
Krzysztof Kozlowskid0432342019-11-21 04:19:30 +0100135 def_bool y
136 depends on OF && IOMMU_API
Hiroshi Doyu4e0ee782012-06-25 14:23:54 +0300137
Robin Murphy0db2e5d2015-10-01 20:13:58 +0100138# IOMMU-agnostic DMA-mapping layer
139config IOMMU_DMA
140 bool
Christoph Hellwig2f9237d2020-07-08 09:30:00 +0200141 select DMA_OPS
Robin Murphy0db2e5d2015-10-01 20:13:58 +0100142 select IOMMU_API
143 select IOMMU_IOVA
Julien Grallece6e6f2019-05-01 14:58:19 +0100144 select IRQ_MSI_IOMMU
Robin Murphy59a68eb2016-02-29 11:13:39 +0000145 select NEED_SG_DMA_LENGTH
Robin Murphy0db2e5d2015-10-01 20:13:58 +0100146
Jean-Philippe Bruckercfc78df2020-11-06 16:50:48 +0100147# Shared Virtual Addressing library
148config IOMMU_SVA_LIB
149 bool
150 select IOASID
151
Varun Sethi695093e2013-07-15 10:20:57 +0530152config FSL_PAMU
153 bool "Freescale IOMMU support"
Joerg Roedela4d98fb2017-08-09 15:00:36 +0200154 depends on PCI
Joerg Roedelaf29d9f2017-08-09 15:04:47 +0200155 depends on PHYS_64BIT
Andy Fleminga0d284d2016-03-16 23:15:44 -0500156 depends on PPC_E500MC || (COMPILE_TEST && PPC)
Varun Sethi695093e2013-07-15 10:20:57 +0530157 select IOMMU_API
158 select GENERIC_ALLOCATOR
159 help
160 Freescale PAMU support. PAMU is the IOMMU present on Freescale QorIQ platforms.
161 PAMU can authorize memory access, remap the memory address, and remap I/O
162 transaction types.
163
Ohad Ben-Cohenb10f1272011-06-02 03:20:08 +0300164# MSM IOMMU support
165config MSM_IOMMU
166 bool "MSM IOMMU Support"
Joerg Roedel477ab7a2015-01-20 16:13:33 +0100167 depends on ARM
168 depends on ARCH_MSM8X60 || ARCH_MSM8960 || COMPILE_TEST
Ohad Ben-Cohenb10f1272011-06-02 03:20:08 +0300169 select IOMMU_API
Sricharan Rc9220fb2016-06-13 17:06:06 +0530170 select IOMMU_IO_PGTABLE_ARMV7S
Ohad Ben-Cohenb10f1272011-06-02 03:20:08 +0300171 help
172 Support for the IOMMUs found on certain Qualcomm SOCs.
173 These IOMMUs allow virtualization of the address space used by most
174 cores within the multimedia subsystem.
175
176 If unsure, say N here.
177
Jerry Snitselaarcbe94c6e2020-06-30 13:06:36 -0700178source "drivers/iommu/amd/Kconfig"
Jerry Snitselaarab65ba52020-06-30 13:06:35 -0700179source "drivers/iommu/intel/Kconfig"
Lu Baolu04618252020-01-02 08:18:02 +0800180
Suresh Siddhad3f13812011-08-23 17:05:25 -0700181config IRQ_REMAP
Kees Cooka446e212013-01-16 18:53:39 -0800182 bool "Support for Interrupt Remapping"
183 depends on X86_64 && X86_IO_APIC && PCI_MSI && ACPI
Suresh Siddhad3f13812011-08-23 17:05:25 -0700184 select DMAR_TABLE
Masahiro Yamadaa7f7f622020-06-14 01:50:22 +0900185 help
Ohad Ben-Cohen166e9272011-06-10 21:42:27 +0300186 Supports Interrupt remapping for IO-APIC and MSI devices.
187 To use x2apic mode in the CPU's which support x2APIC enhancements or
188 to support platforms with CPU's having > 8 bit APIC ID, say Y.
Joerg Roedel68255b62011-06-14 15:51:54 +0200189
Ohad Ben-Cohenfcf3a6e2011-08-15 23:21:41 +0300190# OMAP IOMMU support
191config OMAP_IOMMU
192 bool "OMAP IOMMU Support"
Joerg Roedel477ab7a2015-01-20 16:13:33 +0100193 depends on ARCH_OMAP2PLUS || COMPILE_TEST
Ohad Ben-Cohenfcf3a6e2011-08-15 23:21:41 +0300194 select IOMMU_API
Masahiro Yamadaa7f7f622020-06-14 01:50:22 +0900195 help
Gerd Hoffmann06b718c2014-11-11 09:17:00 +0100196 The OMAP3 media platform drivers depend on iommu support,
197 if you need them say Y here.
Ohad Ben-Cohenfcf3a6e2011-08-15 23:21:41 +0300198
Ohad Ben-Cohenfcf3a6e2011-08-15 23:21:41 +0300199config OMAP_IOMMU_DEBUG
Suman Anna61c75352014-10-22 17:22:30 -0500200 bool "Export OMAP IOMMU internals in DebugFS"
201 depends on OMAP_IOMMU && DEBUG_FS
Masahiro Yamadaa7f7f622020-06-14 01:50:22 +0900202 help
Suman Anna61c75352014-10-22 17:22:30 -0500203 Select this to see extensive information about
204 the internal state of OMAP IOMMU in debugfs.
Ohad Ben-Cohenfcf3a6e2011-08-15 23:21:41 +0300205
Suman Anna61c75352014-10-22 17:22:30 -0500206 Say N unless you know you need this.
Ohad Ben-Cohenfcf3a6e2011-08-15 23:21:41 +0300207
Daniel Kurtzc68a2922014-11-03 10:53:27 +0800208config ROCKCHIP_IOMMU
209 bool "Rockchip IOMMU Support"
Joerg Roedel11175882014-11-03 18:16:56 +0100210 depends on ARCH_ROCKCHIP || COMPILE_TEST
Daniel Kurtzc68a2922014-11-03 10:53:27 +0800211 select IOMMU_API
212 select ARM_DMA_USE_IOMMU
213 help
214 Support for IOMMUs found on Rockchip rk32xx SOCs.
215 These IOMMUs allow virtualization of the address space used by most
216 cores within the multimedia subsystem.
217 Say Y here if you are using a Rockchip SoC that includes an IOMMU
218 device.
Ohad Ben-Cohenab493a02011-06-02 02:48:05 +0300219
Maxime Ripard4100b8c2020-05-13 16:07:22 +0200220config SUN50I_IOMMU
221 bool "Allwinner H6 IOMMU Support"
Geert Uytterhoevenc7451e42020-06-29 14:11:46 +0200222 depends on HAS_DMA
Maxime Ripard4100b8c2020-05-13 16:07:22 +0200223 depends on ARCH_SUNXI || COMPILE_TEST
224 select ARM_DMA_USE_IOMMU
225 select IOMMU_API
Maxime Ripard4100b8c2020-05-13 16:07:22 +0200226 help
227 Support for the IOMMU introduced in the Allwinner H6 SoCs.
228
Hiroshi DOYUd53e54b2011-11-16 17:36:37 +0200229config TEGRA_IOMMU_GART
230 bool "Tegra GART IOMMU Support"
231 depends on ARCH_TEGRA_2x_SOC
Dmitry Osipenkoce2785a2018-12-12 23:38:56 +0300232 depends on TEGRA_MC
Hiroshi DOYUd53e54b2011-11-16 17:36:37 +0200233 select IOMMU_API
234 help
235 Enables support for remapping discontiguous physical memory
236 shared with the operating system into contiguous I/O virtual
237 space through the GART (Graphics Address Relocation Table)
238 hardware included on Tegra SoCs.
239
Hiroshi DOYU7a31f6f2011-11-17 07:31:31 +0200240config TEGRA_IOMMU_SMMU
Thierry Reding89184652014-04-16 09:24:44 +0200241 bool "NVIDIA Tegra SMMU Support"
242 depends on ARCH_TEGRA
243 depends on TEGRA_AHB
244 depends on TEGRA_MC
Hiroshi DOYU7a31f6f2011-11-17 07:31:31 +0200245 select IOMMU_API
246 help
Thierry Reding89184652014-04-16 09:24:44 +0200247 This driver supports the IOMMU hardware (SMMU) found on NVIDIA Tegra
Thierry Reding588c43a2015-03-23 10:45:12 +0100248 SoCs (Tegra30 up to Tegra210).
Hiroshi DOYU7a31f6f2011-11-17 07:31:31 +0200249
KyongHo Cho2a965362012-05-12 05:56:09 +0900250config EXYNOS_IOMMU
251 bool "Exynos IOMMU Support"
Robin Murphyb4ceb4a2020-07-03 17:03:19 +0100252 depends on ARCH_EXYNOS || COMPILE_TEST
Arnd Bergmanndb3a7fd2017-07-28 15:19:19 +0200253 depends on !CPU_BIG_ENDIAN # revisit driver if we can enable big-endian ptes
KyongHo Cho2a965362012-05-12 05:56:09 +0900254 select IOMMU_API
Tushar Behera4802c1d2014-07-04 15:01:08 +0530255 select ARM_DMA_USE_IOMMU
KyongHo Cho2a965362012-05-12 05:56:09 +0900256 help
Sachin Kamat5455d702014-05-22 09:50:55 +0530257 Support for the IOMMU (System MMU) of Samsung Exynos application
258 processor family. This enables H/W multimedia accelerators to see
259 non-linear physical memory chunks as linear memory in their
260 address space.
KyongHo Cho2a965362012-05-12 05:56:09 +0900261
262 If unsure, say N here.
263
264config EXYNOS_IOMMU_DEBUG
265 bool "Debugging log for Exynos IOMMU"
266 depends on EXYNOS_IOMMU
267 help
268 Select this to see the detailed log message that shows what
Sachin Kamat5455d702014-05-22 09:50:55 +0530269 happens in the IOMMU driver.
KyongHo Cho2a965362012-05-12 05:56:09 +0900270
Sachin Kamat5455d702014-05-22 09:50:55 +0530271 Say N unless you need kernel log message for IOMMU debugging.
KyongHo Cho2a965362012-05-12 05:56:09 +0900272
Laurent Pinchartd25a2a12014-04-02 12:47:37 +0200273config IPMMU_VMSA
274 bool "Renesas VMSA-compatible IPMMU"
Guenter Roecka4aaecc2017-09-10 13:43:37 -0700275 depends on ARCH_RENESAS || (COMPILE_TEST && !GENERIC_ATOMIC64)
Laurent Pinchartd25a2a12014-04-02 12:47:37 +0200276 select IOMMU_API
Laurent Pinchartf20ed392015-01-20 18:30:04 +0200277 select IOMMU_IO_PGTABLE_LPAE
Laurent Pinchartd25a2a12014-04-02 12:47:37 +0200278 select ARM_DMA_USE_IOMMU
279 help
Geert Uytterhoeven15021d32018-07-25 15:10:29 +0200280 Support for the Renesas VMSA-compatible IPMMU found in the R-Mobile
Lad Prabhakard714aaa2020-09-11 11:19:12 +0100281 APE6, R-Car Gen{2,3} and RZ/G{1,2} SoCs.
Laurent Pinchartd25a2a12014-04-02 12:47:37 +0200282
283 If unsure, say N.
284
Alexey Kardashevskiy4e13c1a2013-05-21 13:33:09 +1000285config SPAPR_TCE_IOMMU
286 bool "sPAPR TCE IOMMU Support"
Krzysztof Kozlowski9dd124b2020-04-14 16:26:30 +0200287 depends on PPC_POWERNV || PPC_PSERIES
Alexey Kardashevskiy4e13c1a2013-05-21 13:33:09 +1000288 select IOMMU_API
289 help
290 Enables bits of IOMMU API required by VFIO. The iommu_ops
291 is not implemented as it is not necessary for VFIO.
292
Sven Peter46d1fb02021-08-03 14:16:51 +0200293config APPLE_DART
294 tristate "Apple DART IOMMU Support"
Geert Uytterhoevenfaf8e752021-08-10 15:47:19 +0200295 depends on ARCH_APPLE || (COMPILE_TEST && !GENERIC_ATOMIC64)
Sven Peter46d1fb02021-08-03 14:16:51 +0200296 select IOMMU_API
297 select IOMMU_IO_PGTABLE_LPAE
298 default ARCH_APPLE
299 help
300 Support for Apple DART (Device Address Resolution Table) IOMMUs
301 found in Apple ARM SoCs like the M1.
302 This IOMMU is required for most peripherals using DMA to access
303 the main memory.
304
305 Say Y here if you are using an Apple SoC.
306
Will Deacon48ec83b2015-05-27 17:25:59 +0100307# ARM IOMMU support
Will Deacon45ae7cf2013-06-24 18:31:25 +0100308config ARM_SMMU
Will Deaconcd221bd2019-12-19 12:03:51 +0000309 tristate "ARM Ltd. System MMU (SMMU) Support"
Robin Murphyb4ceb4a2020-07-03 17:03:19 +0100310 depends on ARM64 || ARM || (COMPILE_TEST && !GENERIC_ATOMIC64)
Will Deacon45ae7cf2013-06-24 18:31:25 +0100311 select IOMMU_API
Will Deacon518f7132014-11-14 17:17:54 +0000312 select IOMMU_IO_PGTABLE_LPAE
Will Deacon45ae7cf2013-06-24 18:31:25 +0100313 select ARM_DMA_USE_IOMMU if ARM
314 help
315 Support for implementations of the ARM System MMU architecture
Will Deacon518f7132014-11-14 17:17:54 +0000316 versions 1 and 2.
Will Deacon45ae7cf2013-06-24 18:31:25 +0100317
318 Say Y here if your SoC includes an IOMMU device implementing
319 the ARM SMMU architecture.
320
Will Deaconcd221bd2019-12-19 12:03:51 +0000321config ARM_SMMU_LEGACY_DT_BINDINGS
322 bool "Support the legacy \"mmu-masters\" devicetree bindings"
323 depends on ARM_SMMU=y && OF
324 help
325 Support for the badly designed and deprecated "mmu-masters"
326 devicetree bindings. This allows some DMA masters to attach
327 to the SMMU but does not provide any support via the DMA API.
328 If you're lucky, you might be able to get VFIO up and running.
329
330 If you say Y here then you'll make me very sad. Instead, say N
331 and move your firmware to the utopian future that was 2016.
332
Douglas Anderson954a03b2019-03-01 11:20:17 -0800333config ARM_SMMU_DISABLE_BYPASS_BY_DEFAULT
334 bool "Default to disabling bypass on ARM SMMU v1 and v2"
335 depends on ARM_SMMU
336 default y
337 help
338 Say Y here to (by default) disable bypass streams such that
339 incoming transactions from devices that are not attached to
340 an iommu domain will report an abort back to the device and
341 will not be allowed to pass through the SMMU.
342
343 Any old kernels that existed before this KConfig was
344 introduced would default to _allowing_ bypass (AKA the
345 equivalent of NO for this config). However the default for
346 this option is YES because the old behavior is insecure.
347
348 There are few reasons to allow unmatched stream bypass, and
349 even fewer good ones. If saying YES here breaks your board
350 you should work on fixing your board. This KConfig option
351 is expected to be removed in the future and we'll simply
352 hardcode the bypass disable in the code.
353
354 NOTE: the kernel command line parameter
355 'arm-smmu.disable_bypass' will continue to override this
356 config.
357
Arnd Bergmann0f0f80d2021-10-10 19:27:03 +0200358config ARM_SMMU_QCOM
359 def_tristate y
360 depends on ARM_SMMU && ARCH_QCOM
361 select QCOM_SCM
362 help
363 When running on a Qualcomm platform that has the custom variant
364 of the ARM SMMU, this needs to be built into the SMMU driver.
365
Will Deacon48ec83b2015-05-27 17:25:59 +0100366config ARM_SMMU_V3
Will Deacon2852ad02019-12-19 12:03:49 +0000367 tristate "ARM Ltd. System MMU Version 3 (SMMUv3) Support"
Robin Murphy08d4ca22016-09-12 17:13:46 +0100368 depends on ARM64
Will Deacon48ec83b2015-05-27 17:25:59 +0100369 select IOMMU_API
370 select IOMMU_IO_PGTABLE_LPAE
Marc Zyngier166bdbd2015-10-13 18:32:30 +0100371 select GENERIC_MSI_IRQ_DOMAIN
Will Deacon48ec83b2015-05-27 17:25:59 +0100372 help
373 Support for implementations of the ARM System MMU architecture
374 version 3 providing translation support to a PCIe root complex.
375
376 Say Y here if your system includes an IOMMU device implementing
377 the ARM SMMUv3 architecture.
378
Jean-Philippe Brucker3f1ce8e2020-09-18 12:18:48 +0200379config ARM_SMMU_V3_SVA
380 bool "Shared Virtual Addressing support for the ARM SMMUv3"
381 depends on ARM_SMMU_V3
Jean-Philippe Brucker32784a92020-11-06 16:50:49 +0100382 select IOMMU_SVA_LIB
383 select MMU_NOTIFIER
Jean-Philippe Brucker3f1ce8e2020-09-18 12:18:48 +0200384 help
385 Support for sharing process address spaces with devices using the
386 SMMUv3.
387
388 Say Y here if your system supports SVA extensions such as PCIe PASID
389 and PRI.
390
Gerald Schaefer8128f23c2015-08-27 15:33:03 +0200391config S390_IOMMU
392 def_bool y if S390 && PCI
393 depends on S390 && PCI
394 select IOMMU_API
395 help
396 Support for the IOMMU API for s390 PCI devices.
397
Dong Jia Shi63f19342017-03-17 04:17:31 +0100398config S390_CCW_IOMMU
399 bool "S390 CCW IOMMU Support"
Krzysztof Kozlowskie93a1692020-03-03 21:27:51 +0100400 depends on S390 && CCW || COMPILE_TEST
Dong Jia Shi63f19342017-03-17 04:17:31 +0100401 select IOMMU_API
402 help
403 Enables bits of IOMMU API required by VFIO. The iommu_ops
404 is not implemented as it is not necessary for VFIO.
405
Tony Krowiak1fde5732018-09-25 19:16:19 -0400406config S390_AP_IOMMU
407 bool "S390 AP IOMMU Support"
Krzysztof Kozlowskie93a1692020-03-03 21:27:51 +0100408 depends on S390 && ZCRYPT || COMPILE_TEST
Tony Krowiak1fde5732018-09-25 19:16:19 -0400409 select IOMMU_API
410 help
411 Enables bits of IOMMU API required by VFIO. The iommu_ops
412 is not implemented as it is not necessary for VFIO.
413
Yong Wu0df4fab2016-02-23 01:20:50 +0800414config MTK_IOMMU
Yong Wu18d8c742021-03-26 11:23:37 +0800415 tristate "MediaTek IOMMU Support"
Yong Wu0df4fab2016-02-23 01:20:50 +0800416 depends on ARCH_MEDIATEK || COMPILE_TEST
Arnd Bergmann19288322016-02-29 10:19:06 +0100417 select ARM_DMA_USE_IOMMU
Yong Wu0df4fab2016-02-23 01:20:50 +0800418 select IOMMU_API
Yong Wu0df4fab2016-02-23 01:20:50 +0800419 select IOMMU_IO_PGTABLE_ARMV7S
420 select MEMORY
421 select MTK_SMI
422 help
423 Support for the M4U on certain Mediatek SOCs. M4U is MultiMedia
424 Memory Management Unit. This option enables remapping of DMA memory
425 accesses for the multimedia subsystem.
426
427 If unsure, say N here.
428
Honghui Zhangb17336c2016-06-08 17:51:00 +0800429config MTK_IOMMU_V1
Yong Wu8de000c2021-03-26 11:23:36 +0800430 tristate "MediaTek IOMMU Version 1 (M4U gen1) Support"
Honghui Zhangb17336c2016-06-08 17:51:00 +0800431 depends on ARM
432 depends on ARCH_MEDIATEK || COMPILE_TEST
433 select ARM_DMA_USE_IOMMU
434 select IOMMU_API
435 select MEMORY
436 select MTK_SMI
Honghui Zhangb17336c2016-06-08 17:51:00 +0800437 help
438 Support for the M4U on certain Mediatek SoCs. M4U generation 1 HW is
439 Multimedia Memory Managememt Unit. This option enables remapping of
440 DMA memory accesses for the multimedia subsystem.
441
442 if unsure, say N here.
443
Rob Clark0ae349a2017-08-09 10:43:04 -0400444config QCOM_IOMMU
445 # Note: iommu drivers cannot (yet?) be built as modules
446 bool "Qualcomm IOMMU Support"
Guenter Roecka4aaecc2017-09-10 13:43:37 -0700447 depends on ARCH_QCOM || (COMPILE_TEST && !GENERIC_ATOMIC64)
Arnd Bergmann424953c2021-09-28 09:50:27 +0200448 select QCOM_SCM
Rob Clark0ae349a2017-08-09 10:43:04 -0400449 select IOMMU_API
450 select IOMMU_IO_PGTABLE_LPAE
451 select ARM_DMA_USE_IOMMU
452 help
453 Support for IOMMU on certain Qualcomm SoCs.
454
Lan Tianyu29217a42019-02-27 22:54:04 +0800455config HYPERV_IOMMU
456 bool "Hyper-V x2APIC IRQ Handling"
Boqun Fengd7f0b2e2019-10-17 08:57:03 +0800457 depends on HYPERV && X86
Lan Tianyu29217a42019-02-27 22:54:04 +0800458 select IOMMU_API
459 default HYPERV
460 help
461 Stub IOMMU driver to handle IRQs as to allow Hyper-V Linux
462 guests to run with x2APIC mode enabled.
463
Jean-Philippe Bruckeredcd69a2019-01-15 12:19:57 +0000464config VIRTIO_IOMMU
Jean-Philippe Bruckerfa4afd72020-02-14 17:38:27 +0100465 tristate "Virtio IOMMU driver"
466 depends on VIRTIO
Jean-Philippe Brucker8ce4904b2021-06-18 17:21:00 +0200467 depends on (ARM64 || X86)
Jean-Philippe Bruckeredcd69a2019-01-15 12:19:57 +0000468 select IOMMU_API
Jean-Philippe Brucker8ce4904b2021-06-18 17:21:00 +0200469 select IOMMU_DMA
Jean-Philippe Bruckeredcd69a2019-01-15 12:19:57 +0000470 select INTERVAL_TREE
Jean-Philippe Brucker3cf48552021-06-18 17:20:58 +0200471 select ACPI_VIOT if ACPI
Jean-Philippe Bruckeredcd69a2019-01-15 12:19:57 +0000472 help
473 Para-virtualised IOMMU driver with virtio.
474
475 Say Y here if you intend to run this kernel as a guest.
476
Chunyan Zhangb23e4fc2021-03-05 17:32:16 +0800477config SPRD_IOMMU
478 tristate "Unisoc IOMMU Support"
479 depends on ARCH_SPRD || COMPILE_TEST
480 select IOMMU_API
481 help
482 Support for IOMMU on Unisoc's SoCs, this IOMMU can be used by
483 Unisoc's multimedia devices, such as display, Image codec(jpeg)
484 and a few signal processors, including VSP(video), GSP(graphic),
485 ISP(image), and CPP(camera pixel processor), etc.
486
487 Say Y here if you want to use the multimedia devices listed above.
488
Ohad Ben-Cohenab493a02011-06-02 02:48:05 +0300489endif # IOMMU_SUPPORT