diff options
-rw-r--r-- | arch/x86/include/asm/amd_iommu.h | 2 | ||||
-rw-r--r-- | arch/x86/kernel/amd_iommu_init.c | 17 | ||||
-rw-r--r-- | arch/x86/kernel/pci-dma.c | 2 |
3 files changed, 3 insertions, 18 deletions
diff --git a/arch/x86/include/asm/amd_iommu.h b/arch/x86/include/asm/amd_iommu.h index 3604669f7b15..b8ef2ee93643 100644 --- a/arch/x86/include/asm/amd_iommu.h +++ b/arch/x86/include/asm/amd_iommu.h | |||
@@ -23,7 +23,6 @@ | |||
23 | #include <linux/irqreturn.h> | 23 | #include <linux/irqreturn.h> |
24 | 24 | ||
25 | #ifdef CONFIG_AMD_IOMMU | 25 | #ifdef CONFIG_AMD_IOMMU |
26 | extern int amd_iommu_init(void); | ||
27 | extern int amd_iommu_init_dma_ops(void); | 26 | extern int amd_iommu_init_dma_ops(void); |
28 | extern int amd_iommu_init_passthrough(void); | 27 | extern int amd_iommu_init_passthrough(void); |
29 | extern void amd_iommu_detect(void); | 28 | extern void amd_iommu_detect(void); |
@@ -32,7 +31,6 @@ extern void amd_iommu_flush_all_domains(void); | |||
32 | extern void amd_iommu_flush_all_devices(void); | 31 | extern void amd_iommu_flush_all_devices(void); |
33 | extern void amd_iommu_apply_erratum_63(u16 devid); | 32 | extern void amd_iommu_apply_erratum_63(u16 devid); |
34 | #else | 33 | #else |
35 | static inline int amd_iommu_init(void) { return -ENODEV; } | ||
36 | static inline void amd_iommu_detect(void) { } | 34 | static inline void amd_iommu_detect(void) { } |
37 | #endif | 35 | #endif |
38 | 36 | ||
diff --git a/arch/x86/kernel/amd_iommu_init.c b/arch/x86/kernel/amd_iommu_init.c index 6acd43e9afd7..c41aabddaa2a 100644 --- a/arch/x86/kernel/amd_iommu_init.c +++ b/arch/x86/kernel/amd_iommu_init.c | |||
@@ -29,6 +29,7 @@ | |||
29 | #include <asm/amd_iommu.h> | 29 | #include <asm/amd_iommu.h> |
30 | #include <asm/iommu.h> | 30 | #include <asm/iommu.h> |
31 | #include <asm/gart.h> | 31 | #include <asm/gart.h> |
32 | #include <asm/x86_init.h> | ||
32 | 33 | ||
33 | /* | 34 | /* |
34 | * definitions for the ACPI scanning code | 35 | * definitions for the ACPI scanning code |
@@ -1176,19 +1177,10 @@ static struct sys_device device_amd_iommu = { | |||
1176 | * functions. Finally it prints some information about AMD IOMMUs and | 1177 | * functions. Finally it prints some information about AMD IOMMUs and |
1177 | * the driver state and enables the hardware. | 1178 | * the driver state and enables the hardware. |
1178 | */ | 1179 | */ |
1179 | int __init amd_iommu_init(void) | 1180 | static int __init amd_iommu_init(void) |
1180 | { | 1181 | { |
1181 | int i, ret = 0; | 1182 | int i, ret = 0; |
1182 | 1183 | ||
1183 | |||
1184 | if (no_iommu) { | ||
1185 | printk(KERN_INFO "AMD-Vi disabled by kernel command line\n"); | ||
1186 | return 0; | ||
1187 | } | ||
1188 | |||
1189 | if (!amd_iommu_detected) | ||
1190 | return -ENODEV; | ||
1191 | |||
1192 | /* | 1184 | /* |
1193 | * First parse ACPI tables to find the largest Bus/Dev/Func | 1185 | * First parse ACPI tables to find the largest Bus/Dev/Func |
1194 | * we need to handle. Upon this information the shared data | 1186 | * we need to handle. Upon this information the shared data |
@@ -1344,10 +1336,7 @@ void __init amd_iommu_detect(void) | |||
1344 | if (acpi_table_parse("IVRS", early_amd_iommu_detect) == 0) { | 1336 | if (acpi_table_parse("IVRS", early_amd_iommu_detect) == 0) { |
1345 | iommu_detected = 1; | 1337 | iommu_detected = 1; |
1346 | amd_iommu_detected = 1; | 1338 | amd_iommu_detected = 1; |
1347 | #ifdef CONFIG_GART_IOMMU | 1339 | x86_init.iommu.iommu_init = amd_iommu_init; |
1348 | gart_iommu_aperture_disabled = 1; | ||
1349 | gart_iommu_aperture = 0; | ||
1350 | #endif | ||
1351 | } | 1340 | } |
1352 | } | 1341 | } |
1353 | 1342 | ||
diff --git a/arch/x86/kernel/pci-dma.c b/arch/x86/kernel/pci-dma.c index ecde8543537f..5ca44a9301a0 100644 --- a/arch/x86/kernel/pci-dma.c +++ b/arch/x86/kernel/pci-dma.c | |||
@@ -296,8 +296,6 @@ static int __init pci_iommu_init(void) | |||
296 | 296 | ||
297 | intel_iommu_init(); | 297 | intel_iommu_init(); |
298 | 298 | ||
299 | amd_iommu_init(); | ||
300 | |||
301 | no_iommu_init(); | 299 | no_iommu_init(); |
302 | return 0; | 300 | return 0; |
303 | } | 301 | } |