From: Vinod Koul <vkoul@kernel.org>
To: Abin Joseph <abin.joseph@amd.com>
Cc: michal.simek@amd.com, robh@kernel.org,
u.kleine-koenig@pengutronix.de, krzk+dt@kernel.org,
conor+dt@kernel.org, radhey.shyam.pandey@amd.com,
harini.katakam@amd.com, git@amd.com, dmaengine@vger.kernel.org,
devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] dmaengine: zynqmp_dma: Add support for AMD Versal Gen 2 DMA IP
Date: Mon, 5 Aug 2024 22:23:05 +0530 [thread overview]
Message-ID: <ZrEDcQLWCbKbCRaL@matsya> (raw)
In-Reply-To: <20240726062639.2609974-3-abin.joseph@amd.com>
On 26-07-24, 11:56, Abin Joseph wrote:
> ZynqMp DMA IP and AMD Versal Gen 2 DMA IP are similar but have different
> interrupt register offset. Create a dedicated compatible string to
> support Versal Gen 2 DMA IP with Irq register offset for interrupt
> Enable/Disable/Status/Mask functionality.
>
> Signed-off-by: Abin Joseph <abin.joseph@amd.com>
> ---
> drivers/dma/xilinx/zynqmp_dma.c | 17 +++++++++++++----
> 1 file changed, 13 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/dma/xilinx/zynqmp_dma.c b/drivers/dma/xilinx/zynqmp_dma.c
> index f31631bef961..a5d84d746929 100644
> --- a/drivers/dma/xilinx/zynqmp_dma.c
> +++ b/drivers/dma/xilinx/zynqmp_dma.c
> @@ -22,10 +22,10 @@
> #include "../dmaengine.h"
>
> /* Register Offsets */
> -#define ZYNQMP_DMA_ISR 0x100
> -#define ZYNQMP_DMA_IMR 0x104
> -#define ZYNQMP_DMA_IER 0x108
> -#define ZYNQMP_DMA_IDS 0x10C
> +#define ZYNQMP_DMA_ISR (chan->irq_offset + 0x100)
> +#define ZYNQMP_DMA_IMR (chan->irq_offset + 0x104)
> +#define ZYNQMP_DMA_IER (chan->irq_offset + 0x108)
> +#define ZYNQMP_DMA_IDS (chan->irq_offset + 0x10C)
Lower case please
> #define ZYNQMP_DMA_CTRL0 0x110
> #define ZYNQMP_DMA_CTRL1 0x114
> #define ZYNQMP_DMA_DATA_ATTR 0x120
> @@ -145,6 +145,9 @@
> #define tx_to_desc(tx) container_of(tx, struct zynqmp_dma_desc_sw, \
> async_tx)
>
> +/* IRQ Register offset for VersalGen2 */
> +#define IRQ_REG_OFFSET 0x308
> +
> /**
> * struct zynqmp_dma_desc_ll - Hw linked list descriptor
> * @addr: Buffer address
> @@ -211,6 +214,7 @@ struct zynqmp_dma_desc_sw {
> * @bus_width: Bus width
> * @src_burst_len: Source burst length
> * @dst_burst_len: Dest burst length
> + * @irq_offset: Irq register offset
> */
> struct zynqmp_dma_chan {
> struct zynqmp_dma_device *zdev;
> @@ -235,6 +239,7 @@ struct zynqmp_dma_chan {
> u32 bus_width;
> u32 src_burst_len;
> u32 dst_burst_len;
> + u32 irq_offset;
> };
>
> /**
> @@ -919,6 +924,9 @@ static int zynqmp_dma_chan_probe(struct zynqmp_dma_device *zdev,
> return -EINVAL;
> }
>
> + if (of_device_is_compatible(node, "amd,versal2-dma-1.0"))
> + chan->irq_offset = IRQ_REG_OFFSET;
This should be added as driver_data
> +
> chan->is_dmacoherent = of_property_read_bool(node, "dma-coherent");
> zdev->chan = chan;
> tasklet_setup(&chan->tasklet, zynqmp_dma_do_tasklet);
> @@ -1162,6 +1170,7 @@ static void zynqmp_dma_remove(struct platform_device *pdev)
>
> static const struct of_device_id zynqmp_dma_of_match[] = {
> { .compatible = "xlnx,zynqmp-dma-1.0", },
> + { .compatible = "amd,versal2-dma-1.0", },
> {}
> };
> MODULE_DEVICE_TABLE(of, zynqmp_dma_of_match);
> --
> 2.25.1
--
~Vinod
prev parent reply other threads:[~2024-08-05 16:53 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-26 6:26 [PATCH 0/2] Add support for ADMA Abin Joseph
2024-07-26 6:26 ` [PATCH 1/2] dt-bindings: dmaengine: zynqmp_dma: Add a new compatible string Abin Joseph
2024-07-26 9:13 ` Krzysztof Kozlowski
2024-07-26 6:26 ` [PATCH 2/2] dmaengine: zynqmp_dma: Add support for AMD Versal Gen 2 DMA IP Abin Joseph
2024-07-26 9:12 ` Krzysztof Kozlowski
2024-08-05 16:53 ` Vinod Koul [this message]
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=ZrEDcQLWCbKbCRaL@matsya \
--to=vkoul@kernel.org \
--cc=abin.joseph@amd.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dmaengine@vger.kernel.org \
--cc=git@amd.com \
--cc=harini.katakam@amd.com \
--cc=krzk+dt@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=michal.simek@amd.com \
--cc=radhey.shyam.pandey@amd.com \
--cc=robh@kernel.org \
--cc=u.kleine-koenig@pengutronix.de \
/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;
as well as URLs for NNTP newsgroup(s).