xref: /openbmc/linux/Documentation/devicetree/bindings/serial/serial.yaml (revision b97d6790d03b763eca08847a9a5869a4291b9f9a)
1175a7427SGeert Uytterhoeven# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2175a7427SGeert Uytterhoeven%YAML 1.2
3175a7427SGeert Uytterhoeven---
4cb95de8dSRob Herring$id: http://devicetree.org/schemas/serial/serial.yaml#
5cb95de8dSRob Herring$schema: http://devicetree.org/meta-schemas/core.yaml#
6175a7427SGeert Uytterhoeven
7a612130cSKrzysztof Kozlowskititle: Serial Interface Generic
8175a7427SGeert Uytterhoeven
9175a7427SGeert Uytterhoevenmaintainers:
1032ced09dSGeert Uytterhoeven  - Rob Herring <robh@kernel.org>
11175a7427SGeert Uytterhoeven  - Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12175a7427SGeert Uytterhoeven
13175a7427SGeert Uytterhoevendescription:
14175a7427SGeert Uytterhoeven  This document lists a set of generic properties for describing UARTs in a
15175a7427SGeert Uytterhoeven  device tree.  Whether these properties apply to a particular device depends
16175a7427SGeert Uytterhoeven  on the DT bindings for the actual device.
17175a7427SGeert Uytterhoeven
18a5427e4eSGeert Uytterhoeven  Each enabled UART may have an optional "serialN" alias in the "aliases" node,
19a5427e4eSGeert Uytterhoeven  where N is the port number (non-negative decimal integer) as printed on the
20a5427e4eSGeert Uytterhoeven  label next to the physical port.
21a5427e4eSGeert Uytterhoeven
22175a7427SGeert Uytterhoevenproperties:
23175a7427SGeert Uytterhoeven  $nodename:
24175a7427SGeert Uytterhoeven    pattern: "^serial(@.*)?$"
25175a7427SGeert Uytterhoeven
26e27671f6SZhen Lei  label: true
27e27671f6SZhen Lei
28175a7427SGeert Uytterhoeven  cts-gpios:
29175a7427SGeert Uytterhoeven    maxItems: 1
30175a7427SGeert Uytterhoeven    description:
31175a7427SGeert Uytterhoeven      Must contain a GPIO specifier, referring to the GPIO pin to be used as
32175a7427SGeert Uytterhoeven      the UART's CTS line.
33175a7427SGeert Uytterhoeven
34175a7427SGeert Uytterhoeven  dcd-gpios:
35175a7427SGeert Uytterhoeven    maxItems: 1
36175a7427SGeert Uytterhoeven    description:
37175a7427SGeert Uytterhoeven      Must contain a GPIO specifier, referring to the GPIO pin to be used as
38175a7427SGeert Uytterhoeven      the UART's DCD line.
39175a7427SGeert Uytterhoeven
40175a7427SGeert Uytterhoeven  dsr-gpios:
41175a7427SGeert Uytterhoeven    maxItems: 1
42175a7427SGeert Uytterhoeven    description:
43175a7427SGeert Uytterhoeven      Must contain a GPIO specifier, referring to the GPIO pin to be used as
44175a7427SGeert Uytterhoeven      the UART's DSR line.
45175a7427SGeert Uytterhoeven
46175a7427SGeert Uytterhoeven  dtr-gpios:
47175a7427SGeert Uytterhoeven    maxItems: 1
48175a7427SGeert Uytterhoeven    description:
49175a7427SGeert Uytterhoeven      Must contain a GPIO specifier, referring to the GPIO pin to be used as
50175a7427SGeert Uytterhoeven      the UART's DTR line.
51175a7427SGeert Uytterhoeven
52175a7427SGeert Uytterhoeven  rng-gpios:
53175a7427SGeert Uytterhoeven    maxItems: 1
54175a7427SGeert Uytterhoeven    description:
55175a7427SGeert Uytterhoeven      Must contain a GPIO specifier, referring to the GPIO pin to be used as
56175a7427SGeert Uytterhoeven      the UART's RNG line.
57175a7427SGeert Uytterhoeven
58175a7427SGeert Uytterhoeven  rts-gpios:
59175a7427SGeert Uytterhoeven    maxItems: 1
60175a7427SGeert Uytterhoeven    description:
61175a7427SGeert Uytterhoeven      Must contain a GPIO specifier, referring to the GPIO pin to be used as
62175a7427SGeert Uytterhoeven      the UART's RTS line.
63175a7427SGeert Uytterhoeven
64175a7427SGeert Uytterhoeven  uart-has-rtscts:
65175a7427SGeert Uytterhoeven    $ref: /schemas/types.yaml#/definitions/flag
66175a7427SGeert Uytterhoeven    description:
67175a7427SGeert Uytterhoeven      The presence of this property indicates that the UART has dedicated lines
68175a7427SGeert Uytterhoeven      for RTS/CTS hardware flow control, and that they are available for use
69175a7427SGeert Uytterhoeven      (wired and enabled by pinmux configuration).  This depends on both the
70175a7427SGeert Uytterhoeven      UART hardware and the board wiring.
71175a7427SGeert Uytterhoeven
7241d455bdSAkash Asthana  rx-tx-swap:
7341d455bdSAkash Asthana    type: boolean
7441d455bdSAkash Asthana    description: RX and TX pins are swapped.
7541d455bdSAkash Asthana
7641d455bdSAkash Asthana  cts-rts-swap:
7741d455bdSAkash Asthana    type: boolean
7841d455bdSAkash Asthana    description: CTS and RTS pins are swapped.
7941d455bdSAkash Asthana
808574c9e7SErwan Le Ray  rx-threshold:
818574c9e7SErwan Le Ray    $ref: /schemas/types.yaml#/definitions/uint32
828574c9e7SErwan Le Ray    description:
838574c9e7SErwan Le Ray      RX FIFO threshold configuration (in bytes).
848574c9e7SErwan Le Ray
858574c9e7SErwan Le Ray  tx-threshold:
868574c9e7SErwan Le Ray    $ref: /schemas/types.yaml#/definitions/uint32
878574c9e7SErwan Le Ray    description:
888574c9e7SErwan Le Ray      TX FIFO threshold configuration (in bytes).
898574c9e7SErwan Le Ray
90175a7427SGeert Uytterhoevenif:
91175a7427SGeert Uytterhoeven  required:
92175a7427SGeert Uytterhoeven    - uart-has-rtscts
93175a7427SGeert Uytterhoeventhen:
94175a7427SGeert Uytterhoeven  properties:
95175a7427SGeert Uytterhoeven    cts-gpios: false
96175a7427SGeert Uytterhoeven    rts-gpios: false
9732ced09dSGeert Uytterhoeven
9832ced09dSGeert UytterhoevenpatternProperties:
99*8159c843SKrzysztof Kozlowski  "^(bluetooth|gnss|gps|mcu)$":
10032ced09dSGeert Uytterhoeven    if:
10132ced09dSGeert Uytterhoeven      type: object
10232ced09dSGeert Uytterhoeven    then:
10332ced09dSGeert Uytterhoeven      description:
10432ced09dSGeert Uytterhoeven        Serial attached devices shall be a child node of the host UART device
10532ced09dSGeert Uytterhoeven        the slave device is attached to. It is expected that the attached
10632ced09dSGeert Uytterhoeven        device is the only child node of the UART device. The slave device node
10732ced09dSGeert Uytterhoeven        name shall reflect the generic type of device for the node.
10832ced09dSGeert Uytterhoeven
10932ced09dSGeert Uytterhoeven      properties:
11032ced09dSGeert Uytterhoeven        compatible:
11132ced09dSGeert Uytterhoeven          description:
11232ced09dSGeert Uytterhoeven            Compatible of the device connected to the serial port.
11332ced09dSGeert Uytterhoeven
11432ced09dSGeert Uytterhoeven        max-speed:
11532ced09dSGeert Uytterhoeven          $ref: /schemas/types.yaml#/definitions/uint32
11632ced09dSGeert Uytterhoeven          description:
11732ced09dSGeert Uytterhoeven            The maximum baud rate the device operates at.
11832ced09dSGeert Uytterhoeven            This should only be present if the maximum is less than the slave
11932ced09dSGeert Uytterhoeven            device can support.  For example, a particular board has some
12032ced09dSGeert Uytterhoeven            signal quality issue or the host processor can't support higher
12132ced09dSGeert Uytterhoeven            baud rates.
12232ced09dSGeert Uytterhoeven
12332ced09dSGeert Uytterhoeven        current-speed:
12432ced09dSGeert Uytterhoeven          $ref: /schemas/types.yaml#/definitions/uint32
12532ced09dSGeert Uytterhoeven          description: |
12632ced09dSGeert Uytterhoeven            The current baud rate the device operates at.
12732ced09dSGeert Uytterhoeven            This should only be present in case a driver has no chance to know
12832ced09dSGeert Uytterhoeven            the baud rate of the slave device.
12932ced09dSGeert Uytterhoeven            Examples:
13032ced09dSGeert Uytterhoeven              * device supports auto-baud
13132ced09dSGeert Uytterhoeven              * the rate is setup by a bootloader and there is no way to reset
13232ced09dSGeert Uytterhoeven                the device
13332ced09dSGeert Uytterhoeven              * device baud rate is configured by its firmware but there is no
13432ced09dSGeert Uytterhoeven                way to request the actual settings
13532ced09dSGeert Uytterhoeven
13632ced09dSGeert Uytterhoeven      required:
13732ced09dSGeert Uytterhoeven        - compatible
13832ced09dSGeert Uytterhoeven
1396a0e321eSRob HerringadditionalProperties: true
1406a0e321eSRob Herring
14132ced09dSGeert Uytterhoevenexamples:
14232ced09dSGeert Uytterhoeven  - |
14332ced09dSGeert Uytterhoeven    serial@1234 {
14432ced09dSGeert Uytterhoeven        compatible = "ns16550a";
14532ced09dSGeert Uytterhoeven        reg = <0x1234 0x20>;
14632ced09dSGeert Uytterhoeven        interrupts = <1>;
14732ced09dSGeert Uytterhoeven
14832ced09dSGeert Uytterhoeven        bluetooth {
14928ffe8bfSRob Herring            compatible = "brcm,bcm4330-bt";
15032ced09dSGeert Uytterhoeven            interrupt-parent = <&gpio>;
15132ced09dSGeert Uytterhoeven            interrupts = <10>;
15232ced09dSGeert Uytterhoeven        };
15332ced09dSGeert Uytterhoeven    };
154