xref: /freebsd/sys/contrib/device-tree/Bindings/serial/st,stm32-uart.yaml (revision a4e5e0106ac7145f56eb39a691e302cabb4635be)
1# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2%YAML 1.2
3---
4$id: http://devicetree.org/schemas/serial/st,stm32-uart.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7maintainers:
8  - Erwan Le Ray <erwan.leray@foss.st.com>
9
10title: STMicroelectronics STM32 USART
11
12properties:
13  compatible:
14    enum:
15      - st,stm32-uart
16      - st,stm32f7-uart
17      - st,stm32h7-uart
18
19  reg:
20    maxItems: 1
21
22  interrupts:
23    maxItems: 1
24
25  clocks:
26    maxItems: 1
27
28  resets:
29    maxItems: 1
30
31  label:
32    description: label associated with this uart
33
34  st,hw-flow-ctrl:
35    description: enable hardware flow control (deprecated)
36    $ref: /schemas/types.yaml#/definitions/flag
37
38  rx-tx-swap: true
39
40  dmas:
41    minItems: 1
42    maxItems: 2
43
44  dma-names:
45    items:
46      enum: [ rx, tx ]
47    minItems: 1
48    maxItems: 2
49
50# cts-gpios and rts-gpios properties can be used instead of 'uart-has-rtscts'
51# or 'st,hw-flow-ctrl' (deprecated) for making use of any gpio pins for flow
52# control instead of dedicated pins.
53#
54# It should be noted that both cts-gpios/rts-gpios and 'uart-has-rtscts' or
55# 'st,hw-flow-ctrl' (deprecated) properties cannot co-exist in a design.
56  cts-gpios: true
57  rts-gpios: true
58
59  wakeup-source: true
60
61  rx-threshold:
62    description:
63      If value is set to 1, RX FIFO threshold is disabled.
64    enum: [1, 2, 4, 8, 12, 14, 16]
65    default: 8
66
67  tx-threshold:
68    description:
69      If value is set to 1, TX FIFO threshold is disabled.
70    enum: [1, 2, 4, 8, 12, 14, 16]
71    default: 8
72
73allOf:
74  - $ref: rs485.yaml#
75  - $ref: serial.yaml#
76  - if:
77      required:
78        - st,hw-flow-ctrl
79    then:
80      properties:
81        cts-gpios: false
82        rts-gpios: false
83  - if:
84      properties:
85        compatible:
86          const: st,stm32-uart
87    then:
88      properties:
89        rx-tx-swap: false
90  - if:
91      properties:
92        compatible:
93          contains:
94            enum:
95              - st,stm32-uart
96              - st,stm32f7-uart
97    then:
98      properties:
99        rx-threshold: false
100        tx-threshold: false
101
102required:
103  - compatible
104  - reg
105  - interrupts
106  - clocks
107
108unevaluatedProperties: false
109
110examples:
111  - |
112    #include <dt-bindings/clock/stm32mp1-clks.h>
113    usart1: serial@40011000 {
114      compatible = "st,stm32h7-uart";
115      reg = <0x40011000 0x400>;
116      interrupts = <37>;
117      clocks = <&rcc 0 164>;
118      dmas = <&dma2 2 4 0x414 0x0>,
119             <&dma2 7 4 0x414 0x0>;
120      dma-names = "rx", "tx";
121      rx-threshold = <4>;
122      tx-threshold = <4>;
123      rs485-rts-active-low;
124    };
125
126...
127