From: Alexander Gordeev <a.gordeev.box@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: Alexander Gordeev <a.gordeev.box@gmail.com>, dmaengine@vger.kernel.org
Subject: [PATCH v5 0/2] dmaengine: avalon: Intel Avalon-MM DMA Interface forPCIe
Date: Wed, 6 Nov 2019 20:22:40 +0100 [thread overview]
Message-ID: <cover.1573052725.git.a.gordeev.box@gmail.com> (raw)
This series is against v5.4-rc6
Patch 1. Introduces "avalon-dma" driver that conforms to the standard
"dmaengine" model;
Patch 2. The existing "dmatest" is not meant for DMA_SLAVE type of
transfers needed by "avalon-dma" driver. Instead, custom "avalon-test"
was used to debug and stress "avalon-dma". In fact, the methology used
for testing is pretty much generic:
- DMA to/from the remote device (memory) - oneshot or multiple times;
- continuously run cuncurrent threads DMAing to/from the remote device;
- using IOCTL to DMA data to/from user level;
Such functionality could be very useful for bringing up custom embedded
devices, i.e sensors, displays etc.
With some effort "avalon-test" could even be merged into the existing
"dmatest" or turned into a tool for testing any "dmaengine" compatible
driver that does not need any custom hardware specifics to initiate DMA
transfers.
I am not certain that "avalon-test" in its current form is the best way
to proceed and thus marking patch 2 as RFC. It depends on "avalon-dma",
but the two drivers are not necessary to go along.
Changes since v4:
- kbuild test robot reported issues fixed;
Changes since v3 ("avalon-test" only):
- BUG_ONs, WARN_ONs, dev_dbgs removed goto labels renamed;
- kernel configuration options removed in favour of module parameters;
- fail paths reworked to avoid resource leaks uninitialized data crashes;
- invalid parameter checks reworked;
Changes since v2 ("avalon-dma" only):
- avalon_dma_register() return value bug fixed;
- device_prep_slave_sg() does not crash dmaengine_prep_slave_single();
- kernel configuration options removed in favour of module parameters;
- BUG_ONs, WARN_ONs, dev_dbgs removed goto labels renamed;
- polling loop in interrupt handler commented;
- cpu_relax() added to polling loop in interrupt handler;
Changes since v1:
- "avalon-dma" converted to "dmaengine" model;
- "avalon-drv" renamed to "avalon-test";
The Avalon-MM DMA Interface for PCIe is a design used in hard IPs for
Intel Arria, Cyclone or Stratix FPGAs. It transfers data between on-chip
memory and system memory.
Testing was done using a custom FPGA build with Arria 10 FPGA streaming
data to target device RAM:
+----------+ +----------+ +----------+ +----------+
| NIOS CPU |<-->| RAM |<-->| Avalon |<-PCIe->| Host CPU |
+----------+ +----------+ +----------+ +----------+
The data integrity was ensured by examining target device RAM contents
(a) from host CPU (indirectly - checking data DMAed to/from the system)
and (b) from NIOS CPU that has direct access to the device RAM.
A companion tool using "avalon-test" IOCTL commands was used to DMA files:
https://github.com/a-gordeev/avalon-tool.git
CC: dmaengine@vger.kernel.org
Alexander Gordeev (2):
dmaengine: avalon-dma: Intel Avalon-MM DMA Interface for PCIe
dmaengine: avalon-test: Intel Avalon-MM DMA Interface for PCIe test
drivers/dma/Kconfig | 3 +
drivers/dma/Makefile | 2 +
drivers/dma/avalon-test/Kconfig | 12 +
drivers/dma/avalon-test/Makefile | 14 +
drivers/dma/avalon-test/avalon-dev.c | 108 +++++
drivers/dma/avalon-test/avalon-dev.h | 33 ++
drivers/dma/avalon-test/avalon-ioctl.c | 101 +++++
drivers/dma/avalon-test/avalon-ioctl.h | 13 +
drivers/dma/avalon-test/avalon-mmap.c | 74 +++
drivers/dma/avalon-test/avalon-mmap.h | 13 +
drivers/dma/avalon-test/avalon-sg-buf.c | 132 ++++++
drivers/dma/avalon-test/avalon-sg-buf.h | 27 ++
drivers/dma/avalon-test/avalon-xfer.c | 575 ++++++++++++++++++++++++
drivers/dma/avalon-test/avalon-xfer.h | 29 ++
drivers/dma/avalon/Kconfig | 15 +
drivers/dma/avalon/Makefile | 12 +
drivers/dma/avalon/avalon-core.c | 477 ++++++++++++++++++++
drivers/dma/avalon/avalon-core.h | 92 ++++
drivers/dma/avalon/avalon-hw.c | 187 ++++++++
drivers/dma/avalon/avalon-hw.h | 86 ++++
drivers/dma/avalon/avalon-pci.c | 145 ++++++
include/uapi/linux/avalon-ioctl.h | 34 ++
22 files changed, 2184 insertions(+)
create mode 100644 drivers/dma/avalon-test/Kconfig
create mode 100644 drivers/dma/avalon-test/Makefile
create mode 100644 drivers/dma/avalon-test/avalon-dev.c
create mode 100644 drivers/dma/avalon-test/avalon-dev.h
create mode 100644 drivers/dma/avalon-test/avalon-ioctl.c
create mode 100644 drivers/dma/avalon-test/avalon-ioctl.h
create mode 100644 drivers/dma/avalon-test/avalon-mmap.c
create mode 100644 drivers/dma/avalon-test/avalon-mmap.h
create mode 100644 drivers/dma/avalon-test/avalon-sg-buf.c
create mode 100644 drivers/dma/avalon-test/avalon-sg-buf.h
create mode 100644 drivers/dma/avalon-test/avalon-xfer.c
create mode 100644 drivers/dma/avalon-test/avalon-xfer.h
create mode 100644 drivers/dma/avalon/Kconfig
create mode 100644 drivers/dma/avalon/Makefile
create mode 100644 drivers/dma/avalon/avalon-core.c
create mode 100644 drivers/dma/avalon/avalon-core.h
create mode 100644 drivers/dma/avalon/avalon-hw.c
create mode 100644 drivers/dma/avalon/avalon-hw.h
create mode 100644 drivers/dma/avalon/avalon-pci.c
create mode 100644 include/uapi/linux/avalon-ioctl.h
base-commit: a99d8080aaf358d5d23581244e5da23b35e340b9
--
2.24.0
next reply other threads:[~2019-11-06 19:23 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-06 19:22 Alexander Gordeev [this message]
2019-11-06 19:22 ` [PATCH v5 1/2] dmaengine: avalon-dma: Intel Avalon-MM DMA Interface for PCIe Alexander Gordeev
2019-11-22 5:18 ` Vinod Koul
2019-11-06 19:22 ` [PATCH RFC v5 2/2] dmaengine: avalon-test: Intel Avalon-MM DMA Interface for PCIe test Alexander Gordeev
2019-11-14 5:03 ` Vinod Koul
2019-11-14 15:53 ` Alexander Gordeev
2019-11-22 5:06 ` Vinod Koul
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=cover.1573052725.git.a.gordeev.box@gmail.com \
--to=a.gordeev.box@gmail.com \
--cc=dmaengine@vger.kernel.org \
--cc=linux-kernel@vger.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.