Kconfig 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417
  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_SVM
  160. bool "Support for Shared Virtual Memory with Intel IOMMU"
  161. depends on INTEL_IOMMU && X86
  162. select PCI_PASID
  163. select MMU_NOTIFIER
  164. help
  165. Shared Virtual Memory (SVM) provides a facility for devices
  166. to access DMA resources through process address space by
  167. means of a Process Address Space ID (PASID).
  168. config INTEL_IOMMU_DEFAULT_ON
  169. def_bool y
  170. prompt "Enable Intel DMA Remapping Devices by default"
  171. depends on INTEL_IOMMU
  172. help
  173. Selecting this option will enable a DMAR device at boot time if
  174. one is found. If this option is not selected, DMAR support can
  175. be enabled by passing intel_iommu=on to the kernel.
  176. config INTEL_IOMMU_BROKEN_GFX_WA
  177. bool "Workaround broken graphics drivers (going away soon)"
  178. depends on INTEL_IOMMU && BROKEN && X86
  179. ---help---
  180. Current Graphics drivers tend to use physical address
  181. for DMA and avoid using DMA APIs. Setting this config
  182. option permits the IOMMU driver to set a unity map for
  183. all the OS-visible memory. Hence the driver can continue
  184. to use physical addresses for DMA, at least until this
  185. option is removed in the 2.6.32 kernel.
  186. config INTEL_IOMMU_FLOPPY_WA
  187. def_bool y
  188. depends on INTEL_IOMMU && X86
  189. ---help---
  190. Floppy disk drivers are known to bypass DMA API calls
  191. thereby failing to work when IOMMU is enabled. This
  192. workaround will setup a 1:1 mapping for the first
  193. 16MiB to make floppy (an ISA device) work.
  194. config IRQ_REMAP
  195. bool "Support for Interrupt Remapping"
  196. depends on X86_64 && X86_IO_APIC && PCI_MSI && ACPI
  197. select DMAR_TABLE
  198. ---help---
  199. Supports Interrupt remapping for IO-APIC and MSI devices.
  200. To use x2apic mode in the CPU's which support x2APIC enhancements or
  201. to support platforms with CPU's having > 8 bit APIC ID, say Y.
  202. # OMAP IOMMU support
  203. config OMAP_IOMMU
  204. bool "OMAP IOMMU Support"
  205. depends on ARM && MMU
  206. depends on ARCH_OMAP2PLUS || COMPILE_TEST
  207. select IOMMU_API
  208. ---help---
  209. The OMAP3 media platform drivers depend on iommu support,
  210. if you need them say Y here.
  211. config OMAP_IOMMU_DEBUG
  212. bool "Export OMAP IOMMU internals in DebugFS"
  213. depends on OMAP_IOMMU && DEBUG_FS
  214. ---help---
  215. Select this to see extensive information about
  216. the internal state of OMAP IOMMU in debugfs.
  217. Say N unless you know you need this.
  218. config ROCKCHIP_IOMMU
  219. bool "Rockchip IOMMU Support"
  220. depends on ARM || ARM64
  221. depends on ARCH_ROCKCHIP || COMPILE_TEST
  222. select IOMMU_API
  223. select ARM_DMA_USE_IOMMU
  224. help
  225. Support for IOMMUs found on Rockchip rk32xx SOCs.
  226. These IOMMUs allow virtualization of the address space used by most
  227. cores within the multimedia subsystem.
  228. Say Y here if you are using a Rockchip SoC that includes an IOMMU
  229. device.
  230. config TEGRA_IOMMU_GART
  231. bool "Tegra GART IOMMU Support"
  232. depends on ARCH_TEGRA_2x_SOC
  233. select IOMMU_API
  234. help
  235. Enables support for remapping discontiguous physical memory
  236. shared with the operating system into contiguous I/O virtual
  237. space through the GART (Graphics Address Relocation Table)
  238. hardware included on Tegra SoCs.
  239. config TEGRA_IOMMU_SMMU
  240. bool "NVIDIA Tegra SMMU Support"
  241. depends on ARCH_TEGRA
  242. depends on TEGRA_AHB
  243. depends on TEGRA_MC
  244. select IOMMU_API
  245. help
  246. This driver supports the IOMMU hardware (SMMU) found on NVIDIA Tegra
  247. SoCs (Tegra30 up to Tegra210).
  248. config EXYNOS_IOMMU
  249. bool "Exynos IOMMU Support"
  250. depends on ARCH_EXYNOS && MMU
  251. depends on !CPU_BIG_ENDIAN # revisit driver if we can enable big-endian ptes
  252. select IOMMU_API
  253. select ARM_DMA_USE_IOMMU
  254. help
  255. Support for the IOMMU (System MMU) of Samsung Exynos application
  256. processor family. This enables H/W multimedia accelerators to see
  257. non-linear physical memory chunks as linear memory in their
  258. address space.
  259. If unsure, say N here.
  260. config EXYNOS_IOMMU_DEBUG
  261. bool "Debugging log for Exynos IOMMU"
  262. depends on EXYNOS_IOMMU
  263. help
  264. Select this to see the detailed log message that shows what
  265. happens in the IOMMU driver.
  266. Say N unless you need kernel log message for IOMMU debugging.
  267. config IPMMU_VMSA
  268. bool "Renesas VMSA-compatible IPMMU"
  269. depends on ARM || IOMMU_DMA
  270. depends on ARCH_RENESAS || (COMPILE_TEST && !GENERIC_ATOMIC64)
  271. select IOMMU_API
  272. select IOMMU_IO_PGTABLE_LPAE
  273. select ARM_DMA_USE_IOMMU
  274. help
  275. Support for the Renesas VMSA-compatible IPMMU found in the R-Mobile
  276. APE6, R-Car Gen2, and R-Car Gen3 SoCs.
  277. If unsure, say N.
  278. config SPAPR_TCE_IOMMU
  279. bool "sPAPR TCE IOMMU Support"
  280. depends on PPC_POWERNV || PPC_PSERIES
  281. select IOMMU_API
  282. help
  283. Enables bits of IOMMU API required by VFIO. The iommu_ops
  284. is not implemented as it is not necessary for VFIO.
  285. # ARM IOMMU support
  286. config ARM_SMMU
  287. bool "ARM Ltd. System MMU (SMMU) Support"
  288. depends on (ARM64 || ARM) && MMU
  289. select IOMMU_API
  290. select IOMMU_IO_PGTABLE_LPAE
  291. select ARM_DMA_USE_IOMMU if ARM
  292. help
  293. Support for implementations of the ARM System MMU architecture
  294. versions 1 and 2.
  295. Say Y here if your SoC includes an IOMMU device implementing
  296. the ARM SMMU architecture.
  297. config ARM_SMMU_V3
  298. bool "ARM Ltd. System MMU Version 3 (SMMUv3) Support"
  299. depends on ARM64
  300. select IOMMU_API
  301. select IOMMU_IO_PGTABLE_LPAE
  302. select GENERIC_MSI_IRQ_DOMAIN
  303. help
  304. Support for implementations of the ARM System MMU architecture
  305. version 3 providing translation support to a PCIe root complex.
  306. Say Y here if your system includes an IOMMU device implementing
  307. the ARM SMMUv3 architecture.
  308. config S390_IOMMU
  309. def_bool y if S390 && PCI
  310. depends on S390 && PCI
  311. select IOMMU_API
  312. help
  313. Support for the IOMMU API for s390 PCI devices.
  314. config S390_CCW_IOMMU
  315. bool "S390 CCW IOMMU Support"
  316. depends on S390 && CCW
  317. select IOMMU_API
  318. help
  319. Enables bits of IOMMU API required by VFIO. The iommu_ops
  320. is not implemented as it is not necessary for VFIO.
  321. config MTK_IOMMU
  322. bool "MTK IOMMU Support"
  323. depends on ARM || ARM64
  324. depends on ARCH_MEDIATEK || COMPILE_TEST
  325. select ARM_DMA_USE_IOMMU
  326. select IOMMU_API
  327. select IOMMU_DMA
  328. select IOMMU_IO_PGTABLE_ARMV7S
  329. select MEMORY
  330. select MTK_SMI
  331. help
  332. Support for the M4U on certain Mediatek SOCs. M4U is MultiMedia
  333. Memory Management Unit. This option enables remapping of DMA memory
  334. accesses for the multimedia subsystem.
  335. If unsure, say N here.
  336. config MTK_IOMMU_V1
  337. bool "MTK IOMMU Version 1 (M4U gen1) Support"
  338. depends on ARM
  339. depends on ARCH_MEDIATEK || COMPILE_TEST
  340. select ARM_DMA_USE_IOMMU
  341. select IOMMU_API
  342. select MEMORY
  343. select MTK_SMI
  344. help
  345. Support for the M4U on certain Mediatek SoCs. M4U generation 1 HW is
  346. Multimedia Memory Managememt Unit. This option enables remapping of
  347. DMA memory accesses for the multimedia subsystem.
  348. if unsure, say N here.
  349. config QCOM_IOMMU
  350. # Note: iommu drivers cannot (yet?) be built as modules
  351. bool "Qualcomm IOMMU Support"
  352. depends on ARCH_QCOM || (COMPILE_TEST && !GENERIC_ATOMIC64)
  353. select IOMMU_API
  354. select IOMMU_IO_PGTABLE_LPAE
  355. select ARM_DMA_USE_IOMMU
  356. help
  357. Support for IOMMU on certain Qualcomm SoCs.
  358. endif # IOMMU_SUPPORT