5 #include <linux/module.h>
7 #include <linux/slab.h>
9 #include <linux/kernel.h>
20 static int intel_fetch_size(
void)
29 for (i = 0; i <
agp_bridge->driver->num_aperture_sizes; i++) {
33 return values[
i].
size;
40 static int __intel_8xx_fetch_size(
u8 temp)
47 for (i = 0; i <
agp_bridge->driver->num_aperture_sizes; i++) {
50 agp_bridge->current_size = (
void *) (values + i);
52 return values[
i].
size;
58 static int intel_8xx_fetch_size(
void)
63 return __intel_8xx_fetch_size(temp);
66 static int intel_815_fetch_size(
void)
75 return __intel_8xx_fetch_size(temp);
95 static void intel_cleanup(
void)
107 static void intel_8xx_cleanup(
void)
119 static int intel_configure(
void)
143 (temp2 & ~(1 << 10)) | (1 << 9));
149 static int intel_815_configure(
void)
159 dev_emerg(&
agp_bridge->dev->dev,
"gatt bus addr too high");
195 static void intel_820_cleanup(
void)
209 static int intel_820_configure(
void)
240 static int intel_840_configure(
void)
269 static int intel_845_configure(
void)
304 static int intel_850_configure(
void)
333 static int intel_860_configure(
void)
362 static int intel_830mp_configure(
void)
391 static int intel_7505_configure(
void)
420 static const struct gatt_mask intel_generic_masks[] =
422 {.mask = 0x00000017, .type = 0}
463 .aperture_sizes = intel_generic_sizes,
465 .num_aperture_sizes = 7,
466 .needs_scratch_page =
true,
467 .configure = intel_configure,
468 .fetch_size = intel_fetch_size,
469 .cleanup = intel_cleanup,
470 .tlb_flush = intel_tlbflush,
472 .masks = intel_generic_masks,
490 .aperture_sizes = intel_815_sizes,
492 .num_aperture_sizes = 2,
493 .needs_scratch_page =
true,
494 .configure = intel_815_configure,
495 .fetch_size = intel_815_fetch_size,
496 .cleanup = intel_8xx_cleanup,
497 .tlb_flush = intel_8xx_tlbflush,
499 .masks = intel_generic_masks,
517 .aperture_sizes = intel_8xx_sizes,
519 .num_aperture_sizes = 7,
520 .needs_scratch_page =
true,
521 .configure = intel_820_configure,
522 .fetch_size = intel_8xx_fetch_size,
523 .cleanup = intel_820_cleanup,
524 .tlb_flush = intel_820_tlbflush,
526 .masks = intel_generic_masks,
544 .aperture_sizes = intel_830mp_sizes,
546 .num_aperture_sizes = 4,
547 .needs_scratch_page =
true,
548 .configure = intel_830mp_configure,
549 .fetch_size = intel_8xx_fetch_size,
550 .cleanup = intel_8xx_cleanup,
551 .tlb_flush = intel_8xx_tlbflush,
553 .masks = intel_generic_masks,
571 .aperture_sizes = intel_8xx_sizes,
573 .num_aperture_sizes = 7,
574 .needs_scratch_page =
true,
575 .configure = intel_840_configure,
576 .fetch_size = intel_8xx_fetch_size,
577 .cleanup = intel_8xx_cleanup,
578 .tlb_flush = intel_8xx_tlbflush,
580 .masks = intel_generic_masks,
598 .aperture_sizes = intel_8xx_sizes,
600 .num_aperture_sizes = 7,
601 .needs_scratch_page =
true,
602 .configure = intel_845_configure,
603 .fetch_size = intel_8xx_fetch_size,
604 .cleanup = intel_8xx_cleanup,
605 .tlb_flush = intel_8xx_tlbflush,
607 .masks = intel_generic_masks,
625 .aperture_sizes = intel_8xx_sizes,
627 .num_aperture_sizes = 7,
628 .needs_scratch_page =
true,
629 .configure = intel_850_configure,
630 .fetch_size = intel_8xx_fetch_size,
631 .cleanup = intel_8xx_cleanup,
632 .tlb_flush = intel_8xx_tlbflush,
634 .masks = intel_generic_masks,
652 .aperture_sizes = intel_8xx_sizes,
654 .num_aperture_sizes = 7,
655 .needs_scratch_page =
true,
656 .configure = intel_860_configure,
657 .fetch_size = intel_8xx_fetch_size,
658 .cleanup = intel_8xx_cleanup,
659 .tlb_flush = intel_8xx_tlbflush,
661 .masks = intel_generic_masks,
679 .aperture_sizes = intel_8xx_sizes,
681 .num_aperture_sizes = 7,
682 .needs_scratch_page =
true,
683 .configure = intel_7505_configure,
684 .fetch_size = intel_8xx_fetch_size,
685 .cleanup = intel_8xx_cleanup,
686 .tlb_flush = intel_8xx_tlbflush,
688 .masks = intel_generic_masks,
708 static const struct intel_agp_driver_description {
712 } intel_agp_chipsets[] = {
754 for (i = 0; intel_agp_chipsets[
i].name !=
NULL; i++) {
758 if (pdev->
device == intel_agp_chipsets[i].chip_id) {
759 bridge->
driver = intel_agp_chipsets[
i].driver;
766 dev_warn(&pdev->
dev,
"unsupported Intel chipset [%04x/%04x]\n",
775 dev_info(&pdev->
dev,
"Intel %s Chipset\n", intel_agp_chipsets[i].name);
790 dev_err(&pdev->
dev,
"can't assign resource 0\n");
802 dev_err(&pdev->
dev,
"can't enable PCI device\n");
809 pci_read_config_dword(pdev,
815 pci_set_drvdata(pdev, bridge);
834 static int agp_intel_resume(
struct pci_dev *pdev)
838 bridge->
driver->configure();
847 .class = (PCI_CLASS_BRIDGE_HOST << 8), \
849 .vendor = PCI_VENDOR_ID_INTEL, \
851 .subvendor = PCI_ANY_ID, \
852 .subdevice = PCI_ANY_ID, \
911 static struct pci_driver agp_intel_pci_driver = {
912 .name =
"agpgart-intel",
913 .id_table = agp_intel_pci_table,
914 .probe = agp_intel_probe,
917 .resume = agp_intel_resume,
921 static int __init agp_intel_init(
void)
925 return pci_register_driver(&agp_intel_pci_driver);
928 static void __exit agp_intel_cleanup(
void)