mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2] dmaengine: mmp_pdma: fix wrong extended DRCMR base for SpacemiT K3
@ 2026-07-27  8:26 Troy Mitchell
  2026-08-14 20:17 ` Frank Li
  2026-09-03 16:29 ` Vinod Koul
  0 siblings, 2 replies; 3+ messages in thread
From: Troy Mitchell @ 2026-07-27  8:26 UTC (permalink / raw)
  To: Vinod Koul, Frank Li, Yixun Lan, Guodong Xu
  Cc: dmaengine, linux-kernel, linux-riscv, spacemit, Troy Mitchell,
	Paul Walmsley, Palmer Dabbelt, Albert Ou, Alexandre Ghiti

The extended DRCMR window on SpacemiT K3 starts at 0x1100. Commit
6587b8661a0b ("dmaengine: mmp_pdma: add SpacemiT K3 support") incorrectly
set it to 0x1000, causing DRCMR accesses for request IDs >= 64 to target
offsets 0x100 too low.

The 0x1100 base has been verified on K3 silicon using real SPI and QSPI
DMA transactions. The K3 DMA documentation [1] was updated on June 24,
2026, to reflect the corrected register addresses.

Drop the bogus DRCMR_EXT_BASE_K3 macro and reuse
DRCMR_EXT_BASE_DEFAULT for the K3 ops.

Fixes: 6587b8661a0b ("dmaengine: mmp_pdma: add SpacemiT K3 support")
Link: https://www.spacemit.com/community/document/info?nodepath=hardware/key_stone/k3/k3_docs/k3_usermanual/16_peripherals/dma.md&lang=en [1]
Signed-off-by: Troy Mitchell <troy.mitchell@linux.spacemit.com>
---
This is a minimal fix for the wrong DRCMR_EXT_BASE_K3 value introduced
by commit 6587b8661a0b ("dmaengine: mmp_pdma: add SpacemiT K3 support").
K3 silicon uses 0x1100 as the extended DRCMR base, so the K3 ops now
reuse DRCMR_EXT_BASE_DEFAULT.

I deliberately kept the per-ops drcmr_ext_base field and the
DRCMR_EXT_BASE_DEFAULT macro to preserve the extensibility that was
introduced together with the helper refactor, in case a future PDMA
variant ends up using a different extended base. If reviewers prefer
to drop this abstraction entirely and collapse it back to a single
constant now that all known users share the same value, I am happy to
send a v3 that removes the drcmr_ext_base ops field as a cleanup.
---
Changes in v2:
- Reword the commit message to remove the inaccurate K1 comparison.
- Mention successful SPI and QSPI DMA tests on K3 silicon in the commit
  message.
- Add a link to the corrected K3 DMA documentation, updated June 24,
  2026.
- Link to v1: https://patch.msgid.link/20260615-k3-pdma-fix-drcmr-base-v1-1-ee1af124199f@linux.spacemit.com

To: Vinod Koul <vkoul@kernel.org>
To: Frank Li <Frank.Li@kernel.org>
To: Yixun Lan <dlan@kernel.org>
To: Guodong Xu <guodong@riscstar.com>
To: Troy Mitchell <troy.mitchell@linux.spacemit.com>
To: Paul Walmsley <pjw@kernel.org>
To: Palmer Dabbelt <palmer@dabbelt.com>
To: Albert Ou <aou@eecs.berkeley.edu>
To: Alexandre Ghiti <alex@ghiti.fr>
Cc: dmaengine@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Cc: linux-riscv@lists.infradead.org
Cc: spacemit@lists.linux.dev
---
 drivers/dma/mmp_pdma.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/dma/mmp_pdma.c b/drivers/dma/mmp_pdma.c
index 386e85cd4882..78e3e07e681d 100644
--- a/drivers/dma/mmp_pdma.c
+++ b/drivers/dma/mmp_pdma.c
@@ -52,7 +52,6 @@
 #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) */
@@ -1219,7 +1218,7 @@ static const struct mmp_pdma_ops spacemit_k3_pdma_ops = {
 	.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,
+	.drcmr_ext_base = DRCMR_EXT_BASE_DEFAULT,
 };
 
 static const struct of_device_id mmp_pdma_dt_ids[] = {

---
base-commit: c425609d6ac4012c8bbf01ec2e10e801b1923a7b
change-id: 20260615-k3-pdma-fix-drcmr-base-326536770427

Best regards,
--  
Troy Mitchell <troy.mitchell@linux.spacemit.com>


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] dmaengine: mmp_pdma: fix wrong extended DRCMR base for SpacemiT K3
  2026-07-27  8:26 [PATCH v2] dmaengine: mmp_pdma: fix wrong extended DRCMR base for SpacemiT K3 Troy Mitchell
@ 2026-08-14 20:17 ` Frank Li
  2026-09-03 16:29 ` Vinod Koul
  1 sibling, 0 replies; 3+ messages in thread
From: Frank Li @ 2026-08-14 20:17 UTC (permalink / raw)
  To: Troy Mitchell
  Cc: Vinod Koul, Frank Li, Yixun Lan, Guodong Xu, dmaengine,
	linux-kernel, linux-riscv, spacemit, Paul Walmsley,
	Palmer Dabbelt, Albert Ou, Alexandre Ghiti

