devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Lechner <dlechner@baylibre.com>
To: "Mark Brown" <broonie@kernel.org>,
	"Jonathan Cameron" <jic23@kernel.org>,
	"Rob Herring" <robh@kernel.org>,
	"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
	"Conor Dooley" <conor+dt@kernel.org>,
	"Nuno Sá" <nuno.sa@analog.com>
Cc: "Uwe Kleine-König" <ukleinek@kernel.org>,
	"Michael Hennerich" <Michael.Hennerich@analog.com>,
	"Lars-Peter Clausen" <lars@metafoo.de>,
	"David Jander" <david@protonic.nl>,
	"Martin Sperl" <kernel@martin.sperl.org>,
	linux-spi@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org,
	"Jonathan Cameron" <Jonathan.Cameron@huawei.com>,
	"David Lechner" <dlechner@baylibre.com>,
	"Axel Haslam" <ahaslam@baylibre.com>
Subject: [PATCH v8 00/17] spi: axi-spi-engine: add offload support
Date: Fri, 07 Feb 2025 14:08:57 -0600	[thread overview]
Message-ID: <20250207-dlech-mainline-spi-engine-offload-2-v8-0-e48a489be48c@baylibre.com> (raw)

Only very minor fixes in this revision.

Also, now that trees are rebased on v6.14-rc1 we no longer have
dependencies for the IIO patches. So Mark can pick up all of the
patches if we want to go that way. In any case though, Jonathan will
need an immutable branch since we have other IIO patches in-flight
building on top of this series.

[1]: https://lore.kernel.org/all/20241124125206.1ffd6e6c@jic23-huawei/

---
Changes in v8:
- Added missing include to fix CI build error in spi-axi-spi-engine.
- Fixed a wrong register cleared in ad4695 driver.
- Link to v7: https://lore.kernel.org/r/20250113-dlech-mainline-spi-engine-offload-2-v7-0-e0860c81caae@baylibre.com

Changes in v7:
- Addressed some very minor feedback.
- Link to v6: https://lore.kernel.org/r/20241211-dlech-mainline-spi-engine-offload-2-v6-0-88ee574d5d03@baylibre.com

Changes in v6:
- Dropped the "spi: dt-bindings: add trigger-source.yaml" patch. It was
  reworked and merged into dt-schema in
  https://github.com/devicetree-org/dt-schema/pull/147
- Adjusted other dt-bindings patches to account for above change.
- Dropped one iio patch that was already applied to iio tree.
- Added a DAC patch to make use of the TX DMA stream API.
- Minor fixes and improvements to other patches based on feedback.
- Link to v5: https://lore.kernel.org/r/20241115-dlech-mainline-spi-engine-offload-2-v5-0-bea815bd5ea5@baylibre.com

Changes in v5:
- Dropped pwm patch. A variant of this patch has been picked up in the
  pwm tree.
- Addressed review comments (see details in individual patches).
- Added some polish, like MAINTAINERS entries and updating ADC docs.
- Link to v4: https://lore.kernel.org/r/20241023-dlech-mainline-spi-engine-offload-2-v4-0-f8125b99f5a1@baylibre.com

Changes in v4:
- Dropped #spi-offload-cells and spi-offload properties from DT bindings.
- Made an attempt at a more generic trigger interface instead of using
  clk framework. This also includes a new driver for a generic PWM
  trigger.
- Addressed IIO review comments.
- Added new patches for iio/adc/ad4695 as 2nd user of SPI offload.
- Link to v3: https://lore.kernel.org/r/20240722-dlech-mainline-spi-engine-offload-2-v3-0-7420e45df69b@baylibre.com

Changes in v3:
- Reworked DT bindings to have things physically connected to the SPI
  controller be properties of the SPI controller and use more
  conventional provider/consumer properties.
- Added more SPI APIs for peripheral drivers to use to get auxillary
  offload resources, like triggers.
- Link to v2: https://lore.kernel.org/r/20240510-dlech-mainline-spi-engine-offload-2-v2-0-8707a870c435@baylibre.com

Individual patches have more details on these changes and earlier revisions too.
---

As a recap, here is the background and end goal of this series:

The AXI SPI Engine is a SPI controller that has the ability to record a
series of SPI transactions and then play them back using a hardware
trigger. This allows operations to be performed, repeating many times,
without any CPU intervention. This is needed for achieving high data
rates (millions of samples per second) from ADCs and DACs that are
connected via a SPI bus.

The offload hardware interface consists of a trigger input and a data
output for the RX data. These are connected to other hardware external
to the SPI controller.

