xref: /linux/drivers/iommu/Kconfig (revision ef4144b1b47dba61ebf19b9567013afdba5225dd)
1ec8f24b7SThomas Gleixner# SPDX-License-Identifier: GPL-2.0-only
2bd3c2e66SSakari Ailus# The IOVA library may also be used by non-IOMMU_API users
3bd3c2e66SSakari Ailusconfig IOMMU_IOVA
4bd3c2e66SSakari Ailus	tristate
5bd3c2e66SSakari Ailus
6ab493a0fSOhad Ben-Cohen# IOMMU_API always gets selected by whoever wants it.
7ab493a0fSOhad Ben-Cohenconfig IOMMU_API
8ab493a0fSOhad Ben-Cohen	bool
9b10f127eSOhad Ben-Cohen
108c9c727bSJoao Martinsconfig IOMMUFD_DRIVER
118c9c727bSJoao Martins	bool
128c9c727bSJoao Martins	default n
138c9c727bSJoao Martins
1468255b62SJoerg Roedelmenuconfig IOMMU_SUPPORT
1568255b62SJoerg Roedel	bool "IOMMU Hardware Support"
16e5144c93SArnd Bergmann	depends on MMU
1768255b62SJoerg Roedel	default y
18a7f7f624SMasahiro Yamada	help
1968255b62SJoerg Roedel	  Say Y here if you want to compile device drivers for IO Memory
2068255b62SJoerg Roedel	  Management Units into the kernel. These devices usually allow to
2168255b62SJoerg Roedel	  remap DMA requests and/or remap interrupts from other devices on the
2268255b62SJoerg Roedel	  system.
2368255b62SJoerg Roedel
2468255b62SJoerg Roedelif IOMMU_SUPPORT
2568255b62SJoerg Roedel
26fdb1d7beSWill Deaconmenu "Generic IOMMU Pagetable Support"
27fdb1d7beSWill Deacon
28fdb1d7beSWill Deacon# Selected by the actual pagetable implementations
29fdb1d7beSWill Deaconconfig IOMMU_IO_PGTABLE
30fdb1d7beSWill Deacon	bool
31fdb1d7beSWill Deacon
32e1d3c0fdSWill Deaconconfig IOMMU_IO_PGTABLE_LPAE
33e1d3c0fdSWill Deacon	bool "ARMv7/v8 Long Descriptor Format"
34e1d3c0fdSWill Deacon	select IOMMU_IO_PGTABLE
35d286a58bSRobin Murphy	depends on ARM || ARM64 || COMPILE_TEST
361b0b5f50SGeert Uytterhoeven	depends on !GENERIC_ATOMIC64	# for cmpxchg64()
37e1d3c0fdSWill Deacon	help
38e1d3c0fdSWill Deacon	  Enable support for the ARM long descriptor pagetable format.
39e1d3c0fdSWill Deacon	  This allocator supports 4K/2M/1G, 16K/32M and 64K/512M page
40e1d3c0fdSWill Deacon	  sizes at both stage-1 and stage-2, as well as address spaces
41e1d3c0fdSWill Deacon	  up to 48-bits in size.
42e1d3c0fdSWill Deacon
43fe4b991dSWill Deaconconfig IOMMU_IO_PGTABLE_LPAE_SELFTEST
44fe4b991dSWill Deacon	bool "LPAE selftests"
45fe4b991dSWill Deacon	depends on IOMMU_IO_PGTABLE_LPAE
46fe4b991dSWill Deacon	help
47fe4b991dSWill Deacon	  Enable self-tests for LPAE page table allocator. This performs
48fe4b991dSWill Deacon	  a series of page-table consistency checks during boot.
49fe4b991dSWill Deacon
50fe4b991dSWill Deacon	  If unsure, say N here.
51fe4b991dSWill Deacon
52e5fc9753SRobin Murphyconfig IOMMU_IO_PGTABLE_ARMV7S
53e5fc9753SRobin Murphy	bool "ARMv7/v8 Short Descriptor Format"
54e5fc9753SRobin Murphy	select IOMMU_IO_PGTABLE
5548e6f765SGeert Uytterhoeven	depends on ARM || ARM64 || COMPILE_TEST
56e5fc9753SRobin Murphy	help
57e5fc9753SRobin Murphy	  Enable support for the ARM Short-descriptor pagetable format.
58e5fc9753SRobin Murphy	  This supports 32-bit virtual and physical addresses mapped using
59e5fc9753SRobin Murphy	  2-level tables with 4KB pages/1MB sections, and contiguous entries
60e5fc9753SRobin Murphy	  for 64KB pages/16MB supersections if indicated by the IOMMU driver.
61e5fc9753SRobin Murphy
62e5fc9753SRobin Murphyconfig IOMMU_IO_PGTABLE_ARMV7S_SELFTEST
63e5fc9753SRobin Murphy	bool "ARMv7s selftests"
64e5fc9753SRobin Murphy	depends on IOMMU_IO_PGTABLE_ARMV7S
65e5fc9753SRobin Murphy	help
66e5fc9753SRobin Murphy	  Enable self-tests for ARMv7s page table allocator. This performs
67e5fc9753SRobin Murphy	  a series of page-table consistency checks during boot.
68e5fc9753SRobin Murphy
69e5fc9753SRobin Murphy	  If unsure, say N here.
70e5fc9753SRobin Murphy
71745ef109SJanne Grunauconfig IOMMU_IO_PGTABLE_DART
72745ef109SJanne Grunau	bool "Apple DART Formats"
73745ef109SJanne Grunau	select IOMMU_IO_PGTABLE
74d286a58bSRobin Murphy	depends on ARM64 || COMPILE_TEST
751b0b5f50SGeert Uytterhoeven	depends on !GENERIC_ATOMIC64	# for cmpxchg64()
76745ef109SJanne Grunau	help
77745ef109SJanne Grunau	  Enable support for the Apple DART pagetable formats. These include
78745ef109SJanne Grunau	  the t8020 and t6000/t8110 DART formats used in Apple M1/M2 family
79745ef109SJanne Grunau	  SoCs.
80745ef109SJanne Grunau
81745ef109SJanne Grunau	  If unsure, say N here.
82745ef109SJanne Grunau
83fdb1d7beSWill Deaconendmenu
84fdb1d7beSWill Deacon
85bad614b2SGary R Hookconfig IOMMU_DEBUGFS
86bad614b2SGary R Hook	bool "Export IOMMU internals in DebugFS"
87bad614b2SGary R Hook	depends on DEBUG_FS
88bad614b2SGary R Hook	help
89bad614b2SGary R Hook	  Allows exposure of IOMMU device internals. This option enables
90bad614b2SGary R Hook	  the use of debugfs by IOMMU drivers as required. Devices can,
91bad614b2SGary R Hook	  at initialization time, cause the IOMMU code to create a top-level
92bad614b2SGary R Hook	  debug/iommu directory, and then populate a subdirectory with
93bad614b2SGary R Hook	  entries as required.
94bad614b2SGary R Hook
95712d8f20SZhen Leichoice
96e96763ecSRobin Murphy	prompt "IOMMU default domain type"
9758d11317SOlof Johansson	depends on IOMMU_API
984bbdb725SLinus Torvalds	default IOMMU_DEFAULT_DMA_LAZY if X86 || S390
99e96763ecSRobin Murphy	default IOMMU_DEFAULT_DMA_STRICT
10058d11317SOlof Johansson	help
101e96763ecSRobin Murphy	  Choose the type of IOMMU domain used to manage DMA API usage by
102e96763ecSRobin Murphy	  device drivers. The options here typically represent different
103e96763ecSRobin Murphy	  levels of tradeoff between robustness/security and performance,
104e96763ecSRobin Murphy	  depending on the IOMMU driver. Not all IOMMUs support all options.
105e96763ecSRobin Murphy	  This choice can be overridden at boot via the command line, and for
106e96763ecSRobin Murphy	  some devices also at runtime via sysfs.
10758d11317SOlof Johansson
108712d8f20SZhen Lei	  If unsure, keep the default.
109712d8f20SZhen Lei
110e96763ecSRobin Murphyconfig IOMMU_DEFAULT_DMA_STRICT
111e96763ecSRobin Murphy	bool "Translated - Strict"
112712d8f20SZhen Lei	help
113e96763ecSRobin Murphy	  Trusted devices use translation to restrict their access to only
114e96763ecSRobin Murphy	  DMA-mapped pages, with strict TLB invalidation on unmap. Equivalent
115e96763ecSRobin Murphy	  to passing "iommu.passthrough=0 iommu.strict=1" on the command line.
116712d8f20SZhen Lei
117e96763ecSRobin Murphy	  Untrusted devices always use this mode, with an additional layer of
118e96763ecSRobin Murphy	  bounce-buffering such that they cannot gain access to any unrelated
119e96763ecSRobin Murphy	  data within a mapped page.
120e96763ecSRobin Murphy
121e96763ecSRobin Murphyconfig IOMMU_DEFAULT_DMA_LAZY
122e96763ecSRobin Murphy	bool "Translated - Lazy"
123712d8f20SZhen Lei	help
124e96763ecSRobin Murphy	  Trusted devices use translation to restrict their access to only
125e96763ecSRobin Murphy	  DMA-mapped pages, but with "lazy" batched TLB invalidation. This
126e96763ecSRobin Murphy	  mode allows higher performance with some IOMMUs due to reduced TLB
127e96763ecSRobin Murphy	  flushing, but at the cost of reduced isolation since devices may be
128e96763ecSRobin Murphy	  able to access memory for some time after it has been unmapped.
129e96763ecSRobin Murphy	  Equivalent to passing "iommu.passthrough=0 iommu.strict=0" on the
130e96763ecSRobin Murphy	  command line.
131712d8f20SZhen Lei
132e96763ecSRobin Murphy	  If this mode is not supported by the IOMMU driver, the effective
133e96763ecSRobin Murphy	  runtime default will fall back to IOMMU_DEFAULT_DMA_STRICT.
134e96763ecSRobin Murphy
135e96763ecSRobin Murphyconfig IOMMU_DEFAULT_PASSTHROUGH
136e96763ecSRobin Murphy	bool "Passthrough"
137e96763ecSRobin Murphy	help
138e96763ecSRobin Murphy	  Trusted devices are identity-mapped, giving them unrestricted access
139e96763ecSRobin Murphy	  to memory with minimal performance overhead. Equivalent to passing
140e96763ecSRobin Murphy	  "iommu.passthrough=1" (historically "iommu=pt") on the command line.
141e96763ecSRobin Murphy
142e96763ecSRobin Murphy	  If this mode is not supported by the IOMMU driver, the effective
143e96763ecSRobin Murphy	  runtime default will fall back to IOMMU_DEFAULT_DMA_STRICT.
144712d8f20SZhen Lei
145712d8f20SZhen Leiendchoice
14658d11317SOlof Johansson
1474e0ee78fSHiroshi Doyuconfig OF_IOMMU
1484e0ee78fSHiroshi Doyu	def_bool y
1497eba1d51SWill Deacon	depends on OF && IOMMU_API
1504e0ee78fSHiroshi Doyu
1510db2e5d1SRobin Murphy# IOMMU-agnostic DMA-mapping layer
1520db2e5d1SRobin Murphyconfig IOMMU_DMA
1534bbdb725SLinus Torvalds	def_bool ARM64 || X86 || S390
154b5c58b2fSLeon Romanovsky	select DMA_OPS_HELPERS
1550db2e5d1SRobin Murphy	select IOMMU_API
1560db2e5d1SRobin Murphy	select IOMMU_IOVA
157ece6e6f0SJulien Grall	select IRQ_MSI_IOMMU
15859a68eb8SRobin Murphy	select NEED_SG_DMA_LENGTH
159861370f4SCatalin Marinas	select NEED_SG_DMA_FLAGS if SWIOTLB
1600db2e5d1SRobin Murphy
1617ba56472SFenghua Yu# Shared Virtual Addressing
1627ba56472SFenghua Yuconfig IOMMU_SVA
1638f23f5dbSJason Gunthorpe	select IOMMU_MM_DATA
164cfc78dfdSJean-Philippe Brucker	bool
165cfc78dfdSJean-Philippe Brucker
16617c51a0eSLu Baoluconfig IOMMU_IOPF
16717c51a0eSLu Baolu	bool
16817c51a0eSLu Baolu
169695093e3SVarun Sethiconfig FSL_PAMU
170695093e3SVarun Sethi	bool "Freescale IOMMU support"
171a4d98fb3SJoerg Roedel	depends on PCI
172af29d9faSJoerg Roedel	depends on PHYS_64BIT
173a0d284d2SAndy Fleming	depends on PPC_E500MC || (COMPILE_TEST && PPC)
174695093e3SVarun Sethi	select IOMMU_API
175695093e3SVarun Sethi	select GENERIC_ALLOCATOR
176695093e3SVarun Sethi	help
177695093e3SVarun Sethi	  Freescale PAMU support. PAMU is the IOMMU present on Freescale QorIQ platforms.
178695093e3SVarun Sethi	  PAMU can authorize memory access, remap the memory address, and remap I/O
179695093e3SVarun Sethi	  transaction types.
180695093e3SVarun Sethi
181b10f127eSOhad Ben-Cohen# MSM IOMMU support
182b10f127eSOhad Ben-Cohenconfig MSM_IOMMU
183b10f127eSOhad Ben-Cohen	bool "MSM IOMMU Support"
184477ab7a1SJoerg Roedel	depends on ARM
18518368ee2SDmitry Baryshkov	depends on ARCH_QCOM || COMPILE_TEST
186b10f127eSOhad Ben-Cohen	select IOMMU_API
187c9220fbdSSricharan R	select IOMMU_IO_PGTABLE_ARMV7S
188b10f127eSOhad Ben-Cohen	help
189b10f127eSOhad Ben-Cohen	  Support for the IOMMUs found on certain Qualcomm SOCs.
190b10f127eSOhad Ben-Cohen	  These IOMMUs allow virtualization of the address space used by most
191b10f127eSOhad Ben-Cohen	  cores within the multimedia subsystem.
192b10f127eSOhad Ben-Cohen
193b10f127eSOhad Ben-Cohen	  If unsure, say N here.
194b10f127eSOhad Ben-Cohen
195cbe94c6eSJerry Snitselaarsource "drivers/iommu/amd/Kconfig"
196ab65ba57SJerry Snitselaarsource "drivers/iommu/intel/Kconfig"
1972ff4bed7SJason Gunthorpesource "drivers/iommu/iommufd/Kconfig"
1985c0ebbd3STomasz Jeznachsource "drivers/iommu/riscv/Kconfig"
19904618252SLu Baolu
200d3f13810SSuresh Siddhaconfig IRQ_REMAP
201a446e219SKees Cook	bool "Support for Interrupt Remapping"
202a446e219SKees Cook	depends on X86_64 && X86_IO_APIC && PCI_MSI && ACPI
20370bad345SBert Karwatzki	select DMAR_TABLE if INTEL_IOMMU
204a7f7f624SMasahiro Yamada	help
205166e9278SOhad Ben-Cohen	  Supports Interrupt remapping for IO-APIC and MSI devices.
206166e9278SOhad Ben-Cohen	  To use x2apic mode in the CPU's which support x2APIC enhancements or
207166e9278SOhad Ben-Cohen	  to support platforms with CPU's having > 8 bit APIC ID, say Y.
20868255b62SJoerg Roedel
209fcf3a6efSOhad Ben-Cohen# OMAP IOMMU support
210fcf3a6efSOhad Ben-Cohenconfig OMAP_IOMMU
211fcf3a6efSOhad Ben-Cohen	bool "OMAP IOMMU Support"
212477ab7a1SJoerg Roedel	depends on ARCH_OMAP2PLUS || COMPILE_TEST
213fcf3a6efSOhad Ben-Cohen	select IOMMU_API
214a7f7f624SMasahiro Yamada	help
21506b718c0SGerd Hoffmann	  The OMAP3 media platform drivers depend on iommu support,
21606b718c0SGerd Hoffmann	  if you need them say Y here.
217fcf3a6efSOhad Ben-Cohen
218fcf3a6efSOhad Ben-Cohenconfig OMAP_IOMMU_DEBUG
21961c75352SSuman Anna	bool "Export OMAP IOMMU internals in DebugFS"
220baaa7b5dSLaurent Pinchart	depends on OMAP_IOMMU && DEBUG_FS
221a7f7f624SMasahiro Yamada	help
222fcf3a6efSOhad Ben-Cohen	  Select this to see extensive information about
223baaa7b5dSLaurent Pinchart	  the internal state of OMAP IOMMU in debugfs.
224fcf3a6efSOhad Ben-Cohen
225fcf3a6efSOhad Ben-Cohen	  Say N unless you know you need this.
226fcf3a6efSOhad Ben-Cohen
227c68a2921SDaniel Kurtzconfig ROCKCHIP_IOMMU
228c68a2921SDaniel Kurtz	bool "Rockchip IOMMU Support"
22911175886SJoerg Roedel	depends on ARCH_ROCKCHIP || COMPILE_TEST
230c68a2921SDaniel Kurtz	select IOMMU_API
231c68a2921SDaniel Kurtz	select ARM_DMA_USE_IOMMU
232c68a2921SDaniel Kurtz	help
233c68a2921SDaniel Kurtz	  Support for IOMMUs found on Rockchip rk32xx SOCs.
234c68a2921SDaniel Kurtz	  These IOMMUs allow virtualization of the address space used by most
235c68a2921SDaniel Kurtz	  cores within the multimedia subsystem.
236c68a2921SDaniel Kurtz	  Say Y here if you are using a Rockchip SoC that includes an IOMMU
237c68a2921SDaniel Kurtz	  device.
238c68a2921SDaniel Kurtz
2394100b8c2SMaxime Ripardconfig SUN50I_IOMMU
2404100b8c2SMaxime Ripard	bool "Allwinner H6 IOMMU Support"
241c7451e49SGeert Uytterhoeven	depends on HAS_DMA
2424100b8c2SMaxime Ripard	depends on ARCH_SUNXI || COMPILE_TEST
2434100b8c2SMaxime Ripard	select ARM_DMA_USE_IOMMU
2444100b8c2SMaxime Ripard	select IOMMU_API
2454100b8c2SMaxime Ripard	help
2464100b8c2SMaxime Ripard	  Support for the IOMMU introduced in the Allwinner H6 SoCs.
2474100b8c2SMaxime Ripard
2487a31f6f4SHiroshi DOYUconfig TEGRA_IOMMU_SMMU
24989184651SThierry Reding	bool "NVIDIA Tegra SMMU Support"
25089184651SThierry Reding	depends on ARCH_TEGRA
25189184651SThierry Reding	depends on TEGRA_AHB
25289184651SThierry Reding	depends on TEGRA_MC
2537a31f6f4SHiroshi DOYU	select IOMMU_API
2547a31f6f4SHiroshi DOYU	help
25589184651SThierry Reding	  This driver supports the IOMMU hardware (SMMU) found on NVIDIA Tegra
256588c43a7SThierry Reding	  SoCs (Tegra30 up to Tegra210).
2577a31f6f4SHiroshi DOYU
2582a96536eSKyongHo Choconfig EXYNOS_IOMMU
2592a96536eSKyongHo Cho	bool "Exynos IOMMU Support"
260b4ceb4a5SRobin Murphy	depends on ARCH_EXYNOS || COMPILE_TEST
261db3a7fd7SArnd Bergmann	depends on !CPU_BIG_ENDIAN # revisit driver if we can enable big-endian ptes
2622a96536eSKyongHo Cho	select IOMMU_API
2634802c1d0STushar Behera	select ARM_DMA_USE_IOMMU
2642a96536eSKyongHo Cho	help
2652a96536eSKyongHo Cho	  Support for the IOMMU (System MMU) of Samsung Exynos application
2665455d700SSachin Kamat	  processor family. This enables H/W multimedia accelerators to see
2675455d700SSachin Kamat	  non-linear physical memory chunks as linear memory in their
2685455d700SSachin Kamat	  address space.
2692a96536eSKyongHo Cho
2702a96536eSKyongHo Cho	  If unsure, say N here.
2712a96536eSKyongHo Cho
2722a96536eSKyongHo Choconfig EXYNOS_IOMMU_DEBUG
2732a96536eSKyongHo Cho	bool "Debugging log for Exynos IOMMU"
2742a96536eSKyongHo Cho	depends on EXYNOS_IOMMU
2752a96536eSKyongHo Cho	help
2762a96536eSKyongHo Cho	  Select this to see the detailed log message that shows what
2775455d700SSachin Kamat	  happens in the IOMMU driver.
2782a96536eSKyongHo Cho
2795455d700SSachin Kamat	  Say N unless you need kernel log message for IOMMU debugging.
2802a96536eSKyongHo Cho
281d25a2a16SLaurent Pinchartconfig IPMMU_VMSA
282d25a2a16SLaurent Pinchart	bool "Renesas VMSA-compatible IPMMU"
283d286a58bSRobin Murphy	depends on ARCH_RENESAS || COMPILE_TEST
284e332003bSRandy Dunlap	depends on ARM || ARM64 || COMPILE_TEST
285d286a58bSRobin Murphy	depends on !GENERIC_ATOMIC64	# for IOMMU_IO_PGTABLE_LPAE
286d25a2a16SLaurent Pinchart	select IOMMU_API
287f20ed39fSLaurent Pinchart	select IOMMU_IO_PGTABLE_LPAE
288d25a2a16SLaurent Pinchart	select ARM_DMA_USE_IOMMU
289d25a2a16SLaurent Pinchart	help
29015021d36SGeert Uytterhoeven	  Support for the Renesas VMSA-compatible IPMMU found in the R-Mobile
291d714aaa7SLad Prabhakar	  APE6, R-Car Gen{2,3} and RZ/G{1,2} SoCs.
292d25a2a16SLaurent Pinchart
293d25a2a16SLaurent Pinchart	  If unsure, say N.
294d25a2a16SLaurent Pinchart
2954e13c1acSAlexey Kardashevskiyconfig SPAPR_TCE_IOMMU
2964e13c1acSAlexey Kardashevskiy	bool "sPAPR TCE IOMMU Support"
2979dd124b6SKrzysztof Kozlowski	depends on PPC_POWERNV || PPC_PSERIES
2984e13c1acSAlexey Kardashevskiy	select IOMMU_API
2994e13c1acSAlexey Kardashevskiy	help
3004e13c1acSAlexey Kardashevskiy	  Enables bits of IOMMU API required by VFIO. The iommu_ops
3014e13c1acSAlexey Kardashevskiy	  is not implemented as it is not necessary for VFIO.
3024e13c1acSAlexey Kardashevskiy
30346d1fb07SSven Peterconfig APPLE_DART
30446d1fb07SSven Peter	tristate "Apple DART IOMMU Support"
305d286a58bSRobin Murphy	depends on ARCH_APPLE || COMPILE_TEST
306d286a58bSRobin Murphy	depends on !GENERIC_ATOMIC64	# for IOMMU_IO_PGTABLE_DART
30746d1fb07SSven Peter	select IOMMU_API
308745ef109SJanne Grunau	select IOMMU_IO_PGTABLE_DART
30946d1fb07SSven Peter	default ARCH_APPLE
31046d1fb07SSven Peter	help
31146d1fb07SSven Peter	  Support for Apple DART (Device Address Resolution Table) IOMMUs
31246d1fb07SSven Peter	  found in Apple ARM SoCs like the M1.
31346d1fb07SSven Peter	  This IOMMU is required for most peripherals using DMA to access
31446d1fb07SSven Peter	  the main memory.
31546d1fb07SSven Peter
31646d1fb07SSven Peter	  Say Y here if you are using an Apple SoC.
31746d1fb07SSven Peter
31848ec83bcSWill Deacon# ARM IOMMU support
31945ae7cffSWill Deaconconfig ARM_SMMU
320cd221bd2SWill Deacon	tristate "ARM Ltd. System MMU (SMMU) Support"
321d286a58bSRobin Murphy	depends on ARM64 || ARM || COMPILE_TEST
322d286a58bSRobin Murphy	depends on !GENERIC_ATOMIC64	# for IOMMU_IO_PGTABLE_LPAE
32345ae7cffSWill Deacon	select IOMMU_API
324518f7136SWill Deacon	select IOMMU_IO_PGTABLE_LPAE
32545ae7cffSWill Deacon	select ARM_DMA_USE_IOMMU if ARM
32645ae7cffSWill Deacon	help
32745ae7cffSWill Deacon	  Support for implementations of the ARM System MMU architecture
328518f7136SWill Deacon	  versions 1 and 2.
32945ae7cffSWill Deacon
33045ae7cffSWill Deacon	  Say Y here if your SoC includes an IOMMU device implementing
33145ae7cffSWill Deacon	  the ARM SMMU architecture.
33245ae7cffSWill Deacon
333cd221bd2SWill Deaconconfig ARM_SMMU_LEGACY_DT_BINDINGS
334cd221bd2SWill Deacon	bool "Support the legacy \"mmu-masters\" devicetree bindings"
335cd221bd2SWill Deacon	depends on ARM_SMMU=y && OF
336cd221bd2SWill Deacon	help
337cd221bd2SWill Deacon	  Support for the badly designed and deprecated "mmu-masters"
338cd221bd2SWill Deacon	  devicetree bindings. This allows some DMA masters to attach
339cd221bd2SWill Deacon	  to the SMMU but does not provide any support via the DMA API.
340cd221bd2SWill Deacon	  If you're lucky, you might be able to get VFIO up and running.
341cd221bd2SWill Deacon
342cd221bd2SWill Deacon	  If you say Y here then you'll make me very sad. Instead, say N
343cd221bd2SWill Deacon	  and move your firmware to the utopian future that was 2016.
344cd221bd2SWill Deacon
345954a03beSDouglas Andersonconfig ARM_SMMU_DISABLE_BYPASS_BY_DEFAULT
346954a03beSDouglas Anderson	bool "Default to disabling bypass on ARM SMMU v1 and v2"
347954a03beSDouglas Anderson	depends on ARM_SMMU
348954a03beSDouglas Anderson	default y
349954a03beSDouglas Anderson	help
350954a03beSDouglas Anderson	  Say Y here to (by default) disable bypass streams such that
351954a03beSDouglas Anderson	  incoming transactions from devices that are not attached to
352954a03beSDouglas Anderson	  an iommu domain will report an abort back to the device and
353954a03beSDouglas Anderson	  will not be allowed to pass through the SMMU.
354954a03beSDouglas Anderson
355954a03beSDouglas Anderson	  Any old kernels that existed before this KConfig was
356954a03beSDouglas Anderson	  introduced would default to _allowing_ bypass (AKA the
357954a03beSDouglas Anderson	  equivalent of NO for this config).  However the default for
358954a03beSDouglas Anderson	  this option is YES because the old behavior is insecure.
359954a03beSDouglas Anderson
360954a03beSDouglas Anderson	  There are few reasons to allow unmatched stream bypass, and
361954a03beSDouglas Anderson	  even fewer good ones.  If saying YES here breaks your board
362954a03beSDouglas Anderson	  you should work on fixing your board.  This KConfig option
363954a03beSDouglas Anderson	  is expected to be removed in the future and we'll simply
364954a03beSDouglas Anderson	  hardcode the bypass disable in the code.
365954a03beSDouglas Anderson
366954a03beSDouglas Anderson	  NOTE: the kernel command line parameter
367954a03beSDouglas Anderson	  'arm-smmu.disable_bypass' will continue to override this
368954a03beSDouglas Anderson	  config.
369954a03beSDouglas Anderson
370*ef4144b1SBibek Kumar Patroconfig ARM_SMMU_MMU_500_CPRE_ERRATA
371*ef4144b1SBibek Kumar Patro	bool "Enable errata workaround for CPRE in SMMU reset path"
372*ef4144b1SBibek Kumar Patro	depends on ARM_SMMU
373*ef4144b1SBibek Kumar Patro	default y
374*ef4144b1SBibek Kumar Patro	help
375*ef4144b1SBibek Kumar Patro	  Say Y here (by default) to apply workaround to disable
376*ef4144b1SBibek Kumar Patro	  MMU-500's next-page prefetcher for sake of 4 known errata.
377*ef4144b1SBibek Kumar Patro
378*ef4144b1SBibek Kumar Patro	  Say N here only when it is sure that any errata related to
379*ef4144b1SBibek Kumar Patro	  prefetch enablement are not applicable on the platform.
380*ef4144b1SBibek Kumar Patro	  Refer silicon-errata.rst for info on errata IDs.
381*ef4144b1SBibek Kumar Patro
3820f0f80d9SArnd Bergmannconfig ARM_SMMU_QCOM
3830f0f80d9SArnd Bergmann	def_tristate y
3840f0f80d9SArnd Bergmann	depends on ARM_SMMU && ARCH_QCOM
3850f0f80d9SArnd Bergmann	select QCOM_SCM
3860f0f80d9SArnd Bergmann	help
3870f0f80d9SArnd Bergmann	  When running on a Qualcomm platform that has the custom variant
3880f0f80d9SArnd Bergmann	  of the ARM SMMU, this needs to be built into the SMMU driver.
3890f0f80d9SArnd Bergmann
390b9b721d1SSai Prakash Ranjanconfig ARM_SMMU_QCOM_DEBUG
391b9b721d1SSai Prakash Ranjan	bool "ARM SMMU QCOM implementation defined debug support"
3920928fc15SWill Deacon	depends on ARM_SMMU_QCOM=y
393b9b721d1SSai Prakash Ranjan	help
394b9b721d1SSai Prakash Ranjan	  Support for implementation specific debug features in ARM SMMU
395414ecb03SGeorgi Djakov	  hardware found in QTI platforms. This include support for
396414ecb03SGeorgi Djakov	  the Translation Buffer Units (TBU) that can be used to obtain
397414ecb03SGeorgi Djakov	  additional information when debugging memory management issues
398414ecb03SGeorgi Djakov	  like context faults.
399b9b721d1SSai Prakash Ranjan
400414ecb03SGeorgi Djakov	  Say Y here to enable debug for issues such as context faults
401414ecb03SGeorgi Djakov	  or TLB sync timeouts which requires implementation defined
402414ecb03SGeorgi Djakov	  register dumps.
403b9b721d1SSai Prakash Ranjan
40448ec83bcSWill Deaconconfig ARM_SMMU_V3
4052852ad05SWill Deacon	tristate "ARM Ltd. System MMU Version 3 (SMMUv3) Support"
40608d4ca2aSRobin Murphy	depends on ARM64
40748ec83bcSWill Deacon	select IOMMU_API
40848ec83bcSWill Deacon	select IOMMU_IO_PGTABLE_LPAE
40913e7accbSThomas Gleixner	select GENERIC_MSI_IRQ
41025c776ddSKunkun Jiang	select IOMMUFD_DRIVER if IOMMUFD
41148ec83bcSWill Deacon	help
41248ec83bcSWill Deacon	  Support for implementations of the ARM System MMU architecture
41348ec83bcSWill Deacon	  version 3 providing translation support to a PCIe root complex.
41448ec83bcSWill Deacon
41548ec83bcSWill Deacon	  Say Y here if your system includes an IOMMU device implementing
41648ec83bcSWill Deacon	  the ARM SMMUv3 architecture.
41748ec83bcSWill Deacon
41856e1a4ccSJason Gunthorpeif ARM_SMMU_V3
4193f1ce8e8SJean-Philippe Bruckerconfig ARM_SMMU_V3_SVA
4203f1ce8e8SJean-Philippe Brucker	bool "Shared Virtual Addressing support for the ARM SMMUv3"
4217ba56472SFenghua Yu	select IOMMU_SVA
42217c51a0eSLu Baolu	select IOMMU_IOPF
42332784a95SJean-Philippe Brucker	select MMU_NOTIFIER
4243f1ce8e8SJean-Philippe Brucker	help
4253f1ce8e8SJean-Philippe Brucker	  Support for sharing process address spaces with devices using the
4263f1ce8e8SJean-Philippe Brucker	  SMMUv3.
4273f1ce8e8SJean-Philippe Brucker
4283f1ce8e8SJean-Philippe Brucker	  Say Y here if your system supports SVA extensions such as PCIe PASID
4293f1ce8e8SJean-Philippe Brucker	  and PRI.
4303f1ce8e8SJean-Philippe Brucker
4316912ec91SNicolin Chenconfig ARM_SMMU_V3_IOMMUFD
4326912ec91SNicolin Chen	bool "Enable IOMMUFD features for ARM SMMUv3 (EXPERIMENTAL)"
4336912ec91SNicolin Chen	depends on IOMMUFD
4346912ec91SNicolin Chen	help
4356912ec91SNicolin Chen	  Support for IOMMUFD features intended to support virtual machines
4366912ec91SNicolin Chen	  with accelerated virtual IOMMUs.
4376912ec91SNicolin Chen
4386912ec91SNicolin Chen	  Say Y here if you are doing development and testing on this feature.
4396912ec91SNicolin Chen
44056e1a4ccSJason Gunthorpeconfig ARM_SMMU_V3_KUNIT_TEST
441da55da5aSJason Gunthorpe	tristate "KUnit tests for arm-smmu-v3 driver"  if !KUNIT_ALL_TESTS
44256e1a4ccSJason Gunthorpe	depends on KUNIT
44356e1a4ccSJason Gunthorpe	depends on ARM_SMMU_V3_SVA
44456e1a4ccSJason Gunthorpe	default KUNIT_ALL_TESTS
44556e1a4ccSJason Gunthorpe	help
44656e1a4ccSJason Gunthorpe	  Enable this option to unit-test arm-smmu-v3 driver functions.
44756e1a4ccSJason Gunthorpe
44856e1a4ccSJason Gunthorpe	  If unsure, say N.
449918eb5c8SNate Watterson
450918eb5c8SNate Wattersonconfig TEGRA241_CMDQV
451918eb5c8SNate Watterson	bool "NVIDIA Tegra241 CMDQ-V extension support for ARM SMMUv3"
452918eb5c8SNate Watterson	depends on ACPI
453918eb5c8SNate Watterson	help
454918eb5c8SNate Watterson	  Support for NVIDIA CMDQ-Virtualization extension for ARM SMMUv3. The
455918eb5c8SNate Watterson	  CMDQ-V extension is similar to v3.3 ECMDQ for multi command queues
456918eb5c8SNate Watterson	  support, except with virtualization capabilities.
457918eb5c8SNate Watterson
458918eb5c8SNate Watterson	  Say Y here if your system is NVIDIA Tegra241 (Grace) or it has the same
459918eb5c8SNate Watterson	  CMDQ-V extension.
46056e1a4ccSJason Gunthorpeendif
46156e1a4ccSJason Gunthorpe
4628128f23cSGerald Schaeferconfig S390_IOMMU
4638128f23cSGerald Schaefer	def_bool y if S390 && PCI
4648128f23cSGerald Schaefer	depends on S390 && PCI
4658128f23cSGerald Schaefer	select IOMMU_API
4668128f23cSGerald Schaefer	help
4678128f23cSGerald Schaefer	  Support for the IOMMU API for s390 PCI devices.
4688128f23cSGerald Schaefer
4690df4fabeSYong Wuconfig MTK_IOMMU
47018d8c74eSYong Wu	tristate "MediaTek IOMMU Support"
4710df4fabeSYong Wu	depends on ARCH_MEDIATEK || COMPILE_TEST
4721928832fSArnd Bergmann	select ARM_DMA_USE_IOMMU
4730df4fabeSYong Wu	select IOMMU_API
4740df4fabeSYong Wu	select IOMMU_IO_PGTABLE_ARMV7S
4750df4fabeSYong Wu	select MEMORY
4760df4fabeSYong Wu	select MTK_SMI
4770df4fabeSYong Wu	help
4780df4fabeSYong Wu	  Support for the M4U on certain Mediatek SOCs. M4U is MultiMedia
4790df4fabeSYong Wu	  Memory Management Unit. This option enables remapping of DMA memory
4800df4fabeSYong Wu	  accesses for the multimedia subsystem.
4810df4fabeSYong Wu
4820df4fabeSYong Wu	  If unsure, say N here.
4830df4fabeSYong Wu
484b17336c5SHonghui Zhangconfig MTK_IOMMU_V1
4858de000cfSYong Wu	tristate "MediaTek IOMMU Version 1 (M4U gen1) Support"
486b17336c5SHonghui Zhang	depends on ARM
487b17336c5SHonghui Zhang	depends on ARCH_MEDIATEK || COMPILE_TEST
488b17336c5SHonghui Zhang	select ARM_DMA_USE_IOMMU
489b17336c5SHonghui Zhang	select IOMMU_API
490b17336c5SHonghui Zhang	select MEMORY
491b17336c5SHonghui Zhang	select MTK_SMI
492b17336c5SHonghui Zhang	help
493b17336c5SHonghui Zhang	  Support for the M4U on certain Mediatek SoCs. M4U generation 1 HW is
494b17336c5SHonghui Zhang	  Multimedia Memory Managememt Unit. This option enables remapping of
495b17336c5SHonghui Zhang	  DMA memory accesses for the multimedia subsystem.
496b17336c5SHonghui Zhang
497b17336c5SHonghui Zhang	  if unsure, say N here.
498b17336c5SHonghui Zhang
4990ae349a0SRob Clarkconfig QCOM_IOMMU
5000ae349a0SRob Clark	# Note: iommu drivers cannot (yet?) be built as modules
5010ae349a0SRob Clark	bool "Qualcomm IOMMU Support"
502d286a58bSRobin Murphy	depends on ARCH_QCOM || COMPILE_TEST
503d286a58bSRobin Murphy	depends on !GENERIC_ATOMIC64	# for IOMMU_IO_PGTABLE_LPAE
504424953cfSArnd Bergmann	select QCOM_SCM
5050ae349a0SRob Clark	select IOMMU_API
5060ae349a0SRob Clark	select IOMMU_IO_PGTABLE_LPAE
5070ae349a0SRob Clark	select ARM_DMA_USE_IOMMU
5080ae349a0SRob Clark	help
5090ae349a0SRob Clark	  Support for IOMMU on certain Qualcomm SoCs.
5100ae349a0SRob Clark
51129217a47SLan Tianyuconfig HYPERV_IOMMU
512fea858dcSNuno Das Neves	bool "Hyper-V IRQ Handling"
513d7f0b2e4SBoqun Feng	depends on HYPERV && X86
51429217a47SLan Tianyu	select IOMMU_API
51529217a47SLan Tianyu	default HYPERV
51629217a47SLan Tianyu	help
517fea858dcSNuno Das Neves	  Stub IOMMU driver to handle IRQs to support Hyper-V Linux
518fea858dcSNuno Das Neves	  guest and root partitions.
51929217a47SLan Tianyu
520edcd69abSJean-Philippe Bruckerconfig VIRTIO_IOMMU
521fa4afd78SJean-Philippe Brucker	tristate "Virtio IOMMU driver"
522fa4afd78SJean-Philippe Brucker	depends on VIRTIO
5238ce4904bSJean-Philippe Brucker	depends on (ARM64 || X86)
524edcd69abSJean-Philippe Brucker	select IOMMU_API
525edcd69abSJean-Philippe Brucker	select INTERVAL_TREE
5263cf48554SJean-Philippe Brucker	select ACPI_VIOT if ACPI
527edcd69abSJean-Philippe Brucker	help
528edcd69abSJean-Philippe Brucker	  Para-virtualised IOMMU driver with virtio.
529edcd69abSJean-Philippe Brucker
530edcd69abSJean-Philippe Brucker	  Say Y here if you intend to run this kernel as a guest.
531edcd69abSJean-Philippe Brucker
532b23e4fc4SChunyan Zhangconfig SPRD_IOMMU
533b23e4fc4SChunyan Zhang	tristate "Unisoc IOMMU Support"
534b23e4fc4SChunyan Zhang	depends on ARCH_SPRD || COMPILE_TEST
535b23e4fc4SChunyan Zhang	select IOMMU_API
536b23e4fc4SChunyan Zhang	help
537b23e4fc4SChunyan Zhang	  Support for IOMMU on Unisoc's SoCs, this IOMMU can be used by
538b23e4fc4SChunyan Zhang	  Unisoc's multimedia devices, such as display, Image codec(jpeg)
539b23e4fc4SChunyan Zhang	  and a few signal processors, including VSP(video), GSP(graphic),
540b23e4fc4SChunyan Zhang	  ISP(image), and CPP(camera pixel processor), etc.
541b23e4fc4SChunyan Zhang
542b23e4fc4SChunyan Zhang	  Say Y here if you want to use the multimedia devices listed above.
543b23e4fc4SChunyan Zhang
54468255b62SJoerg Roedelendif # IOMMU_SUPPORT
545