AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Alexandre Demers <alexandre.f.demers@gmail.com>
To: amd-gfx@lists.freedesktop.org
Subject: [PATCH 08/18] drm/amdgpu: add missing DMA defines, shifts and masks
Date: Mon, 17 Mar 2025 02:06:52 -0400	[thread overview]
Message-ID: <20250317060702.5297-9-alexandre.f.demers@gmail.com> (raw)
In-Reply-To: <20250317060702.5297-1-alexandre.f.demers@gmail.com>

Signed-off-by: Alexandre Demers <alexandre.f.demers@gmail.com>
---
 .../drm/amd/include/asic_reg/oss/oss_1_0_d.h  | 21 +++++++--
 .../include/asic_reg/oss/oss_1_0_sh_mask.h    | 43 +++++++++++++++++++
 2 files changed, 61 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/amd/include/asic_reg/oss/oss_1_0_d.h b/drivers/gpu/drm/amd/include/asic_reg/oss/oss_1_0_d.h
index edc8a793a95d..8edd6c871e1b 100644
--- a/drivers/gpu/drm/amd/include/asic_reg/oss/oss_1_0_d.h
+++ b/drivers/gpu/drm/amd/include/asic_reg/oss/oss_1_0_d.h
@@ -234,6 +234,24 @@
 #define mmIH_RB_WPTR_ADDR_HI 0x0F84
 #define mmIH_RB_WPTR_ADDR_LO 0x0F85
 #define mmIH_STATUS 0x0F88
+
+#define mmDMA_GFX_RB_CNTL                                       0x3400
+#define mmDMA_GFX_RB_BASE                                       0x3401
+#define mmDMA_GFX_RB_RPTR                                       0x3402
+#define mmDMA_GFX_RB_WPTR                                       0x3403
+#define mmDMA_GFX_RB_RPTR_ADDR_HI                               0x3407
+#define mmDMA_GFX_RB_RPTR_ADDR_LO                               0x3408
+#define mmDMA_GFX_IB_CNTL                                       0x3409
+#define mmDMA_GFX_IB_RPTR                                       0x340a
+#define mmDMA_CNTL                                          0x340b
+#define mmDMA_STATUS_REG                                    0x340D
+#define mmDMA_TILING_CONFIG  				  0x342E
+#define	mmDMA_POWER_CNTL					0x342F
+#define	mmDMA_CLK_CTRL					0x3430
+#define	mmDMA_PG						0x3435
+#define	mmDMA_PGFSM_CONFIG				0x3436
+#define	mmDMA_PGFSM_WRITE					0x3437
+
 #define mmSEM_MAILBOX 0x0F9B
 #define mmSEM_MAILBOX_CLIENTCONFIG 0x0F9A
 #define mmSEM_MAILBOX_CONTROL 0x0F9C
@@ -269,7 +287,4 @@
 #define mmVCE_CONFIG 0x0F94
 #define mmXDMA_MSTR_MEM_OVERFLOW_CNTL 0x03F8
 
-/* from the old sid.h */
-#define mmDMA_TILING_CONFIG 0x342E
-
 #endif
diff --git a/drivers/gpu/drm/amd/include/asic_reg/oss/oss_1_0_sh_mask.h b/drivers/gpu/drm/amd/include/asic_reg/oss/oss_1_0_sh_mask.h
index 1c540fe136cb..12c6c39d93d0 100644
--- a/drivers/gpu/drm/amd/include/asic_reg/oss/oss_1_0_sh_mask.h
+++ b/drivers/gpu/drm/amd/include/asic_reg/oss/oss_1_0_sh_mask.h
@@ -823,6 +823,45 @@
 #define LX3__RESERVED__SHIFT 0x00000000
 #define RINGOSC_MASK__MASK_MASK 0x0000ffffL
 #define RINGOSC_MASK__MASK__SHIFT 0x00000000
