From: Nathan Lynch via B4 Relay <devnull+nathan.lynch.amd.com@kernel.org>
To: Vinod Koul <vkoul@kernel.org>
Cc: Wei Huang <wei.huang2@amd.com>,
Mario Limonciello <mario.limonciello@amd.com>,
Bjorn Helgaas <bhelgaas@google.com>,
linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org,
dmaengine@vger.kernel.org
Subject: [PATCH RFC 04/13] dmaengine: sdxi: Add MMIO register definitions
Date: Fri, 05 Sep 2025 13:48:27 -0500 [thread overview]
Message-ID: <20250905-sdxi-base-v1-4-d0341a1292ba@amd.com> (raw)
In-Reply-To: <20250905-sdxi-base-v1-0-d0341a1292ba@amd.com>
From: Nathan Lynch <nathan.lynch@amd.com>
Add offsets and bitmasks for:
* General control and status registers (MMIO_CTL0, MMIO_CTL2,
MMIO_STS0)
* Capability registers (MMIO_CAP0, MMIO_CAP1)
* Context table pointer register (MMIO_CXT_L2)
* Error logging control and status registers (MMIO_ERR_CTL,
MMIO_ERR_STS, MMIO_ERR_CFG, MMIO_ERR_WRT, MMIO_ERR_RD)
This is a useful subset of the MMIO registers and fields defined in
the spec. The driver currently does not use MMIO_VERSION,
MMIO_GRP_ENUM, or the mailbox registers.
Co-developed-by: Wei Huang <wei.huang2@amd.com>
Signed-off-by: Wei Huang <wei.huang2@amd.com>
Signed-off-by: Nathan Lynch <nathan.lynch@amd.com>
---
drivers/dma/sdxi/mmio.h | 92 +++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 92 insertions(+)
diff --git a/drivers/dma/sdxi/mmio.h b/drivers/dma/sdxi/mmio.h
new file mode 100644
index 0000000000000000000000000000000000000000..36d174a1f8859055f7808d520de1ff193c49ae26
--- /dev/null
+++ b/drivers/dma/sdxi/mmio.h
@@ -0,0 +1,92 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+/*
+ * SDXI MMIO register offsets and layouts.
+ *
+ * Copyright (C) 2025 Advanced Micro Devices, Inc.
+ */
+
+#ifndef DMA_SDXI_MMIO_H
+#define DMA_SDXI_MMIO_H
+
+#include <linux/bits.h>
+#include <linux/compiler_attributes.h>
+#include <linux/compiler_types.h>
+#include <linux/types.h>
+
+/* Refer to "MMIO Control Registers". */
+enum sdxi_reg {
+ SDXI_MMIO_CTL0 = 0x00000,
+ SDXI_MMIO_CTL2 = 0x00010,
+ SDXI_MMIO_STS0 = 0x00100,
+ SDXI_MMIO_CAP0 = 0x00200,
+ SDXI_MMIO_CAP1 = 0x00208,
+ SDXI_MMIO_VERSION = 0x00210,
+ SDXI_MMIO_CXT_L2 = 0x10000,
+ SDXI_MMIO_RKEY = 0x10100,
+ SDXI_MMIO_ERR_CTL = 0x20000,
+ SDXI_MMIO_ERR_STS = 0x20008,
+ SDXI_MMIO_ERR_CFG = 0x20010,
+ SDXI_MMIO_ERR_WRT = 0x20020,
+ SDXI_MMIO_ERR_RD = 0x20028,
+};
+
+enum {
+ /* SDXI_MMIO_CTL0 fields */
+ SDXI_MMIO_CTL0_FN_GSR = GENMASK_ULL(1, 0),
+ SDXI_MMIO_CTL0_FN_PASID_VL = BIT_ULL(2),
+ SDXI_MMIO_CTL0_FN_ERR_INTR_EN = BIT_ULL(4),
+ SDXI_MMIO_CTL0_FN_PASID = GENMASK_ULL(27, 8),
+ SDXI_MMIO_CTL0_FN_GRP_ID = GENMASK_ULL(63, 32),
+
+ /* SDXI_MMIO_CTL2 fields */
+ SDXI_MMIO_CTL2_MAX_BUFFER = GENMASK_ULL(3, 0),
+ SDXI_MMIO_CTL2_MAX_AKEY_SZ = GENMASK_ULL(15, 12),
+ SDXI_MMIO_CTL2_MAX_CXT = GENMASK_ULL(31, 16),
+ SDXI_MMIO_CTL2_OPB_000_AVL = GENMASK_ULL(63, 32),
+
+ /* SDXI_MMIO_STS0 bit definitions */
+ SDXI_MMIO_STS0_FN_GSV = GENMASK_ULL(2, 0),
+
+ /* SDXI_MMIO_CAP0 bit definitions */
+ SDXI_MMIO_CAP0_SFUNC = GENMASK_ULL(15, 0),
+ SDXI_MMIO_CAP0_DB_STRIDE = GENMASK_ULL(22, 20),
+ SDXI_MMIO_CAP0_MAX_DS_RING_SZ = GENMASK_ULL(28, 24),
+
+ /* SDXI_MMIO_CAP1 fields */
+ SDXI_MMIO_CAP1_MAX_BUFFER = GENMASK_ULL(3, 0),
+ SDXI_MMIO_CAP1_RKEY_CAP = BIT_ULL(4),
+ SDXI_MMIO_CAP1_RM = BIT_ULL(5),
+ SDXI_MMIO_CAP1_MMIO64 = BIT_ULL(6),
+ SDXI_MMIO_CAP1_MAX_ERRLOG_SZ = GENMASK_ULL(11, 8),
+ SDXI_MMIO_CAP1_MAX_AKEY_SZ = GENMASK_ULL(15, 12),
+ SDXI_MMIO_CAP1_MAX_CXT = GENMASK_ULL(31, 16),
+ SDXI_MMIO_CAP1_OPB_000_CAP = GENMASK_ULL(63, 32),
+
+ /* SDXI_MMIO_VERSION fields */
+ SDXI_MMIO_VERSION_MINOR = GENMASK_ULL(7, 0),
+ SDXI_MMIO_VERSION_MAJOR = GENMASK_ULL(23, 16),
+
+ /* SDXI_MMIO_CXT_L2 fields */
+ SDXI_MMIO_CXT_L2_PTR = GENMASK_ULL(63, 12),
+
+ /* SDXI_MMIO_ERR_CFG bit definitions */
+ SDXI_MMIO_ERR_CFG_PTR = GENMASK_ULL(63, 12),
+ SDXI_MMIO_ERR_CFG_SZ = GENMASK_ULL(5, 1),
+ SDXI_MMIO_ERR_CFG_EN = BIT_ULL(0),
+
+ /* SDXI_MMIO_RKEY bit definitions */
+ SDXI_MMIO_RKEY_PTR = GENMASK_ULL(63, 12),
+ SDXI_MMIO_RKEY_SZ = GENMASK_ULL(4, 1),
+ SDXI_MMIO_RKEY_EN = BIT_ULL(0),
+
+ /* SDXI_MMIO_ERR_CTL bit definitions */
+ SDXI_MMIO_ERR_CTL_EN = BIT_ULL(0),
+
+ /* SDXI_MMIO_ERR_STS bit definitions. */
+ SDXI_MMIO_ERR_STS_STS_BIT = BIT_ULL(0),
+ SDXI_MMIO_ERR_STS_OVF_BIT = BIT_ULL(1),
+ SDXI_MMIO_ERR_STS_ERR_BIT = BIT_ULL(3),
+};
+
+#endif /* DMA_SDXI_MMIO_H */
--
2.39.5
next prev parent reply other threads:[~2025-09-05 18:48 UTC|newest]
Thread overview: 43+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-05 18:48 [PATCH RFC 00/13] dmaengine: Smart Data Accelerator Interface (SDXI) basic support Nathan Lynch via B4 Relay
2025-09-05 18:48 ` [PATCH RFC 01/13] PCI: Add SNIA SDXI accelerator sub-class Nathan Lynch via B4 Relay
2025-09-15 17:25 ` Bjorn Helgaas
2025-09-15 20:17 ` Nathan Lynch
2025-09-05 18:48 ` [PATCH RFC 02/13] dmaengine: sdxi: Add control structure definitions Nathan Lynch via B4 Relay
2025-09-05 18:48 ` [PATCH RFC 03/13] dmaengine: sdxi: Add descriptor encoding and unit tests Nathan Lynch via B4 Relay
2025-09-15 11:52 ` Jonathan Cameron
2025-09-15 19:30 ` Nathan Lynch
2025-09-16 14:20 ` Jonathan Cameron
2025-09-16 19:06 ` Nathan Lynch
2025-09-05 18:48 ` Nathan Lynch via B4 Relay [this message]
2025-09-05 18:48 ` [PATCH RFC 05/13] dmaengine: sdxi: Add software data structures Nathan Lynch via B4 Relay
2025-09-15 11:59 ` Jonathan Cameron
2025-09-16 19:07 ` Nathan Lynch
2025-09-16 9:38 ` Markus Elfring
2025-09-05 18:48 ` [PATCH RFC 06/13] dmaengine: sdxi: Add error reporting support Nathan Lynch via B4 Relay
2025-09-15 12:11 ` Jonathan Cameron
2025-09-15 20:42 ` Nathan Lynch
2025-09-16 14:23 ` Jonathan Cameron
2025-09-05 18:48 ` [PATCH RFC 07/13] dmaengine: sdxi: Import descriptor enqueue code from spec Nathan Lynch via B4 Relay
2025-09-15 12:18 ` Jonathan Cameron
2025-09-16 17:05 ` [External] : " ALOK TIWARI
2025-09-05 18:48 ` [PATCH RFC 08/13] dmaengine: sdxi: Context creation/removal, descriptor submission Nathan Lynch via B4 Relay
2025-09-15 14:12 ` Jonathan Cameron
2025-09-16 20:40 ` Nathan Lynch
2025-09-17 13:34 ` Jonathan Cameron
2025-09-15 19:42 ` Markus Elfring
2025-09-05 18:48 ` [PATCH RFC 09/13] dmaengine: sdxi: Add core device management code Nathan Lynch via B4 Relay
2025-09-15 14:23 ` Jonathan Cameron
2025-09-16 21:23 ` Nathan Lynch
2025-09-05 18:48 ` [PATCH RFC 10/13] dmaengine: sdxi: Add PCI driver support Nathan Lynch via B4 Relay
2025-09-05 19:14 ` Mario Limonciello
2025-09-10 15:25 ` Nathan Lynch
2025-09-05 20:05 ` Bjorn Helgaas
2025-09-10 15:28 ` Nathan Lynch
2025-09-15 15:03 ` Jonathan Cameron
2025-09-16 16:43 ` [External] : " ALOK TIWARI
2025-09-05 18:48 ` [PATCH RFC 11/13] dmaengine: sdxi: Add DMA engine provider Nathan Lynch via B4 Relay
2025-09-15 15:16 ` Jonathan Cameron
2025-09-05 18:48 ` [PATCH RFC 12/13] dmaengine: sdxi: Add Kconfig and Makefile Nathan Lynch via B4 Relay
2025-09-15 15:08 ` Jonathan Cameron
2025-09-15 16:44 ` Nathan Lynch
2025-09-05 18:48 ` [PATCH RFC 13/13] MAINTAINERS: Add entry for SDXI driver Nathan Lynch via B4 Relay
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=20250905-sdxi-base-v1-4-d0341a1292ba@amd.com \
--to=devnull+nathan.lynch.amd.com@kernel.org \
--cc=bhelgaas@google.com \
--cc=dmaengine@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=mario.limonciello@amd.com \
--cc=nathan.lynch@amd.com \
--cc=vkoul@kernel.org \
--cc=wei.huang2@amd.com \
/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