On Wed, Nov 29, 2023 at 12:57 AM Guo Mengqi <guomengqi3@xxxxxxxxxx> wrote: > > This patch adds a driver for HiSilicon Ascend SDMA engine. > > The DMA controller can do transfers between device and memory > or memory to memory. Currently, the controller only support > single copy. Drives can pass a substreamid to the DMA engine, > which will enable transfers in user-space addresses. > > Signed-off-by: Guo Mengqi <guomengqi3@xxxxxxxxxx> > --- > drivers/dma/Kconfig | 9 + > drivers/dma/Makefile | 1 + > drivers/dma/hisi-ascend-sdma.c | 788 +++++++++++++++++++++++++++++++++ > 3 files changed, 798 insertions(+) > create mode 100644 drivers/dma/hisi-ascend-sdma.c > > diff --git a/drivers/dma/Kconfig b/drivers/dma/Kconfig > index 70ba506dabab..974a00e528ae 100644 > --- a/drivers/dma/Kconfig > +++ b/drivers/dma/Kconfig > @@ -244,6 +244,15 @@ config FSL_RAID > the capability to offload memcpy, xor and pq computation > for raid5/6. > > +config HISI_ASCEND_SDMA > + tristate "HiSilicon Ascend SDMA Engine support" > + depends on ARCH_HISI && ARM64 || COMPILE_TEST > + depends on IOMMU_API && OF && IOMMU_SVA > + select DMA_ENGINE > + select DMA_VIRTUAL_CHANNELS > + help > + Enable support for HiSilicon Ascend SDMA engine. > + > config HISI_DMA > tristate "HiSilicon DMA Engine support" > depends on ARCH_HISI || COMPILE_TEST > diff --git a/drivers/dma/Makefile b/drivers/dma/Makefile > index 83553a97a010..0b736c54407b 100644 > --- a/drivers/dma/Makefile > +++ b/drivers/dma/Makefile > @@ -82,6 +82,7 @@ obj-$(CONFIG_XGENE_DMA) += xgene-dma.o > obj-$(CONFIG_ST_FDMA) += st_fdma.o > obj-$(CONFIG_FSL_DPAA2_QDMA) += fsl-dpaa2-qdma/ > obj-$(CONFIG_INTEL_LDMA) += lgm/ > +obj-$(CONFIG_HISI_ASCEND_SDMA) += hisi-ascend-sdma.o > > obj-y += mediatek/ > obj-y += qcom/ > diff --git a/drivers/dma/hisi-ascend-sdma.c b/drivers/dma/hisi-ascend-sdma.c > new file mode 100644 > index 000000000000..74560b1fdca5 > --- /dev/null > +++ b/drivers/dma/hisi-ascend-sdma.c > @@ -0,0 +1,788 @@ > +// SPDX-License-Identifier: GPL-2.0-only > +/* Copyright(c) 2019-2022 HiSilicon Limited. */ > + > +#include <linux/kernel.h> > +#include <linux/module.h> > +#include <linux/dmaengine.h> > +#include <linux/slab.h> > +#include "virt-dma.h" > +#include <linux/init.h> > +#include <linux/platform_device.h> > +#include <linux/of.h> > +#include <linux/of_address.h> > +#include <linux/of_device.h> You probably don't need this header and the implicit includes it makes are dropped now in linux-next. Please check what you actually need and make them explicit. of_address.h is also probably not needed. Double check. Rob