[PATCH] dt-bindings: firmware: cznic,turris-mox-rwtm: convert to DT schema

Gabor Juhos posted 1 patch 1 month, 3 weeks ago
.../bindings/firmware/cznic,turris-mox-rwtm.txt    | 19 ----------
.../bindings/firmware/cznic,turris-mox-rwtm.yaml   | 44 ++++++++++++++++++++++
MAINTAINERS                                        |  2 +-
3 files changed, 45 insertions(+), 20 deletions(-)
[PATCH] dt-bindings: firmware: cznic,turris-mox-rwtm: convert to DT schema
Posted by Gabor Juhos 1 month, 3 weeks ago
Convert the Turris Mox rWTM firmware binding to YAML format. Both the
compatibles and the examples were adjusted to match with the ones used
by the existing device trees to avoid new dtb check warnings.

Signed-off-by: Gabor Juhos <j4g8y7@gmail.com>
---
 .../bindings/firmware/cznic,turris-mox-rwtm.txt    | 19 ----------
 .../bindings/firmware/cznic,turris-mox-rwtm.yaml   | 44 ++++++++++++++++++++++
 MAINTAINERS                                        |  2 +-
 3 files changed, 45 insertions(+), 20 deletions(-)

diff --git a/Documentation/devicetree/bindings/firmware/cznic,turris-mox-rwtm.txt b/Documentation/devicetree/bindings/firmware/cznic,turris-mox-rwtm.txt
deleted file mode 100644
index 338169dea7bbb69cf005d964d20d69fdb9b3c7a8..0000000000000000000000000000000000000000
--- a/Documentation/devicetree/bindings/firmware/cznic,turris-mox-rwtm.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-Turris Mox rWTM firmware driver
-
-Required properties:
- - compatible		: Should be "cznic,turris-mox-rwtm"
- - mboxes		: Must contain a reference to associated mailbox
-
-This device tree node should be used on Turris Mox, or potentially another A3700
-compatible device running the Mox's rWTM firmware in the secure processor (for
-example it is possible to flash this firmware into EspressoBin).
-
-Example:
-
-	firmware {
-		turris-mox-rwtm {
-			compatible = "cznic,turris-mox-rwtm";
-			mboxes = <&rwtm 0>;
-			status = "okay";
-		};
-	};
diff --git a/Documentation/devicetree/bindings/firmware/cznic,turris-mox-rwtm.yaml b/Documentation/devicetree/bindings/firmware/cznic,turris-mox-rwtm.yaml
new file mode 100644
index 0000000000000000000000000000000000000000..2feb11103653f841b2456286b666bf523bd02e1e
--- /dev/null
+++ b/Documentation/devicetree/bindings/firmware/cznic,turris-mox-rwtm.yaml
@@ -0,0 +1,44 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/firmware/cznic,turris-mox-rwtm.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Turris Mox rWTM firmware interface
+
+maintainers:
+  - Marek Behún <kabel@kernel.org>
+
+description: |
+  This device tree node should be used on Turris Mox, or potentially
+  another A3700 compatible device running the Mox's rWTM firmware in
+  the secure processor (for example it is possible to flash this
+  firmware into EspressoBin).
+
+properties:
+  compatible:
+    oneOf:
+      - const: marvell,armada-3700-rwtm-firmware
+
+      - items:
+        - const: marvell,armada-3700-rwtm-firmware
+        - const: cznic,turris-mox-rwtm
+
+  mboxes:
+    description: Reference to the associated mailbox.
+    maxItems: 1
+
+required:
+  - compatible
+  - mboxes
+
+additionalProperties: false
+
+examples:
+  - |
+    armada-3700-rwtm {
+        compatible = "marvell,armada-3700-rwtm-firmware";
+        mboxes = <&rwtm 0>;
+    };
+
+...
diff --git a/MAINTAINERS b/MAINTAINERS
index e087673237636268346979ddc270f8cf0905c722..43ec3489898e3bd5c79924670081d4eb397e2729 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -2713,7 +2713,7 @@ F:	Documentation/ABI/testing/sysfs-bus-i2c-devices-turris-omnia-mcu
 F:	Documentation/ABI/testing/sysfs-bus-moxtet-devices
 F:	Documentation/ABI/testing/sysfs-firmware-turris-mox-rwtm
 F:	Documentation/devicetree/bindings/bus/cznic,moxtet.yaml
-F:	Documentation/devicetree/bindings/firmware/cznic,turris-mox-rwtm.txt
+F:	Documentation/devicetree/bindings/firmware/cznic,turris-mox-rwtm.yaml
 F:	Documentation/devicetree/bindings/firmware/cznic,turris-omnia-mcu.yaml
 F:	Documentation/devicetree/bindings/interrupt-controller/marvell,mpic.yaml
 F:	Documentation/devicetree/bindings/leds/cznic,turris-omnia-leds.yaml

