0001 # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
0002 %YAML 1.2
0003 ---
0004 $id: "http://devicetree.org/schemas/serial/serial.yaml#"
0005 $schema: "http://devicetree.org/meta-schemas/core.yaml#"
0006
0007 title: Serial Interface Generic DT Bindings
0008
0009 maintainers:
0010 - Rob Herring <robh@kernel.org>
0011 - Greg Kroah-Hartman <gregkh@linuxfoundation.org>
0012
0013 description:
0014 This document lists a set of generic properties for describing UARTs in a
0015 device tree. Whether these properties apply to a particular device depends
0016 on the DT bindings for the actual device.
0017
0018 Each enabled UART may have an optional "serialN" alias in the "aliases" node,
0019 where N is the port number (non-negative decimal integer) as printed on the
0020 label next to the physical port.
0021
0022 properties:
0023 $nodename:
0024 pattern: "^serial(@.*)?$"
0025
0026 label: true
0027
0028 cts-gpios:
0029 maxItems: 1
0030 description:
0031 Must contain a GPIO specifier, referring to the GPIO pin to be used as
0032 the UART's CTS line.
0033
0034 dcd-gpios:
0035 maxItems: 1
0036 description:
0037 Must contain a GPIO specifier, referring to the GPIO pin to be used as
0038 the UART's DCD line.
0039
0040 dsr-gpios:
0041 maxItems: 1
0042 description:
0043 Must contain a GPIO specifier, referring to the GPIO pin to be used as
0044 the UART's DSR line.
0045
0046 dtr-gpios:
0047 maxItems: 1
0048 description:
0049 Must contain a GPIO specifier, referring to the GPIO pin to be used as
0050 the UART's DTR line.
0051
0052 rng-gpios:
0053 maxItems: 1
0054 description:
0055 Must contain a GPIO specifier, referring to the GPIO pin to be used as
0056 the UART's RNG line.
0057
0058 rts-gpios:
0059 maxItems: 1
0060 description:
0061 Must contain a GPIO specifier, referring to the GPIO pin to be used as
0062 the UART's RTS line.
0063
0064 uart-has-rtscts:
0065 $ref: /schemas/types.yaml#/definitions/flag
0066 description:
0067 The presence of this property indicates that the UART has dedicated lines
0068 for RTS/CTS hardware flow control, and that they are available for use
0069 (wired and enabled by pinmux configuration). This depends on both the
0070 UART hardware and the board wiring.
0071
0072 rx-tx-swap:
0073 type: boolean
0074 description: RX and TX pins are swapped.
0075
0076 cts-rts-swap:
0077 type: boolean
0078 description: CTS and RTS pins are swapped.
0079
0080 rx-threshold:
0081 $ref: /schemas/types.yaml#/definitions/uint32
0082 description:
0083 RX FIFO threshold configuration (in bytes).
0084
0085 tx-threshold:
0086 $ref: /schemas/types.yaml#/definitions/uint32
0087 description:
0088 TX FIFO threshold configuration (in bytes).
0089
0090 if:
0091 required:
0092 - uart-has-rtscts
0093 then:
0094 properties:
0095 cts-gpios: false
0096 rts-gpios: false
0097
0098 patternProperties:
0099 ".*":
0100 if:
0101 type: object
0102 then:
0103 description:
0104 Serial attached devices shall be a child node of the host UART device
0105 the slave device is attached to. It is expected that the attached
0106 device is the only child node of the UART device. The slave device node
0107 name shall reflect the generic type of device for the node.
0108
0109 properties:
0110 compatible:
0111 description:
0112 Compatible of the device connected to the serial port.
0113
0114 max-speed:
0115 $ref: /schemas/types.yaml#/definitions/uint32
0116 description:
0117 The maximum baud rate the device operates at.
0118 This should only be present if the maximum is less than the slave
0119 device can support. For example, a particular board has some
0120 signal quality issue or the host processor can't support higher
0121 baud rates.
0122
0123 current-speed:
0124 $ref: /schemas/types.yaml#/definitions/uint32
0125 description: |
0126 The current baud rate the device operates at.
0127 This should only be present in case a driver has no chance to know
0128 the baud rate of the slave device.
0129 Examples:
0130 * device supports auto-baud
0131 * the rate is setup by a bootloader and there is no way to reset
0132 the device
0133 * device baud rate is configured by its firmware but there is no
0134 way to request the actual settings
0135
0136 required:
0137 - compatible
0138
0139 additionalProperties: true
0140
0141 examples:
0142 - |
0143 serial@1234 {
0144 compatible = "ns16550a";
0145 reg = <0x1234 0x20>;
0146 interrupts = <1>;
0147
0148 bluetooth {
0149 compatible = "brcm,bcm4330-bt";
0150 interrupt-parent = <&gpio>;
0151 interrupts = <10>;
0152 };
0153 };