On Mon, Jul 27, 2026 at 01:26:15AM -0700, Troy Mitchell wrote:
> The extended DRCMR window on SpacemiT K3 starts at 0x1100. Commit
> 6587b8661a0b ("dmaengine: mmp_pdma: add SpacemiT K3 support") incorrectly
> set it to 0x1000, causing DRCMR accesses for request IDs >= 64 to target
> offsets 0x100 too low.
>
> The 0x1100 base has been verified on K3 silicon using real SPI and QSPI
> DMA transactions. The K3 DMA documentation [1] was updated on June 24,
> 2026, to reflect the corrected register addresses.
>
> Drop the bogus DRCMR_EXT_BASE_K3 macro and reuse
> DRCMR_EXT_BASE_DEFAULT for the K3 ops.
>
> Fixes: 6587b8661a0b ("dmaengine: mmp_pdma: add SpacemiT K3 support")
> Link: https://www.spacemit.com/community/document/info?nodepath=hardware/key_stone/k3/k3_docs/k3_usermanual/16_peripherals/dma.md&lang=en [1]
> Signed-off-by: Troy Mitchell <troy.mitchell@linux.spacemit.com>
> ---

Reviewed-by: Frank Li <Frank.Li@nxp.com>

> This is a minimal fix for the wrong DRCMR_EXT_BASE_K3 value introduced
> by commit 6587b8661a0b ("dmaengine: mmp_pdma: add SpacemiT K3 support").
> K3 silicon uses 0x1100 as the extended DRCMR base, so the K3 ops now
> reuse DRCMR_EXT_BASE_DEFAULT.
>
> I deliberately kept the per-ops drcmr_ext_base field and the
> DRCMR_EXT_BASE_DEFAULT macro to preserve the extensibility that was
> introduced together with the helper refactor, in case a future PDMA
> variant ends up using a different extended base. If reviewers prefer
> to drop this abstraction entirely and collapse it back to a single
> constant now that all known users share the same value, I am happy to
> send a v3 that removes the drcmr_ext_base ops field as a cleanup.
> ---
> Changes in v2:
> - Reword the commit message to remove the inaccurate K1 comparison.
> - Mention successful SPI and QSPI DMA tests on K3 silicon in the commit
>   message.
> - Add a link to the corrected K3 DMA documentation, updated June 24,
>   2026.
> - Link to v1: https://patch.msgid.link/20260615-k3-pdma-fix-drcmr-base-v1-1-ee1af124199f@linux.spacemit.com
>
> To: Vinod Koul <vkoul@kernel.org>
> To: Frank Li <Frank.Li@kernel.org>
> To: Yixun Lan <dlan@kernel.org>
> To: Guodong Xu <guodong@riscstar.com>
> To: Troy Mitchell <troy.mitchell@linux.spacemit.com>
> To: Paul Walmsley <pjw@kernel.org>
> To: Palmer Dabbelt <palmer@dabbelt.com>
> To: Albert Ou <aou@eecs.berkeley.edu>
> To: Alexandre Ghiti <alex@ghiti.fr>
> Cc: dmaengine@vger.kernel.org
> Cc: linux-kernel@vger.kernel.org
> Cc: linux-riscv@lists.infradead.org
> Cc: spacemit@lists.linux.dev
> ---
>  drivers/dma/mmp_pdma.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/dma/mmp_pdma.c b/drivers/dma/mmp_pdma.c
> index 386e85cd4882..78e3e07e681d 100644
> --- a/drivers/dma/mmp_pdma.c
> +++ b/drivers/dma/mmp_pdma.c
> @@ -52,7 +52,6 @@
>  #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) */
> @@ -1219,7 +1218,7 @@ static const struct mmp_pdma_ops spacemit_k3_pdma_ops = {
>  	.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,
> +	.drcmr_ext_base = DRCMR_EXT_BASE_DEFAULT,
>  };
>
>  static const struct of_device_id mmp_pdma_dt_ids[] = {
>
> ---
> base-commit: c425609d6ac4012c8bbf01ec2e10e801b1923a7b
> change-id: 20260615-k3-pdma-fix-drcmr-base-326536770427
>
> Best regards,
> --
> Troy Mitchell <troy.mitchell@linux.spacemit.com>
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] dmaengine: mmp_pdma: fix wrong extended DRCMR base for SpacemiT K3
  2026-07-27  8:26 [PATCH v2] dmaengine: mmp_pdma: fix wrong extended DRCMR base for SpacemiT K3 Troy Mitchell
  2026-08-14 20:17 ` Frank Li
@ 2026-09-03 16:29 ` Vinod Koul
  1 sibling, 0 replies; 3+ messages in thread
From: Vinod Koul @ 2026-09-03 16:29 UTC (permalink / raw)
  To: Frank Li, Yixun Lan, Guodong Xu, Troy Mitchell
  Cc: dmaengine, linux-kernel, linux-riscv, spacemit, Paul Walmsley,
	Palmer Dabbelt, Albert Ou, Alexandre Ghiti


On Mon, 27 Jul 2026 01:26:15 -0700, Troy Mitchell wrote:
> The extended DRCMR window on SpacemiT K3 starts at 0x1100. Commit
> 6587b8661a0b ("dmaengine: mmp_pdma: add SpacemiT K3 support") incorrectly
> set it to 0x1000, causing DRCMR accesses for request IDs >= 64 to target
> offsets 0x100 too low.
> 
> The 0x1100 base has been verified on K3 silicon using real SPI and QSPI
> DMA transactions. The K3 DMA documentation [1] was updated on June 24,
> 2026, to reflect the corrected register addresses.
> 
> [...]

Applied, thanks!

[1/1] dmaengine: mmp_pdma: fix wrong extended DRCMR base for SpacemiT K3
      commit: d1fc569fcbc7be6de06b034cf954a95e30ca1fb2

Best regards,
-- 
~Vinod



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-09-03 16:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-07-27  8:26 [PATCH v2] dmaengine: mmp_pdma: fix wrong extended DRCMR base for SpacemiT K3 Troy Mitchell
2026-08-14 20:17 ` Frank Li
2026-09-03 16:29 ` Vinod Koul

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®