aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorJoerg Roedel <joerg.roedel@amd.com>2008-06-26 15:27:51 -0400
committerIngo Molnar <mingo@elte.hu>2008-06-27 04:12:13 -0400
commitae7877de9cd8da075a46d5f615cb9fc9858e4b2f (patch)
treead1afdfd73370595815125a4a0e5b33d7239689d /arch
parentfe74c9cf3985e307e9734296d08a270d510e3fb7 (diff)
x86, AMD IOMMU: add early detection code
This patch adds code to detect an AMD IOMMU early during boot before the early detection code of other IOMMUs run. Signed-off-by: Joerg Roedel <joerg.roedel@amd.com> Cc: iommu@lists.linux-foundation.org Cc: bhavna.sarathy@amd.com Cc: Sebastian.Biemueller@amd.com Cc: robert.richter@amd.com Cc: joro@8bytes.org Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/kernel/amd_iommu_init.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/arch/x86/kernel/amd_iommu_init.c b/arch/x86/kernel/amd_iommu_init.c
index c792ddc4fec..d7a75bf0f7e 100644
--- a/arch/x86/kernel/amd_iommu_init.c
+++ b/arch/x86/kernel/amd_iommu_init.c
@@ -769,3 +769,23 @@ free:
769 goto out; 769 goto out;
770} 770}
771 771
772static int __init early_amd_iommu_detect(struct acpi_table_header *table)
773{
774 return 0;
775}
776
777void __init amd_iommu_detect(void)
778{
779 if (swiotlb || no_iommu || iommu_detected)
780 return;
781
782 if (amd_iommu_disable)
783 return;
784
785 if (acpi_table_parse("IVRS", early_amd_iommu_detect) == 0) {
786 iommu_detected = 1;
787 gart_iommu_aperture_disabled = 1;
788 gart_iommu_aperture = 0;
789 }
790}
791