Skip to contentSkip to conversation

dt-bindings: serial: pl011: Fix some dtbs_check warnings

PATCH In review Zhen Lei 2 participants 9 messages Apr 22, 2021 – May 6, 2021

Subsystems (3)
lore
Share & tools
lore

Zhen Lei

author
#0 lore raw

v2 cover dt-bindings: serial: pl011: Fix some dtbs_check warnings

v1 --> v2:
1) Change to reference the kernel-defined serial.yaml
2) Move the new added "label: true" into /schemas/serial/serial.yaml

Zhen Lei (3):
dt-bindings: serial: Normalize the node name of the serial port
dt-bindings: serial: pl011: Change to reference the kernel-defined
serial.yaml
dt-bindings: serial: Add label property in serial.yaml

 Documentation/devicetree/bindings/serial/pl011.yaml  | 4 ++--
 Documentation/devicetree/bindings/serial/serial.yaml | 4 +++-
 2 files changed, 5 insertions(+), 3 deletions(-)
Signature · 1 line
2.21.1
author
#1 lore raw

PATCH v2 1/3 dt-bindings: serial: Normalize the node name of the serial port

Only letters, digits, and commas that describe the base address of the serial port in hexadecimal format are allowed.

---
 Documentation/devicetree/bindings/serial/serial.yaml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Documentation/devicetree/bindings/serial/serial.yaml +1 -1
index 65e75d040521..71aec7fda07d 100644
@@ -21,7 +21,7 @@ description:
 
 properties:
   $nodename:
-    pattern: "^serial(@.*)?$"
+    pattern: "^serial(@[0-9a-f,]+)?$"
 
   cts-gpios:
     maxItems: 1
Signature · 1 line
2.21.1
maintainer
#2 lore raw

Re: [PATCH v2 1/3] dt-bindings: serial: Normalize the node name of the serial port

Quoted 13 lines · Zhen Lei

Only letters, digits, and commas that describe the base address of the serial port in hexadecimal format are allowed.

---
 Documentation/devicetree/bindings/serial/serial.yaml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Documentation/devicetree/bindings/serial/serial.yaml +0 -0
index 65e75d040521..71aec7fda07d 100644

Documentation/devicetree/bindings/serial/serial.yaml description: · line 24

Quoted 5 lines
Documentation/devicetree/bindings/serial/serial.yaml +1 -1
@@ -21,7 +21,7 @@ description:
 
 properties:
   $nodename:
-    pattern: "^serial(@.*)?$"
+    pattern: "^serial(@[0-9a-f,]+)?$"

The format of unit-addresses is dictated by the bus (parent), so this is the wrong place to enforce this.

Rob

#3 lore raw

Re: [PATCH v2 1/3] dt-bindings: serial: Normalize the node name of the serial port

Quoted 15 lines · Rob Herring
Quoted 14 lines · Zhen Lei

Only letters, digits, and commas that describe the base address of the serial port in hexadecimal format are allowed.

---
 Documentation/devicetree/bindings/serial/serial.yaml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Documentation/devicetree/bindings/serial/serial.yaml +0 -0
index 65e75d040521..71aec7fda07d 100644
@@ -21,7 +21,7 @@ description:
 
Quoted 7 lines

Documentation/devicetree/bindings/serial/serial.yaml description: · line 24

Quoted 4 lines
Documentation/devicetree/bindings/serial/serial.yaml +1 -1
 properties:
   $nodename:
-    pattern: "^serial(@.*)?$"
+    pattern: "^serial(@[0-9a-f,]+)?$"

The format of unit-addresses is dictated by the bus (parent), so this is the wrong place to enforce this.

Okay, so I'll leave this place unchanged.

Quoted 5 lines

Rob

.

author
#4 lore raw

PATCH v2 2/3 dt-bindings: serial: pl011: Change to reference the kernel-defined serial.yaml

In reply to Zhen Lei

The /schemas/serial.yaml from dt-schema only has the property $nodename, whereas the kernel-defined /schemas/serial/serial.yaml contains more useful properties, support for more complex application scenarios.

For example:
1) The property "current-speed" in fsl-lx2160a.dtsi
2) The subnode "bluetooth" in hi3660-hikey960.dts

---
 Documentation/devicetree/bindings/serial/pl011.yaml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Documentation/devicetree/bindings/serial/pl011.yaml +2 -2
index 1f8e9f2644b6..142187337c76 100644
@@ -10,7 +10,7 @@ maintainers:
   - Rob Herring <[email protected]>
 
 allOf:
-  - $ref: /schemas/serial.yaml#
+  - $ref: serial.yaml#
 
 # Need a custom select here or 'arm,primecell' will match on lots of nodes
 select:
@@ -103,7 +103,7 @@ dependencies:
   poll-rate-ms: [ auto-poll ]
   poll-timeout-ms: [ auto-poll ]
 
-additionalProperties: false
+unevaluatedProperties: false
 
 examples:
   - |
Signature · 1 line
2.21.1
maintainer
#5 lore raw

Re: [PATCH v2 2/3] dt-bindings: serial: pl011: Change to reference the kernel-defined serial.yaml

Quoted 4 lines · Zhen Lei

The /schemas/serial.yaml from dt-schema only has the property $nodename, whereas the kernel-defined /schemas/serial/serial.yaml contains more useful properties, support for more complex application scenarios.

Quoted 8 lines

