diff options
author | Glauber Costa <gcosta@redhat.com> | 2008-04-08 12:20:56 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-04-19 13:19:57 -0400 |
commit | fae9a0d8ca68a14da8d2351ad3e0bf42f3b29899 (patch) | |
tree | a16bbeabb8b77e96e040ddc900a03ae5879fe784 /arch/x86/kernel/pci-dma.c | |
parent | 8e0c379718ef32967deea55937895bfc9b493dd8 (diff) |
x86: merge iommu initialization parameters
we merge the iommu initialization parameters in pci-dma.c
Nice thing, that both architectures at least recognize the same
parameters.
usedac i386 parameter is marked for deprecation
Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch/x86/kernel/pci-dma.c')
-rw-r--r-- | arch/x86/kernel/pci-dma.c | 81 |
1 files changed, 81 insertions, 0 deletions
diff --git a/arch/x86/kernel/pci-dma.c b/arch/x86/kernel/pci-dma.c index 7d3bd652c36f..48ab52d052b6 100644 --- a/arch/x86/kernel/pci-dma.c +++ b/arch/x86/kernel/pci-dma.c | |||
@@ -24,6 +24,18 @@ int panic_on_overflow __read_mostly = 0; | |||
24 | int force_iommu __read_mostly = 0; | 24 | int force_iommu __read_mostly = 0; |
25 | #endif | 25 | #endif |
26 | 26 | ||
27 | int iommu_merge __read_mostly = 0; | ||
28 | |||
29 | int no_iommu __read_mostly; | ||
30 | /* Set this to 1 if there is a HW IOMMU in the system */ | ||
31 | int iommu_detected __read_mostly = 0; | ||
32 | |||
33 | /* This tells the BIO block layer to assume merging. Default to off | ||
34 | because we cannot guarantee merging later. */ | ||
35 | int iommu_bio_merge __read_mostly = 0; | ||
36 | EXPORT_SYMBOL(iommu_bio_merge); | ||
37 | |||
38 | |||
27 | int dma_set_mask(struct device *dev, u64 mask) | 39 | int dma_set_mask(struct device *dev, u64 mask) |
28 | { | 40 | { |
29 | if (!dev->dma_mask || !dma_supported(dev, mask)) | 41 | if (!dev->dma_mask || !dma_supported(dev, mask)) |
@@ -105,6 +117,75 @@ void __init pci_iommu_alloc(void) | |||
105 | } | 117 | } |
106 | #endif | 118 | #endif |
107 | 119 | ||
120 | /* | ||
121 | * See <Documentation/x86_64/boot-options.txt> for the iommu kernel parameter | ||
122 | * documentation. | ||
123 | */ | ||
124 | static __init int iommu_setup(char *p) | ||
125 | { | ||
126 | iommu_merge = 1; | ||
127 | |||
128 | if (!p) | ||
129 | return -EINVAL; | ||
130 | |||
131 | while (*p) { | ||
132 | if (!strncmp(p, "off", 3)) | ||
133 | no_iommu = 1; | ||
134 | /* gart_parse_options has more force support */ | ||
135 | if (!strncmp(p, "force", 5)) | ||
136 | force_iommu = 1; | ||
137 | if (!strncmp(p, "noforce", 7)) { | ||
138 | iommu_merge = 0; | ||
139 | force_iommu = 0; | ||
140 | } | ||
141 | |||
142 | if (!strncmp(p, "biomerge", 8)) { | ||
143 | iommu_bio_merge = 4096; | ||
144 | iommu_merge = 1; | ||
145 | force_iommu = 1; | ||
146 | } | ||
147 | if (!strncmp(p, "panic", 5)) | ||
148 | panic_on_overflow = 1; | ||
149 | if (!strncmp(p, "nopanic", 7)) | ||
150 | panic_on_overflow = 0; | ||
151 | if (!strncmp(p, "merge", 5)) { | ||
152 | iommu_merge = 1; | ||
153 | force_iommu = 1; | ||
154 | } | ||
155 | if (!strncmp(p, "nomerge", 7)) | ||
156 | iommu_merge = 0; | ||
157 | if (!strncmp(p, "forcesac", 8)) | ||
158 | iommu_sac_force = 1; | ||
159 | if (!strncmp(p, "allowdac", 8)) | ||
160 | forbid_dac = 0; | ||
161 | if (!strncmp(p, "nodac", 5)) | ||
162 | forbid_dac = -1; | ||
163 | if (!strncmp(p, "usedac", 6)) { | ||
164 | forbid_dac = -1; | ||
165 | return 1; | ||
166 | } | ||
167 | #ifdef CONFIG_SWIOTLB | ||
168 | if (!strncmp(p, "soft", 4)) | ||
169 | swiotlb = 1; | ||
170 | #endif | ||
171 | |||
172 | #ifdef CONFIG_GART_IOMMU | ||
173 | gart_parse_options(p); | ||
174 | #endif | ||
175 | |||
176 | #ifdef CONFIG_CALGARY_IOMMU | ||
177 | if (!strncmp(p, "calgary", 7)) | ||
178 | use_calgary = 1; | ||
179 | #endif /* CONFIG_CALGARY_IOMMU */ | ||
180 | |||
181 | p += strcspn(p, ","); | ||
182 | if (*p == ',') | ||
183 | ++p; | ||
184 | } | ||
185 | return 0; | ||
186 | } | ||
187 | early_param("iommu", iommu_setup); | ||
188 | |||
108 | int dma_supported(struct device *dev, u64 mask) | 189 | int dma_supported(struct device *dev, u64 mask) |
109 | { | 190 | { |
110 | #ifdef CONFIG_PCI | 191 | #ifdef CONFIG_PCI |