xref: /openbmc/linux/drivers/iommu/Kconfig (revision e5cac32c)
1ab493a0fSOhad Ben-Cohen# IOMMU_API always gets selected by whoever wants it.
2ab493a0fSOhad Ben-Cohenconfig IOMMU_API
3ab493a0fSOhad Ben-Cohen	bool
4b10f127eSOhad Ben-Cohen
568255b62SJoerg Roedelmenuconfig IOMMU_SUPPORT
668255b62SJoerg Roedel	bool "IOMMU Hardware Support"
768255b62SJoerg Roedel	default y
868255b62SJoerg Roedel	---help---
968255b62SJoerg Roedel	  Say Y here if you want to compile device drivers for IO Memory
1068255b62SJoerg Roedel	  Management Units into the kernel. These devices usually allow to
1168255b62SJoerg Roedel	  remap DMA requests and/or remap interrupts from other devices on the
1268255b62SJoerg Roedel	  system.
1368255b62SJoerg Roedel
1468255b62SJoerg Roedelif IOMMU_SUPPORT
1568255b62SJoerg Roedel
164e0ee78fSHiroshi Doyuconfig OF_IOMMU
174e0ee78fSHiroshi Doyu       def_bool y
184e0ee78fSHiroshi Doyu       depends on OF
194e0ee78fSHiroshi Doyu
20695093e3SVarun Sethiconfig FSL_PAMU
21695093e3SVarun Sethi	bool "Freescale IOMMU support"
22695093e3SVarun Sethi	depends on PPC_E500MC
23695093e3SVarun Sethi	select IOMMU_API
24695093e3SVarun Sethi	select GENERIC_ALLOCATOR
25695093e3SVarun Sethi	help
26695093e3SVarun Sethi	  Freescale PAMU support. PAMU is the IOMMU present on Freescale QorIQ platforms.
27695093e3SVarun Sethi	  PAMU can authorize memory access, remap the memory address, and remap I/O
28695093e3SVarun Sethi	  transaction types.
29695093e3SVarun Sethi
30b10f127eSOhad Ben-Cohen# MSM IOMMU support
31b10f127eSOhad Ben-Cohenconfig MSM_IOMMU
32b10f127eSOhad Ben-Cohen	bool "MSM IOMMU Support"
33b10f127eSOhad Ben-Cohen	depends on ARCH_MSM8X60 || ARCH_MSM8960
34b10f127eSOhad Ben-Cohen	select IOMMU_API
35b10f127eSOhad Ben-Cohen	help
36b10f127eSOhad Ben-Cohen	  Support for the IOMMUs found on certain Qualcomm SOCs.
37b10f127eSOhad Ben-Cohen	  These IOMMUs allow virtualization of the address space used by most
38b10f127eSOhad Ben-Cohen	  cores within the multimedia subsystem.
39b10f127eSOhad Ben-Cohen
40b10f127eSOhad Ben-Cohen	  If unsure, say N here.
41b10f127eSOhad Ben-Cohen
42b10f127eSOhad Ben-Cohenconfig IOMMU_PGTABLES_L2
43b10f127eSOhad Ben-Cohen	def_bool y
44b10f127eSOhad Ben-Cohen	depends on MSM_IOMMU && MMU && SMP && CPU_DCACHE_DISABLE=n
4529b68415SOhad Ben-Cohen
4629b68415SOhad Ben-Cohen# AMD IOMMU support
4729b68415SOhad Ben-Cohenconfig AMD_IOMMU
4829b68415SOhad Ben-Cohen	bool "AMD IOMMU support"
4929b68415SOhad Ben-Cohen	select SWIOTLB
5029b68415SOhad Ben-Cohen	select PCI_MSI
5152815b75SJoerg Roedel	select PCI_ATS
5252815b75SJoerg Roedel	select PCI_PRI
5352815b75SJoerg Roedel	select PCI_PASID
5429b68415SOhad Ben-Cohen	select IOMMU_API
550dbc6078SThomas Petazzoni	depends on X86_64 && PCI && ACPI
5629b68415SOhad Ben-Cohen	---help---
5729b68415SOhad Ben-Cohen	  With this option you can enable support for AMD IOMMU hardware in
5829b68415SOhad Ben-Cohen	  your system. An IOMMU is a hardware component which provides
5929b68415SOhad Ben-Cohen	  remapping of DMA memory accesses from devices. With an AMD IOMMU you
6059bf8964SMasanari Iida	  can isolate the DMA memory of different devices and protect the
6129b68415SOhad Ben-Cohen	  system from misbehaving device drivers or hardware.
6229b68415SOhad Ben-Cohen
6329b68415SOhad Ben-Cohen	  You can find out if your system has an AMD IOMMU if you look into
6429b68415SOhad Ben-Cohen	  your BIOS for an option to enable it or if you have an IVRS ACPI
6529b68415SOhad Ben-Cohen	  table.
6629b68415SOhad Ben-Cohen
6729b68415SOhad Ben-Cohenconfig AMD_IOMMU_STATS
6829b68415SOhad Ben-Cohen	bool "Export AMD IOMMU statistics to debugfs"
6929b68415SOhad Ben-Cohen	depends on AMD_IOMMU
7029b68415SOhad Ben-Cohen	select DEBUG_FS
7129b68415SOhad Ben-Cohen	---help---
7229b68415SOhad Ben-Cohen	  This option enables code in the AMD IOMMU driver to collect various
7329b68415SOhad Ben-Cohen	  statistics about whats happening in the driver and exports that
7429b68415SOhad Ben-Cohen	  information to userspace via debugfs.
7529b68415SOhad Ben-Cohen	  If unsure, say N.
76166e9278SOhad Ben-Cohen
77e3c495c7SJoerg Roedelconfig AMD_IOMMU_V2
78a446e219SKees Cook	tristate "AMD IOMMU Version 2 driver"
79e5cac32cSBorislav Petkov	depends on AMD_IOMMU
808736b2c3SJoerg Roedel	select MMU_NOTIFIER
81e3c495c7SJoerg Roedel	---help---
82e3c495c7SJoerg Roedel	  This option enables support for the AMD IOMMUv2 features of the IOMMU
83e3c495c7SJoerg Roedel	  hardware. Select this option if you want to use devices that support
8459bf8964SMasanari Iida	  the PCI PRI and PASID interface.
85e3c495c7SJoerg Roedel
86166e9278SOhad Ben-Cohen# Intel IOMMU support
87d3f13810SSuresh Siddhaconfig DMAR_TABLE
88d3f13810SSuresh Siddha	bool
89d3f13810SSuresh Siddha
90d3f13810SSuresh Siddhaconfig INTEL_IOMMU
91d3f13810SSuresh Siddha	bool "Support for Intel IOMMU using DMA Remapping Devices"
92166e9278SOhad Ben-Cohen	depends on PCI_MSI && ACPI && (X86 || IA64_GENERIC)
93166e9278SOhad Ben-Cohen	select IOMMU_API
94d3f13810SSuresh Siddha	select DMAR_TABLE
95166e9278SOhad Ben-Cohen	help
96166e9278SOhad Ben-Cohen	  DMA remapping (DMAR) devices support enables independent address
97166e9278SOhad Ben-Cohen	  translations for Direct Memory Access (DMA) from devices.
98166e9278SOhad Ben-Cohen	  These DMA remapping devices are reported via ACPI tables
99166e9278SOhad Ben-Cohen	  and include PCI device scope covered by these DMA
100166e9278SOhad Ben-Cohen	  remapping devices.
101166e9278SOhad Ben-Cohen
102d3f13810SSuresh Siddhaconfig INTEL_IOMMU_DEFAULT_ON
103166e9278SOhad Ben-Cohen	def_bool y
104d3f13810SSuresh Siddha	prompt "Enable Intel DMA Remapping Devices by default"
105d3f13810SSuresh Siddha	depends on INTEL_IOMMU
106166e9278SOhad Ben-Cohen	help
107166e9278SOhad Ben-Cohen	  Selecting this option will enable a DMAR device at boot time if
108166e9278SOhad Ben-Cohen	  one is found. If this option is not selected, DMAR support can
109166e9278SOhad Ben-Cohen	  be enabled by passing intel_iommu=on to the kernel.
110166e9278SOhad Ben-Cohen
111d3f13810SSuresh Siddhaconfig INTEL_IOMMU_BROKEN_GFX_WA
112166e9278SOhad Ben-Cohen	bool "Workaround broken graphics drivers (going away soon)"
113d3f13810SSuresh Siddha	depends on INTEL_IOMMU && BROKEN && X86
114166e9278SOhad Ben-Cohen	---help---
115166e9278SOhad Ben-Cohen	  Current Graphics drivers tend to use physical address
116166e9278SOhad Ben-Cohen	  for DMA and avoid using DMA APIs. Setting this config
117166e9278SOhad Ben-Cohen	  option permits the IOMMU driver to set a unity map for
118166e9278SOhad Ben-Cohen	  all the OS-visible memory. Hence the driver can continue
119166e9278SOhad Ben-Cohen	  to use physical addresses for DMA, at least until this
120166e9278SOhad Ben-Cohen	  option is removed in the 2.6.32 kernel.
121166e9278SOhad Ben-Cohen
122d3f13810SSuresh Siddhaconfig INTEL_IOMMU_FLOPPY_WA
123166e9278SOhad Ben-Cohen	def_bool y
124d3f13810SSuresh Siddha	depends on INTEL_IOMMU && X86
125166e9278SOhad Ben-Cohen	---help---
126166e9278SOhad Ben-Cohen	  Floppy disk drivers are known to bypass DMA API calls
127166e9278SOhad Ben-Cohen	  thereby failing to work when IOMMU is enabled. This
128166e9278SOhad Ben-Cohen	  workaround will setup a 1:1 mapping for the first
129166e9278SOhad Ben-Cohen	  16MiB to make floppy (an ISA device) work.
130166e9278SOhad Ben-Cohen
131d3f13810SSuresh Siddhaconfig IRQ_REMAP
132a446e219SKees Cook	bool "Support for Interrupt Remapping"
133a446e219SKees Cook	depends on X86_64 && X86_IO_APIC && PCI_MSI && ACPI
134d3f13810SSuresh Siddha	select DMAR_TABLE
135166e9278SOhad Ben-Cohen	---help---
136166e9278SOhad Ben-Cohen	  Supports Interrupt remapping for IO-APIC and MSI devices.
137166e9278SOhad Ben-Cohen	  To use x2apic mode in the CPU's which support x2APIC enhancements or
138166e9278SOhad Ben-Cohen	  to support platforms with CPU's having > 8 bit APIC ID, say Y.
13968255b62SJoerg Roedel
140fcf3a6efSOhad Ben-Cohen# OMAP IOMMU support
141fcf3a6efSOhad Ben-Cohenconfig OMAP_IOMMU
142fcf3a6efSOhad Ben-Cohen	bool "OMAP IOMMU Support"
143ae191589SArnd Bergmann	depends on ARCH_OMAP2PLUS
144fcf3a6efSOhad Ben-Cohen	select IOMMU_API
145fcf3a6efSOhad Ben-Cohen
146fcf3a6efSOhad Ben-Cohenconfig OMAP_IOVMM
1477b6d45f1SJoerg Roedel	tristate "OMAP IO Virtual Memory Manager Support"
1487b6d45f1SJoerg Roedel	depends on OMAP_IOMMU
149fcf3a6efSOhad Ben-Cohen
150fcf3a6efSOhad Ben-Cohenconfig OMAP_IOMMU_DEBUG
151fcf3a6efSOhad Ben-Cohen       tristate "Export OMAP IOMMU/IOVMM internals in DebugFS"
152fcf3a6efSOhad Ben-Cohen       depends on OMAP_IOVMM && DEBUG_FS
153fcf3a6efSOhad Ben-Cohen       help
154fcf3a6efSOhad Ben-Cohen         Select this to see extensive information about
155fcf3a6efSOhad Ben-Cohen         the internal state of OMAP IOMMU/IOVMM in debugfs.
156fcf3a6efSOhad Ben-Cohen
157fcf3a6efSOhad Ben-Cohen         Say N unless you know you need this.
158fcf3a6efSOhad Ben-Cohen
159d53e54b4SHiroshi DOYUconfig TEGRA_IOMMU_GART
160d53e54b4SHiroshi DOYU	bool "Tegra GART IOMMU Support"
161d53e54b4SHiroshi DOYU	depends on ARCH_TEGRA_2x_SOC
162d53e54b4SHiroshi DOYU	select IOMMU_API
163d53e54b4SHiroshi DOYU	help
164d53e54b4SHiroshi DOYU	  Enables support for remapping discontiguous physical memory
165d53e54b4SHiroshi DOYU	  shared with the operating system into contiguous I/O virtual
166d53e54b4SHiroshi DOYU	  space through the GART (Graphics Address Relocation Table)
167d53e54b4SHiroshi DOYU	  hardware included on Tegra SoCs.
168d53e54b4SHiroshi DOYU
1697a31f6f4SHiroshi DOYUconfig TEGRA_IOMMU_SMMU
1707a31f6f4SHiroshi DOYU	bool "Tegra SMMU IOMMU Support"
171d300356cSHiroshi Doyu	depends on ARCH_TEGRA && TEGRA_AHB
1727a31f6f4SHiroshi DOYU	select IOMMU_API
1737a31f6f4SHiroshi DOYU	help
1747a31f6f4SHiroshi DOYU	  Enables support for remapping discontiguous physical memory
1757a31f6f4SHiroshi DOYU	  shared with the operating system into contiguous I/O virtual
1767a31f6f4SHiroshi DOYU	  space through the SMMU (System Memory Management Unit)
1777a31f6f4SHiroshi DOYU	  hardware included on Tegra SoCs.
1787a31f6f4SHiroshi DOYU
1792a96536eSKyongHo Choconfig EXYNOS_IOMMU
1802a96536eSKyongHo Cho	bool "Exynos IOMMU Support"
181b28165daSSachin Kamat	depends on ARCH_EXYNOS
1822a96536eSKyongHo Cho	select IOMMU_API
1832a96536eSKyongHo Cho	help
1842a96536eSKyongHo Cho	  Support for the IOMMU (System MMU) of Samsung Exynos application
1855455d700SSachin Kamat	  processor family. This enables H/W multimedia accelerators to see
1865455d700SSachin Kamat	  non-linear physical memory chunks as linear memory in their
1875455d700SSachin Kamat	  address space.
1882a96536eSKyongHo Cho
1892a96536eSKyongHo Cho	  If unsure, say N here.
1902a96536eSKyongHo Cho
1912a96536eSKyongHo Choconfig EXYNOS_IOMMU_DEBUG
1922a96536eSKyongHo Cho	bool "Debugging log for Exynos IOMMU"
1932a96536eSKyongHo Cho	depends on EXYNOS_IOMMU
1942a96536eSKyongHo Cho	help
1952a96536eSKyongHo Cho	  Select this to see the detailed log message that shows what
1965455d700SSachin Kamat	  happens in the IOMMU driver.
1972a96536eSKyongHo Cho
1985455d700SSachin Kamat	  Say N unless you need kernel log message for IOMMU debugging.
1992a96536eSKyongHo Cho
200c2c460f7SHideki EIRAKUconfig SHMOBILE_IPMMU
201c2c460f7SHideki EIRAKU	bool
202c2c460f7SHideki EIRAKU
203c2c460f7SHideki EIRAKUconfig SHMOBILE_IPMMU_TLB
204c2c460f7SHideki EIRAKU	bool
205c2c460f7SHideki EIRAKU
206c2c460f7SHideki EIRAKUconfig SHMOBILE_IOMMU
207c2c460f7SHideki EIRAKU	bool "IOMMU for Renesas IPMMU/IPMMUI"
208c2c460f7SHideki EIRAKU	default n
209f63c4824SLinus Torvalds	depends on ARM
210b8354439SPaul Bolle	depends on ARCH_SHMOBILE || COMPILE_TEST
211c2c460f7SHideki EIRAKU	select IOMMU_API
212c2c460f7SHideki EIRAKU	select ARM_DMA_USE_IOMMU
213c2c460f7SHideki EIRAKU	select SHMOBILE_IPMMU
214c2c460f7SHideki EIRAKU	select SHMOBILE_IPMMU_TLB
215c2c460f7SHideki EIRAKU	help
216c2c460f7SHideki EIRAKU	  Support for Renesas IPMMU/IPMMUI. This option enables
217c2c460f7SHideki EIRAKU	  remapping of DMA memory accesses from all of the IP blocks
218c2c460f7SHideki EIRAKU	  on the ICB.
219c2c460f7SHideki EIRAKU
220c2c460f7SHideki EIRAKU	  Warning: Drivers (including userspace drivers of UIO
221c2c460f7SHideki EIRAKU	  devices) of the IP blocks on the ICB *must* use addresses
222c2c460f7SHideki EIRAKU	  allocated from the IPMMU (iova) for DMA with this option
223c2c460f7SHideki EIRAKU	  enabled.
224c2c460f7SHideki EIRAKU
225c2c460f7SHideki EIRAKU	  If unsure, say N.
226c2c460f7SHideki EIRAKU
227c2c460f7SHideki EIRAKUchoice
228c2c460f7SHideki EIRAKU	prompt "IPMMU/IPMMUI address space size"
229c2c460f7SHideki EIRAKU	default SHMOBILE_IOMMU_ADDRSIZE_2048MB
230c2c460f7SHideki EIRAKU	depends on SHMOBILE_IOMMU
231c2c460f7SHideki EIRAKU	help
232c2c460f7SHideki EIRAKU	  This option sets IPMMU/IPMMUI address space size by
233c2c460f7SHideki EIRAKU	  adjusting the 1st level page table size. The page table size
234c2c460f7SHideki EIRAKU	  is calculated as follows:
235c2c460f7SHideki EIRAKU
236c2c460f7SHideki EIRAKU	      page table size = number of page table entries * 4 bytes
237c2c460f7SHideki EIRAKU	      number of page table entries = address space size / 1 MiB
238c2c460f7SHideki EIRAKU
239c2c460f7SHideki EIRAKU	  For example, when the address space size is 2048 MiB, the
240c2c460f7SHideki EIRAKU	  1st level page table size is 8192 bytes.
241c2c460f7SHideki EIRAKU
242c2c460f7SHideki EIRAKU	config SHMOBILE_IOMMU_ADDRSIZE_2048MB
243c2c460f7SHideki EIRAKU		bool "2 GiB"
244c2c460f7SHideki EIRAKU
245c2c460f7SHideki EIRAKU	config SHMOBILE_IOMMU_ADDRSIZE_1024MB
246c2c460f7SHideki EIRAKU		bool "1 GiB"
247c2c460f7SHideki EIRAKU
248c2c460f7SHideki EIRAKU	config SHMOBILE_IOMMU_ADDRSIZE_512MB
249c2c460f7SHideki EIRAKU		bool "512 MiB"
250c2c460f7SHideki EIRAKU
251c2c460f7SHideki EIRAKU	config SHMOBILE_IOMMU_ADDRSIZE_256MB
252c2c460f7SHideki EIRAKU		bool "256 MiB"
253c2c460f7SHideki EIRAKU
254c2c460f7SHideki EIRAKU	config SHMOBILE_IOMMU_ADDRSIZE_128MB
255c2c460f7SHideki EIRAKU		bool "128 MiB"
256c2c460f7SHideki EIRAKU
257c2c460f7SHideki EIRAKU	config SHMOBILE_IOMMU_ADDRSIZE_64MB
258c2c460f7SHideki EIRAKU		bool "64 MiB"
259c2c460f7SHideki EIRAKU
260c2c460f7SHideki EIRAKU	config SHMOBILE_IOMMU_ADDRSIZE_32MB
261c2c460f7SHideki EIRAKU		bool "32 MiB"
262c2c460f7SHideki EIRAKU
263c2c460f7SHideki EIRAKUendchoice
264c2c460f7SHideki EIRAKU
265c2c460f7SHideki EIRAKUconfig SHMOBILE_IOMMU_L1SIZE
266c2c460f7SHideki EIRAKU	int
267c2c460f7SHideki EIRAKU	default 8192 if SHMOBILE_IOMMU_ADDRSIZE_2048MB
268c2c460f7SHideki EIRAKU	default 4096 if SHMOBILE_IOMMU_ADDRSIZE_1024MB
269c2c460f7SHideki EIRAKU	default 2048 if SHMOBILE_IOMMU_ADDRSIZE_512MB
270c2c460f7SHideki EIRAKU	default 1024 if SHMOBILE_IOMMU_ADDRSIZE_256MB
271c2c460f7SHideki EIRAKU	default 512 if SHMOBILE_IOMMU_ADDRSIZE_128MB
272c2c460f7SHideki EIRAKU	default 256 if SHMOBILE_IOMMU_ADDRSIZE_64MB
273c2c460f7SHideki EIRAKU	default 128 if SHMOBILE_IOMMU_ADDRSIZE_32MB
274c2c460f7SHideki EIRAKU
275d25a2a16SLaurent Pinchartconfig IPMMU_VMSA
276d25a2a16SLaurent Pinchart	bool "Renesas VMSA-compatible IPMMU"
277d25a2a16SLaurent Pinchart	depends on ARM_LPAE
278d25a2a16SLaurent Pinchart	depends on ARCH_SHMOBILE || COMPILE_TEST
279d25a2a16SLaurent Pinchart	select IOMMU_API
280d25a2a16SLaurent Pinchart	select ARM_DMA_USE_IOMMU
281d25a2a16SLaurent Pinchart	help
282d25a2a16SLaurent Pinchart	  Support for the Renesas VMSA-compatible IPMMU Renesas found in the
283d25a2a16SLaurent Pinchart	  R-Mobile APE6 and R-Car H2/M2 SoCs.
284d25a2a16SLaurent Pinchart
285d25a2a16SLaurent Pinchart	  If unsure, say N.
286d25a2a16SLaurent Pinchart
2874e13c1acSAlexey Kardashevskiyconfig SPAPR_TCE_IOMMU
2884e13c1acSAlexey Kardashevskiy	bool "sPAPR TCE IOMMU Support"
2895b25199eSAlexey Kardashevskiy	depends on PPC_POWERNV || PPC_PSERIES
2904e13c1acSAlexey Kardashevskiy	select IOMMU_API
2914e13c1acSAlexey Kardashevskiy	help
2924e13c1acSAlexey Kardashevskiy	  Enables bits of IOMMU API required by VFIO. The iommu_ops
2934e13c1acSAlexey Kardashevskiy	  is not implemented as it is not necessary for VFIO.
2944e13c1acSAlexey Kardashevskiy
29545ae7cffSWill Deaconconfig ARM_SMMU
29645ae7cffSWill Deacon	bool "ARM Ltd. System MMU (SMMU) Support"
29745ae7cffSWill Deacon	depends on ARM64 || (ARM_LPAE && OF)
29845ae7cffSWill Deacon	select IOMMU_API
29945ae7cffSWill Deacon	select ARM_DMA_USE_IOMMU if ARM
30045ae7cffSWill Deacon	help
30145ae7cffSWill Deacon	  Support for implementations of the ARM System MMU architecture
30245ae7cffSWill Deacon	  versions 1 and 2. The driver supports both v7l and v8l table
30345ae7cffSWill Deacon	  formats with 4k and 64k page sizes.
30445ae7cffSWill Deacon
30545ae7cffSWill Deacon	  Say Y here if your SoC includes an IOMMU device implementing
30645ae7cffSWill Deacon	  the ARM SMMU architecture.
30745ae7cffSWill Deacon
30868255b62SJoerg Roedelendif # IOMMU_SUPPORT
309