Skip to contentSkip to conversation

dt-bindings: arm: samsung: Force clkoutN names to be unique in PMU

PATCH Applied Krzysztof Kozlowski 3 participants 14 messages Oct 4, 2019 – Nov 3, 2019

Subsystems (6)
lore
Share & tools
lore

Krzysztof Kozlowski

author maintainer
#0 lore raw

PATCH 1/3 dt-bindings: arm: samsung: Force clkoutN names to be unique in PMU

The clkoutN names of clocks must be unique because they represent unique inputs of clock multiplexer.

---
 Documentation/devicetree/bindings/arm/samsung/pmu.yaml | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
Documentation/devicetree/bindings/arm/samsung/pmu.yaml +4 -2
index 73b56fc5bf58..d8e03716f5d2 100644
@@ -53,8 +53,10 @@ properties:
       List of clock names for particular CLKOUT mux inputs
     minItems: 1
     maxItems: 32
-    items:
-      pattern: '^clkout([0-9]|[12][0-9]|3[0-1])$'
+    allOf:
+      - items:
+          pattern: '^clkout([0-9]|[12][0-9]|3[0-1])$'
+      - uniqueItems: true
 
   clocks:
     minItems: 1
Signature · 1 line
2.17.1
author maintainer
#1 lore raw

PATCH 2/3 dt-bindings: gpu: samsung-rotator: Fix indentation

Array elements under 'items' should be indented.

---
 Documentation/devicetree/bindings/gpu/samsung-rotator.yaml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Documentation/devicetree/bindings/gpu/samsung-rotator.yaml +1 -1
index 45ce562435fa..f4dfa6fc724c 100644
@@ -27,7 +27,7 @@ properties:
 
   clock-names:
     items:
-    - const: rotator
+      - const: rotator
 
 required:
   - compatible
Signature · 1 line
2.17.1
author maintainer
#3 lore raw

PATCH 3/3 dt-bindings: serial: Convert Samsung UART bindings to json-schema

In reply to Krzysztof Kozlowski

Convert Samsung S3C/S5P/Exynos Serial/UART bindings to DT schema format using json-schema.

---
 .../bindings/mfd/samsung,exynos5433-lpass.txt |   2 +-
 .../bindings/serial/samsung_uart.txt          |  58 -------
 .../bindings/serial/samsung_uart.yaml         | 148 ++++++++++++++++++
 3 files changed, 149 insertions(+), 59 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/serial/samsung_uart.txt
 create mode 100644 Documentation/devicetree/bindings/serial/samsung_uart.yaml
Documentation/devicetree/bindings/mfd/samsung,exynos5433-lpass.txt +1 -1
index d759da606f75..30ea27c3936d 100644
@@ -18,7 +18,7 @@ an optional sub-node. For "samsung,exynos5433-lpass" compatible this includes:
 UART, SLIMBUS, PCM, I2S, DMAC, Timers 0...4, VIC, WDT 0...1 devices.
 
 Bindings of the sub-nodes are described in:
-  ../serial/samsung_uart.txt
+  ../serial/samsung_uart.yaml
   ../sound/samsung-i2s.txt
   ../dma/arm-pl330.txt
 
Documentation/devicetree/bindings/serial/samsung_uart.txt deleted +0 -58

58 lines not on this page · raw message

Documentation/devicetree/bindings/serial/samsung_uart.yaml new file +148 -0

148 lines not on this page · raw message

Signature · 6 lines
2.17.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#6 lore raw
In reply to Krzysztof Kozlowski
Quoted 14 lines · Krzysztof Kozlowski

The clkoutN names of clocks must be unique because they represent unique inputs of clock multiplexer.

---
 Documentation/devicetree/bindings/arm/samsung/pmu.yaml | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
Documentation/devicetree/bindings/arm/samsung/pmu.yaml +0 -0
index 73b56fc5bf58..d8e03716f5d2 100644

Documentation/devicetree/bindings/arm/samsung/pmu.yaml properties: · line 59

Quoted 9 lines
Documentation/devicetree/bindings/arm/samsung/pmu.yaml +4 -2
@@ -53,8 +53,10 @@ properties:
       List of clock names for particular CLKOUT mux inputs
     minItems: 1
     maxItems: 32