---
base-commit: 05f7e89ab9731565d8a62e3b5d1ec206485eeb0b
change-id: 20260221-mox-rwtm-yaml-ccdf4e6e8619

Best regards,
-- 
Gabor Juhos <j4g8y7@gmail.com>

Re: [PATCH] dt-bindings: firmware: cznic,turris-mox-rwtm: convert to DT schema
Posted by Rob Herring (Arm) 1 month, 3 weeks ago
On Sat, 21 Feb 2026 19:21:34 +0100, Gabor Juhos wrote:
> Convert the Turris Mox rWTM firmware binding to YAML format. Both the
> compatibles and the examples were adjusted to match with the ones used
> by the existing device trees to avoid new dtb check warnings.
> 
> Signed-off-by: Gabor Juhos <j4g8y7@gmail.com>
> ---
>  .../bindings/firmware/cznic,turris-mox-rwtm.txt    | 19 ----------
>  .../bindings/firmware/cznic,turris-mox-rwtm.yaml   | 44 ++++++++++++++++++++++
>  MAINTAINERS                                        |  2 +-
>  3 files changed, 45 insertions(+), 20 deletions(-)
> 

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

yamllint warnings/errors:
./Documentation/devicetree/bindings/firmware/cznic,turris-mox-rwtm.yaml:24:9: [warning] wrong indentation: expected 10 but found 8 (indentation)

dtschema/dtc warnings/errors:

doc reference errors (make refcheckdocs):

See https://patchwork.kernel.org/project/devicetree/patch/20260221-mox-rwtm-yaml-v1-1-25dec4a0228b@gmail.com

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.
Re: [PATCH] dt-bindings: firmware: cznic,turris-mox-rwtm: convert to DT schema
Posted by Krzysztof Kozlowski 1 month, 3 weeks ago
On 21/02/2026 19:21, Gabor Juhos wrote:
> +
> +description: |
> +  This device tree node should be used on Turris Mox, or potentially
> +  another A3700 compatible device running the Mox's rWTM firmware in
> +  the secure processor (for example it is possible to flash this
> +  firmware into EspressoBin).
> +
> +properties:
> +  compatible:
> +    oneOf:
> +      - const: marvell,armada-3700-rwtm-firmware
> +
> +      - items:
> +        - const: marvell,armada-3700-rwtm-firmware

This makes little sense. How this can be alone and followed by fallback?
Plus adding new compatible has to be explicit in commit msg, including
the reason (existing users).

> +        - const: cznic,turris-mox-rwtm

Anyway, not tested. Please test your patches BEFORE you send them. I
finished review here because of that.

Best regards,
Krzysztof
Re: [PATCH] dt-bindings: firmware: cznic,turris-mox-rwtm: convert to DT schema
Posted by Gabor Juhos 1 month, 3 weeks ago
Hi Krzysztof,

2026. 02. 21. 19:31 keltezéssel, Krzysztof Kozlowski írta:
> On 21/02/2026 19:21, Gabor Juhos wrote:
>> +
>> +description: |
>> +  This device tree node should be used on Turris Mox, or potentially
>> +  another A3700 compatible device running the Mox's rWTM firmware in
>> +  the secure processor (for example it is possible to flash this
>> +  firmware into EspressoBin).
>> +
>> +properties:
>> +  compatible:
>> +    oneOf:
>> +      - const: marvell,armada-3700-rwtm-firmware
>> +
>> +      - items:
>> +        - const: marvell,armada-3700-rwtm-firmware
> 
> This makes little sense. How this can be alone and followed by fallback?

I admit that this is quite messy, but let me describe the current situation in
detail.

Originally both the dt-bindings documentation and the 'turris-mox-rwtm' driver
have used the 'cznic,turris-mox-rwtm' compatible alone.

