summaryrefslogtreecommitdiffstats
path: root/dts/Bindings/power/mediatek,power-controller.yaml
blob: 135c6f7220914286760e764e66e66ece402cdd84 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/power/mediatek,power-controller.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Mediatek Power Domains Controller

maintainers:
  - Weiyi Lu <weiyi.lu@mediatek.com>
  - Matthias Brugger <mbrugger@suse.com>

description: |
  Mediatek processors include support for multiple power domains which can be
  powered up/down by software based on different application scenes to save power.

  IP cores belonging to a power domain should contain a 'power-domains'
  property that is a phandle for SCPSYS node representing the domain.

properties:
  $nodename:
    const: power-controller

  compatible:
    enum:
      - mediatek,mt8167-power-controller
      - mediatek,mt8173-power-controller
      - mediatek,mt8183-power-controller
      - mediatek,mt8186-power-controller
      - mediatek,mt8192-power-controller
      - mediatek,mt8195-power-controller

  '#power-domain-cells':
    const: 1

  '#address-cells':
    const: 1

  '#size-cells':
    const: 0

patternProperties:
  "^power-domain@[0-9a-f]+$":
    type: object
    description: |
      Represents the power domains within the power controller node as documented
      in Documentation/devicetree/bindings/power/power-domain.yaml.

    properties:

      '#power-domain-cells':
        description:
          Must be 0 for nodes representing a single PM domain and 1 for nodes
          providing multiple PM domains.

      '#address-cells':
        const: 1

      '#size-cells':
        const: 0

      reg:
        description: |
          Power domain index. Valid values are defined in:
              "include/dt-bindings/power/mt8167-power.h" - for MT8167 type power domain.
              "include/dt-bindings/power/mt8173-power.h" - for MT8173 type power domain.
              "include/dt-bindings/power/mt8183-power.h" - for MT8183 type power domain.
              "include/dt-bindings/power/mt8192-power.h" - for MT8192 type power domain.
              "include/dt-bindings/power/mt8195-power.h" - for MT8195 type power domain.
        maxItems: 1

      clocks:
        description: |
          A number of phandles to clocks that need to be enabled during domain
          power-up sequencing.

      clock-names:
        description: |
          List of names of clocks, in order to match the power-up sequencing
          for each power domain we need to group the clocks by name. BASIC
          clocks need to be enabled before enabling the corresponding power
          domain, and should not have a '-' in their name (i.e mm, mfg, venc).
          SUSBYS clocks need to be enabled before releasing the bus protection,
          and should contain a '-' in their name (i.e mm-0, isp-0, cam-0).

          In order to follow properly the power-up sequencing, the clocks must
          be specified by order, adding first the BASIC clocks followed by the
          SUSBSYS clocks.

      domain-supply:
        description: domain regulator supply.

      mediatek,infracfg:
        $ref: /schemas/types.yaml#/definitions/phandle
        description: phandle to the device containing the INFRACFG register range.

      mediatek,smi:
        $ref: /schemas/types.yaml#/definitions/phandle
        description: phandle to the device containing the SMI register range.

    patternProperties:
      "^power-domain@[0-9a-f]+$":
        type: object
        description: |
          Represents a power domain child within a power domain parent node.

        properties:

          '#power-domain-cells':
            description:
              Must be 0 for nodes representing a single PM domain and 1 for nodes
              providing multiple PM domains.

          '#address-cells':
            const: 1

          '#size-cells':
            const: 0

          reg:
            maxItems: 1

          clocks:
            description: |
              A number of phandles to clocks that need to be enabled during domain
              power-up sequencing.

          clock-names:
            description: |
              List of names of clocks, in order to match the power-up sequencing
              for each power domain we need to group the clocks by name. BASIC
              clocks need to be enabled before enabling the corresponding power
              domain, and should not have a '-' in their name (i.e mm, mfg, venc).
              SUSBYS clocks need to be enabled before releasing the bus protection,
              and should contain a '-' in their name (i.e mm-0, isp-0, cam-0).

              In order to follow properly the power-up sequencing, the clocks must
              be specified by order, adding first the BASIC clocks followed by the
              SUSBSYS clocks.

          domain-supply:
            description: domain regulator supply.

          mediatek,infracfg:
            $ref: /schemas/types.yaml#/definitions/phandle
            description: phandle to the device containing the INFRACFG register range.

          mediatek,smi:
            $ref: /schemas/types.yaml#/definitions/phandle
            description: phandle to the device containing the SMI register range.

        patternProperties:
          "^power-domain@[0-9a-f]+$":
            type: object
            description: |
              Represents a power domain child within a power domain parent node.

            properties:

              '#power-domain-cells':
                description:
                  Must be 0 for nodes representing a single PM domain and 1 for nodes
                  providing multiple PM domains.

              '#address-cells':
                const: 1

              '#size-cells':
                const: 0

              reg:
                maxItems: 1

              clocks:
                description: |
                  A number of phandles to clocks that need to be enabled during domain
                  power-up sequencing.

              clock-names:
                description: |
                  List of names of clocks, in order to match the power-up sequencing
                  for each power domain we need to group the clocks by name. BASIC
                  clocks need to be enabled before enabling the corresponding power
                  domain, and should not have a '-' in their name (i.e mm, mfg, venc).
                  SUSBYS clocks need to be enabled before releasing the bus protection,
                  and should contain a '-' in their name (i.e mm-0, isp-0, cam-0).

                  In order to follow properly the power-up sequencing, the clocks must
                  be specified by order, adding first the BASIC clocks followed by the
                  SUSBSYS clocks.

              domain-supply:
                description: domain regulator supply.

              mediatek,infracfg:
                $ref: /schemas/types.yaml#/definitions/phandle
                description: phandle to the device containing the INFRACFG register range.

              mediatek,smi:
                $ref: /schemas/types.yaml#/definitions/phandle
                description: phandle to the device containing the SMI register range.

            required:
              - reg

            additionalProperties: false

        required:
          - reg

        additionalProperties: false

    required:
      - reg

    additionalProperties: false

