diff options
author | Joerg Roedel <joerg.roedel@amd.com> | 2008-06-26 15:28:07 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-06-27 04:12:21 -0400 |
commit | 8736197ba8e40d030eec0ab7a9e9f2be41810c4e (patch) | |
tree | 2ad786a9626caec77f5a4e11b12d44999661c789 /arch/x86/kernel/amd_iommu_init.c | |
parent | c6da992e16a9d261eb9dfeff14e9777c3e0468c5 (diff) |
x86, AMD IOMMU: initialize dma_ops from IOMMU initialization and enable 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>
Diffstat (limited to 'arch/x86/kernel/amd_iommu_init.c')
-rw-r--r-- | 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 bae4a76a3b54..d1aa2344cd90 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) | |||
644 | return 0; | 644 | return 0; |
645 | } | 645 | } |
646 | 646 | ||
647 | static void __init enable_iommus(void) | ||
648 | { | ||
649 | struct amd_iommu *iommu; | ||
650 | |||
651 | list_for_each_entry(iommu, &amd_iommu_list, list) { | ||
652 | iommu_set_exclusion_range(iommu); | ||
653 | iommu_enable(iommu); | ||
654 | } | ||
655 | } | ||
656 | |||
647 | int __init amd_iommu_init(void) | 657 | int __init amd_iommu_init(void) |
648 | { | 658 | { |
649 | int i, ret = 0; | 659 | int i, ret = 0; |
@@ -731,6 +741,12 @@ int __init amd_iommu_init(void) | |||
731 | if (acpi_table_parse("IVRS", init_memory_definitions) != 0) | 741 | if (acpi_table_parse("IVRS", init_memory_definitions) != 0) |
732 | goto free; | 742 | goto free; |
733 | 743 | ||
744 | ret = amd_iommu_init_dma_ops(); | ||
745 | if (ret) | ||
746 | goto free; | ||
747 | |||
748 | enable_iommus(); | ||
749 | |||
734 | printk(KERN_INFO "AMD IOMMU: aperture size is %d MB\n", | 750 | printk(KERN_INFO "AMD IOMMU: aperture size is %d MB\n", |
735 | (1 << (amd_iommu_aperture_order-20))); | 751 | (1 << (amd_iommu_aperture_order-20))); |
736 | 752 | ||