···9898 tristate "Serverworks LE/HE chipset support"9999 depends on AGP && X86_32100100 help101101- Say Y here to support the Serverworks AGP card. See 101101+ Say Y here to support the Serverworks AGP card. See102102 <http://www.serverworks.com/> for product descriptions and images.103103104104config AGP_VIA
+5-6
drivers/char/agp/agp.h
···1919 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS2020 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,2121 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL2222- * JEFF HARTMANN, OR ANY OTHER CONTRIBUTORS BE LIABLE FOR ANY CLAIM, 2323- * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 2424- * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE 2222+ * JEFF HARTMANN, OR ANY OTHER CONTRIBUTORS BE LIABLE FOR ANY CLAIM,2323+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR2424+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE2525 * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.2626 *2727 */···5353struct gatt_mask {5454 unsigned long mask;5555 u32 type;5656- /* totally device specific, for integrated chipsets that 5656+ /* totally device specific, for integrated chipsets that5757 * might have different types of memory masks. For other5858 * devices this will probably be ignored */5959};···104104 void (*agp_enable)(struct agp_bridge_data *, u32);105105 void (*cleanup)(void);106106 void (*tlb_flush)(struct agp_memory *);107107- unsigned long (*mask_memory)(struct agp_bridge_data *,108108- unsigned long, int);107107+ unsigned long (*mask_memory)(struct agp_bridge_data *, unsigned long, int);109108 void (*cache_flush)(void);110109 int (*create_gatt_table)(struct agp_bridge_data *);111110 int (*free_gatt_table)(struct agp_bridge_data *);
···11/*22 * Transmeta's Efficeon AGPGART driver.33- * 33+ *44 * Based upon a diff by Linus around November '02.55 *66 * Ported to the 2.6 kernel by Carlos Puchol <cpglinux@puchol.com>···991010/*1111 * NOTE-cpg-040217:1212- * 1212+ *1313 * - when compiled as a module, after loading the module,1414 * it will refuse to unload, indicating it is in use,1515 * when it is not.···4545 * 8: Present4646 * 7:6: reserved, write as zero4747 * 5:0: GATT directory index: which 1st-level entry4848- * 4848+ *4949 * The Efficeon AGP spec requires pages to be WB-cacheable5050 * but to be explicitly CLFLUSH'd after any changes.5151 */···125125 struct aper_size_info_lvl2 *current_size;126126127127 printk(KERN_DEBUG PFX "efficeon_configure()\n");128128-128128+129129 current_size = A_SIZE_LVL2(agp_bridge->current_size);130130131131 /* aperture size */···190190 const int present = EFFICEON_PRESENT;191191 const int clflush_chunk = ((cpuid_ebx(1) >> 8) & 0xff) << 3;192192 int num_entries, l1_pages;193193-193193+194194 num_entries = A_SIZE_LVL2(agp_bridge->current_size)->num_entries;195195196196 printk(KERN_DEBUG PFX "efficeon_create_gatt_table(%d)\n", num_entries);···257257258258 if (!page)259259 continue;260260-260260+261261 page += (index & 0x3ff);262262 *page = insert;263263264264 /* clflush is slow, so don't clflush until we have to */265265- if ( last_page && 265265+ if ( last_page &&266266 ((unsigned long)page^(unsigned long)last_page) & clflush_mask )267267 asm volatile("clflush %0" : : "m" (*last_page));268268···373373 */374374 r = &pdev->resource[0];375375 if (!r->start && r->end) {376376- if(pci_assign_resource(pdev, 0)) {376376+ if (pci_assign_resource(pdev, 0)) {377377 printk(KERN_ERR PFX "could not assign resource 0\n");378378 return -ENODEV;379379 }
+1-1
drivers/char/agp/frontend.c
···781781 if (agp_fe.current_controller != NULL)782782 return -EBUSY;783783784784- if(!agp_bridge)784784+ if (!agp_bridge)785785 return -ENODEV;786786787787 if (atomic_read(&agp_bridge->agp_in_use))
+1-1
drivers/char/agp/generic.c
···299299/**300300 * agp_copy_info - copy bridge state information301301 *302302- * @info: agp_kern_info pointer. The caller should insure that this pointer is valid. 302302+ * @info: agp_kern_info pointer. The caller should insure that this pointer is valid.303303 *304304 * This function copies information about the agp bridge device and the state of305305 * the agp backend into an agp_kern_info pointer.
+3-3
drivers/char/agp/hp-agp.c
···8585 /*8686 * IOC already configured by sba_iommu module; just use8787 * its setup. We assume:8888- * - IOVA space is 1Gb in size8989- * - first 512Mb is IOMMU, second 512Mb is GART8888+ * - IOVA space is 1Gb in size8989+ * - first 512Mb is IOMMU, second 512Mb is GART9090 */9191 hp->io_tlb_ps = readq(hp->ioc_regs+HP_ZX1_TCNFG);9292 switch (hp->io_tlb_ps) {···115115116116 if (hp->gatt[0] != HP_ZX1_SBA_IOMMU_COOKIE) {117117 /* Normal case when no AGP device in system */118118- hp->gatt = NULL;118118+ hp->gatt = NULL;119119 hp->gatt_entries = 0;120120 printk(KERN_ERR PFX "No reserved IO PDIR entry found; "121121 "GART disabled\n");
+8-8
drivers/char/agp/i460-agp.c
···400400 num_entries = A_SIZE_8(temp)->num_entries;401401402402 /* Figure out what pg_start means in terms of our large GART pages */403403- start = &i460.lp_desc[pg_start / I460_KPAGES_PER_IOPAGE];404404- end = &i460.lp_desc[(pg_start + mem->page_count - 1) / I460_KPAGES_PER_IOPAGE];405405- start_offset = pg_start % I460_KPAGES_PER_IOPAGE;406406- end_offset = (pg_start + mem->page_count - 1) % I460_KPAGES_PER_IOPAGE;403403+ start = &i460.lp_desc[pg_start / I460_KPAGES_PER_IOPAGE];404404+ end = &i460.lp_desc[(pg_start + mem->page_count - 1) / I460_KPAGES_PER_IOPAGE];405405+ start_offset = pg_start % I460_KPAGES_PER_IOPAGE;406406+ end_offset = (pg_start + mem->page_count - 1) % I460_KPAGES_PER_IOPAGE;407407408408 if (end > i460.lp_desc + num_entries) {409409 printk(KERN_ERR PFX "Looks like we're out of AGP memory\n");···458458 num_entries = A_SIZE_8(temp)->num_entries;459459460460 /* Figure out what pg_start means in terms of our large GART pages */461461- start = &i460.lp_desc[pg_start / I460_KPAGES_PER_IOPAGE];462462- end = &i460.lp_desc[(pg_start + mem->page_count - 1) / I460_KPAGES_PER_IOPAGE];463463- start_offset = pg_start % I460_KPAGES_PER_IOPAGE;464464- end_offset = (pg_start + mem->page_count - 1) % I460_KPAGES_PER_IOPAGE;461461+ start = &i460.lp_desc[pg_start / I460_KPAGES_PER_IOPAGE];462462+ end = &i460.lp_desc[(pg_start + mem->page_count - 1) / I460_KPAGES_PER_IOPAGE];463463+ start_offset = pg_start % I460_KPAGES_PER_IOPAGE;464464+ end_offset = (pg_start + mem->page_count - 1) % I460_KPAGES_PER_IOPAGE;465465466466 for (i = 0, lp = start; lp <= end; ++lp) {467467 for (idx = ((lp == start) ? start_offset : 0);
+19-26
drivers/char/agp/intel-agp.c
···201201 temp = agp_bridge->current_size;202202 num_entries = A_SIZE_FIX(temp)->num_entries;203203204204- if ((pg_start + mem->page_count) > num_entries) {204204+ if ((pg_start + mem->page_count) > num_entries)205205 return -EINVAL;206206- }206206+207207 for (j = pg_start; j < (pg_start + mem->page_count); j++) {208208 if (!PGE_EMPTY(agp_bridge, readl(agp_bridge->gatt_table+j)))209209 return -EBUSY;···221221 agp_bridge->driver->tlb_flush(mem);222222 return 0;223223 }224224- if((type == AGP_PHYS_MEMORY) && (mem->type == AGP_PHYS_MEMORY))224224+ if ((type == AGP_PHYS_MEMORY) && (mem->type == AGP_PHYS_MEMORY))225225 goto insert;226226 return -EINVAL;227227 }···328328static void intel_i810_free_by_type(struct agp_memory *curr)329329{330330 agp_free_key(curr->key);331331- if(curr->type == AGP_PHYS_MEMORY) {331331+ if (curr->type == AGP_PHYS_MEMORY) {332332 if (curr->page_count == 4)333333 i8xx_destroy_pages(gart_to_virt(curr->memory[0]));334334 else {···16031603 name = "i820";16041604 break;16051605 case PCI_DEVICE_ID_INTEL_82830_HB:16061606- if (find_i830(PCI_DEVICE_ID_INTEL_82830_CGC)) {16061606+ if (find_i830(PCI_DEVICE_ID_INTEL_82830_CGC))16071607 bridge->driver = &intel_830_driver;16081608- } else {16081608+ else16091609 bridge->driver = &intel_830mp_driver;16101610- }16111610 name = "830M";16121611 break;16131612 case PCI_DEVICE_ID_INTEL_82840_HB:···16181619 name = "i845";16191620 break;16201621 case PCI_DEVICE_ID_INTEL_82845G_HB:16211621- if (find_i830(PCI_DEVICE_ID_INTEL_82845G_IG)) {16221622+ if (find_i830(PCI_DEVICE_ID_INTEL_82845G_IG))16221623 bridge->driver = &intel_830_driver;16231623- } else {16241624+ else16241625 bridge->driver = &intel_845_driver;16251625- }16261626 name = "845G";16271627 break;16281628 case PCI_DEVICE_ID_INTEL_82850_HB:···16461648 name = "i860";16471649 break;16481650 case PCI_DEVICE_ID_INTEL_82865_HB:16491649- if (find_i830(PCI_DEVICE_ID_INTEL_82865_IG)) {16511651+ if (find_i830(PCI_DEVICE_ID_INTEL_82865_IG))16501652 bridge->driver = &intel_830_driver;16511651- } else {16531653+ else16521654 bridge->driver = &intel_845_driver;16531653- }16541655 name = "865";16551656 break;16561657 case PCI_DEVICE_ID_INTEL_82875_HB:···16571660 name = "i875";16581661 break;16591662 case PCI_DEVICE_ID_INTEL_82915G_HB:16601660- if (find_i830(PCI_DEVICE_ID_INTEL_82915G_IG)) {16631663+ if (find_i830(PCI_DEVICE_ID_INTEL_82915G_IG))16611664 bridge->driver = &intel_915_driver;16621662- } else {16651665+ else16631666 bridge->driver = &intel_845_driver;16641664- }16651667 name = "915G";16661668 break;16671669 case PCI_DEVICE_ID_INTEL_82915GM_HB:16681668- if (find_i830(PCI_DEVICE_ID_INTEL_82915GM_IG)) {16701670+ if (find_i830(PCI_DEVICE_ID_INTEL_82915GM_IG))16691671 bridge->driver = &intel_915_driver;16701670- } else {16721672+ else16711673 bridge->driver = &intel_845_driver;16721672- }16731674 name = "915GM";16741675 break;16751676 case PCI_DEVICE_ID_INTEL_82945G_HB:16761676- if (find_i830(PCI_DEVICE_ID_INTEL_82945G_IG)) {16771677+ if (find_i830(PCI_DEVICE_ID_INTEL_82945G_IG))16771678 bridge->driver = &intel_915_driver;16781678- } else {16791679+ else16791680 bridge->driver = &intel_845_driver;16801680- }16811681 name = "945G";16821682 break;16831683 case PCI_DEVICE_ID_INTEL_82945GM_HB:16841684- if (find_i830(PCI_DEVICE_ID_INTEL_82945GM_IG)) {16841684+ if (find_i830(PCI_DEVICE_ID_INTEL_82945GM_IG))16851685 bridge->driver = &intel_915_driver;16861686- } else {16861686+ else16871687 bridge->driver = &intel_845_driver;16881688- }16891688 name = "945GM";16901689 break;16911690 case PCI_DEVICE_ID_INTEL_7505_0:···17171724 */17181725 r = &pdev->resource[0];17191726 if (!r->start && r->end) {17201720- if(pci_assign_resource(pdev, 0)) {17271727+ if (pci_assign_resource(pdev, 0)) {17211728 printk(KERN_ERR PFX "could not assign resource 0\n");17221729 agp_put_bridge(bridge);17231730 return -ENODEV;
+10-10
drivers/char/agp/isoch.c
···26262727 list_for_each(pos, head) {2828 cur = list_entry(pos, struct agp_3_5_dev, list);2929- if(cur->maxbw > n->maxbw)2929+ if (cur->maxbw > n->maxbw)3030 break;3131 }3232 list_add_tail(new, pos);···5454 }5555}56565757-/* 5858- * Initialize all isochronous transfer parameters for an AGP 3.0 5959- * node (i.e. a host bridge in combination with the adapters 5757+/*5858+ * Initialize all isochronous transfer parameters for an AGP 3.05959+ * node (i.e. a host bridge in combination with the adapters6060 * lying behind it...)6161 */6262···200200 * this to the hungriest device (as per the spec) */201201 rem = target.n - tot_n;202202203203- /* 203203+ /*204204 * Calculate the minimum isochronous RQ depth needed by each master.205205 * Along the way, distribute the extra ISOCH_N capability calculated206206 * above.···214214 * many writes on the AGP bus).215215 */216216 master[cdev].rq = master[cdev].n;217217- if(master[cdev].y > 0x1)217217+ if (master[cdev].y > 0x1)218218 master[cdev].rq *= (1 << (master[cdev].y - 1));219219220220 tot_rq += master[cdev].rq;···334334335335 arqsz = (tstatus >> 13) & 0x7;336336337337- /* 337337+ /*338338 * Allocate a head for our AGP 3.5 device list339339- * (multiple AGP v3 devices are allowed behind a single bridge). 339339+ * (multiple AGP v3 devices are allowed behind a single bridge).340340 */341341 if ((dev_list = kmalloc(sizeof(*dev_list), GFP_KERNEL)) == NULL) {342342 ret = -ENOMEM;···366366367367 case 0x0300: /* Display controller */368368 case 0x0400: /* Multimedia controller */369369- if((cur = kmalloc(sizeof(*cur), GFP_KERNEL)) == NULL) {369369+ if ((cur = kmalloc(sizeof(*cur), GFP_KERNEL)) == NULL) {370370 ret = -ENOMEM;371371 goto free_and_exit;372372 }···391391 list_for_each(pos, head) {392392 cur = list_entry(pos, struct agp_3_5_dev, list);393393 dev = cur->dev;394394-394394+395395 pci_read_config_word(dev, PCI_STATUS, &mpstat);396396 if ((mpstat & PCI_STATUS_CAP_LIST) == 0)397397 continue;
+10-10
drivers/char/agp/nvidia-agp.c
···7272 /* Find the iorr that is already used for the base */7373 /* If not found, determine the uppermost available iorr */7474 free_iorr_addr = AMD_K7_NUM_IORR;7575- for(iorr_addr = 0; iorr_addr < AMD_K7_NUM_IORR; iorr_addr++) {7575+ for (iorr_addr = 0; iorr_addr < AMD_K7_NUM_IORR; iorr_addr++) {7676 rdmsr(IORR_BASE0 + 2 * iorr_addr, base_lo, base_hi);7777 rdmsr(IORR_MASK0 + 2 * iorr_addr, mask_lo, mask_hi);7878···8282 if ((mask_lo & 0x00000800) == 0)8383 free_iorr_addr = iorr_addr;8484 }8585-8585+8686 if (iorr_addr >= AMD_K7_NUM_IORR) {8787 iorr_addr = free_iorr_addr;8888 if (iorr_addr >= AMD_K7_NUM_IORR)···139139 }140140141141 /* attbase */142142- for(i = 0; i < 8; i++) {142142+ for (i = 0; i < 8; i++) {143143 pci_write_config_dword(nvidia_private.dev_2, NVIDIA_2_ATTBASE(i),144144 (agp_bridge->gatt_bus_addr + (i % num_dirs) * 64 * 1024) | 1);145145 }···197197static int nvidia_insert_memory(struct agp_memory *mem, off_t pg_start, int type)198198{199199 int i, j;200200-200200+201201 if ((type != 0) || (mem->type != 0))202202 return -EINVAL;203203-203203+204204 if ((pg_start + mem->page_count) >205205 (nvidia_private.num_active_entries - agp_memory_reserved/PAGE_SIZE))206206 return -EINVAL;207207-208208- for(j = pg_start; j < (pg_start + mem->page_count); j++) {207207+208208+ for (j = pg_start; j < (pg_start + mem->page_count); j++) {209209 if (!PGE_EMPTY(agp_bridge, readl(agp_bridge->gatt_table+nvidia_private.pg_offset+j)))210210 return -EBUSY;211211 }···264264 }265265266266 /* flush TLB entries */267267- for(i = 0; i < 32 + 1; i++)267267+ for (i = 0; i < 32 + 1; i++)268268 temp = readl(nvidia_private.aperture+(i * PAGE_SIZE / sizeof(u32)));269269- for(i = 0; i < 32 + 1; i++)269269+ for (i = 0; i < 32 + 1; i++)270270 temp = readl(nvidia_private.aperture+(i * PAGE_SIZE / sizeof(u32)));271271}272272···323323 pci_find_slot((unsigned int)pdev->bus->number, PCI_DEVFN(0, 2));324324 nvidia_private.dev_3 =325325 pci_find_slot((unsigned int)pdev->bus->number, PCI_DEVFN(30, 0));326326-326326+327327 if (!nvidia_private.dev_1 || !nvidia_private.dev_2 || !nvidia_private.dev_3) {328328 printk(KERN_INFO PFX "Detected an NVIDIA nForce/nForce2 "329329 "chipset, but could not find the secondary devices.\n");
+1-1
drivers/char/agp/sgi-agp.c
···329329330330static void __devexit agp_sgi_cleanup(void)331331{332332- if(sgi_tioca_agp_bridges)332332+ if (sgi_tioca_agp_bridges)333333 kfree(sgi_tioca_agp_bridges);334334 sgi_tioca_agp_bridges=NULL;335335}
+4-4
drivers/char/agp/sis-agp.c
···121121122122static struct agp_bridge_driver sis_driver = {123123 .owner = THIS_MODULE,124124- .aperture_sizes = sis_generic_sizes,124124+ .aperture_sizes = sis_generic_sizes,125125 .size_type = U8_APER_SIZE,126126 .num_aperture_sizes = 7,127127 .configure = sis_configure,···243243{244244 int i;245245246246- for(i=0; sis_broken_chipsets[i]!=0; ++i)247247- if(bridge->dev->device==sis_broken_chipsets[i])246246+ for (i=0; sis_broken_chipsets[i]!=0; ++i)247247+ if (bridge->dev->device==sis_broken_chipsets[i])248248 break;249249250250- if(sis_broken_chipsets[i] || agp_sis_force_delay)250250+ if (sis_broken_chipsets[i] || agp_sis_force_delay)251251 sis_driver.agp_enable=sis_delayed_enable;252252253253 // sis chipsets that indicate less than agp3.5
+7-8
drivers/char/agp/sworks-agp.c
···6464 }6565 global_cache_flush();66666767- for(i = 0; i < PAGE_SIZE / sizeof(unsigned long); i++)6767+ for (i = 0; i < PAGE_SIZE / sizeof(unsigned long); i++)6868 writel(agp_bridge->scratch_page, page_map->remapped+i);69697070 return 0;···8484 struct serverworks_page_map *entry;85858686 tables = serverworks_private.gatt_pages;8787- for(i = 0; i < serverworks_private.num_tables; i++) {8787+ for (i = 0; i < serverworks_private.num_tables; i++) {8888 entry = tables[i];8989 if (entry != NULL) {9090 if (entry->real != NULL) {···103103 int retval = 0;104104 int i;105105106106- tables = kzalloc((nr_tables + 1) * sizeof(struct serverworks_page_map *), 106106+ tables = kzalloc((nr_tables + 1) * sizeof(struct serverworks_page_map *),107107 GFP_KERNEL);108108 if (tables == NULL)109109 return -ENOMEM;···161161 return retval;162162 }163163 /* Create a fake scratch directory */164164- for(i = 0; i < 1024; i++) {164164+ for (i = 0; i < 1024; i++) {165165 writel(agp_bridge->scratch_page, serverworks_private.scratch_dir.remapped+i);166166 writel(virt_to_gart(serverworks_private.scratch_dir.real) | 1, page_dir.remapped+i);167167 }···185185 pci_read_config_dword(agp_bridge->dev,serverworks_private.gart_addr_ofs,&temp);186186 agp_bridge->gart_bus_addr = (temp & PCI_BASE_ADDRESS_MEM_MASK);187187188188- /* Calculate the agp offset */ 189189-190190- for(i = 0; i < value->num_entries / 1024; i++)188188+ /* Calculate the agp offset */189189+ for (i = 0; i < value->num_entries / 1024; i++)191190 writel(virt_to_gart(serverworks_private.gatt_pages[i]->real)|1, page_dir.remapped+i);192191193192 return 0;···195196static int serverworks_free_gatt_table(struct agp_bridge_data *bridge)196197{197198 struct serverworks_page_map page_dir;198198-199199+199200 page_dir.real = (unsigned long *)agp_bridge->gatt_table_real;200201 page_dir.remapped = (unsigned long __iomem *)agp_bridge->gatt_table;201202