st,stm32-rtc.yaml 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
  2. %YAML 1.2
  3. ---
  4. $id: http://devicetree.org/schemas/rtc/st,stm32-rtc.yaml#
  5. $schema: http://devicetree.org/meta-schemas/core.yaml#
  6. title: STMicroelectronics STM32 Real Time Clock
  7. maintainers:
  8. - Gabriel Fernandez <gabriel.fernandez@foss.st.com>
  9. properties:
  10. compatible:
  11. enum:
  12. - st,stm32-rtc
  13. - st,stm32h7-rtc
  14. - st,stm32mp1-rtc
  15. - st,stm32mp25-rtc
  16. reg:
  17. maxItems: 1
  18. clocks:
  19. minItems: 1
  20. maxItems: 2
  21. clock-names:
  22. items:
  23. - const: pclk
  24. - const: rtc_ck
  25. interrupts:
  26. maxItems: 1
  27. st,syscfg:
  28. $ref: /schemas/types.yaml#/definitions/phandle-array
  29. items:
  30. minItems: 3
  31. maxItems: 3
  32. description: |
  33. Phandle/offset/mask triplet. The phandle to pwrcfg used to
  34. access control register at offset, and change the dbp (Disable Backup
  35. Protection) bit represented by the mask, mandatory to disable/enable backup
  36. domain (RTC registers) write protection.
  37. assigned-clocks:
  38. description: |
  39. override default rtc_ck parent clock reference to the rtc_ck clock entry
  40. maxItems: 1
  41. assigned-clock-parents:
  42. description: |
  43. override default rtc_ck parent clock phandle of the new parent clock of rtc_ck
  44. maxItems: 1
  45. patternProperties:
  46. "^rtc-[a-z]+-[0-9]+$":
  47. type: object
  48. $ref: /schemas/pinctrl/pinmux-node.yaml
  49. description: |
  50. Configuration of STM32 RTC pins description. STM32 RTC is able to output
  51. some signals on specific pins:
  52. - LSCO (Low Speed Clock Output) that allow to output LSE clock on a pin.
  53. - Alarm out that allow to send a pulse on a pin when alarm A of the RTC
  54. expires.
  55. additionalProperties: false
  56. properties:
  57. function:
  58. enum:
  59. - lsco
  60. - alarm-a
  61. pins:
  62. enum:
  63. - out1
  64. - out2
  65. - out2_rmp
  66. allOf:
  67. - if:
  68. properties:
  69. compatible:
  70. contains:
  71. const: st,stm32-rtc
  72. then:
  73. properties:
  74. clocks:
  75. minItems: 1
  76. maxItems: 1
  77. clock-names: false
  78. patternProperties:
  79. "^rtc-[a-z]+-[0-9]+$": false
  80. required:
  81. - st,syscfg
  82. - if:
  83. properties:
  84. compatible:
  85. contains:
  86. const: st,stm32h7-rtc
  87. then:
  88. properties:
  89. clocks:
  90. minItems: 2
  91. maxItems: 2
  92. patternProperties:
  93. "^rtc-[a-z]+-[0-9]+$": false
  94. required:
  95. - clock-names
  96. - st,syscfg
  97. - if:
  98. properties:
  99. compatible:
  100. contains:
  101. enum:
  102. - st,stm32mp1-rtc
  103. - st,stm32mp25-rtc
  104. then:
  105. properties:
  106. clocks:
  107. minItems: 2
  108. maxItems: 2
  109. assigned-clocks: false
  110. assigned-clock-parents: false
  111. required:
  112. - clock-names
  113. required:
  114. - compatible
  115. - reg
  116. - clocks
  117. - interrupts
  118. additionalProperties: false
  119. examples:
  120. - |
  121. #include <dt-bindings/mfd/stm32f4-rcc.h>
  122. #include <dt-bindings/clock/stm32fx-clock.h>
  123. rtc@40002800 {
  124. compatible = "st,stm32-rtc";
  125. reg = <0x40002800 0x400>;
  126. clocks = <&rcc 1 CLK_RTC>;
  127. assigned-clocks = <&rcc 1 CLK_RTC>;
  128. assigned-clock-parents = <&rcc 1 CLK_LSE>;
  129. interrupt-parent = <&exti>;
  130. interrupts = <17 1>;
  131. st,syscfg = <&pwrcfg 0x00 0x100>;
  132. };
  133. - |
  134. #include <dt-bindings/interrupt-controller/arm-gic.h>
  135. #include <dt-bindings/clock/stm32mp1-clks.h>
  136. rtc@5c004000 {
  137. compatible = "st,stm32mp1-rtc";
  138. reg = <0x5c004000 0x400>;
  139. clocks = <&rcc RTCAPB>, <&rcc RTC>;
  140. clock-names = "pclk", "rtc_ck";
  141. interrupts = <GIC_SPI 3 IRQ_TYPE_LEVEL_HIGH>;
  142. };
  143. ...