-    items:
-      pattern: '^clkout([0-9]|[12][0-9]|3[0-1])$'
+    allOf:
+      - items:
+          pattern: '^clkout([0-9]|[12][0-9]|3[0-1])$'
+      - uniqueItems: true

You shouldn't need the 'allOf', just add uniqueItems at the same level as items.

Rob

author maintainer
#7 lore raw
Quoted 10 lines · Rob Herring
Quoted 9 lines · Krzysztof Kozlowski

The clkoutN names of clocks must be unique because they represent unique inputs of clock multiplexer.

---
 Documentation/devicetree/bindings/arm/samsung/pmu.yaml | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
Quoted 16 lines
Quoted 5 lines
Documentation/devicetree/bindings/arm/samsung/pmu.yaml +0 -0
index 73b56fc5bf58..d8e03716f5d2 100644

Documentation/devicetree/bindings/arm/samsung/pmu.yaml properties: · line 59

Quoted 9 lines
Documentation/devicetree/bindings/arm/samsung/pmu.yaml +4 -2
@@ -53,8 +53,10 @@ properties:
       List of clock names for particular CLKOUT mux inputs
     minItems: 1
     maxItems: 32
-    items:
-      pattern: '^clkout([0-9]|[12][0-9]|3[0-1])$'
+    allOf:
+      - items:
+          pattern: '^clkout([0-9]|[12][0-9]|3[0-1])$'
+      - uniqueItems: true

You shouldn't need the 'allOf', just add uniqueItems at the same level as items.

If you mean something like:
56 uniqueItems: true
57 items:
58 pattern: '^clkout([0-9]|[12][0-9]|3[0-1])$'

Then the dt_binding_check fails:

dev/linux/Documentation/devicetree/bindings/arm/samsung/pmu.yaml: properties:clock-names:
'uniqueItems' is not one of ['$ref', 'additionalItems', 'additionalProperties', 'allOf', 'anyOf', 'const', 'contains', 'default', 'dependencies', 'deprecated', 'description', 'else', 'enum', 'items', 'if', 'minItems', 'minimum', 'maxItems', 'maximum', 'not', 'oneOf', 'pattern', 'patternProperties', 'properties', 'required', 'then', 'type', 'typeSize', 'unevaluatedProperties']

Best regards,
Krzysztof

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#8 lore raw
Quoted 34 lines · Krzysztof Kozlowski
Quoted 10 lines · Rob Herring
Quoted 9 lines · Krzysztof Kozlowski

The clkoutN names of clocks must be unique because they represent unique inputs of clock multiplexer.

---
 Documentation/devicetree/bindings/arm/samsung/pmu.yaml | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
Quoted 16 lines
Quoted 5 lines
Documentation/devicetree/bindings/arm/samsung/pmu.yaml +0 -0
index 73b56fc5bf58..d8e03716f5d2 100644

Documentation/devicetree/bindings/arm/samsung/pmu.yaml properties: · line 59

Quoted 9 lines
Documentation/devicetree/bindings/arm/samsung/pmu.yaml +4 -2
@@ -53,8 +53,10 @@ properties:
       List of clock names for particular CLKOUT mux inputs
     minItems: 1
     maxItems: 32
-    items:
-      pattern: '^clkout([0-9]|[12][0-9]|3[0-1])$'
+    allOf:
+      - items:
+          pattern: '^clkout([0-9]|[12][0-9]|3[0-1])$'
+      - uniqueItems: true

You shouldn't need the 'allOf', just add uniqueItems at the same level as items.

If you mean something like:
56 uniqueItems: true
57 items:
58 pattern: '^clkout([0-9]|[12][0-9]|3[0-1])$'

Quoted 4 lines

Then the dt_binding_check fails:

dev/linux/Documentation/devicetree/bindings/arm/samsung/pmu.yaml: properties:clock-names:
'uniqueItems' is not one of ['$ref', 'additionalItems', 'additionalProperties', 'allOf', 'anyOf', 'const', 'contains', 'default', 'dependencies', 'deprecated', 'description', 'else', 'enum', 'items', 'if', 'minItems', 'minimum', 'maxItems', 'maximum', 'not', 'oneOf', 'pattern', 'patternProperties', 'properties', 'required', 'then', 'type', 'typeSize', 'unevaluatedProperties']

I can add it.

