aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2011-07-11 01:57:54 -0400
committerBen Skeggs <bskeggs@redhat.com>2011-12-21 04:01:27 -0500
commit06784090ecb3f925616fc797164a74b03d5c0968 (patch)
treef77b4896046fef0a503f690103e943e0c54ffd12 /drivers
parentbe7f2615d7d14221a106e6c4ec3a64558e6190ed (diff)
drm/nvc0/gr: add initial support for nvd9, not quite there yet..
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_state.c5
-rw-r--r--drivers/gpu/drm/nouveau/nvc0_graph.c6
-rw-r--r--drivers/gpu/drm/nouveau/nvc0_graph.h1
-rw-r--r--drivers/gpu/drm/nouveau/nvc0_grctx.c127
-rw-r--r--drivers/gpu/drm/nouveau/nvc0_grgpc.fuc59
-rw-r--r--drivers/gpu/drm/nouveau/nvc0_grgpc.fuc.h80
-rw-r--r--drivers/gpu/drm/nouveau/nvc0_grhub.fuc45
-rw-r--r--drivers/gpu/drm/nouveau/nvc0_grhub.fuc.h96
8 files changed, 326 insertions, 93 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_state.c b/drivers/gpu/drm/nouveau/nouveau_state.c
index 3e3798f7f369..46831fea7861 100644
--- a/drivers/gpu/drm/nouveau/nouveau_state.c
+++ b/drivers/gpu/drm/nouveau/nouveau_state.c
@@ -655,6 +655,7 @@ nouveau_card_init(struct drm_device *dev)
655 nv50_graph_create(dev); 655 nv50_graph_create(dev);
656 break; 656 break;
657 case NV_C0: 657 case NV_C0:
658 case NV_D0:
658 nvc0_graph_create(dev); 659 nvc0_graph_create(dev);
659 break; 660 break;
660 default: 661 default:
@@ -1111,13 +1112,11 @@ int nouveau_load(struct drm_device *dev, unsigned long flags)
1111 dev_priv->noaccel = !!nouveau_noaccel; 1112 dev_priv->noaccel = !!nouveau_noaccel;
1112 if (nouveau_noaccel == -1) { 1113 if (nouveau_noaccel == -1) {
1113 switch (dev_priv->chipset) { 1114 switch (dev_priv->chipset) {
1114#if 0 1115 case 0xd9: /* known broken */
1115 case 0xXX: /* known broken */
1116 NV_INFO(dev, "acceleration disabled by default, pass " 1116 NV_INFO(dev, "acceleration disabled by default, pass "
1117 "noaccel=0 to force enable\n"); 1117 "noaccel=0 to force enable\n");
1118 dev_priv->noaccel = true; 1118 dev_priv->noaccel = true;
1119 break; 1119 break;
1120#endif
1121 default: 1120 default:
1122 dev_priv->noaccel = false; 1121 dev_priv->noaccel = false;
1123 break; 1122 break;
diff --git a/drivers/gpu/drm/nouveau/nvc0_graph.c b/drivers/gpu/drm/nouveau/nvc0_graph.c
index ecfafd70cf0e..8ee3963f9030 100644
--- a/drivers/gpu/drm/nouveau/nvc0_graph.c
+++ b/drivers/gpu/drm/nouveau/nvc0_graph.c
@@ -875,14 +875,16 @@ nvc0_graph_create(struct drm_device *dev)
875 case 0xcf: /* 4/0/0/0, 3 */ 875 case 0xcf: /* 4/0/0/0, 3 */
876 priv->magic_not_rop_nr = 0x03; 876 priv->magic_not_rop_nr = 0x03;
877 break; 877 break;
878 case 0xd9: /* 1/0/0/0, 1 */
879 priv->magic_not_rop_nr = 0x01;
880 break;
878 } 881 }
879 882
880 if (!priv->magic_not_rop_nr) { 883 if (!priv->magic_not_rop_nr) {
881 NV_ERROR(dev, "PGRAPH: unknown config: %d/%d/%d/%d, %d\n", 884 NV_ERROR(dev, "PGRAPH: unknown config: %d/%d/%d/%d, %d\n",
882 priv->tp_nr[0], priv->tp_nr[1], priv->tp_nr[2], 885 priv->tp_nr[0], priv->tp_nr[1], priv->tp_nr[2],
883 priv->tp_nr[3], priv->rop_nr); 886 priv->tp_nr[3], priv->rop_nr);
884 /* use 0xc3's values... */ 887 priv->magic_not_rop_nr = 0x00;
885 priv->magic_not_rop_nr = 0x03;
886 } 888 }
887 889
888 NVOBJ_CLASS(dev, 0x902d, GR); /* 2D */ 890 NVOBJ_CLASS(dev, 0x902d, GR); /* 2D */
diff --git a/drivers/gpu/drm/nouveau/nvc0_graph.h b/drivers/gpu/drm/nouveau/nvc0_graph.h
index 636fe9812f79..91d44ea662d9 100644
--- a/drivers/gpu/drm/nouveau/nvc0_graph.h
+++ b/drivers/gpu/drm/nouveau/nvc0_graph.h
@@ -87,6 +87,7 @@ nvc0_graph_class(struct drm_device *dev)
87 case 0xc1: 87 case 0xc1:
88 return 0x9197; 88 return 0x9197;
89 case 0xc8: 89 case 0xc8:
90 case 0xd9:
90 return 0x9297; 91 return 0x9297;
91 default: 92 default:
92 return 0; 93 return 0;
diff --git a/drivers/gpu/drm/nouveau/nvc0_grctx.c b/drivers/gpu/drm/nouveau/nvc0_grctx.c
index 96b0b93d94ca..de77842b31c0 100644
--- a/drivers/gpu/drm/nouveau/nvc0_grctx.c
+++ b/drivers/gpu/drm/nouveau/nvc0_grctx.c
@@ -1268,6 +1268,17 @@ nvc0_grctx_generate_9039(struct drm_device *dev)
1268static void 1268static void
1269nvc0_grctx_generate_90c0(struct drm_device *dev) 1269nvc0_grctx_generate_90c0(struct drm_device *dev)
1270{ 1270{
1271 struct drm_nouveau_private *dev_priv = dev->dev_private;
1272 int i;
1273
1274 for (i = 0; dev_priv->chipset == 0xd9 && i < 4; i++) {
1275 nv_mthd(dev, 0x90c0, 0x2700 + (i * 0x40), 0x00000000);
1276 nv_mthd(dev, 0x90c0, 0x2720 + (i * 0x40), 0x00000000);
1277 nv_mthd(dev, 0x90c0, 0x2704 + (i * 0x40), 0x00000000);
1278 nv_mthd(dev, 0x90c0, 0x2724 + (i * 0x40), 0x00000000);
1279 nv_mthd(dev, 0x90c0, 0x2708 + (i * 0x40), 0x00000000);
1280 nv_mthd(dev, 0x90c0, 0x2728 + (i * 0x40), 0x00000000);
1281 }
1271 nv_mthd(dev, 0x90c0, 0x270c, 0x00000000); 1282 nv_mthd(dev, 0x90c0, 0x270c, 0x00000000);
1272 nv_mthd(dev, 0x90c0, 0x272c, 0x00000000); 1283 nv_mthd(dev, 0x90c0, 0x272c, 0x00000000);
1273 nv_mthd(dev, 0x90c0, 0x274c, 0x00000000); 1284 nv_mthd(dev, 0x90c0, 0x274c, 0x00000000);
@@ -1276,6 +1287,12 @@ nvc0_grctx_generate_90c0(struct drm_device *dev)
1276 nv_mthd(dev, 0x90c0, 0x27ac, 0x00000000); 1287 nv_mthd(dev, 0x90c0, 0x27ac, 0x00000000);
1277 nv_mthd(dev, 0x90c0, 0x27cc, 0x00000000); 1288 nv_mthd(dev, 0x90c0, 0x27cc, 0x00000000);
1278 nv_mthd(dev, 0x90c0, 0x27ec, 0x00000000); 1289 nv_mthd(dev, 0x90c0, 0x27ec, 0x00000000);
1290 for (i = 0; dev_priv->chipset == 0xd9 && i < 4; i++) {
1291 nv_mthd(dev, 0x90c0, 0x2710 + (i * 0x40), 0x00014000);
1292 nv_mthd(dev, 0x90c0, 0x2730 + (i * 0x40), 0x00014000);
1293 nv_mthd(dev, 0x90c0, 0x2714 + (i * 0x40), 0x00000040);
1294 nv_mthd(dev, 0x90c0, 0x2734 + (i * 0x40), 0x00000040);
1295 }
1279 nv_mthd(dev, 0x90c0, 0x030c, 0x00000001); 1296 nv_mthd(dev, 0x90c0, 0x030c, 0x00000001);
1280 nv_mthd(dev, 0x90c0, 0x1944, 0x00000000); 1297 nv_mthd(dev, 0x90c0, 0x1944, 0x00000000);
1281 nv_mthd(dev, 0x90c0, 0x0758, 0x00000100); 1298 nv_mthd(dev, 0x90c0, 0x0758, 0x00000100);
@@ -1471,14 +1488,20 @@ nvc0_grctx_generate_shaders(struct drm_device *dev)
1471{ 1488{
1472 struct drm_nouveau_private *dev_priv = dev->dev_private; 1489 struct drm_nouveau_private *dev_priv = dev->dev_private;
1473 1490
1474 if (dev_priv->chipset != 0xc1) { 1491 if (dev_priv->chipset == 0xd9) {
1475 nv_wr32(dev, 0x405800, 0x078000bf);
1476 nv_wr32(dev, 0x405830, 0x02180000);
1477 } else {
1478 nv_wr32(dev, 0x405800, 0x0f8000bf); 1492 nv_wr32(dev, 0x405800, 0x0f8000bf);
1479 nv_wr32(dev, 0x405830, 0x02180218); 1493 nv_wr32(dev, 0x405830, 0x02180218);
1494 nv_wr32(dev, 0x405834, 0x08000000);
1495 } else
1496 if (dev_priv->chipset == 0xc1) {
1497 nv_wr32(dev, 0x405800, 0x0f8000bf);
1498 nv_wr32(dev, 0x405830, 0x02180218);
1499 nv_wr32(dev, 0x405834, 0x00000000);
1500 } else {
1501 nv_wr32(dev, 0x405800, 0x078000bf);
1502 nv_wr32(dev, 0x405830, 0x02180000);
1503 nv_wr32(dev, 0x405834, 0x00000000);
1480 } 1504 }
1481 nv_wr32(dev, 0x405834, 0x00000000);
1482 nv_wr32(dev, 0x405838, 0x00000000); 1505 nv_wr32(dev, 0x405838, 0x00000000);
1483 nv_wr32(dev, 0x405854, 0x00000000); 1506 nv_wr32(dev, 0x405854, 0x00000000);
1484 nv_wr32(dev, 0x405870, 0x00000001); 1507 nv_wr32(dev, 0x405870, 0x00000001);
@@ -1509,7 +1532,10 @@ nvc0_grctx_generate_unk64xx(struct drm_device *dev)
1509 nv_wr32(dev, 0x4064ac, 0x00003fff); 1532 nv_wr32(dev, 0x4064ac, 0x00003fff);
1510 nv_wr32(dev, 0x4064b4, 0x00000000); 1533 nv_wr32(dev, 0x4064b4, 0x00000000);
1511 nv_wr32(dev, 0x4064b8, 0x00000000); 1534 nv_wr32(dev, 0x4064b8, 0x00000000);
1512 if (dev_priv->chipset == 0xc1) { 1535 if (dev_priv->chipset == 0xd9)
1536 nv_wr32(dev, 0x4064bc, 0x00000000);
1537 if (dev_priv->chipset == 0xc1 ||
1538 dev_priv->chipset == 0xd9) {
1513 nv_wr32(dev, 0x4064c0, 0x80140078); 1539 nv_wr32(dev, 0x4064c0, 0x80140078);
1514 nv_wr32(dev, 0x4064c4, 0x0086ffff); 1540 nv_wr32(dev, 0x4064c4, 0x0086ffff);
1515 } 1541 }
@@ -1550,10 +1576,23 @@ nvc0_grctx_generate_rop(struct drm_device *dev)
1550 /* ROPC_BROADCAST */ 1576 /* ROPC_BROADCAST */
1551 nv_wr32(dev, 0x408800, 0x02802a3c); 1577 nv_wr32(dev, 0x408800, 0x02802a3c);
1552 nv_wr32(dev, 0x408804, 0x00000040); 1578 nv_wr32(dev, 0x408804, 0x00000040);
1553 nv_wr32(dev, 0x408808, chipset != 0xc1 ? 0x0003e00d : 0x1003e005); 1579 if (chipset == 0xd9) {
1554 nv_wr32(dev, 0x408900, 0x3080b801); 1580 nv_wr32(dev, 0x408808, 0x1043e005);
1555 nv_wr32(dev, 0x408904, chipset != 0xc1 ? 0x02000001 : 0x62000001); 1581 nv_wr32(dev, 0x408900, 0x3080b801);
1556 nv_wr32(dev, 0x408908, 0x00c80929); 1582 nv_wr32(dev, 0x408904, 0x1043e005);
1583 nv_wr32(dev, 0x408908, 0x00c8102f);
1584 } else
1585 if (chipset == 0xc1) {
1586 nv_wr32(dev, 0x408808, 0x1003e005);
1587 nv_wr32(dev, 0x408900, 0x3080b801);
1588 nv_wr32(dev, 0x408904, 0x62000001);
1589 nv_wr32(dev, 0x408908, 0x00c80929);
1590 } else {
1591 nv_wr32(dev, 0x408808, 0x0003e00d);
1592 nv_wr32(dev, 0x408900, 0x3080b801);
1593 nv_wr32(dev, 0x408904, 0x02000001);
1594 nv_wr32(dev, 0x408908, 0x00c80929);
1595 }
1557 nv_wr32(dev, 0x40890c, 0x00000000); 1596 nv_wr32(dev, 0x40890c, 0x00000000);
1558 nv_wr32(dev, 0x408980, 0x0000011d); 1597 nv_wr32(dev, 0x408980, 0x0000011d);
1559} 1598}
@@ -1572,7 +1611,7 @@ nvc0_grctx_generate_gpc(struct drm_device *dev)
1572 nv_wr32(dev, 0x418408, 0x00000000); 1611 nv_wr32(dev, 0x418408, 0x00000000);
1573 nv_wr32(dev, 0x41840c, 0x00001008); 1612 nv_wr32(dev, 0x41840c, 0x00001008);
1574 nv_wr32(dev, 0x418410, 0x0fff0fff); 1613 nv_wr32(dev, 0x418410, 0x0fff0fff);
1575 nv_wr32(dev, 0x418414, 0x00200fff); 1614 nv_wr32(dev, 0x418414, chipset != 0xd9 ? 0x00200fff : 0x02200fff);
1576 nv_wr32(dev, 0x418450, 0x00000000); 1615 nv_wr32(dev, 0x418450, 0x00000000);
1577 nv_wr32(dev, 0x418454, 0x00000000); 1616 nv_wr32(dev, 0x418454, 0x00000000);
1578 nv_wr32(dev, 0x418458, 0x00000000); 1617 nv_wr32(dev, 0x418458, 0x00000000);
@@ -1587,14 +1626,17 @@ nvc0_grctx_generate_gpc(struct drm_device *dev)
1587 nv_wr32(dev, 0x418700, 0x00000002); 1626 nv_wr32(dev, 0x418700, 0x00000002);
1588 nv_wr32(dev, 0x418704, 0x00000080); 1627 nv_wr32(dev, 0x418704, 0x00000080);
1589 nv_wr32(dev, 0x418708, 0x00000000); 1628 nv_wr32(dev, 0x418708, 0x00000000);
1590 nv_wr32(dev, 0x41870c, 0x07c80000); 1629 nv_wr32(dev, 0x41870c, chipset != 0xd9 ? 0x07c80000 : 0x00000000);
1591 nv_wr32(dev, 0x418710, 0x00000000); 1630 nv_wr32(dev, 0x418710, 0x00000000);
1592 nv_wr32(dev, 0x418800, 0x0006860a); 1631 nv_wr32(dev, 0x418800, chipset != 0xd9 ? 0x0006860a : 0x7006860a);
1593 nv_wr32(dev, 0x418808, 0x00000000); 1632 nv_wr32(dev, 0x418808, 0x00000000);
1594 nv_wr32(dev, 0x41880c, 0x00000000); 1633 nv_wr32(dev, 0x41880c, 0x00000000);
1595 nv_wr32(dev, 0x418810, 0x00000000); 1634 nv_wr32(dev, 0x418810, 0x00000000);
1596 nv_wr32(dev, 0x418828, 0x00008442); 1635 nv_wr32(dev, 0x418828, 0x00008442);
1597 nv_wr32(dev, 0x418830, chipset != 0xc1 ? 0x00000001 : 0x10000001); 1636 if (chipset == 0xc1 || chipset == 0xd9)
1637 nv_wr32(dev, 0x418830, 0x10000001);
1638 else
1639 nv_wr32(dev, 0x418830, 0x00000001);
1598 nv_wr32(dev, 0x4188d8, 0x00000008); 1640 nv_wr32(dev, 0x4188d8, 0x00000008);
1599 nv_wr32(dev, 0x4188e0, 0x01000000); 1641 nv_wr32(dev, 0x4188e0, 0x01000000);
1600 nv_wr32(dev, 0x4188e8, 0x00000000); 1642 nv_wr32(dev, 0x4188e8, 0x00000000);
@@ -1602,7 +1644,12 @@ nvc0_grctx_generate_gpc(struct drm_device *dev)
1602 nv_wr32(dev, 0x4188f0, 0x00000000); 1644 nv_wr32(dev, 0x4188f0, 0x00000000);
1603 nv_wr32(dev, 0x4188f4, 0x00000000); 1645 nv_wr32(dev, 0x4188f4, 0x00000000);
1604 nv_wr32(dev, 0x4188f8, 0x00000000); 1646 nv_wr32(dev, 0x4188f8, 0x00000000);
1605 nv_wr32(dev, 0x4188fc, chipset != 0xc1 ? 0x00100000 : 0x00100018); 1647 if (chipset == 0xd9)
1648 nv_wr32(dev, 0x4188fc, 0x20100008);
1649 else if (chipset == 0xc1)
1650 nv_wr32(dev, 0x4188fc, 0x00100018);
1651 else
1652 nv_wr32(dev, 0x4188fc, 0x00100000);
1606 nv_wr32(dev, 0x41891c, 0x00ff00ff); 1653 nv_wr32(dev, 0x41891c, 0x00ff00ff);
1607 nv_wr32(dev, 0x418924, 0x00000000); 1654 nv_wr32(dev, 0x418924, 0x00000000);
1608 nv_wr32(dev, 0x418928, 0x00ffff00); 1655 nv_wr32(dev, 0x418928, 0x00ffff00);
@@ -1616,7 +1663,7 @@ nvc0_grctx_generate_gpc(struct drm_device *dev)
1616 nv_wr32(dev, 0x418a14 + (i * 0x20), 0x00000000); 1663 nv_wr32(dev, 0x418a14 + (i * 0x20), 0x00000000);
1617 nv_wr32(dev, 0x418a18 + (i * 0x20), 0x00000000); 1664 nv_wr32(dev, 0x418a18 + (i * 0x20), 0x00000000);
1618 } 1665 }
1619 nv_wr32(dev, 0x418b00, 0x00000000); 1666 nv_wr32(dev, 0x418b00, chipset != 0xd9 ? 0x00000000 : 0x00000006);
1620 nv_wr32(dev, 0x418b08, 0x0a418820); 1667 nv_wr32(dev, 0x418b08, 0x0a418820);
1621 nv_wr32(dev, 0x418b0c, 0x062080e6); 1668 nv_wr32(dev, 0x418b0c, 0x062080e6);
1622 nv_wr32(dev, 0x418b10, 0x020398a4); 1669 nv_wr32(dev, 0x418b10, 0x020398a4);
@@ -1633,7 +1680,7 @@ nvc0_grctx_generate_gpc(struct drm_device *dev)
1633 nv_wr32(dev, 0x418c24, 0x00000000); 1680 nv_wr32(dev, 0x418c24, 0x00000000);
1634 nv_wr32(dev, 0x418c28, 0x00000000); 1681 nv_wr32(dev, 0x418c28, 0x00000000);
1635 nv_wr32(dev, 0x418c2c, 0x00000000); 1682 nv_wr32(dev, 0x418c2c, 0x00000000);
1636 if (chipset == 0xc1) 1683 if (chipset == 0xc1 || chipset == 0xd9)
1637 nv_wr32(dev, 0x418c6c, 0x00000001); 1684 nv_wr32(dev, 0x418c6c, 0x00000001);
1638 nv_wr32(dev, 0x418c80, 0x20200004); 1685 nv_wr32(dev, 0x418c80, 0x20200004);
1639 nv_wr32(dev, 0x418c8c, 0x00000001); 1686 nv_wr32(dev, 0x418c8c, 0x00000001);
@@ -1653,7 +1700,10 @@ nvc0_grctx_generate_tp(struct drm_device *dev)
1653 nv_wr32(dev, 0x419818, 0x00000000); 1700 nv_wr32(dev, 0x419818, 0x00000000);
1654 nv_wr32(dev, 0x41983c, 0x00038bc7); 1701 nv_wr32(dev, 0x41983c, 0x00038bc7);
1655 nv_wr32(dev, 0x419848, 0x00000000); 1702 nv_wr32(dev, 0x419848, 0x00000000);
1656 nv_wr32(dev, 0x419864, chipset != 0xc1 ? 0x0000012a : 0x00000129); 1703 if (chipset == 0xc1 || chipset == 0xd9)
1704 nv_wr32(dev, 0x419864, 0x00000129);
1705 else
1706 nv_wr32(dev, 0x419864, 0x0000012a);
1657 nv_wr32(dev, 0x419888, 0x00000000); 1707 nv_wr32(dev, 0x419888, 0x00000000);
1658 nv_wr32(dev, 0x419a00, 0x000001f0); 1708 nv_wr32(dev, 0x419a00, 0x000001f0);
1659 nv_wr32(dev, 0x419a04, 0x00000001); 1709 nv_wr32(dev, 0x419a04, 0x00000001);
@@ -1663,7 +1713,9 @@ nvc0_grctx_generate_tp(struct drm_device *dev)
1663 nv_wr32(dev, 0x419a14, 0x00000200); 1713 nv_wr32(dev, 0x419a14, 0x00000200);
1664 nv_wr32(dev, 0x419a1c, 0x00000000); 1714 nv_wr32(dev, 0x419a1c, 0x00000000);
1665 nv_wr32(dev, 0x419a20, 0x00000800); 1715 nv_wr32(dev, 0x419a20, 0x00000800);
1666 if (chipset != 0xc0 && chipset != 0xc8) 1716 if (chipset == 0xd9)
1717 nv_wr32(dev, 0x00419ac4, 0x0017f440);
1718 else if (chipset != 0xc0 && chipset != 0xc8)
1667 nv_wr32(dev, 0x00419ac4, 0x0007f440); 1719 nv_wr32(dev, 0x00419ac4, 0x0007f440);
1668 nv_wr32(dev, 0x419b00, 0x0a418820); 1720 nv_wr32(dev, 0x419b00, 0x0a418820);
1669 nv_wr32(dev, 0x419b04, 0x062080e6); 1721 nv_wr32(dev, 0x419b04, 0x062080e6);
@@ -1672,21 +1724,33 @@ nvc0_grctx_generate_tp(struct drm_device *dev)
1672 nv_wr32(dev, 0x419b10, 0x0a418820); 1724 nv_wr32(dev, 0x419b10, 0x0a418820);
1673 nv_wr32(dev, 0x419b14, 0x000000e6); 1725 nv_wr32(dev, 0x419b14, 0x000000e6);
1674 nv_wr32(dev, 0x419bd0, 0x00900103); 1726 nv_wr32(dev, 0x419bd0, 0x00900103);
1675 nv_wr32(dev, 0x419be0, chipset != 0xc1 ? 0x00000001 : 0x00400001); 1727 if (chipset == 0xc1 || chipset == 0xd9)
1728 nv_wr32(dev, 0x419be0, 0x00400001);
1729 else
1730 nv_wr32(dev, 0x419be0, 0x00000001);
1676 nv_wr32(dev, 0x419be4, 0x00000000); 1731 nv_wr32(dev, 0x419be4, 0x00000000);
1677 nv_wr32(dev, 0x419c00, 0x00000002); 1732 nv_wr32(dev, 0x419c00, chipset != 0xd9 ? 0x00000002 : 0x0000000a);
1678 nv_wr32(dev, 0x419c04, 0x00000006); 1733 nv_wr32(dev, 0x419c04, 0x00000006);
1679 nv_wr32(dev, 0x419c08, 0x00000002); 1734 nv_wr32(dev, 0x419c08, 0x00000002);
1680 nv_wr32(dev, 0x419c20, 0x00000000); 1735 nv_wr32(dev, 0x419c20, 0x00000000);
1681 if (chipset == 0xce || chipset == 0xcf) 1736 if (dev_priv->chipset == 0xd9) {
1737 nv_wr32(dev, 0x419c24, 0x00084210);
1738 nv_wr32(dev, 0x419c28, 0x3cf3cf3c);
1682 nv_wr32(dev, 0x419cb0, 0x00020048); 1739 nv_wr32(dev, 0x419cb0, 0x00020048);
1683 else 1740 } else
1741 if (chipset == 0xce || chipset == 0xcf) {
1742 nv_wr32(dev, 0x419cb0, 0x00020048);
1743 } else {
1684 nv_wr32(dev, 0x419cb0, 0x00060048); 1744 nv_wr32(dev, 0x419cb0, 0x00060048);
1745 }
1685 nv_wr32(dev, 0x419ce8, 0x00000000); 1746 nv_wr32(dev, 0x419ce8, 0x00000000);
1686 nv_wr32(dev, 0x419cf4, 0x00000183); 1747 nv_wr32(dev, 0x419cf4, 0x00000183);
1687 nv_wr32(dev, 0x419d20, chipset != 0xc1 ? 0x02180000 : 0x12180000); 1748 if (chipset == 0xc1 || chipset == 0xd9)
1749 nv_wr32(dev, 0x419d20, 0x12180000);
1750 else
1751 nv_wr32(dev, 0x419d20, 0x02180000);
1688 nv_wr32(dev, 0x419d24, 0x00001fff); 1752 nv_wr32(dev, 0x419d24, 0x00001fff);
1689 if (chipset == 0xc1) 1753 if (chipset == 0xc1 || chipset == 0xd9)
1690 nv_wr32(dev, 0x419d44, 0x02180218); 1754 nv_wr32(dev, 0x419d44, 0x02180218);
1691 nv_wr32(dev, 0x419e04, 0x00000000); 1755 nv_wr32(dev, 0x419e04, 0x00000000);
1692 nv_wr32(dev, 0x419e08, 0x00000000); 1756 nv_wr32(dev, 0x419e08, 0x00000000);
@@ -1986,6 +2050,10 @@ nvc0_grctx_generate(struct nouveau_channel *chan)
1986 nv_icmd(dev, 0x00000215, 0x00000040); 2050 nv_icmd(dev, 0x00000215, 0x00000040);
1987 nv_icmd(dev, 0x00000216, 0x00000040); 2051 nv_icmd(dev, 0x00000216, 0x00000040);
1988 nv_icmd(dev, 0x00000217, 0x00000040); 2052 nv_icmd(dev, 0x00000217, 0x00000040);
2053 if (dev_priv->chipset == 0xd9) {
2054 for (i = 0x0400; i <= 0x0417; i++)
2055 nv_icmd(dev, i, 0x00000040);
2056 }
1989 nv_icmd(dev, 0x00000218, 0x0000c080); 2057 nv_icmd(dev, 0x00000218, 0x0000c080);
1990 nv_icmd(dev, 0x00000219, 0x0000c080); 2058 nv_icmd(dev, 0x00000219, 0x0000c080);
1991 nv_icmd(dev, 0x0000021a, 0x0000c080); 2059 nv_icmd(dev, 0x0000021a, 0x0000c080);
@@ -1994,6 +2062,10 @@ nvc0_grctx_generate(struct nouveau_channel *chan)
1994 nv_icmd(dev, 0x0000021d, 0x0000c080); 2062 nv_icmd(dev, 0x0000021d, 0x0000c080);
1995 nv_icmd(dev, 0x0000021e, 0x0000c080); 2063 nv_icmd(dev, 0x0000021e, 0x0000c080);
1996 nv_icmd(dev, 0x0000021f, 0x0000c080); 2064 nv_icmd(dev, 0x0000021f, 0x0000c080);
2065 if (dev_priv->chipset == 0xd9) {
2066 for (i = 0x0440; i <= 0x0457; i++)
2067 nv_icmd(dev, i, 0x0000c080);
2068 }
1997 nv_icmd(dev, 0x000000ad, 0x0000013e); 2069 nv_icmd(dev, 0x000000ad, 0x0000013e);
1998 nv_icmd(dev, 0x000000e1, 0x00000010); 2070 nv_icmd(dev, 0x000000e1, 0x00000010);
1999 nv_icmd(dev, 0x00000290, 0x00000000); 2071 nv_icmd(dev, 0x00000290, 0x00000000);
@@ -2556,7 +2628,8 @@ nvc0_grctx_generate(struct nouveau_channel *chan)
2556 nv_icmd(dev, 0x0000053f, 0xffff0000); 2628 nv_icmd(dev, 0x0000053f, 0xffff0000);
2557 nv_icmd(dev, 0x00000585, 0x0000003f); 2629 nv_icmd(dev, 0x00000585, 0x0000003f);
2558 nv_icmd(dev, 0x00000576, 0x00000003); 2630 nv_icmd(dev, 0x00000576, 0x00000003);
2559 if (dev_priv->chipset == 0xc1) 2631 if (dev_priv->chipset == 0xc1 ||
2632 dev_priv->chipset == 0xd9)
2560 nv_icmd(dev, 0x0000057b, 0x00000059); 2633 nv_icmd(dev, 0x0000057b, 0x00000059);
2561 nv_icmd(dev, 0x00000586, 0x00000040); 2634 nv_icmd(dev, 0x00000586, 0x00000040);
2562 nv_icmd(dev, 0x00000582, 0x00000080); 2635 nv_icmd(dev, 0x00000582, 0x00000080);
@@ -2658,6 +2731,8 @@ nvc0_grctx_generate(struct nouveau_channel *chan)
2658 nv_icmd(dev, 0x00000957, 0x00000003); 2731 nv_icmd(dev, 0x00000957, 0x00000003);
2659 nv_icmd(dev, 0x0000095e, 0x20164010); 2732 nv_icmd(dev, 0x0000095e, 0x20164010);
2660 nv_icmd(dev, 0x0000095f, 0x00000020); 2733 nv_icmd(dev, 0x0000095f, 0x00000020);
2734 if (dev_priv->chipset == 0xd9)
2735 nv_icmd(dev, 0x0000097d, 0x00000020);
2661 nv_icmd(dev, 0x00000683, 0x00000006); 2736 nv_icmd(dev, 0x00000683, 0x00000006);
2662 nv_icmd(dev, 0x00000685, 0x003fffff); 2737 nv_icmd(dev, 0x00000685, 0x003fffff);
2663 nv_icmd(dev, 0x00000687, 0x00000c48); 2738 nv_icmd(dev, 0x00000687, 0x00000c48);
diff --git a/drivers/gpu/drm/nouveau/nvc0_grgpc.fuc b/drivers/gpu/drm/nouveau/nvc0_grgpc.fuc
index a9e93c80ef03..15272be33b66 100644
--- a/drivers/gpu/drm/nouveau/nvc0_grgpc.fuc
+++ b/drivers/gpu/drm/nouveau/nvc0_grgpc.fuc
@@ -82,6 +82,11 @@ chipsets:
82.b16 #nvc0_gpc_mmio_tail 82.b16 #nvc0_gpc_mmio_tail
83.b16 #nvc0_tpc_mmio_head 83.b16 #nvc0_tpc_mmio_head
84.b16 #nvcf_tpc_mmio_tail 84.b16 #nvcf_tpc_mmio_tail
85.b8 0xd9 0 0 0
86.b16 #nvd9_gpc_mmio_head
87.b16 #nvd9_gpc_mmio_tail
88.b16 #nvd9_tpc_mmio_head
89.b16 #nvd9_tpc_mmio_tail
85.b8 0 0 0 0 90.b8 0 0 0 0
86 91
87// GPC mmio lists 92// GPC mmio lists
@@ -114,6 +119,35 @@ nvc0_gpc_mmio_tail:
114mmctx_data(0x000c6c, 1); 119mmctx_data(0x000c6c, 1);
115nvc1_gpc_mmio_tail: 120nvc1_gpc_mmio_tail:
116 121
122nvd9_gpc_mmio_head:
123mmctx_data(0x000380, 1)
124mmctx_data(0x000400, 2)
125mmctx_data(0x00040c, 3)
126mmctx_data(0x000450, 9)
127mmctx_data(0x000600, 1)
128mmctx_data(0x000684, 1)
129mmctx_data(0x000700, 5)
130mmctx_data(0x000800, 1)
131mmctx_data(0x000808, 3)
132mmctx_data(0x000828, 1)
133mmctx_data(0x000830, 1)
134mmctx_data(0x0008d8, 1)
135mmctx_data(0x0008e0, 1)
136mmctx_data(0x0008e8, 6)
137mmctx_data(0x00091c, 1)
138mmctx_data(0x000924, 3)
139mmctx_data(0x000b00, 1)
140mmctx_data(0x000b08, 6)
141mmctx_data(0x000bb8, 1)
142mmctx_data(0x000c08, 1)
143mmctx_data(0x000c10, 8)
144mmctx_data(0x000c6c, 1)
145mmctx_data(0x000c80, 1)
146mmctx_data(0x000c8c, 1)
147mmctx_data(0x001000, 3)
148mmctx_data(0x001014, 1)
149nvd9_gpc_mmio_tail:
150
117// TPC mmio lists 151// TPC mmio lists
118nvc0_tpc_mmio_head: 152nvc0_tpc_mmio_head:
119mmctx_data(0x000018, 1) 153mmctx_data(0x000018, 1)
@@ -146,6 +180,31 @@ nvc3_tpc_mmio_tail:
146mmctx_data(0x000544, 1) 180mmctx_data(0x000544, 1)
147nvc1_tpc_mmio_tail: 181nvc1_tpc_mmio_tail:
148 182
183nvd9_tpc_mmio_head:
184mmctx_data(0x000018, 1)
185mmctx_data(0x00003c, 1)
186mmctx_data(0x000048, 1)
187mmctx_data(0x000064, 1)
188mmctx_data(0x000088, 1)
189mmctx_data(0x000200, 6)
190mmctx_data(0x00021c, 2)
191mmctx_data(0x0002c4, 1)
192mmctx_data(0x000300, 6)
193mmctx_data(0x0003d0, 1)
194mmctx_data(0x0003e0, 2)
195mmctx_data(0x000400, 3)
196mmctx_data(0x000420, 3)
197mmctx_data(0x0004b0, 1)
198mmctx_data(0x0004e8, 1)
199mmctx_data(0x0004f4, 1)
200mmctx_data(0x000520, 2)
201mmctx_data(0x000544, 1)
202mmctx_data(0x000604, 4)
203mmctx_data(0x000644, 20)
204mmctx_data(0x000698, 1)
205mmctx_data(0x0006e0, 1)
206mmctx_data(0x000750, 3)
207nvd9_tpc_mmio_tail:
149 208
150.section #nvc0_grgpc_code 209.section #nvc0_grgpc_code
151bra #init 210bra #init
diff --git a/drivers/gpu/drm/nouveau/nvc0_grgpc.fuc.h b/drivers/gpu/drm/nouveau/nvc0_grgpc.fuc.h
index 6f820324480e..a988b8ad00ac 100644
--- a/drivers/gpu/drm/nouveau/nvc0_grgpc.fuc.h
+++ b/drivers/gpu/drm/nouveau/nvc0_grgpc.fuc.h
@@ -25,26 +25,29 @@ uint32_t nvc0_grgpc_data[] = {
25 0x00000000, 25 0x00000000,
26 0x00000000, 26 0x00000000,
27 0x000000c0, 27 0x000000c0,
28 0x011c00bc, 28 0x012800c8,
29 0x01700120, 29 0x01e40194,
30 0x000000c1, 30 0x000000c1,
31 0x012000bc, 31 0x012c00c8,
32 0x01840120, 32 0x01f80194,
33 0x000000c3, 33 0x000000c3,
34 0x011c00bc, 34 0x012800c8,
35 0x01800120, 35 0x01f40194,
36 0x000000c4, 36 0x000000c4,
37 0x011c00bc, 37 0x012800c8,
38 0x01800120, 38 0x01f40194,
39 0x000000c8, 39 0x000000c8,
40 0x011c00bc, 40 0x012800c8,
41 0x01700120, 41 0x01e40194,
42 0x000000ce, 42 0x000000ce,
43 0x011c00bc, 43 0x012800c8,
44 0x01800120, 44 0x01f40194,
45 0x000000cf, 45 0x000000cf,
46 0x011c00bc, 46 0x012800c8,
47 0x017c0120, 47 0x01f00194,
48 0x000000d9,
49 0x0194012c,
50 0x025401f8,
48 0x00000000, 51 0x00000000,
49 0x00000380, 52 0x00000380,
50 0x14000400, 53 0x14000400,
@@ -71,6 +74,32 @@ uint32_t nvc0_grgpc_data[] = {
71 0x08001000, 74 0x08001000,
72 0x00001014, 75 0x00001014,
73 0x00000c6c, 76 0x00000c6c,
77 0x00000380,
78 0x04000400,
79 0x0800040c,
80 0x20000450,
81 0x00000600,
82 0x00000684,
83 0x10000700,
84 0x00000800,
85 0x08000808,
86 0x00000828,
87 0x00000830,
88 0x000008d8,
89 0x000008e0,
90 0x140008e8,
91 0x0000091c,
92 0x08000924,
93 0x00000b00,
94 0x14000b08,
95 0x00000bb8,
96 0x00000c08,
97 0x1c000c10,
98 0x00000c6c,
99 0x00000c80,
100 0x00000c8c,
101 0x08001000,
102 0x00001014,
74 0x00000018, 103 0x00000018,
75 0x0000003c, 104 0x0000003c,
76 0x00000048, 105 0x00000048,
@@ -96,6 +125,29 @@ uint32_t nvc0_grgpc_data[] = {
96 0x000006e0, 125 0x000006e0,
97 0x000004bc, 126 0x000004bc,
98 0x00000544, 127 0x00000544,
128 0x00000018,
129 0x0000003c,
130 0x00000048,
131 0x00000064,
132 0x00000088,
133 0x14000200,
134 0x0400021c,
135 0x000002c4,
136 0x14000300,
137 0x000003d0,
138 0x040003e0,
139 0x08000400,
140 0x08000420,
141 0x000004b0,
142 0x000004e8,
143 0x000004f4,
144 0x04000520,
145 0x00000544,
146 0x0c000604,
147 0x4c000644,
148 0x00000698,
149 0x000006e0,
150 0x08000750,
99}; 151};
100 152
101uint32_t nvc0_grgpc_code[] = { 153uint32_t nvc0_grgpc_code[] = {
diff --git a/drivers/gpu/drm/nouveau/nvc0_grhub.fuc b/drivers/gpu/drm/nouveau/nvc0_grhub.fuc
index 3ea31966ddb0..98acddb2c5bb 100644
--- a/drivers/gpu/drm/nouveau/nvc0_grhub.fuc
+++ b/drivers/gpu/drm/nouveau/nvc0_grhub.fuc
@@ -59,6 +59,9 @@ chipsets:
59.b8 0xcf 0 0 0 59.b8 0xcf 0 0 0
60.b16 #nvc0_hub_mmio_head 60.b16 #nvc0_hub_mmio_head
61.b16 #nvc0_hub_mmio_tail 61.b16 #nvc0_hub_mmio_tail
62.b8 0xd9 0 0 0
63.b16 #nvd9_hub_mmio_head
64.b16 #nvd9_hub_mmio_tail
62.b8 0 0 0 0 65.b8 0 0 0 0
63 66
64nvc0_hub_mmio_head: 67nvc0_hub_mmio_head:
@@ -105,6 +108,48 @@ nvc0_hub_mmio_tail:
105mmctx_data(0x4064c0, 2) 108mmctx_data(0x4064c0, 2)
106nvc1_hub_mmio_tail: 109nvc1_hub_mmio_tail:
107 110
111nvd9_hub_mmio_head:
112mmctx_data(0x17e91c, 2)
113mmctx_data(0x400204, 2)
114mmctx_data(0x404004, 10)
115mmctx_data(0x404044, 1)
116mmctx_data(0x404094, 14)
117mmctx_data(0x4040d0, 7)
118mmctx_data(0x4040f8, 1)
119mmctx_data(0x404130, 3)
120mmctx_data(0x404150, 3)
121mmctx_data(0x404164, 2)
122mmctx_data(0x404178, 2)
123mmctx_data(0x404200, 8)
124mmctx_data(0x404404, 14)
125mmctx_data(0x404460, 4)
126mmctx_data(0x404480, 1)
127mmctx_data(0x404498, 1)
128mmctx_data(0x404604, 4)
129mmctx_data(0x404618, 32)
130mmctx_data(0x404698, 21)
131mmctx_data(0x4046f0, 2)
132mmctx_data(0x404700, 22)
133mmctx_data(0x405800, 1)
134mmctx_data(0x405830, 3)
135mmctx_data(0x405854, 1)
136mmctx_data(0x405870, 4)
137mmctx_data(0x405a00, 2)
138mmctx_data(0x405a18, 1)
139mmctx_data(0x406020, 1)
140mmctx_data(0x406028, 4)
141mmctx_data(0x4064a8, 2)
142mmctx_data(0x4064b4, 5)
143mmctx_data(0x407804, 1)
144mmctx_data(0x40780c, 6)
145mmctx_data(0x4078bc, 1)
146mmctx_data(0x408000, 7)
147mmctx_data(0x408064, 1)
148mmctx_data(0x408800, 3)
149mmctx_data(0x408900, 4)
150mmctx_data(0x408980, 1)
151nvd9_hub_mmio_tail:
152
108.align 256 153.align 256
109chan_data: 154chan_data:
110chan_mmio_count: .b32 0 155chan_mmio_count: .b32 0
diff --git a/drivers/gpu/drm/nouveau/nvc0_grhub.fuc.h b/drivers/gpu/drm/nouveau/nvc0_grhub.fuc.h
index 241d3263f1e5..c5ed307abeb9 100644
--- a/drivers/gpu/drm/nouveau/nvc0_grhub.fuc.h
+++ b/drivers/gpu/drm/nouveau/nvc0_grhub.fuc.h
@@ -23,19 +23,21 @@ uint32_t nvc0_grhub_data[] = {
23 0x00000000, 23 0x00000000,
24 0x00000000, 24 0x00000000,
25 0x000000c0, 25 0x000000c0,
26 0x01340098, 26 0x013c00a0,
27 0x000000c1, 27 0x000000c1,
28 0x01380098, 28 0x014000a0,
29 0x000000c3, 29 0x000000c3,
30 0x01340098, 30 0x013c00a0,
31 0x000000c4, 31 0x000000c4,
32 0x01340098, 32 0x013c00a0,
33 0x000000c8, 33 0x000000c8,
34 0x01340098, 34 0x013c00a0,
35 0x000000ce, 35 0x000000ce,
36 0x01340098, 36 0x013c00a0,
37 0x000000cf, 37 0x000000cf,
38 0x01340098, 38 0x013c00a0,
39 0x000000d9,
40 0x01dc0140,
39 0x00000000, 41 0x00000000,
40 0x0417e91c, 42 0x0417e91c,
41 0x04400204, 43 0x04400204,
@@ -77,47 +79,45 @@ uint32_t nvc0_grhub_data[] = {
77 0x0c408900, 79 0x0c408900,
78 0x00408980, 80 0x00408980,
79 0x044064c0, 81 0x044064c0,
80 0x00000000, 82 0x0417e91c,
81 0x00000000, 83 0x04400204,
82 0x00000000, 84 0x24404004,
83 0x00000000, 85 0x00404044,
84 0x00000000, 86 0x34404094,
85 0x00000000, 87 0x184040d0,
86 0x00000000, 88 0x004040f8,
87 0x00000000, 89 0x08404130,
88 0x00000000, 90 0x08404150,
89 0x00000000, 91 0x04404164,
90 0x00000000, 92 0x04404178,
91 0x00000000, 93 0x1c404200,
92 0x00000000, 94 0x34404404,
93 0x00000000, 95 0x0c404460,
94 0x00000000, 96 0x00404480,
95 0x00000000, 97 0x00404498,
96 0x00000000, 98 0x0c404604,
97 0x00000000, 99 0x7c404618,
98 0x00000000, 100 0x50404698,
99 0x00000000, 101 0x044046f0,
100 0x00000000, 102 0x54404700,
101 0x00000000, 103 0x00405800,
102 0x00000000, 104 0x08405830,
103 0x00000000, 105 0x00405854,
104 0x00000000, 106 0x0c405870,
105 0x00000000, 107 0x04405a00,
106 0x00000000, 108 0x00405a18,
107 0x00000000, 109 0x00406020,
108 0x00000000, 110 0x0c406028,
109 0x00000000, 111 0x044064a8,
110 0x00000000, 112 0x104064b4,
111 0x00000000, 113 0x00407804,
112 0x00000000, 114 0x1440780c,
113 0x00000000, 115 0x004078bc,
114 0x00000000, 116 0x18408000,
115 0x00000000, 117 0x00408064,
116 0x00000000, 118 0x08408800,
117 0x00000000, 119 0x0c408900,
118 0x00000000, 120 0x00408980,
119 0x00000000,
120 0x00000000,
121 0x00000000, 121 0x00000000,
122 0x00000000, 122 0x00000000,
123 0x00000000, 123 0x00000000,