From: Troy Mitchell <troy.mitchell@linux.spacemit.com>
To: Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Paul Walmsley <pjw@kernel.org>,
Palmer Dabbelt <palmer@dabbelt.com>,
Albert Ou <aou@eecs.berkeley.edu>,
Alexandre Ghiti <alex@ghiti.fr>, Yixun Lan <dlan@kernel.org>,
Vinod Koul <vkoul@kernel.org>, Frank Li <Frank.Li@kernel.org>,
Guodong Xu <guodong@riscstar.com>,
Michael Turquette <mturquette@baylibre.com>,
Stephen Boyd <sboyd@kernel.org>
Cc: devicetree@vger.kernel.org, linux-riscv@lists.infradead.org,
spacemit@lists.linux.dev, linux-kernel@vger.kernel.org,
dmaengine@vger.kernel.org, linux-clk@vger.kernel.org,
Troy Mitchell <troy.mitchell@linux.spacemit.com>
Subject: [PATCH v2 5/7] dmaengine: mmp_pdma: add Spacemit K3 support
Date: Thu, 26 Mar 2026 16:17:20 +0800 [thread overview]
Message-ID: <20260326-k3-pdma-v2-5-ca94ca7bb595@linux.spacemit.com> (raw)
In-Reply-To: <20260326-k3-pdma-v2-0-ca94ca7bb595@linux.spacemit.com>
From: Guodong Xu <guodong@riscstar.com>
SpacemiT K3 reuses most of the PDMA IP design found on K1, with one difference
being the extended DRCMR base address. This patch adds "spacemit,k3-pdma"
compatible string and it defines a new mmp_pdma_ops for k3 pdma.
Signed-off-by: Guodong Xu <guodong@riscstar.com>
Signed-off-by: Troy Mitchell <troy.mitchell@linux.spacemit.com>
---
drivers/dma/mmp_pdma.c | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/drivers/dma/mmp_pdma.c b/drivers/dma/mmp_pdma.c
index 6112369006ee..386e85cd4882 100644
--- a/drivers/dma/mmp_pdma.c
+++ b/drivers/dma/mmp_pdma.c
@@ -52,6 +52,7 @@
#define DCSR_EORINTR BIT(9) /* The end of Receive */
#define DRCMR_BASE 0x0100
+#define DRCMR_EXT_BASE_K3 0x1000
#define DRCMR_EXT_BASE_DEFAULT 0x1100
#define DRCMR_REQ_LIMIT 64
#define DRCMR_MAPVLD BIT(7) /* Map Valid (read / write) */
@@ -1207,6 +1208,20 @@ static const struct mmp_pdma_ops spacemit_k1_pdma_ops = {
.drcmr_ext_base = DRCMR_EXT_BASE_DEFAULT,
};
+static const struct mmp_pdma_ops spacemit_k3_pdma_ops = {
+ .write_next_addr = write_next_addr_64,
+ .read_src_addr = read_src_addr_64,
+ .read_dst_addr = read_dst_addr_64,
+ .set_desc_next_addr = set_desc_next_addr_64,
+ .set_desc_src_addr = set_desc_src_addr_64,
+ .set_desc_dst_addr = set_desc_dst_addr_64,
+ .get_desc_src_addr = get_desc_src_addr_64,
+ .get_desc_dst_addr = get_desc_dst_addr_64,
+ .run_bits = (DCSR_RUN | DCSR_LPAEEN | DCSR_EORIRQEN | DCSR_EORSTOPEN),
+ .dma_width = 64,
+ .drcmr_ext_base = DRCMR_EXT_BASE_K3,
+};
+
static const struct of_device_id mmp_pdma_dt_ids[] = {
{
.compatible = "marvell,pdma-1.0",
@@ -1214,6 +1229,9 @@ static const struct of_device_id mmp_pdma_dt_ids[] = {
}, {
.compatible = "spacemit,k1-pdma",
.data = &spacemit_k1_pdma_ops
+ }, {
+ .compatible = "spacemit,k3-pdma",
+ .data = &spacemit_k3_pdma_ops
}, {
/* sentinel */
}
--
2.53.0
next prev parent reply other threads:[~2026-03-26 8:19 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-26 8:17 [PATCH v2 0/7] dmaengine: Add Peripheral DMA support for SpacemiT K3 SoC Troy Mitchell
2026-03-26 8:17 ` [PATCH v2 1/7] dt-bindings: dmaengine: Add SpacemiT K1 DMA request definitions Troy Mitchell
2026-03-27 7:27 ` Krzysztof Kozlowski
2026-03-28 9:46 ` Troy Mitchell
2026-03-27 7:28 ` Krzysztof Kozlowski
2026-03-28 9:48 ` Troy Mitchell
2026-03-26 8:17 ` [PATCH v2 2/7] dt-bindings: dmaengine: Add SpacemiT K3 DMA compatible string Troy Mitchell
2026-03-26 18:34 ` Conor Dooley
2026-03-27 7:04 ` Troy Mitchell
2026-03-26 8:17 ` [PATCH v2 3/7] dt-bindings: dmaengine: Add SpacemiT K3 DMA request definitions Troy Mitchell
2026-03-27 7:30 ` Krzysztof Kozlowski
2026-03-28 9:58 ` Troy Mitchell
2026-03-28 11:35 ` Krzysztof Kozlowski
2026-03-26 8:17 ` [PATCH v2 4/7] dmaengine: mmp_pdma: support variable extended DRCMR base Troy Mitchell
2026-03-26 8:17 ` Troy Mitchell [this message]
2026-03-26 8:17 ` [PATCH v2 6/7] clk: spacemit: k3: mark top_dclk as CLK_IS_CRITICAL Troy Mitchell
2026-03-26 8:17 ` [PATCH v2 7/7] riscv: dts: spacemit: Add PDMA controller node for K3 SoC Troy Mitchell
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=20260326-k3-pdma-v2-5-ca94ca7bb595@linux.spacemit.com \
--to=troy.mitchell@linux.spacemit.com \
--cc=Frank.Li@kernel.org \
--cc=alex@ghiti.fr \
--cc=aou@eecs.berkeley.edu \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dlan@kernel.org \
--cc=dmaengine@vger.kernel.org \
--cc=guodong@riscstar.com \
--cc=krzk+dt@kernel.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=mturquette@baylibre.com \
--cc=palmer@dabbelt.com \
--cc=pjw@kernel.org \
--cc=robh@kernel.org \
--cc=sboyd@kernel.org \
--cc=spacemit@lists.linux.dev \
--cc=vkoul@kernel.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