All of lore.kernel.org
 help / color / mirror / Atom feed
From: Frank Li <Frank.li@oss.nxp.com>
To: s-adivi@ti.com
Cc: Vignesh Raghavendra <vigneshr@ti.com>,
	Vinod Koul <vkoul@kernel.org>, Frank Li <Frank.Li@kernel.org>,
	Peter Ujfalusi <peter.ujfalusi@ti.com>,
	Nishanth Menon <nm@ti.com>,
	Santosh Shilimkar <ssantosh@kernel.org>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org,
	sebin.francis@ti.com
Subject: Re: [PATCH v13 17/20] dmaengine: ti: k3-udma-v2: New driver for K3 BCDMA_V2
Date: Thu, 3 Dec 2026 16:13:46 -0600	[thread overview]
Message-ID: <axHpmhtX_9hYPVHU@SMW015318> (raw)
In-Reply-To: <20261124-dma-upstream-v13-v13-17-bd4251fdc6d4@ti.com>

On Tue, Nov 24, 2026 at 05:15:19PM +0530, Sai Sree Kartheek Adivi via B4 Relay wrote:
> [You don't often get email from devnull+s-adivi.ti.com@kernel.org. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
>
> From: Sai Sree Kartheek Adivi <s-adivi@ti.com>
>
> Add support for BCDMA_V2.
>
> The BCDMA_V2 is different than the existing BCDMA supported by the
> k3-udma driver.
>
> The changes in BCDMA_V2 are:
> - Autopair: There is no longer a need for PSIL pair and AUTOPAIR bit
>   needs to set in the RT_CTL register.
> - Static channel mapping: Each channel is mapped to a single peripheral.
> - Direct IRQs: There is no INT-A and interrupt lines from DMA are
>   directly connected to GIC.
> - Remote side configuration is otherwise handled by DMA, so PEER
>   register writes are not needed for START / PAUSE, but a PEER register
>   FLUSH write is still required during TEARDOWN as a hardware
>   workaround.
> - Unified Channel Space: Tx and Rx channels share a single register
>   space. Each channel index is specifically fixed in hardware as either
>   Tx or Rx in an interleaved manner.
>
> Also, since a version member is introduced in the match_data, Add
> version v1 in match_data of SoCs using v1 DMA.
>
> Reviewed-by: Vignesh Raghavendra <vigneshr@ti.com>
> Signed-off-by: Sai Sree Kartheek Adivi <s-adivi@ti.com>
> ---
>  drivers/dma/ti/Kconfig            |   15 +-
>  drivers/dma/ti/Makefile           |    1 +
>  drivers/dma/ti/k3-udma-common.c   |  132 +++-
>  drivers/dma/ti/k3-udma-v2.c       | 1377 +++++++++++++++++++++++++++++++++++++
>  drivers/dma/ti/k3-udma.c          |    9 +
>  drivers/dma/ti/k3-udma.h          |  124 ++--
>  include/linux/soc/ti/k3-ringacc.h |    3 +
>  7 files changed, 1586 insertions(+), 75 deletions(-)
>
> diff --git a/drivers/dma/ti/Kconfig b/drivers/dma/ti/Kconfig
> index a389ae04ec930..e6a2cf37062e7 100644
> --- a/drivers/dma/ti/Kconfig
> +++ b/drivers/dma/ti/Kconfig
> @@ -49,6 +49,19 @@ config TI_K3_UDMA
>           Enable support for the TI UDMA (Unified DMA) controller. This
>           DMA engine is used in AM65x and j721e.
>
> +config TI_K3_UDMA_V2
> +       tristate "Texas Instruments K3 UDMA v2 support"
> +       depends on ARCH_K3 || COMPILE_TEST
> +       depends on TI_SCI_INTA_IRQCHIP
> +       select DMA_ENGINE
> +       select DMA_VIRTUAL_CHANNELS
> +       select TI_K3_UDMA_COMMON
> +       select TI_K3_RINGACC
> +       select TI_K3_PSIL
> +        help
> +         Enable support for the TI UDMA (Unified DMA) v2 controller. This
> +         DMA engine is used in AM62L.
> +
>  config TI_K3_UDMA_COMMON
>         tristate
>
> @@ -62,7 +75,7 @@ config TI_K3_UDMA_GLUE_LAYER
>
>  config TI_K3_PSIL
>         tristate
> -       default TI_K3_UDMA
> +       default TI_K3_UDMA || TI_K3_UDMA_V2
>
>  config TI_DMA_CROSSBAR
>         bool
> diff --git a/drivers/dma/ti/Makefile b/drivers/dma/ti/Makefile
> index 41bfba944dc6c..296aa3421e71b 100644
> --- a/drivers/dma/ti/Makefile
> +++ b/drivers/dma/ti/Makefile
> @@ -3,6 +3,7 @@ obj-$(CONFIG_TI_CPPI41) += cppi41.o
>  obj-$(CONFIG_TI_EDMA) += edma.o
>  obj-$(CONFIG_DMA_OMAP) += omap-dma.o
>  obj-$(CONFIG_TI_K3_UDMA) += k3-udma.o
> +obj-$(CONFIG_TI_K3_UDMA_V2) += k3-udma-v2.o
>  obj-$(CONFIG_TI_K3_UDMA_COMMON) += k3-udma-common.o
>  obj-$(CONFIG_TI_K3_UDMA_GLUE_LAYER) += k3-udma-glue.o
>  k3-psil-lib-objs := k3-psil.o \
> diff --git a/drivers/dma/ti/k3-udma-common.c b/drivers/dma/ti/k3-udma-common.c
> index ff5c9aedaecf3..42d918c6ba168 100644
> --- a/drivers/dma/ti/k3-udma-common.c
> +++ b/drivers/dma/ti/k3-udma-common.c
> @@ -178,8 +178,13 @@ bool udma_is_desc_really_done(struct udma_chan *uc, struct udma_desc *d)
>             uc->config.dir != DMA_MEM_TO_DEV || !(uc->config.tx_flags & DMA_PREP_INTERRUPT))
>                 return true;
>
> -       peer_bcnt = udma_tchanrt_read(uc, UDMA_CHAN_RT_PEER_BCNT_REG);
> -       bcnt = udma_tchanrt_read(uc, UDMA_CHAN_RT_BCNT_REG);
> +       if (uc->ud->match_data->version == K3_UDMA_V1) {
> +               peer_bcnt = udma_tchanrt_read(uc, UDMA_CHAN_RT_PEER_BCNT_REG);
> +               bcnt = udma_tchanrt_read(uc, UDMA_CHAN_RT_BCNT_REG);
> +       } else {
> +               peer_bcnt = udma_chanrt_read(uc, UDMA_CHAN_RT_PERIPH_BCNT_REG);
> +               bcnt = udma_chanrt_read(uc, UDMA_CHAN_RT_BCNT_REG);
> +       }

