diff mbox series

[RFC,v3,1/9] spi: dt-bindings: add spi-offload properties

Message ID 20240722-dlech-mainline-spi-engine-offload-2-v3-1-7420e45df69b@baylibre.com (mailing list archive)
State New
Headers show
Series spi: axi-spi-engine: add offload support | expand

Commit Message

David Lechner July 22, 2024, 9:57 p.m. UTC
This adds a new provider/consumer property pair to the generic SPI
bindings for use with peripherals connected to controllers that support
offloading.

Here, offloading means that the controller has the ability to perform
SPI transactions without any CPU intervention in some shape or form.

The spi-offloads property will be used to assign controller offload
resources to each peripheral that needs them. What these resources are
will be defined by each specific controller binding by specifying the
value of the #spi-offload-cells property.

SPI peripherals that use multiple offload instances at the same time
for different functions can describe the functions using the
spi-offload-names property, for example, for a SPI flash memory, this
might be "read", "erase" and "write" functions.

Signed-off-by: David Lechner <dlechner@baylibre.com>
---

v3 changes:
* Added #spi-offload-cells property to the controller binding.
* Changed spi-offloads to phandle-array.
* Added spi-offload-names property.

v2 changes:

In v1, instead of generic SPI bindings, there were only controller-
specific bindings, so this is a new patch.
---
 Documentation/devicetree/bindings/spi/spi-controller.yaml     |  5 +++++
 .../devicetree/bindings/spi/spi-peripheral-props.yaml         | 11 +++++++++++
 2 files changed, 16 insertions(+)

Comments

Rob Herring (Arm) July 26, 2024, 11:47 a.m. UTC | #1
On Mon, Jul 22, 2024 at 04:57:08PM -0500, David Lechner wrote:
> This adds a new provider/consumer property pair to the generic SPI
> bindings for use with peripherals connected to controllers that support
> offloading.
> 
> Here, offloading means that the controller has the ability to perform
> SPI transactions without any CPU intervention in some shape or form.
> 
> The spi-offloads property will be used to assign controller offload
> resources to each peripheral that needs them. What these resources are
> will be defined by each specific controller binding by specifying the
> value of the #spi-offload-cells property.
> 
> SPI peripherals that use multiple offload instances at the same time
> for different functions can describe the functions using the
> spi-offload-names property, for example, for a SPI flash memory, this
> might be "read", "erase" and "write" functions.
> 
> Signed-off-by: David Lechner <dlechner@baylibre.com>
> ---
> 
> v3 changes:
> * Added #spi-offload-cells property to the controller binding.
> * Changed spi-offloads to phandle-array.
> * Added spi-offload-names property.
> 
> v2 changes:
> 
> In v1, instead of generic SPI bindings, there were only controller-
> specific bindings, so this is a new patch.
> ---
>  Documentation/devicetree/bindings/spi/spi-controller.yaml     |  5 +++++
>  .../devicetree/bindings/spi/spi-peripheral-props.yaml         | 11 +++++++++++
>  2 files changed, 16 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/spi/spi-controller.yaml b/Documentation/devicetree/bindings/spi/spi-controller.yaml
> index 093150c0cb87..0af9cce80be9 100644
> --- a/Documentation/devicetree/bindings/spi/spi-controller.yaml
> +++ b/Documentation/devicetree/bindings/spi/spi-controller.yaml
> @@ -105,6 +105,11 @@ properties:
>      required:
>        - compatible
>  
> +  '#spi-offload-cells':
> +    $ref: /schemas/types.yaml#/definitions/uint32
> +    description:
> +      Number of cells in a SPI offload specifier.
> +

This is the SPI controller/bus schema, but this is likely not part of 
the SPI controller. So needs its own schema.

Some description around what you think would typically be in these cells 
would be good.

Rob
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/spi/spi-controller.yaml b/Documentation/devicetree/bindings/spi/spi-controller.yaml
index 093150c0cb87..0af9cce80be9 100644
--- a/Documentation/devicetree/bindings/spi/spi-controller.yaml
+++ b/Documentation/devicetree/bindings/spi/spi-controller.yaml
@@ -105,6 +105,11 @@  properties:
     required:
       - compatible
 
+  '#spi-offload-cells':
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description:
+      Number of cells in a SPI offload specifier.
+
 patternProperties:
   "^.*@[0-9a-f]+$":
     type: object
diff --git a/Documentation/devicetree/bindings/spi/spi-peripheral-props.yaml b/Documentation/devicetree/bindings/spi/spi-peripheral-props.yaml
index 0bb443b8decd..e27577bdae48 100644
--- a/Documentation/devicetree/bindings/spi/spi-peripheral-props.yaml
+++ b/Documentation/devicetree/bindings/spi/spi-peripheral-props.yaml
@@ -113,6 +113,17 @@  properties:
     minItems: 2
     maxItems: 4
 
+  spi-offloads:
+    $ref: /schemas/types.yaml#/definitions/phandle-array
+    description:
+      Array of SPI offload instances that are used by the peripheral.
+
+  spi-offload-names:
+    $ref: /schemas/types.yaml#/definitions/string-array
+    description:
+      Describes the function of each offload instance. Can be omitted if there
+      is only one item allowed in the spi-offloads array.
+
   st,spi-midi-ns:
     description: |
       Only for STM32H7, (Master Inter-Data Idleness) minimum time