1*c66ec88fSEmmanuel Vadot# Copyright 2020 Lubomir Rintel <lkundrak@v3.sk>
2*c66ec88fSEmmanuel Vadot%YAML 1.2
3*c66ec88fSEmmanuel Vadot---
4*c66ec88fSEmmanuel Vadot$id: http://devicetree.org/schemas/serial/8250.yaml#
5*c66ec88fSEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
6*c66ec88fSEmmanuel Vadot
7*c66ec88fSEmmanuel Vadottitle: UART (Universal Asynchronous Receiver/Transmitter) bindings
8*c66ec88fSEmmanuel Vadot
9*c66ec88fSEmmanuel Vadotmaintainers:
10*c66ec88fSEmmanuel Vadot  - devicetree@vger.kernel.org
11*c66ec88fSEmmanuel Vadot
12*c66ec88fSEmmanuel VadotallOf:
13*c66ec88fSEmmanuel Vadot  - $ref: /schemas/serial.yaml#
14*c66ec88fSEmmanuel Vadot  - if:
15*c66ec88fSEmmanuel Vadot      required:
16*c66ec88fSEmmanuel Vadot        - aspeed,sirq-polarity-sense
17*c66ec88fSEmmanuel Vadot    then:
18*c66ec88fSEmmanuel Vadot      properties:
19*c66ec88fSEmmanuel Vadot        compatible:
20*c66ec88fSEmmanuel Vadot          const: aspeed,ast2500-vuart
21*c66ec88fSEmmanuel Vadot  - if:
22*c66ec88fSEmmanuel Vadot      properties:
23*c66ec88fSEmmanuel Vadot        compatible:
24*c66ec88fSEmmanuel Vadot          const: mrvl,mmp-uart
25*c66ec88fSEmmanuel Vadot    then:
26*c66ec88fSEmmanuel Vadot      properties:
27*c66ec88fSEmmanuel Vadot        reg-shift:
28*c66ec88fSEmmanuel Vadot          const: 2
29*c66ec88fSEmmanuel Vadot      required:
30*c66ec88fSEmmanuel Vadot        - reg-shift
31*c66ec88fSEmmanuel Vadot  - if:
32*c66ec88fSEmmanuel Vadot      not:
33*c66ec88fSEmmanuel Vadot        properties:
34*c66ec88fSEmmanuel Vadot          compatible:
35*c66ec88fSEmmanuel Vadot            items:
36*c66ec88fSEmmanuel Vadot              - enum:
37*c66ec88fSEmmanuel Vadot                  - ns8250
38*c66ec88fSEmmanuel Vadot                  - ns16450
39*c66ec88fSEmmanuel Vadot                  - ns16550
40*c66ec88fSEmmanuel Vadot                  - ns16550a
41*c66ec88fSEmmanuel Vadot    then:
42*c66ec88fSEmmanuel Vadot      anyOf:
43*c66ec88fSEmmanuel Vadot        - required: [ clock-frequency ]
44*c66ec88fSEmmanuel Vadot        - required: [ clocks ]
45*c66ec88fSEmmanuel Vadot
46*c66ec88fSEmmanuel Vadotproperties:
47*c66ec88fSEmmanuel Vadot  compatible:
48*c66ec88fSEmmanuel Vadot    oneOf:
49*c66ec88fSEmmanuel Vadot      - const: ns8250
50*c66ec88fSEmmanuel Vadot      - const: ns16450
51*c66ec88fSEmmanuel Vadot      - const: ns16550
52*c66ec88fSEmmanuel Vadot      - const: ns16550a
53*c66ec88fSEmmanuel Vadot      - const: ns16850
54*c66ec88fSEmmanuel Vadot      - const: aspeed,ast2400-vuart
55*c66ec88fSEmmanuel Vadot      - const: aspeed,ast2500-vuart
56*c66ec88fSEmmanuel Vadot      - const: intel,xscale-uart
57*c66ec88fSEmmanuel Vadot      - const: mrvl,pxa-uart
58*c66ec88fSEmmanuel Vadot      - const: nuvoton,npcm750-uart
59*c66ec88fSEmmanuel Vadot      - const: nvidia,tegra20-uart
60*c66ec88fSEmmanuel Vadot      - const: nxp,lpc3220-uart
61*c66ec88fSEmmanuel Vadot      - items:
62*c66ec88fSEmmanuel Vadot          - enum:
63*c66ec88fSEmmanuel Vadot              - altr,16550-FIFO32
64*c66ec88fSEmmanuel Vadot              - altr,16550-FIFO64
65*c66ec88fSEmmanuel Vadot              - altr,16550-FIFO128
66*c66ec88fSEmmanuel Vadot              - fsl,16550-FIFO64
67*c66ec88fSEmmanuel Vadot              - fsl,ns16550
68*c66ec88fSEmmanuel Vadot              - andestech,uart16550
69*c66ec88fSEmmanuel Vadot              - nxp,lpc1850-uart
70*c66ec88fSEmmanuel Vadot              - opencores,uart16550-rtlsvn105
71*c66ec88fSEmmanuel Vadot              - ti,da830-uart
72*c66ec88fSEmmanuel Vadot          - const: ns16550a
73*c66ec88fSEmmanuel Vadot      - items:
74*c66ec88fSEmmanuel Vadot          - enum:
75*c66ec88fSEmmanuel Vadot              - ns16750
76*c66ec88fSEmmanuel Vadot              - cavium,octeon-3860-uart
77*c66ec88fSEmmanuel Vadot              - xlnx,xps-uart16550-2.00.b
78*c66ec88fSEmmanuel Vadot              - ralink,rt2880-uart
79*c66ec88fSEmmanuel Vadot          - enum:
80*c66ec88fSEmmanuel Vadot              - ns16550 # Deprecated, unless the FIFO really is broken
81*c66ec88fSEmmanuel Vadot              - ns16550a
82*c66ec88fSEmmanuel Vadot      - items:
83*c66ec88fSEmmanuel Vadot          - enum:
84*c66ec88fSEmmanuel Vadot              - ralink,mt7620a-uart
85*c66ec88fSEmmanuel Vadot              - ralink,rt3052-uart
86*c66ec88fSEmmanuel Vadot              - ralink,rt3883-uart
87*c66ec88fSEmmanuel Vadot          - const: ralink,rt2880-uart
88*c66ec88fSEmmanuel Vadot          - enum:
89*c66ec88fSEmmanuel Vadot              - ns16550 # Deprecated, unless the FIFO really is broken
90*c66ec88fSEmmanuel Vadot              - ns16550a
91*c66ec88fSEmmanuel Vadot      - items:
92*c66ec88fSEmmanuel Vadot          - enum:
93*c66ec88fSEmmanuel Vadot              - mediatek,mt7622-btif
94*c66ec88fSEmmanuel Vadot              - mediatek,mt7623-btif
95*c66ec88fSEmmanuel Vadot          - const: mediatek,mtk-btif
96*c66ec88fSEmmanuel Vadot      - items:
97*c66ec88fSEmmanuel Vadot          - enum:
98*c66ec88fSEmmanuel Vadot              - mediatek,mt7622-btif
99*c66ec88fSEmmanuel Vadot              - mediatek,mt7623-btif
100*c66ec88fSEmmanuel Vadot          - const: mediatek,mtk-btif
101*c66ec88fSEmmanuel Vadot      - items:
102*c66ec88fSEmmanuel Vadot          - const: mrvl,mmp-uart
103*c66ec88fSEmmanuel Vadot          - const: intel,xscale-uart
104*c66ec88fSEmmanuel Vadot      - items:
105*c66ec88fSEmmanuel Vadot          - enum:
106*c66ec88fSEmmanuel Vadot              - nvidia,tegra30-uart
107*c66ec88fSEmmanuel Vadot              - nvidia,tegra114-uart
108*c66ec88fSEmmanuel Vadot              - nvidia,tegra124-uart
109*c66ec88fSEmmanuel Vadot              - nvidia,tegra186-uart
110*c66ec88fSEmmanuel Vadot              - nvidia,tegra194-uart
111*c66ec88fSEmmanuel Vadot              - nvidia,tegra210-uart
112*c66ec88fSEmmanuel Vadot          - const: nvidia,tegra20-uart
113*c66ec88fSEmmanuel Vadot
114*c66ec88fSEmmanuel Vadot  reg:
115*c66ec88fSEmmanuel Vadot    maxItems: 1
116*c66ec88fSEmmanuel Vadot
117*c66ec88fSEmmanuel Vadot  interrupts:
118*c66ec88fSEmmanuel Vadot    maxItems: 1
119*c66ec88fSEmmanuel Vadot
120*c66ec88fSEmmanuel Vadot  clock-frequency: true
121*c66ec88fSEmmanuel Vadot
122*c66ec88fSEmmanuel Vadot  clocks:
123*c66ec88fSEmmanuel Vadot    maxItems: 1
124*c66ec88fSEmmanuel Vadot
125*c66ec88fSEmmanuel Vadot  resets:
126*c66ec88fSEmmanuel Vadot    maxItems: 1
127*c66ec88fSEmmanuel Vadot
128*c66ec88fSEmmanuel Vadot  current-speed:
129*c66ec88fSEmmanuel Vadot    $ref: /schemas/types.yaml#definitions/uint32
130*c66ec88fSEmmanuel Vadot    description: The current active speed of the UART.
131*c66ec88fSEmmanuel Vadot
132*c66ec88fSEmmanuel Vadot  reg-offset:
133*c66ec88fSEmmanuel Vadot    description: |
134*c66ec88fSEmmanuel Vadot      Offset to apply to the mapbase from the start of the registers.
135*c66ec88fSEmmanuel Vadot
136*c66ec88fSEmmanuel Vadot  reg-shift:
137*c66ec88fSEmmanuel Vadot    description: Quantity to shift the register offsets by.
138*c66ec88fSEmmanuel Vadot
139*c66ec88fSEmmanuel Vadot  reg-io-width:
140*c66ec88fSEmmanuel Vadot    description: |
141*c66ec88fSEmmanuel Vadot      The size (in bytes) of the IO accesses that should be performed on the
142*c66ec88fSEmmanuel Vadot      device. There are some systems that require 32-bit accesses to the
143*c66ec88fSEmmanuel Vadot      UART (e.g. TI davinci).
144*c66ec88fSEmmanuel Vadot
145*c66ec88fSEmmanuel Vadot  used-by-rtas:
146*c66ec88fSEmmanuel Vadot    type: boolean
147*c66ec88fSEmmanuel Vadot    description: |
148*c66ec88fSEmmanuel Vadot      Set to indicate that the port is in use by the OpenFirmware RTAS and
149*c66ec88fSEmmanuel Vadot      should not be registered.
150*c66ec88fSEmmanuel Vadot
151*c66ec88fSEmmanuel Vadot  no-loopback-test:
152*c66ec88fSEmmanuel Vadot    type: boolean
153*c66ec88fSEmmanuel Vadot    description: |
154*c66ec88fSEmmanuel Vadot      Set to indicate that the port does not implement loopback test mode.
155*c66ec88fSEmmanuel Vadot
156*c66ec88fSEmmanuel Vadot  fifo-size:
157*c66ec88fSEmmanuel Vadot    $ref: /schemas/types.yaml#definitions/uint32
158*c66ec88fSEmmanuel Vadot    description: The fifo size of the UART.
159*c66ec88fSEmmanuel Vadot
160*c66ec88fSEmmanuel Vadot  auto-flow-control:
161*c66ec88fSEmmanuel Vadot    type: boolean
162*c66ec88fSEmmanuel Vadot    description: |
163*c66ec88fSEmmanuel Vadot      One way to enable automatic flow control support. The driver is
164*c66ec88fSEmmanuel Vadot      allowed to detect support for the capability even without this
165*c66ec88fSEmmanuel Vadot      property.
166*c66ec88fSEmmanuel Vadot
167*c66ec88fSEmmanuel Vadot  tx-threshold:
168*c66ec88fSEmmanuel Vadot    $ref: /schemas/types.yaml#definitions/uint32
169*c66ec88fSEmmanuel Vadot    description: |
170*c66ec88fSEmmanuel Vadot      Specify the TX FIFO low water indication for parts with programmable
171*c66ec88fSEmmanuel Vadot      TX FIFO thresholds.
172*c66ec88fSEmmanuel Vadot
173*c66ec88fSEmmanuel Vadot  overrun-throttle-ms:
174*c66ec88fSEmmanuel Vadot    description: |
175*c66ec88fSEmmanuel Vadot      How long to pause uart rx when input overrun is encountered.
176*c66ec88fSEmmanuel Vadot
177*c66ec88fSEmmanuel Vadot  rts-gpios: true
178*c66ec88fSEmmanuel Vadot  cts-gpios: true
179*c66ec88fSEmmanuel Vadot  dtr-gpios: true
180*c66ec88fSEmmanuel Vadot  dsr-gpios: true
181*c66ec88fSEmmanuel Vadot  rng-gpios: true
182*c66ec88fSEmmanuel Vadot  dcd-gpios: true
183*c66ec88fSEmmanuel Vadot
184*c66ec88fSEmmanuel Vadot  aspeed,sirq-polarity-sense:
185*c66ec88fSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/phandle-array
186*c66ec88fSEmmanuel Vadot    description: |
187*c66ec88fSEmmanuel Vadot      Phandle to aspeed,ast2500-scu compatible syscon alongside register
188*c66ec88fSEmmanuel Vadot      offset and bit number to identify how the SIRQ polarity should be
189*c66ec88fSEmmanuel Vadot      configured. One possible data source is the LPC/eSPI mode bit. Only
190*c66ec88fSEmmanuel Vadot      applicable to aspeed,ast2500-vuart.
191*c66ec88fSEmmanuel Vadot
192*c66ec88fSEmmanuel Vadotrequired:
193*c66ec88fSEmmanuel Vadot  - reg
194*c66ec88fSEmmanuel Vadot  - interrupts
195*c66ec88fSEmmanuel Vadot
196*c66ec88fSEmmanuel VadotunevaluatedProperties: false
197*c66ec88fSEmmanuel Vadot
198*c66ec88fSEmmanuel Vadotexamples:
199*c66ec88fSEmmanuel Vadot  - |
200*c66ec88fSEmmanuel Vadot    serial@80230000 {
201*c66ec88fSEmmanuel Vadot        compatible = "ns8250";
202*c66ec88fSEmmanuel Vadot        reg = <0x80230000 0x100>;
203*c66ec88fSEmmanuel Vadot        interrupts = <10>;
204*c66ec88fSEmmanuel Vadot        reg-shift = <2>;
205*c66ec88fSEmmanuel Vadot        clock-frequency = <48000000>;
206*c66ec88fSEmmanuel Vadot    };
207*c66ec88fSEmmanuel Vadot  - |
208*c66ec88fSEmmanuel Vadot    #include <dt-bindings/gpio/gpio.h>
209*c66ec88fSEmmanuel Vadot    serial@49042000 {
210*c66ec88fSEmmanuel Vadot        compatible = "andestech,uart16550", "ns16550a";
211*c66ec88fSEmmanuel Vadot        reg = <0x49042000 0x400>;
212*c66ec88fSEmmanuel Vadot        interrupts = <80>;
213*c66ec88fSEmmanuel Vadot        clock-frequency = <48000000>;
214*c66ec88fSEmmanuel Vadot        cts-gpios = <&gpio3 5 GPIO_ACTIVE_LOW>;
215*c66ec88fSEmmanuel Vadot        rts-gpios = <&gpio3 6 GPIO_ACTIVE_LOW>;
216*c66ec88fSEmmanuel Vadot        dtr-gpios = <&gpio1 12 GPIO_ACTIVE_LOW>;
217*c66ec88fSEmmanuel Vadot        dsr-gpios = <&gpio1 13 GPIO_ACTIVE_LOW>;
218*c66ec88fSEmmanuel Vadot        dcd-gpios = <&gpio1 14 GPIO_ACTIVE_LOW>;
219*c66ec88fSEmmanuel Vadot        rng-gpios = <&gpio1 15 GPIO_ACTIVE_LOW>;
220*c66ec88fSEmmanuel Vadot    };
221*c66ec88fSEmmanuel Vadot  - |
222*c66ec88fSEmmanuel Vadot    #include <dt-bindings/clock/aspeed-clock.h>
223*c66ec88fSEmmanuel Vadot    serial@1e787000 {
224*c66ec88fSEmmanuel Vadot        compatible = "aspeed,ast2500-vuart";
225*c66ec88fSEmmanuel Vadot        reg = <0x1e787000 0x40>;
226*c66ec88fSEmmanuel Vadot        reg-shift = <2>;
227*c66ec88fSEmmanuel Vadot        interrupts = <8>;
228*c66ec88fSEmmanuel Vadot        clocks = <&syscon ASPEED_CLK_APB>;
229*c66ec88fSEmmanuel Vadot        no-loopback-test;
230*c66ec88fSEmmanuel Vadot        aspeed,sirq-polarity-sense = <&syscon 0x70 25>;
231*c66ec88fSEmmanuel Vadot    };
232*c66ec88fSEmmanuel Vadot
233*c66ec88fSEmmanuel Vadot...
234