18c2ecf20Sopenharmony_ci# SPDX-License-Identifier: GPL-2.0-only
28c2ecf20Sopenharmony_ci# Intel IOMMU support
38c2ecf20Sopenharmony_ciconfig DMAR_TABLE
48c2ecf20Sopenharmony_ci	bool
58c2ecf20Sopenharmony_ci
68c2ecf20Sopenharmony_ciconfig INTEL_IOMMU
78c2ecf20Sopenharmony_ci	bool "Support for Intel IOMMU using DMA Remapping Devices"
88c2ecf20Sopenharmony_ci	depends on PCI_MSI && ACPI && (X86 || IA64)
98c2ecf20Sopenharmony_ci	select DMA_OPS
108c2ecf20Sopenharmony_ci	select IOMMU_API
118c2ecf20Sopenharmony_ci	select IOMMU_IOVA
128c2ecf20Sopenharmony_ci	select NEED_DMA_MAP_STATE
138c2ecf20Sopenharmony_ci	select DMAR_TABLE
148c2ecf20Sopenharmony_ci	select SWIOTLB
158c2ecf20Sopenharmony_ci	select IOASID
168c2ecf20Sopenharmony_ci	help
178c2ecf20Sopenharmony_ci	  DMA remapping (DMAR) devices support enables independent address
188c2ecf20Sopenharmony_ci	  translations for Direct Memory Access (DMA) from devices.
198c2ecf20Sopenharmony_ci	  These DMA remapping devices are reported via ACPI tables
208c2ecf20Sopenharmony_ci	  and include PCI device scope covered by these DMA
218c2ecf20Sopenharmony_ci	  remapping devices.
228c2ecf20Sopenharmony_ci
238c2ecf20Sopenharmony_ciconfig INTEL_IOMMU_DEBUGFS
248c2ecf20Sopenharmony_ci	bool "Export Intel IOMMU internals in Debugfs"
258c2ecf20Sopenharmony_ci	depends on INTEL_IOMMU && IOMMU_DEBUGFS
268c2ecf20Sopenharmony_ci	help
278c2ecf20Sopenharmony_ci	  !!!WARNING!!!
288c2ecf20Sopenharmony_ci
298c2ecf20Sopenharmony_ci	  DO NOT ENABLE THIS OPTION UNLESS YOU REALLY KNOW WHAT YOU ARE DOING!!!
308c2ecf20Sopenharmony_ci
318c2ecf20Sopenharmony_ci	  Expose Intel IOMMU internals in Debugfs.
328c2ecf20Sopenharmony_ci
338c2ecf20Sopenharmony_ci	  This option is -NOT- intended for production environments, and should
348c2ecf20Sopenharmony_ci	  only be enabled for debugging Intel IOMMU.
358c2ecf20Sopenharmony_ci
368c2ecf20Sopenharmony_ciconfig INTEL_IOMMU_SVM
378c2ecf20Sopenharmony_ci	bool "Support for Shared Virtual Memory with Intel IOMMU"
388c2ecf20Sopenharmony_ci	depends on INTEL_IOMMU && X86_64
398c2ecf20Sopenharmony_ci	select PCI_PASID
408c2ecf20Sopenharmony_ci	select PCI_PRI
418c2ecf20Sopenharmony_ci	select MMU_NOTIFIER
428c2ecf20Sopenharmony_ci	select IOASID
438c2ecf20Sopenharmony_ci	help
448c2ecf20Sopenharmony_ci	  Shared Virtual Memory (SVM) provides a facility for devices
458c2ecf20Sopenharmony_ci	  to access DMA resources through process address space by
468c2ecf20Sopenharmony_ci	  means of a Process Address Space ID (PASID).
478c2ecf20Sopenharmony_ci
488c2ecf20Sopenharmony_ciconfig INTEL_IOMMU_DEFAULT_ON
498c2ecf20Sopenharmony_ci	def_bool y
508c2ecf20Sopenharmony_ci	prompt "Enable Intel DMA Remapping Devices by default"
518c2ecf20Sopenharmony_ci	depends on INTEL_IOMMU
528c2ecf20Sopenharmony_ci	help
538c2ecf20Sopenharmony_ci	  Selecting this option will enable a DMAR device at boot time if
548c2ecf20Sopenharmony_ci	  one is found. If this option is not selected, DMAR support can
558c2ecf20Sopenharmony_ci	  be enabled by passing intel_iommu=on to the kernel.
568c2ecf20Sopenharmony_ci
578c2ecf20Sopenharmony_ciconfig INTEL_IOMMU_BROKEN_GFX_WA
588c2ecf20Sopenharmony_ci	bool "Workaround broken graphics drivers (going away soon)"
598c2ecf20Sopenharmony_ci	depends on INTEL_IOMMU && BROKEN && X86
608c2ecf20Sopenharmony_ci	help
618c2ecf20Sopenharmony_ci	  Current Graphics drivers tend to use physical address
628c2ecf20Sopenharmony_ci	  for DMA and avoid using DMA APIs. Setting this config
638c2ecf20Sopenharmony_ci	  option permits the IOMMU driver to set a unity map for
648c2ecf20Sopenharmony_ci	  all the OS-visible memory. Hence the driver can continue
658c2ecf20Sopenharmony_ci	  to use physical addresses for DMA, at least until this
668c2ecf20Sopenharmony_ci	  option is removed in the 2.6.32 kernel.
678c2ecf20Sopenharmony_ci
688c2ecf20Sopenharmony_ciconfig INTEL_IOMMU_FLOPPY_WA
698c2ecf20Sopenharmony_ci	def_bool y
708c2ecf20Sopenharmony_ci	depends on INTEL_IOMMU && X86
718c2ecf20Sopenharmony_ci	help
728c2ecf20Sopenharmony_ci	  Floppy disk drivers are known to bypass DMA API calls
738c2ecf20Sopenharmony_ci	  thereby failing to work when IOMMU is enabled. This
748c2ecf20Sopenharmony_ci	  workaround will setup a 1:1 mapping for the first
758c2ecf20Sopenharmony_ci	  16MiB to make floppy (an ISA device) work.
768c2ecf20Sopenharmony_ci
778c2ecf20Sopenharmony_ciconfig INTEL_IOMMU_SCALABLE_MODE_DEFAULT_ON
788c2ecf20Sopenharmony_ci	bool "Enable Intel IOMMU scalable mode by default"
798c2ecf20Sopenharmony_ci	depends on INTEL_IOMMU
808c2ecf20Sopenharmony_ci	help
818c2ecf20Sopenharmony_ci	  Selecting this option will enable by default the scalable mode if
828c2ecf20Sopenharmony_ci	  hardware presents the capability. The scalable mode is defined in
838c2ecf20Sopenharmony_ci	  VT-d 3.0. The scalable mode capability could be checked by reading
848c2ecf20Sopenharmony_ci	  /sys/devices/virtual/iommu/dmar*/intel-iommu/ecap. If this option
858c2ecf20Sopenharmony_ci	  is not selected, scalable mode support could also be enabled by
868c2ecf20Sopenharmony_ci	  passing intel_iommu=sm_on to the kernel. If not sure, please use
878c2ecf20Sopenharmony_ci	  the default value.
88