Kconfig 10 KB

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