To record one or more transactions, commands and TX data are written
to memories in the controller (RX buffer is not used since RX data gets
streamed to an external sink). This sequence of transactions can then be
played back when the trigger input is asserted.

This series includes core SPI support along with the first SPI
controller (AXI SPI Engine) and SPI peripheral (AD7944 ADC) that use
them. This enables capturing analog data at 2 million samples per
second.

The hardware setup looks like this:

+-------------------------------+   +------------------+
|                               |   |                  |
|  SOC/FPGA                     |   |  AD7944 ADC      |
|  +---------------------+      |   |                  |
|  | AXI SPI Engine      |      |   |                  |
|  |             SPI Bus ============ SPI Bus          |
|  |                     |      |   |                  |
|  |  +---------------+  |      |   |                  |
|  |  | Offload 0     |  |      |   +------------------+
|  |  |   RX DATA OUT > > > >   |
|  |  |    TRIGGER IN < < <  v  |
|  |  +---------------+  | ^ v  |
|  +---------------------+ ^ v  |
|  | AXI PWM             | ^ v  |
|  |                 CH0 > ^ v  |
|  +---------------------+   v  |
|  | AXI DMA             |   v  |
|  |                 CH0 < < <  |
|  +---------------------+      |
|                               |
+-------------------------------+

---
Axel Haslam (1):
      iio: dac: ad5791: Add offload support

David Lechner (16):
      spi: add basic support for SPI offloading
      spi: offload: add support for hardware triggers
      dt-bindings: trigger-source: add generic PWM trigger source
      spi: offload-trigger: add PWM trigger driver
      spi: add offload TX/RX streaming APIs
      spi: dt-bindings: axi-spi-engine: add SPI offload properties
      spi: axi-spi-engine: implement offload support
      iio: buffer-dmaengine: split requesting DMA channel from allocating buffer
      iio: buffer-dmaengine: add devm_iio_dmaengine_buffer_setup_with_handle()
      iio: adc: ad7944: don't use storagebits for sizing
      iio: adc: ad7944: add support for SPI offload
      doc: iio: ad7944: describe offload support
      dt-bindings: iio: adc: adi,ad4695: add SPI offload properties
      iio: adc: ad4695: Add support for SPI offload
      doc: iio: ad4695: add SPI offload support
      iio: dac: ad5791: sort include directives

 .../devicetree/bindings/iio/adc/adi,ad4695.yaml    |  13 +
 .../bindings/spi/adi,axi-spi-engine.yaml           |  24 ++
 .../bindings/trigger-source/pwm-trigger.yaml       |  37 ++
 Documentation/iio/ad4695.rst                       |  68 +++
 Documentation/iio/ad7944.rst                       |  24 +-
 MAINTAINERS                                        |  12 +
 drivers/iio/adc/Kconfig                            |   2 +
 drivers/iio/adc/ad4695.c                           | 445 +++++++++++++++++++-
 drivers/iio/adc/ad7944.c                           | 307 +++++++++++++-
 drivers/iio/adc/adi-axi-adc.c                      |   2 +-
 drivers/iio/buffer/industrialio-buffer-dmaengine.c | 144 +++++--
 drivers/iio/dac/Kconfig                            |   3 +
 drivers/iio/dac/ad5791.c                           | 179 +++++++-
 drivers/iio/dac/adi-axi-dac.c                      |   2 +-
 drivers/spi/Kconfig                                |  16 +
 drivers/spi/Makefile                               |   4 +
 drivers/spi/spi-axi-spi-engine.c                   | 315 +++++++++++++-
 drivers/spi/spi-offload-trigger-pwm.c              | 162 +++++++
 drivers/spi/spi-offload.c                          | 465 +++++++++++++++++++++
 drivers/spi/spi.c                                  |  10 +
 include/dt-bindings/iio/adc/adi,ad4695.h           |   7 +
 include/linux/iio/buffer-dmaengine.h               |   7 +-
 include/linux/spi/offload/consumer.h               |  39 ++
 include/linux/spi/offload/provider.h               |  47 +++
 include/linux/spi/offload/types.h                  |  99 +++++
 include/linux/spi/spi.h                            |  20 +
 26 files changed, 2350 insertions(+), 103 deletions(-)
---
base-commit: 884697cc74d9fea0a8628c2794d0b80065ac95d1
change-id: 20240510-dlech-mainline-spi-engine-offload-2-afce3790b5ab