+
+#define DMA_CNTL__TRAP_ENABLE_MASK 0x00000001L	// (1 << 0)
+#define DMA_CNTL__TRAP_ENABLE__SHIFT 0x00000000
+#define DMA_CNTL__SEM_INCOMPLETE_INT_ENABLE_MASK 0x00000002L	// (1 << 1)
+#define DMA_CNTL__SEM_INCOMPLETE_INT_ENABLE__SHIFT 0x00000001
+#define DMA_CNTL__SEM_WAIT_INT_ENABLE_MASK 0x00000004L	// (1 << 2)
+#define DMA_CNTL__SEM_WAIT_INT_ENABLE__SHIFT 0x00000002
+#define DMA_CNTL__DATA_SWAP_ENABLE_MASK 0x00000008L	// (1 << 3)
+#define DMA_CNTL__DATA_SWAP_ENABLE__SHIFT 0x00000003
+#define DMA_CNTL__FENCE_SWAP_ENABLE_MASK 0x00000010L	// (1 << 4)
+#define DMA_CNTL__FENCE_SWAP_ENABLE__SHIFT 0x00000004
+#define DMA_CNTL__CTXEMPTY_INT_ENABLE_MASK 0x10000000L	// (1 << 28)
+#define DMA_CNTL__CTXEMPTY_INT_ENABLE__SHIFT 0x0000001C
+#define DMA_GFX_RB_CNTL__RB_ENABLE_MASK 0x00000001L	// (1 << 0)
+#define DMA_GFX_RB_CNTL__RB_ENABLE__SHIFT 0x00000000
+// #define DMA_GFX_RB_CNTL__RB_SIZE_MASK 0x00000001L	// undefined
+#define DMA_GFX_RB_CNTL__RB_SIZE__SHIFT 0x00000001	// ((x) << 1) /* log2 */
+#define DMA_GFX_RB_CNTL__RB_SWAP_ENABLE_MASK 0x00000200L	// (1 << 9) /* 8IN32 */
+#define DMA_GFX_RB_CNTL__RB_SWAP_ENABLE__SHIFT 0x00000009
+#define DMA_GFX_RB_CNTL__RPTR_WRITEBACK_ENABLE_MASK 0x00001000L	// (1 << 12)
+#define DMA_GFX_RB_CNTL__RPTR_WRITEBACK_ENABLE__SHIFT 0x0000000C
+#define DMA_GFX_RB_CNTL__RPTR_WRITEBACK_SWAP_ENABLE_MASK 0x00002000L	// (1 << 13)  /* 8IN32 */
+#define DMA_GFX_RB_CNTL__RPTR_WRITEBACK_SWAP_ENABLE__SHIFT 0x0000000D
+// #define DMA_GFX_RB_CNTL__RPTR_WRITEBACK_TIMER_MASK 0x00000001L	// undefined
+#define DMA_GFX_RB_CNTL__RPTR_WRITEBACK_TIMER__SHIFT 0x00000010	// ((x) << 16) /* log2 */
+#define DMA_GFX_IB_CNTL__IB_ENABLE_MASK 0x00000001L	// (1 << 0)
+#define DMA_GFX_IB_CNTL__IB_ENABLE__SHIFT 0x00000000
+#define DMA_GFX_IB_CNTL__IB_SWAP_ENABLE_MASK 0x00000010L	// (1 << 4)
+#define DMA_GFX_IB_CNTL__IB_SWAP_ENABLE__SHIFT 0x00000004
+#define DMA_GFX_IB_CNTL__CMD_VMID_FORCE_MASK 0x80000000L	// (1 << 31)
+#define DMA_GFX_IB_CNTL__CMD_VMID_FORCE__SHIFT 0x0000001F
+
+#define DMA_STATUS_REG__IDLE_MASK 0x00000001L	// (1 << 0)
+#define DMA_STATUS_REG__IDLE__SHIFT 0x00000000
+#define DMA_POWER_CNTL__MEM_POWER_OVERRIDE_MASK 0x00000100L	// (1 << 8)
+#define DMA_POWER_CNTL__MEM_POWER_OVERRIDE__SHIFT 0x00000008
+#define DMA_PG__PG_CNTL_ENABLE_MASK 0x00000001L	// (1 << 0)
+#define DMA_PG__PG_CNTL_ENABLE__SHIFT 0x00000000
+
 #define SEM_MAILBOX_CLIENTCONFIG__CP_CLIENT0_MASK 0x00000007L
 #define SEM_MAILBOX_CLIENTCONFIG__CP_CLIENT0__SHIFT 0x00000000
 #define SEM_MAILBOX_CLIENTCONFIG__CP_CLIENT1_MASK 0x00000038L
