5 #include <linux/types.h>
6 #include <linux/module.h>
14 #define VIA_GARTCTRL 0x80
15 #define VIA_APSIZE 0x84
16 #define VIA_ATTBASE 0x88
18 #define VIA_AGP3_GARTCTRL 0x90
19 #define VIA_AGP3_APSIZE 0x94
20 #define VIA_AGP3_ATTBASE 0x98
21 #define VIA_AGPSEL 0xfd
23 static int via_fetch_size(
void)
31 for (i = 0; i <
agp_bridge->driver->num_aperture_sizes; i++) {
34 agp_bridge->current_size = (
void *) (values + i);
36 return values[
i].
size;
44 static int via_configure(
void)
67 static void via_cleanup(
void)
106 static int via_fetch_size_agp3(
void)
116 for (i = 0; i <
agp_bridge->driver->num_aperture_sizes; i++) {
119 agp_bridge->current_size = (
void *) (values + i);
121 return values[
i].
size;
128 static int via_configure_agp3(
void)
154 static void via_cleanup_agp3(
void)
177 .num_aperture_sizes = 10,
178 .needs_scratch_page =
true,
179 .configure = via_configure_agp3,
180 .fetch_size = via_fetch_size_agp3,
181 .cleanup = via_cleanup_agp3,
182 .tlb_flush = via_tlbflush_agp3,
202 .aperture_sizes = via_generic_sizes,
204 .num_aperture_sizes = 9,
205 .needs_scratch_page =
true,
206 .configure = via_configure,
207 .fetch_size = via_fetch_size,
208 .cleanup = via_cleanup,
209 .tlb_flush = via_tlbflush,
231 .chipset_name =
"Apollo VP3",
236 .chipset_name =
"Apollo MVP3",
241 .chipset_name =
"Apollo MVP4",
247 .chipset_name =
"Apollo ProMedia/PLE133Ta",
253 .chipset_name =
"Apollo Pro 133",
258 .chipset_name =
"KX133",
264 .chipset_name =
"Pro 266",
269 .chipset_name =
"Apollo Pro266",
275 .chipset_name =
"KLE133",
281 .chipset_name =
"Twister-K/KT133x/KM133",
287 .chipset_name =
"P4X266",
293 .chipset_name =
"KT266/KY266x/KT333",
299 .chipset_name =
"Pro266T",
305 .chipset_name =
"PM266/KM266",
311 .chipset_name =
"CLE266",
316 .chipset_name =
"KT400/KT400A/KT600",
323 .chipset_name =
"ProSavage PM133/PL133/PN133"
329 .chipset_name =
"P4M266x/P4N266",
335 .chipset_name =
"PT800",
341 .chipset_name =
"P4X600"
347 .chipset_name =
"KM400/KM400A",
353 .chipset_name =
"PT880",
359 .chipset_name =
"PT880 Ultra",
365 .chipset_name =
"PT890",
371 .chipset_name =
"PM800/PN800/PM880/PN880",
376 .chipset_name =
"KT880",
381 .chipset_name =
"VT83xx/VT87xx/KTxxx/Px8xx",
386 .chipset_name =
"P4M800",
391 .chipset_name =
"VT3314",
396 .chipset_name =
"CX700",
409 .chipset_name =
"VT3336",
415 .chipset_name =
"P4M890",
420 .chipset_name =
"P4M900",
436 if ((reg & (1<<1))==0)
437 bridge->
driver = &via_agp3_driver;
453 j = ent - agp_via_pci_table;
462 bridge->
driver = &via_driver;
471 check_via_agp3(bridge);
478 check_via_agp3(bridge);
481 pci_read_config_dword(pdev,
484 pci_set_drvdata(pdev, bridge);
506 static int agp_via_resume(
struct pci_dev *pdev)
513 if (bridge->
driver == &via_agp3_driver)
514 return via_configure_agp3();
515 else if (bridge->
driver == &via_driver)
516 return via_configure();
527 .class = (PCI_CLASS_BRIDGE_HOST << 8), \
529 .vendor = PCI_VENDOR_ID_VIA, \
531 .subvendor = PCI_ANY_ID, \
532 .subdevice = PCI_ANY_ID, \
572 static struct pci_driver agp_via_pci_driver = {
573 .name =
"agpgart-via",
574 .id_table = agp_via_pci_table,
575 .probe = agp_via_probe,
576 .remove = agp_via_remove,
578 .suspend = agp_via_suspend,
579 .resume = agp_via_resume,
584 static int __init agp_via_init(
void)
588 return pci_register_driver(&agp_via_pci_driver);
591 static void __exit agp_via_cleanup(
void)