For example:
1) The property "current-speed" in fsl-lx2160a.dtsi
2) The subnode "bluetooth" in hi3660-hikey960.dts

---
 Documentation/devicetree/bindings/serial/pl011.yaml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

What about all these:

$ git grep 'schemas/serial.yaml'
Documentation/devicetree/bindings/serial/8250.yaml:  - $ref: /schemas/serial.yaml#
Documentation/devicetree/bindings/serial/brcm,bcm7271-uart.yaml:  - $ref: /schemas/serial.yaml#
Documentation/devicetree/bindings/serial/ingenic,uart.yaml:  - $ref: /schemas/serial.yaml#
Documentation/devicetree/bindings/serial/pl011.yaml:  - $ref: /schemas/serial.yaml#
Documentation/devicetree/bindings/serial/qca,ar9330-uart.yaml:  - $ref: /schemas/serial.yaml#
Documentation/devicetree/bindings/serial/samsung_uart.yaml:  - $ref: /schemas/serial.yaml#
Documentation/devicetree/bindings/serial/sifive-serial.yaml:  - $ref: /schemas/serial.yaml#
Documentation/devicetree/bindings/serial/snps-dw-apb-uart.yaml:  - $ref: /schemas/serial.yaml#
Documentation/devicetree/bindings/soc/qcom/qcom,geni-se.yaml:    $ref: /schemas/serial.yaml#
#6 lore raw

Re: [PATCH v2 2/3] dt-bindings: serial: pl011: Change to reference the kernel-defined serial.yaml

Quoted 9 lines · Rob Herring
Quoted 8 lines · Zhen Lei

The /schemas/serial.yaml from dt-schema only has the property $nodename, whereas the kernel-defined /schemas/serial/serial.yaml contains more useful properties, support for more complex application scenarios.

For example:
1) The property "current-speed" in fsl-lx2160a.dtsi
2) The subnode "bluetooth" in hi3660-hikey960.dts

Quoted 6 lines
Quoted 4 lines
---
 Documentation/devicetree/bindings/serial/pl011.yaml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

What about all these:

Currently, the extended attributes described in /schemas/serial/serial.yaml are not referenced in the dts of other serial ports except pl011. So I didn't change them. At least I run dtbs_check one by one on the ARM64 platform, no warning is reported. Now, it seems that I was wrong, /schemas/serial/serial.yaml is applicable to all serial ports. Even if those attributes are not currently referenced, the reference relationship should be corrected in advance.

Quoted 14 lines
$ git grep 'schemas/serial.yaml'
Documentation/devicetree/bindings/serial/8250.yaml:  - $ref: /schemas/serial.yaml#
Documentation/devicetree/bindings/serial/brcm,bcm7271-uart.yaml:  - $ref: /schemas/serial.yaml#
Documentation/devicetree/bindings/serial/ingenic,uart.yaml:  - $ref: /schemas/serial.yaml#
Documentation/devicetree/bindings/serial/pl011.yaml:  - $ref: /schemas/serial.yaml#
Documentation/devicetree/bindings/serial/qca,ar9330-uart.yaml:  - $ref: /schemas/serial.yaml#
Documentation/devicetree/bindings/serial/samsung_uart.yaml:  - $ref: /schemas/serial.yaml#
Documentation/devicetree/bindings/serial/sifive-serial.yaml:  - $ref: /schemas/serial.yaml#
Documentation/devicetree/bindings/serial/snps-dw-apb-uart.yaml:  - $ref: /schemas/serial.yaml#
Documentation/devicetree/bindings/soc/qcom/qcom,geni-se.yaml:    $ref: /schemas/serial.yaml#

.

author
#7 lore raw

PATCH v2 3/3 dt-bindings: serial: Add label property in serial.yaml

In reply to Zhen Lei

When there is more than one serial port present, the property 'label' allows a custom name to be used for briefly describe the usage or position of each serial port.

Without this "label" property, many dtbs_check warnings similar to the following are reported:
arch/arm64/boot/dts/hisilicon/hi3660-hikey960.dt.yaml: \
serial@ffd74000: Additional properties are not allowed ('label' was unexpected)
From schema: Documentation/devicetree/bindings/serial/pl011.yaml

---
 Documentation/devicetree/bindings/serial/serial.yaml | 2 ++
 1 file changed, 2 insertions(+)
Documentation/devicetree/bindings/serial/serial.yaml +2 -0
index 71aec7fda07d..04ec229cbb4f 100644
@@ -23,6 +23,8 @@ properties:
   $nodename:
     pattern: "^serial(@[0-9a-f,]+)?$"
 
+  label: true
+
   cts-gpios:
     maxItems: 1
     description:
Signature · 1 line
2.21.1
maintainer Reviewed-by on v2 3/3
#8 lore raw

Re: [PATCH v2 3/3] dt-bindings: serial: Add label property in serial.yaml

Quoted 10 lines · Zhen Lei

When there is more than one serial port present, the property 'label' allows a custom name to be used for briefly describe the usage or position of each serial port.

Without this "label" property, many dtbs_check warnings similar to the following are reported:
arch/arm64/boot/dts/hisilicon/hi3660-hikey960.dt.yaml: \
serial@ffd74000: Additional properties are not allowed ('label' was unexpected)
From schema: Documentation/devicetree/bindings/serial/pl011.yaml

Quoted 5 lines
---
 Documentation/devicetree/bindings/serial/serial.yaml | 2 ++
 1 file changed, 2 insertions(+)