The other option is to fix this in the clock schema. I'm not sure if there's a need for duplicate clock-names. Seems unlikely. I'll test that.

Rob

#9 lore raw
Quoted 38 lines · Rob Herring
Quoted 36 lines · Krzysztof Kozlowski
Quoted 10 lines · Rob Herring
Quoted 9 lines · Krzysztof Kozlowski

The clkoutN names of clocks must be unique because they represent unique inputs of clock multiplexer.

---
 Documentation/devicetree/bindings/arm/samsung/pmu.yaml | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
Quoted 16 lines
Quoted 5 lines
Documentation/devicetree/bindings/arm/samsung/pmu.yaml +0 -0
index 73b56fc5bf58..d8e03716f5d2 100644

Documentation/devicetree/bindings/arm/samsung/pmu.yaml properties: · line 59

Quoted 9 lines
Documentation/devicetree/bindings/arm/samsung/pmu.yaml +4 -2
@@ -53,8 +53,10 @@ properties:
       List of clock names for particular CLKOUT mux inputs
     minItems: 1
     maxItems: 32
-    items:
-      pattern: '^clkout([0-9]|[12][0-9]|3[0-1])$'
+    allOf:
+      - items:
+          pattern: '^clkout([0-9]|[12][0-9]|3[0-1])$'
+      - uniqueItems: true

You shouldn't need the 'allOf', just add uniqueItems at the same level as items.

If you mean something like:
56 uniqueItems: true
57 items:
58 pattern: '^clkout([0-9]|[12][0-9]|3[0-1])$'

Then the dt_binding_check fails:

Quoted 8 lines
Quoted 2 lines

dev/linux/Documentation/devicetree/bindings/arm/samsung/pmu.yaml: properties:clock-names:
'uniqueItems' is not one of ['$ref', 'additionalItems', 'additionalProperties', 'allOf', 'anyOf', 'const', 'contains', 'default', 'dependencies', 'deprecated', 'description', 'else', 'enum', 'items', 'if', 'minItems', 'minimum', 'maxItems', 'maximum', 'not', 'oneOf', 'pattern', 'patternProperties', 'properties', 'required', 'then', 'type', 'typeSize', 'unevaluatedProperties']

I can add it.

The other option is to fix this in the clock schema. I'm not sure if there's a need for duplicate clock-names. Seems unlikely. I'll test that.

Actually, clock-names is already set to be unique. Did you see otherwise?

Rob
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

author maintainer
#10 lore raw
Quoted 42 lines · Rob Herring
Quoted 41 lines · Rob Herring
Quoted 38 lines · Krzysztof Kozlowski
Quoted 10 lines · Rob Herring
Quoted 9 lines · Krzysztof Kozlowski

The clkoutN names of clocks must be unique because they represent unique inputs of clock multiplexer.

---
 Documentation/devicetree/bindings/arm/samsung/pmu.yaml | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
Quoted 16 lines
Quoted 5 lines
Documentation/devicetree/bindings/arm/samsung/pmu.yaml +0 -0
index 73b56fc5bf58..d8e03716f5d2 100644

Documentation/devicetree/bindings/arm/samsung/pmu.yaml properties: · line 59

Quoted 9 lines
Documentation/devicetree/bindings/arm/samsung/pmu.yaml +4 -2
@@ -53,8 +53,10 @@ properties:
       List of clock names for particular CLKOUT mux inputs
     minItems: 1
     maxItems: 32
-    items:
-      pattern: '^clkout([0-9]|[12][0-9]|3[0-1])$'
+    allOf:
+      - items:
+          pattern: '^clkout([0-9]|[12][0-9]|3[0-1])$'
+      - uniqueItems: true

You shouldn't need the 'allOf', just add uniqueItems at the same level as items.

If you mean something like:
56 uniqueItems: true
57 items:
58 pattern: '^clkout([0-9]|[12][0-9]|3[0-1])$'

Then the dt_binding_check fails:

dev/linux/Documentation/devicetree/bindings/arm/samsung/pmu.yaml: properties:clock-names:
'uniqueItems' is not one of ['$ref', 'additionalItems', 'additionalProperties', 'allOf', 'anyOf', 'const', 'contains', 'default', 'dependencies', 'deprecated', 'description', 'else', 'enum', 'items', 'if', 'minItems', 'minimum', 'maxItems', 'maximum', 'not', 'oneOf', 'pattern', 'patternProperties', 'properties', 'required', 'then', 'type', 'typeSize', 'unevaluatedProperties']

Quoted 7 lines
Quoted 5 lines

I can add it.

The other option is to fix this in the clock schema. I'm not sure if there's a need for duplicate clock-names. Seems unlikely. I'll test that.

Actually, clock-names is already set to be unique. Did you see otherwise?

Yeah, I duplicated on purpose "clkout1" and it was not reported as an error. That's why I added "uniqueItems".

Best regards,
Krzysztof

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#11 lore raw
Quoted 46 lines · Krzysztof Kozlowski
Quoted 44 lines · Rob Herring
Quoted 43 lines · Rob Herring
Quoted 34 lines · Krzysztof Kozlowski
Quoted 10 lines · Rob Herring
Quoted 9 lines · Krzysztof Kozlowski

The clkoutN names of clocks must be unique because they represent unique inputs of clock multiplexer.

---
 Documentation/devicetree/bindings/arm/samsung/pmu.yaml | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
Quoted 16 lines
Quoted 5 lines
Documentation/devicetree/bindings/arm/samsung/pmu.yaml +0 -0
index 73b56fc5bf58..d8e03716f5d2 100644

Documentation/devicetree/bindings/arm/samsung/pmu.yaml properties: · line 59

Quoted 9 lines
Documentation/devicetree/bindings/arm/samsung/pmu.yaml +4 -2
@@ -53,8 +53,10 @@ properties:
       List of clock names for particular CLKOUT mux inputs
     minItems: 1
     maxItems: 32
-    items:
-      pattern: '^clkout([0-9]|[12][0-9]|3[0-1])$'
+    allOf:
+      - items:
+          pattern: '^clkout([0-9]|[12][0-9]|3[0-1])$'
+      - uniqueItems: true

You shouldn't need the 'allOf', just add uniqueItems at the same level as items.

If you mean something like:
56 uniqueItems: true
57 items:
58 pattern: '^clkout([0-9]|[12][0-9]|3[0-1])$'

Quoted 4 lines

Then the dt_binding_check fails:

dev/linux/Documentation/devicetree/bindings/arm/samsung/pmu.yaml: properties:clock-names:
'uniqueItems' is not one of ['$ref', 'additionalItems', 'additionalProperties', 'allOf', 'anyOf', 'const', 'contains', 'default', 'dependencies', 'deprecated', 'description', 'else', 'enum', 'items', 'if', 'minItems', 'minimum', 'maxItems', 'maximum', 'not', 'oneOf', 'pattern', 'patternProperties', 'properties', 'required', 'then', 'type', 'typeSize', 'unevaluatedProperties']

I can add it.

Quoted 8 lines
Quoted 5 lines
Quoted 3 lines

The other option is to fix this in the clock schema. I'm not sure if there's a need for duplicate clock-names. Seems unlikely. I'll test that.

Actually, clock-names is already set to be unique. Did you see otherwise?

Yeah, I duplicated on purpose "clkout1" and it was not reported as an error. That's why I added "uniqueItems".

Are you running using DT_SCHEMA_FILES? If so, you won't get the core schema.

Rob

author maintainer
#12 lore raw
Quoted 1 line · Rob Herring

Are you running using DT_SCHEMA_FILES? If so, you won't get the core schema.

Ah, yes, now I see proper errors. Thanks for pointing this.

I'll send next version of this patch only (if others are ok).

Best regards,
Krzysztof

author maintainer
#13 lore raw
Quoted 7 lines · Krzysztof Kozlowski
Quoted 1 line · Rob Herring

Are you running using DT_SCHEMA_FILES? If so, you won't get the core schema.

Ah, yes, now I see proper errors. Thanks for pointing this.

I'll send next version of this patch only (if others are ok).

Of course, there will be no v2, this patch can be just skipped.

Best regards,
Krzysztof

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

maintainer Applied
#2 lore raw

Re: [PATCH 2/3] dt-bindings: gpu: samsung-rotator: Fix indentation

In reply to Krzysztof Kozlowski
Quoted 7 lines · Krzysztof Kozlowski

Array elements under 'items' should be indented.