use callback other method, don't check K3_UDMA_V1, incase V<n> change again
to make compare complex.

>
>         /* Transfer is incomplete, store current residue and time stamp */
>         if (peer_bcnt < bcnt) {
> @@ -326,6 +331,7 @@ udma_prep_slave_sg_tr(struct udma_chan *uc, struct scatterlist *sgl,
>         size_t tr_size;
>         int num_tr = 0;
>         int tr_idx = 0;
> +       u32 extra_flags = 0;
>         u64 asel;
>
>         /* estimate the number of TRs we will need */
> @@ -349,6 +355,16 @@ udma_prep_slave_sg_tr(struct udma_chan *uc, struct scatterlist *sgl,
>         else
>                 asel = (u64)uc->config.asel << K3_ADDRESS_ASEL_SHIFT;
>
> +       /*
> +        * BCDMA V2 stalls and stops processing further TRs if a TR's ICNT0
> +        * is not a multiple of 16 bytes. Setting EOP on every TR (not just
> +        * the last one) avoids that stall condition. Intentional, not a bug.
> +        */
> +       if (uc->ud->match_data->type == DMA_TYPE_BCDMA &&
> +           uc->ud->match_data->version == K3_UDMA_V2 &&

Add new field at match_data, to avoid complex check and direct use

	extra_flags = uc->ud->match_data->extra_flags;

check others, avoid direct check version number

Frank

  parent reply	other threads:[~2026-12-03 22:13 UTC|newest]

Thread overview: 59+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-24 11:45 [PATCH v13 00/20] dmaengine: ti: Add support for BCDMA v2 and PKTDMA v2 Sai Sree Kartheek Adivi
2026-11-24 11:45 ` Sai Sree Kartheek Adivi via B4 Relay
2026-11-24 11:45 ` [PATCH v13 01/20] dmaengine: ti: k3-udma: Fix sporadic crash on AM62x Sai Sree Kartheek Adivi
2026-11-24 11:45   ` Sai Sree Kartheek Adivi via B4 Relay
2026-11-24 11:52   ` sashiko-bot
2026-11-24 11:45 ` [PATCH v13 02/20] dmaengine: ti: k3-udma: move macros to header file Sai Sree Kartheek Adivi
2026-11-24 11:45   ` Sai Sree Kartheek Adivi via B4 Relay
2026-11-24 11:45 ` [PATCH v13 03/20] dmaengine: ti: k3-udma: move structs and enums " Sai Sree Kartheek Adivi
2026-11-24 11:45   ` Sai Sree Kartheek Adivi via B4 Relay
2026-11-24 11:45 ` [PATCH v13 04/20] dmaengine: ti: k3-udma: move static inline helper functions " Sai Sree Kartheek Adivi
2026-11-24 11:45   ` Sai Sree Kartheek Adivi via B4 Relay
2026-11-24 11:45 ` [PATCH v13 05/20] dmaengine: ti: k3-udma: move descriptor management to k3-udma-common.c Sai Sree Kartheek Adivi
2026-11-24 11:45   ` Sai Sree Kartheek Adivi via B4 Relay
2026-11-24 12:15   ` sashiko-bot
2026-12-03 21:51   ` Frank Li
2026-11-24 11:45 ` [PATCH v13 06/20] dmaengine: ti: k3-udma: move ring management functions " Sai Sree Kartheek Adivi
2026-11-24 11:45   ` Sai Sree Kartheek Adivi via B4 Relay
2026-11-24 11:45 ` [PATCH v13 07/20] dmaengine: ti: k3-udma: Add variant-specific function pointers to udma_dev Sai Sree Kartheek Adivi
2026-11-24 11:45   ` Sai Sree Kartheek Adivi via B4 Relay
2026-11-24 11:45 ` [PATCH v13 08/20] dmaengine: ti: k3-udma: move udma utility functions to k3-udma-common.c Sai Sree Kartheek Adivi
2026-11-24 11:45   ` Sai Sree Kartheek Adivi via B4 Relay
2026-11-24 12:01   ` sashiko-bot
2026-12-03 21:53   ` Frank Li
2026-11-24 11:45 ` [PATCH v13 09/20] dmaengine: ti: k3-udma: move resource management " Sai Sree Kartheek Adivi
2026-11-24 11:45   ` Sai Sree Kartheek Adivi via B4 Relay
2026-12-03 21:54   ` Frank Li
2026-11-24 11:45 ` [PATCH v13 10/20] dmaengine: ti: k3-udma: refactor resource setup functions Sai Sree Kartheek Adivi
2026-11-24 11:45   ` Sai Sree Kartheek Adivi via B4 Relay
2026-11-24 11:53   ` sashiko-bot
2026-12-03 21:55   ` Frank Li
2026-11-24 11:45 ` [PATCH v13 11/20] dmaengine: ti: k3-udma: move inclusion of k3-udma-private.c to k3-udma-common.c Sai Sree Kartheek Adivi
2026-11-24 11:45   ` Sai Sree Kartheek Adivi via B4 Relay
2026-12-03 21:56   ` Frank Li
2026-11-24 11:45 ` [PATCH v13 12/20] dmaengine: ti: k3-udma: pin owning module while glue clients hold a udma_dev Sai Sree Kartheek Adivi
2026-11-24 11:45   ` Sai Sree Kartheek Adivi via B4 Relay
2026-12-03 21:59   ` Frank Li
2026-11-24 11:45 ` [PATCH v13 13/20] drivers: soc: ti: k3-ringacc: handle absence of tisci Sai Sree Kartheek Adivi
2026-11-24 11:45   ` Sai Sree Kartheek Adivi via B4 Relay
2026-11-24 12:00   ` sashiko-bot
2026-12-03 22:02   ` Frank Li
2026-11-24 11:45 ` [PATCH v13 14/20] dt-bindings: dma: ti: Add K3 BCDMA V2 Sai Sree Kartheek Adivi
2026-11-24 11:45   ` Sai Sree Kartheek Adivi via B4 Relay
2026-11-24 11:45 ` [PATCH v13 15/20] dt-bindings: dma: ti: Add K3 PKTDMA V2 Sai Sree Kartheek Adivi
2026-11-24 11:45   ` Sai Sree Kartheek Adivi via B4 Relay
2026-11-24 11:45 ` [PATCH v13 16/20] dmaengine: ti: k3-psil-am62l: Add AM62Lx PSIL and PDMA data Sai Sree Kartheek Adivi
2026-11-24 11:45   ` Sai Sree Kartheek Adivi via B4 Relay
2026-11-24 12:02   ` sashiko-bot
2026-12-03 22:06   ` Frank Li
2026-11-24 11:45 ` [PATCH v13 17/20] dmaengine: ti: k3-udma-v2: New driver for K3 BCDMA_V2 Sai Sree Kartheek Adivi
2026-11-24 11:45   ` Sai Sree Kartheek Adivi via B4 Relay
2026-11-24 12:17   ` sashiko-bot
2026-12-03 22:13   ` Frank Li [this message]
2026-11-24 11:45 ` [PATCH v13 18/20] dmaengine: ti: k3-udma-v2: Add support for PKTDMA V2 Sai Sree Kartheek Adivi
2026-11-24 11:45   ` Sai Sree Kartheek Adivi via B4 Relay
2026-11-24 12:15   ` sashiko-bot
2026-11-24 11:45 ` [PATCH v13 19/20] dmaengine: ti: k3-udma-v2: Update glue layer to support " Sai Sree Kartheek Adivi
2026-11-24 11:45   ` Sai Sree Kartheek Adivi via B4 Relay
2026-11-24 11:45 ` [PATCH v13 20/20] dmaengine: ti: k3-udma: Validate resource ID and fix logging in reservation Sai Sree Kartheek Adivi
2026-11-24 11:45   ` Sai Sree Kartheek Adivi 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=axHpmhtX_9hYPVHU@SMW015318 \
    --to=frank.li@oss.nxp.com \
    --cc=Frank.Li@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dmaengine@vger.kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nm@ti.com \
    --cc=peter.ujfalusi@ti.com \
    --cc=robh@kernel.org \
    --cc=s-adivi@ti.com \
    --cc=sebin.francis@ti.com \
    --cc=ssantosh@kernel.org \
    --cc=vigneshr@ti.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.