mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Lizhi Hou <lizhi.hou@amd.com>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: <vkoul@kernel.org>, <dmaengine@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>, <max.zhen@amd.com>,
	<sonal.santan@amd.com>, <larry.liu@amd.com>, <brian.xu@amd.com>,
	<tumic@gpxsee.org>
Subject: Re: [RESEND PATCH V12 XDMA 1/2] dmaengine: xilinx: xdma: Add xilinx xdma driver
Date: Tue, 21 Feb 2023 19:46:33 -0800	[thread overview]
Message-ID: <2ec1a8e8-6e85-4873-c1d1-61427b83a6ac@amd.com> (raw)
In-Reply-To: <CAMuHMdXsUPAW5zKrsaTR9Tgv7kFdkz8s_QUjLXq6zDpoo47fRA@mail.gmail.com>


On 2/21/23 05:25, Geert Uytterhoeven wrote:
> Hi Lizhi,
>
> On Thu, Feb 9, 2023 at 8:18 PM Lizhi Hou <lizhi.hou@amd.com> wrote:
>> Add driver to enable PCIe board which uses XDMA (the DMA/Bridge Subsystem
>> for PCI Express). For example, Xilinx Alveo PCIe devices.
>>      https://www.xilinx.com/products/boards-and-kits/alveo.html
>>
>> The XDMA engine support up to 4 Host to Card (H2C) and 4 Card to Host (C2H)
>> channels. Memory transfers are specified on a per-channel basis in
>> descriptor linked lists, which the DMA fetches from host memory and
>> processes. Events such as descriptor completion and errors are signaled
>> using interrupts. The hardware detail is provided by
>>      https://docs.xilinx.com/r/en-US/pg195-pcie-dma/Introduction
>>
>> This driver implements dmaengine APIs.
>>      - probe the available DMA channels
>>      - use dma_slave_map for channel lookup
>>      - use virtual channel to manage dmaengine tx descriptors
>>      - implement device_prep_slave_sg callback to handle host scatter gather
>>        list
>>      - implement device_config to config device address for DMA transfer
>>
>> Signed-off-by: Lizhi Hou <lizhi.hou@amd.com>
>> Signed-off-by: Sonal Santan <sonal.santan@amd.com>
>> Signed-off-by: Max Zhen <max.zhen@amd.com>
>> Signed-off-by: Brian Xu <brian.xu@amd.com>
>> Tested-by: Martin Tuma <tumic@gpxsee.org>
> Thanks for your patch, which is now commit 17ce252266c7f016
> ("dmaengine: xilinx: xdma: Add xilinx xdma driver") in dmaengine/next.
>
>> --- a/drivers/dma/Kconfig
>> +++ b/drivers/dma/Kconfig
>> @@ -735,6 +735,20 @@ config XILINX_DMA
>>            the scatter gather interface with multiple channels independent
>>            configuration support.
>>
>> +config XILINX_XDMA
>> +       tristate "Xilinx DMA/Bridge Subsystem DMA Engine"
>> +       depends on HAS_IOMEM
>> +       select DMA_ENGINE
>> +       select DMA_VIRTUAL_CHANNELS
>> +       select REGMAP_MMIO
> No platform dependencies at all, while this is a platform driver that
> relies on some other not-yet-existing driver creating an "xdma"
> platform device?
>
>> +       help
>> +         Enable support for Xilinx DMA/Bridge Subsystem DMA engine. The DMA
>> +         provides high performance block data movement between Host memory
>> +         and the DMA subsystem. These direct memory transfers can be both in
>> +         the Host to Card (H2C) and Card to Host (C2H) transfers.
>> +         The core also provides up to 16 user interrupt wires that generate
>> +         interrupts to the host.
>> +
>>   config XILINX_ZYNQMP_DMA
>>          tristate "Xilinx ZynqMP DMA Engine"
>>          depends on ARCH_ZYNQ || MICROBLAZE || ARM64 || COMPILE_TEST
>> --- /dev/null
>> +++ b/drivers/dma/xilinx/xdma.c
>> +/**
>> + * xdma_probe - Driver probe function
>> + * @pdev: Pointer to the platform_device structure
>> + */
>> +static int xdma_probe(struct platform_device *pdev)
>> +{
>> +       struct xdma_platdata *pdata = dev_get_platdata(&pdev->dev);
> Platform data? No DT?
> Do we still accept plain platform drivers?

The XDMA driver needs to support both the non-DT and DT use cases.

For the non-DT case the parent PCIe device driver will create the xdma 
platform device and pass the required information to the xdma driver. An 
example is 
https://lore.kernel.org/dmaengine/5fbe6029-61d5-bba4-556b-2282153f21dc@gpxsee.org/ 


For the DT use case, the xdma device will be populated by the FDT. This 
part is WIP and will be enabled with future patches.

>
>> +static const struct platform_device_id xdma_id_table[] = {
>> +       { "xdma", 0},
>> +       { },
>> +};
> This table is not needed, as the single entry matches driver.name below.

Thanks. I will create a patch to fix this.


Lizhi

>
>> +
>> +static struct platform_driver xdma_driver = {
>> +       .driver         = {
>> +               .name = "xdma",
>> +       },
>> +       .id_table       = xdma_id_table,
>> +       .probe          = xdma_probe,
>> +       .remove         = xdma_remove,
>> +};
>> +
>> +module_platform_driver(xdma_driver);
> Gr{oetje,eeting}s,
>
>                          Geert
>

  parent reply	other threads:[~2023-02-22  3:46 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-09 19:05 [RESEND PATCH V12 XDMA 0/2] xilinx XDMA driver Lizhi Hou
2023-02-09 19:05 ` [RESEND PATCH V12 XDMA 1/2] dmaengine: xilinx: xdma: Add xilinx xdma driver Lizhi Hou
2023-02-21 13:25   ` Geert Uytterhoeven
2023-02-21 20:46     ` Martin Tůma
2023-02-21 21:06       ` Geert Uytterhoeven
2023-02-21 21:46         ` Martin Tůma
2023-02-22  3:51           ` Lizhi Hou
2023-02-22  3:46     ` Lizhi Hou [this message]
2023-02-09 19:05 ` [RESEND PATCH V12 XDMA 2/2] dmaengine: xilinx: xdma: Add user logic interrupt support Lizhi Hou
  -- strict thread matches above, loose matches on Subject: below --
2023-02-03 18:13 [RESEND PATCH V12 XDMA 0/2] xilinx XDMA driver Lizhi Hou
2023-02-03 18:13 ` [RESEND PATCH V12 XDMA 1/2] dmaengine: xilinx: xdma: Add xilinx xdma driver Lizhi Hou
2023-01-26 19:12 [RESEND PATCH V12 XDMA 0/2] xilinx XDMA driver Lizhi Hou
2023-01-26 19:12 ` [RESEND PATCH V12 XDMA 1/2] dmaengine: xilinx: xdma: Add xilinx xdma driver Lizhi Hou

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=2ec1a8e8-6e85-4873-c1d1-61427b83a6ac@amd.com \
    --to=lizhi.hou@amd.com \
    --cc=brian.xu@amd.com \
    --cc=dmaengine@vger.kernel.org \
    --cc=geert@linux-m68k.org \
    --cc=larry.liu@amd.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=max.zhen@amd.com \
    --cc=sonal.santan@amd.com \
    --cc=tumic@gpxsee.org \
    --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

all inboxes | Powered by JetHome®