Kconfig 9.5 KB

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