]> err.no Git - linux-2.6/commitdiff
x86, AMD IOMMU: add early detection code
authorJoerg Roedel <joerg.roedel@amd.com>
Thu, 26 Jun 2008 19:27:51 +0000 (21:27 +0200)
committerIngo Molnar <mingo@elte.hu>
Fri, 27 Jun 2008 08:12:13 +0000 (10:12 +0200)
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>
arch/x86/kernel/amd_iommu_init.c

index c792ddc4fec62267b1539e0c9bafdfb144987d4c..d7a75bf0f7e6026f4f84149bb91804012586eae9 100644 (file)
@@ -769,3 +769,23 @@ free:
        goto out;
 }
 
+static int __init early_amd_iommu_detect(struct acpi_table_header *table)
+{
+       return 0;
+}
+
+void __init amd_iommu_detect(void)
+{
+       if (swiotlb || no_iommu || iommu_detected)
+               return;
+
+       if (amd_iommu_disable)
+               return;
+
+       if (acpi_table_parse("IVRS", early_amd_iommu_detect) == 0) {
+               iommu_detected = 1;
+               gart_iommu_aperture_disabled = 1;
+               gart_iommu_aperture = 0;
+       }
+}
+