xref: /linux/Documentation/devicetree/bindings/rtc/st,stm32-rtc.yaml (revision 62597edf6340191511bdf9a7f64fa315ddc58805)
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
7title: STMicroelectronics STM32 Real Time Clock
8
9maintainers:
10  - Gabriel Fernandez <gabriel.fernandez@foss.st.com>
11
12properties:
13  compatible:
14    enum:
15      - st,stm32-rtc
16      - st,stm32h7-rtc
17      - st,stm32mp1-rtc
18      - st,stm32mp25-rtc
19
20  reg:
21    maxItems: 1
22
23  clocks:
24    minItems: 1
25    maxItems: 2
26
27  clock-names:
28    items:
29      - const: pclk
30      - const: rtc_ck
31
32  interrupts:
33    maxItems: 1
34
35  st,syscfg:
36    $ref: /schemas/types.yaml#/definitions/phandle-array
37    items:
38      minItems: 3
39      maxItems: 3
40    description: |
41      Phandle/offset/mask triplet. The phandle to pwrcfg used to
42      access control register at offset, and change the dbp (Disable Backup
43      Protection) bit represented by the mask, mandatory to disable/enable backup
44      domain (RTC registers) write protection.
45
46  assigned-clocks:
47    description: |
48      override default rtc_ck parent clock reference to the rtc_ck clock entry
49    maxItems: 1
50
51  assigned-clock-parents:
52    description: |
53      override default rtc_ck parent clock phandle of the new parent clock of rtc_ck
54    maxItems: 1
55
56allOf:
57  - if:
58      properties:
59        compatible:
60          contains:
61            const: st,stm32-rtc
62
63    then:
64      properties:
65        clocks:
66          minItems: 1
67          maxItems: 1
68
69        clock-names: false
70
71      required:
72        - st,syscfg
73
74  - if:
75      properties:
76        compatible:
77          contains:
78            const: st,stm32h7-rtc
79
80    then:
81      properties:
82        clocks:
83          minItems: 2
84          maxItems: 2
85
86      required:
87        - clock-names
88        - st,syscfg
89
90  - if:
91      properties:
92        compatible:
93          contains:
94            enum:
95              - st,stm32mp1-rtc
96              - st,stm32mp25-rtc
97
98    then:
99      properties:
100        clocks:
101          minItems: 2
102          maxItems: 2
103
104        assigned-clocks: false
105        assigned-clock-parents: false
106
107      required:
108        - clock-names
109
110required:
111  - compatible
112  - reg
113  - clocks
114  - interrupts
115
116additionalProperties: false
117
118examples:
119  - |
120    #include <dt-bindings/mfd/stm32f4-rcc.h>
121    #include <dt-bindings/clock/stm32fx-clock.h>
122    rtc@40002800 {
123      compatible = "st,stm32-rtc";
124      reg = <0x40002800 0x400>;
125      clocks = <&rcc 1 CLK_RTC>;
126      assigned-clocks = <&rcc 1 CLK_RTC>;
127      assigned-clock-parents = <&rcc 1 CLK_LSE>;
128      interrupt-parent = <&exti>;
129      interrupts = <17 1>;
130      st,syscfg = <&pwrcfg 0x00 0x100>;
131    };
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
144...
145