Re: [PATCH 4/4] devicetree: bindings: spi: Introduce SPI bus extensions

From: Rob Herring (Arm)
Date: Tue Jul 29 2025 - 09:13:07 EST



On Tue, 29 Jul 2025 15:21:03 +0530, Ayush Singh wrote:
> An SPI bus can be wired to the connector and allows an add-on board to
> connect additional SPI devices to this bus.
>
> Those additional SPI devices could be described as sub-nodes of the SPI
> bus controller node however for hotplug connectors described via device
> tree overlays there is additional level of indirection, which is needed
> to decouple the overlay and the base tree:
>
> --- base device tree ---
>
> spi1: spi@abcd0000 {
> compatible = "xyz,foo";
> spi-bus-extension@0 {
> spi-bus = <&spi_ctrl>;
> };
> ...
> };
>
> spi5: spi@cafe0000 {
> compatible = "xyz,bar";
> spi-bus-extension@0 {
> spi-bus = <&spi_sensors>;
> };
> ...
> };
>
> connector {
> spi_ctrl: spi-ctrl {
> spi-parent = <&spi1>;
> #address-cells = <1>;
> #size-cells = <0>;
> };
>
> spi_sensors: spi-sensors {
> spi-parent = <&spi5>;
> #address-cells = <1>;
> #size-cells = <0>;
> };
> };
>
> --- device tree overlay ---
>
> ...
> // This node will overlay on the spi-ctrl node of the base tree
> spi-ctrl {
> eeprom@50 { compatible = "atmel,24c64"; ... };
> };
> ...
>
> --- resulting device tree ---
>
> spi1: spi@abcd0000 {
> compatible = "xyz,foo";
> spi-bus-extension@0 {
> spi-bus = <&spi_ctrl>;
> };
> ...
> };
>
> spi5: spi@cafe0000 {
> compatible = "xyz,bar";
> spi-bus-extension@0 {
> spi-bus = <&spi_sensors>;
> };
> ...
> };
>
> connector {
> spi_ctrl: spi-ctrl {
> spi-parent = <&spi1>;
> #address-cells = <1>;
> #size-cells = <0>;
>
> device@1 { compatible = "xyz,foo"; ... };
> };
>
> spi_sensors: spi-sensors {
> spi-parent = <&spi5>;
> #address-cells = <1>;
> #size-cells = <0>;
> };
> };
>
> Here spi-ctrl (same goes for spi-sensors) represent the part of SPI bus
> that is on the hot-pluggable add-on. On hot-plugging it will physically
> connect to the SPI adapter on the base board. Let's call the 'spi-ctrl'
> node an "extension node".
>
> In order to decouple the overlay from the base tree, the SPI adapter
> (spi@abcd0000) and the extension node (spi-ctrl) are separate nodes.
>
> The extension node is linked to the SPI bus controller in two ways. The
> first one with the spi-bus-extension available in SPI controller
> sub-node and the second one with the spi-parent property available in
> the extension node itself.
>
> The purpose of those two links is to provide the link in both direction
> from the SPI controller to the SPI extension and from the SPI extension
> to the SPI controller.
>
> Signed-off-by: Ayush Singh <ayush@xxxxxxxxxxxxxxx>
> ---
> .../devicetree/bindings/spi/spi-controller.yaml | 66 +++++++++++++++++++++-
> 1 file changed, 65 insertions(+), 1 deletion(-)
>

My bot found errors running 'make dt_binding_check' on your patch:

yamllint warnings/errors:

dtschema/dtc warnings/errors:
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/spi/spi-controller.example.dtb: spi@abcd0000 (brcm,bcm2835-spi): 'oneOf' conditional failed, one must be fixed:
'interrupts' is a required property
'interrupts-extended' is a required property
from schema $id: http://devicetree.org/schemas/spi/brcm,bcm2835-spi.yaml#
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/spi/spi-controller.example.dtb: spi@abcd0000 (brcm,bcm2835-spi): 'clocks' is a required property
from schema $id: http://devicetree.org/schemas/spi/brcm,bcm2835-spi.yaml#
Documentation/devicetree/bindings/spi/spi-controller.example.dtb: /example-2/connector/spi-addon/device@2: failed to match any schema with compatible: ['xyz,foo']

doc reference errors (make refcheckdocs):

See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/20250729-spi-bus-extension-v1-4-b20c73f2161a@xxxxxxxxxxxxxxx

The base for the series is generally the latest rc1. A different dependency
should be noted in *this* patch.

If you already ran 'make dt_binding_check' and didn't see the above
error(s), then make sure 'yamllint' is installed and dt-schema is up to
date:

pip3 install dtschema --upgrade

Please check and re-submit after running the above command yourself. Note
that DT_SCHEMA_FILES can be set to your schema file to speed up checking
your schema. However, it must be unset to test all examples with your schema.