[PATCH v2 2/3] dt-bindings: clock: versal-clk: Fix Versal NET clock validation
From: Michal Simek
Date: Fri May 29 2026 - 10:20:15 EST
The Versal NET clock controller compatible is specified as:
compatible = "xlnx,versal-net-clk", "xlnx,versal-clk";
with xlnx,versal-clk listed as fallback. The original binding had
two separate if/then blocks - one matching xlnx,versal-clk (2 clocks)
and another matching xlnx,versal-net-clk (3 clocks). Since both
compatible strings are present, both conditions matched simultaneously
and JSON Schema applied the more restrictive 2-clock constraint,
causing false "too long" validation errors for Versal NET.
Define clock-names at the top-level and use if/then only to constrain
the clock count (2 for Versal, 3 for Versal NET). Add a dedicated
example for the Versal NET 3-clock configuration.
Signed-off-by: Michal Simek <michal.simek@xxxxxxx>
---
Changes in v2:
- Update logic without ZynqMP part in this file and have if/else only
around min/maxItems
.../bindings/clock/xlnx,versal-clk.yaml | 51 ++++++++-----------
1 file changed, 22 insertions(+), 29 deletions(-)
diff --git a/Documentation/devicetree/bindings/clock/xlnx,versal-clk.yaml b/Documentation/devicetree/bindings/clock/xlnx,versal-clk.yaml
index 12d060c39bfc..a1b8043958be 100644
--- a/Documentation/devicetree/bindings/clock/xlnx,versal-clk.yaml
+++ b/Documentation/devicetree/bindings/clock/xlnx,versal-clk.yaml
@@ -30,11 +30,17 @@ properties:
description: List of clock specifiers which are external input
clocks to the given clock controller.
minItems: 2
- maxItems: 3
+ items:
+ - description: reference clock
+ - description: alternate reference clock for programmable logic
+ - description: alternate reference clock
clock-names:
minItems: 2
- maxItems: 3
+ items:
+ - const: ref
+ - const: pl_alt_ref
+ - const: alt_ref
required:
- compatible
@@ -50,40 +56,19 @@ allOf:
compatible:
contains:
enum:
- - xlnx,versal-clk
-
+ - xlnx,versal-net-clk
then:
properties:
clocks:
- items:
- - description: reference clock
- - description: alternate reference clock for programmable logic
-
+ minItems: 3
clock-names:
- items:
- - const: ref
- - const: pl_alt_ref
-
- - if:
- properties:
- compatible:
- contains:
- enum:
- - xlnx,versal-net-clk
-
- then:
+ minItems: 3
+ else:
properties:
clocks:
- items:
- - description: reference clock
- - description: alternate reference clock for programmable logic
- - description: alternate reference clock
-
+ maxItems: 2
clock-names:
- items:
- - const: ref
- - const: pl_alt_ref
- - const: alt_ref
+ maxItems: 2
examples:
- |
@@ -99,4 +84,12 @@ examples:
};
};
};
+
+ - |
+ clock-controller {
+ #clock-cells = <1>;
+ compatible = "xlnx,versal-net-clk", "xlnx,versal-clk";
+ clocks = <&ref>, <&pl_alt_ref>, <&alt_ref>;
+ clock-names = "ref", "pl_alt_ref", "alt_ref";
+ };
...
--
2.43.0