Best regards,
-- 
David Lechner <dlechner@baylibre.com>


             reply	other threads:[~2025-02-07 20:09 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-07 20:08 David Lechner [this message]
2025-02-07 20:08 ` [PATCH v8 01/17] spi: add basic support for SPI offloading David Lechner
2025-02-10 16:45   ` Andy Shevchenko
2025-02-10 17:11     ` David Lechner
2025-02-10 17:48       ` Mark Brown
2025-02-10 20:33         ` Andy Shevchenko
2025-02-11 13:00           ` Mark Brown
2025-02-11 14:20             ` Andy Shevchenko
2025-02-11 14:29               ` Andy Shevchenko
2025-02-11 14:31                 ` Andy Shevchenko
2025-02-11 14:35                   ` Andy Shevchenko
2025-02-11 18:45                     ` Uwe Kleine-König
2025-02-11 18:53                       ` Mark Brown
2025-02-11 19:15                         ` Andy Shevchenko
2025-02-11 19:12                       ` Andy Shevchenko
2025-02-12  8:52                         ` Uwe Kleine-König
2025-02-12 10:55                           ` Andy Shevchenko
2025-02-12 10:58                           ` Andy Shevchenko
2025-02-07 20:08 ` [PATCH v8 02/17] spi: offload: add support for hardware triggers David Lechner
2025-02-07 20:09 ` [PATCH v8 03/17] dt-bindings: trigger-source: add generic PWM trigger source David Lechner
2025-02-07 20:09 ` [PATCH v8 04/17] spi: offload-trigger: add PWM trigger driver David Lechner
2025-02-10 16:52   ` Andy Shevchenko
2025-02-07 20:09 ` [PATCH v8 05/17] spi: add offload TX/RX streaming APIs David Lechner
2025-02-07 20:09 ` [PATCH v8 06/17] spi: dt-bindings: axi-spi-engine: add SPI offload properties David Lechner
2025-02-07 20:09 ` [PATCH v8 07/17] spi: axi-spi-engine: implement offload support David Lechner
2025-02-07 20:09 ` [PATCH v8 08/17] iio: buffer-dmaengine: split requesting DMA channel from allocating buffer David Lechner
2025-02-07 20:09 ` [PATCH v8 09/17] iio: buffer-dmaengine: add devm_iio_dmaengine_buffer_setup_with_handle() David Lechner
2025-02-07 20:09 ` [PATCH v8 10/17] iio: adc: ad7944: don't use storagebits for sizing David Lechner
2025-02-07 20:09 ` [PATCH v8 11/17] iio: adc: ad7944: add support for SPI offload David Lechner
2025-02-10 19:09   ` David Lechner
2025-02-11 19:32     ` Jonathan Cameron
2025-02-07 20:09 ` [PATCH v8 12/17] doc: iio: ad7944: describe offload support David Lechner
2025-02-07 20:09 ` [PATCH v8 13/17] dt-bindings: iio: adc: adi,ad4695: add SPI offload properties David Lechner
2025-02-07 20:09 ` [PATCH v8 14/17] iio: adc: ad4695: Add support for SPI offload David Lechner
2025-02-07 20:20   ` Mark Brown
2025-02-08 13:11     ` Jonathan Cameron
2025-02-10 16:01   ` David Lechner
2025-02-10 18:54     ` Jonathan Cameron
2025-02-07 20:09 ` [PATCH v8 15/17] doc: iio: ad4695: add SPI offload support David Lechner
2025-02-07 20:09 ` [PATCH v8 16/17] iio: dac: ad5791: sort include directives David Lechner
2025-02-07 20:09 ` [PATCH v8 17/17] iio: dac: ad5791: Add offload support David Lechner
2025-02-10 14:36 ` [PATCH v8 00/17] spi: axi-spi-engine: add " Mark Brown
2025-02-10 18:59   ` Jonathan Cameron
2025-02-10 16:07 ` (subset) " Mark Brown

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=20250207-dlech-mainline-spi-engine-offload-2-v8-0-e48a489be48c@baylibre.com \
    --to=dlechner@baylibre.com \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=Michael.Hennerich@analog.com \
    --cc=ahaslam@baylibre.com \
    --cc=broonie@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=david@protonic.nl \
    --cc=devicetree@vger.kernel.org \
    --cc=jic23@kernel.org \
    --cc=kernel@martin.sperl.org \
    --cc=krzk+dt@kernel.org \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=nuno.sa@analog.com \
    --cc=robh@kernel.org \
    --cc=ukleinek@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;
as well as URLs for NNTP newsgroup(s).