---
 Documentation/devicetree/bindings/gpu/samsung-rotator.yaml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Applied, thanks.

Rob
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

maintainer
#4 lore raw

Re: [PATCH 3/3] dt-bindings: serial: Convert Samsung UART bindings to json-schema

In reply to Krzysztof Kozlowski
Quoted 125 lines · Krzysztof Kozlowski

Convert Samsung S3C/S5P/Exynos Serial/UART bindings to DT schema format using json-schema.

---
 .../bindings/mfd/samsung,exynos5433-lpass.txt |   2 +-
 .../bindings/serial/samsung_uart.txt          |  58 -------
 .../bindings/serial/samsung_uart.yaml         | 148 ++++++++++++++++++
 3 files changed, 149 insertions(+), 59 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/serial/samsung_uart.txt
 create mode 100644 Documentation/devicetree/bindings/serial/samsung_uart.yaml
Documentation/devicetree/bindings/mfd/samsung,exynos5433-lpass.txt +1 -1
index d759da606f75..30ea27c3936d 100644
@@ -18,7 +18,7 @@ an optional sub-node. For "samsung,exynos5433-lpass" compatible this includes:
 UART, SLIMBUS, PCM, I2S, DMAC, Timers 0...4, VIC, WDT 0...1 devices.
 
 Bindings of the sub-nodes are described in:
-  ../serial/samsung_uart.txt
+  ../serial/samsung_uart.yaml
   ../sound/samsung-i2s.txt
   ../dma/arm-pl330.txt
 
Documentation/devicetree/bindings/serial/samsung_uart.txt deleted +0 -58
deleted file mode 100644
index e85f37ec33f0..000000000000
@@ -1,58 +0,0 @@
-* Samsung's UART Controller
-
-The Samsung's UART controller is used for interfacing SoC with serial
-communicaion devices.
-
-Required properties:
-- compatible: should be one of following:
-  - "samsung,exynos4210-uart" -  Exynos4210 SoC,
-  - "samsung,s3c2410-uart" - compatible with ports present on S3C2410 SoC,
-  - "samsung,s3c2412-uart" - compatible with ports present on S3C2412 SoC,
-  - "samsung,s3c2440-uart" - compatible with ports present on S3C2440 SoC,
-  - "samsung,s3c6400-uart" - compatible with ports present on S3C6400 SoC,
-  - "samsung,s5pv210-uart" - compatible with ports present on S5PV210 SoC.
-
-- reg: base physical address of the controller and length of memory mapped
-  region.
-
-- interrupts: a single interrupt signal to SoC interrupt controller,
-  according to interrupt bindings documentation [1].
-
-- clock-names: input names of clocks used by the controller:
-  - "uart" - controller bus clock,
-  - "clk_uart_baudN" - Nth baud base clock input (N = 0, 1, ...),
-    according to SoC User's Manual (only N = 0 is allowedfor SoCs without
-    internal baud clock mux).
-- clocks: phandles and specifiers for all clocks specified in "clock-names"
-  property, in the same order, according to clock bindings documentation [2].
-
-[1] Documentation/devicetree/bindings/interrupt-controller/interrupts.txt
-[2] Documentation/devicetree/bindings/clock/clock-bindings.txt
-
-Optional properties:
-- samsung,uart-fifosize: The fifo size supported by the UART channel
-
-Note: Each Samsung UART should have an alias correctly numbered in the
-"aliases" node, according to serialN format, where N is the port number
-(non-negative decimal integer) as specified by User's Manual of respective
-SoC.
-
-Example:
-	aliases {
-		serial0 = &uart0;
-		serial1 = &uart1;
-		serial2 = &uart2;
-	};
-
-Example:
-	uart1: serial@7f005400 {
-		compatible = "samsung,s3c6400-uart";
-		reg = <0x7f005400 0x100>;
-		interrupt-parent = <&vic1>;
-		interrupts = <6>;
-		clock-names = "uart", "clk_uart_baud2",
-				"clk_uart_baud3";
-		clocks = <&clocks PCLK_UART1>, <&clocks PCLK_UART1>,
-				<&clocks SCLK_UART>;
-		samsung,uart-fifosize = <16>;
-	};
Documentation/devicetree/bindings/serial/samsung_uart.yaml new file +30 -0
new file mode 100644
index 000000000000..276bea1c231a
@@ -0,0 +1,148 @@
+# SPDX-License-Identifier: GPL-2.0
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/serial/samsung_uart.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Samsung S3C, S5P and Exynos SoC UART Controller
+
+maintainers:
+  - Krzysztof Kozlowski <[email protected]>
+  - Greg Kroah-Hartman <[email protected]>
+
+description: |+
+  Each Samsung UART should have an alias correctly numbered in the "aliases"
+  node, according to serialN format, where N is the port number (non-negative
+  decimal integer) as specified by User's Manual of respective SoC.
+
+properties:
+  compatible:
+    items:
+      - enum:
+          - samsung,s3c2410-uart
+          - samsung,s3c2412-uart
+          - samsung,s3c2440-uart
+          - samsung,s3c6400-uart
+          - samsung,s5pv210-uart
+          - samsung,exynos4210-uart
+
+  reg:
+    maxItems: 1

