Kconfig 13 KB

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