xref: /linux/Documentation/devicetree/bindings/nvmem/rockchip,otp.yaml (revision fbf5df34a4dbcd09d433dd4f0916bf9b2ddb16de)
1# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
2%YAML 1.2
3---
4$id: http://devicetree.org/schemas/nvmem/rockchip,otp.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: Rockchip internal OTP (One Time Programmable) memory
8
9maintainers:
10  - Heiko Stuebner <heiko@sntech.de>
11
12properties:
13  compatible:
14    enum:
15      - rockchip,px30-otp
16      - rockchip,rk3308-otp
17      - rockchip,rk3528-otp
18      - rockchip,rk3562-otp
19      - rockchip,rk3568-otp
20      - rockchip,rk3576-otp
21      - rockchip,rk3588-otp
22
23  reg:
24    maxItems: 1
25
26  clocks:
27    minItems: 3
28    maxItems: 4
29
30  clock-names:
31    minItems: 3
32    maxItems: 4
33
34  resets:
35    minItems: 1
36    maxItems: 4
37
38  reset-names:
39    minItems: 1
40    maxItems: 4
41
42required:
43  - compatible
44  - reg
45  - clocks
46  - clock-names
47  - resets
48  - reset-names
49
50allOf:
51  - $ref: nvmem.yaml#
52  - $ref: nvmem-deprecated-cells.yaml#
53
54  - if:
55      properties:
56        compatible:
57          contains:
58            enum:
59              - rockchip,px30-otp
60              - rockchip,rk3308-otp
61    then:
62      properties:
63        clocks:
64          maxItems: 3
65        clock-names:
66          items:
67            - const: otp
68            - const: apb_pclk
69            - const: phy
70        resets:
71          maxItems: 1
72        reset-names:
73          items:
74            - const: phy
75
76  - if:
77      properties:
78        compatible:
79          contains:
80            enum:
81              - rockchip,rk3528-otp
82    then:
83      properties:
84        clocks:
85          maxItems: 3
86        clock-names:
87          items:
88            - const: otp
89            - const: apb_pclk
90            - const: sbpi
91        resets:
92          minItems: 3
93          maxItems: 3
94        reset-names:
95          items:
96            - const: otp
97            - const: apb
98            - const: sbpi
99
100  - if:
101      properties:
102        compatible:
103          contains:
104            enum:
105              - rockchip,rk3562-otp
106              - rockchip,rk3568-otp
107    then:
108      properties:
109        clocks:
110          minItems: 4
111          maxItems: 4
112        clock-names:
113          items:
114            - const: otp
115            - const: apb_pclk
116            - const: phy
117            - const: sbpi
118        resets:
119          minItems: 4
120          maxItems: 4
121        reset-names:
122          items:
123            - const: otp
124            - const: apb
125            - const: phy
126            - const: sbpi
127
128  - if:
129      properties:
130        compatible:
131          contains:
132            enum:
133              - rockchip,rk3576-otp
134    then:
135      properties:
136        clocks:
137          maxItems: 3
138        clock-names:
139          items:
140            - const: otp
141            - const: apb_pclk
142            - const: phy
143        resets:
144          minItems: 2
145          maxItems: 2
146        reset-names:
147          items:
148            - const: otp
149            - const: apb
150
151  - if:
152      properties:
153        compatible:
154          contains:
155            enum:
156              - rockchip,rk3588-otp
157    then:
158      properties:
159        clocks:
160          minItems: 4
161          maxItems: 4
162        clock-names:
163          items:
164            - const: otp
165            - const: apb_pclk
166            - const: phy
167            - const: arb
168        resets:
169          minItems: 3
170          maxItems: 3
171        reset-names:
172          items:
173            - const: otp
174            - const: apb
175            - const: arb
176
177unevaluatedProperties: false
178
179examples:
180  - |
181    #include <dt-bindings/clock/px30-cru.h>
182
183    soc {
184        #address-cells = <2>;
185        #size-cells = <2>;
186
187        otp: efuse@ff290000 {
188            compatible = "rockchip,px30-otp";
189            reg = <0x0 0xff290000 0x0 0x4000>;
190            clocks = <&cru SCLK_OTP_USR>, <&cru PCLK_OTP_NS>,
191                     <&cru PCLK_OTP_PHY>;
192            clock-names = "otp", "apb_pclk", "phy";
193            resets = <&cru SRST_OTP_PHY>;
194            reset-names = "phy";
195            #address-cells = <1>;
196            #size-cells = <1>;
197
198            cpu_id: id@7 {
199                reg = <0x07 0x10>;
200            };
201
202            cpu_leakage: cpu-leakage@17 {
203                reg = <0x17 0x1>;
204            };
205
206            performance: performance@1e {
207                reg = <0x1e 0x1>;
208                bits = <4 3>;
209            };
210        };
211    };
212