[05/13] dt-bindings: serial: cdsn,uart: add power-domains

Message ID 20230123151302.368277-5-krzysztof.kozlowski@linaro.org
State New
Headers
Series [01/13] dt-bindings: serial: amlogic,meson-uart: allow other serial properties |

Commit Message

Krzysztof Kozlowski Jan. 23, 2023, 3:12 p.m. UTC
  Few Xilinx DTS have power domains in serial node:

  zynqmp-zc1232-revA.dtb: serial@ff000000: Unevaluated properties are not allowed ('power-domains' was unexpected)

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 .../devicetree/bindings/serial/cdns,uart.yaml   | 17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)
  

Comments

Michal Simek Jan. 23, 2023, 3:39 p.m. UTC | #1
On 1/23/23 16:12, Krzysztof Kozlowski wrote:
> 
> Few Xilinx DTS have power domains in serial node:
> 
>    zynqmp-zc1232-revA.dtb: serial@ff000000: Unevaluated properties are not allowed ('power-domains' was unexpected)
> 
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> ---
>   .../devicetree/bindings/serial/cdns,uart.yaml   | 17 ++++++++++++++---
>   1 file changed, 14 insertions(+), 3 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/serial/cdns,uart.yaml b/Documentation/devicetree/bindings/serial/cdns,uart.yaml
> index 0c118d5336cc..38925b79cb38 100644
> --- a/Documentation/devicetree/bindings/serial/cdns,uart.yaml
> +++ b/Documentation/devicetree/bindings/serial/cdns,uart.yaml
> @@ -9,9 +9,6 @@ title: Cadence UART Controller
>   maintainers:
>     - Michal Simek <michal.simek@xilinx.com>
> 
> -allOf:
> -  - $ref: serial.yaml#
> -
>   properties:
>     compatible:
>       oneOf:
> @@ -46,6 +43,9 @@ properties:
>         port does not use this pin.
>       type: boolean
> 
> +  power-domains:
> +    maxItems: 1
> +
>   required:
>     - compatible
>     - reg
> @@ -53,6 +53,17 @@ required:
>     - clocks
>     - clock-names
> 
> +allOf:
> +  - $ref: serial.yaml#
> +  - if:
> +      properties:
> +        compatible:
> +          contains:
> +            const: cdns,uart-r1p8
> +    then:
> +      properties:
> +        power-domains: false
> +
>   unevaluatedProperties: false
> 
>   examples:
> --
> 2.34.1
> 

Reviewed-by: Michal Simek <michal.simek@amd.com>

btw: I was running it and I have seen that properties are checked only on nodes 
which have status property okay. On disabled nodes properties are not checked. 
Is this standard behavior/setting?

Thanks,
Michal
  
Krzysztof Kozlowski Jan. 23, 2023, 3:40 p.m. UTC | #2
On 23/01/2023 16:39, Michal Simek wrote:
>>
>>   examples:
>> --
>> 2.34.1
>>
> 
> Reviewed-by: Michal Simek <michal.simek@amd.com>
> 
> btw: I was running it and I have seen that properties are checked only on nodes 
> which have status property okay. On disabled nodes properties are not checked. 
> Is this standard behavior/setting?

Yes, because disabled nodes might be missing several properties (e.g.
clocks or supplies).

Best regards,
Krzysztof
  

Patch

diff --git a/Documentation/devicetree/bindings/serial/cdns,uart.yaml b/Documentation/devicetree/bindings/serial/cdns,uart.yaml
index 0c118d5336cc..38925b79cb38 100644
--- a/Documentation/devicetree/bindings/serial/cdns,uart.yaml
+++ b/Documentation/devicetree/bindings/serial/cdns,uart.yaml
@@ -9,9 +9,6 @@  title: Cadence UART Controller
 maintainers:
   - Michal Simek <michal.simek@xilinx.com>
 
-allOf:
-  - $ref: serial.yaml#
-
 properties:
   compatible:
     oneOf:
@@ -46,6 +43,9 @@  properties:
       port does not use this pin.
     type: boolean
 
+  power-domains:
+    maxItems: 1
+
 required:
   - compatible
   - reg
@@ -53,6 +53,17 @@  required:
   - clocks
   - clock-names
 
+allOf:
+  - $ref: serial.yaml#
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: cdns,uart-r1p8
+    then:
+      properties:
+        power-domains: false
+
 unevaluatedProperties: false
 
 examples: