mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/2] Add devicetree bindings for spi-virtio
@ 2026-09-29 16:41 Francesco Valla
  2026-09-29 16:41 ` [PATCH 1/2] dt-bindings: spi: add " Francesco Valla
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Francesco Valla @ 2026-09-29 16:41 UTC (permalink / raw)
  To: Michael S. Tsirkin, Mark Brown, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Haixu Cui, Jason Wang
  Cc: Viresh Kumar, Xuan Zhuo, Eugenio Pérez, linux-spi,
	devicetree, linux-kernel, virtualization, Francesco Valla

Add bindings for spi-virtio, like the ones that already exists for
gpio-virtio and i2c-virtio. A node using these would not be used to
probe the device, which is registered by the virtio transport
(e.g.: virtio-mmio) but to declare properties and/or child nodes.

This was tested both with virtio-mmio using qemu-system-aarch64 and with
remoteproc-virtio with a Zephyr backend.

---
I added myself as reviewer for the spi-virtio driver to be CC'd on any
patch involving the new bindings.

As a side note: mails addressed to the spi-virtio driver maintainer
(Haixu Cui) gets bounced back by the Qualcomm postmaster; I added them
here nevertheless.

Thank you!

Regards,
Francesco

To: "Michael S. Tsirkin" <mst@redhat.com>
To: Jason Wang <jasowang@redhat.com>
To: Mark Brown <broonie@kernel.org>
To: Rob Herring <robh@kernel.org>
To: Krzysztof Kozlowski <krzk+dt@kernel.org>
To: Conor Dooley <conor+dt@kernel.org>
To: Haixu Cui <quic_haixcui@quicinc.com>
Cc: Viresh Kumar <viresh.kumar@linaro.org>
Cc: Xuan Zhuo <xuanzhuo@linux.alibaba.com>
Cc: Eugenio Pérez <eperezma@redhat.com>
Cc: linux-spi@vger.kernel.org
Cc: devicetree@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Cc: virtualization@lists.linux.dev
Signed-off-by: Francesco Valla <francesco@valla.it>

---
Francesco Valla (2):
      dt-bindings: spi: add bindings for spi-virtio
      MAINTAINERS: add Francesco as spi-virtio reviewer

 .../devicetree/bindings/spi/spi-virtio.yaml        | 53 ++++++++++++++++++++++
 MAINTAINERS                                        |  2 +
 2 files changed, 55 insertions(+)
---
base-commit: 6f8319e3e9a44dd537d17f41565a8453c560a581
change-id: 20260927-spi-virtio-bindings-f4e350b2709a

Best regards,
--  
Francesco Valla <francesco@valla.it>


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 1/2] dt-bindings: spi: add bindings for spi-virtio
  2026-09-29 16:41 [PATCH 0/2] Add devicetree bindings for spi-virtio Francesco Valla
@ 2026-09-29 16:41 ` Francesco Valla
  2026-09-30 12:03   ` Krzysztof Kozlowski
  2026-09-29 16:41 ` [PATCH 2/2] MAINTAINERS: add Francesco as spi-virtio reviewer Francesco Valla
  2026-09-30 11:58 ` [PATCH 0/2] Add devicetree bindings for spi-virtio Krzysztof Kozlowski
  2 siblings, 1 reply; 7+ messages in thread
From: Francesco Valla @ 2026-09-29 16:41 UTC (permalink / raw)
  To: Michael S. Tsirkin, Mark Brown, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Haixu Cui, Jason Wang
  Cc: Viresh Kumar, Xuan Zhuo, Eugenio Pérez, linux-spi,
	devicetree, linux-kernel, virtualization, Francesco Valla

Add bindings for spi-virtio based on virtio-device, reflecting what
already exists for gpio-virtio and i2c-virtio. A node using the bindings
is not used to instantiate the device, which is registered by the
transport (e.g.: virtio-mmio), but to define its properties and
establish dependencies with other nodes.

Add the new bindings inside the MAINTAINERS file.

Signed-off-by: Francesco Valla <francesco@valla.it>
---
 .../devicetree/bindings/spi/spi-virtio.yaml        | 53 ++++++++++++++++++++++
 MAINTAINERS                                        |  1 +
 2 files changed, 54 insertions(+)

diff --git a/Documentation/devicetree/bindings/spi/spi-virtio.yaml b/Documentation/devicetree/bindings/spi/spi-virtio.yaml
new file mode 100644
index 000000000000..5b8639dd2e1f
--- /dev/null
+++ b/Documentation/devicetree/bindings/spi/spi-virtio.yaml
@@ -0,0 +1,53 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/spi/spi-virtio.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Virtio SPI controller device
+
+maintainers:
+  - Francesco Valla <francesco@valla.it>
+
+allOf:
+  - $ref: /schemas/spi/spi-controller.yaml#
+  - $ref: /schemas/virtio/virtio-device.yaml#
+
+description:
+  Virtio SPI controller device, see /schemas/virtio/virtio-device.yaml for
+  more details.
+
+properties:
+  $nodename:
+    const: spi
+
+  compatible:
+    const: virtio,device2d
+
+required:
+  - compatible
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    virtio@3000 {
+        compatible = "virtio,mmio";
+        reg = <0x3000 0x100>;
+        interrupts = <41>;
+
+        spi {
+            compatible = "virtio,device2d";
+
+            #address-cells = <1>;
+            #size-cells = <0>;
+
+            sram@0 {
+                compatible = "microchip,mchp23k256";
+                reg = <0>;
+                spi-max-frequency = <20000000>;
+            };
+        };
+    };
+
+...
diff --git a/MAINTAINERS b/MAINTAINERS
index 360977678f70..f91340fc6e7f 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -29062,6 +29062,7 @@ VIRTIO SPI DRIVER
 M:	Haixu Cui <quic_haixcui@quicinc.com>
 L:	virtualization@lists.linux.dev
 S:	Maintained
+F:	Documentation/devicetree/bindings/spi/spi-virtio.yaml
 F:	drivers/spi/spi-virtio.c
 F:	include/uapi/linux/virtio_spi.h
 

-- 
2.55.0


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 2/2] MAINTAINERS: add Francesco as spi-virtio reviewer
  2026-09-29 16:41 [PATCH 0/2] Add devicetree bindings for spi-virtio Francesco Valla
  2026-09-29 16:41 ` [PATCH 1/2] dt-bindings: spi: add " Francesco Valla
