Update firmware dt-bindings
Subsystems (2)
cover Update firmware dt-bindings
The patch fixes/enhances below problems,
1. Add missing compatible property under the example section for zynqmp_firmware node.
2. Add conditional pinctrl schema
3. Move FPGA schema references under the allOf schema to align with the expected structure.
Ronak Jain (3):
dt-bindings: firmware: xilinx: Add xlnx,zynqmp-firmware compatible
dt-bindings: firmware: xilinx: Add conditional pinctrl schema
dt-bindings: firmware: xilinx: Move FPGA schema references under allOf
.../firmware/xilinx/xlnx,zynqmp-firmware.yaml | 27 ++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-)
Signature · 1 line
2.34.1
PATCH 1/3 dt-bindings: firmware: xilinx: Add xlnx,zynqmp-firmware compatible
The absence of a compatible property caused dt_binding_check to skip the zynqmp_firmware node.
To address this, add "xlnx,zynqmp-firmware" to the compatible property in the example section for the zynqmp_firmware node.
--- .../bindings/firmware/xilinx/xlnx,zynqmp-firmware.yaml | 1 + 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/firmware/xilinx/xlnx,zynqmp-firmware.yaml +1 -0
@@ -116,6 +116,7 @@ examples: #include <dt-bindings/power/xlnx-zynqmp-power.h> firmware { zynqmp_firmware: zynqmp-firmware { + compatible = "xlnx,zynqmp-firmware"; #power-domain-cells = <1>; soc-nvmem { compatible = "xlnx,zynqmp-nvmem-fw";
Signature · 1 line
2.34.1
PATCH 3/3 dt-bindings: firmware: xilinx: Move FPGA schema references under allOf
In reply to Ronak JainThe "pcap" and "versal-fpga" schema references are moved under the conditional schema "allOf" to align with the expected structure so that versal-fpga is only available via the versal firmware and pcap via zynqmp firmware.
--- .../bindings/firmware/xilinx/xlnx,zynqmp-firmware.yaml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
Documentation/devicetree/bindings/firmware/xilinx/xlnx,zynqmp-firmware.yaml +4 -2
@@ -69,7 +69,6 @@ properties: type: object pcap: - $ref: /schemas/fpga/xlnx,zynqmp-pcap-fpga.yaml description: The ZynqMP SoC uses the PCAP (Processor Configuration Port) to configure the Programmable Logic (PL). The configuration uses the firmware interface.
@@ -93,7 +92,6 @@ properties: type: object versal-fpga: - $ref: /schemas/fpga/xlnx,versal-fpga.yaml# description: Compatible of the FPGA device. type: object
@@ -115,10 +113,14 @@ allOf: properties: pinctrl: $ref: /schemas/pinctrl/xlnx,zynqmp-pinctrl.yaml# + pcap: + $ref: /schemas/fpga/xlnx,zynqmp-pcap-fpga.yaml# else: properties: pinctrl: $ref: /schemas/pinctrl/xlnx,versal-pinctrl.yaml# + versal-fpga: + $ref: /schemas/fpga/xlnx,versal-fpga.yaml# required: - compatible
Signature · 1 line
2.34.1
PATCH 2/3 dt-bindings: firmware: xilinx: Add conditional pinctrl schema
In reply to Ronak JainUpdates 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.
--- .../firmware/xilinx/xlnx,zynqmp-firmware.yaml | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/firmware/xilinx/xlnx,zynqmp-firmware.yaml +19 -1
@@ -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"; };
Signature · 1 line
2.34.1
Rob Herring
maintainerRe: [PATCH 2/3] dt-bindings: firmware: xilinx: Add conditional pinctrl schema
Quoted 40 lines · Ronak Jain
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 <[email protected]>--- .../firmware/xilinx/xlnx,zynqmp-firmware.yaml | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-)Documentation/devicetree/bindings/firmware/xilinx/xlnx,zynqmp-firmware.yaml +4
-1@@ -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:
Documentation/devicetree/bindings/firmware/xilinx/xlnx,zynqmp-firmware.yaml properties: · line 121
Quoted 10 lines
Documentation/devicetree/bindings/firmware/xilinx/xlnx,zynqmp-firmware.yaml +10
-0+ 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#
The somewhat preferred way to do this would be to do this in the top level:
pinctrl:
type: object
additionalProperties: true
properties:
compatible:
contains:
enum:
- xlnx,zynqmp-pinctrl
- xlnx,versal-pinctrl
required:
- compatible
Otherwise, the pinctrl schema ends up being applied twice.
Quoted 18 lines
Documentation/devicetree/bindings/firmware/xilinx/xlnx,zynqmp-firmware.yaml +5
-0+ required: - compatible@@ -164,6 +178,10 @@ examples: compatible = "xlnx,versal-fpga"; }; + pinctrl { + compatible = "xlnx,versal-pinctrl"; + }; + xlnx_aes: zynqmp-aes { compatible = "xlnx,zynqmp-aes"; };Signature · 1 line
2.34.1
Re: [PATCH 1/3] dt-bindings: firmware: xilinx: Add xlnx,zynqmp-firmware compatible
In reply to Ronak JainQuoted 11 lines · Ronak Jain
The absence of a compatible property caused
dt_binding_checkto skip thezynqmp_firmwarenode.To address this, add "xlnx,zynqmp-firmware" to the compatible property in the example section for the
zynqmp_firmwarenode.Signed-off-by Ronak Jain <[email protected]>--- .../bindings/firmware/xilinx/xlnx,zynqmp-firmware.yaml | 1 + 1 file changed, 1 insertion(+)
RE: [PATCH 2/3] dt-bindings: firmware: xilinx: Add conditional pinctrl schema
In reply to Rob HerringHi Rob,
Quoted 82 lines
-----Original Message-----
From: Rob Herring <[email protected]>
Sent: Wednesday, February 12, 2025 3:24 AM
To: Jain, Ronak <[email protected]>
Cc: [email protected]; [email protected]; Simek, Michal <[email protected]>; Manne, Nava kishore <[email protected]>; [email protected]; linux-arm- [email protected]; [email protected]
Subject: Re: [PATCH 2/3] dt-bindings: firmware: xilinx: Add conditional pinctrl schemaQuoted 15 lines · Ronak Jain
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.
Review
Quoted 6 lines
Signed-off-by Ronak Jain <[email protected]>--- .../firmware/xilinx/xlnx,zynqmp-firmware.yaml | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-)(quoted diff) +0
-0
firmware.yamlb/Documentation/devicetree/bindings/firmware/xilinx/xlnx,zynqmp-firmware.yamlQuoted 2 lines
index
2b72fb9d3c22..d50438b0fca8100644
--- a/Documentation/devicetree/bindings/firmware/xilinx/xlnx,zynqmp-
firmware.yamlQuoted 1 line
+++ b/Documentation/devicetree/bindings/firmware/xilinx/xlnx,zynqmp-
firmware.yamlQuoted 16 lines
Documentation/devicetree/bindings/firmware/xilinx/xlnx,zynqmp-firmware.yaml +4
-1@@ -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:Documentation/devicetree/bindings/firmware/xilinx/xlnx,zynqmp-firmware.yaml properties: · line 121
Quoted 10 lines
Documentation/devicetree/bindings/firmware/xilinx/xlnx,zynqmp-firmware.yaml +10
-0+ 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#The somewhat preferred way to do this would be to do this in the top level:
pinctrl:
type: object
additionalProperties: true properties:
compatible:
contains:
enum:
- xlnx,zynqmp-pinctrl
- xlnx,versal-pinctrl
required:
- compatible
Quoted 1 line
Otherwise, the pinctrl schema ends up being applied twice.
Thanks for the patch review and inputs. I'll update and send the next version.
Thanks,
Ronak
Quoted 19 lines
Quoted 19 lines
Documentation/devicetree/bindings/firmware/xilinx/xlnx,zynqmp-firmware.yaml +5
-1+ 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
RE: [PATCH 2/3] dt-bindings: firmware: xilinx: Add conditional pinctrl schema
[AMD Official Use Only - AMD Internal Distribution Only]
Hi Rob,
Quoted 95 lines
-----Original Message-----
From: Jain, Ronak
Sent: Thursday, February 13, 2025 4:46 PM
To: Rob Herring <[email protected]>
Cc: [email protected]; [email protected]; Simek, Michal <[email protected]>; Manne, Nava kishore <[email protected]>; [email protected]; linux-arm- [email protected]; [email protected]
Subject: RE: [PATCH 2/3] dt-bindings: firmware: xilinx: Add conditional pinctrl schemaHi Rob,
Quoted 82 lines
-----Original Message-----
From: Rob Herring <[email protected]>
Sent: Wednesday, February 12, 2025 3:24 AM
To: Jain, Ronak <[email protected]>
Cc: [email protected]; [email protected]; Simek, Michal <[email protected]>; Manne, Nava kishore <[email protected]>; [email protected]; linux-arm- [email protected]; [email protected]
Subject: Re: [PATCH 2/3] dt-bindings: firmware: xilinx: Add conditional pinctrl schemaQuoted 15 lines · Ronak Jain
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.
Review
Quoted 6 lines
Signed-off-by Ronak Jain <[email protected]>--- .../firmware/xilinx/xlnx,zynqmp-firmware.yaml | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-)(quoted diff) +0
-0
firmware.yamlb/Documentation/devicetree/bindings/firmware/xilinx/xlnx,zynqmp-firmware.yamlQuoted 2 lines
index
2b72fb9d3c22..d50438b0fca8100644
--- a/Documentation/devicetree/bindings/firmware/xilinx/xlnx,zynqmp-
firmware.yamlQuoted 1 line
+++ b/Documentation/devicetree/bindings/firmware/xilinx/xlnx,zynqmp-
firmware.yamlQuoted 16 lines
Documentation/devicetree/bindings/firmware/xilinx/xlnx,zynqmp-firmware.yaml +4
-1@@ -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:Documentation/devicetree/bindings/firmware/xilinx/xlnx,zynqmp-firmware.yaml properties: · line 121
Quoted 10 lines
Documentation/devicetree/bindings/firmware/xilinx/xlnx,zynqmp-firmware.yaml +10
-0+ 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#The somewhat preferred way to do this would be to do this in the top level:
pinctrl:
type: object
additionalProperties: true properties:
compatible:
contains:
enum:
- xlnx,zynqmp-pinctrl
- xlnx,versal-pinctrl
required:
- compatible
Quoted 4 lines
Quoted 1 line
Otherwise, the pinctrl schema ends up being applied twice.
Thanks for the patch review and inputs. I'll update and send the next version.
In your suggested code, the schema allows either xlnx,zynqmp-pinctrl or xlnx,versal-pinctrl on any platform, which is incorrect. This means that if a user mistakenly assigns xlnx,versal-pinctrl to a ZynqMP platform or xlnx,zynqmp-pinctrl to a Versal platform, the wrong reference will be used, but no error is reported. The dt-binding check still passes instead of flagging this as an issue.
By using a conditional schema, we can enforce platform-specific compatibility, ensuring that the correct compatible string is used for the corresponding platform. This would also generate an error if an incorrect compatible string is provided, preventing misconfigurations.
Please let me know your thoughts.
Thanks,
Ronak
Quoted 21 lines
Thanks,
RonakQuoted 19 lines
Quoted 19 lines
Documentation/devicetree/bindings/firmware/xilinx/xlnx,zynqmp-firmware.yaml +5
-1+ 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
RE: [PATCH 2/3] dt-bindings: firmware: xilinx: Add conditional pinctrl schema
[AMD Official Use Only - AMD Internal Distribution Only]
Hi @Rob Herring,
Did you get a moment to go through the queries I asked for?
Thanks,
Ronak
Quoted 159 lines
-----Original Message-----
From: Jain, Ronak
Sent: Thursday, February 20, 2025 5:48 PM
To: Rob Herring <[email protected]>
Cc: [email protected]; [email protected]; Simek, Michal <[email protected]>; Manne, Nava kishore <[email protected]>; [email protected]; linux-arm- [email protected]; [email protected]
Subject: RE: [PATCH 2/3] dt-bindings: firmware: xilinx: Add conditional pinctrl schemaHi Rob,
Quoted 9 lines
-----Original Message-----
From: Jain, Ronak
Sent: Thursday, February 13, 2025 4:46 PM
To: Rob Herring <[email protected]>
Cc: [email protected]; [email protected]; Simek, Michal <[email protected]>; Manne, Nava kishore <[email protected]>; [email protected]; linux-arm- [email protected]; [email protected]
Subject: RE: [PATCH 2/3] dt-bindings: firmware: xilinx: Add conditionalpinctrl
Quoted 11 lines
schema
Hi Rob,
Quoted 7 lines
-----Original Message-----
From: Rob Herring <[email protected]>
Sent: Wednesday, February 12, 2025 3:24 AM
To: Jain, Ronak <[email protected]>
Cc: [email protected]; [email protected]; Simek, Michal <[email protected]>; Manne, Nava kishore <[email protected]>; [email protected]; linux-arm-
Quoted 2 lines
Quoted 2 lines
[email protected]; [email protected]
Subject: Re: [PATCH 2/3] dt-bindings: firmware: xilinx: Add conditionalpinctrl
Quoted 15 lines
Quoted 15 lines
schema
Quoted 12 lines · Ronak Jain
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.Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Additionally, an example entry for "xlnx,versal-pinctrl" has been added under the examples section.
Signed-off-by Ronak Jain <[email protected]>--- .../firmware/xilinx/xlnx,zynqmp-firmware.yaml | 20++++++++++++++++++-
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
1 file changed, 19 insertions(+), 1 deletion(-)diff --git
a/Documentation/devicetree/bindings/firmware/xilinx/xlnx,zynqmp-
Quoted 1 line
Quoted 1 line
firmware.yamlb/Documentation/devicetree/bindings/firmware/xilinx/xlnx,zynqmp-
Quoted 4 lines
Quoted 4 lines
firmware.yamlQuoted 2 lines
index
2b72fb9d3c22..d50438b0fca8100644
--- a/Documentation/devicetree/bindings/firmware/xilinx/xlnx,zynqmp-
firmware.yamlQuoted 8 lines
Quoted 8 lines
Quoted 1 line
+++ b/Documentation/devicetree/bindings/firmware/xilinx/xlnx,zynqmp-
firmware.yamlDocumentation/devicetree/bindings/firmware/xilinx/xlnx,zynqmp-firmware.yaml properties: · line 79
Quoted 6 lines
Documentation/devicetree/bindings/firmware/xilinx/xlnx,zynqmp-firmware.yaml +0
-1@@ -76,7 +76,6 @@ properties: type: object pinctrl: - $ref: /schemas/pinctrl/xlnx,zynqmp-pinctrl.yaml# description: The pinctrl node provides access to pinconfig andpincontrol
Quoted 36 lines
Quoted 36 lines
Quoted 10 lines
Documentation/devicetree/bindings/firmware/xilinx/xlnx,zynqmp-firmware.yaml +4
-0functionality available in firmware. type: object@@ -106,6 +105,21 @@ properties: type: object deprecated: true +allOf: + - if: + properties: + compatible:Documentation/devicetree/bindings/firmware/xilinx/xlnx,zynqmp-firmware.yaml properties: · line 121
Quoted 10 lines
Documentation/devicetree/bindings/firmware/xilinx/xlnx,zynqmp-firmware.yaml +10
-0+ 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#The somewhat preferred way to do this would be to do this in the top level:
pinctrl:
type: object
additionalProperties: true properties:
compatible:
contains:
enum:
- xlnx,zynqmp-pinctrl
- xlnx,versal-pinctrl
required:
- compatibleQuoted 3 lines
Quoted 1 line
Otherwise, the pinctrl schema ends up being applied twice.
Thanks for the patch review and inputs. I'll update and send the next
version.
Quoted 1 line
In your suggested code, the schema allows either xlnx,zynqmp-pinctrl or xlnx,versal-pinctrl on any platform, which is incorrect. This means that if a user mistakenly assigns xlnx,versal-pinctrl to a ZynqMP platform or xlnx,zynqmp-pinctrl to a Versal platform, the wrong reference will be used, but no error is reported. The dt-binding check still passes instead of flagging this as an issue.
By using a conditional schema, we can enforce platform-specific compatibility, ensuring that the correct compatible string is used for the corresponding platform. This would also generate an error if an incorrect compatible string is provided, preventing misconfigurations.
Please let me know your thoughts.
Thanks,
RonakQuoted 21 lines
Thanks,
RonakQuoted 19 lines
Quoted 19 lines
Documentation/devicetree/bindings/firmware/xilinx/xlnx,zynqmp-firmware.yaml +5
-1+ 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
RE: [PATCH 2/3] dt-bindings: firmware: xilinx: Add conditional pinctrl schema
[AMD Official Use Only - AMD Internal Distribution Only]
Hi Rob,
I am following up on this thread as the query from April is still open. Could you please take a look at my question in the inline mail below?
Thanks,
Ronak
Quoted 186 lines
-----Original Message-----
From: Jain, Ronak
Sent: Tuesday, March 4, 2025 11:46 AM
To: 'Rob Herring' <[email protected]>
Cc: '[email protected]' <[email protected]>; '[email protected]' <[email protected]>; Simek, Michal <[email protected]>; Manne, Nava kishore <[email protected]>; '[email protected]' <[email protected]>; '[email protected]' <linux- [email protected]>; '[email protected]' <linux- [email protected]>
Subject: RE: [PATCH 2/3] dt-bindings: firmware: xilinx: Add conditional pinctrl schemaHi @Rob Herring,
Did you get a moment to go through the queries I asked for?
Thanks,
RonakQuoted 9 lines
-----Original Message-----
From: Jain, Ronak
Sent: Thursday, February 20, 2025 5:48 PM
To: Rob Herring <[email protected]>
Cc: [email protected]; [email protected]; Simek, Michal <[email protected]>; Manne, Nava kishore <[email protected]>; [email protected]; linux-arm- [email protected]; [email protected]
Subject: RE: [PATCH 2/3] dt-bindings: firmware: xilinx: Add conditionalpinctrl
Quoted 11 lines
schema
Hi Rob,
Quoted 7 lines
-----Original Message-----
From: Jain, Ronak
Sent: Thursday, February 13, 2025 4:46 PM
To: Rob Herring <[email protected]>
Cc: [email protected]; [email protected]; Simek, Michal <[email protected]>; Manne, Nava kishore <[email protected]>; [email protected]; linux-arm-
Quoted 14 lines
Quoted 2 lines
[email protected]; [email protected]
Subject: RE: [PATCH 2/3] dt-bindings: firmware: xilinx: Add conditionalpinctrl
Quoted 11 lines
schema
Hi Rob,
Quoted 7 lines
-----Original Message-----
From: Rob Herring <[email protected]>
Sent: Wednesday, February 12, 2025 3:24 AM
To: Jain, Ronak <[email protected]>
Cc: [email protected]; [email protected]; Simek, Michal <[email protected]>; Manne, Nava kishore <[email protected]>; [email protected]; linux-Quoted 13 lines
arm-
Quoted 2 lines
Quoted 2 lines
[email protected]; [email protected]
Subject: Re: [PATCH 2/3] dt-bindings: firmware: xilinx: Add conditionalpinctrl
Quoted 9 lines
Quoted 9 lines
schema
Quoted 6 lines · Ronak Jain
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
Quoted 12 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
property. Specifically:
- If compatible contains "xlnx,zynqmp-pinctrl", reference xlnx,zynqmp-pinctrl.yaml.
- If compatible contains "xlnx,versal-pinctrl", reference xlnx,versal-pinctrl.yaml.Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Additionally, an example entry for "xlnx,versal-pinctrl" has been added under the examples section.
Signed-off-by Ronak Jain <[email protected]>--- .../firmware/xilinx/xlnx,zynqmp-firmware.yaml | 20Quoted 10 lines
++++++++++++++++++-
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
1 file changed, 19 insertions(+), 1 deletion(-)diff --git
a/Documentation/devicetree/bindings/firmware/xilinx/xlnx,zynqmp-
Quoted 1 line
Quoted 1 line
firmware.yamlb/Documentation/devicetree/bindings/firmware/xilinx/xlnx,zynqmp-
Quoted 3 lines
Quoted 3 lines
firmware.yamlQuoted 2 lines
index
2b72fb9d3c22..d50438b0fca8100644
---a/Documentation/devicetree/bindings/firmware/xilinx/xlnx,zynqmp-
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
firmware.yamlQuoted 1 line
+++
b/Documentation/devicetree/bindings/firmware/xilinx/xlnx,zynqmp-
Quoted 50 lines
Quoted 7 lines
Quoted 7 lines
firmware.yamlDocumentation/devicetree/bindings/firmware/xilinx/xlnx,zynqmp-firmware.yaml properties: · line 79
Quoted 6 lines
Documentation/devicetree/bindings/firmware/xilinx/xlnx,zynqmp-firmware.yaml +0
-1@@ -76,7 +76,6 @@ properties: type: object pinctrl: - $ref: /schemas/pinctrl/xlnx,zynqmp-pinctrl.yaml# description: The pinctrl node provides access to pinconfig andpincontrol
Quoted 36 lines
Quoted 36 lines
Quoted 10 lines
Documentation/devicetree/bindings/firmware/xilinx/xlnx,zynqmp-firmware.yaml +4
-0functionality available in firmware. type: object@@ -106,6 +105,21 @@ properties: type: object deprecated: true +allOf: + - if: + properties: + compatible:Documentation/devicetree/bindings/firmware/xilinx/xlnx,zynqmp-firmware.yaml properties: · line 121
Quoted 10 lines
Documentation/devicetree/bindings/firmware/xilinx/xlnx,zynqmp-firmware.yaml +10
-0+ 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#The somewhat preferred way to do this would be to do this in the top level:
pinctrl:
type: object
additionalProperties: true properties:
compatible:
contains:
enum:
- xlnx,zynqmp-pinctrl
- xlnx,versal-pinctrl
required:
- compatibleQuoted 3 lines
Quoted 1 line
Otherwise, the pinctrl schema ends up being applied twice.
Thanks for the patch review and inputs. I'll update and send the next
version.
Quoted 1 line
Quoted 8 lines
In your suggested code, the schema allows either xlnx,zynqmp-pinctrl or xlnx,versal-pinctrl on any platform, which is incorrect. This means that if a user mistakenly assigns xlnx,versal-pinctrl to a ZynqMP platform or xlnx,zynqmp-pinctrl to a Versal platform, the wrong reference will be used, but no error is reported. The dt-binding check still passes instead of flagging this as an issue.
By using a conditional schema, we can enforce platform-specific
compatibility,
Quoted 2 lines
ensuring that the correct compatible string is used for the corresponding platform. This would also generate an error if an incorrect compatible string
is
Quoted 28 lines
provided, preventing misconfigurations.
Please let me know your thoughts.
Thanks,
RonakQuoted 21 lines
Thanks,
RonakQuoted 19 lines
Quoted 19 lines
Documentation/devicetree/bindings/firmware/xilinx/xlnx,zynqmp-firmware.yaml +5
-1+ 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