Skip to contentSkip to conversation

dt-bindings: serial: convert st,asc to DT schema

PATCH In review Raphael Gallais-Pou 2 participants 5 messages Feb 25, 2024 – Feb 26, 2024

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dt-bindings: serial: convert st,asc to DT schema

Converts st,asc binding to DT schema format and update example.

---
 .../devicetree/bindings/serial/st,asc.yaml    | 57 +++++++++++++++++++
 .../devicetree/bindings/serial/st-asc.txt     | 18 ------
 2 files changed, 57 insertions(+), 18 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/serial/st,asc.yaml
 delete mode 100644 Documentation/devicetree/bindings/serial/st-asc.txt
Documentation/devicetree/bindings/serial/st,asc.yaml new file +57 -0
new file mode 100644
index 000000000000..b26e1d247346
@@ -0,0 +1,57 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/serial/st,asc.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: STMicroelectronics STi SoCs Serial Port
+
+maintainers:
+  - Patrice Chotard <[email protected]>
+
+allOf:
+  - $ref: serial.yaml#
+
+properties:
+  compatible:
+    const: st,asc
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+  clocks:
+    maxItems: 1
+
+  uart-has-rtscts: true
+
+  st,hw-flow-ctrl:
+    description: When set, enable hardware flow control.
+    type: boolean
+
+  st,force-m1:
+    description: When set, force asc to be in Mode-1. This is recommended for
+      high bit rates above 19.2K.
+    type: boolean
+
+required:
+  - compatible
+  - reg
+  - interrupts
+  - clocks
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/clock/stih407-clks.h>
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+    serial@9830000 {
+        compatible = "st,asc";
+        reg = <0x9830000 0x2c>;
+        interrupts = <GIC_SPI 122 IRQ_TYPE_LEVEL_HIGH>;
+        clocks = <&clk_s_c0_flexgen CLK_EXT2F_A9>;
+    };
+...
Documentation/devicetree/bindings/serial/st-asc.txt deleted +0 -18
deleted file mode 100644
index a1b9b6f3490a..000000000000
@@ -1,18 +0,0 @@
-*st-asc(Serial Port)
-
-Required properties:
-- compatible : Should be "st,asc".
-- reg, reg-names, interrupts, interrupt-names	: Standard way to define device
-			resources with names. look in
-			Documentation/devicetree/bindings/resource-names.txt
-
-Optional properties:
-- st,hw-flow-ctrl	bool flag to enable hardware flow control.
-- st,force-m1		bool flat to force asc to be in Mode-1 recommended
-			for high bit rates (above 19.2K)
-Example:
-serial@fe440000{
-    compatible    = "st,asc";
-    reg         = <0xfe440000 0x2c>;
-    interrupts     =  <0 209 0>;
-};
Signature · 1 line
2.43.2
#1 lore raw
Quoted 32 lines · Raphael Gallais-Pou

Converts st,asc binding to DT schema format and update example.

---
 .../devicetree/bindings/serial/st,asc.yaml    | 57 +++++++++++++++++++
 .../devicetree/bindings/serial/st-asc.txt     | 18 ------
 2 files changed, 57 insertions(+), 18 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/serial/st,asc.yaml
 delete mode 100644 Documentation/devicetree/bindings/serial/st-asc.txt
Documentation/devicetree/bindings/serial/st,asc.yaml new file +16 -0
new file mode 100644
index 000000000000..b26e1d247346
@@ -0,0 +1,57 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/serial/st,asc.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: STMicroelectronics STi SoCs Serial Port
+
+maintainers:
+  - Patrice Chotard <[email protected]>
+
+allOf:
+  - $ref: serial.yaml#
+
+properties:
+  compatible:

Documentation/devicetree/bindings/serial/st,asc.yaml line 26

Quoted 10 lines
Documentation/devicetree/bindings/serial/st,asc.yaml new file +10 -0
+    const: st,asc
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+  clocks:
+    maxItems: 1

This wasn't here before and your commit msg does not explain it.

Documentation/devicetree/bindings/serial/st,asc.yaml line 28

Quoted 2 lines
Documentation/devicetree/bindings/serial/st,asc.yaml new file +2 -0
+
+  uart-has-rtscts: true

Drop, not needed.

Quoted 5 lines
Documentation/devicetree/bindings/serial/st,asc.yaml new file +5 -0
+
+  st,hw-flow-ctrl:
+    description: When set, enable hardware flow control.
+    type: boolean
+

Documentation/devicetree/bindings/serial/st,asc.yaml line 43

Quoted 10 lines
Documentation/devicetree/bindings/serial/st,asc.yaml new file +10 -0
+  st,force-m1:
+    description: When set, force asc to be in Mode-1. This is recommended for
+      high bit rates above 19.2K.
+    type: boolean
+
+required:
+  - compatible
+  - reg
+  - interrupts
+  - clocks

Also something new.

Best regards,
Krzysztof

#2 lore raw

Hi Krzysztof,

Le 25/02/2024 à 16:42, Krzysztof Kozlowski a écrit :

Quoted 37 lines · Raphael Gallais-Pou
Quoted 36 lines

