diff options
Diffstat (limited to 'drivers/gpu/drm/radeon/nid.h')
-rw-r--r-- | drivers/gpu/drm/radeon/nid.h | 168 |
1 files changed, 168 insertions, 0 deletions
diff --git a/drivers/gpu/drm/radeon/nid.h b/drivers/gpu/drm/radeon/nid.h index 9dc2b3429c3f..57062f14acc9 100644 --- a/drivers/gpu/drm/radeon/nid.h +++ b/drivers/gpu/drm/radeon/nid.h | |||
@@ -205,6 +205,24 @@ | |||
205 | #define SOFT_RESET_VGT (1 << 14) | 205 | #define SOFT_RESET_VGT (1 << 14) |
206 | #define SOFT_RESET_IA (1 << 15) | 206 | #define SOFT_RESET_IA (1 << 15) |
207 | 207 | ||
208 | #define SCRATCH_REG0 0x8500 | ||
209 | #define SCRATCH_REG1 0x8504 | ||
210 | #define SCRATCH_REG2 0x8508 | ||
211 | #define SCRATCH_REG3 0x850C | ||
212 | #define SCRATCH_REG4 0x8510 | ||
213 | #define SCRATCH_REG5 0x8514 | ||
214 | #define SCRATCH_REG6 0x8518 | ||
215 | #define SCRATCH_REG7 0x851C | ||
216 | #define SCRATCH_UMSK 0x8540 | ||
217 | #define SCRATCH_ADDR 0x8544 | ||
218 | #define CP_SEM_WAIT_TIMER 0x85BC | ||
219 | #define CP_ME_CNTL 0x86D8 | ||
220 | #define CP_ME_HALT (1 << 28) | ||
221 | #define CP_PFP_HALT (1 << 26) | ||
222 | #define CP_RB2_RPTR 0x86f8 | ||
223 | #define CP_RB1_RPTR 0x86fc | ||
224 | #define CP_RB0_RPTR 0x8700 | ||
225 | #define CP_RB_WPTR_DELAY 0x8704 | ||
208 | #define CP_MEQ_THRESHOLDS 0x8764 | 226 | #define CP_MEQ_THRESHOLDS 0x8764 |
209 | #define MEQ1_START(x) ((x) << 0) | 227 | #define MEQ1_START(x) ((x) << 0) |
210 | #define MEQ2_START(x) ((x) << 8) | 228 | #define MEQ2_START(x) ((x) << 8) |
@@ -363,5 +381,155 @@ | |||
363 | #define ACK_FLUSH_CTL(x) ((x) << 6) | 381 | #define ACK_FLUSH_CTL(x) ((x) << 6) |
364 | #define SYNC_FLUSH_CTL (1 << 8) | 382 | #define SYNC_FLUSH_CTL (1 << 8) |
365 | 383 | ||
384 | #define CP_RB0_BASE 0xC100 | ||
385 | #define CP_RB0_CNTL 0xC104 | ||
386 | #define RB_BUFSZ(x) ((x) << 0) | ||
387 | #define RB_BLKSZ(x) ((x) << 8) | ||
388 | #define RB_NO_UPDATE (1 << 27) | ||
389 | #define RB_RPTR_WR_ENA (1 << 31) | ||
390 | #define BUF_SWAP_32BIT (2 << 16) | ||
391 | #define CP_RB0_RPTR_ADDR 0xC10C | ||
392 | #define CP_RB0_RPTR_ADDR_HI 0xC110 | ||
393 | #define CP_RB0_WPTR 0xC114 | ||
394 | #define CP_RB1_BASE 0xC180 | ||
395 | #define CP_RB1_CNTL 0xC184 | ||
396 | #define CP_RB1_RPTR_ADDR 0xC188 | ||
397 | #define CP_RB1_RPTR_ADDR_HI 0xC18C | ||
398 | #define CP_RB1_WPTR 0xC190 | ||
399 | #define CP_RB2_BASE 0xC194 | ||
400 | #define CP_RB2_CNTL 0xC198 | ||
401 | #define CP_RB2_RPTR_ADDR 0xC19C | ||
402 | #define CP_RB2_RPTR_ADDR_HI 0xC1A0 | ||
403 | #define CP_RB2_WPTR 0xC1A4 | ||
404 | #define CP_PFP_UCODE_ADDR 0xC150 | ||
405 | #define CP_PFP_UCODE_DATA 0xC154 | ||
406 | #define CP_ME_RAM_RADDR 0xC158 | ||
407 | #define CP_ME_RAM_WADDR 0xC15C | ||
408 | #define CP_ME_RAM_DATA 0xC160 | ||
409 | #define CP_DEBUG 0xC1FC | ||
410 | |||
411 | /* | ||
412 | * PM4 | ||
413 | */ | ||
414 | #define PACKET_TYPE0 0 | ||
415 | #define PACKET_TYPE1 1 | ||
416 | #define PACKET_TYPE2 2 | ||
417 | #define PACKET_TYPE3 3 | ||
418 | |||
419 | #define CP_PACKET_GET_TYPE(h) (((h) >> 30) & 3) | ||
420 | #define CP_PACKET_GET_COUNT(h) (((h) >> 16) & 0x3FFF) | ||
421 | #define CP_PACKET0_GET_REG(h) (((h) & 0xFFFF) << 2) | ||
422 | #define CP_PACKET3_GET_OPCODE(h) (((h) >> 8) & 0xFF) | ||
423 | #define PACKET0(reg, n) ((PACKET_TYPE0 << 30) | \ | ||
424 | (((reg) >> 2) & 0xFFFF) | \ | ||
425 | ((n) & 0x3FFF) << 16) | ||
426 | #define CP_PACKET2 0x80000000 | ||
427 | #define PACKET2_PAD_SHIFT 0 | ||
428 | #define PACKET2_PAD_MASK (0x3fffffff << 0) | ||
429 | |||
430 | #define PACKET2(v) (CP_PACKET2 | REG_SET(PACKET2_PAD, (v))) | ||
431 | |||
432 | #define PACKET3(op, n) ((PACKET_TYPE3 << 30) | \ | ||
433 | (((op) & 0xFF) << 8) | \ | ||
434 | ((n) & 0x3FFF) << 16) | ||
435 | |||
436 | /* Packet 3 types */ | ||
437 | #define PACKET3_NOP 0x10 | ||
438 | #define PACKET3_SET_BASE 0x11 | ||
439 | #define PACKET3_CLEAR_STATE 0x12 | ||
440 | #define PACKET3_INDEX_BUFFER_SIZE 0x13 | ||
441 | #define PACKET3_DEALLOC_STATE 0x14 | ||
442 | #define PACKET3_DISPATCH_DIRECT 0x15 | ||
443 | #define PACKET3_DISPATCH_INDIRECT 0x16 | ||
444 | #define PACKET3_INDIRECT_BUFFER_END 0x17 | ||
445 | #define PACKET3_SET_PREDICATION 0x20 | ||
446 | #define PACKET3_REG_RMW 0x21 | ||
447 | #define PACKET3_COND_EXEC 0x22 | ||
448 | #define PACKET3_PRED_EXEC 0x23 | ||
449 | #define PACKET3_DRAW_INDIRECT 0x24 | ||
450 | #define PACKET3_DRAW_INDEX_INDIRECT 0x25 | ||
451 | #define PACKET3_INDEX_BASE 0x26 | ||
452 | #define PACKET3_DRAW_INDEX_2 0x27 | ||
453 | #define PACKET3_CONTEXT_CONTROL 0x28 | ||
454 | #define PACKET3_DRAW_INDEX_OFFSET 0x29 | ||
455 | #define PACKET3_INDEX_TYPE 0x2A | ||
456 | #define PACKET3_DRAW_INDEX 0x2B | ||
457 | #define PACKET3_DRAW_INDEX_AUTO 0x2D | ||
458 | #define PACKET3_DRAW_INDEX_IMMD 0x2E | ||
459 | #define PACKET3_NUM_INSTANCES 0x2F | ||
460 | #define PACKET3_DRAW_INDEX_MULTI_AUTO 0x30 | ||
461 | #define PACKET3_INDIRECT_BUFFER 0x32 | ||
462 | #define PACKET3_STRMOUT_BUFFER_UPDATE 0x34 | ||
463 | #define PACKET3_DRAW_INDEX_OFFSET_2 0x35 | ||
464 | #define PACKET3_DRAW_INDEX_MULTI_ELEMENT 0x36 | ||
465 | #define PACKET3_WRITE_DATA 0x37 | ||
466 | #define PACKET3_MEM_SEMAPHORE 0x39 | ||
467 | #define PACKET3_MPEG_INDEX 0x3A | ||
468 | #define PACKET3_WAIT_REG_MEM 0x3C | ||
469 | #define PACKET3_MEM_WRITE 0x3D | ||
470 | #define PACKET3_SURFACE_SYNC 0x43 | ||
471 | # define PACKET3_CB0_DEST_BASE_ENA (1 << 6) | ||
472 | # define PACKET3_CB1_DEST_BASE_ENA (1 << 7) | ||
473 | # define PACKET3_CB2_DEST_BASE_ENA (1 << 8) | ||
474 | # define PACKET3_CB3_DEST_BASE_ENA (1 << 9) | ||
475 | # define PACKET3_CB4_DEST_BASE_ENA (1 << 10) | ||
476 | # define PACKET3_CB5_DEST_BASE_ENA (1 << 11) | ||
477 | # define PACKET3_CB6_DEST_BASE_ENA (1 << 12) | ||
478 | # define PACKET3_CB7_DEST_BASE_ENA (1 << 13) | ||
479 | # define PACKET3_DB_DEST_BASE_ENA (1 << 14) | ||
480 | # define PACKET3_CB8_DEST_BASE_ENA (1 << 15) | ||
481 | # define PACKET3_CB9_DEST_BASE_ENA (1 << 16) | ||
482 | # define PACKET3_CB10_DEST_BASE_ENA (1 << 17) | ||
483 | # define PACKET3_CB11_DEST_BASE_ENA (1 << 18) | ||
484 | # define PACKET3_FULL_CACHE_ENA (1 << 20) | ||
485 | # define PACKET3_TC_ACTION_ENA (1 << 23) | ||
486 | # define PACKET3_CB_ACTION_ENA (1 << 25) | ||
487 | # define PACKET3_DB_ACTION_ENA (1 << 26) | ||
488 | # define PACKET3_SH_ACTION_ENA (1 << 27) | ||
489 | # define PACKET3_SX_ACTION_ENA (1 << 28) | ||
490 | #define PACKET3_ME_INITIALIZE 0x44 | ||
491 | #define PACKET3_ME_INITIALIZE_DEVICE_ID(x) ((x) << 16) | ||
492 | #define PACKET3_COND_WRITE 0x45 | ||
493 | #define PACKET3_EVENT_WRITE 0x46 | ||
494 | #define PACKET3_EVENT_WRITE_EOP 0x47 | ||
495 | #define PACKET3_EVENT_WRITE_EOS 0x48 | ||
496 | #define PACKET3_PREAMBLE_CNTL 0x4A | ||
497 | # define PACKET3_PREAMBLE_BEGIN_CLEAR_STATE (2 << 28) | ||
498 | # define PACKET3_PREAMBLE_END_CLEAR_STATE (3 << 28) | ||
499 | #define PACKET3_ALU_PS_CONST_BUFFER_COPY 0x4C | ||
500 | #define PACKET3_ALU_VS_CONST_BUFFER_COPY 0x4D | ||
501 | #define PACKET3_ALU_PS_CONST_UPDATE 0x4E | ||
502 | #define PACKET3_ALU_VS_CONST_UPDATE 0x4F | ||
503 | #define PACKET3_ONE_REG_WRITE 0x57 | ||
504 | #define PACKET3_SET_CONFIG_REG 0x68 | ||
505 | #define PACKET3_SET_CONFIG_REG_START 0x00008000 | ||
506 | #define PACKET3_SET_CONFIG_REG_END 0x0000ac00 | ||
507 | #define PACKET3_SET_CONTEXT_REG 0x69 | ||
508 | #define PACKET3_SET_CONTEXT_REG_START 0x00028000 | ||
509 | #define PACKET3_SET_CONTEXT_REG_END 0x00029000 | ||
510 | #define PACKET3_SET_ALU_CONST 0x6A | ||
511 | /* alu const buffers only; no reg file */ | ||
512 | #define PACKET3_SET_BOOL_CONST 0x6B | ||
513 | #define PACKET3_SET_BOOL_CONST_START 0x0003a500 | ||
514 | #define PACKET3_SET_BOOL_CONST_END 0x0003a518 | ||
515 | #define PACKET3_SET_LOOP_CONST 0x6C | ||
516 | #define PACKET3_SET_LOOP_CONST_START 0x0003a200 | ||
517 | #define PACKET3_SET_LOOP_CONST_END 0x0003a500 | ||
518 | #define PACKET3_SET_RESOURCE 0x6D | ||
519 | #define PACKET3_SET_RESOURCE_START 0x00030000 | ||
520 | #define PACKET3_SET_RESOURCE_END 0x00038000 | ||
521 | #define PACKET3_SET_SAMPLER 0x6E | ||
522 | #define PACKET3_SET_SAMPLER_START 0x0003c000 | ||
523 | #define PACKET3_SET_SAMPLER_END 0x0003c600 | ||
524 | #define PACKET3_SET_CTL_CONST 0x6F | ||
525 | #define PACKET3_SET_CTL_CONST_START 0x0003cff0 | ||
526 | #define PACKET3_SET_CTL_CONST_END 0x0003ff0c | ||
527 | #define PACKET3_SET_RESOURCE_OFFSET 0x70 | ||
528 | #define PACKET3_SET_ALU_CONST_VS 0x71 | ||
529 | #define PACKET3_SET_ALU_CONST_DI 0x72 | ||
530 | #define PACKET3_SET_CONTEXT_REG_INDIRECT 0x73 | ||
531 | #define PACKET3_SET_RESOURCE_INDIRECT 0x74 | ||
532 | #define PACKET3_SET_APPEND_CNT 0x75 | ||
533 | |||
366 | #endif | 534 | #endif |
367 | 535 | ||