Ohad Ben-Cohen | ab493a0 | 2011-06-02 02:48:05 +0300 | [diff] [blame] | 1 | # IOMMU_API always gets selected by whoever wants it. |
| 2 | config IOMMU_API |
| 3 | bool |
Ohad Ben-Cohen | b10f127 | 2011-06-02 03:20:08 +0300 | [diff] [blame] | 4 | |
Joerg Roedel | 68255b6 | 2011-06-14 15:51:54 +0200 | [diff] [blame] | 5 | menuconfig IOMMU_SUPPORT |
| 6 | bool "IOMMU Hardware Support" |
| 7 | default y |
| 8 | ---help--- |
| 9 | Say Y here if you want to compile device drivers for IO Memory |
| 10 | Management Units into the kernel. These devices usually allow to |
| 11 | remap DMA requests and/or remap interrupts from other devices on the |
| 12 | system. |
| 13 | |
| 14 | if IOMMU_SUPPORT |
| 15 | |
Will Deacon | fdb1d7b | 2014-11-14 17:16:49 +0000 | [diff] [blame^] | 16 | menu "Generic IOMMU Pagetable Support" |
| 17 | |
| 18 | # Selected by the actual pagetable implementations |
| 19 | config IOMMU_IO_PGTABLE |
| 20 | bool |
| 21 | |
| 22 | endmenu |
| 23 | |
Hiroshi Doyu | 4e0ee78 | 2012-06-25 14:23:54 +0300 | [diff] [blame] | 24 | config OF_IOMMU |
| 25 | def_bool y |
Will Deacon | 7eba1d5 | 2014-08-27 16:20:32 +0100 | [diff] [blame] | 26 | depends on OF && IOMMU_API |
Hiroshi Doyu | 4e0ee78 | 2012-06-25 14:23:54 +0300 | [diff] [blame] | 27 | |
Varun Sethi | 695093e | 2013-07-15 10:20:57 +0530 | [diff] [blame] | 28 | config FSL_PAMU |
| 29 | bool "Freescale IOMMU support" |
| 30 | depends on PPC_E500MC |
| 31 | select IOMMU_API |
| 32 | select GENERIC_ALLOCATOR |
| 33 | help |
| 34 | Freescale PAMU support. PAMU is the IOMMU present on Freescale QorIQ platforms. |
| 35 | PAMU can authorize memory access, remap the memory address, and remap I/O |
| 36 | transaction types. |
| 37 | |
Ohad Ben-Cohen | b10f127 | 2011-06-02 03:20:08 +0300 | [diff] [blame] | 38 | # MSM IOMMU support |
| 39 | config MSM_IOMMU |
| 40 | bool "MSM IOMMU Support" |
| 41 | depends on ARCH_MSM8X60 || ARCH_MSM8960 |
| 42 | select IOMMU_API |
| 43 | help |
| 44 | Support for the IOMMUs found on certain Qualcomm SOCs. |
| 45 | These IOMMUs allow virtualization of the address space used by most |
| 46 | cores within the multimedia subsystem. |
| 47 | |
| 48 | If unsure, say N here. |
| 49 | |
| 50 | config IOMMU_PGTABLES_L2 |
| 51 | def_bool y |
| 52 | depends on MSM_IOMMU && MMU && SMP && CPU_DCACHE_DISABLE=n |
Ohad Ben-Cohen | 29b6841 | 2011-06-05 18:22:18 +0300 | [diff] [blame] | 53 | |
| 54 | # AMD IOMMU support |
| 55 | config AMD_IOMMU |
| 56 | bool "AMD IOMMU support" |
| 57 | select SWIOTLB |
| 58 | select PCI_MSI |
Joerg Roedel | 52815b7 | 2011-11-17 17:24:28 +0100 | [diff] [blame] | 59 | select PCI_ATS |
| 60 | select PCI_PRI |
| 61 | select PCI_PASID |
Ohad Ben-Cohen | 29b6841 | 2011-06-05 18:22:18 +0300 | [diff] [blame] | 62 | select IOMMU_API |
Thomas Petazzoni | 0dbc607 | 2013-10-03 11:59:14 +0200 | [diff] [blame] | 63 | depends on X86_64 && PCI && ACPI |
Ohad Ben-Cohen | 29b6841 | 2011-06-05 18:22:18 +0300 | [diff] [blame] | 64 | ---help--- |
| 65 | With this option you can enable support for AMD IOMMU hardware in |
| 66 | your system. An IOMMU is a hardware component which provides |
| 67 | remapping of DMA memory accesses from devices. With an AMD IOMMU you |
Masanari Iida | 59bf896 | 2012-04-18 00:01:21 +0900 | [diff] [blame] | 68 | can isolate the DMA memory of different devices and protect the |
Ohad Ben-Cohen | 29b6841 | 2011-06-05 18:22:18 +0300 | [diff] [blame] | 69 | system from misbehaving device drivers or hardware. |
| 70 | |
| 71 | You can find out if your system has an AMD IOMMU if you look into |
| 72 | your BIOS for an option to enable it or if you have an IVRS ACPI |
| 73 | table. |
| 74 | |
| 75 | config AMD_IOMMU_STATS |
| 76 | bool "Export AMD IOMMU statistics to debugfs" |
| 77 | depends on AMD_IOMMU |
| 78 | select DEBUG_FS |
| 79 | ---help--- |
| 80 | This option enables code in the AMD IOMMU driver to collect various |
| 81 | statistics about whats happening in the driver and exports that |
| 82 | information to userspace via debugfs. |
| 83 | If unsure, say N. |
Ohad Ben-Cohen | 166e927 | 2011-06-10 21:42:27 +0300 | [diff] [blame] | 84 | |
Joerg Roedel | e3c495c | 2011-11-09 12:31:15 +0100 | [diff] [blame] | 85 | config AMD_IOMMU_V2 |
Kees Cook | a446e21 | 2013-01-16 18:53:39 -0800 | [diff] [blame] | 86 | tristate "AMD IOMMU Version 2 driver" |
Borislav Petkov | e5cac32 | 2014-07-10 12:44:56 +0200 | [diff] [blame] | 87 | depends on AMD_IOMMU |
Joerg Roedel | 8736b2c | 2011-11-24 16:21:52 +0100 | [diff] [blame] | 88 | select MMU_NOTIFIER |
Joerg Roedel | e3c495c | 2011-11-09 12:31:15 +0100 | [diff] [blame] | 89 | ---help--- |
| 90 | This option enables support for the AMD IOMMUv2 features of the IOMMU |
| 91 | hardware. Select this option if you want to use devices that support |
Masanari Iida | 59bf896 | 2012-04-18 00:01:21 +0900 | [diff] [blame] | 92 | the PCI PRI and PASID interface. |
Joerg Roedel | e3c495c | 2011-11-09 12:31:15 +0100 | [diff] [blame] | 93 | |
Ohad Ben-Cohen | 166e927 | 2011-06-10 21:42:27 +0300 | [diff] [blame] | 94 | # Intel IOMMU support |
Suresh Siddha | d3f1381 | 2011-08-23 17:05:25 -0700 | [diff] [blame] | 95 | config DMAR_TABLE |
| 96 | bool |
| 97 | |
| 98 | config INTEL_IOMMU |
| 99 | bool "Support for Intel IOMMU using DMA Remapping Devices" |
Ohad Ben-Cohen | 166e927 | 2011-06-10 21:42:27 +0300 | [diff] [blame] | 100 | depends on PCI_MSI && ACPI && (X86 || IA64_GENERIC) |
| 101 | select IOMMU_API |
Suresh Siddha | d3f1381 | 2011-08-23 17:05:25 -0700 | [diff] [blame] | 102 | select DMAR_TABLE |
Ohad Ben-Cohen | 166e927 | 2011-06-10 21:42:27 +0300 | [diff] [blame] | 103 | help |
| 104 | DMA remapping (DMAR) devices support enables independent address |
| 105 | translations for Direct Memory Access (DMA) from devices. |
| 106 | These DMA remapping devices are reported via ACPI tables |
| 107 | and include PCI device scope covered by these DMA |
| 108 | remapping devices. |
| 109 | |
Suresh Siddha | d3f1381 | 2011-08-23 17:05:25 -0700 | [diff] [blame] | 110 | config INTEL_IOMMU_DEFAULT_ON |
Ohad Ben-Cohen | 166e927 | 2011-06-10 21:42:27 +0300 | [diff] [blame] | 111 | def_bool y |
Suresh Siddha | d3f1381 | 2011-08-23 17:05:25 -0700 | [diff] [blame] | 112 | prompt "Enable Intel DMA Remapping Devices by default" |
| 113 | depends on INTEL_IOMMU |
Ohad Ben-Cohen | 166e927 | 2011-06-10 21:42:27 +0300 | [diff] [blame] | 114 | help |
| 115 | Selecting this option will enable a DMAR device at boot time if |
| 116 | one is found. If this option is not selected, DMAR support can |
| 117 | be enabled by passing intel_iommu=on to the kernel. |
| 118 | |
Suresh Siddha | d3f1381 | 2011-08-23 17:05:25 -0700 | [diff] [blame] | 119 | config INTEL_IOMMU_BROKEN_GFX_WA |
Ohad Ben-Cohen | 166e927 | 2011-06-10 21:42:27 +0300 | [diff] [blame] | 120 | bool "Workaround broken graphics drivers (going away soon)" |
Suresh Siddha | d3f1381 | 2011-08-23 17:05:25 -0700 | [diff] [blame] | 121 | depends on INTEL_IOMMU && BROKEN && X86 |
Ohad Ben-Cohen | 166e927 | 2011-06-10 21:42:27 +0300 | [diff] [blame] | 122 | ---help--- |
| 123 | Current Graphics drivers tend to use physical address |
| 124 | for DMA and avoid using DMA APIs. Setting this config |
| 125 | option permits the IOMMU driver to set a unity map for |
| 126 | all the OS-visible memory. Hence the driver can continue |
| 127 | to use physical addresses for DMA, at least until this |
| 128 | option is removed in the 2.6.32 kernel. |
| 129 | |
Suresh Siddha | d3f1381 | 2011-08-23 17:05:25 -0700 | [diff] [blame] | 130 | config INTEL_IOMMU_FLOPPY_WA |
Ohad Ben-Cohen | 166e927 | 2011-06-10 21:42:27 +0300 | [diff] [blame] | 131 | def_bool y |
Suresh Siddha | d3f1381 | 2011-08-23 17:05:25 -0700 | [diff] [blame] | 132 | depends on INTEL_IOMMU && X86 |
Ohad Ben-Cohen | 166e927 | 2011-06-10 21:42:27 +0300 | [diff] [blame] | 133 | ---help--- |
| 134 | Floppy disk drivers are known to bypass DMA API calls |
| 135 | thereby failing to work when IOMMU is enabled. This |
| 136 | workaround will setup a 1:1 mapping for the first |
| 137 | 16MiB to make floppy (an ISA device) work. |
| 138 | |
Suresh Siddha | d3f1381 | 2011-08-23 17:05:25 -0700 | [diff] [blame] | 139 | config IRQ_REMAP |
Kees Cook | a446e21 | 2013-01-16 18:53:39 -0800 | [diff] [blame] | 140 | bool "Support for Interrupt Remapping" |
| 141 | depends on X86_64 && X86_IO_APIC && PCI_MSI && ACPI |
Suresh Siddha | d3f1381 | 2011-08-23 17:05:25 -0700 | [diff] [blame] | 142 | select DMAR_TABLE |
Ohad Ben-Cohen | 166e927 | 2011-06-10 21:42:27 +0300 | [diff] [blame] | 143 | ---help--- |
| 144 | Supports Interrupt remapping for IO-APIC and MSI devices. |
| 145 | To use x2apic mode in the CPU's which support x2APIC enhancements or |
| 146 | to support platforms with CPU's having > 8 bit APIC ID, say Y. |
Joerg Roedel | 68255b6 | 2011-06-14 15:51:54 +0200 | [diff] [blame] | 147 | |
Ohad Ben-Cohen | fcf3a6e | 2011-08-15 23:21:41 +0300 | [diff] [blame] | 148 | # OMAP IOMMU support |
| 149 | config OMAP_IOMMU |
| 150 | bool "OMAP IOMMU Support" |
Arnd Bergmann | ae19158 | 2013-03-05 23:16:48 +0100 | [diff] [blame] | 151 | depends on ARCH_OMAP2PLUS |
Ohad Ben-Cohen | fcf3a6e | 2011-08-15 23:21:41 +0300 | [diff] [blame] | 152 | select IOMMU_API |
| 153 | |
Ohad Ben-Cohen | fcf3a6e | 2011-08-15 23:21:41 +0300 | [diff] [blame] | 154 | config OMAP_IOMMU_DEBUG |
Suman Anna | 61c7535 | 2014-10-22 17:22:30 -0500 | [diff] [blame] | 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. |
Ohad Ben-Cohen | fcf3a6e | 2011-08-15 23:21:41 +0300 | [diff] [blame] | 160 | |
Suman Anna | 61c7535 | 2014-10-22 17:22:30 -0500 | [diff] [blame] | 161 | Say N unless you know you need this. |
Ohad Ben-Cohen | fcf3a6e | 2011-08-15 23:21:41 +0300 | [diff] [blame] | 162 | |
Daniel Kurtz | c68a292 | 2014-11-03 10:53:27 +0800 | [diff] [blame] | 163 | config ROCKCHIP_IOMMU |
| 164 | bool "Rockchip IOMMU Support" |
Joerg Roedel | 1117588 | 2014-11-03 18:16:56 +0100 | [diff] [blame] | 165 | depends on ARM |
| 166 | depends on ARCH_ROCKCHIP || COMPILE_TEST |
Daniel Kurtz | c68a292 | 2014-11-03 10:53:27 +0800 | [diff] [blame] | 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. |
Ohad Ben-Cohen | ab493a0 | 2011-06-02 02:48:05 +0300 | [diff] [blame] | 175 | |
Hiroshi DOYU | d53e54b | 2011-11-16 17:36:37 +0200 | [diff] [blame] | 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 | |
Hiroshi DOYU | 7a31f6f | 2011-11-17 07:31:31 +0200 | [diff] [blame] | 186 | config TEGRA_IOMMU_SMMU |
Thierry Reding | 8918465 | 2014-04-16 09:24:44 +0200 | [diff] [blame] | 187 | bool "NVIDIA Tegra SMMU Support" |
| 188 | depends on ARCH_TEGRA |
| 189 | depends on TEGRA_AHB |
| 190 | depends on TEGRA_MC |
Hiroshi DOYU | 7a31f6f | 2011-11-17 07:31:31 +0200 | [diff] [blame] | 191 | select IOMMU_API |
| 192 | help |
Thierry Reding | 8918465 | 2014-04-16 09:24:44 +0200 | [diff] [blame] | 193 | This driver supports the IOMMU hardware (SMMU) found on NVIDIA Tegra |
| 194 | SoCs (Tegra30 up to Tegra124). |
Hiroshi DOYU | 7a31f6f | 2011-11-17 07:31:31 +0200 | [diff] [blame] | 195 | |
KyongHo Cho | 2a96536 | 2012-05-12 05:56:09 +0900 | [diff] [blame] | 196 | config EXYNOS_IOMMU |
| 197 | bool "Exynos IOMMU Support" |
Mark Brown | 20911ce | 2014-12-15 15:54:42 +0000 | [diff] [blame] | 198 | depends on ARCH_EXYNOS && ARM |
KyongHo Cho | 2a96536 | 2012-05-12 05:56:09 +0900 | [diff] [blame] | 199 | select IOMMU_API |
Tushar Behera | 4802c1d | 2014-07-04 15:01:08 +0530 | [diff] [blame] | 200 | select ARM_DMA_USE_IOMMU |
KyongHo Cho | 2a96536 | 2012-05-12 05:56:09 +0900 | [diff] [blame] | 201 | help |
Sachin Kamat | 5455d70 | 2014-05-22 09:50:55 +0530 | [diff] [blame] | 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. |
KyongHo Cho | 2a96536 | 2012-05-12 05:56:09 +0900 | [diff] [blame] | 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 |
Sachin Kamat | 5455d70 | 2014-05-22 09:50:55 +0530 | [diff] [blame] | 214 | happens in the IOMMU driver. |
KyongHo Cho | 2a96536 | 2012-05-12 05:56:09 +0900 | [diff] [blame] | 215 | |
Sachin Kamat | 5455d70 | 2014-05-22 09:50:55 +0530 | [diff] [blame] | 216 | Say N unless you need kernel log message for IOMMU debugging. |
KyongHo Cho | 2a96536 | 2012-05-12 05:56:09 +0900 | [diff] [blame] | 217 | |
Hideki EIRAKU | c2c460f | 2013-01-21 19:54:26 +0900 | [diff] [blame] | 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 |
Linus Torvalds | f63c482 | 2013-11-15 18:57:42 -0800 | [diff] [blame] | 227 | depends on ARM |
Paul Bolle | b835443 | 2014-02-08 22:21:54 +0100 | [diff] [blame] | 228 | depends on ARCH_SHMOBILE || COMPILE_TEST |
Hideki EIRAKU | c2c460f | 2013-01-21 19:54:26 +0900 | [diff] [blame] | 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 | |
Laurent Pinchart | d25a2a1 | 2014-04-02 12:47:37 +0200 | [diff] [blame] | 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 | |
Alexey Kardashevskiy | 4e13c1a | 2013-05-21 13:33:09 +1000 | [diff] [blame] | 305 | config SPAPR_TCE_IOMMU |
| 306 | bool "sPAPR TCE IOMMU Support" |
Alexey Kardashevskiy | 5b25199 | 2013-05-21 13:33:11 +1000 | [diff] [blame] | 307 | depends on PPC_POWERNV || PPC_PSERIES |
Alexey Kardashevskiy | 4e13c1a | 2013-05-21 13:33:09 +1000 | [diff] [blame] | 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 | |
Will Deacon | 45ae7cf | 2013-06-24 18:31:25 +0100 | [diff] [blame] | 313 | config ARM_SMMU |
| 314 | bool "ARM Ltd. System MMU (SMMU) Support" |
| 315 | depends on ARM64 || (ARM_LPAE && OF) |
| 316 | select IOMMU_API |
| 317 | select ARM_DMA_USE_IOMMU if ARM |
| 318 | help |
| 319 | Support for implementations of the ARM System MMU architecture |
| 320 | versions 1 and 2. The driver supports both v7l and v8l table |
| 321 | formats with 4k and 64k page sizes. |
| 322 | |
| 323 | Say Y here if your SoC includes an IOMMU device implementing |
| 324 | the ARM SMMU architecture. |
| 325 | |
Ohad Ben-Cohen | ab493a0 | 2011-06-02 02:48:05 +0300 | [diff] [blame] | 326 | endif # IOMMU_SUPPORT |