In commit 90ae47215de3 ("firmware: turris-mox-rwtm: add
marvell,armada-3700-rwtm-firmware compatible string") a new compatible string
'marvell,armada-3700-rwtm-firmware' has been added to the driver.

Additionally, in commit 3a52a48973b3 ("arm64: dts: marvell: armada-37xx: move
firmware node to generic dtsi file") added a node to the Armada 37xx SoC dtsi
file which uses only 'marvell,armada-3700-rwtm-firmware' as compatible. In the
same commit the 'armada-3720-turris-mox.dts' file has been modified to use both
compatible strings, and the 'cznic,turris-mox-rwtm'  has been chosen to be the
fallback.

Unfortunately, none of the commits above updated the original dt-binding
documentation, so it is out of date since more than 4 years.

In short, the driver handles both compatibles equally, none of those are a
fallback of the other one. And in the existing in-kernel dts files, the
compatible is specified in the following forms:
  "marvell,armada-3700-rwtm-firmware", "cznic,turris-mox-rwtm"
or
  "marvell,armada-3700-rwtm-firmware" alone

The dt-schema is based on these facts in order to avoid new 'dtbs_check'
warnings, even if this is not the optimal/best approach.

> Plus adding new compatible has to be explicit in commit msg, including
> the reason (existing users).
> 
>> +        - const: cznic,turris-mox-rwtm
> 
> Anyway, not tested. Please test your patches BEFORE you send them. I
> finished review here because of that.

Sorry about wasting your time. This is my first schema and I have missed the
'yamllint' warning indicated by Rob's bot in the other mail.

Nevertheless, I have tested the patch before sending, along with several different
versions besides the current one.

Without the patch 'make dtbs_check' throws the following warnings:

  arch/arm64/boot/dts/marvell/armada-3720-atlas-v5.dtb: /firmware/armada-3700-rwtm: failed to match any schema with compatible: ['marvell,armada-3700-rwtm-firmware', 'cznic,turris-mox-rwtm']
  arch/arm64/boot/dts/marvell/armada-3720-atlas-v5.dtb: /firmware/armada-3700-rwtm: failed to match any schema with compatible: ['marvell,armada-3700-rwtm-firmware', 'cznic,turris-mox-rwtm']
  arch/arm64/boot/dts/marvell/armada-3720-db.dtb: /firmware/armada-3700-rwtm: failed to match any schema with compatible: ['marvell,armada-3700-rwtm-firmware']
  arch/arm64/boot/dts/marvell/armada-3720-eDPU.dtb: /firmware/armada-3700-rwtm: failed to match any schema with compatible: ['marvell,armada-3700-rwtm-firmware']
  arch/arm64/boot/dts/marvell/armada-3720-espressobin.dtb: /firmware/armada-3700-rwtm: failed to match any schema with compatible: ['marvell,armada-3700-rwtm-firmware']
  arch/arm64/boot/dts/marvell/armada-3720-espressobin-emmc.dtb: /firmware/armada-3700-rwtm: failed to match any schema with compatible: ['marvell,armada-3700-rwtm-firmware']
  arch/arm64/boot/dts/marvell/armada-3720-espressobin-ultra.dtb: /firmware/armada-3700-rwtm: failed to match any schema with compatible: ['marvell,armada-3700-rwtm-firmware']
  arch/arm64/boot/dts/marvell/armada-3720-espressobin-v7.dtb: /firmware/armada-3700-rwtm: failed to match any schema with compatible: ['marvell,armada-3700-rwtm-firmware']
  arch/arm64/boot/dts/marvell/armada-3720-espressobin-v7-emmc.dtb: /firmware/armada-3700-rwtm: failed to match any schema with compatible: ['marvell,armada-3700-rwtm-firmware']
  arch/arm64/boot/dts/marvell/armada-3720-gl-mv1000.dtb: /firmware/armada-3700-rwtm: failed to match any schema with compatible: ['marvell,armada-3700-rwtm-firmware']
  arch/arm64/boot/dts/marvell/armada-3720-turris-mox.dtb: /firmware/armada-3700-rwtm: failed to match any schema with compatible: ['marvell,armada-3700-rwtm-firmware', 'cznic,turris-mox-rwtm']
  arch/arm64/boot/dts/marvell/armada-3720-turris-mox.dtb: /firmware/armada-3700-rwtm: failed to match any schema with compatible: ['marvell,armada-3700-rwtm-firmware', 'cznic,turris-mox-rwtm']
  arch/arm64/boot/dts/marvell/armada-3720-uDPU.dtb: /firmware/armada-3700-rwtm: failed to match any schema with compatible: ['marvell,armada-3700-rwtm-firmware']

Below are the results of testing different compatible rules.

  properties:
    compatible:
      const: cznic,turris-mox-rwtm

  arch/arm64/boot/dts/marvell/armada-3720-atlas-v5.dtb: armada-3700-rwtm (marvell,armada-3700-rwtm-firmware): compatible:0: 'cznic,turris-mox-rwtm' was expected
  arch/arm64/boot/dts/marvell/armada-3720-atlas-v5.dtb: armada-3700-rwtm (marvell,armada-3700-rwtm-firmware): compatible: ['marvell,armada-3700-rwtm-firmware', 'cznic,turris-mox-rwtm'] is too long
  arch/arm64/boot/dts/marvell/armada-3720-turris-mox.dtb: armada-3700-rwtm (marvell,armada-3700-rwtm-firmware): compatible:0: 'cznic,turris-mox-rwtm' was expected
  arch/arm64/boot/dts/marvell/armada-3720-turris-mox.dtb: armada-3700-rwtm (marvell,armada-3700-rwtm-firmware): compatible: ['marvell,armada-3700-rwtm-firmware', 'cznic,turris-mox-rwtm'] is too long

  properties:
    compatible:
      const: marvell,armada-3700-rwtm-firmware

  arch/arm64/boot/dts/marvell/armada-3720-atlas-v5.dtb: armada-3700-rwtm (marvell,armada-3700-rwtm-firmware): compatible: ['marvell,armada-3700-rwtm-firmware', 'cznic,turris-mox-rwtm'] is too long
  arch/arm64/boot/dts/marvell/armada-3720-turris-mox.dtb: armada-3700-rwtm (marvell,armada-3700-rwtm-firmware): compatible: ['marvell,armada-3700-rwtm-firmware', 'cznic,turris-mox-rwtm'] is too long

  properties:
    compatible:
      enum:
        - marvell,armada-3700-rwtm-firmware
        - cznic,turris-mox-rwtm

  arch/arm64/boot/dts/marvell/armada-3720-atlas-v5.dtb: armada-3700-rwtm (marvell,armada-3700-rwtm-firmware): compatible: ['marvell,armada-3700-rwtm-firmware', 'cznic,turris-mox-rwtm'] is too long
  arch/arm64/boot/dts/marvell/armada-3720-turris-mox.dtb: armada-3700-rwtm (marvell,armada-3700-rwtm-firmware): compatible: ['marvell,armada-3700-rwtm-firmware', 'cznic,turris-mox-rwtm'] is too long

  properties:
    compatible:
      items:
        - const: marvell,armada-3700-rwtm-firmware
        - const: cznic,turris-mox-rwtm

  arch/arm64/boot/dts/marvell/armada-3720-db.dtb: armada-3700-rwtm (marvell,armada-3700-rwtm-firmware): compatible: ['marvell,armada-3700-rwtm-firmware'] is too short
  arch/arm64/boot/dts/marvell/armada-3720-eDPU.dtb: armada-3700-rwtm (marvell,armada-3700-rwtm-firmware): compatible: ['marvell,armada-3700-rwtm-firmware'] is too short
  arch/arm64/boot/dts/marvell/armada-3720-espressobin-emmc.dtb: armada-3700-rwtm (marvell,armada-3700-rwtm-firmware): compatible: ['marvell,armada-3700-rwtm-firmware'] is too short
  arch/arm64/boot/dts/marvell/armada-3720-espressobin-ultra.dtb: armada-3700-rwtm (marvell,armada-3700-rwtm-firmware): compatible: ['marvell,armada-3700-rwtm-firmware'] is too short
  arch/arm64/boot/dts/marvell/armada-3720-espressobin-v7-emmc.dtb: armada-3700-rwtm (marvell,armada-3700-rwtm-firmware): compatible: ['marvell,armada-3700-rwtm-firmware'] is too short
  arch/arm64/boot/dts/marvell/armada-3720-espressobin-v7.dtb: armada-3700-rwtm (marvell,armada-3700-rwtm-firmware): compatible: ['marvell,armada-3700-rwtm-firmware'] is too short
  arch/arm64/boot/dts/marvell/armada-3720-espressobin.dtb: armada-3700-rwtm (marvell,armada-3700-rwtm-firmware): compatible: ['marvell,armada-3700-rwtm-firmware'] is too short
  arch/arm64/boot/dts/marvell/armada-3720-gl-mv1000.dtb: armada-3700-rwtm (marvell,armada-3700-rwtm-firmware): compatible: ['marvell,armada-3700-rwtm-firmware'] is too short
  arch/arm64/boot/dts/marvell/armada-3720-uDPU.dtb: armada-3700-rwtm (marvell,armada-3700-rwtm-firmware): compatible: ['marvell,armada-3700-rwtm-firmware'] is too short


I wanted to get rid of all warnings, so I ended up with the current patch.

Do you have any suggestion about what would be the acceptable solution to clean
up the current mess?


Regards,
Gabor

Re: [PATCH] dt-bindings: firmware: cznic,turris-mox-rwtm: convert to DT schema
Posted by Gabor Juhos 1 month, 3 weeks ago
2026. 02. 23. 11:57 keltezéssel, Gabor Juhos írta:

...

> I wanted to get rid of all warnings, so I ended up with the current patch.
> 
> Do you have any suggestion about what would be the acceptable solution to clean
> up the current mess?

Please scrap this, v7.0-rc1 contains a similar change already. See commit
62fedca4ff8a ("dt-bindings: firmware: Convert cznic,turris-mox-rwtm to DT schema").

Sorry for the noise.

Regards,
Gabor