11da177e4SLinus Torvalds /* 21da177e4SLinus Torvalds * SiS AGPGART routines. 31da177e4SLinus Torvalds */ 41da177e4SLinus Torvalds 51da177e4SLinus Torvalds #include <linux/module.h> 61da177e4SLinus Torvalds #include <linux/pci.h> 71da177e4SLinus Torvalds #include <linux/init.h> 81da177e4SLinus Torvalds #include <linux/agp_backend.h> 91da177e4SLinus Torvalds #include <linux/delay.h> 101da177e4SLinus Torvalds #include "agp.h" 111da177e4SLinus Torvalds 121da177e4SLinus Torvalds #define SIS_ATTBASE 0x90 131da177e4SLinus Torvalds #define SIS_APSIZE 0x94 141da177e4SLinus Torvalds #define SIS_TLBCNTRL 0x97 151da177e4SLinus Torvalds #define SIS_TLBFLUSH 0x98 161da177e4SLinus Torvalds 172e374748SChaoyu Chen #define PCI_DEVICE_ID_SI_662 0x0662 182e374748SChaoyu Chen #define PCI_DEVICE_ID_SI_671 0x0671 192e374748SChaoyu Chen 200bbed20eSBill Pemberton static bool agp_sis_force_delay = 0; 210bbed20eSBill Pemberton static int agp_sis_agp_spec = -1; 221da177e4SLinus Torvalds 231da177e4SLinus Torvalds static int sis_fetch_size(void) 241da177e4SLinus Torvalds { 251da177e4SLinus Torvalds u8 temp_size; 261da177e4SLinus Torvalds int i; 271da177e4SLinus Torvalds struct aper_size_info_8 *values; 281da177e4SLinus Torvalds 291da177e4SLinus Torvalds pci_read_config_byte(agp_bridge->dev, SIS_APSIZE, &temp_size); 301da177e4SLinus Torvalds values = A_SIZE_8(agp_bridge->driver->aperture_sizes); 311da177e4SLinus Torvalds for (i = 0; i < agp_bridge->driver->num_aperture_sizes; i++) { 321da177e4SLinus Torvalds if ((temp_size == values[i].size_value) || 33b7d0640fSStuart Bennett ((temp_size & ~(0x07)) == 34b7d0640fSStuart Bennett (values[i].size_value & ~(0x07)))) { 351da177e4SLinus Torvalds agp_bridge->previous_size = 361da177e4SLinus Torvalds agp_bridge->current_size = (void *) (values + i); 371da177e4SLinus Torvalds 381da177e4SLinus Torvalds agp_bridge->aperture_size_idx = i; 391da177e4SLinus Torvalds return values[i].size; 401da177e4SLinus Torvalds } 411da177e4SLinus Torvalds } 421da177e4SLinus Torvalds 431da177e4SLinus Torvalds return 0; 441da177e4SLinus Torvalds } 451da177e4SLinus Torvalds 461da177e4SLinus Torvalds static void sis_tlbflush(struct agp_memory *mem) 471da177e4SLinus Torvalds { 481da177e4SLinus Torvalds pci_write_config_byte(agp_bridge->dev, SIS_TLBFLUSH, 0x02); 491da177e4SLinus Torvalds } 501da177e4SLinus Torvalds 511da177e4SLinus Torvalds static int sis_configure(void) 521da177e4SLinus Torvalds { 531da177e4SLinus Torvalds u32 temp; 541da177e4SLinus Torvalds struct aper_size_info_8 *current_size; 551da177e4SLinus Torvalds 561da177e4SLinus Torvalds current_size = A_SIZE_8(agp_bridge->current_size); 571da177e4SLinus Torvalds pci_write_config_byte(agp_bridge->dev, SIS_TLBCNTRL, 0x05); 581da177e4SLinus Torvalds pci_read_config_dword(agp_bridge->dev, AGP_APBASE, &temp); 591da177e4SLinus Torvalds agp_bridge->gart_bus_addr = (temp & PCI_BASE_ADDRESS_MEM_MASK); 601da177e4SLinus Torvalds pci_write_config_dword(agp_bridge->dev, SIS_ATTBASE, 611da177e4SLinus Torvalds agp_bridge->gatt_bus_addr); 621da177e4SLinus Torvalds pci_write_config_byte(agp_bridge->dev, SIS_APSIZE, 631da177e4SLinus Torvalds current_size->size_value); 641da177e4SLinus Torvalds return 0; 651da177e4SLinus Torvalds } 661da177e4SLinus Torvalds 671da177e4SLinus Torvalds static void sis_cleanup(void) 681da177e4SLinus Torvalds { 691da177e4SLinus Torvalds struct aper_size_info_8 *previous_size; 701da177e4SLinus Torvalds 711da177e4SLinus Torvalds previous_size = A_SIZE_8(agp_bridge->previous_size); 721da177e4SLinus Torvalds pci_write_config_byte(agp_bridge->dev, SIS_APSIZE, 731da177e4SLinus Torvalds (previous_size->size_value & ~(0x03))); 741da177e4SLinus Torvalds } 751da177e4SLinus Torvalds 761da177e4SLinus Torvalds static void sis_delayed_enable(struct agp_bridge_data *bridge, u32 mode) 771da177e4SLinus Torvalds { 781da177e4SLinus Torvalds struct pci_dev *device = NULL; 791da177e4SLinus Torvalds u32 command; 801da177e4SLinus Torvalds int rate; 811da177e4SLinus Torvalds 82e3cf6951SBjorn Helgaas dev_info(&agp_bridge->dev->dev, "AGP %d.%d bridge\n", 83e3cf6951SBjorn Helgaas agp_bridge->major_version, agp_bridge->minor_version); 841da177e4SLinus Torvalds 851da177e4SLinus Torvalds pci_read_config_dword(agp_bridge->dev, agp_bridge->capndx + PCI_AGP_STATUS, &command); 861da177e4SLinus Torvalds command = agp_collect_device_status(bridge, mode, command); 871da177e4SLinus Torvalds command |= AGPSTAT_AGP_ENABLE; 881da177e4SLinus Torvalds rate = (command & 0x7) << 2; 891da177e4SLinus Torvalds 901da177e4SLinus Torvalds for_each_pci_dev(device) { 911da177e4SLinus Torvalds u8 agp = pci_find_capability(device, PCI_CAP_ID_AGP); 921da177e4SLinus Torvalds if (!agp) 931da177e4SLinus Torvalds continue; 941da177e4SLinus Torvalds 95e3cf6951SBjorn Helgaas dev_info(&agp_bridge->dev->dev, "putting AGP V3 device at %s into %dx mode\n", 961da177e4SLinus Torvalds pci_name(device), rate); 971da177e4SLinus Torvalds 981da177e4SLinus Torvalds pci_write_config_dword(device, agp + PCI_AGP_COMMAND, command); 991da177e4SLinus Torvalds 1001da177e4SLinus Torvalds /* 1011da177e4SLinus Torvalds * Weird: on some sis chipsets any rate change in the target 1021da177e4SLinus Torvalds * command register triggers a 5ms screwup during which the master 1031da177e4SLinus Torvalds * cannot be configured 1041da177e4SLinus Torvalds */ 1051da177e4SLinus Torvalds if (device->device == bridge->dev->device) { 106e3cf6951SBjorn Helgaas dev_info(&agp_bridge->dev->dev, "SiS delay workaround: giving bridge time to recover\n"); 1071da177e4SLinus Torvalds msleep(10); 1081da177e4SLinus Torvalds } 1091da177e4SLinus Torvalds } 1101da177e4SLinus Torvalds } 1111da177e4SLinus Torvalds 112e5524f35SDave Jones static const struct aper_size_info_8 sis_generic_sizes[7] = 1131da177e4SLinus Torvalds { 1141da177e4SLinus Torvalds {256, 65536, 6, 99}, 1151da177e4SLinus Torvalds {128, 32768, 5, 83}, 1161da177e4SLinus Torvalds {64, 16384, 4, 67}, 1171da177e4SLinus Torvalds {32, 8192, 3, 51}, 1181da177e4SLinus Torvalds {16, 4096, 2, 35}, 1191da177e4SLinus Torvalds {8, 2048, 1, 19}, 1201da177e4SLinus Torvalds {4, 1024, 0, 3} 1211da177e4SLinus Torvalds }; 1221da177e4SLinus Torvalds 123408b664aSAdrian Bunk static struct agp_bridge_driver sis_driver = { 1241da177e4SLinus Torvalds .owner = THIS_MODULE, 1251da177e4SLinus Torvalds .aperture_sizes = sis_generic_sizes, 1261da177e4SLinus Torvalds .size_type = U8_APER_SIZE, 1271da177e4SLinus Torvalds .num_aperture_sizes = 7, 12861cf0593SJerome Glisse .needs_scratch_page = true, 1291da177e4SLinus Torvalds .configure = sis_configure, 1301da177e4SLinus Torvalds .fetch_size = sis_fetch_size, 1311da177e4SLinus Torvalds .cleanup = sis_cleanup, 1321da177e4SLinus Torvalds .tlb_flush = sis_tlbflush, 1331da177e4SLinus Torvalds .mask_memory = agp_generic_mask_memory, 1341da177e4SLinus Torvalds .masks = NULL, 1351da177e4SLinus Torvalds .agp_enable = agp_generic_enable, 1361da177e4SLinus Torvalds .cache_flush = global_cache_flush, 1371da177e4SLinus Torvalds .create_gatt_table = agp_generic_create_gatt_table, 1381da177e4SLinus Torvalds .free_gatt_table = agp_generic_free_gatt_table, 1391da177e4SLinus Torvalds .insert_memory = agp_generic_insert_memory, 1401da177e4SLinus Torvalds .remove_memory = agp_generic_remove_memory, 1411da177e4SLinus Torvalds .alloc_by_type = agp_generic_alloc_by_type, 1421da177e4SLinus Torvalds .free_by_type = agp_generic_free_by_type, 1431da177e4SLinus Torvalds .agp_alloc_page = agp_generic_alloc_page, 1445f310b63SRene Herman .agp_alloc_pages = agp_generic_alloc_pages, 1451da177e4SLinus Torvalds .agp_destroy_page = agp_generic_destroy_page, 1465f310b63SRene Herman .agp_destroy_pages = agp_generic_destroy_pages, 147bf1e5989SThomas Hellstrom .agp_type_to_mask_type = agp_generic_type_to_mask_type, 1481da177e4SLinus Torvalds }; 1491da177e4SLinus Torvalds 1501da177e4SLinus Torvalds // chipsets that require the 'delay hack' 1510bbed20eSBill Pemberton static int sis_broken_chipsets[] = { 1521da177e4SLinus Torvalds PCI_DEVICE_ID_SI_648, 1531da177e4SLinus Torvalds PCI_DEVICE_ID_SI_746, 1541da177e4SLinus Torvalds 0 // terminator 1551da177e4SLinus Torvalds }; 1561da177e4SLinus Torvalds 157*bcd2982aSGreg Kroah-Hartman static void sis_get_driver(struct agp_bridge_data *bridge) 1581da177e4SLinus Torvalds { 1591da177e4SLinus Torvalds int i; 1601da177e4SLinus Torvalds 1611da177e4SLinus Torvalds for (i=0; sis_broken_chipsets[i]!=0; ++i) 1621da177e4SLinus Torvalds if (bridge->dev->device==sis_broken_chipsets[i]) 1631da177e4SLinus Torvalds break; 1641da177e4SLinus Torvalds 1651da177e4SLinus Torvalds if (sis_broken_chipsets[i] || agp_sis_force_delay) 1661da177e4SLinus Torvalds sis_driver.agp_enable=sis_delayed_enable; 1671da177e4SLinus Torvalds 1681da177e4SLinus Torvalds // sis chipsets that indicate less than agp3.5 1691da177e4SLinus Torvalds // are not actually fully agp3 compliant 1701da177e4SLinus Torvalds if ((agp_bridge->major_version == 3 && agp_bridge->minor_version >= 5 1711da177e4SLinus Torvalds && agp_sis_agp_spec!=0) || agp_sis_agp_spec==1) { 1721da177e4SLinus Torvalds sis_driver.aperture_sizes = agp3_generic_sizes; 1731da177e4SLinus Torvalds sis_driver.size_type = U16_APER_SIZE; 1741da177e4SLinus Torvalds sis_driver.num_aperture_sizes = AGP_GENERIC_SIZES_ENTRIES; 1751da177e4SLinus Torvalds sis_driver.configure = agp3_generic_configure; 1761da177e4SLinus Torvalds sis_driver.fetch_size = agp3_generic_fetch_size; 1771da177e4SLinus Torvalds sis_driver.cleanup = agp3_generic_cleanup; 1781da177e4SLinus Torvalds sis_driver.tlb_flush = agp3_generic_tlbflush; 1791da177e4SLinus Torvalds } 1801da177e4SLinus Torvalds } 1811da177e4SLinus Torvalds 1821da177e4SLinus Torvalds 183*bcd2982aSGreg Kroah-Hartman static int agp_sis_probe(struct pci_dev *pdev, const struct pci_device_id *ent) 1841da177e4SLinus Torvalds { 1851da177e4SLinus Torvalds struct agp_bridge_data *bridge; 1861da177e4SLinus Torvalds u8 cap_ptr; 1871da177e4SLinus Torvalds 1881da177e4SLinus Torvalds cap_ptr = pci_find_capability(pdev, PCI_CAP_ID_AGP); 1891da177e4SLinus Torvalds if (!cap_ptr) 1901da177e4SLinus Torvalds return -ENODEV; 1911da177e4SLinus Torvalds 1921da177e4SLinus Torvalds 193e3cf6951SBjorn Helgaas dev_info(&pdev->dev, "SiS chipset [%04x/%04x]\n", 194e3cf6951SBjorn Helgaas pdev->vendor, pdev->device); 1951da177e4SLinus Torvalds bridge = agp_alloc_bridge(); 1961da177e4SLinus Torvalds if (!bridge) 1971da177e4SLinus Torvalds return -ENOMEM; 1981da177e4SLinus Torvalds 1991da177e4SLinus Torvalds bridge->driver = &sis_driver; 2001da177e4SLinus Torvalds bridge->dev = pdev; 2011da177e4SLinus Torvalds bridge->capndx = cap_ptr; 2021da177e4SLinus Torvalds 2031da177e4SLinus Torvalds get_agp_version(bridge); 2041da177e4SLinus Torvalds 2051da177e4SLinus Torvalds /* Fill in the mode register */ 2061da177e4SLinus Torvalds pci_read_config_dword(pdev, bridge->capndx+PCI_AGP_STATUS, &bridge->mode); 2071da177e4SLinus Torvalds sis_get_driver(bridge); 2081da177e4SLinus Torvalds 2091da177e4SLinus Torvalds pci_set_drvdata(pdev, bridge); 2101da177e4SLinus Torvalds return agp_add_bridge(bridge); 2111da177e4SLinus Torvalds } 2121da177e4SLinus Torvalds 21339af33fcSBill Pemberton static void agp_sis_remove(struct pci_dev *pdev) 2141da177e4SLinus Torvalds { 2151da177e4SLinus Torvalds struct agp_bridge_data *bridge = pci_get_drvdata(pdev); 2161da177e4SLinus Torvalds 2171da177e4SLinus Torvalds agp_remove_bridge(bridge); 2181da177e4SLinus Torvalds agp_put_bridge(bridge); 2191da177e4SLinus Torvalds } 2201da177e4SLinus Torvalds 22116469a0eSStuart Bennett #ifdef CONFIG_PM 22216469a0eSStuart Bennett 22316469a0eSStuart Bennett static int agp_sis_suspend(struct pci_dev *pdev, pm_message_t state) 22416469a0eSStuart Bennett { 22516469a0eSStuart Bennett pci_save_state(pdev); 22616469a0eSStuart Bennett pci_set_power_state(pdev, pci_choose_state(pdev, state)); 22716469a0eSStuart Bennett 22816469a0eSStuart Bennett return 0; 22916469a0eSStuart Bennett } 23016469a0eSStuart Bennett 23116469a0eSStuart Bennett static int agp_sis_resume(struct pci_dev *pdev) 23216469a0eSStuart Bennett { 23316469a0eSStuart Bennett pci_set_power_state(pdev, PCI_D0); 23416469a0eSStuart Bennett pci_restore_state(pdev); 23516469a0eSStuart Bennett 23616469a0eSStuart Bennett return sis_driver.configure(); 23716469a0eSStuart Bennett } 23816469a0eSStuart Bennett 23916469a0eSStuart Bennett #endif /* CONFIG_PM */ 24016469a0eSStuart Bennett 2411da177e4SLinus Torvalds static struct pci_device_id agp_sis_pci_table[] = { 2421da177e4SLinus Torvalds { 2431da177e4SLinus Torvalds .class = (PCI_CLASS_BRIDGE_HOST << 8), 2441da177e4SLinus Torvalds .class_mask = ~0, 2451da177e4SLinus Torvalds .vendor = PCI_VENDOR_ID_SI, 24691397585SKrzysztof Helt .device = PCI_DEVICE_ID_SI_5591, 24782eab130SOliver Neukum .subvendor = PCI_ANY_ID, 24882eab130SOliver Neukum .subdevice = PCI_ANY_ID, 24982eab130SOliver Neukum }, 25082eab130SOliver Neukum { 25182eab130SOliver Neukum .class = (PCI_CLASS_BRIDGE_HOST << 8), 25282eab130SOliver Neukum .class_mask = ~0, 25382eab130SOliver Neukum .vendor = PCI_VENDOR_ID_SI, 25482eab130SOliver Neukum .device = PCI_DEVICE_ID_SI_530, 25582eab130SOliver Neukum .subvendor = PCI_ANY_ID, 25682eab130SOliver Neukum .subdevice = PCI_ANY_ID, 25782eab130SOliver Neukum }, 25882eab130SOliver Neukum { 25982eab130SOliver Neukum .class = (PCI_CLASS_BRIDGE_HOST << 8), 26082eab130SOliver Neukum .class_mask = ~0, 26182eab130SOliver Neukum .vendor = PCI_VENDOR_ID_SI, 26282eab130SOliver Neukum .device = PCI_DEVICE_ID_SI_540, 26382eab130SOliver Neukum .subvendor = PCI_ANY_ID, 26482eab130SOliver Neukum .subdevice = PCI_ANY_ID, 26582eab130SOliver Neukum }, 26682eab130SOliver Neukum { 26782eab130SOliver Neukum .class = (PCI_CLASS_BRIDGE_HOST << 8), 26882eab130SOliver Neukum .class_mask = ~0, 26982eab130SOliver Neukum .vendor = PCI_VENDOR_ID_SI, 27082eab130SOliver Neukum .device = PCI_DEVICE_ID_SI_550, 27182eab130SOliver Neukum .subvendor = PCI_ANY_ID, 27282eab130SOliver Neukum .subdevice = PCI_ANY_ID, 27382eab130SOliver Neukum }, 27482eab130SOliver Neukum { 27582eab130SOliver Neukum .class = (PCI_CLASS_BRIDGE_HOST << 8), 27682eab130SOliver Neukum .class_mask = ~0, 27782eab130SOliver Neukum .vendor = PCI_VENDOR_ID_SI, 27882eab130SOliver Neukum .device = PCI_DEVICE_ID_SI_620, 27982eab130SOliver Neukum .subvendor = PCI_ANY_ID, 28082eab130SOliver Neukum .subdevice = PCI_ANY_ID, 28182eab130SOliver Neukum }, 28282eab130SOliver Neukum { 28382eab130SOliver Neukum .class = (PCI_CLASS_BRIDGE_HOST << 8), 28482eab130SOliver Neukum .class_mask = ~0, 28582eab130SOliver Neukum .vendor = PCI_VENDOR_ID_SI, 28682eab130SOliver Neukum .device = PCI_DEVICE_ID_SI_630, 28782eab130SOliver Neukum .subvendor = PCI_ANY_ID, 28882eab130SOliver Neukum .subdevice = PCI_ANY_ID, 28982eab130SOliver Neukum }, 29082eab130SOliver Neukum { 29182eab130SOliver Neukum .class = (PCI_CLASS_BRIDGE_HOST << 8), 29282eab130SOliver Neukum .class_mask = ~0, 29382eab130SOliver Neukum .vendor = PCI_VENDOR_ID_SI, 29482eab130SOliver Neukum .device = PCI_DEVICE_ID_SI_635, 29582eab130SOliver Neukum .subvendor = PCI_ANY_ID, 29682eab130SOliver Neukum .subdevice = PCI_ANY_ID, 29782eab130SOliver Neukum }, 29882eab130SOliver Neukum { 29982eab130SOliver Neukum .class = (PCI_CLASS_BRIDGE_HOST << 8), 30082eab130SOliver Neukum .class_mask = ~0, 30182eab130SOliver Neukum .vendor = PCI_VENDOR_ID_SI, 30282eab130SOliver Neukum .device = PCI_DEVICE_ID_SI_645, 30382eab130SOliver Neukum .subvendor = PCI_ANY_ID, 30482eab130SOliver Neukum .subdevice = PCI_ANY_ID, 30582eab130SOliver Neukum }, 30682eab130SOliver Neukum { 30782eab130SOliver Neukum .class = (PCI_CLASS_BRIDGE_HOST << 8), 30882eab130SOliver Neukum .class_mask = ~0, 30982eab130SOliver Neukum .vendor = PCI_VENDOR_ID_SI, 31082eab130SOliver Neukum .device = PCI_DEVICE_ID_SI_646, 31182eab130SOliver Neukum .subvendor = PCI_ANY_ID, 31282eab130SOliver Neukum .subdevice = PCI_ANY_ID, 31382eab130SOliver Neukum }, 31482eab130SOliver Neukum { 31582eab130SOliver Neukum .class = (PCI_CLASS_BRIDGE_HOST << 8), 31682eab130SOliver Neukum .class_mask = ~0, 31782eab130SOliver Neukum .vendor = PCI_VENDOR_ID_SI, 31882eab130SOliver Neukum .device = PCI_DEVICE_ID_SI_648, 31982eab130SOliver Neukum .subvendor = PCI_ANY_ID, 32082eab130SOliver Neukum .subdevice = PCI_ANY_ID, 32182eab130SOliver Neukum }, 32282eab130SOliver Neukum { 32382eab130SOliver Neukum .class = (PCI_CLASS_BRIDGE_HOST << 8), 32482eab130SOliver Neukum .class_mask = ~0, 32582eab130SOliver Neukum .vendor = PCI_VENDOR_ID_SI, 32682eab130SOliver Neukum .device = PCI_DEVICE_ID_SI_650, 32782eab130SOliver Neukum .subvendor = PCI_ANY_ID, 32882eab130SOliver Neukum .subdevice = PCI_ANY_ID, 32982eab130SOliver Neukum }, 33082eab130SOliver Neukum { 33182eab130SOliver Neukum .class = (PCI_CLASS_BRIDGE_HOST << 8), 33282eab130SOliver Neukum .class_mask = ~0, 33382eab130SOliver Neukum .vendor = PCI_VENDOR_ID_SI, 33482eab130SOliver Neukum .device = PCI_DEVICE_ID_SI_651, 33582eab130SOliver Neukum .subvendor = PCI_ANY_ID, 33682eab130SOliver Neukum .subdevice = PCI_ANY_ID, 33782eab130SOliver Neukum }, 33882eab130SOliver Neukum { 33982eab130SOliver Neukum .class = (PCI_CLASS_BRIDGE_HOST << 8), 34082eab130SOliver Neukum .class_mask = ~0, 34182eab130SOliver Neukum .vendor = PCI_VENDOR_ID_SI, 34282eab130SOliver Neukum .device = PCI_DEVICE_ID_SI_655, 34382eab130SOliver Neukum .subvendor = PCI_ANY_ID, 34482eab130SOliver Neukum .subdevice = PCI_ANY_ID, 34582eab130SOliver Neukum }, 34682eab130SOliver Neukum { 34782eab130SOliver Neukum .class = (PCI_CLASS_BRIDGE_HOST << 8), 34882eab130SOliver Neukum .class_mask = ~0, 34982eab130SOliver Neukum .vendor = PCI_VENDOR_ID_SI, 35082eab130SOliver Neukum .device = PCI_DEVICE_ID_SI_661, 35182eab130SOliver Neukum .subvendor = PCI_ANY_ID, 35282eab130SOliver Neukum .subdevice = PCI_ANY_ID, 35382eab130SOliver Neukum }, 35482eab130SOliver Neukum { 35582eab130SOliver Neukum .class = (PCI_CLASS_BRIDGE_HOST << 8), 35682eab130SOliver Neukum .class_mask = ~0, 35782eab130SOliver Neukum .vendor = PCI_VENDOR_ID_SI, 3582e374748SChaoyu Chen .device = PCI_DEVICE_ID_SI_662, 3592e374748SChaoyu Chen .subvendor = PCI_ANY_ID, 3602e374748SChaoyu Chen .subdevice = PCI_ANY_ID, 3612e374748SChaoyu Chen }, 3622e374748SChaoyu Chen { 3632e374748SChaoyu Chen .class = (PCI_CLASS_BRIDGE_HOST << 8), 3642e374748SChaoyu Chen .class_mask = ~0, 3652e374748SChaoyu Chen .vendor = PCI_VENDOR_ID_SI, 3662e374748SChaoyu Chen .device = PCI_DEVICE_ID_SI_671, 3672e374748SChaoyu Chen .subvendor = PCI_ANY_ID, 3682e374748SChaoyu Chen .subdevice = PCI_ANY_ID, 3692e374748SChaoyu Chen }, 3702e374748SChaoyu Chen { 3712e374748SChaoyu Chen .class = (PCI_CLASS_BRIDGE_HOST << 8), 3722e374748SChaoyu Chen .class_mask = ~0, 3732e374748SChaoyu Chen .vendor = PCI_VENDOR_ID_SI, 37482eab130SOliver Neukum .device = PCI_DEVICE_ID_SI_730, 37582eab130SOliver Neukum .subvendor = PCI_ANY_ID, 37682eab130SOliver Neukum .subdevice = PCI_ANY_ID, 37782eab130SOliver Neukum }, 37882eab130SOliver Neukum { 37982eab130SOliver Neukum .class = (PCI_CLASS_BRIDGE_HOST << 8), 38082eab130SOliver Neukum .class_mask = ~0, 38182eab130SOliver Neukum .vendor = PCI_VENDOR_ID_SI, 38282eab130SOliver Neukum .device = PCI_DEVICE_ID_SI_735, 38382eab130SOliver Neukum .subvendor = PCI_ANY_ID, 38482eab130SOliver Neukum .subdevice = PCI_ANY_ID, 38582eab130SOliver Neukum }, 38682eab130SOliver Neukum { 38782eab130SOliver Neukum .class = (PCI_CLASS_BRIDGE_HOST << 8), 38882eab130SOliver Neukum .class_mask = ~0, 38982eab130SOliver Neukum .vendor = PCI_VENDOR_ID_SI, 39082eab130SOliver Neukum .device = PCI_DEVICE_ID_SI_740, 39182eab130SOliver Neukum .subvendor = PCI_ANY_ID, 39282eab130SOliver Neukum .subdevice = PCI_ANY_ID, 39382eab130SOliver Neukum }, 39482eab130SOliver Neukum { 39582eab130SOliver Neukum .class = (PCI_CLASS_BRIDGE_HOST << 8), 39682eab130SOliver Neukum .class_mask = ~0, 39782eab130SOliver Neukum .vendor = PCI_VENDOR_ID_SI, 39882eab130SOliver Neukum .device = PCI_DEVICE_ID_SI_741, 39982eab130SOliver Neukum .subvendor = PCI_ANY_ID, 40082eab130SOliver Neukum .subdevice = PCI_ANY_ID, 40182eab130SOliver Neukum }, 40282eab130SOliver Neukum { 40382eab130SOliver Neukum .class = (PCI_CLASS_BRIDGE_HOST << 8), 40482eab130SOliver Neukum .class_mask = ~0, 40582eab130SOliver Neukum .vendor = PCI_VENDOR_ID_SI, 40682eab130SOliver Neukum .device = PCI_DEVICE_ID_SI_745, 40782eab130SOliver Neukum .subvendor = PCI_ANY_ID, 40882eab130SOliver Neukum .subdevice = PCI_ANY_ID, 40982eab130SOliver Neukum }, 41082eab130SOliver Neukum { 41182eab130SOliver Neukum .class = (PCI_CLASS_BRIDGE_HOST << 8), 41282eab130SOliver Neukum .class_mask = ~0, 41382eab130SOliver Neukum .vendor = PCI_VENDOR_ID_SI, 41482eab130SOliver Neukum .device = PCI_DEVICE_ID_SI_746, 41582eab130SOliver Neukum .subvendor = PCI_ANY_ID, 41682eab130SOliver Neukum .subdevice = PCI_ANY_ID, 41782eab130SOliver Neukum }, 4181da177e4SLinus Torvalds { } 4191da177e4SLinus Torvalds }; 4201da177e4SLinus Torvalds 4211da177e4SLinus Torvalds MODULE_DEVICE_TABLE(pci, agp_sis_pci_table); 4221da177e4SLinus Torvalds 4231da177e4SLinus Torvalds static struct pci_driver agp_sis_pci_driver = { 4241da177e4SLinus Torvalds .name = "agpgart-sis", 4251da177e4SLinus Torvalds .id_table = agp_sis_pci_table, 4261da177e4SLinus Torvalds .probe = agp_sis_probe, 4271da177e4SLinus Torvalds .remove = agp_sis_remove, 42816469a0eSStuart Bennett #ifdef CONFIG_PM 42916469a0eSStuart Bennett .suspend = agp_sis_suspend, 43016469a0eSStuart Bennett .resume = agp_sis_resume, 43116469a0eSStuart Bennett #endif 4321da177e4SLinus Torvalds }; 4331da177e4SLinus Torvalds 4341da177e4SLinus Torvalds static int __init agp_sis_init(void) 4351da177e4SLinus Torvalds { 4361da177e4SLinus Torvalds if (agp_off) 4371da177e4SLinus Torvalds return -EINVAL; 4381da177e4SLinus Torvalds return pci_register_driver(&agp_sis_pci_driver); 4391da177e4SLinus Torvalds } 4401da177e4SLinus Torvalds 4411da177e4SLinus Torvalds static void __exit agp_sis_cleanup(void) 4421da177e4SLinus Torvalds { 4431da177e4SLinus Torvalds pci_unregister_driver(&agp_sis_pci_driver); 4441da177e4SLinus Torvalds } 4451da177e4SLinus Torvalds 4461da177e4SLinus Torvalds module_init(agp_sis_init); 4471da177e4SLinus Torvalds module_exit(agp_sis_cleanup); 4481da177e4SLinus Torvalds 4491da177e4SLinus Torvalds module_param(agp_sis_force_delay, bool, 0); 4501da177e4SLinus Torvalds MODULE_PARM_DESC(agp_sis_force_delay,"forces sis delay hack"); 4511da177e4SLinus Torvalds module_param(agp_sis_agp_spec, int, 0); 4521da177e4SLinus Torvalds MODULE_PARM_DESC(agp_sis_agp_spec,"0=force sis init, 1=force generic agp3 init, default: autodetect"); 4531da177e4SLinus Torvalds MODULE_LICENSE("GPL and additional rights"); 454