@ 2026-09-29 16:41 ` Francesco Valla
  2026-09-30 11:58 ` [PATCH 0/2] Add devicetree bindings for spi-virtio Krzysztof Kozlowski
  2 siblings, 0 replies; 7+ messages in thread
From: Francesco Valla @ 2026-09-29 16:41 UTC (permalink / raw)
  To: Michael S. Tsirkin, Mark Brown, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Haixu Cui, Jason Wang
  Cc: Viresh Kumar, Xuan Zhuo, Eugenio Pérez, linux-spi,
	devicetree, linux-kernel, virtualization, Francesco Valla

Add myself as reviewer for spi-virtio, following the introduction of the
devicetree bindings for it.

Signed-off-by: Francesco Valla <francesco@valla.it>
---
 MAINTAINERS | 1 +
 1 file changed, 1 insertion(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index f91340fc6e7f..ff70479e99c3 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -29060,6 +29060,7 @@ F:	sound/virtio/*
 
 VIRTIO SPI DRIVER
 M:	Haixu Cui <quic_haixcui@quicinc.com>
+R:	Francesco Valla <francesco@valla.it>
 L:	virtualization@lists.linux.dev
 S:	Maintained
 F:	Documentation/devicetree/bindings/spi/spi-virtio.yaml

-- 
2.55.0


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 0/2] Add devicetree bindings for spi-virtio
  2026-09-29 16:41 [PATCH 0/2] Add devicetree bindings for spi-virtio Francesco Valla
  2026-09-29 16:41 ` [PATCH 1/2] dt-bindings: spi: add " Francesco Valla
  2026-09-29 16:41 ` [PATCH 2/2] MAINTAINERS: add Francesco as spi-virtio reviewer Francesco Valla
@ 2026-09-30 11:58 ` Krzysztof Kozlowski
  2026-09-30 16:01   ` Francesco Valla
  2 siblings, 1 reply; 7+ messages in thread
From: Krzysztof Kozlowski @ 2026-09-30 11:58 UTC (permalink / raw)
  To: Francesco Valla
  Cc: Michael S. Tsirkin, Mark Brown, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Haixu Cui, Jason Wang, Viresh Kumar, Xuan Zhuo,
	Eugenio Pérez, linux-spi, devicetree, linux-kernel,
	virtualization

On Tue, Sep 29, 2026 at 06:41:54PM +0200, Francesco Valla wrote:
> Add bindings for spi-virtio, like the ones that already exists for
> gpio-virtio and i2c-virtio. A node using these would not be used to
> probe the device, which is registered by the virtio transport
> (e.g.: virtio-mmio) but to declare properties and/or child nodes.

Keep proper versioning of your work and DO NOT IGNORE previous
discussions. This was discussed before, no?

https://lore.kernel.org/all/20260916-remoteproc_virtio_map-v1-7-dac8c5eb4aa9@valla.it/

b4 solves the first problem for you.

Best regards,
Krzysztof


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/2] dt-bindings: spi: add bindings for spi-virtio
  2026-09-29 16:41 ` [PATCH 1/2] dt-bindings: spi: add " Francesco Valla
@ 2026-09-30 12:03   ` Krzysztof Kozlowski
  2026-09-30 16:22     ` Francesco Valla
  0 siblings, 1 reply; 7+ messages in thread
From: Krzysztof Kozlowski @ 2026-09-30 12:03 UTC (permalink / raw)
  To: Francesco Valla
  Cc: Michael S. Tsirkin, Mark Brown, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Haixu Cui, Jason Wang, Viresh Kumar, Xuan Zhuo,
	Eugenio Pérez, linux-spi, devicetree, linux-kernel,
	virtualization

On Tue, Sep 29, 2026 at 06:41:55PM +0200, Francesco Valla wrote:
> Add bindings for spi-virtio based on virtio-device, reflecting what
> already exists for gpio-virtio and i2c-virtio. A node using the bindings

Existing code is not a reason to add more code. Existing bugs are not a
reason to add more bugs. Please provide proper rationale why this suits
DT.

> is not used to instantiate the device, which is registered by the
> transport (e.g.: virtio-mmio), but to define its properties and
> establish dependencies with other nodes.
> 
> Add the new bindings inside the MAINTAINERS file.
> 
> Signed-off-by: Francesco Valla <francesco@valla.it>
> ---
>  .../devicetree/bindings/spi/spi-virtio.yaml        | 53 ++++++++++++++++++++++
>  MAINTAINERS                                        |  1 +
>  2 files changed, 54 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/spi/spi-virtio.yaml b/Documentation/devicetree/bindings/spi/spi-virtio.yaml
> new file mode 100644
> index 000000000000..5b8639dd2e1f
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/spi/spi-virtio.yaml
> @@ -0,0 +1,53 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/spi/spi-virtio.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Virtio SPI controller device
> +
> +maintainers:
> +  - Francesco Valla <francesco@valla.it>
> +
> +allOf:
> +  - $ref: /schemas/spi/spi-controller.yaml#
> +  - $ref: /schemas/virtio/virtio-device.yaml#
> +
> +description:
> +  Virtio SPI controller device, see /schemas/virtio/virtio-device.yaml for
> +  more details.
> +
> +properties:
> +  $nodename:
> +    const: spi
> +
> +  compatible:
> +    const: virtio,device2d

From where does the compatible come from?

Best regards,
Krzysztof


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 0/2] Add devicetree bindings for spi-virtio
  2026-09-30 11:58 ` [PATCH 0/2] Add devicetree bindings for spi-virtio Krzysztof Kozlowski
@ 2026-09-30 16:01   ` Francesco Valla
  0 siblings, 0 replies; 7+ messages in thread
From: Francesco Valla @ 2026-09-30 16:01 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Michael S. Tsirkin, Mark Brown, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Haixu Cui, Jason Wang, Viresh Kumar, Xuan Zhuo,
	Eugenio Pérez, linux-spi, devicetree, linux-kernel,
	virtualization

Hello Krzysztof,

On Wed, Sep 30, 2026 at 01:58:38PM +0200, Krzysztof Kozlowski wrote:
> On Tue, Sep 29, 2026 at 06:41:54PM +0200, Francesco Valla wrote:
> > Add bindings for spi-virtio, like the ones that already exists for
> > gpio-virtio and i2c-virtio. A node using these would not be used to
> > probe the device, which is registered by the virtio transport
> > (e.g.: virtio-mmio) but to declare properties and/or child nodes.
> 
> Keep proper versioning of your work and DO NOT IGNORE previous
> discussions. This was discussed before, no?
> 
> https://lore.kernel.org/all/20260916-remoteproc_virtio_map-v1-7-dac8c5eb4aa9@valla.it/
>

This is correct, the first patch was an accesssory part of a RFC series I
sent some days ago. I decided to drop it from that series as it was
outside its particular scope, as Mathieu noted [1], after picking up a
copy-paste error signalled by sashiko.

I should definitely have mentioned that in the cover letter.

However, I believe this to be independent of that particular series.

> b4 solves the first problem for you.
>
> Best regards,
> Krzysztof
> 

Thank you!


Regards,
Francesco



[1] https://lore.kernel.org/all/CANLsYkzC5DU8j_QJLkuUcV2tYb=G86L_G4yiBZTePKSqiRdd6w@mail.gmail.com/


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/2] dt-bindings: spi: add bindings for spi-virtio
  2026-09-30 12:03   ` Krzysztof Kozlowski
@ 2026-09-30 16:22     ` Francesco Valla
  0 siblings, 0 replies; 7+ messages in thread
From: Francesco Valla @ 2026-09-30 16:22 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Michael S. Tsirkin, Mark Brown, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Haixu Cui, Jason Wang, Viresh Kumar, Xuan Zhuo,
	Eugenio Pérez, linux-spi, devicetree, linux-kernel,
	virtualization

Hello Krzysztof,

On Wed, Sep 30, 2026 at 02:03:17PM +0200, Krzysztof Kozlowski wrote:
> On Tue, Sep 29, 2026 at 06:41:55PM +0200, Francesco Valla wrote:
> > Add bindings for spi-virtio based on virtio-device, reflecting what
> > already exists for gpio-virtio and i2c-virtio. A node using the bindings
> 
> Existing code is not a reason to add more code. Existing bugs are not a
> reason to add more bugs. Please provide proper rationale why this suits
> DT.
> 

When a non-discoverable bus (SPI in this case, but that's true also for
e.g. the I2C and GPIO cases I mentioned) made available by a virtio
transport is registered, the devicetree can be used to declare its child
devices (if any) and/or other properties (say,i GPIOs tied to CS lines
for the SPI usecase).

The virtio framework already searches for a node with a suitable
compatible when registering a device [1]; this binding is thus not
introducing a new functionality, but allowing proper validation of
nodes tied to spi-virtio devices.

> > is not used to instantiate the device, which is registered by the
> > transport (e.g.: virtio-mmio), but to define its properties and
> > establish dependencies with other nodes.
> > 
> > Add the new bindings inside the MAINTAINERS file.
> > 
> > Signed-off-by: Francesco Valla <francesco@valla.it>
> > ---
> >  .../devicetree/bindings/spi/spi-virtio.yaml        | 53 ++++++++++++++++++++++
> >  MAINTAINERS                                        |  1 +
> >  2 files changed, 54 insertions(+)
> > 
> > diff --git a/Documentation/devicetree/bindings/spi/spi-virtio.yaml b/Documentation/devicetree/bindings/spi/spi-virtio.yaml
> > new file mode 100644
> > index 000000000000..5b8639dd2e1f
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/spi/spi-virtio.yaml
> > @@ -0,0 +1,53 @@
> > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> > +%YAML 1.2
> > +---
> > +$id: http://devicetree.org/schemas/spi/spi-virtio.yaml#
> > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > +
> > +title: Virtio SPI controller device
> > +
> > +maintainers:
> > +  - Francesco Valla <francesco@valla.it>
> > +
> > +allOf:
> > +  - $ref: /schemas/spi/spi-controller.yaml#
> > +  - $ref: /schemas/virtio/virtio-device.yaml#
> > +
> > +description:
> > +  Virtio SPI controller device, see /schemas/virtio/virtio-device.yaml for
> > +  more details.
> > +
> > +properties:
> > +  $nodename:
> > +    const: spi
> > +
> > +  compatible:
> > +    const: virtio,device2d
> 
> From where does the compatible come from?
>

This is the compatible the virtio framework is expecting [1]; '2d' is the
hexadecimal representation of 45, which is the virtio identifier for a
SPI device [2].

> Best regards,
> Krzysztof
>

Thank you

Regards,
Francesco

[1] https://elixir.bootlin.com/linux/v7.2.8/source/drivers/virtio/virtio.c#L488
[2] https://docs.oasis-open.org/virtio/virtio/v1.4/virtio-v1.4.html @ 5.21.1



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2026-09-30 16:22 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-29 16:41 [PATCH 0/2] Add devicetree bindings for spi-virtio Francesco Valla
2026-09-29 16:41 ` [PATCH 1/2] dt-bindings: spi: add " Francesco Valla
2026-09-30 12:03   ` Krzysztof Kozlowski
2026-09-30 16:22     ` Francesco Valla
2026-09-29 16:41 ` [PATCH 2/2] MAINTAINERS: add Francesco as spi-virtio reviewer Francesco Valla
2026-09-30 11:58 ` [PATCH 0/2] Add devicetree bindings for spi-virtio Krzysztof Kozlowski
2026-09-30 16:01   ` Francesco Valla

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®