aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOhad Ben-Cohen <ohad@wizery.com>2011-06-05 11:22:18 -0400
committerJoerg Roedel <joerg.roedel@amd.com>2011-06-21 04:49:29 -0400
commit29b68415e335ba9e0eb6057f9405aa4d9c23efe4 (patch)
tree76d1a8990ab1e5db5f6860262cb52c186d477925
parentb10f127e1a4d8cac5414c6e2b152c205b66c9f16 (diff)
x86: amd_iommu: move to drivers/iommu/
This should ease finding similarities with different platforms, with the intention of solving problems once in a generic framework which everyone can use. Compile-tested on x86_64. Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com> Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
-rw-r--r--arch/x86/Kconfig28
-rw-r--r--arch/x86/kernel/Makefile2
-rw-r--r--drivers/iommu/Kconfig29
-rw-r--r--drivers/iommu/Makefile1
-rw-r--r--drivers/iommu/amd_iommu.c (renamed from arch/x86/kernel/amd_iommu.c)0
5 files changed, 31 insertions, 29 deletions
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 460d57370016..1b6a2e212db4 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -680,34 +680,6 @@ config CALGARY_IOMMU_ENABLED_BY_DEFAULT
680 Calgary anyway, pass 'iommu=calgary' on the kernel command line. 680 Calgary anyway, pass 'iommu=calgary' on the kernel command line.
681 If unsure, say Y. 681 If unsure, say Y.
682 682
683config AMD_IOMMU
684 bool "AMD IOMMU support"
685 select SWIOTLB
686 select PCI_MSI
687 select PCI_IOV
688 select IOMMU_API
689 depends on X86_64 && PCI && ACPI
690 ---help---
691 With this option you can enable support for AMD IOMMU hardware in
692 your system. An IOMMU is a hardware component which provides
693 remapping of DMA memory accesses from devices. With an AMD IOMMU you
694 can isolate the the DMA memory of different devices and protect the
695 system from misbehaving device drivers or hardware.
696
697 You can find out if your system has an AMD IOMMU if you look into
698 your BIOS for an option to enable it or if you have an IVRS ACPI
699 table.
700
701config AMD_IOMMU_STATS
702 bool "Export AMD IOMMU statistics to debugfs"
703 depends on AMD_IOMMU
704 select DEBUG_FS
705 ---help---
706 This option enables code in the AMD IOMMU driver to collect various
707 statistics about whats happening in the driver and exports that
708 information to userspace via debugfs.
709 If unsure, say N.
710
711# need this always selected by IOMMU for the VIA workaround 683# need this always selected by IOMMU for the VIA workaround
712config SWIOTLB 684config SWIOTLB
713 def_bool y if X86_64 685 def_bool y if X86_64
diff --git a/arch/x86/kernel/Makefile b/arch/x86/kernel/Makefile
index 90b06d4daee2..aef02989c930 100644
--- a/arch/x86/kernel/Makefile
+++ b/arch/x86/kernel/Makefile
@@ -123,7 +123,7 @@ ifeq ($(CONFIG_X86_64),y)
123 123
124 obj-$(CONFIG_GART_IOMMU) += amd_gart_64.o aperture_64.o 124 obj-$(CONFIG_GART_IOMMU) += amd_gart_64.o aperture_64.o
125 obj-$(CONFIG_CALGARY_IOMMU) += pci-calgary_64.o tce_64.o 125 obj-$(CONFIG_CALGARY_IOMMU) += pci-calgary_64.o tce_64.o
126 obj-$(CONFIG_AMD_IOMMU) += amd_iommu_init.o amd_iommu.o 126 obj-$(CONFIG_AMD_IOMMU) += amd_iommu_init.o
127 127
128 obj-$(CONFIG_PCI_MMCONFIG) += mmconf-fam10h_64.o 128 obj-$(CONFIG_PCI_MMCONFIG) += mmconf-fam10h_64.o
129 obj-y += vsmp_64.o 129 obj-y += vsmp_64.o
diff --git a/drivers/iommu/Kconfig b/drivers/iommu/Kconfig
index 21a80bfbdb52..9246c5bf25af 100644
--- a/drivers/iommu/Kconfig
+++ b/drivers/iommu/Kconfig
@@ -17,3 +17,32 @@ config MSM_IOMMU
17config IOMMU_PGTABLES_L2 17config IOMMU_PGTABLES_L2
18 def_bool y 18 def_bool y
19 depends on MSM_IOMMU && MMU && SMP && CPU_DCACHE_DISABLE=n 19 depends on MSM_IOMMU && MMU && SMP && CPU_DCACHE_DISABLE=n
20
21# AMD IOMMU support
22config AMD_IOMMU
23 bool "AMD IOMMU support"
24 select SWIOTLB
25 select PCI_MSI
26 select PCI_IOV
27 select IOMMU_API
28 depends on X86_64 && PCI && ACPI
29 ---help---
30 With this option you can enable support for AMD IOMMU hardware in
31 your system. An IOMMU is a hardware component which provides
32 remapping of DMA memory accesses from devices. With an AMD IOMMU you
33 can isolate the the DMA memory of different devices and protect the
34 system from misbehaving device drivers or hardware.
35
36 You can find out if your system has an AMD IOMMU if you look into
37 your BIOS for an option to enable it or if you have an IVRS ACPI
38 table.
39
40config AMD_IOMMU_STATS
41 bool "Export AMD IOMMU statistics to debugfs"
42 depends on AMD_IOMMU
43 select DEBUG_FS
44 ---help---
45 This option enables code in the AMD IOMMU driver to collect various
46 statistics about whats happening in the driver and exports that
47 information to userspace via debugfs.
48 If unsure, say N.
diff --git a/drivers/iommu/Makefile b/drivers/iommu/Makefile
index 1a71c82b1af2..4237eaf84609 100644
--- a/drivers/iommu/Makefile
+++ b/drivers/iommu/Makefile
@@ -1,2 +1,3 @@
1obj-$(CONFIG_IOMMU_API) += iommu.o 1obj-$(CONFIG_IOMMU_API) += iommu.o
2obj-$(CONFIG_MSM_IOMMU) += msm_iommu.o msm_iommu_dev.o 2obj-$(CONFIG_MSM_IOMMU) += msm_iommu.o msm_iommu_dev.o
3obj-$(CONFIG_AMD_IOMMU) += amd_iommu.o
diff --git a/arch/x86/kernel/amd_iommu.c b/drivers/iommu/amd_iommu.c
index 7c3a95e54ec5..7c3a95e54ec5 100644
--- a/arch/x86/kernel/amd_iommu.c
+++ b/drivers/iommu/amd_iommu.c