xref: /openbmc/linux/drivers/iommu/Kconfig (revision 6da2ec56)
1# IOMMU_API always gets selected by whoever wants it.
2config IOMMU_API
3	bool
4
5menuconfig IOMMU_SUPPORT
6	bool "IOMMU Hardware Support"
7	depends on MMU
8	default y
9	---help---
10	  Say Y here if you want to compile device drivers for IO Memory
11	  Management Units into the kernel. These devices usually allow to
12	  remap DMA requests and/or remap interrupts from other devices on the
13	  system.
14
15if IOMMU_SUPPORT
16
17menu "Generic IOMMU Pagetable Support"
18
19# Selected by the actual pagetable implementations
20config IOMMU_IO_PGTABLE
21	bool
22
23config IOMMU_IO_PGTABLE_LPAE
24	bool "ARMv7/v8 Long Descriptor Format"
25	select IOMMU_IO_PGTABLE
26	depends on ARM || ARM64 || (COMPILE_TEST && !GENERIC_ATOMIC64)
27	help
28	  Enable support for the ARM long descriptor pagetable format.
29	  This allocator supports 4K/2M/1G, 16K/32M and 64K/512M page
30	  sizes at both stage-1 and stage-2, as well as address spaces
31	  up to 48-bits in size.
32
33config IOMMU_IO_PGTABLE_LPAE_SELFTEST
34	bool "LPAE selftests"
35	depends on IOMMU_IO_PGTABLE_LPAE
36	help
37	  Enable self-tests for LPAE page table allocator. This performs
38	  a series of page-table consistency checks during boot.
39
40	  If unsure, say N here.
41
42config IOMMU_IO_PGTABLE_ARMV7S
43	bool "ARMv7/v8 Short Descriptor Format"
44	select IOMMU_IO_PGTABLE
45	depends on ARM || ARM64 || COMPILE_TEST
46	help
47	  Enable support for the ARM Short-descriptor pagetable format.
48	  This supports 32-bit virtual and physical addresses mapped using
49	  2-level tables with 4KB pages/1MB sections, and contiguous entries
50	  for 64KB pages/16MB supersections if indicated by the IOMMU driver.
51
52config IOMMU_IO_PGTABLE_ARMV7S_SELFTEST
53	bool "ARMv7s selftests"
54	depends on IOMMU_IO_PGTABLE_ARMV7S
55	help
56	  Enable self-tests for ARMv7s page table allocator. This performs
57	  a series of page-table consistency checks during boot.
58
59	  If unsure, say N here.
60
61endmenu
62
63config IOMMU_IOVA
64	tristate
65
66config OF_IOMMU
67       def_bool y
68       depends on OF && IOMMU_API
69
70# IOMMU-agnostic DMA-mapping layer
71config IOMMU_DMA
72	bool
73	select IOMMU_API
74	select IOMMU_IOVA
75	select NEED_SG_DMA_LENGTH
76
77config FSL_PAMU
78	bool "Freescale IOMMU support"
79	depends on PCI
80	depends on PHYS_64BIT
81	depends on PPC_E500MC || (COMPILE_TEST && PPC)
82	select IOMMU_API
83	select GENERIC_ALLOCATOR
84	help
85	  Freescale PAMU support. PAMU is the IOMMU present on Freescale QorIQ platforms.
86	  PAMU can authorize memory access, remap the memory address, and remap I/O
87	  transaction types.
88
89# MSM IOMMU support
90config MSM_IOMMU
91	bool "MSM IOMMU Support"
92	depends on ARM
93	depends on ARCH_MSM8X60 || ARCH_MSM8960 || COMPILE_TEST
94	select IOMMU_API
95	select IOMMU_IO_PGTABLE_ARMV7S
96	help
97	  Support for the IOMMUs found on certain Qualcomm SOCs.
98	  These IOMMUs allow virtualization of the address space used by most
99	  cores within the multimedia subsystem.
100
101	  If unsure, say N here.
102
103config IOMMU_PGTABLES_L2
104	def_bool y
105	depends on MSM_IOMMU && MMU && SMP && CPU_DCACHE_DISABLE=n
106
107# AMD IOMMU support
108config AMD_IOMMU
109	bool "AMD IOMMU support"
110	select DMA_DIRECT_OPS
111	select SWIOTLB
112	select PCI_MSI
113	select PCI_ATS
114	select PCI_PRI
115	select PCI_PASID
116	select IOMMU_API
117	select IOMMU_IOVA
118	depends on X86_64 && PCI && ACPI
119	---help---
120	  With this option you can enable support for AMD IOMMU hardware in
121	  your system. An IOMMU is a hardware component which provides
122	  remapping of DMA memory accesses from devices. With an AMD IOMMU you
123	  can isolate the DMA memory of different devices and protect the
124	  system from misbehaving device drivers or hardware.
125
126	  You can find out if your system has an AMD IOMMU if you look into
127	  your BIOS for an option to enable it or if you have an IVRS ACPI
128	  table.
129
130config AMD_IOMMU_V2
131	tristate "AMD IOMMU Version 2 driver"
132	depends on AMD_IOMMU
133	select MMU_NOTIFIER
134	---help---
135	  This option enables support for the AMD IOMMUv2 features of the IOMMU
136	  hardware. Select this option if you want to use devices that support
137	  the PCI PRI and PASID interface.
138
139# Intel IOMMU support
140config DMAR_TABLE
141	bool
142
143config INTEL_IOMMU
144	bool "Support for Intel IOMMU using DMA Remapping Devices"
145	depends on PCI_MSI && ACPI && (X86 || IA64_GENERIC)
146	select DMA_DIRECT_OPS
147	select IOMMU_API
148	select IOMMU_IOVA
149	select NEED_DMA_MAP_STATE
150	select DMAR_TABLE
151	help
152	  DMA remapping (DMAR) devices support enables independent address
153	  translations for Direct Memory Access (DMA) from devices.
154	  These DMA remapping devices are reported via ACPI tables
155	  and include PCI device scope covered by these DMA
156	  remapping devices.
157
158config INTEL_IOMMU_SVM
159	bool "Support for Shared Virtual Memory with Intel IOMMU"
160	depends on INTEL_IOMMU && X86
161	select PCI_PASID
162	select MMU_NOTIFIER
163	help
164	  Shared Virtual Memory (SVM) provides a facility for devices
165	  to access DMA resources through process address space by
166	  means of a Process Address Space ID (PASID).
167
168config INTEL_IOMMU_DEFAULT_ON
169	def_bool y
170	prompt "Enable Intel DMA Remapping Devices by default"
171	depends on INTEL_IOMMU
172	help
173	  Selecting this option will enable a DMAR device at boot time if
174	  one is found. If this option is not selected, DMAR support can
175	  be enabled by passing intel_iommu=on to the kernel.
176
177config INTEL_IOMMU_BROKEN_GFX_WA
178	bool "Workaround broken graphics drivers (going away soon)"
179	depends on INTEL_IOMMU && BROKEN && X86
180	---help---
181	  Current Graphics drivers tend to use physical address
182	  for DMA and avoid using DMA APIs. Setting this config
183	  option permits the IOMMU driver to set a unity map for
184	  all the OS-visible memory. Hence the driver can continue
185	  to use physical addresses for DMA, at least until this
186	  option is removed in the 2.6.32 kernel.
187
188config INTEL_IOMMU_FLOPPY_WA
189	def_bool y
190	depends on INTEL_IOMMU && X86
191	---help---
192	  Floppy disk drivers are known to bypass DMA API calls
193	  thereby failing to work when IOMMU is enabled. This
194	  workaround will setup a 1:1 mapping for the first
195	  16MiB to make floppy (an ISA device) work.
196
197config IRQ_REMAP
198	bool "Support for Interrupt Remapping"
199	depends on X86_64 && X86_IO_APIC && PCI_MSI && ACPI
200	select DMAR_TABLE
201	---help---
202	  Supports Interrupt remapping for IO-APIC and MSI devices.
203	  To use x2apic mode in the CPU's which support x2APIC enhancements or
204	  to support platforms with CPU's having > 8 bit APIC ID, say Y.
205
206# OMAP IOMMU support
207config OMAP_IOMMU
208	bool "OMAP IOMMU Support"
209	depends on ARM && MMU
210	depends on ARCH_OMAP2PLUS || COMPILE_TEST
211	select IOMMU_API
212	---help---
213	  The OMAP3 media platform drivers depend on iommu support,
214	  if you need them say Y here.
215
216config OMAP_IOMMU_DEBUG
217	bool "Export OMAP IOMMU internals in DebugFS"
218	depends on OMAP_IOMMU && DEBUG_FS
219	---help---
220	  Select this to see extensive information about
221	  the internal state of OMAP IOMMU in debugfs.
222
223	  Say N unless you know you need this.
224
225config ROCKCHIP_IOMMU
226	bool "Rockchip IOMMU Support"
227	depends on ARM || ARM64
228	depends on ARCH_ROCKCHIP || COMPILE_TEST
229	select IOMMU_API
230	select ARM_DMA_USE_IOMMU
231	help
232	  Support for IOMMUs found on Rockchip rk32xx SOCs.
233	  These IOMMUs allow virtualization of the address space used by most
234	  cores within the multimedia subsystem.
235	  Say Y here if you are using a Rockchip SoC that includes an IOMMU
236	  device.
237
238config TEGRA_IOMMU_GART
239	bool "Tegra GART IOMMU Support"
240	depends on ARCH_TEGRA_2x_SOC
241	select IOMMU_API
242	help
243	  Enables support for remapping discontiguous physical memory
244	  shared with the operating system into contiguous I/O virtual
245	  space through the GART (Graphics Address Relocation Table)
246	  hardware included on Tegra SoCs.
247
248config TEGRA_IOMMU_SMMU
249	bool "NVIDIA Tegra SMMU Support"
250	depends on ARCH_TEGRA
251	depends on TEGRA_AHB
252	depends on TEGRA_MC
253	select IOMMU_API
254	help
255	  This driver supports the IOMMU hardware (SMMU) found on NVIDIA Tegra
256	  SoCs (Tegra30 up to Tegra210).
257
258config EXYNOS_IOMMU
259	bool "Exynos IOMMU Support"
260	depends on ARCH_EXYNOS && MMU
261	depends on !CPU_BIG_ENDIAN # revisit driver if we can enable big-endian ptes
262	select IOMMU_API
263	select ARM_DMA_USE_IOMMU
264	help
265	  Support for the IOMMU (System MMU) of Samsung Exynos application
266	  processor family. This enables H/W multimedia accelerators to see
267	  non-linear physical memory chunks as linear memory in their
268	  address space.
269
270	  If unsure, say N here.
271
272config EXYNOS_IOMMU_DEBUG
273	bool "Debugging log for Exynos IOMMU"
274	depends on EXYNOS_IOMMU
275	help
276	  Select this to see the detailed log message that shows what
277	  happens in the IOMMU driver.
278
279	  Say N unless you need kernel log message for IOMMU debugging.
280
281config IPMMU_VMSA
282	bool "Renesas VMSA-compatible IPMMU"
283	depends on ARM || IOMMU_DMA
284	depends on ARCH_RENESAS || (COMPILE_TEST && !GENERIC_ATOMIC64)
285	select IOMMU_API
286	select IOMMU_IO_PGTABLE_LPAE
287	select ARM_DMA_USE_IOMMU
288	help
289	  Support for the Renesas VMSA-compatible IPMMU Renesas found in the
290	  R-Mobile APE6 and R-Car H2/M2 SoCs.
291
292	  If unsure, say N.
293
294config SPAPR_TCE_IOMMU
295	bool "sPAPR TCE IOMMU Support"
296	depends on PPC_POWERNV || PPC_PSERIES
297	select IOMMU_API
298	help
299	  Enables bits of IOMMU API required by VFIO. The iommu_ops
300	  is not implemented as it is not necessary for VFIO.
301
302# ARM IOMMU support
303config ARM_SMMU
304	bool "ARM Ltd. System MMU (SMMU) Support"
305	depends on (ARM64 || ARM) && MMU
306	select IOMMU_API
307	select IOMMU_IO_PGTABLE_LPAE
308	select ARM_DMA_USE_IOMMU if ARM
309	help
310	  Support for implementations of the ARM System MMU architecture
311	  versions 1 and 2.
312
313	  Say Y here if your SoC includes an IOMMU device implementing
314	  the ARM SMMU architecture.
315
316config ARM_SMMU_V3
317	bool "ARM Ltd. System MMU Version 3 (SMMUv3) Support"
318	depends on ARM64
319	select IOMMU_API
320	select IOMMU_IO_PGTABLE_LPAE
321	select GENERIC_MSI_IRQ_DOMAIN
322	help
323	  Support for implementations of the ARM System MMU architecture
324	  version 3 providing translation support to a PCIe root complex.
325
326	  Say Y here if your system includes an IOMMU device implementing
327	  the ARM SMMUv3 architecture.
328
329config S390_IOMMU
330	def_bool y if S390 && PCI
331	depends on S390 && PCI
332	select IOMMU_API
333	help
334	  Support for the IOMMU API for s390 PCI devices.
335
336config S390_CCW_IOMMU
337	bool "S390 CCW IOMMU Support"
338	depends on S390 && CCW
339	select IOMMU_API
340	help
341	  Enables bits of IOMMU API required by VFIO. The iommu_ops
342	  is not implemented as it is not necessary for VFIO.
343
344config MTK_IOMMU
345	bool "MTK IOMMU Support"
346	depends on ARM || ARM64
347	depends on ARCH_MEDIATEK || COMPILE_TEST
348	select ARM_DMA_USE_IOMMU
349	select IOMMU_API
350	select IOMMU_DMA
351	select IOMMU_IO_PGTABLE_ARMV7S
352	select MEMORY
353	select MTK_SMI
354	help
355	  Support for the M4U on certain Mediatek SOCs. M4U is MultiMedia
356	  Memory Management Unit. This option enables remapping of DMA memory
357	  accesses for the multimedia subsystem.
358
359	  If unsure, say N here.
360
361config MTK_IOMMU_V1
362	bool "MTK IOMMU Version 1 (M4U gen1) Support"
363	depends on ARM
364	depends on ARCH_MEDIATEK || COMPILE_TEST
365	select ARM_DMA_USE_IOMMU
366	select IOMMU_API
367	select MEMORY
368	select MTK_SMI
369	help
370	  Support for the M4U on certain Mediatek SoCs. M4U generation 1 HW is
371	  Multimedia Memory Managememt Unit. This option enables remapping of
372	  DMA memory accesses for the multimedia subsystem.
373
374	  if unsure, say N here.
375
376config QCOM_IOMMU
377	# Note: iommu drivers cannot (yet?) be built as modules
378	bool "Qualcomm IOMMU Support"
379	depends on ARCH_QCOM || (COMPILE_TEST && !GENERIC_ATOMIC64)
380	select IOMMU_API
381	select IOMMU_IO_PGTABLE_LPAE
382	select ARM_DMA_USE_IOMMU
383	help
384	  Support for IOMMU on certain Qualcomm SoCs.
385
386endif # IOMMU_SUPPORT
387