diff mbox series

[38/38] dt-bindings: serial: Document Tegra-specific properties

Message ID 20200612141903.2391044-39-thierry.reding@gmail.com
State Changes Requested
Headers show
Series dt-bindings: json-schema conversions and cleanups | expand

Commit Message

Thierry Reding June 12, 2020, 2:19 p.m. UTC
From: Thierry Reding <treding@nvidia.com>

On Tegra the UART is described using additional properties, such as
clock-names, reset-names, dmas and dma-names. Document them in the
bindings so that Tegra device trees are properly validated.

Signed-off-by: Thierry Reding <treding@nvidia.com>
---
 .../devicetree/bindings/serial/8250.yaml      | 26 +++++++++++++++++++
 1 file changed, 26 insertions(+)

Comments

Rob Herring June 18, 2020, 2:47 a.m. UTC | #1
On Fri, Jun 12, 2020 at 04:19:03PM +0200, Thierry Reding wrote:
> From: Thierry Reding <treding@nvidia.com>
> 
> On Tegra the UART is described using additional properties, such as
> clock-names, reset-names, dmas and dma-names. Document them in the
> bindings so that Tegra device trees are properly validated.
> 
> Signed-off-by: Thierry Reding <treding@nvidia.com>
> ---
>  .../devicetree/bindings/serial/8250.yaml      | 26 +++++++++++++++++++
>  1 file changed, 26 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/serial/8250.yaml b/Documentation/devicetree/bindings/serial/8250.yaml
> index c1d4c196f005..9c8fad27c3f3 100644
> --- a/Documentation/devicetree/bindings/serial/8250.yaml
> +++ b/Documentation/devicetree/bindings/serial/8250.yaml
> @@ -28,6 +28,32 @@ allOf:
>            const: 2
>        required:
>          - reg-shift
> +  - if:
> +      properties:
> +        compatible:
> +          contains:
> +            enum:
> +              - nvidia,tegra20-uart

Can use 'const' here instead.

> +    then:
> +      properties:
> +        clock-names:
> +          $ref: "/schemas/types.yaml#/definitions/string-array"

Don't need type.

> +          items:
> +            - const: serial
> +
> +        dmas:
> +          $ref: "/schemas/types.yaml#/definitions/phandle-array"

How many?

> +
> +        dma-names:
> +          $ref: "/schemas/types.yaml#/definitions/string-array"
> +          items:
> +            - const: rx
> +            - const: tx
> +
> +        reset-names:
> +          $ref: "/schemas/types.yaml#/definitions/string-array"
> +          items:
> +            - const: serial
>    - if:
>        not:
>          properties:
> -- 
> 2.24.1
>
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/serial/8250.yaml b/Documentation/devicetree/bindings/serial/8250.yaml
index c1d4c196f005..9c8fad27c3f3 100644
--- a/Documentation/devicetree/bindings/serial/8250.yaml
+++ b/Documentation/devicetree/bindings/serial/8250.yaml
@@ -28,6 +28,32 @@  allOf:
           const: 2
       required:
         - reg-shift
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - nvidia,tegra20-uart
+    then:
+      properties:
+        clock-names:
+          $ref: "/schemas/types.yaml#/definitions/string-array"
+          items:
+            - const: serial
+
+        dmas:
+          $ref: "/schemas/types.yaml#/definitions/phandle-array"
+
+        dma-names:
+          $ref: "/schemas/types.yaml#/definitions/string-array"
+          items:
+            - const: rx
+            - const: tx
+
+        reset-names:
+          $ref: "/schemas/types.yaml#/definitions/string-array"
+          items:
+            - const: serial
   - if:
       not:
         properties: