Kconfig 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366
  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 HAS_DMA && (ARM || ARM64 || COMPILE_TEST)
  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 HAS_DMA && (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_IOVA
  52. tristate
  53. config OF_IOMMU
  54. def_bool y
  55. depends on OF && IOMMU_API
  56. # IOMMU-agnostic DMA-mapping layer
  57. config IOMMU_DMA
  58. bool
  59. select IOMMU_API
  60. select IOMMU_IOVA
  61. select NEED_SG_DMA_LENGTH
  62. config FSL_PAMU
  63. bool "Freescale IOMMU support"
  64. depends on PPC_E500MC || (COMPILE_TEST && PPC)
  65. select IOMMU_API
  66. select GENERIC_ALLOCATOR
  67. help
  68. Freescale PAMU support. PAMU is the IOMMU present on Freescale QorIQ platforms.
  69. PAMU can authorize memory access, remap the memory address, and remap I/O
  70. transaction types.
  71. # MSM IOMMU support
  72. config MSM_IOMMU
  73. bool "MSM IOMMU Support"
  74. depends on ARM
  75. depends on ARCH_MSM8X60 || ARCH_MSM8960 || COMPILE_TEST
  76. select IOMMU_API
  77. select IOMMU_IO_PGTABLE_ARMV7S
  78. help
  79. Support for the IOMMUs found on certain Qualcomm SOCs.
  80. These IOMMUs allow virtualization of the address space used by most
  81. cores within the multimedia subsystem.
  82. If unsure, say N here.
  83. config IOMMU_PGTABLES_L2
  84. def_bool y
  85. depends on MSM_IOMMU && MMU && SMP && CPU_DCACHE_DISABLE=n
  86. # AMD IOMMU support
  87. config AMD_IOMMU
  88. bool "AMD IOMMU support"
  89. select SWIOTLB
  90. select PCI_MSI
  91. select PCI_ATS
  92. select PCI_PRI
  93. select PCI_PASID
  94. select IOMMU_API
  95. select IOMMU_IOVA
  96. depends on X86_64 && PCI && ACPI
  97. ---help---
  98. With this option you can enable support for AMD IOMMU hardware in
  99. your system. An IOMMU is a hardware component which provides
  100. remapping of DMA memory accesses from devices. With an AMD IOMMU you
  101. can isolate the DMA memory of different devices and protect the
  102. system from misbehaving device drivers or hardware.
  103. You can find out if your system has an AMD IOMMU if you look into
  104. your BIOS for an option to enable it or if you have an IVRS ACPI
  105. table.
  106. config AMD_IOMMU_V2
  107. tristate "AMD IOMMU Version 2 driver"
  108. depends on AMD_IOMMU
  109. select MMU_NOTIFIER
  110. ---help---
  111. This option enables support for the AMD IOMMUv2 features of the IOMMU
  112. hardware. Select this option if you want to use devices that support
  113. the PCI PRI and PASID interface.
  114. # Intel IOMMU support
  115. config DMAR_TABLE
  116. bool
  117. config INTEL_IOMMU
  118. bool "Support for Intel IOMMU using DMA Remapping Devices"
  119. depends on PCI_MSI && ACPI && (X86 || IA64_GENERIC)
  120. select IOMMU_API
  121. select IOMMU_IOVA
  122. select DMAR_TABLE
  123. help
  124. DMA remapping (DMAR) devices support enables independent address
  125. translations for Direct Memory Access (DMA) from devices.
  126. These DMA remapping devices are reported via ACPI tables
  127. and include PCI device scope covered by these DMA
  128. remapping devices.
  129. config INTEL_IOMMU_SVM
  130. bool "Support for Shared Virtual Memory with Intel IOMMU"
  131. depends on INTEL_IOMMU && X86
  132. select PCI_PASID
  133. select MMU_NOTIFIER
  134. help
  135. Shared Virtual Memory (SVM) provides a facility for devices
  136. to access DMA resources through process address space by
  137. means of a Process Address Space ID (PASID).
  138. config INTEL_IOMMU_DEFAULT_ON
  139. def_bool y
  140. prompt "Enable Intel DMA Remapping Devices by default"
  141. depends on INTEL_IOMMU
  142. help
  143. Selecting this option will enable a DMAR device at boot time if
  144. one is found. If this option is not selected, DMAR support can
  145. be enabled by passing intel_iommu=on to the kernel.
  146. config INTEL_IOMMU_BROKEN_GFX_WA
  147. bool "Workaround broken graphics drivers (going away soon)"
  148. depends on INTEL_IOMMU && BROKEN && X86
  149. ---help---
  150. Current Graphics drivers tend to use physical address
  151. for DMA and avoid using DMA APIs. Setting this config
  152. option permits the IOMMU driver to set a unity map for
  153. all the OS-visible memory. Hence the driver can continue
  154. to use physical addresses for DMA, at least until this
  155. option is removed in the 2.6.32 kernel.
  156. config INTEL_IOMMU_FLOPPY_WA
  157. def_bool y
  158. depends on INTEL_IOMMU && X86
  159. ---help---
  160. Floppy disk drivers are known to bypass DMA API calls
  161. thereby failing to work when IOMMU is enabled. This
  162. workaround will setup a 1:1 mapping for the first
  163. 16MiB to make floppy (an ISA device) work.
  164. config IRQ_REMAP
  165. bool "Support for Interrupt Remapping"
  166. depends on X86_64 && X86_IO_APIC && PCI_MSI && ACPI
  167. select DMAR_TABLE
  168. ---help---
  169. Supports Interrupt remapping for IO-APIC and MSI devices.
  170. To use x2apic mode in the CPU's which support x2APIC enhancements or
  171. to support platforms with CPU's having > 8 bit APIC ID, say Y.
  172. # OMAP IOMMU support
  173. config OMAP_IOMMU
  174. bool "OMAP IOMMU Support"
  175. depends on ARM && MMU
  176. depends on ARCH_OMAP2PLUS || COMPILE_TEST
  177. select IOMMU_API
  178. ---help---
  179. The OMAP3 media platform drivers depend on iommu support,
  180. if you need them say Y here.
  181. config OMAP_IOMMU_DEBUG
  182. bool "Export OMAP IOMMU internals in DebugFS"
  183. depends on OMAP_IOMMU && DEBUG_FS
  184. ---help---
  185. Select this to see extensive information about
  186. the internal state of OMAP IOMMU in debugfs.
  187. Say N unless you know you need this.
  188. config ROCKCHIP_IOMMU
  189. bool "Rockchip IOMMU Support"
  190. depends on ARM
  191. depends on ARCH_ROCKCHIP || COMPILE_TEST
  192. select IOMMU_API
  193. select ARM_DMA_USE_IOMMU
  194. help
  195. Support for IOMMUs found on Rockchip rk32xx SOCs.
  196. These IOMMUs allow virtualization of the address space used by most
  197. cores within the multimedia subsystem.
  198. Say Y here if you are using a Rockchip SoC that includes an IOMMU
  199. device.
  200. config TEGRA_IOMMU_GART
  201. bool "Tegra GART IOMMU Support"
  202. depends on ARCH_TEGRA_2x_SOC
  203. select IOMMU_API
  204. help
  205. Enables support for remapping discontiguous physical memory
  206. shared with the operating system into contiguous I/O virtual
  207. space through the GART (Graphics Address Relocation Table)
  208. hardware included on Tegra SoCs.
  209. config TEGRA_IOMMU_SMMU
  210. bool "NVIDIA Tegra SMMU Support"
  211. depends on ARCH_TEGRA
  212. depends on TEGRA_AHB
  213. depends on TEGRA_MC
  214. select IOMMU_API
  215. help
  216. This driver supports the IOMMU hardware (SMMU) found on NVIDIA Tegra
  217. SoCs (Tegra30 up to Tegra210).
  218. config EXYNOS_IOMMU
  219. bool "Exynos IOMMU Support"
  220. depends on ARCH_EXYNOS && MMU
  221. select IOMMU_API
  222. select ARM_DMA_USE_IOMMU
  223. help
  224. Support for the IOMMU (System MMU) of Samsung Exynos application
  225. processor family. This enables H/W multimedia accelerators to see
  226. non-linear physical memory chunks as linear memory in their
  227. address space.
  228. If unsure, say N here.
  229. config EXYNOS_IOMMU_DEBUG
  230. bool "Debugging log for Exynos IOMMU"
  231. depends on EXYNOS_IOMMU
  232. help
  233. Select this to see the detailed log message that shows what
  234. happens in the IOMMU driver.
  235. Say N unless you need kernel log message for IOMMU debugging.
  236. config IPMMU_VMSA
  237. bool "Renesas VMSA-compatible IPMMU"
  238. depends on ARM_LPAE
  239. depends on ARCH_RENESAS || COMPILE_TEST
  240. select IOMMU_API
  241. select IOMMU_IO_PGTABLE_LPAE
  242. select ARM_DMA_USE_IOMMU
  243. help
  244. Support for the Renesas VMSA-compatible IPMMU Renesas found in the
  245. R-Mobile APE6 and R-Car H2/M2 SoCs.
  246. If unsure, say N.
  247. config SPAPR_TCE_IOMMU
  248. bool "sPAPR TCE IOMMU Support"
  249. depends on PPC_POWERNV || PPC_PSERIES
  250. select IOMMU_API
  251. help
  252. Enables bits of IOMMU API required by VFIO. The iommu_ops
  253. is not implemented as it is not necessary for VFIO.
  254. # ARM IOMMU support
  255. config ARM_SMMU
  256. bool "ARM Ltd. System MMU (SMMU) Support"
  257. depends on (ARM64 || ARM) && MMU
  258. select IOMMU_API
  259. select IOMMU_IO_PGTABLE_LPAE
  260. select ARM_DMA_USE_IOMMU if ARM
  261. help
  262. Support for implementations of the ARM System MMU architecture
  263. versions 1 and 2.
  264. Say Y here if your SoC includes an IOMMU device implementing
  265. the ARM SMMU architecture.
  266. config ARM_SMMU_V3
  267. bool "ARM Ltd. System MMU Version 3 (SMMUv3) Support"
  268. depends on ARM64
  269. select IOMMU_API
  270. select IOMMU_IO_PGTABLE_LPAE
  271. select GENERIC_MSI_IRQ_DOMAIN
  272. help
  273. Support for implementations of the ARM System MMU architecture
  274. version 3 providing translation support to a PCIe root complex.
  275. Say Y here if your system includes an IOMMU device implementing
  276. the ARM SMMUv3 architecture.
  277. config S390_IOMMU
  278. def_bool y if S390 && PCI
  279. depends on S390 && PCI
  280. select IOMMU_API
  281. help
  282. Support for the IOMMU API for s390 PCI devices.
  283. config MTK_IOMMU
  284. bool "MTK IOMMU Support"
  285. depends on ARM || ARM64
  286. depends on ARCH_MEDIATEK || COMPILE_TEST
  287. select ARM_DMA_USE_IOMMU
  288. select IOMMU_API
  289. select IOMMU_DMA
  290. select IOMMU_IO_PGTABLE_ARMV7S
  291. select MEMORY
  292. select MTK_SMI
  293. help
  294. Support for the M4U on certain Mediatek SOCs. M4U is MultiMedia
  295. Memory Management Unit. This option enables remapping of DMA memory
  296. accesses for the multimedia subsystem.
  297. If unsure, say N here.
  298. config MTK_IOMMU_V1
  299. bool "MTK IOMMU Version 1 (M4U gen1) Support"
  300. depends on ARM
  301. depends on ARCH_MEDIATEK || COMPILE_TEST
  302. select ARM_DMA_USE_IOMMU
  303. select IOMMU_API
  304. select MEMORY
  305. select MTK_SMI
  306. select COMMON_CLK_MT2701_MMSYS
  307. select COMMON_CLK_MT2701_IMGSYS
  308. select COMMON_CLK_MT2701_VDECSYS
  309. help
  310. Support for the M4U on certain Mediatek SoCs. M4U generation 1 HW is
  311. Multimedia Memory Managememt Unit. This option enables remapping of
  312. DMA memory accesses for the multimedia subsystem.
  313. if unsure, say N here.
  314. endif # IOMMU_SUPPORT