xref: /linux/Documentation/devicetree/bindings/serial/8250.yaml (revision 20bed0d6ff62d985fe8222958825504b8aad4e88)
1# Copyright 2020 Lubomir Rintel <lkundrak@v3.sk>
2%YAML 1.2
3---
4$id: http://devicetree.org/schemas/serial/8250.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: UART (Universal Asynchronous Receiver/Transmitter)
8
9maintainers:
10  - devicetree@vger.kernel.org
11
12allOf:
13  - $ref: serial.yaml#
14  - $ref: /schemas/memory-controllers/mc-peripheral-props.yaml#
15  - if:
16      anyOf:
17        - required:
18            - aspeed,lpc-io-reg
19        - required:
20            - aspeed,lpc-interrupts
21        - required:
22            - aspeed,sirq-polarity-sense
23    then:
24      properties:
25        compatible:
26          contains:
27            const: aspeed,ast2500-vuart
28  - if:
29      properties:
30        compatible:
31          const: mrvl,mmp-uart
32    then:
33      properties:
34        reg-shift:
35          const: 2
36      required:
37        - reg-shift
38  - if:
39      not:
40        properties:
41          compatible:
42            items:
43              - enum:
44                  - ns8250
45                  - ns16450
46                  - ns16550
47                  - ns16550a
48    then:
49      oneOf:
50        - required: [ clock-frequency ]
51        - required: [ clocks ]
52  - if:
53      properties:
54        compatible:
55          contains:
56            const: nxp,lpc1850-uart
57    then:
58      properties:
59        clock-names:
60          items:
61            - const: uartclk
62            - const: reg
63  - if:
64      properties:
65        compatible:
66          contains:
67            enum:
68              - spacemit,k1-uart
69              - spacemit,k3-uart
70    then:
71      properties:
72        clock-names:
73          items:
74            - const: core
75            - const: bus
76  - if:
77      properties:
78        compatible:
79          contains:
80            enum:
81              - spacemit,k1-uart
82              - spacemit,k3-uart
83              - nxp,lpc1850-uart
84    then:
85      required:
86        - clocks
87        - clock-names
88      properties:
89        clocks:
90          minItems: 2
91        clock-names:
92          minItems: 2
93    else:
94      properties:
95        clocks:
96          maxItems: 1
97        clock-names:
98          maxItems: 1
99
100properties:
101  compatible:
102    oneOf:
103      - enum:
104          - ns8250
105          - ns16450
106          - ns16550
107          - ns16550a
108          - ns16850
109          - airoha,an7581-hsuart
110          - airoha,en7523-uart
111          - aspeed,ast2400-vuart
112          - aspeed,ast2500-vuart
113          - intel,xscale-uart
114          - mrvl,pxa-uart
115          - nuvoton,npcm750-uart
116          - nuvoton,wpcm450-uart
117          - nvidia,tegra20-uart
118          - nxp,lpc3220-uart
119      - items:
120          - const: airoha,an7581-uart
121          - const: airoha,en7523-uart
122      - items:
123          - enum:
124              - exar,xr16l2552
125              - exar,xr16l2551
126              - exar,xr16l2550
127          - const: ns8250
128      - items:
129          - enum:
130              - altr,16550-FIFO32
131              - altr,16550-FIFO64
132              - altr,16550-FIFO128
133              - fsl,16550-FIFO64
134              - andestech,uart16550
135              - nxp,lpc1850-uart
136              - opencores,uart16550-rtlsvn105
137              - ti,da830-uart
138              - loongson,ls2k0500-uart
139              - loongson,ls2k1500-uart
140          - const: ns16550a
141      - items:
142          - enum:
143              - ns16750
144              - fsl,ns16550
145              - cavium,octeon-3860-uart
146              - xlnx,xps-uart16550-2.00.b
147              - ralink,rt2880-uart
148          - enum:
149              - ns16550 # Deprecated, unless the FIFO really is broken
150              - ns16550a
151      - items:
152          - enum:
153              - nuvoton,npcm845-uart
154          - const: nuvoton,npcm750-uart
155      - items:
156          - enum:
157              - ralink,mt7620a-uart
158              - ralink,rt3052-uart
159              - ralink,rt3883-uart
160          - const: ralink,rt2880-uart
161          - enum:
162              - ns16550 # Deprecated, unless the FIFO really is broken
163              - ns16550a
164      - items:
165          - enum:
166              - mediatek,mt7622-btif
167              - mediatek,mt7623-btif
168          - const: mediatek,mtk-btif
169      - items:
170          - enum:
171              - mrvl,mmp-uart
172              - spacemit,k1-uart
173              - spacemit,k3-uart
174          - const: intel,xscale-uart
175      - items:
176          - enum:
177              - nvidia,tegra30-uart
178              - nvidia,tegra114-uart
179              - nvidia,tegra124-uart
180              - nvidia,tegra210-uart
181              - nvidia,tegra186-uart
182              - nvidia,tegra194-uart
183              - nvidia,tegra234-uart
184          - const: nvidia,tegra20-uart
185      - items:
186          - enum:
187              - loongson,ls2k1000-uart
188          - const: loongson,ls2k0500-uart
189          - const: ns16550a
190      - items:
191          - enum:
192              - loongson,ls3a4000-uart
193              - loongson,ls3a5000-uart
194              - loongson,ls3a6000-uart
195              - loongson,ls2k2000-uart
196          - const: loongson,ls2k1500-uart
197          - const: ns16550a
198      - items:
199          - enum:
200              - aspeed,ast2600-vuart
201              - aspeed,ast2700-vuart
202          - const: aspeed,ast2500-vuart
203
204  reg:
205    maxItems: 1
206
207  interrupts:
208    maxItems: 1
209
210  clock-frequency: true
211
212  clocks:
213    minItems: 1
214    items:
215      - description: The core function clock
216      - description: An optional bus clock
217
218  clock-names:
219    minItems: 1
220    maxItems: 2
221    oneOf:
222      - enum:
223          - main
224          - uart
225      - items:
226          - const: core
227          - const: bus
228      - items:
229          - const: uartclk
230          - const: reg
231
232  dmas:
233    minItems: 1
234    maxItems: 4
235
236  dma-names:
237    minItems: 1
238    maxItems: 4
239
240  resets:
241    maxItems: 1
242
243  current-speed:
244    $ref: /schemas/types.yaml#/definitions/uint32
245    description: The current active speed of the UART.
246
247  reg-offset:
248    $ref: /schemas/types.yaml#/definitions/uint32
249    description: |
250      Offset to apply to the mapbase from the start of the registers.
251
252  reg-shift:
253    description: Quantity to shift the register offsets by.
254
255  reg-io-width:
256    description: |
257      The size (in bytes) of the IO accesses that should be performed on the
258      device. There are some systems that require 32-bit accesses to the
259      UART (e.g. TI davinci).
260
261  used-by-rtas:
262    type: boolean
263    description: |
264      Set to indicate that the port is in use by the OpenFirmware RTAS and
265      should not be registered.
266
267  no-loopback-test:
268    type: boolean
269    description: |
270      Set to indicate that the port does not implement loopback test mode.
271
272  fifo-size:
273    $ref: /schemas/types.yaml#/definitions/uint32
274    description: The fifo size of the UART.
275
276  auto-flow-control:
277    type: boolean
278    description: |
279      One way to enable automatic flow control support. The driver is
280      allowed to detect support for the capability even without this
281      property.
282
283  tx-threshold:
284    description: |
285      Specify the TX FIFO low water indication for parts with programmable
286      TX FIFO thresholds.
287
288  overrun-throttle-ms:
289    description: |
290      How long to pause uart rx when input overrun is encountered.
291
292  rts-gpios: true
293  cts-gpios: true
294  dtr-gpios: true
295  dsr-gpios: true
296  rng-gpios: true
297  dcd-gpios: true
298
299  aspeed,sirq-polarity-sense:
300    $ref: /schemas/types.yaml#/definitions/phandle-array
301    description: |
302      Phandle to aspeed,ast2500-scu compatible syscon alongside register
303      offset and bit number to identify how the SIRQ polarity should be
304      configured. One possible data source is the LPC/eSPI mode bit. Only
305      applicable to aspeed,ast2500-vuart.
306    deprecated: true
307
308  aspeed,lpc-io-reg:
309    $ref: /schemas/types.yaml#/definitions/uint32-array
310    maxItems: 1
311    description: |
312      The VUART LPC address.  Only applicable to aspeed,ast2500-vuart.
313
314  aspeed,lpc-interrupts:
315    $ref: /schemas/types.yaml#/definitions/uint32-array
316    minItems: 2
317    maxItems: 2
318    description: |
319      A 2-cell property describing the VUART SIRQ number and SIRQ
320      polarity (IRQ_TYPE_LEVEL_LOW or IRQ_TYPE_LEVEL_HIGH).  Only
321      applicable to aspeed,ast2500-vuart.
322
323required:
324  - reg
325  - interrupts
326
327unevaluatedProperties: false
328
329examples:
330  - |
331    serial@80230000 {
332        compatible = "ns8250";
333        reg = <0x80230000 0x100>;
334        interrupts = <10>;
335        reg-shift = <2>;
336        clock-frequency = <48000000>;
337    };
338  - |
339    #include <dt-bindings/gpio/gpio.h>
340    serial@49042000 {
341        compatible = "andestech,uart16550", "ns16550a";
342        reg = <0x49042000 0x400>;
343        interrupts = <80>;
344        clock-frequency = <48000000>;
345        cts-gpios = <&gpio3 5 GPIO_ACTIVE_LOW>;
346        rts-gpios = <&gpio3 6 GPIO_ACTIVE_LOW>;
347        dtr-gpios = <&gpio1 12 GPIO_ACTIVE_LOW>;
348        dsr-gpios = <&gpio1 13 GPIO_ACTIVE_LOW>;
349        dcd-gpios = <&gpio1 14 GPIO_ACTIVE_LOW>;
350        rng-gpios = <&gpio1 15 GPIO_ACTIVE_LOW>;
351    };
352  - |
353    #include <dt-bindings/clock/aspeed-clock.h>
354    #include <dt-bindings/interrupt-controller/irq.h>
355    serial@1e787000 {
356        compatible = "aspeed,ast2500-vuart";
357        reg = <0x1e787000 0x40>;
358        reg-shift = <2>;
359        interrupts = <8>;
360        clocks = <&syscon ASPEED_CLK_APB>;
361        no-loopback-test;
362        aspeed,lpc-io-reg = <0x3f8>;
363        aspeed,lpc-interrupts = <4 IRQ_TYPE_LEVEL_LOW>;
364    };
365
366...
367