aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/agp/intel-agp.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/char/agp/intel-agp.c')
-rw-r--r--drivers/char/agp/intel-agp.c48
1 files changed, 20 insertions, 28 deletions
diff --git a/drivers/char/agp/intel-agp.c b/drivers/char/agp/intel-agp.c
index a426ee1f57a6..a7c276585a9f 100644
--- a/drivers/char/agp/intel-agp.c
+++ b/drivers/char/agp/intel-agp.c
@@ -118,7 +118,6 @@ static void intel_8xx_cleanup(void)
118 118
119static int intel_configure(void) 119static int intel_configure(void)
120{ 120{
121 u32 temp;
122 u16 temp2; 121 u16 temp2;
123 struct aper_size_info_16 *current_size; 122 struct aper_size_info_16 *current_size;
124 123
@@ -128,8 +127,8 @@ static int intel_configure(void)
128 pci_write_config_word(agp_bridge->dev, INTEL_APSIZE, current_size->size_value); 127 pci_write_config_word(agp_bridge->dev, INTEL_APSIZE, current_size->size_value);
129 128
130 /* address to map to */ 129 /* address to map to */
131 pci_read_config_dword(agp_bridge->dev, AGP_APBASE, &temp); 130 agp_bridge->gart_bus_addr = pci_bus_address(agp_bridge->dev,
132 agp_bridge->gart_bus_addr = (temp & PCI_BASE_ADDRESS_MEM_MASK); 131 AGP_APERTURE_BAR);
133 132
134 /* attbase - aperture base */ 133 /* attbase - aperture base */
135 pci_write_config_dword(agp_bridge->dev, INTEL_ATTBASE, agp_bridge->gatt_bus_addr); 134 pci_write_config_dword(agp_bridge->dev, INTEL_ATTBASE, agp_bridge->gatt_bus_addr);
@@ -148,7 +147,7 @@ static int intel_configure(void)
148 147
149static int intel_815_configure(void) 148static int intel_815_configure(void)
150{ 149{
151 u32 temp, addr; 150 u32 addr;
152 u8 temp2; 151 u8 temp2;
153 struct aper_size_info_8 *current_size; 152 struct aper_size_info_8 *current_size;
154 153
@@ -167,8 +166,8 @@ static int intel_815_configure(void)
167 current_size->size_value); 166 current_size->size_value);
168 167
169 /* address to map to */ 168 /* address to map to */
170 pci_read_config_dword(agp_bridge->dev, AGP_APBASE, &temp); 169 agp_bridge->gart_bus_addr = pci_bus_address(agp_bridge->dev,
171 agp_bridge->gart_bus_addr = (temp & PCI_BASE_ADDRESS_MEM_MASK); 170 AGP_APERTURE_BAR);
172 171
173 pci_read_config_dword(agp_bridge->dev, INTEL_ATTBASE, &addr); 172 pci_read_config_dword(agp_bridge->dev, INTEL_ATTBASE, &addr);
174 addr &= INTEL_815_ATTBASE_MASK; 173 addr &= INTEL_815_ATTBASE_MASK;
@@ -208,7 +207,6 @@ static void intel_820_cleanup(void)
208 207
209static int intel_820_configure(void) 208static int intel_820_configure(void)
210{ 209{
211 u32 temp;
212 u8 temp2; 210 u8 temp2;
213 struct aper_size_info_8 *current_size; 211 struct aper_size_info_8 *current_size;
214 212
@@ -218,8 +216,8 @@ static int intel_820_configure(void)
218 pci_write_config_byte(agp_bridge->dev, INTEL_APSIZE, current_size->size_value); 216 pci_write_config_byte(agp_bridge->dev, INTEL_APSIZE, current_size->size_value);
219 217
220 /* address to map to */ 218 /* address to map to */
221 pci_read_config_dword(agp_bridge->dev, AGP_APBASE, &temp); 219 agp_bridge->gart_bus_addr = pci_bus_address(agp_bridge->dev,
222 agp_bridge->gart_bus_addr = (temp & PCI_BASE_ADDRESS_MEM_MASK); 220 AGP_APERTURE_BAR);
223 221
224 /* attbase - aperture base */ 222 /* attbase - aperture base */
225 pci_write_config_dword(agp_bridge->dev, INTEL_ATTBASE, agp_bridge->gatt_bus_addr); 223 pci_write_config_dword(agp_bridge->dev, INTEL_ATTBASE, agp_bridge->gatt_bus_addr);
@@ -239,7 +237,6 @@ static int intel_820_configure(void)
239 237
240static int intel_840_configure(void) 238static int intel_840_configure(void)
241{ 239{
242 u32 temp;
243 u16 temp2; 240 u16 temp2;
244 struct aper_size_info_8 *current_size; 241 struct aper_size_info_8 *current_size;
245 242
@@ -249,8 +246,8 @@ static int intel_840_configure(void)
249 pci_write_config_byte(agp_bridge->dev, INTEL_APSIZE, current_size->size_value); 246 pci_write_config_byte(agp_bridge->dev, INTEL_APSIZE, current_size->size_value);
250 247
251 /* address to map to */ 248 /* address to map to */
252 pci_read_config_dword(agp_bridge->dev, AGP_APBASE, &temp); 249 agp_bridge->gart_bus_addr = pci_bus_address(agp_bridge->dev,
253 agp_bridge->gart_bus_addr = (temp & PCI_BASE_ADDRESS_MEM_MASK); 250 AGP_APERTURE_BAR);
254 251
255 /* attbase - aperture base */ 252 /* attbase - aperture base */
256 pci_write_config_dword(agp_bridge->dev, INTEL_ATTBASE, agp_bridge->gatt_bus_addr); 253 pci_write_config_dword(agp_bridge->dev, INTEL_ATTBASE, agp_bridge->gatt_bus_addr);
@@ -268,7 +265,6 @@ static int intel_840_configure(void)
268 265
269static int intel_845_configure(void) 266static int intel_845_configure(void)
270{ 267{
271 u32 temp;
272 u8 temp2; 268 u8 temp2;
273 struct aper_size_info_8 *current_size; 269 struct aper_size_info_8 *current_size;
274 270
@@ -282,9 +278,9 @@ static int intel_845_configure(void)
282 agp_bridge->apbase_config); 278 agp_bridge->apbase_config);
283 } else { 279 } else {
284 /* address to map to */ 280 /* address to map to */
285 pci_read_config_dword(agp_bridge->dev, AGP_APBASE, &temp); 281 agp_bridge->gart_bus_addr = pci_bus_address(agp_bridge->dev,
286 agp_bridge->gart_bus_addr = (temp & PCI_BASE_ADDRESS_MEM_MASK); 282 AGP_APERTURE_BAR);
287 agp_bridge->apbase_config = temp; 283 agp_bridge->apbase_config = agp_bridge->gart_bus_addr;
288 } 284 }
289 285
290 /* attbase - aperture base */ 286 /* attbase - aperture base */
@@ -303,7 +299,6 @@ static int intel_845_configure(void)
303 299
304static int intel_850_configure(void) 300static int intel_850_configure(void)
305{ 301{
306 u32 temp;
307 u16 temp2; 302 u16 temp2;
308 struct aper_size_info_8 *current_size; 303 struct aper_size_info_8 *current_size;
309 304
@@ -313,8 +308,8 @@ static int intel_850_configure(void)
313 pci_write_config_byte(agp_bridge->dev, INTEL_APSIZE, current_size->size_value); 308 pci_write_config_byte(agp_bridge->dev, INTEL_APSIZE, current_size->size_value);
314 309
315 /* address to map to */ 310 /* address to map to */
316 pci_read_config_dword(agp_bridge->dev, AGP_APBASE, &temp); 311 agp_bridge->gart_bus_addr = pci_bus_address(agp_bridge->dev,
317 agp_bridge->gart_bus_addr = (temp & PCI_BASE_ADDRESS_MEM_MASK); 312 AGP_APERTURE_BAR);
318 313
319 /* attbase - aperture base */ 314 /* attbase - aperture base */
320 pci_write_config_dword(agp_bridge->dev, INTEL_ATTBASE, agp_bridge->gatt_bus_addr); 315 pci_write_config_dword(agp_bridge->dev, INTEL_ATTBASE, agp_bridge->gatt_bus_addr);
@@ -332,7 +327,6 @@ static int intel_850_configure(void)
332 327
333static int intel_860_configure(void) 328static int intel_860_configure(void)
334{ 329{
335 u32 temp;
336 u16 temp2; 330 u16 temp2;
337 struct aper_size_info_8 *current_size; 331 struct aper_size_info_8 *current_size;
338 332
@@ -342,8 +336,8 @@ static int intel_860_configure(void)
342 pci_write_config_byte(agp_bridge->dev, INTEL_APSIZE, current_size->size_value); 336 pci_write_config_byte(agp_bridge->dev, INTEL_APSIZE, current_size->size_value);
343 337
344 /* address to map to */ 338 /* address to map to */
345 pci_read_config_dword(agp_bridge->dev, AGP_APBASE, &temp); 339 agp_bridge->gart_bus_addr = pci_bus_address(agp_bridge->dev,
346 agp_bridge->gart_bus_addr = (temp & PCI_BASE_ADDRESS_MEM_MASK); 340 AGP_APERTURE_BAR);
347 341
348 /* attbase - aperture base */ 342 /* attbase - aperture base */
349 pci_write_config_dword(agp_bridge->dev, INTEL_ATTBASE, agp_bridge->gatt_bus_addr); 343 pci_write_config_dword(agp_bridge->dev, INTEL_ATTBASE, agp_bridge->gatt_bus_addr);
@@ -361,7 +355,6 @@ static int intel_860_configure(void)
361 355
362static int intel_830mp_configure(void) 356static int intel_830mp_configure(void)
363{ 357{
364 u32 temp;
365 u16 temp2; 358 u16 temp2;
366 struct aper_size_info_8 *current_size; 359 struct aper_size_info_8 *current_size;
367 360
@@ -371,8 +364,8 @@ static int intel_830mp_configure(void)
371 pci_write_config_byte(agp_bridge->dev, INTEL_APSIZE, current_size->size_value); 364 pci_write_config_byte(agp_bridge->dev, INTEL_APSIZE, current_size->size_value);
372 365
373 /* address to map to */ 366 /* address to map to */
374 pci_read_config_dword(agp_bridge->dev, AGP_APBASE, &temp); 367 agp_bridge->gart_bus_addr = pci_bus_address(agp_bridge->dev,
375 agp_bridge->gart_bus_addr = (temp & PCI_BASE_ADDRESS_MEM_MASK); 368 AGP_APERTURE_BAR);
376 369
377 /* attbase - aperture base */ 370 /* attbase - aperture base */
378 pci_write_config_dword(agp_bridge->dev, INTEL_ATTBASE, agp_bridge->gatt_bus_addr); 371 pci_write_config_dword(agp_bridge->dev, INTEL_ATTBASE, agp_bridge->gatt_bus_addr);
@@ -390,7 +383,6 @@ static int intel_830mp_configure(void)
390 383
391static int intel_7505_configure(void) 384static int intel_7505_configure(void)
392{ 385{
393 u32 temp;
394 u16 temp2; 386 u16 temp2;
395 struct aper_size_info_8 *current_size; 387 struct aper_size_info_8 *current_size;
396 388
@@ -400,8 +392,8 @@ static int intel_7505_configure(void)
400 pci_write_config_byte(agp_bridge->dev, INTEL_APSIZE, current_size->size_value); 392 pci_write_config_byte(agp_bridge->dev, INTEL_APSIZE, current_size->size_value);
401 393
402 /* address to map to */ 394 /* address to map to */
403 pci_read_config_dword(agp_bridge->dev, AGP_APBASE, &temp); 395 agp_bridge->gart_bus_addr = pci_bus_address(agp_bridge->dev,
404 agp_bridge->gart_bus_addr = (temp & PCI_BASE_ADDRESS_MEM_MASK); 396 AGP_APERTURE_BAR);
405 397
406 /* attbase - aperture base */ 398 /* attbase - aperture base */
407 pci_write_config_dword(agp_bridge->dev, INTEL_ATTBASE, agp_bridge->gatt_bus_addr); 399 pci_write_config_dword(agp_bridge->dev, INTEL_ATTBASE, agp_bridge->gatt_bus_addr);