aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/video/nvidia/nvidia.c75
-rw-r--r--include/linux/pci_ids.h5
2 files changed, 59 insertions, 21 deletions
diff --git a/drivers/video/nvidia/nvidia.c b/drivers/video/nvidia/nvidia.c
index dcf2e7a7d215..099d64af37be 100644
--- a/drivers/video/nvidia/nvidia.c
+++ b/drivers/video/nvidia/nvidia.c
@@ -284,6 +284,16 @@ static struct pci_device_id nvidiafb_pci_tbl[] = {
284 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, 284 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
285 {PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_GEFORCE_6200, 285 {PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_GEFORCE_6200,
286 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, 286 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
287 {PCI_VENDOR_ID_NVIDIA, PCIE_DEVICE_ID_NVIDIA_GEFORCE_6800_ALT1,
288 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
289 {PCI_VENDOR_ID_NVIDIA, PCIE_DEVICE_ID_NVIDIA_GEFORCE_6600_ALT1,
290 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
291 {PCI_VENDOR_ID_NVIDIA, PCIE_DEVICE_ID_NVIDIA_GEFORCE_6600_ALT2,
292 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
293 {PCI_VENDOR_ID_NVIDIA, PCIE_DEVICE_ID_NVIDIA_GEFORCE_6200_ALT1,
294 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
295 {PCI_VENDOR_ID_NVIDIA, PCIE_DEVICE_ID_NVIDIA_GEFORCE_6800_GT,
296 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
287 {PCI_VENDOR_ID_NVIDIA, 0x0252, 297 {PCI_VENDOR_ID_NVIDIA, 0x0252,
288 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, 298 PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
289 {PCI_VENDOR_ID_NVIDIA, 0x0313, 299 {PCI_VENDOR_ID_NVIDIA, 0x0313,
@@ -1448,11 +1458,34 @@ static int __devinit nvidia_set_fbinfo(struct fb_info *info)
1448 return nvidiafb_check_var(&info->var, info); 1458 return nvidiafb_check_var(&info->var, info);
1449} 1459}
1450 1460
1451static u32 __devinit nvidia_get_arch(struct pci_dev *pd) 1461static u32 __devinit nvidia_get_chipset(struct fb_info *info)
1452{ 1462{
1463 struct nvidia_par *par = info->par;
1464 u32 id = (par->pci_dev->vendor << 16) | par->pci_dev->device;
1465
1466 printk("nvidiafb: PCI id - %x\n", id);
1467 if ((id & 0xfff0) == 0x00f0) {
1468 /* pci-e */
1469 printk("nvidiafb: PCI-E card\n");
1470 id = NV_RD32(par->REGS, 0x1800);
1471
1472 if ((id & 0x0000ffff) == 0x000010DE)
1473 id = 0x10DE0000 | (id >> 16);
1474 else if ((id & 0xffff0000) == 0xDE100000) /* wrong endian */
1475 id = 0x10DE0000 | ((id << 8) & 0x0000ff00) |
1476 ((id >> 8) & 0x000000ff);
1477 }
1478
1479 printk("nvidiafb: Actual id - %x\n", id);
1480 return id;
1481}
1482
1483static u32 __devinit nvidia_get_arch(struct fb_info *info)
1484{
1485 struct nvidia_par *par = info->par;
1453 u32 arch = 0; 1486 u32 arch = 0;
1454 1487
1455 switch (pd->device & 0x0ff0) { 1488 switch (par->Chipset & 0x0ff0) {
1456 case 0x0100: /* GeForce 256 */ 1489 case 0x0100: /* GeForce 256 */
1457 case 0x0110: /* GeForce2 MX */ 1490 case 0x0110: /* GeForce2 MX */
1458 case 0x0150: /* GeForce2 */ 1491 case 0x0150: /* GeForce2 */
@@ -1535,18 +1568,6 @@ static int __devinit nvidiafb_probe(struct pci_dev *pd,
1535 goto err_out_request; 1568 goto err_out_request;
1536 } 1569 }
1537 1570
1538 par->Architecture = nvidia_get_arch(pd);
1539
1540 par->Chipset = (pd->vendor << 16) | pd->device;
1541 printk(KERN_INFO PFX "nVidia device/chipset %X\n", par->Chipset);
1542
1543 if (par->Architecture == 0) {
1544 printk(KERN_ERR PFX "unknown NV_ARCH\n");
1545 goto err_out_free_base0;
1546 }
1547
1548 sprintf(nvidiafb_fix.id, "NV%x", (pd->device & 0x0ff0) >> 4);
1549
1550 par->FlatPanel = flatpanel; 1571 par->FlatPanel = flatpanel;
1551 if (flatpanel == 1) 1572 if (flatpanel == 1)
1552 printk(KERN_INFO PFX "flatpanel support enabled\n"); 1573 printk(KERN_INFO PFX "flatpanel support enabled\n");
@@ -1572,6 +1593,17 @@ static int __devinit nvidiafb_probe(struct pci_dev *pd,
1572 goto err_out_free_base0; 1593 goto err_out_free_base0;
1573 } 1594 }
1574 1595
1596 par->Chipset = nvidia_get_chipset(info);
1597 printk(KERN_INFO PFX "nVidia device/chipset %X\n", par->Chipset);
1598 par->Architecture = nvidia_get_arch(info);
1599
1600 if (par->Architecture == 0) {
1601 printk(KERN_ERR PFX "unknown NV_ARCH\n");
1602 goto err_out_arch;
1603 }
1604
1605 sprintf(nvidiafb_fix.id, "NV%x", (pd->device & 0x0ff0) >> 4);
1606
1575 NVCommonSetup(info); 1607 NVCommonSetup(info);
1576 1608
1577 par->FbAddress = nvidiafb_fix.smem_start; 1609 par->FbAddress = nvidiafb_fix.smem_start;
@@ -1647,21 +1679,22 @@ static int __devinit nvidiafb_probe(struct pci_dev *pd,
1647 NVTRACE_LEAVE(); 1679 NVTRACE_LEAVE();
1648 return 0; 1680 return 0;
1649 1681
1650 err_out_iounmap_fb: 1682err_out_iounmap_fb:
1651 iounmap(info->screen_base); 1683 iounmap(info->screen_base);
1652 err_out_free_base1: 1684err_out_free_base1:
1653 fb_destroy_modedb(info->monspecs.modedb); 1685 fb_destroy_modedb(info->monspecs.modedb);
1654 nvidia_delete_i2c_busses(par); 1686 nvidia_delete_i2c_busses(par);
1687err_out_arch:
1655 iounmap(par->REGS); 1688 iounmap(par->REGS);
1656 err_out_free_base0: 1689err_out_free_base0:
1657 pci_release_regions(pd); 1690 pci_release_regions(pd);
1658 err_out_request: 1691err_out_request:
1659 pci_disable_device(pd); 1692 pci_disable_device(pd);
1660 err_out_enable: 1693err_out_enable:
1661 kfree(info->pixmap.addr); 1694 kfree(info->pixmap.addr);
1662 err_out_kfree: 1695err_out_kfree:
1663 framebuffer_release(info); 1696 framebuffer_release(info);
1664 err_out: 1697err_out:
1665 return -ENODEV; 1698 return -ENODEV;
1666} 1699}
1667 1700
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index 100eba0f4771..f55c98a68aa9 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -1050,6 +1050,11 @@
1050#define PCI_DEVICE_ID_NVIDIA_NVENET_6 0x00e6 1050#define PCI_DEVICE_ID_NVIDIA_NVENET_6 0x00e6
1051#define PCI_DEVICE_ID_NVIDIA_CK8S_AUDIO 0x00ea 1051#define PCI_DEVICE_ID_NVIDIA_CK8S_AUDIO 0x00ea
1052#define PCI_DEVICE_ID_NVIDIA_NFORCE3S_SATA2 0x00ee 1052#define PCI_DEVICE_ID_NVIDIA_NFORCE3S_SATA2 0x00ee
1053#define PCIE_DEVICE_ID_NVIDIA_GEFORCE_6800_ALT1 0x00f0
1054#define PCIE_DEVICE_ID_NVIDIA_GEFORCE_6600_ALT1 0x00f1
1055#define PCIE_DEVICE_ID_NVIDIA_GEFORCE_6600_ALT2 0x00f2
1056#define PCIE_DEVICE_ID_NVIDIA_GEFORCE_6200_ALT1 0x00f3
1057#define PCIE_DEVICE_ID_NVIDIA_GEFORCE_6800_GT 0x00f9
1053#define PCI_DEVICE_ID_NVIDIA_GEFORCE_SDR 0x0100 1058#define PCI_DEVICE_ID_NVIDIA_GEFORCE_SDR 0x0100
1054#define PCI_DEVICE_ID_NVIDIA_GEFORCE_DDR 0x0101 1059#define PCI_DEVICE_ID_NVIDIA_GEFORCE_DDR 0x0101
1055#define PCI_DEVICE_ID_NVIDIA_QUADRO 0x0103 1060#define PCI_DEVICE_ID_NVIDIA_QUADRO 0x0103