aboutsummaryrefslogtreecommitdiffstats
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
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>
-rw-r--r--drivers/gpu/drm/radeon/evergreen.c117
-rw-r--r--drivers/gpu/drm/radeon/evergreend.h2
-rw-r--r--drivers/gpu/drm/radeon/r600.c47
-rw-r--r--drivers/gpu/drm/radeon/radeon.h4
-rw-r--r--drivers/gpu/drm/radeon/radeon_asic.c6
-rw-r--r--drivers/gpu/drm/radeon/rv770.c10
6 files changed, 154 insertions, 32 deletions
diff --git a/drivers/gpu/drm/radeon/evergreen.c b/drivers/gpu/drm/radeon/evergreen.c
index 26b219bb1388..57fe569682df 100644
--- a/drivers/gpu/drm/radeon/evergreen.c
+++ b/drivers/gpu/drm/radeon/evergreen.c
@@ -32,6 +32,9 @@
32#include "avivod.h" 32#include "avivod.h"
33#include "evergreen_reg.h" 33#include "evergreen_reg.h"
34 34
35#define EVERGREEN_PFP_UCODE_SIZE 1120
36#define EVERGREEN_PM4_UCODE_SIZE 1376
37
35static void evergreen_gpu_init(struct radeon_device *rdev); 38static void evergreen_gpu_init(struct radeon_device *rdev);
36void evergreen_fini(struct radeon_device *rdev); 39void evergreen_fini(struct radeon_device *rdev);
37 40
@@ -418,23 +421,91 @@ static void evergreen_mc_program(struct radeon_device *rdev)
418 rv515_vga_render_disable(rdev); 421 rv515_vga_render_disable(rdev);
419} 422}
420 423
421#if 0
422/* 424/*
423 * CP. 425 * CP.
424 */ 426 */
425static void evergreen_cp_stop(struct radeon_device *rdev)
426{
427 /* XXX */
428}
429
430 427
431static int evergreen_cp_load_microcode(struct radeon_device *rdev) 428static int evergreen_cp_load_microcode(struct radeon_device *rdev)
432{ 429{
433 /* XXX */ 430 const __be32 *fw_data;
431 int i;
432
433 if (!rdev->me_fw || !rdev->pfp_fw)
434 return -EINVAL;
434 435
436 r700_cp_stop(rdev);
437 WREG32(CP_RB_CNTL, RB_NO_UPDATE | (15 << 8) | (3 << 0));
438
439 fw_data = (const __be32 *)rdev->pfp_fw->data;
440 WREG32(CP_PFP_UCODE_ADDR, 0);
441 for (i = 0; i < EVERGREEN_PFP_UCODE_SIZE; i++)
442 WREG32(CP_PFP_UCODE_DATA, be32_to_cpup(fw_data++));
443 WREG32(CP_PFP_UCODE_ADDR, 0);
444
445 fw_data = (const __be32 *)rdev->me_fw->data;
446 WREG32(CP_ME_RAM_WADDR, 0);
447 for (i = 0; i < EVERGREEN_PM4_UCODE_SIZE; i++)
448 WREG32(CP_ME_RAM_DATA, be32_to_cpup(fw_data++));
449
450 WREG32(CP_PFP_UCODE_ADDR, 0);
451 WREG32(CP_ME_RAM_WADDR, 0);
452 WREG32(CP_ME_RAM_RADDR, 0);
435 return 0; 453 return 0;
436} 454}
455
456int evergreen_cp_resume(struct radeon_device *rdev)
457{
458 u32 tmp;
459 u32 rb_bufsz;
460 int r;
461
462 /* Reset cp; if cp is reset, then PA, SH, VGT also need to be reset */
463 WREG32(GRBM_SOFT_RESET, (SOFT_RESET_CP |
464 SOFT_RESET_PA |
465 SOFT_RESET_SH |
466 SOFT_RESET_VGT |
467 SOFT_RESET_SX));
468 RREG32(GRBM_SOFT_RESET);
469 mdelay(15);
470 WREG32(GRBM_SOFT_RESET, 0);
471 RREG32(GRBM_SOFT_RESET);
472
473 /* Set ring buffer size */
474 rb_bufsz = drm_order(rdev->cp.ring_size / 8);
475 tmp = RB_NO_UPDATE | (drm_order(RADEON_GPU_PAGE_SIZE/8) << 8) | rb_bufsz;
476#ifdef __BIG_ENDIAN
477 tmp |= BUF_SWAP_32BIT;
437#endif 478#endif
479 WREG32(CP_RB_CNTL, tmp);
480 WREG32(CP_SEM_WAIT_TIMER, 0x4);
481
482 /* Set the write pointer delay */
483 WREG32(CP_RB_WPTR_DELAY, 0);
484
485 /* Initialize the ring buffer's read and write pointers */
486 WREG32(CP_RB_CNTL, tmp | RB_RPTR_WR_ENA);
487 WREG32(CP_RB_RPTR_WR, 0);
488 WREG32(CP_RB_WPTR, 0);
489 WREG32(CP_RB_RPTR_ADDR, rdev->cp.gpu_addr & 0xFFFFFFFF);
490 WREG32(CP_RB_RPTR_ADDR_HI, upper_32_bits(rdev->cp.gpu_addr));
491 mdelay(1);
492 WREG32(CP_RB_CNTL, tmp);
493
494 WREG32(CP_RB_BASE, rdev->cp.gpu_addr >> 8);
495 WREG32(CP_DEBUG, (1 << 27) | (1 << 28));
496
497 rdev->cp.rptr = RREG32(CP_RB_RPTR);
498 rdev->cp.wptr = RREG32(CP_RB_WPTR);
499
500 r600_cp_start(rdev);
501 rdev->cp.ready = true;
502 r = radeon_ring_test(rdev);
503 if (r) {
504 rdev->cp.ready = false;
505 return r;
506 }
507 return 0;
508}
438 509
439/* 510/*
440 * Core functions 511 * Core functions
@@ -1138,15 +1209,15 @@ static int evergreen_startup(struct radeon_device *rdev)
1138{ 1209{
1139 int r; 1210 int r;
1140 1211
1141#if 0 1212 /* XXX until interrupts are supported */
1142 if (!rdev->me_fw || !rdev->pfp_fw || !rdev->rlc_fw) { 1213 if (!rdev->me_fw || !rdev->pfp_fw /*|| !rdev->rlc_fw*/) {
1143 r = r600_init_microcode(rdev); 1214 r = r600_init_microcode(rdev);
1144 if (r) { 1215 if (r) {
1145 DRM_ERROR("Failed to load firmware!\n"); 1216 DRM_ERROR("Failed to load firmware!\n");
1146 return r; 1217 return r;
1147 } 1218 }
1148 } 1219 }
1149#endif 1220
1150 evergreen_mc_program(rdev); 1221 evergreen_mc_program(rdev);
1151 if (rdev->flags & RADEON_IS_AGP) { 1222 if (rdev->flags & RADEON_IS_AGP) {
1152 evergreen_agp_enable(rdev); 1223 evergreen_agp_enable(rdev);
@@ -1184,6 +1255,7 @@ static int evergreen_startup(struct radeon_device *rdev)
1184 return r; 1255 return r;
1185 } 1256 }
1186 r600_irq_set(rdev); 1257 r600_irq_set(rdev);
1258#endif
1187 1259
1188 r = radeon_ring_init(rdev, rdev->cp.ring_size); 1260 r = radeon_ring_init(rdev, rdev->cp.ring_size);
1189 if (r) 1261 if (r)
@@ -1191,12 +1263,12 @@ static int evergreen_startup(struct radeon_device *rdev)
1191 r = evergreen_cp_load_microcode(rdev); 1263 r = evergreen_cp_load_microcode(rdev);
1192 if (r) 1264 if (r)
1193 return r; 1265 return r;
1194 r = r600_cp_resume(rdev); 1266 r = evergreen_cp_resume(rdev);
1195 if (r) 1267 if (r)
1196 return r; 1268 return r;
1197 /* write back buffer are not vital so don't worry about failure */ 1269 /* write back buffer are not vital so don't worry about failure */
1198 r600_wb_enable(rdev); 1270 r600_wb_enable(rdev);
1199#endif 1271
1200 return 0; 1272 return 0;
1201} 1273}
1202 1274
@@ -1221,13 +1293,13 @@ int evergreen_resume(struct radeon_device *rdev)
1221 DRM_ERROR("r600 startup failed on resume\n"); 1293 DRM_ERROR("r600 startup failed on resume\n");
1222 return r; 1294 return r;
1223 } 1295 }
1224#if 0 1296
1225 r = r600_ib_test(rdev); 1297 r = r600_ib_test(rdev);
1226 if (r) { 1298 if (r) {
1227 DRM_ERROR("radeon: failled testing IB (%d).\n", r); 1299 DRM_ERROR("radeon: failled testing IB (%d).\n", r);
1228 return r; 1300 return r;
1229 } 1301 }
1230#endif 1302
1231 return r; 1303 return r;
1232 1304
1233} 1305}
@@ -1236,12 +1308,11 @@ int evergreen_suspend(struct radeon_device *rdev)
1236{ 1308{
1237#if 0 1309#if 0
1238 int r; 1310 int r;
1239 1311#endif
1240 /* FIXME: we should wait for ring to be empty */ 1312 /* FIXME: we should wait for ring to be empty */
1241 r700_cp_stop(rdev); 1313 r700_cp_stop(rdev);
1242 rdev->cp.ready = false; 1314 rdev->cp.ready = false;
1243 r600_wb_disable(rdev); 1315 r600_wb_disable(rdev);
1244#endif
1245 1316
1246 evergreen_pcie_gart_disable(rdev); 1317 evergreen_pcie_gart_disable(rdev);
1247#if 0 1318#if 0
@@ -1348,10 +1419,10 @@ int evergreen_init(struct radeon_device *rdev)
1348 r = radeon_irq_kms_init(rdev); 1419 r = radeon_irq_kms_init(rdev);
1349 if (r) 1420 if (r)
1350 return r; 1421 return r;
1351 1422#endif
1352 rdev->cp.ring_obj = NULL; 1423 rdev->cp.ring_obj = NULL;
1353 r600_ring_init(rdev, 1024 * 1024); 1424 r600_ring_init(rdev, 1024 * 1024);
1354 1425#if 0
1355 rdev->ih.ring_obj = NULL; 1426 rdev->ih.ring_obj = NULL;
1356 r600_ih_ring_init(rdev, 64 * 1024); 1427 r600_ih_ring_init(rdev, 64 * 1024);
1357#endif 1428#endif
@@ -1362,9 +1433,13 @@ int evergreen_init(struct radeon_device *rdev)
1362 rdev->accel_working = false; 1433 rdev->accel_working = false;
1363 r = evergreen_startup(rdev); 1434 r = evergreen_startup(rdev);
1364 if (r) { 1435 if (r) {
1365 evergreen_suspend(rdev); 1436 dev_err(rdev->dev, "disabling GPU acceleration\n");
1366 /*r600_wb_fini(rdev);*/ 1437 r700_cp_fini(rdev);
1367 /*radeon_ring_fini(rdev);*/ 1438 r600_wb_fini(rdev);
1439#if 0
1440 r600_irq_fini(rdev);
1441 radeon_irq_kms_fini(rdev);
1442#endif
1368 evergreen_pcie_gart_fini(rdev); 1443 evergreen_pcie_gart_fini(rdev);
1369 rdev->accel_working = false; 1444 rdev->accel_working = false;
1370 } 1445 }
diff --git a/drivers/gpu/drm/radeon/evergreend.h b/drivers/gpu/drm/radeon/evergreend.h
index effe335356c7..10e9768534da 100644
--- a/drivers/gpu/drm/radeon/evergreend.h
+++ b/drivers/gpu/drm/radeon/evergreend.h
@@ -89,6 +89,7 @@
89#define CP_QUEUE_THRESHOLDS 0x8760 89#define CP_QUEUE_THRESHOLDS 0x8760
90#define ROQ_IB1_START(x) ((x) << 0) 90#define ROQ_IB1_START(x) ((x) << 0)
91#define ROQ_IB2_START(x) ((x) << 8) 91#define ROQ_IB2_START(x) ((x) << 8)
92#define CP_RB_BASE 0xC100
92#define CP_RB_CNTL 0xC104 93#define CP_RB_CNTL 0xC104
93#define RB_BUFSZ(x) ((x) << 0) 94#define RB_BUFSZ(x) ((x) << 0)
94#define RB_BLKSZ(x) ((x) << 8) 95#define RB_BLKSZ(x) ((x) << 8)
@@ -104,6 +105,7 @@
104#define CP_RB_WPTR_ADDR_HI 0xC11C 105#define CP_RB_WPTR_ADDR_HI 0xC11C
105#define CP_RB_WPTR_DELAY 0x8704 106#define CP_RB_WPTR_DELAY 0x8704
106#define CP_SEM_WAIT_TIMER 0x85BC 107#define CP_SEM_WAIT_TIMER 0x85BC
108#define CP_DEBUG 0xC1FC
107 109
108 110
109#define GC_USER_SHADER_PIPE_CONFIG 0x8954 111#define GC_USER_SHADER_PIPE_CONFIG 0x8954
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);
diff --git a/drivers/gpu/drm/radeon/radeon.h b/drivers/gpu/drm/radeon/radeon.h
index a77a86203996..acf21d7e3cb2 100644
--- a/drivers/gpu/drm/radeon/radeon.h
+++ b/drivers/gpu/drm/radeon/radeon.h
@@ -1300,6 +1300,7 @@ extern void rs690_line_buffer_adjust(struct radeon_device *rdev,
1300extern void r600_vram_gtt_location(struct radeon_device *rdev, struct radeon_mc *mc); 1300extern void r600_vram_gtt_location(struct radeon_device *rdev, struct radeon_mc *mc);
1301extern bool r600_card_posted(struct radeon_device *rdev); 1301extern bool r600_card_posted(struct radeon_device *rdev);
1302extern void r600_cp_stop(struct radeon_device *rdev); 1302extern void r600_cp_stop(struct radeon_device *rdev);
1303extern int r600_cp_start(struct radeon_device *rdev);
1303extern void r600_ring_init(struct radeon_device *rdev, unsigned ring_size); 1304extern void r600_ring_init(struct radeon_device *rdev, unsigned ring_size);
1304extern int r600_cp_resume(struct radeon_device *rdev); 1305extern int r600_cp_resume(struct radeon_device *rdev);
1305extern void r600_cp_fini(struct radeon_device *rdev); 1306extern void r600_cp_fini(struct radeon_device *rdev);
@@ -1340,6 +1341,9 @@ extern void r600_hdmi_update_audio_settings(struct drm_encoder *encoder,
1340 uint8_t status_bits, 1341 uint8_t status_bits,
1341 uint8_t category_code); 1342 uint8_t category_code);
1342 1343
1344extern void r700_cp_stop(struct radeon_device *rdev);
1345extern void r700_cp_fini(struct radeon_device *rdev);
1346
1343/* evergreen */ 1347/* evergreen */
1344struct evergreen_mc_save { 1348struct evergreen_mc_save {
1345 u32 vga_control[6]; 1349 u32 vga_control[6];
diff --git a/drivers/gpu/drm/radeon/radeon_asic.c b/drivers/gpu/drm/radeon/radeon_asic.c
index d923e4b234d2..3a576ab805cf 100644
--- a/drivers/gpu/drm/radeon/radeon_asic.c
+++ b/drivers/gpu/drm/radeon/radeon_asic.c
@@ -635,14 +635,14 @@ static struct radeon_asic evergreen_asic = {
635 .fini = &evergreen_fini, 635 .fini = &evergreen_fini,
636 .suspend = &evergreen_suspend, 636 .suspend = &evergreen_suspend,
637 .resume = &evergreen_resume, 637 .resume = &evergreen_resume,
638 .cp_commit = NULL, 638 .cp_commit = &r600_cp_commit,
639 .gpu_is_lockup = &evergreen_gpu_is_lockup, 639 .gpu_is_lockup = &evergreen_gpu_is_lockup,
640 .asic_reset = &evergreen_asic_reset, 640 .asic_reset = &evergreen_asic_reset,
641 .vga_set_state = &r600_vga_set_state, 641 .vga_set_state = &r600_vga_set_state,
642 .gart_tlb_flush = &evergreen_pcie_gart_tlb_flush, 642 .gart_tlb_flush = &evergreen_pcie_gart_tlb_flush,
643 .gart_set_page = &rs600_gart_set_page, 643 .gart_set_page = &rs600_gart_set_page,
644 .ring_test = NULL, 644 .ring_test = &r600_ring_test,
645 .ring_ib_execute = NULL, 645 .ring_ib_execute = &r600_ring_ib_execute,
646 .irq_set = NULL, 646 .irq_set = NULL,
647 .irq_process = NULL, 647 .irq_process = NULL,
648 .get_vblank_counter = NULL, 648 .get_vblank_counter = NULL,
diff --git a/drivers/gpu/drm/radeon/rv770.c b/drivers/gpu/drm/radeon/rv770.c
index 2b8a4e170654..2642d2642641 100644
--- a/drivers/gpu/drm/radeon/rv770.c
+++ b/drivers/gpu/drm/radeon/rv770.c
@@ -236,7 +236,6 @@ void r700_cp_stop(struct radeon_device *rdev)
236 WREG32(CP_ME_CNTL, (CP_ME_HALT | CP_PFP_HALT)); 236 WREG32(CP_ME_CNTL, (CP_ME_HALT | CP_PFP_HALT));
237} 237}
238 238
239
240static int rv770_cp_load_microcode(struct radeon_device *rdev) 239static int rv770_cp_load_microcode(struct radeon_device *rdev)
241{ 240{
242 const __be32 *fw_data; 241 const __be32 *fw_data;
@@ -271,6 +270,11 @@ static int rv770_cp_load_microcode(struct radeon_device *rdev)
271 return 0; 270 return 0;
272} 271}
273 272
273void r700_cp_fini(struct radeon_device *rdev)
274{
275 r700_cp_stop(rdev);
276 radeon_ring_fini(rdev);
277}
274 278
275/* 279/*
276 * Core functions 280 * Core functions
@@ -1125,7 +1129,7 @@ int rv770_init(struct radeon_device *rdev)
1125 r = rv770_startup(rdev); 1129 r = rv770_startup(rdev);
1126 if (r) { 1130 if (r) {
1127 dev_err(rdev->dev, "disabling GPU acceleration\n"); 1131 dev_err(rdev->dev, "disabling GPU acceleration\n");
1128 r600_cp_fini(rdev); 1132 r700_cp_fini(rdev);
1129 r600_wb_fini(rdev); 1133 r600_wb_fini(rdev);
1130 r600_irq_fini(rdev); 1134 r600_irq_fini(rdev);
1131 radeon_irq_kms_fini(rdev); 1135 radeon_irq_kms_fini(rdev);
@@ -1159,7 +1163,7 @@ void rv770_fini(struct radeon_device *rdev)
1159{ 1163{
1160 radeon_pm_fini(rdev); 1164 radeon_pm_fini(rdev);
1161 r600_blit_fini(rdev); 1165 r600_blit_fini(rdev);
1162 r600_cp_fini(rdev); 1166 r700_cp_fini(rdev);
1163 r600_wb_fini(rdev); 1167 r600_wb_fini(rdev);
1164 r600_irq_fini(rdev); 1168 r600_irq_fini(rdev);
1165 radeon_irq_kms_fini(rdev); 1169 radeon_irq_kms_fini(rdev);