Documentation/devicetree/bindings/serial/samsung_uart.yaml line 40

Quoted 10 lines
Documentation/devicetree/bindings/serial/samsung_uart.yaml new file +10 -0
+
+  clocks:
+    minItems: 2
+    maxItems: 5
+
+  clock-names:
+    description: |
+      List of clock names:
+        - "uart" - controller bus clock,
+        - "clk_uart_baudN" - Nth baud base clock input (N = 0, 1, ...).

Kind of redundant to list this here.

Documentation/devicetree/bindings/serial/samsung_uart.yaml line 41

Quoted 1 line
Documentation/devicetree/bindings/serial/samsung_uart.yaml new file +1 -0
+      N = 0 is allowed for SoCs without internal baud clock mux.

You can add a description with the item:

items:
- pattern: '^clk_uart_baud[0-3]$'
description: N = 0 is allowed for SoCs without internal baud clock mux.

Or leave it here is fine too.

Documentation/devicetree/bindings/serial/samsung_uart.yaml line 45

Quoted 4 lines
Documentation/devicetree/bindings/serial/samsung_uart.yaml new file +4 -0
+    minItems: 2
+    maxItems: 5
+    allOf:
+      - uniqueItems: true

You can drop this.

Quoted 9 lines
Documentation/devicetree/bindings/serial/samsung_uart.yaml new file +9 -0
+      - oneOf:
+          - items:
+              - const: uart
+              - pattern: '^clk_uart_baud[0-3]$'
+          - items:
+              - const: uart
+              - pattern: '^clk_uart_baud[0-3]$'
+              - pattern: '^clk_uart_baud[0-3]$'
+          - items:

Documentation/devicetree/bindings/serial/samsung_uart.yaml line 64

Quoted 10 lines
Documentation/devicetree/bindings/serial/samsung_uart.yaml new file +10 -0
+              - const: uart
+              - pattern: '^clk_uart_baud[0-3]$'
+              - pattern: '^clk_uart_baud[0-3]$'
+              - pattern: '^clk_uart_baud[0-3]$'
+          - items:
+              - const: uart
+              - pattern: '^clk_uart_baud[0-3]$'
+              - pattern: '^clk_uart_baud[0-3]$'
+              - pattern: '^clk_uart_baud[0-3]$'
+              - pattern: '^clk_uart_baud[0-3]$'

You only need the last case. With 'minItems: 2', the additional items here will just be ignored.

Documentation/devicetree/bindings/serial/samsung_uart.yaml line 68

Quoted 4 lines
Documentation/devicetree/bindings/serial/samsung_uart.yaml new file +4 -0
+
+  interrupts:
+    minItems: 1
+    maxItems: 2

What is each item?

Quoted 30 lines
Documentation/devicetree/bindings/serial/samsung_uart.yaml new file +30 -0
+
+  samsung,uart-fifosize:
+    description: The fifo size supported by the UART channel
+    allOf:
+      - $ref: /schemas/types.yaml#/definitions/uint32
+      - enum: [16, 64, 256]
+
+required:
+  - compatible
+  - clocks
+  - clock-names
+  - interrupts
+  - reg
+
+allOf:
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - samsung,s3c2410-uart
+              - samsung,s5pv210-uart
+    then:
+      properties:
+        clocks:
+          minItems: 2
+          maxItems: 3
+        clock-names:
+          minItems: 2
+          maxItems: 3

