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