st,stm32-uart.yaml 2.6 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/st,stm32-uart.yaml#
  5. $schema: http://devicetree.org/meta-schemas/core.yaml#
  6. maintainers:
  7. - Erwan Le Ray <erwan.leray@foss.st.com>
  8. title: STMicroelectronics STM32 USART
  9. properties:
  10. compatible:
  11. enum:
  12. - st,stm32-uart
  13. - st,stm32f7-uart
  14. - st,stm32h7-uart
  15. reg:
  16. maxItems: 1
  17. interrupts:
  18. maxItems: 1
  19. clocks:
  20. maxItems: 1
  21. resets:
  22. maxItems: 1
  23. label:
  24. description: label associated with this uart
  25. st,hw-flow-ctrl:
  26. description: enable hardware flow control (deprecated)
  27. $ref: /schemas/types.yaml#/definitions/flag
  28. rx-tx-swap: true
  29. dmas:
  30. minItems: 1
  31. maxItems: 2
  32. dma-names:
  33. items:
  34. enum: [ rx, tx ]
  35. minItems: 1
  36. maxItems: 2
  37. # cts-gpios and rts-gpios properties can be used instead of 'uart-has-rtscts'
  38. # or 'st,hw-flow-ctrl' (deprecated) for making use of any gpio pins for flow
  39. # control instead of dedicated pins.
  40. #
  41. # It should be noted that both cts-gpios/rts-gpios and 'uart-has-rtscts' or
  42. # 'st,hw-flow-ctrl' (deprecated) properties cannot co-exist in a design.
  43. cts-gpios: true
  44. rts-gpios: true
  45. wakeup-source: true
  46. power-domains:
  47. maxItems: 1
  48. rx-threshold:
  49. description:
  50. If value is set to 1, RX FIFO threshold is disabled.
  51. enum: [1, 2, 4, 8, 12, 14, 16]
  52. default: 8
  53. tx-threshold:
  54. description:
  55. If value is set to 1, TX FIFO threshold is disabled.
  56. enum: [1, 2, 4, 8, 12, 14, 16]
  57. default: 8
  58. access-controllers:
  59. minItems: 1
  60. maxItems: 2
  61. allOf:
  62. - $ref: rs485.yaml#
  63. - $ref: serial.yaml#
  64. - if:
  65. required:
  66. - st,hw-flow-ctrl
  67. then:
  68. properties:
  69. cts-gpios: false
  70. rts-gpios: false
  71. - if:
  72. properties:
  73. compatible:
  74. const: st,stm32-uart
  75. then:
  76. properties:
  77. rx-tx-swap: false
  78. - if:
  79. properties:
  80. compatible:
  81. contains:
  82. enum:
  83. - st,stm32-uart
  84. - st,stm32f7-uart
  85. then:
  86. properties:
  87. rx-threshold: false
  88. tx-threshold: false
  89. required:
  90. - compatible
  91. - reg
  92. - interrupts
  93. - clocks
  94. unevaluatedProperties: false
  95. examples:
  96. - |
  97. #include <dt-bindings/clock/stm32mp1-clks.h>
  98. usart1: serial@40011000 {
  99. compatible = "st,stm32h7-uart";
  100. reg = <0x40011000 0x400>;
  101. interrupts = <37>;
  102. clocks = <&rcc 0 164>;
  103. dmas = <&dma2 2 4 0x414 0x0>,
  104. <&dma2 7 4 0x414 0x0>;
  105. dma-names = "rx", "tx";
  106. rx-threshold = <4>;
  107. tx-threshold = <4>;
  108. rs485-rts-active-low;
  109. };
  110. ...