Documentation/devicetree/bindings/serial/samsung_uart.yaml line 108

Quoted 10 lines
Documentation/devicetree/bindings/serial/samsung_uart.yaml new file +10 -0
+          allOf:
+            - uniqueItems: true
+            - oneOf:
+                - items:
+                    - const: uart
+                    - pattern: '^clk_uart_baud[0-1]$'
+                - items:
+                    - const: uart
+                    - pattern: '^clk_uart_baud[0-1]$'
+                    - pattern: '^clk_uart_baud[0-1]$'

Similar simplification can be done here.

Quoted 18 lines
Documentation/devicetree/bindings/serial/samsung_uart.yaml new file +18 -0
+
+  - if:
+      properties:
+        compatible:
+          contains:
+            enum:
+              - samsung,exynos4210-uart
+    then:
+      properties:
+        clocks:
+          minItems: 2
+          maxItems: 2
+        clock-names:
+          minItems: 2
+          maxItems: 2
+          allOf:
+            - uniqueItems: true
+            - items:

Documentation/devicetree/bindings/serial/samsung_uart.yaml line 136

Quoted 10 lines
Documentation/devicetree/bindings/serial/samsung_uart.yaml new file +10 -0
+                - const: uart
+                - const: clk_uart_baud0
+
+examples:
+  - |
+    #include <dt-bindings/clock/samsung,s3c64xx-clock.h>
+
+    aliases {
+        serial0 = &uart0;
+    };

Drop this. It will cause a warning if we enforce 'aliases' to be at the root node.

Quoted 15 lines
Documentation/devicetree/bindings/serial/samsung_uart.yaml new file +12 -0
+
+    uart0: serial@7f005000 {
+        compatible = "samsung,s3c6400-uart";
+        reg = <0x7f005000 0x100>;
+        interrupt-parent = <&vic1>;
+        interrupts = <5>;
+        clock-names = "uart", "clk_uart_baud2",
+                      "clk_uart_baud3";
+        clocks = <&clocks PCLK_UART0>, <&clocks PCLK_UART0>,
+                 <&clocks SCLK_UART>;
+        samsung,uart-fifosize = <16>;
+    };
Signature · 1 line
2.17.1
author maintainer Applied
#5 lore raw

Re: [PATCH 3/3] dt-bindings: serial: Convert Samsung UART bindings to json-schema

Quoted 139 lines · Rob Herring
Quoted 125 lines · Krzysztof Kozlowski

Convert Samsung S3C/S5P/Exynos Serial/UART bindings to DT schema format using json-schema.

---
 .../bindings/mfd/samsung,exynos5433-lpass.txt |   2 +-
 .../bindings/serial/samsung_uart.txt          |  58 -------
 .../bindings/serial/samsung_uart.yaml         | 148 ++++++++++++++++++
 3 files changed, 149 insertions(+), 59 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/serial/samsung_uart.txt
 create mode 100644 Documentation/devicetree/bindings/serial/samsung_uart.yaml
Documentation/devicetree/bindings/mfd/samsung,exynos5433-lpass.txt +1 -1
index d759da606f75..30ea27c3936d 100644
@@ -18,7 +18,7 @@ an optional sub-node. For "samsung,exynos5433-lpass" compatible this includes:
 UART, SLIMBUS, PCM, I2S, DMAC, Timers 0...4, VIC, WDT 0...1 devices.
 
 Bindings of the sub-nodes are described in:
-  ../serial/samsung_uart.txt
+  ../serial/samsung_uart.yaml
   ../sound/samsung-i2s.txt
   ../dma/arm-pl330.txt
 
