xref: /openbmc/linux/drivers/iommu/Kconfig (revision e93a1695)
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
6fa83433cSJean-Philippe Brucker# The IOASID library may also be used by non-IOMMU_API users
7fa83433cSJean-Philippe Bruckerconfig IOASID
8fa83433cSJean-Philippe Brucker	tristate
9fa83433cSJean-Philippe Brucker
10ab493a0fSOhad Ben-Cohen# IOMMU_API always gets selected by whoever wants it.
11ab493a0fSOhad Ben-Cohenconfig IOMMU_API
12ab493a0fSOhad Ben-Cohen	bool
13b10f127eSOhad Ben-Cohen
1468255b62SJoerg Roedelmenuconfig IOMMU_SUPPORT
1568255b62SJoerg Roedel	bool "IOMMU Hardware Support"
16e5144c93SArnd Bergmann	depends on MMU
1768255b62SJoerg Roedel	default y
1868255b62SJoerg Roedel	---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
3548e6f765SGeert Uytterhoeven	depends on ARM || ARM64 || (COMPILE_TEST && !GENERIC_ATOMIC64)
36e1d3c0fdSWill Deacon	help
37e1d3c0fdSWill Deacon	  Enable support for the ARM long descriptor pagetable format.
38e1d3c0fdSWill Deacon	  This allocator supports 4K/2M/1G, 16K/32M and 64K/512M page
39e1d3c0fdSWill Deacon	  sizes at both stage-1 and stage-2, as well as address spaces
40e1d3c0fdSWill Deacon	  up to 48-bits in size.
41e1d3c0fdSWill Deacon
42fe4b991dSWill Deaconconfig IOMMU_IO_PGTABLE_LPAE_SELFTEST
43fe4b991dSWill Deacon	bool "LPAE selftests"
44fe4b991dSWill Deacon	depends on IOMMU_IO_PGTABLE_LPAE
45fe4b991dSWill Deacon	help
46fe4b991dSWill Deacon	  Enable self-tests for LPAE page table allocator. This performs
47fe4b991dSWill Deacon	  a series of page-table consistency checks during boot.
48fe4b991dSWill Deacon
49fe4b991dSWill Deacon	  If unsure, say N here.
50fe4b991dSWill Deacon
51e5fc9753SRobin Murphyconfig IOMMU_IO_PGTABLE_ARMV7S
52e5fc9753SRobin Murphy	bool "ARMv7/v8 Short Descriptor Format"
53e5fc9753SRobin Murphy	select IOMMU_IO_PGTABLE
5448e6f765SGeert Uytterhoeven	depends on ARM || ARM64 || COMPILE_TEST
55e5fc9753SRobin Murphy	help
56e5fc9753SRobin Murphy	  Enable support for the ARM Short-descriptor pagetable format.
57e5fc9753SRobin Murphy	  This supports 32-bit virtual and physical addresses mapped using
58e5fc9753SRobin Murphy	  2-level tables with 4KB pages/1MB sections, and contiguous entries
59e5fc9753SRobin Murphy	  for 64KB pages/16MB supersections if indicated by the IOMMU driver.
60e5fc9753SRobin Murphy
61e5fc9753SRobin Murphyconfig IOMMU_IO_PGTABLE_ARMV7S_SELFTEST
62e5fc9753SRobin Murphy	bool "ARMv7s selftests"
63e5fc9753SRobin Murphy	depends on IOMMU_IO_PGTABLE_ARMV7S
64e5fc9753SRobin Murphy	help
65e5fc9753SRobin Murphy	  Enable self-tests for ARMv7s page table allocator. This performs
66e5fc9753SRobin Murphy	  a series of page-table consistency checks during boot.
67e5fc9753SRobin Murphy
68e5fc9753SRobin Murphy	  If unsure, say N here.
69e5fc9753SRobin Murphy
70fdb1d7beSWill Deaconendmenu
71fdb1d7beSWill Deacon
72bad614b2SGary R Hookconfig IOMMU_DEBUGFS
73bad614b2SGary R Hook	bool "Export IOMMU internals in DebugFS"
74bad614b2SGary R Hook	depends on DEBUG_FS
75bad614b2SGary R Hook	help
76bad614b2SGary R Hook	  Allows exposure of IOMMU device internals. This option enables
77bad614b2SGary R Hook	  the use of debugfs by IOMMU drivers as required. Devices can,
78bad614b2SGary R Hook	  at initialization time, cause the IOMMU code to create a top-level
79bad614b2SGary R Hook	  debug/iommu directory, and then populate a subdirectory with
80bad614b2SGary R Hook	  entries as required.
81bad614b2SGary R Hook
8258d11317SOlof Johanssonconfig IOMMU_DEFAULT_PASSTHROUGH
8358d11317SOlof Johansson	bool "IOMMU passthrough by default"
8458d11317SOlof Johansson	depends on IOMMU_API
8558d11317SOlof Johansson	help
8658d11317SOlof Johansson	  Enable passthrough by default, removing the need to pass in
8758d11317SOlof Johansson	  iommu.passthrough=on or iommu=pt through command line. If this
8858d11317SOlof Johansson	  is enabled, you can still disable with iommu.passthrough=off
8958d11317SOlof Johansson	  or iommu=nopt depending on the architecture.
9058d11317SOlof Johansson
9158d11317SOlof Johansson	  If unsure, say N here.
9258d11317SOlof Johansson
934e0ee78fSHiroshi Doyuconfig OF_IOMMU
944e0ee78fSHiroshi Doyu	def_bool y
957eba1d51SWill Deacon	depends on OF && IOMMU_API
964e0ee78fSHiroshi Doyu
970db2e5d1SRobin Murphy# IOMMU-agnostic DMA-mapping layer
980db2e5d1SRobin Murphyconfig IOMMU_DMA
990db2e5d1SRobin Murphy	bool
1000db2e5d1SRobin Murphy	select IOMMU_API
1010db2e5d1SRobin Murphy	select IOMMU_IOVA
102ece6e6f0SJulien Grall	select IRQ_MSI_IOMMU
10359a68eb8SRobin Murphy	select NEED_SG_DMA_LENGTH
1040db2e5d1SRobin Murphy
105695093e3SVarun Sethiconfig FSL_PAMU
106695093e3SVarun Sethi	bool "Freescale IOMMU support"
107a4d98fb3SJoerg Roedel	depends on PCI
108af29d9faSJoerg Roedel	depends on PHYS_64BIT
109a0d284d2SAndy Fleming	depends on PPC_E500MC || (COMPILE_TEST && PPC)
110695093e3SVarun Sethi	select IOMMU_API
111695093e3SVarun Sethi	select GENERIC_ALLOCATOR
112695093e3SVarun Sethi	help
113695093e3SVarun Sethi	  Freescale PAMU support. PAMU is the IOMMU present on Freescale QorIQ platforms.
114695093e3SVarun Sethi	  PAMU can authorize memory access, remap the memory address, and remap I/O
115695093e3SVarun Sethi	  transaction types.
116695093e3SVarun Sethi
117b10f127eSOhad Ben-Cohen# MSM IOMMU support
118b10f127eSOhad Ben-Cohenconfig MSM_IOMMU
119b10f127eSOhad Ben-Cohen	bool "MSM IOMMU Support"
120477ab7a1SJoerg Roedel	depends on ARM
121477ab7a1SJoerg Roedel	depends on ARCH_MSM8X60 || ARCH_MSM8960 || COMPILE_TEST
122b10f127eSOhad Ben-Cohen	select IOMMU_API
123c9220fbdSSricharan R	select IOMMU_IO_PGTABLE_ARMV7S
124b10f127eSOhad Ben-Cohen	help
125b10f127eSOhad Ben-Cohen	  Support for the IOMMUs found on certain Qualcomm SOCs.
126b10f127eSOhad Ben-Cohen	  These IOMMUs allow virtualization of the address space used by most
127b10f127eSOhad Ben-Cohen	  cores within the multimedia subsystem.
128b10f127eSOhad Ben-Cohen
129b10f127eSOhad Ben-Cohen	  If unsure, say N here.
130b10f127eSOhad Ben-Cohen
131b10f127eSOhad Ben-Cohenconfig IOMMU_PGTABLES_L2
132b10f127eSOhad Ben-Cohen	def_bool y
133b10f127eSOhad Ben-Cohen	depends on MSM_IOMMU && MMU && SMP && CPU_DCACHE_DISABLE=n
13429b68415SOhad Ben-Cohen
13529b68415SOhad Ben-Cohen# AMD IOMMU support
13629b68415SOhad Ben-Cohenconfig AMD_IOMMU
13729b68415SOhad Ben-Cohen	bool "AMD IOMMU support"
13829b68415SOhad Ben-Cohen	select SWIOTLB
13929b68415SOhad Ben-Cohen	select PCI_MSI
14052815b75SJoerg Roedel	select PCI_ATS
14152815b75SJoerg Roedel	select PCI_PRI
14252815b75SJoerg Roedel	select PCI_PASID
14329b68415SOhad Ben-Cohen	select IOMMU_API
144a72c4225SJoerg Roedel	select IOMMU_IOVA
145be62dbf5STom Murphy	select IOMMU_DMA
1460dbc6078SThomas Petazzoni	depends on X86_64 && PCI && ACPI
14729b68415SOhad Ben-Cohen	---help---
14829b68415SOhad Ben-Cohen	  With this option you can enable support for AMD IOMMU hardware in
14929b68415SOhad Ben-Cohen	  your system. An IOMMU is a hardware component which provides
15029b68415SOhad Ben-Cohen	  remapping of DMA memory accesses from devices. With an AMD IOMMU you
15159bf8964SMasanari Iida	  can isolate the DMA memory of different devices and protect the
15229b68415SOhad Ben-Cohen	  system from misbehaving device drivers or hardware.
15329b68415SOhad Ben-Cohen
15429b68415SOhad Ben-Cohen	  You can find out if your system has an AMD IOMMU if you look into
15529b68415SOhad Ben-Cohen	  your BIOS for an option to enable it or if you have an IVRS ACPI
15629b68415SOhad Ben-Cohen	  table.
15729b68415SOhad Ben-Cohen
158e3c495c7SJoerg Roedelconfig AMD_IOMMU_V2
159a446e219SKees Cook	tristate "AMD IOMMU Version 2 driver"
160e5cac32cSBorislav Petkov	depends on AMD_IOMMU
1618736b2c3SJoerg Roedel	select MMU_NOTIFIER
162e3c495c7SJoerg Roedel	---help---
163e3c495c7SJoerg Roedel	  This option enables support for the AMD IOMMUv2 features of the IOMMU
164e3c495c7SJoerg Roedel	  hardware. Select this option if you want to use devices that support
16559bf8964SMasanari Iida	  the PCI PRI and PASID interface.
166e3c495c7SJoerg Roedel
1677d0f5fd3SGary R Hookconfig AMD_IOMMU_DEBUGFS
1687d0f5fd3SGary R Hook	bool "Enable AMD IOMMU internals in DebugFS"
1697d0f5fd3SGary R Hook	depends on AMD_IOMMU && IOMMU_DEBUGFS
1707d0f5fd3SGary R Hook	---help---
1717d0f5fd3SGary R Hook	  !!!WARNING!!!  !!!WARNING!!!  !!!WARNING!!!  !!!WARNING!!!
1727d0f5fd3SGary R Hook
1737d0f5fd3SGary R Hook	  DO NOT ENABLE THIS OPTION UNLESS YOU REALLY, -REALLY- KNOW WHAT YOU ARE DOING!!!
1747d0f5fd3SGary R Hook	  Exposes AMD IOMMU device internals in DebugFS.
1757d0f5fd3SGary R Hook
1767d0f5fd3SGary R Hook	  This option is -NOT- intended for production environments, and should
1777d0f5fd3SGary R Hook	  not generally be enabled.
1787d0f5fd3SGary R Hook
179166e9278SOhad Ben-Cohen# Intel IOMMU support
180d3f13810SSuresh Siddhaconfig DMAR_TABLE
181d3f13810SSuresh Siddha	bool
182d3f13810SSuresh Siddha
183d3f13810SSuresh Siddhaconfig INTEL_IOMMU
184d3f13810SSuresh Siddha	bool "Support for Intel IOMMU using DMA Remapping Devices"
185df41017eSChristoph Hellwig	depends on PCI_MSI && ACPI && (X86 || IA64)
186166e9278SOhad Ben-Cohen	select IOMMU_API
187114150d8SRobin Murphy	select IOMMU_IOVA
188f616ab59SChristoph Hellwig	select NEED_DMA_MAP_STATE
189d3f13810SSuresh Siddha	select DMAR_TABLE
190c5a5dc4cSLu Baolu	select SWIOTLB
191166e9278SOhad Ben-Cohen	help
192166e9278SOhad Ben-Cohen	  DMA remapping (DMAR) devices support enables independent address
193166e9278SOhad Ben-Cohen	  translations for Direct Memory Access (DMA) from devices.
194166e9278SOhad Ben-Cohen	  These DMA remapping devices are reported via ACPI tables
195166e9278SOhad Ben-Cohen	  and include PCI device scope covered by these DMA
196166e9278SOhad Ben-Cohen	  remapping devices.
197166e9278SOhad Ben-Cohen
198ee2636b8SSohil Mehtaconfig INTEL_IOMMU_DEBUGFS
199ee2636b8SSohil Mehta	bool "Export Intel IOMMU internals in Debugfs"
200ee2636b8SSohil Mehta	depends on INTEL_IOMMU && IOMMU_DEBUGFS
201ee2636b8SSohil Mehta	help
202ee2636b8SSohil Mehta	  !!!WARNING!!!
203ee2636b8SSohil Mehta
204ee2636b8SSohil Mehta	  DO NOT ENABLE THIS OPTION UNLESS YOU REALLY KNOW WHAT YOU ARE DOING!!!
205ee2636b8SSohil Mehta
206ee2636b8SSohil Mehta	  Expose Intel IOMMU internals in Debugfs.
207ee2636b8SSohil Mehta
208ee2636b8SSohil Mehta	  This option is -NOT- intended for production environments, and should
209ee2636b8SSohil Mehta	  only be enabled for debugging Intel IOMMU.
210ee2636b8SSohil Mehta
2118a94ade4SDavid Woodhouseconfig INTEL_IOMMU_SVM
2128a94ade4SDavid Woodhouse	bool "Support for Shared Virtual Memory with Intel IOMMU"
2138a94ade4SDavid Woodhouse	depends on INTEL_IOMMU && X86
214b16d0cb9SDavid Woodhouse	select PCI_PASID
215fd872843SBjorn Helgaas	select PCI_PRI
2162f26e0a9SDavid Woodhouse	select MMU_NOTIFIER
21759a62337SJacob Pan	select IOASID
2188a94ade4SDavid Woodhouse	help
2198a94ade4SDavid Woodhouse	  Shared Virtual Memory (SVM) provides a facility for devices
2208a94ade4SDavid Woodhouse	  to access DMA resources through process address space by
2218a94ade4SDavid Woodhouse	  means of a Process Address Space ID (PASID).
2228a94ade4SDavid Woodhouse
223d3f13810SSuresh Siddhaconfig INTEL_IOMMU_DEFAULT_ON
224166e9278SOhad Ben-Cohen	def_bool y
225d3f13810SSuresh Siddha	prompt "Enable Intel DMA Remapping Devices by default"
226d3f13810SSuresh Siddha	depends on INTEL_IOMMU
227166e9278SOhad Ben-Cohen	help
228166e9278SOhad Ben-Cohen	  Selecting this option will enable a DMAR device at boot time if
229166e9278SOhad Ben-Cohen	  one is found. If this option is not selected, DMAR support can
230166e9278SOhad Ben-Cohen	  be enabled by passing intel_iommu=on to the kernel.
231166e9278SOhad Ben-Cohen
232d3f13810SSuresh Siddhaconfig INTEL_IOMMU_BROKEN_GFX_WA
233166e9278SOhad Ben-Cohen	bool "Workaround broken graphics drivers (going away soon)"
234d3f13810SSuresh Siddha	depends on INTEL_IOMMU && BROKEN && X86
235166e9278SOhad Ben-Cohen	---help---
236166e9278SOhad Ben-Cohen	  Current Graphics drivers tend to use physical address
237166e9278SOhad Ben-Cohen	  for DMA and avoid using DMA APIs. Setting this config
238166e9278SOhad Ben-Cohen	  option permits the IOMMU driver to set a unity map for
239166e9278SOhad Ben-Cohen	  all the OS-visible memory. Hence the driver can continue
240166e9278SOhad Ben-Cohen	  to use physical addresses for DMA, at least until this
241166e9278SOhad Ben-Cohen	  option is removed in the 2.6.32 kernel.
242166e9278SOhad Ben-Cohen
243d3f13810SSuresh Siddhaconfig INTEL_IOMMU_FLOPPY_WA
244166e9278SOhad Ben-Cohen	def_bool y
245d3f13810SSuresh Siddha	depends on INTEL_IOMMU && X86
246166e9278SOhad Ben-Cohen	---help---
247166e9278SOhad Ben-Cohen	  Floppy disk drivers are known to bypass DMA API calls
248166e9278SOhad Ben-Cohen	  thereby failing to work when IOMMU is enabled. This
249166e9278SOhad Ben-Cohen	  workaround will setup a 1:1 mapping for the first
250166e9278SOhad Ben-Cohen	  16MiB to make floppy (an ISA device) work.
251166e9278SOhad Ben-Cohen
25204618252SLu Baoluconfig INTEL_IOMMU_SCALABLE_MODE_DEFAULT_ON
25304618252SLu Baolu	bool "Enable Intel IOMMU scalable mode by default"
25404618252SLu Baolu	depends on INTEL_IOMMU
25504618252SLu Baolu	help
25604618252SLu Baolu	  Selecting this option will enable by default the scalable mode if
25704618252SLu Baolu	  hardware presents the capability. The scalable mode is defined in
25804618252SLu Baolu	  VT-d 3.0. The scalable mode capability could be checked by reading
25904618252SLu Baolu	  /sys/devices/virtual/iommu/dmar*/intel-iommu/ecap. If this option
26004618252SLu Baolu	  is not selected, scalable mode support could also be enabled by
26104618252SLu Baolu	  passing intel_iommu=sm_on to the kernel. If not sure, please use
26204618252SLu Baolu	  the default value.
26304618252SLu Baolu
264d3f13810SSuresh Siddhaconfig IRQ_REMAP
265a446e219SKees Cook	bool "Support for Interrupt Remapping"
266a446e219SKees Cook	depends on X86_64 && X86_IO_APIC && PCI_MSI && ACPI
267d3f13810SSuresh Siddha	select DMAR_TABLE
268166e9278SOhad Ben-Cohen	---help---
269166e9278SOhad Ben-Cohen	  Supports Interrupt remapping for IO-APIC and MSI devices.
270166e9278SOhad Ben-Cohen	  To use x2apic mode in the CPU's which support x2APIC enhancements or
271166e9278SOhad Ben-Cohen	  to support platforms with CPU's having > 8 bit APIC ID, say Y.
27268255b62SJoerg Roedel
273fcf3a6efSOhad Ben-Cohen# OMAP IOMMU support
274fcf3a6efSOhad Ben-Cohenconfig OMAP_IOMMU
275fcf3a6efSOhad Ben-Cohen	bool "OMAP IOMMU Support"
276e93a1695SKrzysztof Kozlowski	depends on ARM && MMU || (COMPILE_TEST && (ARM || ARM64 || IA64 || SPARC))
277477ab7a1SJoerg Roedel	depends on ARCH_OMAP2PLUS || COMPILE_TEST
278fcf3a6efSOhad Ben-Cohen	select IOMMU_API
27906b718c0SGerd Hoffmann	---help---
28006b718c0SGerd Hoffmann	  The OMAP3 media platform drivers depend on iommu support,
28106b718c0SGerd Hoffmann	  if you need them say Y here.
282fcf3a6efSOhad Ben-Cohen
283fcf3a6efSOhad Ben-Cohenconfig OMAP_IOMMU_DEBUG
28461c75352SSuman Anna	bool "Export OMAP IOMMU internals in DebugFS"
285baaa7b5dSLaurent Pinchart	depends on OMAP_IOMMU && DEBUG_FS
28661c75352SSuman Anna	---help---
287fcf3a6efSOhad Ben-Cohen	  Select this to see extensive information about
288baaa7b5dSLaurent Pinchart	  the internal state of OMAP IOMMU in debugfs.
289fcf3a6efSOhad Ben-Cohen
290fcf3a6efSOhad Ben-Cohen	  Say N unless you know you need this.
291fcf3a6efSOhad Ben-Cohen
292c68a2921SDaniel Kurtzconfig ROCKCHIP_IOMMU
293c68a2921SDaniel Kurtz	bool "Rockchip IOMMU Support"
294e93a1695SKrzysztof Kozlowski	depends on ARM || ARM64 || (COMPILE_TEST && (ARM64 || IA64 || SPARC))
29511175886SJoerg Roedel	depends on ARCH_ROCKCHIP || COMPILE_TEST
296c68a2921SDaniel Kurtz	select IOMMU_API
297c68a2921SDaniel Kurtz	select ARM_DMA_USE_IOMMU
298c68a2921SDaniel Kurtz	help
299c68a2921SDaniel Kurtz	  Support for IOMMUs found on Rockchip rk32xx SOCs.
300c68a2921SDaniel Kurtz	  These IOMMUs allow virtualization of the address space used by most
301c68a2921SDaniel Kurtz	  cores within the multimedia subsystem.
302c68a2921SDaniel Kurtz	  Say Y here if you are using a Rockchip SoC that includes an IOMMU
303c68a2921SDaniel Kurtz	  device.
304c68a2921SDaniel Kurtz
305d53e54b4SHiroshi DOYUconfig TEGRA_IOMMU_GART
306d53e54b4SHiroshi DOYU	bool "Tegra GART IOMMU Support"
307d53e54b4SHiroshi DOYU	depends on ARCH_TEGRA_2x_SOC
308ce2785a7SDmitry Osipenko	depends on TEGRA_MC
309d53e54b4SHiroshi DOYU	select IOMMU_API
310d53e54b4SHiroshi DOYU	help
311d53e54b4SHiroshi DOYU	  Enables support for remapping discontiguous physical memory
312d53e54b4SHiroshi DOYU	  shared with the operating system into contiguous I/O virtual
313d53e54b4SHiroshi DOYU	  space through the GART (Graphics Address Relocation Table)
314d53e54b4SHiroshi DOYU	  hardware included on Tegra SoCs.
315d53e54b4SHiroshi DOYU
3167a31f6f4SHiroshi DOYUconfig TEGRA_IOMMU_SMMU
31789184651SThierry Reding	bool "NVIDIA Tegra SMMU Support"
31889184651SThierry Reding	depends on ARCH_TEGRA
31989184651SThierry Reding	depends on TEGRA_AHB
32089184651SThierry Reding	depends on TEGRA_MC
3217a31f6f4SHiroshi DOYU	select IOMMU_API
3227a31f6f4SHiroshi DOYU	help
32389184651SThierry Reding	  This driver supports the IOMMU hardware (SMMU) found on NVIDIA Tegra
324588c43a7SThierry Reding	  SoCs (Tegra30 up to Tegra210).
3257a31f6f4SHiroshi DOYU
3262a96536eSKyongHo Choconfig EXYNOS_IOMMU
3272a96536eSKyongHo Cho	bool "Exynos IOMMU Support"
328e93a1695SKrzysztof Kozlowski	depends on ARCH_EXYNOS && MMU || (COMPILE_TEST && (ARM || ARM64 || IA64 || SPARC))
329db3a7fd7SArnd Bergmann	depends on !CPU_BIG_ENDIAN # revisit driver if we can enable big-endian ptes
3302a96536eSKyongHo Cho	select IOMMU_API
3314802c1d0STushar Behera	select ARM_DMA_USE_IOMMU
3322a96536eSKyongHo Cho	help
3332a96536eSKyongHo Cho	  Support for the IOMMU (System MMU) of Samsung Exynos application
3345455d700SSachin Kamat	  processor family. This enables H/W multimedia accelerators to see
3355455d700SSachin Kamat	  non-linear physical memory chunks as linear memory in their
3365455d700SSachin Kamat	  address space.
3372a96536eSKyongHo Cho
3382a96536eSKyongHo Cho	  If unsure, say N here.
3392a96536eSKyongHo Cho
3402a96536eSKyongHo Choconfig EXYNOS_IOMMU_DEBUG
3412a96536eSKyongHo Cho	bool "Debugging log for Exynos IOMMU"
3422a96536eSKyongHo Cho	depends on EXYNOS_IOMMU
3432a96536eSKyongHo Cho	help
3442a96536eSKyongHo Cho	  Select this to see the detailed log message that shows what
3455455d700SSachin Kamat	  happens in the IOMMU driver.
3462a96536eSKyongHo Cho
3475455d700SSachin Kamat	  Say N unless you need kernel log message for IOMMU debugging.
3482a96536eSKyongHo Cho
349d25a2a16SLaurent Pinchartconfig IPMMU_VMSA
350d25a2a16SLaurent Pinchart	bool "Renesas VMSA-compatible IPMMU"
3513ae47292SMagnus Damm	depends on ARM || IOMMU_DMA
352a4aaecccSGuenter Roeck	depends on ARCH_RENESAS || (COMPILE_TEST && !GENERIC_ATOMIC64)
353d25a2a16SLaurent Pinchart	select IOMMU_API
354f20ed39fSLaurent Pinchart	select IOMMU_IO_PGTABLE_LPAE
355d25a2a16SLaurent Pinchart	select ARM_DMA_USE_IOMMU
356d25a2a16SLaurent Pinchart	help
35715021d36SGeert Uytterhoeven	  Support for the Renesas VMSA-compatible IPMMU found in the R-Mobile
35815021d36SGeert Uytterhoeven	  APE6, R-Car Gen2, and R-Car Gen3 SoCs.
359d25a2a16SLaurent Pinchart
360d25a2a16SLaurent Pinchart	  If unsure, say N.
361d25a2a16SLaurent Pinchart
3624e13c1acSAlexey Kardashevskiyconfig SPAPR_TCE_IOMMU
3634e13c1acSAlexey Kardashevskiy	bool "sPAPR TCE IOMMU Support"
364e93a1695SKrzysztof Kozlowski	depends on PPC_POWERNV || PPC_PSERIES || (PPC && COMPILE_TEST)
3654e13c1acSAlexey Kardashevskiy	select IOMMU_API
3664e13c1acSAlexey Kardashevskiy	help
3674e13c1acSAlexey Kardashevskiy	  Enables bits of IOMMU API required by VFIO. The iommu_ops
3684e13c1acSAlexey Kardashevskiy	  is not implemented as it is not necessary for VFIO.
3694e13c1acSAlexey Kardashevskiy
37048ec83bcSWill Deacon# ARM IOMMU support
37145ae7cffSWill Deaconconfig ARM_SMMU
372cd221bd2SWill Deacon	tristate "ARM Ltd. System MMU (SMMU) Support"
373e93a1695SKrzysztof Kozlowski	depends on (ARM64 || ARM || (COMPILE_TEST && !GENERIC_ATOMIC64)) && MMU
37445ae7cffSWill Deacon	select IOMMU_API
375518f7136SWill Deacon	select IOMMU_IO_PGTABLE_LPAE
37645ae7cffSWill Deacon	select ARM_DMA_USE_IOMMU if ARM
37745ae7cffSWill Deacon	help
37845ae7cffSWill Deacon	  Support for implementations of the ARM System MMU architecture
379518f7136SWill Deacon	  versions 1 and 2.
38045ae7cffSWill Deacon
38145ae7cffSWill Deacon	  Say Y here if your SoC includes an IOMMU device implementing
38245ae7cffSWill Deacon	  the ARM SMMU architecture.
38345ae7cffSWill Deacon
384cd221bd2SWill Deaconconfig ARM_SMMU_LEGACY_DT_BINDINGS
385cd221bd2SWill Deacon	bool "Support the legacy \"mmu-masters\" devicetree bindings"
386cd221bd2SWill Deacon	depends on ARM_SMMU=y && OF
387cd221bd2SWill Deacon	help
388cd221bd2SWill Deacon	  Support for the badly designed and deprecated "mmu-masters"
389cd221bd2SWill Deacon	  devicetree bindings. This allows some DMA masters to attach
390cd221bd2SWill Deacon	  to the SMMU but does not provide any support via the DMA API.
391cd221bd2SWill Deacon	  If you're lucky, you might be able to get VFIO up and running.
392cd221bd2SWill Deacon
393cd221bd2SWill Deacon	  If you say Y here then you'll make me very sad. Instead, say N
394cd221bd2SWill Deacon	  and move your firmware to the utopian future that was 2016.
395cd221bd2SWill Deacon
396954a03beSDouglas Andersonconfig ARM_SMMU_DISABLE_BYPASS_BY_DEFAULT
397954a03beSDouglas Anderson	bool "Default to disabling bypass on ARM SMMU v1 and v2"
398954a03beSDouglas Anderson	depends on ARM_SMMU
399954a03beSDouglas Anderson	default y
400954a03beSDouglas Anderson	help
401954a03beSDouglas Anderson	  Say Y here to (by default) disable bypass streams such that
402954a03beSDouglas Anderson	  incoming transactions from devices that are not attached to
403954a03beSDouglas Anderson	  an iommu domain will report an abort back to the device and
404954a03beSDouglas Anderson	  will not be allowed to pass through the SMMU.
405954a03beSDouglas Anderson
406954a03beSDouglas Anderson	  Any old kernels that existed before this KConfig was
407954a03beSDouglas Anderson	  introduced would default to _allowing_ bypass (AKA the
408954a03beSDouglas Anderson	  equivalent of NO for this config).  However the default for
409954a03beSDouglas Anderson	  this option is YES because the old behavior is insecure.
410954a03beSDouglas Anderson
411954a03beSDouglas Anderson	  There are few reasons to allow unmatched stream bypass, and
412954a03beSDouglas Anderson	  even fewer good ones.  If saying YES here breaks your board
413954a03beSDouglas Anderson	  you should work on fixing your board.  This KConfig option
414954a03beSDouglas Anderson	  is expected to be removed in the future and we'll simply
415954a03beSDouglas Anderson	  hardcode the bypass disable in the code.
416954a03beSDouglas Anderson
417954a03beSDouglas Anderson	  NOTE: the kernel command line parameter
418954a03beSDouglas Anderson	  'arm-smmu.disable_bypass' will continue to override this
419954a03beSDouglas Anderson	  config.
420954a03beSDouglas Anderson
42148ec83bcSWill Deaconconfig ARM_SMMU_V3
4222852ad05SWill Deacon	tristate "ARM Ltd. System MMU Version 3 (SMMUv3) Support"
42308d4ca2aSRobin Murphy	depends on ARM64
42448ec83bcSWill Deacon	select IOMMU_API
42548ec83bcSWill Deacon	select IOMMU_IO_PGTABLE_LPAE
426166bdbd2SMarc Zyngier	select GENERIC_MSI_IRQ_DOMAIN
42748ec83bcSWill Deacon	help
42848ec83bcSWill Deacon	  Support for implementations of the ARM System MMU architecture
42948ec83bcSWill Deacon	  version 3 providing translation support to a PCIe root complex.
43048ec83bcSWill Deacon
43148ec83bcSWill Deacon	  Say Y here if your system includes an IOMMU device implementing
43248ec83bcSWill Deacon	  the ARM SMMUv3 architecture.
43348ec83bcSWill Deacon
4348128f23cSGerald Schaeferconfig S390_IOMMU
4358128f23cSGerald Schaefer	def_bool y if S390 && PCI
4368128f23cSGerald Schaefer	depends on S390 && PCI
4378128f23cSGerald Schaefer	select IOMMU_API
4388128f23cSGerald Schaefer	help
4398128f23cSGerald Schaefer	  Support for the IOMMU API for s390 PCI devices.
4408128f23cSGerald Schaefer
44163f1934dSDong Jia Shiconfig S390_CCW_IOMMU
44263f1934dSDong Jia Shi	bool "S390 CCW IOMMU Support"
443e93a1695SKrzysztof Kozlowski	depends on S390 && CCW || COMPILE_TEST
44463f1934dSDong Jia Shi	select IOMMU_API
44563f1934dSDong Jia Shi	help
44663f1934dSDong Jia Shi	  Enables bits of IOMMU API required by VFIO. The iommu_ops
44763f1934dSDong Jia Shi	  is not implemented as it is not necessary for VFIO.
44863f1934dSDong Jia Shi
4491fde5734STony Krowiakconfig S390_AP_IOMMU
4501fde5734STony Krowiak	bool "S390 AP IOMMU Support"
451e93a1695SKrzysztof Kozlowski	depends on S390 && ZCRYPT || COMPILE_TEST
4521fde5734STony Krowiak	select IOMMU_API
4531fde5734STony Krowiak	help
4541fde5734STony Krowiak	  Enables bits of IOMMU API required by VFIO. The iommu_ops
4551fde5734STony Krowiak	  is not implemented as it is not necessary for VFIO.
4561fde5734STony Krowiak
4570df4fabeSYong Wuconfig MTK_IOMMU
4580df4fabeSYong Wu	bool "MTK IOMMU Support"
459e93a1695SKrzysztof Kozlowski	depends on ARM || ARM64 || COMPILE_TEST
4600df4fabeSYong Wu	depends on ARCH_MEDIATEK || COMPILE_TEST
4611928832fSArnd Bergmann	select ARM_DMA_USE_IOMMU
4620df4fabeSYong Wu	select IOMMU_API
4630df4fabeSYong Wu	select IOMMU_DMA
4640df4fabeSYong Wu	select IOMMU_IO_PGTABLE_ARMV7S
4650df4fabeSYong Wu	select MEMORY
4660df4fabeSYong Wu	select MTK_SMI
4670df4fabeSYong Wu	help
4680df4fabeSYong Wu	  Support for the M4U on certain Mediatek SOCs. M4U is MultiMedia
4690df4fabeSYong Wu	  Memory Management Unit. This option enables remapping of DMA memory
4700df4fabeSYong Wu	  accesses for the multimedia subsystem.
4710df4fabeSYong Wu
4720df4fabeSYong Wu	  If unsure, say N here.
4730df4fabeSYong Wu
474b17336c5SHonghui Zhangconfig MTK_IOMMU_V1
475b17336c5SHonghui Zhang	bool "MTK IOMMU Version 1 (M4U gen1) Support"
476b17336c5SHonghui Zhang	depends on ARM
477b17336c5SHonghui Zhang	depends on ARCH_MEDIATEK || COMPILE_TEST
478b17336c5SHonghui Zhang	select ARM_DMA_USE_IOMMU
479b17336c5SHonghui Zhang	select IOMMU_API
480b17336c5SHonghui Zhang	select MEMORY
481b17336c5SHonghui Zhang	select MTK_SMI
482b17336c5SHonghui Zhang	help
483b17336c5SHonghui Zhang	  Support for the M4U on certain Mediatek SoCs. M4U generation 1 HW is
484b17336c5SHonghui Zhang	  Multimedia Memory Managememt Unit. This option enables remapping of
485b17336c5SHonghui Zhang	  DMA memory accesses for the multimedia subsystem.
486b17336c5SHonghui Zhang
487b17336c5SHonghui Zhang	  if unsure, say N here.
488b17336c5SHonghui Zhang
4890ae349a0SRob Clarkconfig QCOM_IOMMU
4900ae349a0SRob Clark	# Note: iommu drivers cannot (yet?) be built as modules
4910ae349a0SRob Clark	bool "Qualcomm IOMMU Support"
492a4aaecccSGuenter Roeck	depends on ARCH_QCOM || (COMPILE_TEST && !GENERIC_ATOMIC64)
4930ae349a0SRob Clark	select IOMMU_API
4940ae349a0SRob Clark	select IOMMU_IO_PGTABLE_LPAE
4950ae349a0SRob Clark	select ARM_DMA_USE_IOMMU
4960ae349a0SRob Clark	help
4970ae349a0SRob Clark	  Support for IOMMU on certain Qualcomm SoCs.
4980ae349a0SRob Clark
49929217a47SLan Tianyuconfig HYPERV_IOMMU
50029217a47SLan Tianyu	bool "Hyper-V x2APIC IRQ Handling"
501d7f0b2e4SBoqun Feng	depends on HYPERV && X86
50229217a47SLan Tianyu	select IOMMU_API
50329217a47SLan Tianyu	default HYPERV
50429217a47SLan Tianyu	help
50529217a47SLan Tianyu	  Stub IOMMU driver to handle IRQs as to allow Hyper-V Linux
50629217a47SLan Tianyu	  guests to run with x2APIC mode enabled.
50729217a47SLan Tianyu
508edcd69abSJean-Philippe Bruckerconfig VIRTIO_IOMMU
509edcd69abSJean-Philippe Brucker	bool "Virtio IOMMU driver"
510edcd69abSJean-Philippe Brucker	depends on VIRTIO=y
511edcd69abSJean-Philippe Brucker	depends on ARM64
512edcd69abSJean-Philippe Brucker	select IOMMU_API
513edcd69abSJean-Philippe Brucker	select INTERVAL_TREE
514edcd69abSJean-Philippe Brucker	help
515edcd69abSJean-Philippe Brucker	  Para-virtualised IOMMU driver with virtio.
516edcd69abSJean-Philippe Brucker
517edcd69abSJean-Philippe Brucker	  Say Y here if you intend to run this kernel as a guest.
518edcd69abSJean-Philippe Brucker
51968255b62SJoerg Roedelendif # IOMMU_SUPPORT
520