aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu
diff options
context:
space:
mode:
authorKen Wang <Qingqing.Wang@amd.com>2016-03-18 03:41:42 -0400
committerAlex Deucher <alexander.deucher@amd.com>2017-03-29 23:54:34 -0400
commit39807b939e2ca619d57eb9cae31f7d70a36392ed (patch)
treee2ebf7a3f969578dc3d8fd87413c6a6dbf58ddc2 /drivers/gpu/drm/amd/amdgpu
parentd0e95758e3b122c5fea63ce5c3898dcc5e5ea846 (diff)
drm/amdgpu: add 64bit doorbell assignments
Signed-off-by: Ken Wang <Qingqing.Wang@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu.h68
1 files changed, 68 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
index 4b92f36e18e6..75525980a5a2 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
@@ -618,6 +618,74 @@ struct amdgpu_doorbell {
618 u32 num_doorbells; /* Number of doorbells actually reserved for amdgpu. */ 618 u32 num_doorbells; /* Number of doorbells actually reserved for amdgpu. */
619}; 619};
620 620
621/*
622 * 64bit doorbell, offset are in QWORD, occupy 2KB doorbell space
623 */
624typedef enum _AMDGPU_DOORBELL64_ASSIGNMENT
625{
626 /*
627 * All compute related doorbells: kiq, hiq, diq, traditional compute queue, user queue, should locate in
628 * a continues range so that programming CP_MEC_DOORBELL_RANGE_LOWER/UPPER can cover this range.
629 * Compute related doorbells are allocated from 0x00 to 0x8a
630 */
631
632
633 /* kernel scheduling */
634 AMDGPU_DOORBELL64_KIQ = 0x00,
635
636 /* HSA interface queue and debug queue */
637 AMDGPU_DOORBELL64_HIQ = 0x01,
638 AMDGPU_DOORBELL64_DIQ = 0x02,
639
640 /* Compute engines */
641 AMDGPU_DOORBELL64_MEC_RING0 = 0x03,
642 AMDGPU_DOORBELL64_MEC_RING1 = 0x04,
643 AMDGPU_DOORBELL64_MEC_RING2 = 0x05,
644 AMDGPU_DOORBELL64_MEC_RING3 = 0x06,
645 AMDGPU_DOORBELL64_MEC_RING4 = 0x07,
646 AMDGPU_DOORBELL64_MEC_RING5 = 0x08,
647 AMDGPU_DOORBELL64_MEC_RING6 = 0x09,
648 AMDGPU_DOORBELL64_MEC_RING7 = 0x0a,
649
650 /* User queue doorbell range (128 doorbells) */
651 AMDGPU_DOORBELL64_USERQUEUE_START = 0x0b,
652 AMDGPU_DOORBELL64_USERQUEUE_END = 0x8a,
653
654 /* Graphics engine */
655 AMDGPU_DOORBELL64_GFX_RING0 = 0x8b,
656
657 /*
658 * Other graphics doorbells can be allocated here: from 0x8c to 0xef
659 * Graphics voltage island aperture 1
660 * default non-graphics QWORD index is 0xF0 - 0xFF inclusive
661 */
662
663 /* sDMA engines */
664 AMDGPU_DOORBELL64_sDMA_ENGINE0 = 0xF0,
665 AMDGPU_DOORBELL64_sDMA_HI_PRI_ENGINE0 = 0xF1,
666 AMDGPU_DOORBELL64_sDMA_ENGINE1 = 0xF2,
667 AMDGPU_DOORBELL64_sDMA_HI_PRI_ENGINE1 = 0xF3,
668
669 /* Interrupt handler */
670 AMDGPU_DOORBELL64_IH = 0xF4, /* For legacy interrupt ring buffer */
671 AMDGPU_DOORBELL64_IH_RING1 = 0xF5, /* For page migration request log */
672 AMDGPU_DOORBELL64_IH_RING2 = 0xF6, /* For page migration translation/invalidation log */
673
674 /* VCN engine */
675 AMDGPU_DOORBELL64_VCN0 = 0xF8,
676 AMDGPU_DOORBELL64_VCN1 = 0xF9,
677 AMDGPU_DOORBELL64_VCN2 = 0xFA,
678 AMDGPU_DOORBELL64_VCN3 = 0xFB,
679 AMDGPU_DOORBELL64_VCN4 = 0xFC,
680 AMDGPU_DOORBELL64_VCN5 = 0xFD,
681 AMDGPU_DOORBELL64_VCN6 = 0xFE,
682 AMDGPU_DOORBELL64_VCN7 = 0xFF,
683
684 AMDGPU_DOORBELL64_MAX_ASSIGNMENT = 0xFF,
685 AMDGPU_DOORBELL64_INVALID = 0xFFFF
686} AMDGPU_DOORBELL64_ASSIGNMENT;
687
688
621void amdgpu_doorbell_get_kfd_info(struct amdgpu_device *adev, 689void amdgpu_doorbell_get_kfd_info(struct amdgpu_device *adev,
622 phys_addr_t *aperture_base, 690 phys_addr_t *aperture_base,
623 size_t *aperture_size, 691 size_t *aperture_size,