162306a36Sopenharmony_ci# SPDX-License-Identifier: GPL-2.0-only
262306a36Sopenharmony_ci# AMD IOMMU support
362306a36Sopenharmony_ciconfig AMD_IOMMU
462306a36Sopenharmony_ci	bool "AMD IOMMU support"
562306a36Sopenharmony_ci	select SWIOTLB
662306a36Sopenharmony_ci	select PCI_MSI
762306a36Sopenharmony_ci	select PCI_ATS
862306a36Sopenharmony_ci	select PCI_PRI
962306a36Sopenharmony_ci	select PCI_PASID
1062306a36Sopenharmony_ci	select IOMMU_API
1162306a36Sopenharmony_ci	select IOMMU_IOVA
1262306a36Sopenharmony_ci	select IOMMU_IO_PGTABLE
1362306a36Sopenharmony_ci	depends on X86_64 && PCI && ACPI && HAVE_CMPXCHG_DOUBLE
1462306a36Sopenharmony_ci	help
1562306a36Sopenharmony_ci	  With this option you can enable support for AMD IOMMU hardware in
1662306a36Sopenharmony_ci	  your system. An IOMMU is a hardware component which provides
1762306a36Sopenharmony_ci	  remapping of DMA memory accesses from devices. With an AMD IOMMU you
1862306a36Sopenharmony_ci	  can isolate the DMA memory of different devices and protect the
1962306a36Sopenharmony_ci	  system from misbehaving device drivers or hardware.
2062306a36Sopenharmony_ci
2162306a36Sopenharmony_ci	  You can find out if your system has an AMD IOMMU if you look into
2262306a36Sopenharmony_ci	  your BIOS for an option to enable it or if you have an IVRS ACPI
2362306a36Sopenharmony_ci	  table.
2462306a36Sopenharmony_ci
2562306a36Sopenharmony_ciconfig AMD_IOMMU_V2
2662306a36Sopenharmony_ci	tristate "AMD IOMMU Version 2 driver"
2762306a36Sopenharmony_ci	depends on AMD_IOMMU
2862306a36Sopenharmony_ci	select MMU_NOTIFIER
2962306a36Sopenharmony_ci	help
3062306a36Sopenharmony_ci	  This option enables support for the AMD IOMMUv2 features of the IOMMU
3162306a36Sopenharmony_ci	  hardware. Select this option if you want to use devices that support
3262306a36Sopenharmony_ci	  the PCI PRI and PASID interface.
3362306a36Sopenharmony_ci
3462306a36Sopenharmony_ciconfig AMD_IOMMU_DEBUGFS
3562306a36Sopenharmony_ci	bool "Enable AMD IOMMU internals in DebugFS"
3662306a36Sopenharmony_ci	depends on AMD_IOMMU && IOMMU_DEBUGFS
3762306a36Sopenharmony_ci	help
3862306a36Sopenharmony_ci	  !!!WARNING!!!  !!!WARNING!!!  !!!WARNING!!!  !!!WARNING!!!
3962306a36Sopenharmony_ci
4062306a36Sopenharmony_ci	  DO NOT ENABLE THIS OPTION UNLESS YOU REALLY, -REALLY- KNOW WHAT YOU ARE DOING!!!
4162306a36Sopenharmony_ci	  Exposes AMD IOMMU device internals in DebugFS.
4262306a36Sopenharmony_ci
4362306a36Sopenharmony_ci	  This option is -NOT- intended for production environments, and should
4462306a36Sopenharmony_ci	  not generally be enabled.
45