Skip to contentSkip to conversation

dt-bindings: serial: samsung: add DMA properties

PATCH In review Krzysztof Kozlowski 2 participants 5 messages Feb 12, 2021 – Mar 7, 2021

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

PATCH 1/2 dt-bindings: serial: samsung: add DMA properties

The Samsung SoC UART nodes have usually DMA so dtschema has to reflect this to fix dtbs_check warnings like:

arch/arm/boot/dts/exynos4210-smdkv310.dt.yaml: serial@13800000:
'dma-names', 'dmas' do not match any of the regexes: 'pinctrl-[0-9]+'

---
 .../devicetree/bindings/serial/samsung_uart.yaml       | 10 ++++++++++
 1 file changed, 10 insertions(+)
Documentation/devicetree/bindings/serial/samsung_uart.yaml +10 -0
index 21ee627b2ced..3e29b561223d 100644
@@ -51,6 +51,16 @@ properties:
       - pattern: '^clk_uart_baud[0-3]$'
       - pattern: '^clk_uart_baud[0-3]$'
 
+  dmas:
+    items:
+      - description: DMA controller phandle and request line for RX
+      - description: DMA controller phandle and request line for TX
+
+  dma-names:
+    items:
+      - const: rx
+      - const: tx
+
   interrupts:
     description: RX interrupt and optionally TX interrupt.
     minItems: 1
Signature · 1 line
2.25.1
#1 lore raw

PATCH 2/2 dt-bindings: serial: samsung: include generic dtschema to match bluetooth child

Include the generic serial.yaml dtschema so the child node like "bluetooh" will be properly matched:

arch/arm/boot/dts/exynos4210-universal_c210.dt.yaml:

    serial@13800000: 'bluetooth' does not match any of the regexes: 'pinctrl-[0-9]+'
---
 .../bindings/serial/samsung_uart.yaml         | 26 ++++++++++++++++++-
 1 file changed, 25 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/serial/samsung_uart.yaml +25 -1
index 3e29b561223d..f4faf32ab00f 100644
@@ -78,9 +78,11 @@ required:
   - interrupts
   - reg
 
-additionalProperties: false
+unevaluatedProperties: false
 
 allOf:
+  - $ref: /schemas/serial.yaml#
+
   - if:
       properties:
         compatible:
@@ -134,3 +136,25 @@ examples:
                  <&clocks SCLK_UART>;
         samsung,uart-fifosize = <16>;
     };
+
+  - |
+    #include <dt-bindings/clock/exynos4.h>
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+
+    serial@13800000 {
+        compatible = "samsung,exynos4210-uart";
+        reg = <0x13800000 0x100>;
+        interrupts = <GIC_SPI 52 IRQ_TYPE_LEVEL_HIGH>;
+        clocks = <&clock CLK_UART0>, <&clock CLK_SCLK_UART0>;
+        clock-names = "uart", "clk_uart_baud0";
+        dmas = <&pdma0 15>, <&pdma0 16>;
+        dma-names = "rx", "tx";
+        pinctrl-0 = <&uart0_data &uart0_fctl>;
+        pinctrl-names = "default";
+
+        bluetooth {
+            compatible = "brcm,bcm4330-bt";
+            pinctrl-0 = <&bt_shutdown &bt_device_wakeup &bt_host_wakeup>;
+            pinctrl-names = "default";
+        };
+    };
Signature · 1 line
2.25.1
maintainer
#2 lore raw

Re: [PATCH 2/2] dt-bindings: serial: samsung: include generic dtschema to match bluetooth child

Quoted 40 lines · Krzysztof Kozlowski

Include the generic serial.yaml dtschema so the child node like "bluetooh" will be properly matched:

arch/arm/boot/dts/exynos4210-universal_c210.dt.yaml:

    serial@13800000: 'bluetooth' does not match any of the regexes: 'pinctrl-[0-9]+'
---
 .../bindings/serial/samsung_uart.yaml         | 26 ++++++++++++++++++-
 1 file changed, 25 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/serial/samsung_uart.yaml +11 -1
index 3e29b561223d..f4faf32ab00f 100644
@@ -78,9 +78,11 @@ required:
   - interrupts
   - reg
 
-additionalProperties: false
+unevaluatedProperties: false
 
 allOf:
+  - $ref: /schemas/serial.yaml#
+
   - if:
       properties:
         compatible:
@@ -134,3 +136,25 @@ examples:
                  <&clocks SCLK_UART>;
         samsung,uart-fifosize = <16>;
     };
+
+  - |
+    #include <dt-bindings/clock/exynos4.h>
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+
+    serial@13800000 {
+        compatible = "samsung,exynos4210-uart";
+        reg = <0x13800000 0x100>;

Documentation/devicetree/bindings/serial/samsung_uart.yaml examples: · line 156

Quoted 10 lines
Documentation/devicetree/bindings/serial/samsung_uart.yaml +10 -0
+        interrupts = <GIC_SPI 52 IRQ_TYPE_LEVEL_HIGH>;
+        clocks = <&clock CLK_UART0>, <&clock CLK_SCLK_UART0>;
+        clock-names = "uart", "clk_uart_baud0";
+        dmas = <&pdma0 15>, <&pdma0 16>;
+        dma-names = "rx", "tx";
+        pinctrl-0 = <&uart0_data &uart0_fctl>;
+        pinctrl-names = "default";
+
+        bluetooth {
+            compatible = "brcm,bcm4330-bt";

Do we need a whole new example for this?

I'm also trying to get rid compatibles without a schema so we can turn on warnings for that, but fortunately Linus is converting Broadcom BT. And looks like it should pass.

Rob

#3 lore raw

Re: [PATCH 2/2] dt-bindings: serial: samsung: include generic dtschema to match bluetooth child

Quoted 45 lines · Rob Herring
Quoted 44 lines · Krzysztof Kozlowski

Include the generic serial.yaml dtschema so the child node like "bluetooh" will be properly matched:

arch/arm/boot/dts/exynos4210-universal_c210.dt.yaml:

    serial@13800000: 'bluetooth' does not match any of the regexes: 'pinctrl-[0-9]+'
---
 .../bindings/serial/samsung_uart.yaml         | 26 ++++++++++++++++++-
 1 file changed, 25 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/serial/samsung_uart.yaml +15 -1
index 3e29b561223d..f4faf32ab00f 100644
@@ -78,9 +78,11 @@ required:
   - interrupts
   - reg
 
-additionalProperties: false
+unevaluatedProperties: false
 
 allOf:
+  - $ref: /schemas/serial.yaml#
+
   - if:
       properties:
         compatible:
@@ -134,3 +136,25 @@ examples:
                  <&clocks SCLK_UART>;
         samsung,uart-fifosize = <16>;
     };
+
+  - |
+    #include <dt-bindings/clock/exynos4.h>
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+
+    serial@13800000 {
+        compatible = "samsung,exynos4210-uart";
+        reg = <0x13800000 0x100>;
+        interrupts = <GIC_SPI 52 IRQ_TYPE_LEVEL_HIGH>;
+        clocks = <&clock CLK_UART0>, <&clock CLK_SCLK_UART0>;
+        clock-names = "uart", "clk_uart_baud0";
+        dmas = <&pdma0 15>, <&pdma0 16>;
Quoted 8 lines

Documentation/devicetree/bindings/serial/samsung_uart.yaml examples: · line 156

Quoted 6 lines
Documentation/devicetree/bindings/serial/samsung_uart.yaml +6 -0
+        dma-names = "rx", "tx";
+        pinctrl-0 = <&uart0_data &uart0_fctl>;
+        pinctrl-names = "default";
+
+        bluetooth {
+            compatible = "brcm,bcm4330-bt";

Do we need a whole new example for this?

No, we don't need it. I find examples useful but if you prefer to have them smaller, then I can skip it.

Best regards,
Krzysztof

maintainer Reviewed-by on v1 1/2
#4 lore raw
In reply to Krzysztof Kozlowski
Quoted 11 lines · Krzysztof Kozlowski

The Samsung SoC UART nodes have usually DMA so dtschema has to reflect this to fix dtbs_check warnings like:

arch/arm/boot/dts/exynos4210-smdkv310.dt.yaml: serial@13800000:
'dma-names', 'dmas' do not match any of the regexes: 'pinctrl-[0-9]+'

---
 .../devicetree/bindings/serial/samsung_uart.yaml       | 10 ++++++++++
 1 file changed, 10 insertions(+)