aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/radeon/r600.c
diff options
context:
space:
mode:
authorAlex Deucher <alexdeucher@gmail.com>2010-03-24 13:36:43 -0400
committerDave Airlie <airlied@redhat.com>2010-04-08 20:16:04 -0400
commitfe251e2fffa1ebc17c8e6e895b0374ae4e732fa5 (patch)
tree995060a10005d4a284bebcd0412fabfd0805de89 /drivers/gpu/drm/radeon/r600.c
parent32fcdbf4084544c3d8fa413004d57e5dc6f2eefe (diff)
drm/radeon/kms/evergreen: setup and enable the CP
The command processor (CP) fetches command buffers and feeds the GPU. This patch requires the evergreen family me and pfp ucode files. Signed-off-by: Alex Deucher <alexdeucher@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/radeon/r600.c')
-rw-r--r--drivers/gpu/drm/radeon/r600.c47
1 files changed, 42 insertions, 5 deletions
diff --git a/drivers/gpu/drm/radeon/r600.c b/drivers/gpu/drm/radeon/r600.c
index 13c9cc34231d..4b0225715b93 100644
--- a/drivers/gpu/drm/radeon/r600.c
+++ b/drivers/gpu/drm/radeon/r600.c
@@ -43,6 +43,8 @@
43#define R700_PFP_UCODE_SIZE 848 43#define R700_PFP_UCODE_SIZE 848
44#define R700_PM4_UCODE_SIZE 1360 44#define R700_PM4_UCODE_SIZE 1360
45#define R700_RLC_UCODE_SIZE 1024 45#define R700_RLC_UCODE_SIZE 1024
46#define EVERGREEN_PFP_UCODE_SIZE 1120
47#define EVERGREEN_PM4_UCODE_SIZE 1376
46 48
47/* Firmware Names */ 49/* Firmware Names */
48MODULE_FIRMWARE("radeon/R600_pfp.bin"); 50MODULE_FIRMWARE("radeon/R600_pfp.bin");
@@ -67,6 +69,14 @@ MODULE_FIRMWARE("radeon/RV710_pfp.bin");
67MODULE_FIRMWARE("radeon/RV710_me.bin"); 69MODULE_FIRMWARE("radeon/RV710_me.bin");
68MODULE_FIRMWARE("radeon/R600_rlc.bin"); 70MODULE_FIRMWARE("radeon/R600_rlc.bin");
69MODULE_FIRMWARE("radeon/R700_rlc.bin"); 71MODULE_FIRMWARE("radeon/R700_rlc.bin");
72MODULE_FIRMWARE("radeon/CEDAR_pfp.bin");
73MODULE_FIRMWARE("radeon/CEDAR_me.bin");
74MODULE_FIRMWARE("radeon/REDWOOD_pfp.bin");
75MODULE_FIRMWARE("radeon/REDWOOD_me.bin");
76MODULE_FIRMWARE("radeon/JUNIPER_pfp.bin");
77MODULE_FIRMWARE("radeon/JUNIPER_me.bin");
78MODULE_FIRMWARE("radeon/CYRPESS_pfp.bin");
79MODULE_FIRMWARE("radeon/CYPRESS_me.bin");
70 80
71int r600_debugfs_mc_info_init(struct radeon_device *rdev); 81int r600_debugfs_mc_info_init(struct radeon_device *rdev);
72 82
@@ -1449,10 +1459,31 @@ int r600_init_microcode(struct radeon_device *rdev)
1449 chip_name = "RV710"; 1459 chip_name = "RV710";
1450 rlc_chip_name = "R700"; 1460 rlc_chip_name = "R700";
1451 break; 1461 break;
1462 case CHIP_CEDAR:
1463 chip_name = "CEDAR";
1464 rlc_chip_name = "";
1465 break;
1466 case CHIP_REDWOOD:
1467 chip_name = "REDWOOD";
1468 rlc_chip_name = "";
1469 break;
1470 case CHIP_JUNIPER:
1471 chip_name = "JUNIPER";
1472 rlc_chip_name = "";
1473 break;
1474 case CHIP_CYPRESS:
1475 case CHIP_HEMLOCK:
1476 chip_name = "CYPRESS";
1477 rlc_chip_name = "";
1478 break;
1452 default: BUG(); 1479 default: BUG();
1453 } 1480 }
1454 1481
1455 if (rdev->family >= CHIP_RV770) { 1482 if (rdev->family >= CHIP_CEDAR) {
1483 pfp_req_size = EVERGREEN_PFP_UCODE_SIZE * 4;
1484 me_req_size = EVERGREEN_PM4_UCODE_SIZE * 4;
1485 rlc_req_size = 0;
1486 } else if (rdev->family >= CHIP_RV770) {
1456 pfp_req_size = R700_PFP_UCODE_SIZE * 4; 1487 pfp_req_size = R700_PFP_UCODE_SIZE * 4;
1457 me_req_size = R700_PM4_UCODE_SIZE * 4; 1488 me_req_size = R700_PM4_UCODE_SIZE * 4;
1458 rlc_req_size = R700_RLC_UCODE_SIZE * 4; 1489 rlc_req_size = R700_RLC_UCODE_SIZE * 4;
@@ -1487,6 +1518,8 @@ int r600_init_microcode(struct radeon_device *rdev)
1487 err = -EINVAL; 1518 err = -EINVAL;
1488 } 1519 }
1489 1520
1521 /* XXX until evergreen interrupts are supported */
1522 if (rdev->family < CHIP_CEDAR) {
1490 snprintf(fw_name, sizeof(fw_name), "radeon/%s_rlc.bin", rlc_chip_name); 1523 snprintf(fw_name, sizeof(fw_name), "radeon/%s_rlc.bin", rlc_chip_name);
1491 err = request_firmware(&rdev->rlc_fw, fw_name, &pdev->dev); 1524 err = request_firmware(&rdev->rlc_fw, fw_name, &pdev->dev);
1492 if (err) 1525 if (err)
@@ -1497,6 +1530,7 @@ int r600_init_microcode(struct radeon_device *rdev)
1497 rdev->rlc_fw->size, fw_name); 1530 rdev->rlc_fw->size, fw_name);
1498 err = -EINVAL; 1531 err = -EINVAL;
1499 } 1532 }
1533 }
1500 1534
1501out: 1535out:
1502 platform_device_unregister(pdev); 1536 platform_device_unregister(pdev);
@@ -1566,12 +1600,15 @@ int r600_cp_start(struct radeon_device *rdev)
1566 } 1600 }
1567 radeon_ring_write(rdev, PACKET3(PACKET3_ME_INITIALIZE, 5)); 1601 radeon_ring_write(rdev, PACKET3(PACKET3_ME_INITIALIZE, 5));
1568 radeon_ring_write(rdev, 0x1); 1602 radeon_ring_write(rdev, 0x1);
1569 if (rdev->family < CHIP_RV770) { 1603 if (rdev->family >= CHIP_CEDAR) {
1570 radeon_ring_write(rdev, 0x3); 1604 radeon_ring_write(rdev, 0x0);
1571 radeon_ring_write(rdev, rdev->config.r600.max_hw_contexts - 1); 1605 radeon_ring_write(rdev, rdev->config.evergreen.max_hw_contexts - 1);
1572 } else { 1606 } else if (rdev->family >= CHIP_RV770) {
1573 radeon_ring_write(rdev, 0x0); 1607 radeon_ring_write(rdev, 0x0);
1574 radeon_ring_write(rdev, rdev->config.rv770.max_hw_contexts - 1); 1608 radeon_ring_write(rdev, rdev->config.rv770.max_hw_contexts - 1);
1609 } else {
1610 radeon_ring_write(rdev, 0x3);
1611 radeon_ring_write(rdev, rdev->config.r600.max_hw_contexts - 1);
1575 } 1612 }
1576 radeon_ring_write(rdev, PACKET3_ME_INITIALIZE_DEVICE_ID(1)); 1613 radeon_ring_write(rdev, PACKET3_ME_INITIALIZE_DEVICE_ID(1));
1577 radeon_ring_write(rdev, 0); 1614 radeon_ring_write(rdev, 0);