aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/agp/intel-agp.c
diff options
context:
space:
mode:
authorWang Zhenyu <zhenyu.z.wang@intel.com>2007-06-05 23:16:25 -0400
committerDave Jones <davej@redhat.com>2007-06-06 17:10:03 -0400
commit874808c6dd429f7431b906a32c7f78a68e7636af (patch)
tree3174596f5a7e21c5a6b1c723898f27d20bfbb976 /drivers/char/agp/intel-agp.c
parentdf80b148869291621ddf51eb8716658d5bfba811 (diff)
[AGPGART] intel_agp: Add support for G33, Q33 and Q35 chipsets
This patch adds pci ids for G33, Q33 and Q35 chips, and update with new GTT size and stolen mem size detect method on these chips. Signed-off-by: Wang Zhenyu <zhenyu.z.wang@intel.com> Signed-off-by: Dave Jones <davej@redhat.com>
Diffstat (limited to 'drivers/char/agp/intel-agp.c')
-rw-r--r--drivers/char/agp/intel-agp.c79
1 files changed, 77 insertions, 2 deletions
diff --git a/drivers/char/agp/intel-agp.c b/drivers/char/agp/intel-agp.c
index 3c4a1c2a25b7..d383168b75fa 100644
--- a/drivers/char/agp/intel-agp.c
+++ b/drivers/char/agp/intel-agp.c
@@ -22,6 +22,12 @@
22#define PCI_DEVICE_ID_INTEL_82965GM_IG 0x2A02 22#define PCI_DEVICE_ID_INTEL_82965GM_IG 0x2A02
23#define PCI_DEVICE_ID_INTEL_82965GME_IG 0x2A12 23#define PCI_DEVICE_ID_INTEL_82965GME_IG 0x2A12
24#define PCI_DEVICE_ID_INTEL_82945GME_IG 0x27AE 24#define PCI_DEVICE_ID_INTEL_82945GME_IG 0x27AE
25#define PCI_DEVICE_ID_INTEL_G33_HB 0x29C0
26#define PCI_DEVICE_ID_INTEL_G33_IG 0x29C2
27#define PCI_DEVICE_ID_INTEL_Q35_HB 0x29B0
28#define PCI_DEVICE_ID_INTEL_Q35_IG 0x29B2
29#define PCI_DEVICE_ID_INTEL_Q33_HB 0x29D0
30#define PCI_DEVICE_ID_INTEL_Q33_IG 0x29D2
25 31
26#define IS_I965 (agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_82946GZ_HB || \ 32#define IS_I965 (agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_82946GZ_HB || \
27 agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_82965G_1_HB || \ 33 agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_82965G_1_HB || \
@@ -29,6 +35,9 @@
29 agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_82965G_HB || \ 35 agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_82965G_HB || \
30 agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_82965GM_HB) 36 agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_82965GM_HB)
31 37
38#define IS_G33 (agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_G33_HB || \
39 agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_Q35_HB || \
40 agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_Q33_HB)
32 41
33extern int agp_memory_reserved; 42extern int agp_memory_reserved;
34 43
@@ -55,6 +64,8 @@ extern int agp_memory_reserved;
55#define I915_PTEADDR 0x1C 64#define I915_PTEADDR 0x1C
56#define I915_GMCH_GMS_STOLEN_48M (0x6 << 4) 65#define I915_GMCH_GMS_STOLEN_48M (0x6 << 4)
57#define I915_GMCH_GMS_STOLEN_64M (0x7 << 4) 66#define I915_GMCH_GMS_STOLEN_64M (0x7 << 4)
67#define G33_GMCH_GMS_STOLEN_128M (0x8 << 4)
68#define G33_GMCH_GMS_STOLEN_256M (0x9 << 4)
58 69
59/* Intel 965G registers */ 70/* Intel 965G registers */
60#define I965_MSAC 0x62 71#define I965_MSAC 0x62
@@ -448,6 +459,22 @@ static void intel_i830_init_gtt_entries(void)
448 size = 512; 459 size = 512;
449 } 460 }
450 size += 4; /* add in BIOS popup space */ 461 size += 4; /* add in BIOS popup space */
462 } else if (IS_G33) {
463 /* G33's GTT size defined in gmch_ctrl */
464 switch (gmch_ctrl & G33_PGETBL_SIZE_MASK) {
465 case G33_PGETBL_SIZE_1M:
466 size = 1024;
467 break;
468 case G33_PGETBL_SIZE_2M:
469 size = 2048;
470 break;
471 default:
472 printk(KERN_INFO PFX "Unknown page table size 0x%x, "
473 "assuming 512KB\n",
474 (gmch_ctrl & G33_PGETBL_SIZE_MASK));
475 size = 512;
476 }
477 size += 4;
451 } else { 478 } else {
452 /* On previous hardware, the GTT size was just what was 479 /* On previous hardware, the GTT size was just what was
453 * required to map the aperture. 480 * required to map the aperture.
@@ -499,7 +526,8 @@ static void intel_i830_init_gtt_entries(void)
499 if (agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_82915G_HB || 526 if (agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_82915G_HB ||
500 agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_82915GM_HB || 527 agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_82915GM_HB ||
501 agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_82945G_HB || 528 agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_82945G_HB ||
502 agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_82945GM_HB || IS_I965 ) 529 agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_82945GM_HB ||
530 IS_I965 || IS_G33)
503 gtt_entries = MB(48) - KB(size); 531 gtt_entries = MB(48) - KB(size);
504 else 532 else
505 gtt_entries = 0; 533 gtt_entries = 0;
@@ -509,10 +537,24 @@ static void intel_i830_init_gtt_entries(void)
509 if (agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_82915G_HB || 537 if (agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_82915G_HB ||
510 agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_82915GM_HB || 538 agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_82915GM_HB ||
511 agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_82945G_HB || 539 agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_82945G_HB ||
512 agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_82945GM_HB || IS_I965) 540 agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_82945GM_HB ||
541 IS_I965 || IS_G33)
513 gtt_entries = MB(64) - KB(size); 542 gtt_entries = MB(64) - KB(size);
514 else 543 else
515 gtt_entries = 0; 544 gtt_entries = 0;
545 break;
546 case G33_GMCH_GMS_STOLEN_128M:
547 if (IS_G33)
548 gtt_entries = MB(128) - KB(size);
549 else
550 gtt_entries = 0;
551 break;
552 case G33_GMCH_GMS_STOLEN_256M:
553 if (IS_G33)
554 gtt_entries = MB(256) - KB(size);
555 else
556 gtt_entries = 0;
557 break;
516 default: 558 default:
517 gtt_entries = 0; 559 gtt_entries = 0;
518 break; 560 break;
@@ -1719,6 +1761,30 @@ static const struct agp_bridge_driver intel_7505_driver = {
1719 .agp_type_to_mask_type = agp_generic_type_to_mask_type, 1761 .agp_type_to_mask_type = agp_generic_type_to_mask_type,
1720}; 1762};
1721 1763
1764static const struct agp_bridge_driver intel_g33_driver = {
1765 .owner = THIS_MODULE,
1766 .aperture_sizes = intel_i830_sizes,
1767 .size_type = FIXED_APER_SIZE,
1768 .num_aperture_sizes = 4,
1769 .needs_scratch_page = TRUE,
1770 .configure = intel_i915_configure,
1771 .fetch_size = intel_i9xx_fetch_size,
1772 .cleanup = intel_i915_cleanup,
1773 .tlb_flush = intel_i810_tlbflush,
1774 .mask_memory = intel_i965_mask_memory,
1775 .masks = intel_i810_masks,
1776 .agp_enable = intel_i810_agp_enable,
1777 .cache_flush = global_cache_flush,
1778 .create_gatt_table = intel_i915_create_gatt_table,
1779 .free_gatt_table = intel_i830_free_gatt_table,
1780 .insert_memory = intel_i915_insert_entries,
1781 .remove_memory = intel_i915_remove_entries,
1782 .alloc_by_type = intel_i830_alloc_by_type,
1783 .free_by_type = intel_i810_free_by_type,
1784 .agp_alloc_page = agp_generic_alloc_page,
1785 .agp_destroy_page = agp_generic_destroy_page,
1786 .agp_type_to_mask_type = intel_i830_type_to_mask_type,
1787};
1722 1788
1723static int find_gmch(u16 device) 1789static int find_gmch(u16 device)
1724{ 1790{
@@ -1799,6 +1865,12 @@ static const struct intel_driver_description {
1799 &intel_845_driver, &intel_i965_driver }, 1865 &intel_845_driver, &intel_i965_driver },
1800 { PCI_DEVICE_ID_INTEL_7505_0, 0, "E7505", &intel_7505_driver, NULL }, 1866 { PCI_DEVICE_ID_INTEL_7505_0, 0, "E7505", &intel_7505_driver, NULL },
1801 { PCI_DEVICE_ID_INTEL_7205_0, 0, "E7205", &intel_7505_driver, NULL }, 1867 { PCI_DEVICE_ID_INTEL_7205_0, 0, "E7205", &intel_7505_driver, NULL },
1868 { PCI_DEVICE_ID_INTEL_G33_HB, PCI_DEVICE_ID_INTEL_G33_IG, "G33",
1869 &intel_845_driver, &intel_g33_driver },
1870 { PCI_DEVICE_ID_INTEL_Q35_HB, PCI_DEVICE_ID_INTEL_Q35_IG, "Q35",
1871 &intel_845_driver, &intel_g33_driver },
1872 { PCI_DEVICE_ID_INTEL_Q33_HB, PCI_DEVICE_ID_INTEL_Q33_IG, "Q33",
1873 &intel_845_driver, &intel_g33_driver },
1802 { 0, 0, NULL, NULL, NULL } 1874 { 0, 0, NULL, NULL, NULL }
1803}; 1875};
1804 1876
@@ -1976,6 +2048,9 @@ static struct pci_device_id agp_intel_pci_table[] = {
1976 ID(PCI_DEVICE_ID_INTEL_82965Q_HB), 2048 ID(PCI_DEVICE_ID_INTEL_82965Q_HB),
1977 ID(PCI_DEVICE_ID_INTEL_82965G_HB), 2049 ID(PCI_DEVICE_ID_INTEL_82965G_HB),
1978 ID(PCI_DEVICE_ID_INTEL_82965GM_HB), 2050 ID(PCI_DEVICE_ID_INTEL_82965GM_HB),
2051 ID(PCI_DEVICE_ID_INTEL_G33_HB),
2052 ID(PCI_DEVICE_ID_INTEL_Q35_HB),
2053 ID(PCI_DEVICE_ID_INTEL_Q33_HB),
1979 { } 2054 { }
1980}; 2055};
1981 2056