serial.yaml 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
  2. %YAML 1.2
  3. ---
  4. $id: http://devicetree.org/schemas/serial/serial.yaml#
  5. $schema: http://devicetree.org/meta-schemas/core.yaml#
  6. title: Serial Interface Generic
  7. maintainers:
  8. - Rob Herring <robh@kernel.org>
  9. - Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  10. description:
  11. This document lists a set of generic properties for describing UARTs in a
  12. device tree. Whether these properties apply to a particular device depends
  13. on the DT bindings for the actual device.
  14. Each enabled UART may have an optional "serialN" alias in the "aliases" node,
  15. where N is the port number (non-negative decimal integer) as printed on the
  16. label next to the physical port.
  17. properties:
  18. $nodename:
  19. pattern: "^serial(@.*)?$"
  20. label: true
  21. cts-gpios:
  22. maxItems: 1
  23. description:
  24. Must contain a GPIO specifier, referring to the GPIO pin to be used as
  25. the UART's CTS line.
  26. dcd-gpios:
  27. maxItems: 1
  28. description:
  29. Must contain a GPIO specifier, referring to the GPIO pin to be used as
  30. the UART's DCD line.
  31. dsr-gpios:
  32. maxItems: 1
  33. description:
  34. Must contain a GPIO specifier, referring to the GPIO pin to be used as
  35. the UART's DSR line.
  36. dtr-gpios:
  37. maxItems: 1
  38. description:
  39. Must contain a GPIO specifier, referring to the GPIO pin to be used as
  40. the UART's DTR line.
  41. rng-gpios:
  42. maxItems: 1
  43. description:
  44. Must contain a GPIO specifier, referring to the GPIO pin to be used as
  45. the UART's RNG line.
  46. rts-gpios:
  47. maxItems: 1
  48. description:
  49. Must contain a GPIO specifier, referring to the GPIO pin to be used as
  50. the UART's RTS line.
  51. uart-has-rtscts:
  52. $ref: /schemas/types.yaml#/definitions/flag
  53. description:
  54. The presence of this property indicates that the UART has dedicated lines
  55. for RTS/CTS hardware flow control, and that they are available for use
  56. (wired and enabled by pinmux configuration). This depends on both the
  57. UART hardware and the board wiring.
  58. rx-tx-swap:
  59. type: boolean
  60. description: RX and TX pins are swapped.
  61. cts-rts-swap:
  62. type: boolean
  63. description: CTS and RTS pins are swapped.
  64. rx-threshold:
  65. $ref: /schemas/types.yaml#/definitions/uint32
  66. description:
  67. RX FIFO threshold configuration (in bytes).
  68. tx-threshold:
  69. $ref: /schemas/types.yaml#/definitions/uint32
  70. description:
  71. TX FIFO threshold configuration (in bytes).
  72. patternProperties:
  73. "^(bluetooth|bluetooth-gnss|embedded-controller|gnss|gps|mcu|onewire)$":
  74. if:
  75. type: object
  76. then:
  77. additionalProperties: true
  78. $ref: serial-peripheral-props.yaml#
  79. description:
  80. Serial attached devices shall be a child node of the host UART device
  81. the slave device is attached to. It is expected that the attached
  82. device is the only child node of the UART device. The slave device node
  83. name shall reflect the generic type of device for the node.
  84. properties:
  85. compatible:
  86. description:
  87. Compatible of the device connected to the serial port.
  88. required:
  89. - compatible
  90. if:
  91. required:
  92. - uart-has-rtscts
  93. then:
  94. properties:
  95. cts-gpios: false
  96. rts-gpios: false
  97. additionalProperties: true
  98. examples:
  99. - |
  100. serial@1234 {
  101. compatible = "ns16550a";
  102. reg = <0x1234 0x20>;
  103. interrupts = <1>;
  104. bluetooth {
  105. compatible = "brcm,bcm4330-bt";
  106. interrupt-parent = <&gpio>;
  107. interrupts = <10>;
  108. };
  109. };