xref: /freebsd/sys/contrib/device-tree/Bindings/serial/st,stm32-uart.yaml (revision 7d0873ebb83b19ba1e8a89e679470d885efe12e3)
1c66ec88fSEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2c66ec88fSEmmanuel Vadot%YAML 1.2
3c66ec88fSEmmanuel Vadot---
4c66ec88fSEmmanuel Vadot$id: http://devicetree.org/schemas/serial/st,stm32-uart.yaml#
5c66ec88fSEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
6c66ec88fSEmmanuel Vadot
7c66ec88fSEmmanuel Vadotmaintainers:
88cc087a1SEmmanuel Vadot  - Erwan Le Ray <erwan.leray@foss.st.com>
9c66ec88fSEmmanuel Vadot
108bab661aSEmmanuel Vadottitle: STMicroelectronics STM32 USART
11c66ec88fSEmmanuel Vadot
12c66ec88fSEmmanuel Vadotproperties:
13c66ec88fSEmmanuel Vadot  compatible:
14c66ec88fSEmmanuel Vadot    enum:
15c66ec88fSEmmanuel Vadot      - st,stm32-uart
16c66ec88fSEmmanuel Vadot      - st,stm32f7-uart
17c66ec88fSEmmanuel Vadot      - st,stm32h7-uart
18c66ec88fSEmmanuel Vadot
19c66ec88fSEmmanuel Vadot  reg:
20c66ec88fSEmmanuel Vadot    maxItems: 1
21c66ec88fSEmmanuel Vadot
22c66ec88fSEmmanuel Vadot  interrupts:
23c66ec88fSEmmanuel Vadot    maxItems: 1
24c66ec88fSEmmanuel Vadot
25c66ec88fSEmmanuel Vadot  clocks:
26c66ec88fSEmmanuel Vadot    maxItems: 1
27c66ec88fSEmmanuel Vadot
28c66ec88fSEmmanuel Vadot  resets:
29c66ec88fSEmmanuel Vadot    maxItems: 1
30c66ec88fSEmmanuel Vadot
31c66ec88fSEmmanuel Vadot  label:
32c66ec88fSEmmanuel Vadot    description: label associated with this uart
33c66ec88fSEmmanuel Vadot
34c66ec88fSEmmanuel Vadot  st,hw-flow-ctrl:
35c66ec88fSEmmanuel Vadot    description: enable hardware flow control (deprecated)
36c66ec88fSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/flag
37c66ec88fSEmmanuel Vadot
382eb4d8dcSEmmanuel Vadot  rx-tx-swap: true
392eb4d8dcSEmmanuel Vadot
40c66ec88fSEmmanuel Vadot  dmas:
41c66ec88fSEmmanuel Vadot    minItems: 1
42c66ec88fSEmmanuel Vadot    maxItems: 2
43c66ec88fSEmmanuel Vadot
44c66ec88fSEmmanuel Vadot  dma-names:
45c66ec88fSEmmanuel Vadot    items:
46c66ec88fSEmmanuel Vadot      enum: [ rx, tx ]
47c66ec88fSEmmanuel Vadot    minItems: 1
48c66ec88fSEmmanuel Vadot    maxItems: 2
49c66ec88fSEmmanuel Vadot
505def4c47SEmmanuel Vadot# cts-gpios and rts-gpios properties can be used instead of 'uart-has-rtscts'
515def4c47SEmmanuel Vadot# or 'st,hw-flow-ctrl' (deprecated) for making use of any gpio pins for flow
525def4c47SEmmanuel Vadot# control instead of dedicated pins.
535def4c47SEmmanuel Vadot#
545def4c47SEmmanuel Vadot# It should be noted that both cts-gpios/rts-gpios and 'uart-has-rtscts' or
555def4c47SEmmanuel Vadot# 'st,hw-flow-ctrl' (deprecated) properties cannot co-exist in a design.
565def4c47SEmmanuel Vadot  cts-gpios: true
575def4c47SEmmanuel Vadot  rts-gpios: true
58c66ec88fSEmmanuel Vadot
59c66ec88fSEmmanuel Vadot  wakeup-source: true
60c66ec88fSEmmanuel Vadot
6101950c46SEmmanuel Vadot  power-domains:
6201950c46SEmmanuel Vadot    maxItems: 1
6301950c46SEmmanuel Vadot
642eb4d8dcSEmmanuel Vadot  rx-threshold:
652eb4d8dcSEmmanuel Vadot    description:
662eb4d8dcSEmmanuel Vadot      If value is set to 1, RX FIFO threshold is disabled.
672eb4d8dcSEmmanuel Vadot    enum: [1, 2, 4, 8, 12, 14, 16]
682eb4d8dcSEmmanuel Vadot    default: 8
692eb4d8dcSEmmanuel Vadot
702eb4d8dcSEmmanuel Vadot  tx-threshold:
712eb4d8dcSEmmanuel Vadot    description:
722eb4d8dcSEmmanuel Vadot      If value is set to 1, TX FIFO threshold is disabled.
732eb4d8dcSEmmanuel Vadot    enum: [1, 2, 4, 8, 12, 14, 16]
742eb4d8dcSEmmanuel Vadot    default: 8
752eb4d8dcSEmmanuel Vadot
76*7d0873ebSEmmanuel Vadot  access-controllers:
77*7d0873ebSEmmanuel Vadot    minItems: 1
78*7d0873ebSEmmanuel Vadot    maxItems: 2
79*7d0873ebSEmmanuel Vadot
802eb4d8dcSEmmanuel VadotallOf:
812eb4d8dcSEmmanuel Vadot  - $ref: rs485.yaml#
822eb4d8dcSEmmanuel Vadot  - $ref: serial.yaml#
832eb4d8dcSEmmanuel Vadot  - if:
84c66ec88fSEmmanuel Vadot      required:
85c66ec88fSEmmanuel Vadot        - st,hw-flow-ctrl
86c66ec88fSEmmanuel Vadot    then:
87c66ec88fSEmmanuel Vadot      properties:
88c66ec88fSEmmanuel Vadot        cts-gpios: false
89c66ec88fSEmmanuel Vadot        rts-gpios: false
902eb4d8dcSEmmanuel Vadot  - if:
912eb4d8dcSEmmanuel Vadot      properties:
922eb4d8dcSEmmanuel Vadot        compatible:
932eb4d8dcSEmmanuel Vadot          const: st,stm32-uart
942eb4d8dcSEmmanuel Vadot    then:
952eb4d8dcSEmmanuel Vadot      properties:
962eb4d8dcSEmmanuel Vadot        rx-tx-swap: false
972eb4d8dcSEmmanuel Vadot  - if:
982eb4d8dcSEmmanuel Vadot      properties:
992eb4d8dcSEmmanuel Vadot        compatible:
1002eb4d8dcSEmmanuel Vadot          contains:
1012eb4d8dcSEmmanuel Vadot            enum:
1022eb4d8dcSEmmanuel Vadot              - st,stm32-uart
1032eb4d8dcSEmmanuel Vadot              - st,stm32f7-uart
1042eb4d8dcSEmmanuel Vadot    then:
1052eb4d8dcSEmmanuel Vadot      properties:
1062eb4d8dcSEmmanuel Vadot        rx-threshold: false
1072eb4d8dcSEmmanuel Vadot        tx-threshold: false
108c66ec88fSEmmanuel Vadot
109c66ec88fSEmmanuel Vadotrequired:
110c66ec88fSEmmanuel Vadot  - compatible
111c66ec88fSEmmanuel Vadot  - reg
112c66ec88fSEmmanuel Vadot  - interrupts
113c66ec88fSEmmanuel Vadot  - clocks
114c66ec88fSEmmanuel Vadot
1155956d97fSEmmanuel VadotunevaluatedProperties: false
116c66ec88fSEmmanuel Vadot
117c66ec88fSEmmanuel Vadotexamples:
118c66ec88fSEmmanuel Vadot  - |
119c66ec88fSEmmanuel Vadot    #include <dt-bindings/clock/stm32mp1-clks.h>
120c66ec88fSEmmanuel Vadot    usart1: serial@40011000 {
1212eb4d8dcSEmmanuel Vadot      compatible = "st,stm32h7-uart";
122c66ec88fSEmmanuel Vadot      reg = <0x40011000 0x400>;
123c66ec88fSEmmanuel Vadot      interrupts = <37>;
124c66ec88fSEmmanuel Vadot      clocks = <&rcc 0 164>;
125c66ec88fSEmmanuel Vadot      dmas = <&dma2 2 4 0x414 0x0>,
126c66ec88fSEmmanuel Vadot             <&dma2 7 4 0x414 0x0>;
127c66ec88fSEmmanuel Vadot      dma-names = "rx", "tx";
1282eb4d8dcSEmmanuel Vadot      rx-threshold = <4>;
1292eb4d8dcSEmmanuel Vadot      tx-threshold = <4>;
130c66ec88fSEmmanuel Vadot      rs485-rts-active-low;
131c66ec88fSEmmanuel Vadot    };
132c66ec88fSEmmanuel Vadot
133c66ec88fSEmmanuel Vadot...
134