xref: /OK3568_Linux_fs/kernel/Documentation/devicetree/bindings/serial/serial.yaml (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2*4882a593Smuzhiyun%YAML 1.2
3*4882a593Smuzhiyun---
4*4882a593Smuzhiyun$id: "http://devicetree.org/schemas/serial/serial.yaml#"
5*4882a593Smuzhiyun$schema: "http://devicetree.org/meta-schemas/core.yaml#"
6*4882a593Smuzhiyun
7*4882a593Smuzhiyuntitle: Serial Interface Generic DT Bindings
8*4882a593Smuzhiyun
9*4882a593Smuzhiyunmaintainers:
10*4882a593Smuzhiyun  - Rob Herring <robh@kernel.org>
11*4882a593Smuzhiyun  - Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12*4882a593Smuzhiyun
13*4882a593Smuzhiyundescription:
14*4882a593Smuzhiyun  This document lists a set of generic properties for describing UARTs in a
15*4882a593Smuzhiyun  device tree.  Whether these properties apply to a particular device depends
16*4882a593Smuzhiyun  on the DT bindings for the actual device.
17*4882a593Smuzhiyun
18*4882a593Smuzhiyun  Each enabled UART may have an optional "serialN" alias in the "aliases" node,
19*4882a593Smuzhiyun  where N is the port number (non-negative decimal integer) as printed on the
20*4882a593Smuzhiyun  label next to the physical port.
21*4882a593Smuzhiyun
22*4882a593Smuzhiyunproperties:
23*4882a593Smuzhiyun  $nodename:
24*4882a593Smuzhiyun    pattern: "^serial(@.*)?$"
25*4882a593Smuzhiyun
26*4882a593Smuzhiyun  cts-gpios:
27*4882a593Smuzhiyun    maxItems: 1
28*4882a593Smuzhiyun    description:
29*4882a593Smuzhiyun      Must contain a GPIO specifier, referring to the GPIO pin to be used as
30*4882a593Smuzhiyun      the UART's CTS line.
31*4882a593Smuzhiyun
32*4882a593Smuzhiyun  dcd-gpios:
33*4882a593Smuzhiyun    maxItems: 1
34*4882a593Smuzhiyun    description:
35*4882a593Smuzhiyun      Must contain a GPIO specifier, referring to the GPIO pin to be used as
36*4882a593Smuzhiyun      the UART's DCD line.
37*4882a593Smuzhiyun
38*4882a593Smuzhiyun  dsr-gpios:
39*4882a593Smuzhiyun    maxItems: 1
40*4882a593Smuzhiyun    description:
41*4882a593Smuzhiyun      Must contain a GPIO specifier, referring to the GPIO pin to be used as
42*4882a593Smuzhiyun      the UART's DSR line.
43*4882a593Smuzhiyun
44*4882a593Smuzhiyun  dtr-gpios:
45*4882a593Smuzhiyun    maxItems: 1
46*4882a593Smuzhiyun    description:
47*4882a593Smuzhiyun      Must contain a GPIO specifier, referring to the GPIO pin to be used as
48*4882a593Smuzhiyun      the UART's DTR line.
49*4882a593Smuzhiyun
50*4882a593Smuzhiyun  rng-gpios:
51*4882a593Smuzhiyun    maxItems: 1
52*4882a593Smuzhiyun    description:
53*4882a593Smuzhiyun      Must contain a GPIO specifier, referring to the GPIO pin to be used as
54*4882a593Smuzhiyun      the UART's RNG line.
55*4882a593Smuzhiyun
56*4882a593Smuzhiyun  rts-gpios:
57*4882a593Smuzhiyun    maxItems: 1
58*4882a593Smuzhiyun    description:
59*4882a593Smuzhiyun      Must contain a GPIO specifier, referring to the GPIO pin to be used as
60*4882a593Smuzhiyun      the UART's RTS line.
61*4882a593Smuzhiyun
62*4882a593Smuzhiyun  uart-has-rtscts:
63*4882a593Smuzhiyun    $ref: /schemas/types.yaml#/definitions/flag
64*4882a593Smuzhiyun    description:
65*4882a593Smuzhiyun      The presence of this property indicates that the UART has dedicated lines
66*4882a593Smuzhiyun      for RTS/CTS hardware flow control, and that they are available for use
67*4882a593Smuzhiyun      (wired and enabled by pinmux configuration).  This depends on both the
68*4882a593Smuzhiyun      UART hardware and the board wiring.
69*4882a593Smuzhiyun
70*4882a593Smuzhiyun  rx-tx-swap:
71*4882a593Smuzhiyun    type: boolean
72*4882a593Smuzhiyun    description: RX and TX pins are swapped.
73*4882a593Smuzhiyun
74*4882a593Smuzhiyun  cts-rts-swap:
75*4882a593Smuzhiyun    type: boolean
76*4882a593Smuzhiyun    description: CTS and RTS pins are swapped.
77*4882a593Smuzhiyun
78*4882a593Smuzhiyunif:
79*4882a593Smuzhiyun  required:
80*4882a593Smuzhiyun    - uart-has-rtscts
81*4882a593Smuzhiyunthen:
82*4882a593Smuzhiyun  properties:
83*4882a593Smuzhiyun    cts-gpios: false
84*4882a593Smuzhiyun    rts-gpios: false
85*4882a593Smuzhiyun
86*4882a593SmuzhiyunpatternProperties:
87*4882a593Smuzhiyun  ".*":
88*4882a593Smuzhiyun    if:
89*4882a593Smuzhiyun      type: object
90*4882a593Smuzhiyun    then:
91*4882a593Smuzhiyun      description:
92*4882a593Smuzhiyun        Serial attached devices shall be a child node of the host UART device
93*4882a593Smuzhiyun        the slave device is attached to. It is expected that the attached
94*4882a593Smuzhiyun        device is the only child node of the UART device. The slave device node
95*4882a593Smuzhiyun        name shall reflect the generic type of device for the node.
96*4882a593Smuzhiyun
97*4882a593Smuzhiyun      properties:
98*4882a593Smuzhiyun        compatible:
99*4882a593Smuzhiyun          description:
100*4882a593Smuzhiyun            Compatible of the device connected to the serial port.
101*4882a593Smuzhiyun
102*4882a593Smuzhiyun        max-speed:
103*4882a593Smuzhiyun          $ref: /schemas/types.yaml#/definitions/uint32
104*4882a593Smuzhiyun          description:
105*4882a593Smuzhiyun            The maximum baud rate the device operates at.
106*4882a593Smuzhiyun            This should only be present if the maximum is less than the slave
107*4882a593Smuzhiyun            device can support.  For example, a particular board has some
108*4882a593Smuzhiyun            signal quality issue or the host processor can't support higher
109*4882a593Smuzhiyun            baud rates.
110*4882a593Smuzhiyun
111*4882a593Smuzhiyun        current-speed:
112*4882a593Smuzhiyun          $ref: /schemas/types.yaml#/definitions/uint32
113*4882a593Smuzhiyun          description: |
114*4882a593Smuzhiyun            The current baud rate the device operates at.
115*4882a593Smuzhiyun            This should only be present in case a driver has no chance to know
116*4882a593Smuzhiyun            the baud rate of the slave device.
117*4882a593Smuzhiyun            Examples:
118*4882a593Smuzhiyun              * device supports auto-baud
119*4882a593Smuzhiyun              * the rate is setup by a bootloader and there is no way to reset
120*4882a593Smuzhiyun                the device
121*4882a593Smuzhiyun              * device baud rate is configured by its firmware but there is no
122*4882a593Smuzhiyun                way to request the actual settings
123*4882a593Smuzhiyun
124*4882a593Smuzhiyun      required:
125*4882a593Smuzhiyun        - compatible
126*4882a593Smuzhiyun
127*4882a593SmuzhiyunadditionalProperties: true
128*4882a593Smuzhiyun
129*4882a593Smuzhiyunexamples:
130*4882a593Smuzhiyun  - |
131*4882a593Smuzhiyun    serial@1234 {
132*4882a593Smuzhiyun            compatible = "ns16550a";
133*4882a593Smuzhiyun            reg = <0x1234 0x20>;
134*4882a593Smuzhiyun            interrupts = <1>;
135*4882a593Smuzhiyun
136*4882a593Smuzhiyun            bluetooth {
137*4882a593Smuzhiyun                    compatible = "brcm,bcm43341-bt";
138*4882a593Smuzhiyun                    interrupt-parent = <&gpio>;
139*4882a593Smuzhiyun                    interrupts = <10>;
140*4882a593Smuzhiyun            };
141*4882a593Smuzhiyun    };
142