@@ -1015,6 +1054,10 @@
 #define SRBM_STATUS2__VCE_BUSY__SHIFT 0x00000007
 #define SRBM_STATUS2__VCE_RQ_PENDING_MASK 0x00000008L
 #define SRBM_STATUS2__VCE_RQ_PENDING__SHIFT 0x00000003
+#define SRBM_STATUS2__DMA_BUSY_MASK 0x00000020L
+#define SRBM_STATUS2__DMA_BUSY__SHIFT 0x00000005
+#define SRBM_STATUS2__DMA1_BUSY_MASK 0x00000040L
+#define SRBM_STATUS2__DMA1_BUSY__SHIFT 0x00000006
 #define SRBM_STATUS2__XDMA_BUSY_MASK 0x00000100L
 #define SRBM_STATUS2__XDMA_BUSY__SHIFT 0x00000008
 #define SRBM_STATUS2__XSP_BUSY_MASK 0x00000010L
-- 
2.48.1


  parent reply	other threads:[~2025-03-17  6:07 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-17  6:06 [PATCH 00/18] Properly wire defines, shifts and masks in SI and cleanup Alexandre Demers
2025-03-17  6:06 ` [PATCH 01/18] drm/amdgpu: move GFX6 defines into gfx_v6_0.c Alexandre Demers
2025-03-17  6:06 ` [PATCH 02/18] drm/amdgpu: wire up defines, shifts and masks through SI code Alexandre Demers
2025-03-17  6:06 ` [PATCH 03/18] drm/amdgpu: use proper defines, shifts and masks in DCE6 code Alexandre Demers
2025-03-17 14:58   ` Alex Deucher
2025-03-17  6:06 ` [PATCH 04/18] drm/amdgpu: remove PACKET3 duplicated defines from si_enums.h Alexandre Demers
2025-03-17  6:06 ` [PATCH 05/18] drm/admgpu: move si_ih.c away from sid.h defines Alexandre Demers
2025-03-17  6:06 ` [PATCH 06/18] drm/amdgpu: use GRPH_SECONDARY_SURFACE_ADDRESS_MASK with GRPH_SECONDARY_SURFACE_ADDRESS in DCE6 Alexandre Demers
2025-03-17  6:06 ` [PATCH 07/18] drm/amdgpu: move DCE6 away from sid.h and si_enums.h defines Alexandre Demers
2025-03-17  6:06 ` Alexandre Demers [this message]
2025-03-17  6:06 ` [PATCH 09/18] drm/amdgpu: add missing GFX6 defines Alexandre Demers
2025-03-17  6:06 ` [PATCH 10/18] drm/amdgpu: add missing SMU6 defines, shifts and masks Alexandre Demers
2025-03-17  6:06 ` [PATCH 11/18] drm/pm/legacy-dpm: move SI away from sid.h and si_enums.h Alexandre Demers
2025-03-17 15:04   ` Alex Deucher
2025-03-19 20:19     ` Alexandre Demers
2025-03-17  6:06 ` [PATCH 12/18] drm/amdgpu: fix GFX6 variables for sid.h cleanup Alexandre Demers
2025-03-17 15:06   ` Alex Deucher
2025-03-17  6:06 ` [PATCH 13/18] drm/amdgpu: move si.c away from sid.h Alexandre Demers
2025-03-17  6:06 ` [PATCH 14/18] drm/amdgpu: move si_dma.c away from sid.h and si_enums.h Alexandre Demers
2025-03-17  6:06 ` [PATCH 15/18] drm/amdgpu: huge sid.h cleanup, drop substituted defines Alexandre Demers
2025-03-17  6:07 ` [PATCH 16/18] drm/amdgpu: keep removing sid.h dependency from si_dma.c Alexandre Demers
2025-03-17  6:07 ` [PATCH 17/18] drm/amdgpu: cleanup DCE6 a bit more Alexandre Demers
2025-03-17  6:07 ` [PATCH 18/18] drm/amdgpu: continue cleaning up sid.h and si_enums.h Alexandre Demers
  -- strict thread matches above, loose matches on Subject: below --
2025-03-22  1:46 [PATCH 00/18] Properly wire defines, shifts and masks in SI and cleanup Alexandre Demers
2025-03-22  1:46 ` [PATCH 08/18] drm/amdgpu: add missing DMA defines, shifts and masks Alexandre Demers

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250317060702.5297-9-alexandre.f.demers@gmail.com \
    --to=alexandre.f.demers@gmail.com \
    --cc=amd-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox