Kconfig 11 KB

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