diff options
author | Jon Mason <jdmason@us.ibm.com> | 2006-06-26 07:58:11 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-06-26 13:48:18 -0400 |
commit | 0dc243ae10c8309c170a3af9f1adad1924a9f217 (patch) | |
tree | f550a8097913728ce96322d5f799329489db85a1 /arch/x86_64/kernel/pci-dma.c | |
parent | a3c042a0f022dade8e02bf6c9be5d2379d7e133c (diff) |
[PATCH] x86_64: Calgary IOMMU - IOMMU abstractions
This patch creates a new interface for IOMMUs by adding a centralized
location for IOMMU allocation (for translation tables/apertures) and
IOMMU initialization. In creating these, code was moved around for
abstraction, uniformity, and consiceness.
Take note of the move of the iommu_setup bootarg parsing code to
__setup. This is enabled by moving back the location of the aperture
allocation/detection to mem init (which while ugly, was already the
location of the swiotlb_init).
While a slight departure from the previous patch, I belive this provides
the true intention of the previous versions of the patch which changed
this code. It also makes the addition of the upcoming calgary code much
cleaner than previous patches.
[AK: Removed one broken change. iommu_setup still has to be called
early]
Signed-off-by: Muli Ben-Yehuda <muli@il.ibm.com>
Signed-off-by: Jon Mason <jdmason@us.ibm.com>
Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/x86_64/kernel/pci-dma.c')
-rw-r--r-- | arch/x86_64/kernel/pci-dma.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/arch/x86_64/kernel/pci-dma.c b/arch/x86_64/kernel/pci-dma.c index 7edd1a40fab3..a45844c7e3a3 100644 --- a/arch/x86_64/kernel/pci-dma.c +++ b/arch/x86_64/kernel/pci-dma.c | |||
@@ -279,3 +279,32 @@ __init int iommu_setup(char *p) | |||
279 | } | 279 | } |
280 | return 1; | 280 | return 1; |
281 | } | 281 | } |
282 | __setup("iommu=", iommu_setup); | ||
283 | |||
284 | void __init pci_iommu_alloc(void) | ||
285 | { | ||
286 | /* | ||
287 | * The order of these functions is important for | ||
288 | * fall-back/fail-over reasons | ||
289 | */ | ||
290 | #ifdef CONFIG_IOMMU | ||
291 | iommu_hole_init(); | ||
292 | #endif | ||
293 | |||
294 | #ifdef CONFIG_SWIOTLB | ||
295 | pci_swiotlb_init(); | ||
296 | #endif | ||
297 | } | ||
298 | |||
299 | static int __init pci_iommu_init(void) | ||
300 | { | ||
301 | #ifdef CONFIG_IOMMU | ||
302 | gart_iommu_init(); | ||
303 | #endif | ||
304 | |||
305 | no_iommu_init(); | ||
306 | return 0; | ||
307 | } | ||
308 | |||
309 | /* Must execute after PCI subsystem */ | ||
310 | fs_initcall(pci_iommu_init); | ||