Documentation/devicetree/bindings/serial/samsung_uart.txt deleted +0 -58
deleted file mode 100644
index e85f37ec33f0..000000000000
@@ -1,58 +0,0 @@
-* Samsung's UART Controller
-
-The Samsung's UART controller is used for interfacing SoC with serial
-communicaion devices.
-
-Required properties:
-- compatible: should be one of following:
-  - "samsung,exynos4210-uart" -  Exynos4210 SoC,
-  - "samsung,s3c2410-uart" - compatible with ports present on S3C2410 SoC,
-  - "samsung,s3c2412-uart" - compatible with ports present on S3C2412 SoC,
-  - "samsung,s3c2440-uart" - compatible with ports present on S3C2440 SoC,
-  - "samsung,s3c6400-uart" - compatible with ports present on S3C6400 SoC,
-  - "samsung,s5pv210-uart" - compatible with ports present on S5PV210 SoC.
-
-- reg: base physical address of the controller and length of memory mapped
-  region.
-
-- interrupts: a single interrupt signal to SoC interrupt controller,
-  according to interrupt bindings documentation [1].
-
-- clock-names: input names of clocks used by the controller:
-  - "uart" - controller bus clock,
-  - "clk_uart_baudN" - Nth baud base clock input (N = 0, 1, ...),
-    according to SoC User's Manual (only N = 0 is allowedfor SoCs without
-    internal baud clock mux).
-- clocks: phandles and specifiers for all clocks specified in "clock-names"
-  property, in the same order, according to clock bindings documentation [2].
-
-[1] Documentation/devicetree/bindings/interrupt-controller/interrupts.txt
-[2] Documentation/devicetree/bindings/clock/clock-bindings.txt
-
-Optional properties:
-- samsung,uart-fifosize: The fifo size supported by the UART channel
-
-Note: Each Samsung UART should have an alias correctly numbered in the
-"aliases" node, according to serialN format, where N is the port number
-(non-negative decimal integer) as specified by User's Manual of respective
-SoC.
-
-Example:
-	aliases {
-		serial0 = &uart0;
-		serial1 = &uart1;
-		serial2 = &uart2;
-	};
-
-Example:
-	uart1: serial@7f005400 {
-		compatible = "samsung,s3c6400-uart";
-		reg = <0x7f005400 0x100>;
-		interrupt-parent = <&vic1>;
-		interrupts = <6>;
-		clock-names = "uart", "clk_uart_baud2",
-				"clk_uart_baud3";
-		clocks = <&clocks PCLK_UART1>, <&clocks PCLK_UART1>,
-				<&clocks SCLK_UART>;
-		samsung,uart-fifosize = <16>;
-	};
Documentation/devicetree/bindings/serial/samsung_uart.yaml new file +30 -0
new file mode 100644
index 000000000000..276bea1c231a
@@ -0,0 +1,148 @@
+# SPDX-License-Identifier: GPL-2.0
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/serial/samsung_uart.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Samsung S3C, S5P and Exynos SoC UART Controller
+
+maintainers:
+  - Krzysztof Kozlowski <[email protected]>
+  - Greg Kroah-Hartman <[email protected]>
+
+description: |+
+  Each Samsung UART should have an alias correctly numbered in the "aliases"
+  node, according to serialN format, where N is the port number (non-negative
+  decimal integer) as specified by User's Manual of respective SoC.
+
+properties:
+  compatible:
+    items:
+      - enum:
+          - samsung,s3c2410-uart
+          - samsung,s3c2412-uart
+          - samsung,s3c2440-uart
+          - samsung,s3c6400-uart
+          - samsung,s5pv210-uart
+          - samsung,exynos4210-uart
+
+  reg:
+    maxItems: 1

Documentation/devicetree/bindings/serial/samsung_uart.yaml line 40

Quoted 10 lines
Documentation/devicetree/bindings/serial/samsung_uart.yaml new file +10 -0
+
+  clocks:
+    minItems: 2
+    maxItems: 5
+
+  clock-names:
+    description: |
+      List of clock names:
+        - "uart" - controller bus clock,
+        - "clk_uart_baudN" - Nth baud base clock input (N = 0, 1, ...).

Kind of redundant to list this here.

Quoted 8 lines

Documentation/devicetree/bindings/serial/samsung_uart.yaml line 41

Quoted 1 line
Documentation/devicetree/bindings/serial/samsung_uart.yaml new file +1 -0
+      N = 0 is allowed for SoCs without internal baud clock mux.

You can add a description with the item:

items:
- pattern: '^clk_uart_baud[0-3]$'
description: N = 0 is allowed for SoCs without internal baud clock mux.

This caused error:
properties:clock-names:items:1: Additional properties are not allowed ('description' was unexpected) ../Documentation/devicetree/bindings/Makefile:12: recipe for target 'Documentation/devicetree/bindings/serial/samsung_uart.example.dts' failed

I applied rest of comments. Thanks for review!

Best regards,
Krzysztof