xref: /linux/drivers/iommu/arm/Kconfig (revision 8477ab143069c6b05d6da4a8184ded8b969240f5)
1# SPDX-License-Identifier: GPL-2.0-only
2# ARM IOMMU support
3config ARM_SMMU
4	tristate "ARM Ltd. System MMU (SMMU) Support"
5	depends on ARM64 || ARM || COMPILE_TEST
6	depends on !GENERIC_ATOMIC64	# for IOMMU_IO_PGTABLE_LPAE
7	select IOMMU_API
8	select IOMMU_IO_PGTABLE_LPAE
9	select ARM_DMA_USE_IOMMU if ARM
10	help
11	  Support for implementations of the ARM System MMU architecture
12	  versions 1 and 2.
13
14	  Say Y here if your SoC includes an IOMMU device implementing
15	  the ARM SMMU architecture.
16
17if ARM_SMMU
18config ARM_SMMU_LEGACY_DT_BINDINGS
19	bool "Support the legacy \"mmu-masters\" devicetree bindings"
20	depends on ARM_SMMU=y && OF
21	help
22	  Support for the badly designed and deprecated "mmu-masters"
23	  devicetree bindings. This allows some DMA masters to attach
24	  to the SMMU but does not provide any support via the DMA API.
25	  If you're lucky, you might be able to get VFIO up and running.
26
27	  If you say Y here then you'll make me very sad. Instead, say N
28	  and move your firmware to the utopian future that was 2016.
29
30config ARM_SMMU_DISABLE_BYPASS_BY_DEFAULT
31	bool "Disable unmatched stream bypass by default" if EXPERT
32	default y
33	help
34	  If your firmware is broken and fails to describe StreamIDs which
35	  Linux should know about in order to manage the SMMU correctly and
36	  securely, and you don't want to boot with the 'arm-smmu.disable_bypass=0'
37	  command line parameter, then as a last resort you can turn it off
38	  by default here. But don't. This option may be removed at any time.
39
40	  Note that 'arm-smmu.disable_bypass=1' will still take precedence.
41
42config ARM_SMMU_MMU_500_CPRE_ERRATA
43	bool "Enable errata workaround for CPRE in SMMU reset path"
44	default y
45	help
46	  Say Y here (by default) to apply workaround to disable
47	  MMU-500's next-page prefetcher for sake of 4 known errata.
48
49	  Say N here only when it is sure that any errata related to
50	  prefetch enablement are not applicable on the platform.
51	  Refer silicon-errata.rst for info on errata IDs.
52
53config ARM_SMMU_QCOM
54	def_tristate y
55	depends on ARCH_QCOM
56	select QCOM_SCM
57	help
58	  When running on a Qualcomm platform that has the custom variant
59	  of the ARM SMMU, this needs to be built into the SMMU driver.
60
61config ARM_SMMU_QCOM_DEBUG
62	bool "ARM SMMU QCOM implementation defined debug support"
63	depends on ARM_SMMU_QCOM=y
64	help
65	  Support for implementation specific debug features in ARM SMMU
66	  hardware found in QTI platforms. This include support for
67	  the Translation Buffer Units (TBU) that can be used to obtain
68	  additional information when debugging memory management issues
69	  like context faults.
70
71	  Say Y here to enable debug for issues such as context faults
72	  or TLB sync timeouts which requires implementation defined
73	  register dumps.
74endif
75
76config ARM_SMMU_V3
77	tristate "ARM Ltd. System MMU Version 3 (SMMUv3) Support"
78	depends on ARM64
79	select IOMMU_API
80	select IOMMU_IO_PGTABLE_LPAE
81	select GENERIC_MSI_IRQ
82	select IOMMUFD_DRIVER if IOMMUFD
83	help
84	  Support for implementations of the ARM System MMU architecture
85	  version 3 providing translation support to a PCIe root complex.
86
87	  Say Y here if your system includes an IOMMU device implementing
88	  the ARM SMMUv3 architecture.
89
90if ARM_SMMU_V3
91config ARM_SMMU_V3_SVA
92	bool "Shared Virtual Addressing support for the ARM SMMUv3"
93	select IOMMU_SVA
94	select IOMMU_IOPF
95	select MMU_NOTIFIER
96	help
97	  Support for sharing process address spaces with devices using the
98	  SMMUv3.
99
100	  Say Y here if your system supports SVA extensions such as PCIe PASID
101	  and PRI.
102
103config ARM_SMMU_V3_IOMMUFD
104	bool "Enable IOMMUFD features for ARM SMMUv3 (EXPERIMENTAL)"
105	depends on IOMMUFD
106	help
107	  Support for IOMMUFD features intended to support virtual machines
108	  with accelerated virtual IOMMUs.
109
110	  Say Y here if you are doing development and testing on this feature.
111
112config ARM_SMMU_V3_KUNIT_TEST
113	tristate "KUnit tests for arm-smmu-v3 driver"  if !KUNIT_ALL_TESTS
114	depends on KUNIT
115	depends on ARM_SMMU_V3_SVA
116	default KUNIT_ALL_TESTS
117	help
118	  Enable this option to unit-test arm-smmu-v3 driver functions.
119
120	  If unsure, say N.
121
122config TEGRA241_CMDQV
123	bool "NVIDIA Tegra241 CMDQ-V extension support for ARM SMMUv3"
124	depends on ACPI
125	help
126	  Support for NVIDIA CMDQ-Virtualization extension for ARM SMMUv3. The
127	  CMDQ-V extension is similar to v3.3 ECMDQ for multi command queues
128	  support, except with virtualization capabilities.
129
130	  Say Y here if your system is NVIDIA Tegra241 (Grace) or it has the same
131	  CMDQ-V extension.
132endif
133
134config QCOM_IOMMU
135	# Note: iommu drivers cannot (yet?) be built as modules
136	bool "Qualcomm IOMMU Support"
137	depends on ARCH_QCOM || COMPILE_TEST
138	depends on !GENERIC_ATOMIC64	# for IOMMU_IO_PGTABLE_LPAE
139	select QCOM_SCM
140	select IOMMU_API
141	select IOMMU_IO_PGTABLE_LPAE
142	select ARM_DMA_USE_IOMMU
143	help
144	  Support for IOMMU on certain Qualcomm SoCs.
145