Converts st,asc binding to DT schema format and update example.

---
  .../devicetree/bindings/serial/st,asc.yaml    | 57 +++++++++++++++++++
  .../devicetree/bindings/serial/st-asc.txt     | 18 ------
  2 files changed, 57 insertions(+), 18 deletions(-)

create mode 100644 Documentation/devicetree/bindings/serial/st,asc.yaml delete mode 100644 Documentation/devicetree/bindings/serial/st-asc.txt

Documentation/devicetree/bindings/serial/st,asc.yaml new file +20 -0
new file mode 100644
index 000000000000..b26e1d247346
@@ -0,0 +1,57 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/serial/st,asc.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: STMicroelectronics STi SoCs Serial Port
+
+maintainers:
+  - Patrice Chotard <[email protected]>
+
+allOf:
+  - $ref: serial.yaml#
+
+properties:
+  compatible:
+    const: st,asc
+
+  reg:
+    maxItems: 1
Quoted 8 lines

Documentation/devicetree/bindings/serial/st,asc.yaml line 26

Quoted 6 lines
Documentation/devicetree/bindings/serial/st,asc.yaml new file +6 -0
+
+  interrupts:
+    maxItems: 1
+
+  clocks:
+    maxItems: 1

This wasn't here before and your commit msg does not explain it.

Looking at the device-tree I found that every instance of this device refers to a phandle of a clock.

Moreover in the driver of the device, the probe fails if it does not find a clock, hence this addition.

cf. drivers/tty/serial/st-asc.c:701

Quoted 5 lines

Documentation/devicetree/bindings/serial/st,asc.yaml line 28

Quoted 3 lines
Documentation/devicetree/bindings/serial/st,asc.yaml new file +2 -0
+
+  uart-has-rtscts: true

Drop, not needed.

Ack

Quoted 10 lines
Quoted 10 lines
Documentation/devicetree/bindings/serial/st,asc.yaml new file +9 -0
+
+  st,hw-flow-ctrl:
+    description: When set, enable hardware flow control.
+    type: boolean
+
+  st,force-m1:
+    description: When set, force asc to be in Mode-1. This is recommended for
+      high bit rates above 19.2K.
+    type: boolean
Quoted 8 lines

Documentation/devicetree/bindings/serial/st,asc.yaml line 43

Quoted 6 lines
Documentation/devicetree/bindings/serial/st,asc.yaml new file +6 -0
+
+required:
+  - compatible
+  - reg
+  - interrupts
+  - clocks

Also something new.

This is linked to the addition above.

If you agree with this change I will send a v2 explaining this.

Regards,
Raphaël

Quoted 7 lines

Best regards,
Krzysztof

#3 lore raw
Quoted 19 lines · Raphaël Gallais-Pou
Quoted 10 lines
Quoted 10 lines
Documentation/devicetree/bindings/serial/st,asc.yaml new file +10 -0
+
+allOf:
+  - $ref: serial.yaml#
+
+properties:
+  compatible:
+    const: st,asc
+
+  reg:
+    maxItems: 1
Quoted 8 lines

Documentation/devicetree/bindings/serial/st,asc.yaml line 26

Quoted 6 lines
Documentation/devicetree/bindings/serial/st,asc.yaml new file +6 -0
+
+  interrupts:
+    maxItems: 1
+
+  clocks:
+    maxItems: 1

This wasn't here before and your commit msg does not explain it.

Quoted 7 lines

Looking at the device-tree I found that every instance of this device refers to a phandle of a clock.

Moreover in the driver of the device, the probe fails if it does not find a clock, hence this addition.

cf. drivers/tty/serial/st-asc.c:701

Commit msg should explain differences from pure conversion and the reason behind. Otherwise how can we know why you did it?

Best regards,
Krzysztof

#4 lore raw

Le 26/02/2024 à 09:09, Krzysztof Kozlowski a écrit :

Quoted 23 lines · Raphaël Gallais-Pou
Quoted 22 lines
Quoted 10 lines
Quoted 10 lines
Documentation/devicetree/bindings/serial/st,asc.yaml new file +10 -0
+
+allOf:
+  - $ref: serial.yaml#
+
+properties:
+  compatible:
+    const: st,asc
+
+  reg:
+    maxItems: 1
Quoted 8 lines

Documentation/devicetree/bindings/serial/st,asc.yaml line 26

Quoted 6 lines
Documentation/devicetree/bindings/serial/st,asc.yaml new file +6 -0
+
+  interrupts:
+    maxItems: 1
+
+  clocks:
+    maxItems: 1

This wasn't here before and your commit msg does not explain it.

Looking at the device-tree I found that every instance of this device refers to a phandle of a clock.

Quoted 7 lines
Quoted 4 lines

Moreover in the driver of the device, the probe fails if it does not find a clock, hence this addition.

cf. drivers/tty/serial/st-asc.c:701

Commit msg should explain differences from pure conversion and the reason behind. Otherwise how can we know why you did it?

Indeed, I will change the commit log.

Regards,
Raphaël

Quoted 5 lines

Best regards,
Krzysztof