| From | Joerg Roedel <> | Subject | [PATCH 31/34] AMD IOMMU: initialize dma_ops from IOMMU initialization and enable IOMMUs | Date | Thu, 26 Jun 2008 21:28:07 +0200 |
| |
This patch adds a call to the driver specific dma_ops initialization routine from the AMD IOMMU hardware initialization. Further it adds the necessary code to finally enable AMD IOMMU hardware.
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com> --- arch/x86/kernel/amd_iommu_init.c | 16 ++++++++++++++++ 1 files changed, 16 insertions(+), 0 deletions(-)
diff --git a/arch/x86/kernel/amd_iommu_init.c b/arch/x86/kernel/amd_iommu_init.c index bae4a76..d1aa234 100644 --- a/arch/x86/kernel/amd_iommu_init.c +++ b/arch/x86/kernel/amd_iommu_init.c @@ -644,6 +644,16 @@ static int __init init_memory_definitions(struct acpi_table_header *table) return 0; } +static void __init enable_iommus(void) +{ + struct amd_iommu *iommu; + + list_for_each_entry(iommu, &amd_iommu_list, list) { + iommu_set_exclusion_range(iommu); + iommu_enable(iommu); + } +} + int __init amd_iommu_init(void) { int i, ret = 0; @@ -731,6 +741,12 @@ int __init amd_iommu_init(void) if (acpi_table_parse("IVRS", init_memory_definitions) != 0) goto free; + ret = amd_iommu_init_dma_ops(); + if (ret) + goto free; + + enable_iommus(); + printk(KERN_INFO "AMD IOMMU: aperture size is %d MB\n", (1 << (amd_iommu_aperture_order-20))); -- 1.5.3.7
|