OSDN Git Service

iommu: Make more drivers depend on COMPILE_TEST
[android-x86/kernel.git] / drivers / iommu / Kconfig
1 # IOMMU_API always gets selected by whoever wants it.
2 config IOMMU_API
3         bool
4
5 menuconfig 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
15 if IOMMU_SUPPORT
16
17 config IOMMU_IOVA
18         bool
19
20 config OF_IOMMU
21        def_bool y
22        depends on OF && IOMMU_API
23
24 config FSL_PAMU
25         bool "Freescale IOMMU support"
26         depends on PPC32
27         depends on PPC_E500MC || COMPILE_TEST
28         select IOMMU_API
29         select GENERIC_ALLOCATOR
30         help
31           Freescale PAMU support. PAMU is the IOMMU present on Freescale QorIQ platforms.
32           PAMU can authorize memory access, remap the memory address, and remap I/O
33           transaction types.
34
35 # MSM IOMMU support
36 config MSM_IOMMU
37         bool "MSM IOMMU Support"
38         depends on ARM
39         depends on ARCH_MSM8X60 || ARCH_MSM8960 || COMPILE_TEST
40         select IOMMU_API
41         help
42           Support for the IOMMUs found on certain Qualcomm SOCs.
43           These IOMMUs allow virtualization of the address space used by most
44           cores within the multimedia subsystem.
45
46           If unsure, say N here.
47
48 config IOMMU_PGTABLES_L2
49         def_bool y
50         depends on MSM_IOMMU && MMU && SMP && CPU_DCACHE_DISABLE=n
51
52 # AMD IOMMU support
53 config AMD_IOMMU
54         bool "AMD IOMMU support"
55         select SWIOTLB
56         select PCI_MSI
57         select PCI_ATS
58         select PCI_PRI
59         select PCI_PASID
60         select IOMMU_API
61         depends on X86_64 && PCI && ACPI
62         ---help---
63           With this option you can enable support for AMD IOMMU hardware in
64           your system. An IOMMU is a hardware component which provides
65           remapping of DMA memory accesses from devices. With an AMD IOMMU you
66           can isolate the DMA memory of different devices and protect the
67           system from misbehaving device drivers or hardware.
68
69           You can find out if your system has an AMD IOMMU if you look into
70           your BIOS for an option to enable it or if you have an IVRS ACPI
71           table.
72
73 config AMD_IOMMU_STATS
74         bool "Export AMD IOMMU statistics to debugfs"
75         depends on AMD_IOMMU
76         select DEBUG_FS
77         ---help---
78           This option enables code in the AMD IOMMU driver to collect various
79           statistics about whats happening in the driver and exports that
80           information to userspace via debugfs.
81           If unsure, say N.
82
83 config AMD_IOMMU_V2
84         tristate "AMD IOMMU Version 2 driver"
85         depends on AMD_IOMMU
86         select MMU_NOTIFIER
87         ---help---
88           This option enables support for the AMD IOMMUv2 features of the IOMMU
89           hardware. Select this option if you want to use devices that support
90           the PCI PRI and PASID interface.
91
92 # Intel IOMMU support
93 config DMAR_TABLE
94         bool
95
96 config INTEL_IOMMU
97         bool "Support for Intel IOMMU using DMA Remapping Devices"
98         depends on PCI_MSI && ACPI && (X86 || IA64_GENERIC)
99         select IOMMU_API
100         select IOMMU_IOVA
101         select DMAR_TABLE
102         help
103           DMA remapping (DMAR) devices support enables independent address
104           translations for Direct Memory Access (DMA) from devices.
105           These DMA remapping devices are reported via ACPI tables
106           and include PCI device scope covered by these DMA
107           remapping devices.
108
109 config INTEL_IOMMU_DEFAULT_ON
110         def_bool y
111         prompt "Enable Intel DMA Remapping Devices by default"
112         depends on INTEL_IOMMU
113         help
114           Selecting this option will enable a DMAR device at boot time if
115           one is found. If this option is not selected, DMAR support can
116           be enabled by passing intel_iommu=on to the kernel.
117
118 config INTEL_IOMMU_BROKEN_GFX_WA
119         bool "Workaround broken graphics drivers (going away soon)"
120         depends on INTEL_IOMMU && BROKEN && X86
121         ---help---
122           Current Graphics drivers tend to use physical address
123           for DMA and avoid using DMA APIs. Setting this config
124           option permits the IOMMU driver to set a unity map for
125           all the OS-visible memory. Hence the driver can continue
126           to use physical addresses for DMA, at least until this
127           option is removed in the 2.6.32 kernel.
128
129 config INTEL_IOMMU_FLOPPY_WA
130         def_bool y
131         depends on INTEL_IOMMU && X86
132         ---help---
133           Floppy disk drivers are known to bypass DMA API calls
134           thereby failing to work when IOMMU is enabled. This
135           workaround will setup a 1:1 mapping for the first
136           16MiB to make floppy (an ISA device) work.
137
138 config IRQ_REMAP
139         bool "Support for Interrupt Remapping"
140         depends on X86_64 && X86_IO_APIC && PCI_MSI && ACPI
141         select DMAR_TABLE
142         ---help---
143           Supports Interrupt remapping for IO-APIC and MSI devices.
144           To use x2apic mode in the CPU's which support x2APIC enhancements or
145           to support platforms with CPU's having > 8 bit APIC ID, say Y.
146
147 # OMAP IOMMU support
148 config OMAP_IOMMU
149         bool "OMAP IOMMU Support"
150         depends on ARM && MMU
151         depends on ARCH_OMAP2PLUS || COMPILE_TEST
152         select IOMMU_API
153
154 config OMAP_IOMMU_DEBUG
155         bool "Export OMAP IOMMU internals in DebugFS"
156         depends on OMAP_IOMMU && DEBUG_FS
157         ---help---
158           Select this to see extensive information about
159           the internal state of OMAP IOMMU in debugfs.
160
161           Say N unless you know you need this.
162
163 config ROCKCHIP_IOMMU
164         bool "Rockchip IOMMU Support"
165         depends on ARM
166         depends on ARCH_ROCKCHIP || COMPILE_TEST
167         select IOMMU_API
168         select ARM_DMA_USE_IOMMU
169         help
170           Support for IOMMUs found on Rockchip rk32xx SOCs.
171           These IOMMUs allow virtualization of the address space used by most
172           cores within the multimedia subsystem.
173           Say Y here if you are using a Rockchip SoC that includes an IOMMU
174           device.
175
176 config TEGRA_IOMMU_GART
177         bool "Tegra GART IOMMU Support"
178         depends on ARCH_TEGRA_2x_SOC
179         select IOMMU_API
180         help
181           Enables support for remapping discontiguous physical memory
182           shared with the operating system into contiguous I/O virtual
183           space through the GART (Graphics Address Relocation Table)
184           hardware included on Tegra SoCs.
185
186 config TEGRA_IOMMU_SMMU
187         bool "NVIDIA Tegra SMMU Support"
188         depends on ARCH_TEGRA
189         depends on TEGRA_AHB
190         depends on TEGRA_MC
191         select IOMMU_API
192         help
193           This driver supports the IOMMU hardware (SMMU) found on NVIDIA Tegra
194           SoCs (Tegra30 up to Tegra124).
195
196 config EXYNOS_IOMMU
197         bool "Exynos IOMMU Support"
198         depends on ARCH_EXYNOS && ARM && MMU
199         select IOMMU_API
200         select ARM_DMA_USE_IOMMU
201         help
202           Support for the IOMMU (System MMU) of Samsung Exynos application
203           processor family. This enables H/W multimedia accelerators to see
204           non-linear physical memory chunks as linear memory in their
205           address space.
206
207           If unsure, say N here.
208
209 config EXYNOS_IOMMU_DEBUG
210         bool "Debugging log for Exynos IOMMU"
211         depends on EXYNOS_IOMMU
212         help
213           Select this to see the detailed log message that shows what
214           happens in the IOMMU driver.
215
216           Say N unless you need kernel log message for IOMMU debugging.
217
218 config SHMOBILE_IPMMU
219         bool
220
221 config SHMOBILE_IPMMU_TLB
222         bool
223
224 config SHMOBILE_IOMMU
225         bool "IOMMU for Renesas IPMMU/IPMMUI"
226         default n
227         depends on ARM && MMU
228         depends on ARCH_SHMOBILE || COMPILE_TEST
229         select IOMMU_API
230         select ARM_DMA_USE_IOMMU
231         select SHMOBILE_IPMMU
232         select SHMOBILE_IPMMU_TLB
233         help
234           Support for Renesas IPMMU/IPMMUI. This option enables
235           remapping of DMA memory accesses from all of the IP blocks
236           on the ICB.
237
238           Warning: Drivers (including userspace drivers of UIO
239           devices) of the IP blocks on the ICB *must* use addresses
240           allocated from the IPMMU (iova) for DMA with this option
241           enabled.
242
243           If unsure, say N.
244
245 choice
246         prompt "IPMMU/IPMMUI address space size"
247         default SHMOBILE_IOMMU_ADDRSIZE_2048MB
248         depends on SHMOBILE_IOMMU
249         help
250           This option sets IPMMU/IPMMUI address space size by
251           adjusting the 1st level page table size. The page table size
252           is calculated as follows:
253
254               page table size = number of page table entries * 4 bytes
255               number of page table entries = address space size / 1 MiB
256
257           For example, when the address space size is 2048 MiB, the
258           1st level page table size is 8192 bytes.
259
260         config SHMOBILE_IOMMU_ADDRSIZE_2048MB
261                 bool "2 GiB"
262
263         config SHMOBILE_IOMMU_ADDRSIZE_1024MB
264                 bool "1 GiB"
265
266         config SHMOBILE_IOMMU_ADDRSIZE_512MB
267                 bool "512 MiB"
268
269         config SHMOBILE_IOMMU_ADDRSIZE_256MB
270                 bool "256 MiB"
271
272         config SHMOBILE_IOMMU_ADDRSIZE_128MB
273                 bool "128 MiB"
274
275         config SHMOBILE_IOMMU_ADDRSIZE_64MB
276                 bool "64 MiB"
277
278         config SHMOBILE_IOMMU_ADDRSIZE_32MB
279                 bool "32 MiB"
280
281 endchoice
282
283 config SHMOBILE_IOMMU_L1SIZE
284         int
285         default 8192 if SHMOBILE_IOMMU_ADDRSIZE_2048MB
286         default 4096 if SHMOBILE_IOMMU_ADDRSIZE_1024MB
287         default 2048 if SHMOBILE_IOMMU_ADDRSIZE_512MB
288         default 1024 if SHMOBILE_IOMMU_ADDRSIZE_256MB
289         default 512 if SHMOBILE_IOMMU_ADDRSIZE_128MB
290         default 256 if SHMOBILE_IOMMU_ADDRSIZE_64MB
291         default 128 if SHMOBILE_IOMMU_ADDRSIZE_32MB
292
293 config IPMMU_VMSA
294         bool "Renesas VMSA-compatible IPMMU"
295         depends on ARM_LPAE
296         depends on ARCH_SHMOBILE || COMPILE_TEST
297         select IOMMU_API
298         select ARM_DMA_USE_IOMMU
299         help
300           Support for the Renesas VMSA-compatible IPMMU Renesas found in the
301           R-Mobile APE6 and R-Car H2/M2 SoCs.
302
303           If unsure, say N.
304
305 config SPAPR_TCE_IOMMU
306         bool "sPAPR TCE IOMMU Support"
307         depends on PPC_POWERNV || PPC_PSERIES
308         select IOMMU_API
309         help
310           Enables bits of IOMMU API required by VFIO. The iommu_ops
311           is not implemented as it is not necessary for VFIO.
312
313 config ARM_SMMU
314         bool "ARM Ltd. System MMU (SMMU) Support"
315         depends on ARM64 || (ARM_LPAE && OF)
316         depends on MMU
317         select IOMMU_API
318         select ARM_DMA_USE_IOMMU if ARM
319         help
320           Support for implementations of the ARM System MMU architecture
321           versions 1 and 2. The driver supports both v7l and v8l table
322           formats with 4k and 64k page sizes.
323
324           Say Y here if your SoC includes an IOMMU device implementing
325           the ARM SMMU architecture.
326
327 endif # IOMMU_SUPPORT