required:
  - compatible

additionalProperties: false

examples:
  - |
    #include <dt-bindings/clock/mt8173-clk.h>
    #include <dt-bindings/power/mt8173-power.h>

    soc {
        #address-cells = <2>;
        #size-cells = <2>;

        scpsys: syscon@10006000 {
            compatible = "syscon", "simple-mfd";
            reg = <0 0x10006000 0 0x1000>;

            spm: power-controller {
                compatible = "mediatek,mt8173-power-controller";
                #address-cells = <1>;
                #size-cells = <0>;
                #power-domain-cells = <1>;

                /* power domains of the SoC */
                power-domain@MT8173_POWER_DOMAIN_VDEC {
                    reg = <MT8173_POWER_DOMAIN_VDEC>;
                    clocks = <&topckgen CLK_TOP_MM_SEL>;
                    clock-names = "mm";
                    #power-domain-cells = <0>;
                };
                power-domain@MT8173_POWER_DOMAIN_VENC {
                    reg = <MT8173_POWER_DOMAIN_VENC>;
                    clocks = <&topckgen CLK_TOP_MM_SEL>,
                             <&topckgen CLK_TOP_VENC_SEL>;
                    clock-names = "mm", "venc";
                    #power-domain-cells = <0>;
                };
                power-domain@MT8173_POWER_DOMAIN_ISP {
                    reg = <MT8173_POWER_DOMAIN_ISP>;
                    clocks = <&topckgen CLK_TOP_MM_SEL>;
                    clock-names = "mm";
                    #power-domain-cells = <0>;
                };
                power-domain@MT8173_POWER_DOMAIN_MM {
                    reg = <MT8173_POWER_DOMAIN_MM>;
                    clocks = <&topckgen CLK_TOP_MM_SEL>;
                    clock-names = "mm";
                    #power-domain-cells = <0>;
                    mediatek,infracfg = <&infracfg>;
                };
                power-domain@MT8173_POWER_DOMAIN_VENC_LT {
                    reg = <MT8173_POWER_DOMAIN_VENC_LT>;
                    clocks = <&topckgen CLK_TOP_MM_SEL>,
                             <&topckgen CLK_TOP_VENC_LT_SEL>;
                    clock-names = "mm", "venclt";
                    #power-domain-cells = <0>;
                };
                power-domain@MT8173_POWER_DOMAIN_AUDIO {
                    reg = <MT8173_POWER_DOMAIN_AUDIO>;
                    #power-domain-cells = <0>;
                };
                power-domain@MT8173_POWER_DOMAIN_USB {
                    reg = <MT8173_POWER_DOMAIN_USB>;
                    #power-domain-cells = <0>;
                };
                power-domain@MT8173_POWER_DOMAIN_MFG_ASYNC {
                    reg = <MT8173_POWER_DOMAIN_MFG_ASYNC>;
                    clocks = <&clk26m>;
                    clock-names = "mfg";
                    #address-cells = <1>;
                    #size-cells = <0>;
                    #power-domain-cells = <1>;

                    power-domain@MT8173_POWER_DOMAIN_MFG_2D {
                        reg = <MT8173_POWER_DOMAIN_MFG_2D>;
                        #address-cells = <1>;
                        #size-cells = <0>;
                        #power-domain-cells = <1>;

                        power-domain@MT8173_POWER_DOMAIN_MFG {
                            reg = <MT8173_POWER_DOMAIN_MFG>;
                            #power-domain-cells = <0>;
                            mediatek,infracfg = <&infracfg>;
                        };
                    };
                };
            };
        };
    };