Skip to content

Commit

Permalink
x86, AMD IOMMU: initialize dma_ops from IOMMU initialization and enab…
Browse files Browse the repository at this point in the history
…le IOMMUs

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>
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>
  • Loading branch information
Joerg Roedel authored and Ingo Molnar committed Jun 27, 2008
1 parent c6da992 commit 8736197
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions arch/x86/kernel/amd_iommu_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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)));

Expand Down

0 comments on commit 8736197

Please sign in to comment.