diff -r cfdb02b1450e Documentation/x86_64/boot-options.txt --- a/Documentation/x86_64/boot-options.txt Sun Oct 29 09:25:34 2006 +0200 +++ b/Documentation/x86_64/boot-options.txt Sun Oct 29 10:55:18 2006 +0200 @@ -183,7 +183,7 @@ IOMMU IOMMU iommu=[size][,noagp][,off][,force][,noforce][,leak][,memaper[=order]][,merge] - [,forcesac][,fullflush][,nomerge][,noaperture] + [,forcesac][,fullflush][,nomerge][,noaperture][,calgary] size set size of iommu (in bytes) noagp don't initialize the AGP driver and use full aperture. off don't use the IOMMU @@ -204,6 +204,7 @@ IOMMU buffering. nodac Forbid DMA >4GB panic Always panic when IOMMU overflows + calgary Use the Calgary IOMMU if it is available swiotlb=pages[,force] diff -r cfdb02b1450e arch/x86_64/Kconfig --- a/arch/x86_64/Kconfig Sun Oct 29 09:25:34 2006 +0200 +++ b/arch/x86_64/Kconfig Sun Oct 29 10:55:00 2006 +0200 @@ -455,6 +455,17 @@ config CALGARY_IOMMU Normally the kernel will make the right choice by itself. If unsure, say Y. +config CALGARY_IOMMU_ENABLED_BY_DEFAULT + bool "Should Calgary be enabled by default?" + default y + depends on CALGARY_IOMMU + help + Should Calgary be enabled by default? if you choose 'y', Calgary + will be used (if it exists). If you choose 'n', Calgary will not be + used even if it exists. If you choose 'n' and would like to use + Calgary anyway, pass 'iommu=calgary' on the kernel command line. + If unsure, say Y. + # need this always selected by IOMMU for the VIA workaround config SWIOTLB bool diff -r cfdb02b1450e arch/x86_64/kernel/pci-calgary.c --- a/arch/x86_64/kernel/pci-calgary.c Sun Oct 29 09:25:34 2006 +0200 +++ b/arch/x86_64/kernel/pci-calgary.c Sun Oct 29 10:55:00 2006 +0200 @@ -41,6 +41,12 @@ #include #include #include + +#ifdef CONFIG_CALGARY_IOMMU_ENABLED_BY_DEFAULT +int use_calgary __read_mostly = 1; +#else +int use_calgary __read_mostly = 0; +#endif /* CONFIG_CALGARY_DEFAULT_ENABLED */ #define PCI_DEVICE_ID_IBM_CALGARY 0x02a1 #define PCI_VENDOR_DEVICE_ID_CALGARY \ @@ -977,6 +983,9 @@ void __init detect_calgary(void) if (swiotlb || no_iommu || iommu_detected) return; + if (!use_calgary) + return; + if (!early_pci_allowed()) return; diff -r cfdb02b1450e arch/x86_64/kernel/pci-dma.c --- a/arch/x86_64/kernel/pci-dma.c Sun Oct 29 09:25:34 2006 +0200 +++ b/arch/x86_64/kernel/pci-dma.c Sun Oct 29 10:55:00 2006 +0200 @@ -296,6 +296,11 @@ __init int iommu_setup(char *p) gart_parse_options(p); #endif +#ifdef CONFIG_CALGARY_IOMMU + if (!strncmp(p, "calgary", 7)) + use_calgary = 1; +#endif /* CONFIG_CALGARY_IOMMU */ + p += strcspn(p, ","); if (*p == ',') ++p; diff -r cfdb02b1450e include/asm-x86_64/calgary.h --- a/include/asm-x86_64/calgary.h Sun Oct 29 09:25:34 2006 +0200 +++ b/include/asm-x86_64/calgary.h Sun Oct 29 10:55:00 2006 +0200 @@ -51,6 +51,8 @@ struct iommu_table { #define TCE_TABLE_SIZE_4M 6 #define TCE_TABLE_SIZE_8M 7 +extern int use_calgary; + #ifdef CONFIG_CALGARY_IOMMU extern int calgary_iommu_init(void); extern void detect_calgary(void);