Merge tag 'kvm-s390-next-5.6-1' of git://git.kernel.org/pub/scm/linux/kernel/git...
[sfrench/cifs-2.6.git] / Documentation / devicetree / bindings / rtc / st,stm32-rtc.yaml
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
7 title: STMicroelectronics STM32 Real Time Clock Bindings
8
9 maintainers:
10   - Gabriel Fernandez <gabriel.fernandez@st.com>
11
12 properties:
13   compatible:
14     enum:
15       - st,stm32-rtc
16       - st,stm32h7-rtc
17       - st,stm32mp1-rtc
18
19   reg:
20     maxItems: 1
21
22   clocks:
23     minItems: 1
24     maxItems: 2
25
26   clock-names:
27     items:
28       - const: pclk
29       - const: rtc_ck
30
31   interrupts:
32     maxItems: 1
33
34   st,syscfg:
35     allOf:
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
56 allOf:
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             const: st,stm32mp1-rtc
95
96     then:
97        properties:
98          clocks:
99            minItems: 2
100            maxItems: 2
101
102          assigned-clocks: false
103          assigned-clock-parents: false
104
105        required:
106          - clock-names
107
108 required:
109   - compatible
110   - reg
111   - clocks
112   - interrupts
113
114 examples:
115   - |
116     #include <dt-bindings/mfd/stm32f4-rcc.h>
117     #include <dt-bindings/clock/stm32fx-clock.h>
118     rtc@40002800 {
119       compatible = "st,stm32-rtc";
120       reg = <0x40002800 0x400>;
121       clocks = <&rcc 1 CLK_RTC>;
122       assigned-clocks = <&rcc 1 CLK_RTC>;
123       assigned-clock-parents = <&rcc 1 CLK_LSE>;
124       interrupt-parent = <&exti>;
125       interrupts = <17 1>;
126       st,syscfg = <&pwrcfg 0x00 0x100>;
127     };
128
129     #include <dt-bindings/interrupt-controller/arm-gic.h>
130     #include <dt-bindings/clock/stm32mp1-clks.h>
131     rtc@5c004000 {
132       compatible = "st,stm32mp1-rtc";
133       reg = <0x5c004000 0x400>;
134       clocks = <&rcc RTCAPB>, <&rcc RTC>;
135       clock-names = "pclk", "rtc_ck";
136       interrupts = <GIC_SPI 3 IRQ_TYPE_LEVEL_HIGH>;
137     };
138
139 ...