aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/char/agp/Kconfig4
-rw-r--r--drivers/char/agp/agp.h11
-rw-r--r--drivers/char/agp/ali-agp.c2
-rw-r--r--drivers/char/agp/alpha-agp.c14
-rw-r--r--drivers/char/agp/amd64-agp.c2
-rw-r--r--drivers/char/agp/ati-agp.c10
-rw-r--r--drivers/char/agp/backend.c2
-rw-r--r--drivers/char/agp/efficeon-agp.c16
-rw-r--r--drivers/char/agp/frontend.c2
-rw-r--r--drivers/char/agp/generic.c2
-rw-r--r--drivers/char/agp/hp-agp.c6
-rw-r--r--drivers/char/agp/i460-agp.c16
-rw-r--r--drivers/char/agp/intel-agp.c45
-rw-r--r--drivers/char/agp/isoch.c20
-rw-r--r--drivers/char/agp/nvidia-agp.c20
-rw-r--r--drivers/char/agp/sgi-agp.c2
-rw-r--r--drivers/char/agp/sis-agp.c8
-rw-r--r--drivers/char/agp/sworks-agp.c15
-rw-r--r--drivers/char/agp/uninorth-agp.c12
19 files changed, 103 insertions, 106 deletions
diff --git a/drivers/char/agp/Kconfig b/drivers/char/agp/Kconfig
index a4d425d2dce..0b9cf9c59a2 100644
--- a/drivers/char/agp/Kconfig
+++ b/drivers/char/agp/Kconfig
@@ -98,12 +98,12 @@ config AGP_SWORKS
98 tristate "Serverworks LE/HE chipset support" 98 tristate "Serverworks LE/HE chipset support"
99 depends on AGP && X86_32 99 depends on AGP && X86_32
100 help 100 help
101 Say Y here to support the Serverworks AGP card. See 101 Say Y here to support the Serverworks AGP card. See
102 <http://www.serverworks.com/> for product descriptions and images. 102 <http://www.serverworks.com/> for product descriptions and images.
103 103
104config AGP_VIA 104config AGP_VIA
105 tristate "VIA chipset support" 105 tristate "VIA chipset support"
106 depends on AGP && X86_32 106 depends on AGP
107 help 107 help
108 This option gives you AGP support for the GLX component of 108 This option gives you AGP support for the GLX component of
109 X on VIA MVP3/Apollo Pro chipsets. 109 X on VIA MVP3/Apollo Pro chipsets.
diff --git a/drivers/char/agp/agp.h b/drivers/char/agp/agp.h
index b4af87c6f9c..3c623b67ea1 100644
--- a/drivers/char/agp/agp.h
+++ b/drivers/char/agp/agp.h
@@ -19,9 +19,9 @@
19 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 19 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
20 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 21 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
22 * JEFF HARTMANN, OR ANY OTHER CONTRIBUTORS BE LIABLE FOR ANY CLAIM, 22 * JEFF HARTMANN, OR ANY OTHER CONTRIBUTORS BE LIABLE FOR ANY CLAIM,
23 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 23 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
24 * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE 24 * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
25 * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 25 * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
26 * 26 *
27 */ 27 */
@@ -53,7 +53,7 @@ enum aper_size_type {
53struct gatt_mask { 53struct gatt_mask {
54 unsigned long mask; 54 unsigned long mask;
55 u32 type; 55 u32 type;
56 /* totally device specific, for integrated chipsets that 56 /* totally device specific, for integrated chipsets that
57 * might have different types of memory masks. For other 57 * might have different types of memory masks. For other
58 * devices this will probably be ignored */ 58 * devices this will probably be ignored */
59}; 59};
@@ -104,8 +104,7 @@ struct agp_bridge_driver {
104 void (*agp_enable)(struct agp_bridge_data *, u32); 104 void (*agp_enable)(struct agp_bridge_data *, u32);
105 void (*cleanup)(void); 105 void (*cleanup)(void);
106 void (*tlb_flush)(struct agp_memory *); 106 void (*tlb_flush)(struct agp_memory *);
107 unsigned long (*mask_memory)(struct agp_bridge_data *, 107 unsigned long (*mask_memory)(struct agp_bridge_data *, unsigned long, int);
108 unsigned long, int);
109 void (*cache_flush)(void); 108 void (*cache_flush)(void);
110 int (*create_gatt_table)(struct agp_bridge_data *); 109 int (*create_gatt_table)(struct agp_bridge_data *);
111 int (*free_gatt_table)(struct agp_bridge_data *); 110 int (*free_gatt_table)(struct agp_bridge_data *);
diff --git a/drivers/char/agp/ali-agp.c b/drivers/char/agp/ali-agp.c
index b02fc226715..5a31ec7c62f 100644
--- a/drivers/char/agp/ali-agp.c
+++ b/drivers/char/agp/ali-agp.c
@@ -147,7 +147,7 @@ static void *m1541_alloc_page(struct agp_bridge_data *bridge)
147 147
148 if (!addr) 148 if (!addr)
149 return NULL; 149 return NULL;
150 150
151 pci_read_config_dword(agp_bridge->dev, ALI_CACHE_FLUSH_CTRL, &temp); 151 pci_read_config_dword(agp_bridge->dev, ALI_CACHE_FLUSH_CTRL, &temp);
152 pci_write_config_dword(agp_bridge->dev, ALI_CACHE_FLUSH_CTRL, 152 pci_write_config_dword(agp_bridge->dev, ALI_CACHE_FLUSH_CTRL,
153 (((temp & ALI_CACHE_FLUSH_ADDR_MASK) | 153 (((temp & ALI_CACHE_FLUSH_ADDR_MASK) |
diff --git a/drivers/char/agp/alpha-agp.c b/drivers/char/agp/alpha-agp.c
index a072d32005a..2b5838e6475 100644
--- a/drivers/char/agp/alpha-agp.c
+++ b/drivers/char/agp/alpha-agp.c
@@ -23,8 +23,9 @@ static struct page *alpha_core_agp_vm_nopage(struct vm_area_struct *vma,
23 dma_addr = address - vma->vm_start + agp->aperture.bus_base; 23 dma_addr = address - vma->vm_start + agp->aperture.bus_base;
24 pa = agp->ops->translate(agp, dma_addr); 24 pa = agp->ops->translate(agp, dma_addr);
25 25
26 if (pa == (unsigned long)-EINVAL) return NULL; /* no translation */ 26 if (pa == (unsigned long)-EINVAL)
27 27 return NULL; /* no translation */
28
28 /* 29 /*
29 * Get the page, inc the use count, and return it 30 * Get the page, inc the use count, and return it
30 */ 31 */
@@ -89,7 +90,7 @@ static void alpha_core_agp_enable(struct agp_bridge_data *bridge, u32 mode)
89 agp_device_command(agp->mode.lw, 0); 90 agp_device_command(agp->mode.lw, 0);
90} 91}
91 92
92static int alpha_core_agp_insert_memory(struct agp_memory *mem, off_t pg_start, 93static int alpha_core_agp_insert_memory(struct agp_memory *mem, off_t pg_start,
93 int type) 94 int type)
94{ 95{
95 alpha_agp_info *agp = agp_bridge->dev_private_data; 96 alpha_agp_info *agp = agp_bridge->dev_private_data;
@@ -98,7 +99,8 @@ static int alpha_core_agp_insert_memory(struct agp_memory *mem, off_t pg_start,
98 99
99 temp = agp_bridge->current_size; 100 temp = agp_bridge->current_size;
100 num_entries = A_SIZE_FIX(temp)->num_entries; 101 num_entries = A_SIZE_FIX(temp)->num_entries;
101 if ((pg_start + mem->page_count) > num_entries) return -EINVAL; 102 if ((pg_start + mem->page_count) > num_entries)
103 return -EINVAL;
102 104
103 status = agp->ops->bind(agp, pg_start, mem); 105 status = agp->ops->bind(agp, pg_start, mem);
104 mb(); 106 mb();
@@ -107,7 +109,7 @@ static int alpha_core_agp_insert_memory(struct agp_memory *mem, off_t pg_start,
107 return status; 109 return status;
108} 110}
109 111
110static int alpha_core_agp_remove_memory(struct agp_memory *mem, off_t pg_start, 112static int alpha_core_agp_remove_memory(struct agp_memory *mem, off_t pg_start,
111 int type) 113 int type)
112{ 114{
113 alpha_agp_info *agp = agp_bridge->dev_private_data; 115 alpha_agp_info *agp = agp_bridge->dev_private_data;
@@ -125,7 +127,7 @@ struct agp_bridge_driver alpha_core_agp_driver = {
125 .size_type = FIXED_APER_SIZE, 127 .size_type = FIXED_APER_SIZE,
126 .cant_use_aperture = 1, 128 .cant_use_aperture = 1,
127 .masks = NULL, 129 .masks = NULL,
128 130
129 .fetch_size = alpha_core_agp_fetch_size, 131 .fetch_size = alpha_core_agp_fetch_size,
130 .configure = alpha_core_agp_configure, 132 .configure = alpha_core_agp_configure,
131 .agp_enable = alpha_core_agp_enable, 133 .agp_enable = alpha_core_agp_enable,
diff --git a/drivers/char/agp/amd64-agp.c b/drivers/char/agp/amd64-agp.c
index 7c6c7268e23..36517d4d1ad 100644
--- a/drivers/char/agp/amd64-agp.c
+++ b/drivers/char/agp/amd64-agp.c
@@ -216,7 +216,7 @@ static struct aper_size_info_32 amd_8151_sizes[7] =
216 {256, 65536, 6, 0x00000700 }, /* 1 1 1 0 0 0 */ 216 {256, 65536, 6, 0x00000700 }, /* 1 1 1 0 0 0 */
217 {128, 32768, 5, 0x00000720 }, /* 1 1 1 1 0 0 */ 217 {128, 32768, 5, 0x00000720 }, /* 1 1 1 1 0 0 */
218 {64, 16384, 4, 0x00000730 }, /* 1 1 1 1 1 0 */ 218 {64, 16384, 4, 0x00000730 }, /* 1 1 1 1 1 0 */
219 {32, 8192, 3, 0x00000738 } /* 1 1 1 1 1 1 */ 219 {32, 8192, 3, 0x00000738 } /* 1 1 1 1 1 1 */
220}; 220};
221 221
222static int amd_8151_configure(void) 222static int amd_8151_configure(void)
diff --git a/drivers/char/agp/ati-agp.c b/drivers/char/agp/ati-agp.c
index 5b74c36c116..06fd10ba0c5 100644
--- a/drivers/char/agp/ati-agp.c
+++ b/drivers/char/agp/ati-agp.c
@@ -74,7 +74,7 @@ static int ati_create_page_map(ati_page_map *page_map)
74 /*CACHE_FLUSH();*/ 74 /*CACHE_FLUSH();*/
75 global_cache_flush(); 75 global_cache_flush();
76 76
77 for(i = 0; i < PAGE_SIZE / sizeof(unsigned long); i++) { 77 for (i = 0; i < PAGE_SIZE / sizeof(unsigned long); i++) {
78 writel(agp_bridge->scratch_page, page_map->remapped+i); 78 writel(agp_bridge->scratch_page, page_map->remapped+i);
79 readl(page_map->remapped+i); /* PCI Posting. */ 79 readl(page_map->remapped+i); /* PCI Posting. */
80 } 80 }
@@ -99,7 +99,7 @@ static void ati_free_gatt_pages(void)
99 ati_page_map *entry; 99 ati_page_map *entry;
100 100
101 tables = ati_generic_private.gatt_pages; 101 tables = ati_generic_private.gatt_pages;
102 for(i = 0; i < ati_generic_private.num_tables; i++) { 102 for (i = 0; i < ati_generic_private.num_tables; i++) {
103 entry = tables[i]; 103 entry = tables[i];
104 if (entry != NULL) { 104 if (entry != NULL) {
105 if (entry->real != NULL) 105 if (entry->real != NULL)
@@ -387,7 +387,7 @@ static int ati_create_gatt_table(struct agp_bridge_data *bridge)
387 agp_bridge->gart_bus_addr = addr; 387 agp_bridge->gart_bus_addr = addr;
388 388
389 /* Calculate the agp offset */ 389 /* Calculate the agp offset */
390 for(i = 0; i < value->num_entries / 1024; i++, addr += 0x00400000) { 390 for (i = 0; i < value->num_entries / 1024; i++, addr += 0x00400000) {
391 writel(virt_to_gart(ati_generic_private.gatt_pages[i]->real) | 1, 391 writel(virt_to_gart(ati_generic_private.gatt_pages[i]->real) | 1,
392 page_dir.remapped+GET_PAGE_DIR_OFF(addr)); 392 page_dir.remapped+GET_PAGE_DIR_OFF(addr));
393 readl(page_dir.remapped+GET_PAGE_DIR_OFF(addr)); /* PCI Posting. */ 393 readl(page_dir.remapped+GET_PAGE_DIR_OFF(addr)); /* PCI Posting. */
@@ -466,6 +466,10 @@ static struct agp_device_ids ati_agp_device_ids[] __devinitdata =
466 .device_id = PCI_DEVICE_ID_ATI_RS300_200, 466 .device_id = PCI_DEVICE_ID_ATI_RS300_200,
467 .chipset_name = "IGP9100/M", 467 .chipset_name = "IGP9100/M",
468 }, 468 },
469 {
470 .device_id = PCI_DEVICE_ID_ATI_RS350_200,
471 .chipset_name = "IGP9100/M",
472 },
469 { }, /* dummy final entry, always present */ 473 { }, /* dummy final entry, always present */
470}; 474};
471 475
diff --git a/drivers/char/agp/backend.c b/drivers/char/agp/backend.c
index 80ee17a8fc2..509adc40325 100644
--- a/drivers/char/agp/backend.c
+++ b/drivers/char/agp/backend.c
@@ -228,7 +228,7 @@ static void agp_backend_cleanup(struct agp_bridge_data *bridge)
228struct agp_bridge_data *agp_alloc_bridge(void) 228struct agp_bridge_data *agp_alloc_bridge(void)
229{ 229{
230 struct agp_bridge_data *bridge; 230 struct agp_bridge_data *bridge;
231 231
232 bridge = kzalloc(sizeof(*bridge), GFP_KERNEL); 232 bridge = kzalloc(sizeof(*bridge), GFP_KERNEL);
233 if (!bridge) 233 if (!bridge)
234 return NULL; 234 return NULL;
diff --git a/drivers/char/agp/efficeon-agp.c b/drivers/char/agp/efficeon-agp.c
index e7aea77a60f..fed0a87448d 100644
--- a/drivers/char/agp/efficeon-agp.c
+++ b/drivers/char/agp/efficeon-agp.c
@@ -1,6 +1,6 @@
1/* 1/*
2 * Transmeta's Efficeon AGPGART driver. 2 * Transmeta's Efficeon AGPGART driver.
3 * 3 *
4 * Based upon a diff by Linus around November '02. 4 * Based upon a diff by Linus around November '02.
5 * 5 *
6 * Ported to the 2.6 kernel by Carlos Puchol <cpglinux@puchol.com> 6 * Ported to the 2.6 kernel by Carlos Puchol <cpglinux@puchol.com>
@@ -9,7 +9,7 @@
9 9
10/* 10/*
11 * NOTE-cpg-040217: 11 * NOTE-cpg-040217:
12 * 12 *
13 * - when compiled as a module, after loading the module, 13 * - when compiled as a module, after loading the module,
14 * it will refuse to unload, indicating it is in use, 14 * it will refuse to unload, indicating it is in use,
15 * when it is not. 15 * when it is not.
@@ -45,7 +45,7 @@
45 * 8: Present 45 * 8: Present
46 * 7:6: reserved, write as zero 46 * 7:6: reserved, write as zero
47 * 5:0: GATT directory index: which 1st-level entry 47 * 5:0: GATT directory index: which 1st-level entry
48 * 48 *
49 * The Efficeon AGP spec requires pages to be WB-cacheable 49 * The Efficeon AGP spec requires pages to be WB-cacheable
50 * but to be explicitly CLFLUSH'd after any changes. 50 * but to be explicitly CLFLUSH'd after any changes.
51 */ 51 */
@@ -125,7 +125,7 @@ static int efficeon_configure(void)
125 struct aper_size_info_lvl2 *current_size; 125 struct aper_size_info_lvl2 *current_size;
126 126
127 printk(KERN_DEBUG PFX "efficeon_configure()\n"); 127 printk(KERN_DEBUG PFX "efficeon_configure()\n");
128 128
129 current_size = A_SIZE_LVL2(agp_bridge->current_size); 129 current_size = A_SIZE_LVL2(agp_bridge->current_size);
130 130
131 /* aperture size */ 131 /* aperture size */
@@ -190,7 +190,7 @@ static int efficeon_create_gatt_table(struct agp_bridge_data *bridge)
190 const int present = EFFICEON_PRESENT; 190 const int present = EFFICEON_PRESENT;
191 const int clflush_chunk = ((cpuid_ebx(1) >> 8) & 0xff) << 3; 191 const int clflush_chunk = ((cpuid_ebx(1) >> 8) & 0xff) << 3;
192 int num_entries, l1_pages; 192 int num_entries, l1_pages;
193 193
194 num_entries = A_SIZE_LVL2(agp_bridge->current_size)->num_entries; 194 num_entries = A_SIZE_LVL2(agp_bridge->current_size)->num_entries;
195 195
196 printk(KERN_DEBUG PFX "efficeon_create_gatt_table(%d)\n", num_entries); 196 printk(KERN_DEBUG PFX "efficeon_create_gatt_table(%d)\n", num_entries);
@@ -257,12 +257,12 @@ static int efficeon_insert_memory(struct agp_memory * mem, off_t pg_start, int t
257 257
258 if (!page) 258 if (!page)
259 continue; 259 continue;
260 260
261 page += (index & 0x3ff); 261 page += (index & 0x3ff);
262 *page = insert; 262 *page = insert;
263 263
264 /* clflush is slow, so don't clflush until we have to */ 264 /* clflush is slow, so don't clflush until we have to */
265 if ( last_page && 265 if ( last_page &&
266 ((unsigned long)page^(unsigned long)last_page) & clflush_mask ) 266 ((unsigned long)page^(unsigned long)last_page) & clflush_mask )
267 asm volatile("clflush %0" : : "m" (*last_page)); 267 asm volatile("clflush %0" : : "m" (*last_page));
268 268
@@ -373,7 +373,7 @@ static int __devinit agp_efficeon_probe(struct pci_dev *pdev,
373 */ 373 */
374 r = &pdev->resource[0]; 374 r = &pdev->resource[0];
375 if (!r->start && r->end) { 375 if (!r->start && r->end) {
376 if(pci_assign_resource(pdev, 0)) { 376 if (pci_assign_resource(pdev, 0)) {
377 printk(KERN_ERR PFX "could not assign resource 0\n"); 377 printk(KERN_ERR PFX "could not assign resource 0\n");
378 return -ENODEV; 378 return -ENODEV;
379 } 379 }
diff --git a/drivers/char/agp/frontend.c b/drivers/char/agp/frontend.c
index 97eeb2345b1..ffcf15c30e9 100644
--- a/drivers/char/agp/frontend.c
+++ b/drivers/char/agp/frontend.c
@@ -781,7 +781,7 @@ static int agpioc_acquire_wrap(struct agp_file_private *priv)
781 if (agp_fe.current_controller != NULL) 781 if (agp_fe.current_controller != NULL)
782 return -EBUSY; 782 return -EBUSY;
783 783
784 if(!agp_bridge) 784 if (!agp_bridge)
785 return -ENODEV; 785 return -ENODEV;
786 786
787 if (atomic_read(&agp_bridge->agp_in_use)) 787 if (atomic_read(&agp_bridge->agp_in_use))
diff --git a/drivers/char/agp/generic.c b/drivers/char/agp/generic.c
index 5567ce8d72b..4e1891e2c03 100644
--- a/drivers/char/agp/generic.c
+++ b/drivers/char/agp/generic.c
@@ -299,7 +299,7 @@ EXPORT_SYMBOL_GPL(agp_num_entries);
299/** 299/**
300 * agp_copy_info - copy bridge state information 300 * agp_copy_info - copy bridge state information
301 * 301 *
302 * @info: agp_kern_info pointer. The caller should insure that this pointer is valid. 302 * @info: agp_kern_info pointer. The caller should insure that this pointer is valid.
303 * 303 *
304 * This function copies information about the agp bridge device and the state of 304 * This function copies information about the agp bridge device and the state of
305 * the agp backend into an agp_kern_info pointer. 305 * the agp backend into an agp_kern_info pointer.
diff --git a/drivers/char/agp/hp-agp.c b/drivers/char/agp/hp-agp.c
index de5d6d21267..8c4c6ef748e 100644
--- a/drivers/char/agp/hp-agp.c
+++ b/drivers/char/agp/hp-agp.c
@@ -85,8 +85,8 @@ static int __init hp_zx1_ioc_shared(void)
85 /* 85 /*
86 * IOC already configured by sba_iommu module; just use 86 * IOC already configured by sba_iommu module; just use
87 * its setup. We assume: 87 * its setup. We assume:
88 * - IOVA space is 1Gb in size 88 * - IOVA space is 1Gb in size
89 * - first 512Mb is IOMMU, second 512Mb is GART 89 * - first 512Mb is IOMMU, second 512Mb is GART
90 */ 90 */
91 hp->io_tlb_ps = readq(hp->ioc_regs+HP_ZX1_TCNFG); 91 hp->io_tlb_ps = readq(hp->ioc_regs+HP_ZX1_TCNFG);
92 switch (hp->io_tlb_ps) { 92 switch (hp->io_tlb_ps) {
@@ -115,7 +115,7 @@ static int __init hp_zx1_ioc_shared(void)
115 115
116 if (hp->gatt[0] != HP_ZX1_SBA_IOMMU_COOKIE) { 116 if (hp->gatt[0] != HP_ZX1_SBA_IOMMU_COOKIE) {
117 /* Normal case when no AGP device in system */ 117 /* Normal case when no AGP device in system */
118 hp->gatt = NULL; 118 hp->gatt = NULL;
119 hp->gatt_entries = 0; 119 hp->gatt_entries = 0;
120 printk(KERN_ERR PFX "No reserved IO PDIR entry found; " 120 printk(KERN_ERR PFX "No reserved IO PDIR entry found; "
121 "GART disabled\n"); 121 "GART disabled\n");
diff --git a/drivers/char/agp/i460-agp.c b/drivers/char/agp/i460-agp.c
index 8ee19a4a6bc..91769443d8f 100644
--- a/drivers/char/agp/i460-agp.c
+++ b/drivers/char/agp/i460-agp.c
@@ -400,10 +400,10 @@ static int i460_insert_memory_large_io_page (struct agp_memory *mem,
400 num_entries = A_SIZE_8(temp)->num_entries; 400 num_entries = A_SIZE_8(temp)->num_entries;
401 401
402 /* Figure out what pg_start means in terms of our large GART pages */ 402 /* Figure out what pg_start means in terms of our large GART pages */
403 start = &i460.lp_desc[pg_start / I460_KPAGES_PER_IOPAGE]; 403 start = &i460.lp_desc[pg_start / I460_KPAGES_PER_IOPAGE];
404 end = &i460.lp_desc[(pg_start + mem->page_count - 1) / I460_KPAGES_PER_IOPAGE]; 404 end = &i460.lp_desc[(pg_start + mem->page_count - 1) / I460_KPAGES_PER_IOPAGE];
405 start_offset = pg_start % I460_KPAGES_PER_IOPAGE; 405 start_offset = pg_start % I460_KPAGES_PER_IOPAGE;
406 end_offset = (pg_start + mem->page_count - 1) % I460_KPAGES_PER_IOPAGE; 406 end_offset = (pg_start + mem->page_count - 1) % I460_KPAGES_PER_IOPAGE;
407 407
408 if (end > i460.lp_desc + num_entries) { 408 if (end > i460.lp_desc + num_entries) {
409 printk(KERN_ERR PFX "Looks like we're out of AGP memory\n"); 409 printk(KERN_ERR PFX "Looks like we're out of AGP memory\n");
@@ -458,10 +458,10 @@ static int i460_remove_memory_large_io_page (struct agp_memory *mem,
458 num_entries = A_SIZE_8(temp)->num_entries; 458 num_entries = A_SIZE_8(temp)->num_entries;
459 459
460 /* Figure out what pg_start means in terms of our large GART pages */ 460 /* Figure out what pg_start means in terms of our large GART pages */
461 start = &i460.lp_desc[pg_start / I460_KPAGES_PER_IOPAGE]; 461 start = &i460.lp_desc[pg_start / I460_KPAGES_PER_IOPAGE];
462 end = &i460.lp_desc[(pg_start + mem->page_count - 1) / I460_KPAGES_PER_IOPAGE]; 462 end = &i460.lp_desc[(pg_start + mem->page_count - 1) / I460_KPAGES_PER_IOPAGE];
463 start_offset = pg_start % I460_KPAGES_PER_IOPAGE; 463 start_offset = pg_start % I460_KPAGES_PER_IOPAGE;
464 end_offset = (pg_start + mem->page_count - 1) % I460_KPAGES_PER_IOPAGE; 464 end_offset = (pg_start + mem->page_count - 1) % I460_KPAGES_PER_IOPAGE;
465 465
466 for (i = 0, lp = start; lp <= end; ++lp) { 466 for (i = 0, lp = start; lp <= end; ++lp) {
467 for (idx = ((lp == start) ? start_offset : 0); 467 for (idx = ((lp == start) ? start_offset : 0);
diff --git a/drivers/char/agp/intel-agp.c b/drivers/char/agp/intel-agp.c
index 631531fd97a..bddcae54b16 100644
--- a/drivers/char/agp/intel-agp.c
+++ b/drivers/char/agp/intel-agp.c
@@ -201,9 +201,9 @@ static int intel_i810_insert_entries(struct agp_memory *mem, off_t pg_start,
201 temp = agp_bridge->current_size; 201 temp = agp_bridge->current_size;
202 num_entries = A_SIZE_FIX(temp)->num_entries; 202 num_entries = A_SIZE_FIX(temp)->num_entries;
203 203
204 if ((pg_start + mem->page_count) > num_entries) { 204 if ((pg_start + mem->page_count) > num_entries)
205 return -EINVAL; 205 return -EINVAL;
206 } 206
207 for (j = pg_start; j < (pg_start + mem->page_count); j++) { 207 for (j = pg_start; j < (pg_start + mem->page_count); j++) {
208 if (!PGE_EMPTY(agp_bridge, readl(agp_bridge->gatt_table+j))) 208 if (!PGE_EMPTY(agp_bridge, readl(agp_bridge->gatt_table+j)))
209 return -EBUSY; 209 return -EBUSY;
@@ -221,7 +221,7 @@ static int intel_i810_insert_entries(struct agp_memory *mem, off_t pg_start,
221 agp_bridge->driver->tlb_flush(mem); 221 agp_bridge->driver->tlb_flush(mem);
222 return 0; 222 return 0;
223 } 223 }
224 if((type == AGP_PHYS_MEMORY) && (mem->type == AGP_PHYS_MEMORY)) 224 if ((type == AGP_PHYS_MEMORY) && (mem->type == AGP_PHYS_MEMORY))
225 goto insert; 225 goto insert;
226 return -EINVAL; 226 return -EINVAL;
227 } 227 }
@@ -328,7 +328,7 @@ static struct agp_memory *intel_i810_alloc_by_type(size_t pg_count, int type)
328static void intel_i810_free_by_type(struct agp_memory *curr) 328static void intel_i810_free_by_type(struct agp_memory *curr)
329{ 329{
330 agp_free_key(curr->key); 330 agp_free_key(curr->key);
331 if(curr->type == AGP_PHYS_MEMORY) { 331 if (curr->type == AGP_PHYS_MEMORY) {
332 if (curr->page_count == 4) 332 if (curr->page_count == 4)
333 i8xx_destroy_pages(gart_to_virt(curr->memory[0])); 333 i8xx_destroy_pages(gart_to_virt(curr->memory[0]));
334 else { 334 else {
@@ -1603,11 +1603,10 @@ static int __devinit agp_intel_probe(struct pci_dev *pdev,
1603 name = "i820"; 1603 name = "i820";
1604 break; 1604 break;
1605 case PCI_DEVICE_ID_INTEL_82830_HB: 1605 case PCI_DEVICE_ID_INTEL_82830_HB:
1606 if (find_i830(PCI_DEVICE_ID_INTEL_82830_CGC)) { 1606 if (find_i830(PCI_DEVICE_ID_INTEL_82830_CGC))
1607 bridge->driver = &intel_830_driver; 1607 bridge->driver = &intel_830_driver;
1608 } else { 1608 else
1609 bridge->driver = &intel_830mp_driver; 1609 bridge->driver = &intel_830mp_driver;
1610 }
1611 name = "830M"; 1610 name = "830M";
1612 break; 1611 break;
1613 case PCI_DEVICE_ID_INTEL_82840_HB: 1612 case PCI_DEVICE_ID_INTEL_82840_HB:
@@ -1619,11 +1618,10 @@ static int __devinit agp_intel_probe(struct pci_dev *pdev,
1619 name = "i845"; 1618 name = "i845";
1620 break; 1619 break;
1621 case PCI_DEVICE_ID_INTEL_82845G_HB: 1620 case PCI_DEVICE_ID_INTEL_82845G_HB:
1622 if (find_i830(PCI_DEVICE_ID_INTEL_82845G_IG)) { 1621 if (find_i830(PCI_DEVICE_ID_INTEL_82845G_IG))
1623 bridge->driver = &intel_830_driver; 1622 bridge->driver = &intel_830_driver;
1624 } else { 1623 else
1625 bridge->driver = &intel_845_driver; 1624 bridge->driver = &intel_845_driver;
1626 }
1627 name = "845G"; 1625 name = "845G";
1628 break; 1626 break;
1629 case PCI_DEVICE_ID_INTEL_82850_HB: 1627 case PCI_DEVICE_ID_INTEL_82850_HB:
@@ -1648,11 +1646,10 @@ static int __devinit agp_intel_probe(struct pci_dev *pdev,
1648 name = "i860"; 1646 name = "i860";
1649 break; 1647 break;
1650 case PCI_DEVICE_ID_INTEL_82865_HB: 1648 case PCI_DEVICE_ID_INTEL_82865_HB:
1651 if (find_i830(PCI_DEVICE_ID_INTEL_82865_IG)) { 1649 if (find_i830(PCI_DEVICE_ID_INTEL_82865_IG))
1652 bridge->driver = &intel_830_driver; 1650 bridge->driver = &intel_830_driver;
1653 } else { 1651 else
1654 bridge->driver = &intel_845_driver; 1652 bridge->driver = &intel_845_driver;
1655 }
1656 name = "865"; 1653 name = "865";
1657 break; 1654 break;
1658 case PCI_DEVICE_ID_INTEL_82875_HB: 1655 case PCI_DEVICE_ID_INTEL_82875_HB:
@@ -1660,35 +1657,31 @@ static int __devinit agp_intel_probe(struct pci_dev *pdev,
1660 name = "i875"; 1657 name = "i875";
1661 break; 1658 break;
1662 case PCI_DEVICE_ID_INTEL_82915G_HB: 1659 case PCI_DEVICE_ID_INTEL_82915G_HB:
1663 if (find_i830(PCI_DEVICE_ID_INTEL_82915G_IG)) { 1660 if (find_i830(PCI_DEVICE_ID_INTEL_82915G_IG))
1664 bridge->driver = &intel_915_driver; 1661 bridge->driver = &intel_915_driver;
1665 } else { 1662 else
1666 bridge->driver = &intel_845_driver; 1663 bridge->driver = &intel_845_driver;
1667 }
1668 name = "915G"; 1664 name = "915G";
1669 break; 1665 break;
1670 case PCI_DEVICE_ID_INTEL_82915GM_HB: 1666 case PCI_DEVICE_ID_INTEL_82915GM_HB:
1671 if (find_i830(PCI_DEVICE_ID_INTEL_82915GM_IG)) { 1667 if (find_i830(PCI_DEVICE_ID_INTEL_82915GM_IG))
1672 bridge->driver = &intel_915_driver; 1668 bridge->driver = &intel_915_driver;
1673 } else { 1669 else
1674 bridge->driver = &intel_845_driver; 1670 bridge->driver = &intel_845_driver;
1675 }
1676 name = "915GM"; 1671 name = "915GM";
1677 break; 1672 break;
1678 case PCI_DEVICE_ID_INTEL_82945G_HB: 1673 case PCI_DEVICE_ID_INTEL_82945G_HB:
1679 if (find_i830(PCI_DEVICE_ID_INTEL_82945G_IG)) { 1674 if (find_i830(PCI_DEVICE_ID_INTEL_82945G_IG))
1680 bridge->driver = &intel_915_driver; 1675 bridge->driver = &intel_915_driver;
1681 } else { 1676 else
1682 bridge->driver = &intel_845_driver; 1677 bridge->driver = &intel_845_driver;
1683 }
1684 name = "945G"; 1678 name = "945G";
1685 break; 1679 break;
1686 case PCI_DEVICE_ID_INTEL_82945GM_HB: 1680 case PCI_DEVICE_ID_INTEL_82945GM_HB:
1687 if (find_i830(PCI_DEVICE_ID_INTEL_82945GM_IG)) { 1681 if (find_i830(PCI_DEVICE_ID_INTEL_82945GM_IG))
1688 bridge->driver = &intel_915_driver; 1682 bridge->driver = &intel_915_driver;
1689 } else { 1683 else
1690 bridge->driver = &intel_845_driver; 1684 bridge->driver = &intel_845_driver;
1691 }
1692 name = "945GM"; 1685 name = "945GM";
1693 break; 1686 break;
1694 case PCI_DEVICE_ID_INTEL_7505_0: 1687 case PCI_DEVICE_ID_INTEL_7505_0:
@@ -1724,7 +1717,7 @@ static int __devinit agp_intel_probe(struct pci_dev *pdev,
1724 */ 1717 */
1725 r = &pdev->resource[0]; 1718 r = &pdev->resource[0];
1726 if (!r->start && r->end) { 1719 if (!r->start && r->end) {
1727 if(pci_assign_resource(pdev, 0)) { 1720 if (pci_assign_resource(pdev, 0)) {
1728 printk(KERN_ERR PFX "could not assign resource 0\n"); 1721 printk(KERN_ERR PFX "could not assign resource 0\n");
1729 agp_put_bridge(bridge); 1722 agp_put_bridge(bridge);
1730 return -ENODEV; 1723 return -ENODEV;
diff --git a/drivers/char/agp/isoch.c b/drivers/char/agp/isoch.c
index 7c14a096b85..3f9ccde6237 100644
--- a/drivers/char/agp/isoch.c
+++ b/drivers/char/agp/isoch.c
@@ -26,7 +26,7 @@ static void agp_3_5_dev_list_insert(struct list_head *head, struct list_head *ne
26 26
27 list_for_each(pos, head) { 27 list_for_each(pos, head) {
28 cur = list_entry(pos, struct agp_3_5_dev, list); 28 cur = list_entry(pos, struct agp_3_5_dev, list);
29 if(cur->maxbw > n->maxbw) 29 if (cur->maxbw > n->maxbw)
30 break; 30 break;
31 } 31 }
32 list_add_tail(new, pos); 32 list_add_tail(new, pos);
@@ -54,9 +54,9 @@ static void agp_3_5_dev_list_sort(struct agp_3_5_dev *list, unsigned int ndevs)
54 } 54 }
55} 55}
56 56
57/* 57/*
58 * Initialize all isochronous transfer parameters for an AGP 3.0 58 * Initialize all isochronous transfer parameters for an AGP 3.0
59 * node (i.e. a host bridge in combination with the adapters 59 * node (i.e. a host bridge in combination with the adapters
60 * lying behind it...) 60 * lying behind it...)
61 */ 61 */
62 62
@@ -200,7 +200,7 @@ static int agp_3_5_isochronous_node_enable(struct agp_bridge_data *bridge,
200 * this to the hungriest device (as per the spec) */ 200 * this to the hungriest device (as per the spec) */
201 rem = target.n - tot_n; 201 rem = target.n - tot_n;
202 202
203 /* 203 /*
204 * Calculate the minimum isochronous RQ depth needed by each master. 204 * Calculate the minimum isochronous RQ depth needed by each master.
205 * Along the way, distribute the extra ISOCH_N capability calculated 205 * Along the way, distribute the extra ISOCH_N capability calculated
206 * above. 206 * above.
@@ -214,7 +214,7 @@ static int agp_3_5_isochronous_node_enable(struct agp_bridge_data *bridge,
214 * many writes on the AGP bus). 214 * many writes on the AGP bus).
215 */ 215 */
216 master[cdev].rq = master[cdev].n; 216 master[cdev].rq = master[cdev].n;
217 if(master[cdev].y > 0x1) 217 if (master[cdev].y > 0x1)
218 master[cdev].rq *= (1 << (master[cdev].y - 1)); 218 master[cdev].rq *= (1 << (master[cdev].y - 1));
219 219
220 tot_rq += master[cdev].rq; 220 tot_rq += master[cdev].rq;
@@ -334,9 +334,9 @@ int agp_3_5_enable(struct agp_bridge_data *bridge)
334 334
335 arqsz = (tstatus >> 13) & 0x7; 335 arqsz = (tstatus >> 13) & 0x7;
336 336
337 /* 337 /*
338 * Allocate a head for our AGP 3.5 device list 338 * Allocate a head for our AGP 3.5 device list
339 * (multiple AGP v3 devices are allowed behind a single bridge). 339 * (multiple AGP v3 devices are allowed behind a single bridge).
340 */ 340 */
341 if ((dev_list = kmalloc(sizeof(*dev_list), GFP_KERNEL)) == NULL) { 341 if ((dev_list = kmalloc(sizeof(*dev_list), GFP_KERNEL)) == NULL) {
342 ret = -ENOMEM; 342 ret = -ENOMEM;
@@ -366,7 +366,7 @@ int agp_3_5_enable(struct agp_bridge_data *bridge)
366 366
367 case 0x0300: /* Display controller */ 367 case 0x0300: /* Display controller */
368 case 0x0400: /* Multimedia controller */ 368 case 0x0400: /* Multimedia controller */
369 if((cur = kmalloc(sizeof(*cur), GFP_KERNEL)) == NULL) { 369 if ((cur = kmalloc(sizeof(*cur), GFP_KERNEL)) == NULL) {
370 ret = -ENOMEM; 370 ret = -ENOMEM;
371 goto free_and_exit; 371 goto free_and_exit;
372 } 372 }
@@ -391,7 +391,7 @@ int agp_3_5_enable(struct agp_bridge_data *bridge)
391 list_for_each(pos, head) { 391 list_for_each(pos, head) {
392 cur = list_entry(pos, struct agp_3_5_dev, list); 392 cur = list_entry(pos, struct agp_3_5_dev, list);
393 dev = cur->dev; 393 dev = cur->dev;
394 394
395 pci_read_config_word(dev, PCI_STATUS, &mpstat); 395 pci_read_config_word(dev, PCI_STATUS, &mpstat);
396 if ((mpstat & PCI_STATUS_CAP_LIST) == 0) 396 if ((mpstat & PCI_STATUS_CAP_LIST) == 0)
397 continue; 397 continue;
diff --git a/drivers/char/agp/nvidia-agp.c b/drivers/char/agp/nvidia-agp.c
index 80dafa3030b..70b8ed9cd17 100644
--- a/drivers/char/agp/nvidia-agp.c
+++ b/drivers/char/agp/nvidia-agp.c
@@ -72,7 +72,7 @@ static int nvidia_init_iorr(u32 base, u32 size)
72 /* Find the iorr that is already used for the base */ 72 /* Find the iorr that is already used for the base */
73 /* If not found, determine the uppermost available iorr */ 73 /* If not found, determine the uppermost available iorr */
74 free_iorr_addr = AMD_K7_NUM_IORR; 74 free_iorr_addr = AMD_K7_NUM_IORR;
75 for(iorr_addr = 0; iorr_addr < AMD_K7_NUM_IORR; iorr_addr++) { 75 for (iorr_addr = 0; iorr_addr < AMD_K7_NUM_IORR; iorr_addr++) {
76 rdmsr(IORR_BASE0 + 2 * iorr_addr, base_lo, base_hi); 76 rdmsr(IORR_BASE0 + 2 * iorr_addr, base_lo, base_hi);
77 rdmsr(IORR_MASK0 + 2 * iorr_addr, mask_lo, mask_hi); 77 rdmsr(IORR_MASK0 + 2 * iorr_addr, mask_lo, mask_hi);
78 78
@@ -82,7 +82,7 @@ static int nvidia_init_iorr(u32 base, u32 size)
82 if ((mask_lo & 0x00000800) == 0) 82 if ((mask_lo & 0x00000800) == 0)
83 free_iorr_addr = iorr_addr; 83 free_iorr_addr = iorr_addr;
84 } 84 }
85 85
86 if (iorr_addr >= AMD_K7_NUM_IORR) { 86 if (iorr_addr >= AMD_K7_NUM_IORR) {
87 iorr_addr = free_iorr_addr; 87 iorr_addr = free_iorr_addr;
88 if (iorr_addr >= AMD_K7_NUM_IORR) 88 if (iorr_addr >= AMD_K7_NUM_IORR)
@@ -139,7 +139,7 @@ static int nvidia_configure(void)
139 } 139 }
140 140
141 /* attbase */ 141 /* attbase */
142 for(i = 0; i < 8; i++) { 142 for (i = 0; i < 8; i++) {
143 pci_write_config_dword(nvidia_private.dev_2, NVIDIA_2_ATTBASE(i), 143 pci_write_config_dword(nvidia_private.dev_2, NVIDIA_2_ATTBASE(i),
144 (agp_bridge->gatt_bus_addr + (i % num_dirs) * 64 * 1024) | 1); 144 (agp_bridge->gatt_bus_addr + (i % num_dirs) * 64 * 1024) | 1);
145 } 145 }
@@ -197,15 +197,15 @@ extern int agp_memory_reserved;
197static int nvidia_insert_memory(struct agp_memory *mem, off_t pg_start, int type) 197static int nvidia_insert_memory(struct agp_memory *mem, off_t pg_start, int type)
198{ 198{
199 int i, j; 199 int i, j;
200 200
201 if ((type != 0) || (mem->type != 0)) 201 if ((type != 0) || (mem->type != 0))
202 return -EINVAL; 202 return -EINVAL;
203 203
204 if ((pg_start + mem->page_count) > 204 if ((pg_start + mem->page_count) >
205 (nvidia_private.num_active_entries - agp_memory_reserved/PAGE_SIZE)) 205 (nvidia_private.num_active_entries - agp_memory_reserved/PAGE_SIZE))
206 return -EINVAL; 206 return -EINVAL;
207 207
208 for(j = pg_start; j < (pg_start + mem->page_count); j++) { 208 for (j = pg_start; j < (pg_start + mem->page_count); j++) {
209 if (!PGE_EMPTY(agp_bridge, readl(agp_bridge->gatt_table+nvidia_private.pg_offset+j))) 209 if (!PGE_EMPTY(agp_bridge, readl(agp_bridge->gatt_table+nvidia_private.pg_offset+j)))
210 return -EBUSY; 210 return -EBUSY;
211 } 211 }
@@ -264,9 +264,9 @@ static void nvidia_tlbflush(struct agp_memory *mem)
264 } 264 }
265 265
266 /* flush TLB entries */ 266 /* flush TLB entries */
267 for(i = 0; i < 32 + 1; i++) 267 for (i = 0; i < 32 + 1; i++)
268 temp = readl(nvidia_private.aperture+(i * PAGE_SIZE / sizeof(u32))); 268 temp = readl(nvidia_private.aperture+(i * PAGE_SIZE / sizeof(u32)));
269 for(i = 0; i < 32 + 1; i++) 269 for (i = 0; i < 32 + 1; i++)
270 temp = readl(nvidia_private.aperture+(i * PAGE_SIZE / sizeof(u32))); 270 temp = readl(nvidia_private.aperture+(i * PAGE_SIZE / sizeof(u32)));
271} 271}
272 272
@@ -323,7 +323,7 @@ static int __devinit agp_nvidia_probe(struct pci_dev *pdev,
323 pci_find_slot((unsigned int)pdev->bus->number, PCI_DEVFN(0, 2)); 323 pci_find_slot((unsigned int)pdev->bus->number, PCI_DEVFN(0, 2));
324 nvidia_private.dev_3 = 324 nvidia_private.dev_3 =
325 pci_find_slot((unsigned int)pdev->bus->number, PCI_DEVFN(30, 0)); 325 pci_find_slot((unsigned int)pdev->bus->number, PCI_DEVFN(30, 0));
326 326
327 if (!nvidia_private.dev_1 || !nvidia_private.dev_2 || !nvidia_private.dev_3) { 327 if (!nvidia_private.dev_1 || !nvidia_private.dev_2 || !nvidia_private.dev_3) {
328 printk(KERN_INFO PFX "Detected an NVIDIA nForce/nForce2 " 328 printk(KERN_INFO PFX "Detected an NVIDIA nForce/nForce2 "
329 "chipset, but could not find the secondary devices.\n"); 329 "chipset, but could not find the secondary devices.\n");
diff --git a/drivers/char/agp/sgi-agp.c b/drivers/char/agp/sgi-agp.c
index 4df7734b51c..cfa7922cb43 100644
--- a/drivers/char/agp/sgi-agp.c
+++ b/drivers/char/agp/sgi-agp.c
@@ -329,7 +329,7 @@ static int __devinit agp_sgi_init(void)
329 329
330static void __devexit agp_sgi_cleanup(void) 330static void __devexit agp_sgi_cleanup(void)
331{ 331{
332 if(sgi_tioca_agp_bridges) 332 if (sgi_tioca_agp_bridges)
333 kfree(sgi_tioca_agp_bridges); 333 kfree(sgi_tioca_agp_bridges);
334 sgi_tioca_agp_bridges=NULL; 334 sgi_tioca_agp_bridges=NULL;
335} 335}
diff --git a/drivers/char/agp/sis-agp.c b/drivers/char/agp/sis-agp.c
index ebc05554045..a00fd48a6f0 100644
--- a/drivers/char/agp/sis-agp.c
+++ b/drivers/char/agp/sis-agp.c
@@ -121,7 +121,7 @@ static struct aper_size_info_8 sis_generic_sizes[7] =
121 121
122static struct agp_bridge_driver sis_driver = { 122static struct agp_bridge_driver sis_driver = {
123 .owner = THIS_MODULE, 123 .owner = THIS_MODULE,
124 .aperture_sizes = sis_generic_sizes, 124 .aperture_sizes = sis_generic_sizes,
125 .size_type = U8_APER_SIZE, 125 .size_type = U8_APER_SIZE,
126 .num_aperture_sizes = 7, 126 .num_aperture_sizes = 7,
127 .configure = sis_configure, 127 .configure = sis_configure,
@@ -243,11 +243,11 @@ static void __devinit sis_get_driver(struct agp_bridge_data *bridge)
243{ 243{
244 int i; 244 int i;
245 245
246 for(i=0; sis_broken_chipsets[i]!=0; ++i) 246 for (i=0; sis_broken_chipsets[i]!=0; ++i)
247 if(bridge->dev->device==sis_broken_chipsets[i]) 247 if (bridge->dev->device==sis_broken_chipsets[i])
248 break; 248 break;
249 249
250 if(sis_broken_chipsets[i] || agp_sis_force_delay) 250 if (sis_broken_chipsets[i] || agp_sis_force_delay)
251 sis_driver.agp_enable=sis_delayed_enable; 251 sis_driver.agp_enable=sis_delayed_enable;
252 252
253 // sis chipsets that indicate less than agp3.5 253 // sis chipsets that indicate less than agp3.5
diff --git a/drivers/char/agp/sworks-agp.c b/drivers/char/agp/sworks-agp.c
index efef9999f1c..4f2d7d99902 100644
--- a/drivers/char/agp/sworks-agp.c
+++ b/drivers/char/agp/sworks-agp.c
@@ -64,7 +64,7 @@ static int serverworks_create_page_map(struct serverworks_page_map *page_map)
64 } 64 }
65 global_cache_flush(); 65 global_cache_flush();
66 66
67 for(i = 0; i < PAGE_SIZE / sizeof(unsigned long); i++) 67 for (i = 0; i < PAGE_SIZE / sizeof(unsigned long); i++)
68 writel(agp_bridge->scratch_page, page_map->remapped+i); 68 writel(agp_bridge->scratch_page, page_map->remapped+i);
69 69
70 return 0; 70 return 0;
@@ -84,7 +84,7 @@ static void serverworks_free_gatt_pages(void)
84 struct serverworks_page_map *entry; 84 struct serverworks_page_map *entry;
85 85
86 tables = serverworks_private.gatt_pages; 86 tables = serverworks_private.gatt_pages;
87 for(i = 0; i < serverworks_private.num_tables; i++) { 87 for (i = 0; i < serverworks_private.num_tables; i++) {
88 entry = tables[i]; 88 entry = tables[i];
89 if (entry != NULL) { 89 if (entry != NULL) {
90 if (entry->real != NULL) { 90 if (entry->real != NULL) {
@@ -103,7 +103,7 @@ static int serverworks_create_gatt_pages(int nr_tables)
103 int retval = 0; 103 int retval = 0;
104 int i; 104 int i;
105 105
106 tables = kzalloc((nr_tables + 1) * sizeof(struct serverworks_page_map *), 106 tables = kzalloc((nr_tables + 1) * sizeof(struct serverworks_page_map *),
107 GFP_KERNEL); 107 GFP_KERNEL);
108 if (tables == NULL) 108 if (tables == NULL)
109 return -ENOMEM; 109 return -ENOMEM;
@@ -161,7 +161,7 @@ static int serverworks_create_gatt_table(struct agp_bridge_data *bridge)
161 return retval; 161 return retval;
162 } 162 }
163 /* Create a fake scratch directory */ 163 /* Create a fake scratch directory */
164 for(i = 0; i < 1024; i++) { 164 for (i = 0; i < 1024; i++) {
165 writel(agp_bridge->scratch_page, serverworks_private.scratch_dir.remapped+i); 165 writel(agp_bridge->scratch_page, serverworks_private.scratch_dir.remapped+i);
166 writel(virt_to_gart(serverworks_private.scratch_dir.real) | 1, page_dir.remapped+i); 166 writel(virt_to_gart(serverworks_private.scratch_dir.real) | 1, page_dir.remapped+i);
167 } 167 }
@@ -185,9 +185,8 @@ static int serverworks_create_gatt_table(struct agp_bridge_data *bridge)
185 pci_read_config_dword(agp_bridge->dev,serverworks_private.gart_addr_ofs,&temp); 185 pci_read_config_dword(agp_bridge->dev,serverworks_private.gart_addr_ofs,&temp);
186 agp_bridge->gart_bus_addr = (temp & PCI_BASE_ADDRESS_MEM_MASK); 186 agp_bridge->gart_bus_addr = (temp & PCI_BASE_ADDRESS_MEM_MASK);
187 187
188 /* Calculate the agp offset */ 188 /* Calculate the agp offset */
189 189 for (i = 0; i < value->num_entries / 1024; i++)
190 for(i = 0; i < value->num_entries / 1024; i++)
191 writel(virt_to_gart(serverworks_private.gatt_pages[i]->real)|1, page_dir.remapped+i); 190 writel(virt_to_gart(serverworks_private.gatt_pages[i]->real)|1, page_dir.remapped+i);
192 191
193 return 0; 192 return 0;
@@ -196,7 +195,7 @@ static int serverworks_create_gatt_table(struct agp_bridge_data *bridge)
196static int serverworks_free_gatt_table(struct agp_bridge_data *bridge) 195static int serverworks_free_gatt_table(struct agp_bridge_data *bridge)
197{ 196{
198 struct serverworks_page_map page_dir; 197 struct serverworks_page_map page_dir;
199 198
200 page_dir.real = (unsigned long *)agp_bridge->gatt_table_real; 199 page_dir.real = (unsigned long *)agp_bridge->gatt_table_real;
201 page_dir.remapped = (unsigned long __iomem *)agp_bridge->gatt_table; 200 page_dir.remapped = (unsigned long __iomem *)agp_bridge->gatt_table;
202 201
diff --git a/drivers/char/agp/uninorth-agp.c b/drivers/char/agp/uninorth-agp.c
index 50947e38501..9846defbddb 100644
--- a/drivers/char/agp/uninorth-agp.c
+++ b/drivers/char/agp/uninorth-agp.c
@@ -95,12 +95,12 @@ static void uninorth_cleanup(void)
95static int uninorth_configure(void) 95static int uninorth_configure(void)
96{ 96{
97 struct aper_size_info_32 *current_size; 97 struct aper_size_info_32 *current_size;
98 98
99 current_size = A_SIZE_32(agp_bridge->current_size); 99 current_size = A_SIZE_32(agp_bridge->current_size);
100 100
101 printk(KERN_INFO PFX "configuring for size idx: %d\n", 101 printk(KERN_INFO PFX "configuring for size idx: %d\n",
102 current_size->size_value); 102 current_size->size_value);
103 103
104 /* aperture size and gatt addr */ 104 /* aperture size and gatt addr */
105 pci_write_config_dword(agp_bridge->dev, 105 pci_write_config_dword(agp_bridge->dev,
106 UNI_N_CFG_GART_BASE, 106 UNI_N_CFG_GART_BASE,
@@ -127,7 +127,7 @@ static int uninorth_configure(void)
127 UNI_N_CFG_GART_DUMMY_PAGE, 127 UNI_N_CFG_GART_DUMMY_PAGE,
128 agp_bridge->scratch_page_real >> 12); 128 agp_bridge->scratch_page_real >> 12);
129 } 129 }
130 130
131 return 0; 131 return 0;
132} 132}
133 133
@@ -162,7 +162,7 @@ static int uninorth_insert_memory(struct agp_memory *mem, off_t pg_start,
162 } 162 }
163 (void)in_le32((volatile u32*)&agp_bridge->gatt_table[pg_start]); 163 (void)in_le32((volatile u32*)&agp_bridge->gatt_table[pg_start]);
164 mb(); 164 mb();
165 flush_dcache_range((unsigned long)&agp_bridge->gatt_table[pg_start], 165 flush_dcache_range((unsigned long)&agp_bridge->gatt_table[pg_start],
166 (unsigned long)&agp_bridge->gatt_table[pg_start + mem->page_count]); 166 (unsigned long)&agp_bridge->gatt_table[pg_start + mem->page_count]);
167 167
168 uninorth_tlbflush(mem); 168 uninorth_tlbflush(mem);
@@ -235,7 +235,7 @@ static void uninorth_agp_enable(struct agp_bridge_data *bridge, u32 mode)
235 235
236 command = agp_collect_device_status(bridge, mode, status); 236 command = agp_collect_device_status(bridge, mode, status);
237 command |= PCI_AGP_COMMAND_AGP; 237 command |= PCI_AGP_COMMAND_AGP;
238 238
239 if (uninorth_rev == 0x21) { 239 if (uninorth_rev == 0x21) {
240 /* 240 /*
241 * Darwin disable AGP 4x on this revision, thus we 241 * Darwin disable AGP 4x on this revision, thus we
@@ -456,7 +456,7 @@ static struct aper_size_info_32 uninorth_sizes[7] =
456 {256, 65536, 6, 64}, 456 {256, 65536, 6, 64},
457 {128, 32768, 5, 32}, 457 {128, 32768, 5, 32},
458 {64, 16384, 4, 16}, 458 {64, 16384, 4, 16},
459#endif 459#endif
460 {32, 8192, 3, 8}, 460 {32, 8192, 3, 8},
461 {16, 4096, 2, 4}, 461 {16, 4096, 2, 4},
462 {8, 2048, 1, 2}, 462 {8, 2048, 1, 2},