[PATCH 2/3] dt-bindings: firmware: xilinx: Add conditional pinctrl schema

Ronak Jain
2025-02-06T14:23:06Z

Updates the Device Tree bindings for Xilinx firmware by introducing
conditional schema references for the pinctrl node.

Previously, the pinctrl node directly referenced
xlnx,zynqmp-pinctrl.yaml. However, this patch modifies the schema to
conditionally apply the correct pinctrl schema based on the compatible
property. Specifically:
- If compatible contains "xlnx,zynqmp-pinctrl", reference
xlnx,zynqmp-pinctrl.yaml.
- If compatible contains "xlnx,versal-pinctrl", reference
xlnx,versal-pinctrl.yaml.

Additionally, an example entry for "xlnx,versal-pinctrl" has been
added under the examples section.

Signed-off-by: Ronak Jain <ronak.jain@amd.com>
---
.../firmware/xilinx/xlnx,zynqmp-firmware.yaml | 20 ++++++++++++++++++-
1 file changed, 19 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/firmware/xilinx/xlnx,zynqmp-firmware.yaml b/Documentation/devicetree/bindings/firmware/xilinx/xlnx,zynqmp-firmware.yaml
index 2b72fb9d3c22..d50438b0fca8 100644
--- a/Documentation/devicetree/bindings/firmware/xilinx/xlnx,zynqmp-firmware.yaml
+++ b/Documentation/devicetree/bindings/firmware/xilinx/xlnx,zynqmp-firmware.yaml
@@ -76,7 +76,6 @@ properties:
type: object

pinctrl:
- $ref: /schemas/pinctrl/xlnx,zynqmp-pinctrl.yaml#
description: The pinctrl node provides access to pinconfig and pincontrol
functionality available in firmware.
type: object
@@ -106,6 +105,21 @@ properties:
type: object
deprecated: true

+allOf:
+ - if:
+ properties:
+ compatible:
+ contains:
+ const: xlnx,zynqmp-firmware
+ then:
+ properties:
+ pinctrl:
+ $ref: /schemas/pinctrl/xlnx,zynqmp-pinctrl.yaml#
+ else:
+ properties:
+ pinctrl:
+ $ref: /schemas/pinctrl/xlnx,versal-pinctrl.yaml#
+
required:
- compatible

@@ -164,6 +178,10 @@ examples:
compatible = "xlnx,versal-fpga";
};

+ pinctrl {
+ compatible = "xlnx,versal-pinctrl";
+ };
+
xlnx_aes: zynqmp-aes {
compatible = "xlnx,zynqmp-aes";
};
--
2.34.1