From: Frank Li <Frank.li@nxp.com>
To: Larisa Grigore <larisa.grigore@oss.nxp.com>
Cc: dmaengine@vger.kernel.org, imx@lists.linux.dev,
linux-kernel@vger.kernel.org, s32@nxp.com,
Christophe Lizzi <clizzi@redhat.com>,
Alberto Ruiz <aruizrui@redhat.com>,
Enric Balletbo <eballetb@redhat.com>
Subject: Re: [PATCH 4/8] dmaengine: fsl-edma: add eDMAv3 registers to edma_regs
Date: Mon, 16 Dec 2024 11:18:00 -0500 [thread overview]
Message-ID: <Z2BSuA/3V655k2bX@lizhi-Precision-Tower-5810> (raw)
In-Reply-To: <20241216075819.2066772-5-larisa.grigore@oss.nxp.com>
On Mon, Dec 16, 2024 at 09:58:14AM +0200, Larisa Grigore wrote:
> Add edma3_regs to match eDMAv3 new register layout for manage page (MP).
> Introduce helper function fsl_edma3_setup_regs() to initialize the
> edma_regs for eDMAv3, which pave the road to support S32 chips.
>
> Signed-off-by: Larisa Grigore <larisa.grigore@oss.nxp.com>
> ---
Reviewed-by: Frank Li <Frank.Li@nxp.com>
> drivers/dma/fsl-edma-common.c | 15 +++++++++++++++
> drivers/dma/fsl-edma-common.h | 11 ++++++++++-
> drivers/dma/fsl-edma-main.c | 8 +++++---
> 3 files changed, 30 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/dma/fsl-edma-common.c b/drivers/dma/fsl-edma-common.c
> index b132a88dfdec..62d51b269e54 100644
> --- a/drivers/dma/fsl-edma-common.c
> +++ b/drivers/dma/fsl-edma-common.c
> @@ -44,6 +44,11 @@
> #define EDMA64_ERRH 0x28
> #define EDMA64_ERRL 0x2c
>
> +#define EDMA_V3_MP_CSR 0x00
> +#define EDMA_V3_MP_ES 0x04
> +#define EDMA_V3_MP_INT 0x08
> +#define EDMA_V3_MP_HRS 0x0C
> +
> void fsl_edma_tx_chan_handler(struct fsl_edma_chan *fsl_chan)
> {
> spin_lock(&fsl_chan->vchan.lock);
> @@ -904,4 +909,14 @@ void fsl_edma_setup_regs(struct fsl_edma_engine *edma)
> }
> }
>
> +void fsl_edma3_setup_regs(struct fsl_edma_engine *edma)
> +{
> + struct edma_regs *regs = &edma->regs;
> +
> + regs->cr = edma->membase + EDMA_V3_MP_CSR;
> + regs->es = edma->membase + EDMA_V3_MP_ES;
> + regs->v3.is = edma->membase + EDMA_V3_MP_INT;
> + regs->v3.hrs = edma->membase + EDMA_V3_MP_HRS;
> +}
> +
> MODULE_LICENSE("GPL v2");
> diff --git a/drivers/dma/fsl-edma-common.h b/drivers/dma/fsl-edma-common.h
> index f1362daaa347..52901623d6fc 100644
> --- a/drivers/dma/fsl-edma-common.h
> +++ b/drivers/dma/fsl-edma-common.h
> @@ -139,10 +139,18 @@ struct edma2_regs {
> void __iomem *errl;
> };
>
> +struct edma3_regs {
> + void __iomem *is;
> + void __iomem *hrs;
> +};
> +
> struct edma_regs {
> void __iomem *cr;
> void __iomem *es;
> - struct edma2_regs v2;
> + union {
> + struct edma2_regs v2;
> + struct edma3_regs v3;
> + };
> };
>
> struct fsl_edma_sw_tcd {
> @@ -491,5 +499,6 @@ int fsl_edma_alloc_chan_resources(struct dma_chan *chan);
> void fsl_edma_free_chan_resources(struct dma_chan *chan);
> void fsl_edma_cleanup_vchan(struct dma_device *dmadev);
> void fsl_edma_setup_regs(struct fsl_edma_engine *edma);
> +void fsl_edma3_setup_regs(struct fsl_edma_engine *edma);
>
> #endif /* _FSL_EDMA_COMMON_H_ */
> diff --git a/drivers/dma/fsl-edma-main.c b/drivers/dma/fsl-edma-main.c
> index 0b89c31bf38c..cc1787698b56 100644
> --- a/drivers/dma/fsl-edma-main.c
> +++ b/drivers/dma/fsl-edma-main.c
> @@ -495,10 +495,12 @@ static int fsl_edma_probe(struct platform_device *pdev)
> if (IS_ERR(fsl_edma->membase))
> return PTR_ERR(fsl_edma->membase);
>
> - if (!(drvdata->flags & FSL_EDMA_DRV_SPLIT_REG)) {
> + if (!(drvdata->flags & FSL_EDMA_DRV_SPLIT_REG))
> fsl_edma_setup_regs(fsl_edma);
> - regs = &fsl_edma->regs;
> - }
> + else
> + fsl_edma3_setup_regs(fsl_edma);
> +
> + regs = &fsl_edma->regs;
>
> if (drvdata->flags & FSL_EDMA_DRV_HAS_DMACLK) {
> fsl_edma->dmaclk = devm_clk_get_enabled(&pdev->dev, "dma");
> --
> 2.47.0
>
next prev parent reply other threads:[~2024-12-16 16:18 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-16 7:58 [PATCH 0/8] Add eDMAv3 support for S32G2/S32G3 SoCs Larisa Grigore
2024-12-16 7:58 ` [PATCH 1/8] dmaengine: fsl-edma: select of_dma_xlate based on the dmamuxs presence Larisa Grigore
2024-12-16 16:16 ` Frank Li
2024-12-17 14:28 ` Larisa Ileana Grigore
2024-12-16 7:58 ` [PATCH 2/8] dmaengine: fsl-edma: remove FSL_EDMA_DRV_SPLIT_REG check when parsing muxbase Larisa Grigore
2024-12-16 16:17 ` Frank Li
2024-12-16 7:58 ` [PATCH 3/8] dmaengine: fsl-edma: move eDMAv2 related registers to a new structure ’edma2_regs’ Larisa Grigore
2024-12-16 16:17 ` Frank Li
2024-12-17 14:27 ` Larisa Ileana Grigore
2024-12-16 7:58 ` [PATCH 4/8] dmaengine: fsl-edma: add eDMAv3 registers to edma_regs Larisa Grigore
2024-12-16 16:18 ` Frank Li [this message]
2024-12-16 7:58 ` [PATCH 5/8] dt-bindings: dma: fsl-edma: add nxp,s32g2-edma compatible string Larisa Grigore
2024-12-16 16:18 ` Frank Li
2024-12-17 5:26 ` Krzysztof Kozlowski
2024-12-17 14:26 ` Larisa Ileana Grigore
2024-12-16 7:58 ` [PATCH 6/8] dmaengine: fsl-edma: add support for S32G based platforms Larisa Grigore
2024-12-16 16:20 ` Frank Li
2024-12-16 7:58 ` [PATCH 7/8] dmaengine: fsl-edma: wait until no hardware request is in progress Larisa Grigore
2024-12-17 5:27 ` Krzysztof Kozlowski
2024-12-17 14:19 ` Larisa Ileana Grigore
2024-12-17 15:27 ` Krzysztof Kozlowski
2024-12-18 13:24 ` Larisa Ileana Grigore
2024-12-18 13:32 ` Krzysztof Kozlowski
2024-12-18 13:38 ` Larisa Ileana Grigore
2024-12-18 14:10 ` Krzysztof Kozlowski
2024-12-18 15:39 ` Frank Li
2024-12-16 7:58 ` [PATCH 8/8] dmaengine: fsl-edma: read/write multiple registers in cyclic transactions Larisa Grigore
2024-12-16 16:09 ` [PATCH 0/8] Add eDMAv3 support for S32G2/S32G3 SoCs Frank Li
2024-12-16 16:22 ` Frank Li
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=Z2BSuA/3V655k2bX@lizhi-Precision-Tower-5810 \
--to=frank.li@nxp.com \
--cc=aruizrui@redhat.com \
--cc=clizzi@redhat.com \
--cc=dmaengine@vger.kernel.org \
--cc=eballetb@redhat.com \
--cc=imx@lists.linux.dev \
--cc=larisa.grigore@oss.nxp.com \
--cc=linux-kernel@vger.kernel.org \
--cc=s32@nxp.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