xref: /openbmc/linux/Documentation/devicetree/bindings/serial/st,stm32-uart.yaml (revision 9a87ffc99ec8eb8d35eed7c4f816d75f5cc9662e)
1af1c2d81SBenjamin Gaignard# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2af1c2d81SBenjamin Gaignard%YAML 1.2
3af1c2d81SBenjamin Gaignard---
4af1c2d81SBenjamin Gaignard$id: http://devicetree.org/schemas/serial/st,stm32-uart.yaml#
5af1c2d81SBenjamin Gaignard$schema: http://devicetree.org/meta-schemas/core.yaml#
6af1c2d81SBenjamin Gaignard
7af1c2d81SBenjamin Gaignardmaintainers:
8f4eedebdSPatrice Chotard  - Erwan Le Ray <erwan.leray@foss.st.com>
9af1c2d81SBenjamin Gaignard
10*84e85359SKrzysztof Kozlowskititle: STMicroelectronics STM32 USART
11af1c2d81SBenjamin Gaignard
12af1c2d81SBenjamin Gaignardproperties:
13af1c2d81SBenjamin Gaignard  compatible:
14af1c2d81SBenjamin Gaignard    enum:
15af1c2d81SBenjamin Gaignard      - st,stm32-uart
16af1c2d81SBenjamin Gaignard      - st,stm32f7-uart
17af1c2d81SBenjamin Gaignard      - st,stm32h7-uart
18af1c2d81SBenjamin Gaignard
19af1c2d81SBenjamin Gaignard  reg:
20af1c2d81SBenjamin Gaignard    maxItems: 1
21af1c2d81SBenjamin Gaignard
22af1c2d81SBenjamin Gaignard  interrupts:
23af1c2d81SBenjamin Gaignard    maxItems: 1
24af1c2d81SBenjamin Gaignard
25af1c2d81SBenjamin Gaignard  clocks:
26af1c2d81SBenjamin Gaignard    maxItems: 1
27af1c2d81SBenjamin Gaignard
28af1c2d81SBenjamin Gaignard  resets:
29af1c2d81SBenjamin Gaignard    maxItems: 1
30af1c2d81SBenjamin Gaignard
31af1c2d81SBenjamin Gaignard  label:
32af1c2d81SBenjamin Gaignard    description: label associated with this uart
33af1c2d81SBenjamin Gaignard
34af1c2d81SBenjamin Gaignard  st,hw-flow-ctrl:
35b2cc2b51SErwan Le Ray    description: enable hardware flow control (deprecated)
36af1c2d81SBenjamin Gaignard    $ref: /schemas/types.yaml#/definitions/flag
37af1c2d81SBenjamin Gaignard
381b8dc398SMartin Devera  rx-tx-swap: true
391b8dc398SMartin Devera
40af1c2d81SBenjamin Gaignard  dmas:
41af1c2d81SBenjamin Gaignard    minItems: 1
42af1c2d81SBenjamin Gaignard    maxItems: 2
43af1c2d81SBenjamin Gaignard
44af1c2d81SBenjamin Gaignard  dma-names:
45af1c2d81SBenjamin Gaignard    items:
46af1c2d81SBenjamin Gaignard      enum: [ rx, tx ]
47af1c2d81SBenjamin Gaignard    minItems: 1
48af1c2d81SBenjamin Gaignard    maxItems: 2
49af1c2d81SBenjamin Gaignard
509ba8377cSErwan Le Ray# cts-gpios and rts-gpios properties can be used instead of 'uart-has-rtscts'
519ba8377cSErwan Le Ray# or 'st,hw-flow-ctrl' (deprecated) for making use of any gpio pins for flow
529ba8377cSErwan Le Ray# control instead of dedicated pins.
539ba8377cSErwan Le Ray#
549ba8377cSErwan Le Ray# It should be noted that both cts-gpios/rts-gpios and 'uart-has-rtscts' or
559ba8377cSErwan Le Ray# 'st,hw-flow-ctrl' (deprecated) properties cannot co-exist in a design.
569ba8377cSErwan Le Ray  cts-gpios: true
579ba8377cSErwan Le Ray  rts-gpios: true
58888ae871SManivannan Sadhasivam
59af1c2d81SBenjamin Gaignard  wakeup-source: true
60af1c2d81SBenjamin Gaignard
61cd9de06eSErwan Le Ray  rx-threshold:
62cd9de06eSErwan Le Ray    description:
63cd9de06eSErwan Le Ray      If value is set to 1, RX FIFO threshold is disabled.
64cd9de06eSErwan Le Ray    enum: [1, 2, 4, 8, 12, 14, 16]
65cd9de06eSErwan Le Ray    default: 8
66cd9de06eSErwan Le Ray
67cd9de06eSErwan Le Ray  tx-threshold:
68cd9de06eSErwan Le Ray    description:
69cd9de06eSErwan Le Ray      If value is set to 1, TX FIFO threshold is disabled.
70cd9de06eSErwan Le Ray    enum: [1, 2, 4, 8, 12, 14, 16]
71cd9de06eSErwan Le Ray    default: 8
72cd9de06eSErwan Le Ray
731b8dc398SMartin DeveraallOf:
741b8dc398SMartin Devera  - $ref: rs485.yaml#
751b8dc398SMartin Devera  - $ref: serial.yaml#
761b8dc398SMartin Devera  - if:
77888ae871SManivannan Sadhasivam      required:
78888ae871SManivannan Sadhasivam        - st,hw-flow-ctrl
79888ae871SManivannan Sadhasivam    then:
80888ae871SManivannan Sadhasivam      properties:
81888ae871SManivannan Sadhasivam        cts-gpios: false
82888ae871SManivannan Sadhasivam        rts-gpios: false
831b8dc398SMartin Devera  - if:
841b8dc398SMartin Devera      properties:
851b8dc398SMartin Devera        compatible:
861b8dc398SMartin Devera          const: st,stm32-uart
871b8dc398SMartin Devera    then:
881b8dc398SMartin Devera      properties:
891b8dc398SMartin Devera        rx-tx-swap: false
90cd9de06eSErwan Le Ray  - if:
91cd9de06eSErwan Le Ray      properties:
92cd9de06eSErwan Le Ray        compatible:
93cd9de06eSErwan Le Ray          contains:
94cd9de06eSErwan Le Ray            enum:
95cd9de06eSErwan Le Ray              - st,stm32-uart
96cd9de06eSErwan Le Ray              - st,stm32f7-uart
97cd9de06eSErwan Le Ray    then:
98cd9de06eSErwan Le Ray      properties:
99cd9de06eSErwan Le Ray        rx-threshold: false
100cd9de06eSErwan Le Ray        tx-threshold: false
101888ae871SManivannan Sadhasivam
102af1c2d81SBenjamin Gaignardrequired:
103af1c2d81SBenjamin Gaignard  - compatible
104af1c2d81SBenjamin Gaignard  - reg
105af1c2d81SBenjamin Gaignard  - interrupts
106af1c2d81SBenjamin Gaignard  - clocks
107af1c2d81SBenjamin Gaignard
1088f082dcfSZhen LeiunevaluatedProperties: false
109af1c2d81SBenjamin Gaignard
110af1c2d81SBenjamin Gaignardexamples:
111af1c2d81SBenjamin Gaignard  - |
112af1c2d81SBenjamin Gaignard    #include <dt-bindings/clock/stm32mp1-clks.h>
113af1c2d81SBenjamin Gaignard    usart1: serial@40011000 {
114cd9de06eSErwan Le Ray      compatible = "st,stm32h7-uart";
115af1c2d81SBenjamin Gaignard      reg = <0x40011000 0x400>;
116af1c2d81SBenjamin Gaignard      interrupts = <37>;
117af1c2d81SBenjamin Gaignard      clocks = <&rcc 0 164>;
118af1c2d81SBenjamin Gaignard      dmas = <&dma2 2 4 0x414 0x0>,
119af1c2d81SBenjamin Gaignard             <&dma2 7 4 0x414 0x0>;
120af1c2d81SBenjamin Gaignard      dma-names = "rx", "tx";
121cd9de06eSErwan Le Ray      rx-threshold = <4>;
122cd9de06eSErwan Le Ray      tx-threshold = <4>;
123af1c2d81SBenjamin Gaignard      rs485-rts-active-low;
124af1c2d81SBenjamin Gaignard    };
125af1c2d81SBenjamin Gaignard
126af1c2d81SBenjamin Gaignard...
127