1d392fe78SEnric Balletbo i Serra# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2d392fe78SEnric Balletbo i Serra%YAML 1.2
3d392fe78SEnric Balletbo i Serra---
4d392fe78SEnric Balletbo i Serra$id: http://devicetree.org/schemas/power/mediatek,power-controller.yaml#
5d392fe78SEnric Balletbo i Serra$schema: http://devicetree.org/meta-schemas/core.yaml#
6d392fe78SEnric Balletbo i Serra
7d392fe78SEnric Balletbo i Serratitle: Mediatek Power Domains Controller
8d392fe78SEnric Balletbo i Serra
9d392fe78SEnric Balletbo i Serramaintainers:
10d392fe78SEnric Balletbo i Serra  - Weiyi Lu <weiyi.lu@mediatek.com>
11d392fe78SEnric Balletbo i Serra  - Matthias Brugger <mbrugger@suse.com>
12d392fe78SEnric Balletbo i Serra
13d392fe78SEnric Balletbo i Serradescription: |
14d392fe78SEnric Balletbo i Serra  Mediatek processors include support for multiple power domains which can be
15d392fe78SEnric Balletbo i Serra  powered up/down by software based on different application scenes to save power.
16d392fe78SEnric Balletbo i Serra
17d392fe78SEnric Balletbo i Serra  IP cores belonging to a power domain should contain a 'power-domains'
18d392fe78SEnric Balletbo i Serra  property that is a phandle for SCPSYS node representing the domain.
19d392fe78SEnric Balletbo i Serra
20d392fe78SEnric Balletbo i Serraproperties:
21d392fe78SEnric Balletbo i Serra  $nodename:
22d392fe78SEnric Balletbo i Serra    const: power-controller
23d392fe78SEnric Balletbo i Serra
24d392fe78SEnric Balletbo i Serra  compatible:
25d392fe78SEnric Balletbo i Serra    enum:
26d392fe78SEnric Balletbo i Serra      - mediatek,mt8173-power-controller
2786a378bbSEnric Balletbo i Serra      - mediatek,mt8183-power-controller
28*343106d9SWeiyi Lu      - mediatek,mt8192-power-controller
29d392fe78SEnric Balletbo i Serra
30d392fe78SEnric Balletbo i Serra  '#power-domain-cells':
31d392fe78SEnric Balletbo i Serra    const: 1
32d392fe78SEnric Balletbo i Serra
33d392fe78SEnric Balletbo i Serra  '#address-cells':
34d392fe78SEnric Balletbo i Serra    const: 1
35d392fe78SEnric Balletbo i Serra
36d392fe78SEnric Balletbo i Serra  '#size-cells':
37d392fe78SEnric Balletbo i Serra    const: 0
38d392fe78SEnric Balletbo i Serra
39d392fe78SEnric Balletbo i SerrapatternProperties:
40d392fe78SEnric Balletbo i Serra  "^power-domain@[0-9a-f]+$":
41d392fe78SEnric Balletbo i Serra    type: object
42d392fe78SEnric Balletbo i Serra    description: |
43d392fe78SEnric Balletbo i Serra      Represents the power domains within the power controller node as documented
44d392fe78SEnric Balletbo i Serra      in Documentation/devicetree/bindings/power/power-domain.yaml.
45d392fe78SEnric Balletbo i Serra
46d392fe78SEnric Balletbo i Serra    properties:
47d392fe78SEnric Balletbo i Serra
48d392fe78SEnric Balletbo i Serra      '#power-domain-cells':
49d392fe78SEnric Balletbo i Serra        description:
50d392fe78SEnric Balletbo i Serra          Must be 0 for nodes representing a single PM domain and 1 for nodes
51d392fe78SEnric Balletbo i Serra          providing multiple PM domains.
52d392fe78SEnric Balletbo i Serra
53d392fe78SEnric Balletbo i Serra      '#address-cells':
54d392fe78SEnric Balletbo i Serra        const: 1
55d392fe78SEnric Balletbo i Serra
56d392fe78SEnric Balletbo i Serra      '#size-cells':
57d392fe78SEnric Balletbo i Serra        const: 0
58d392fe78SEnric Balletbo i Serra
59d392fe78SEnric Balletbo i Serra      reg:
60d392fe78SEnric Balletbo i Serra        description: |
61d392fe78SEnric Balletbo i Serra          Power domain index. Valid values are defined in:
62d392fe78SEnric Balletbo i Serra              "include/dt-bindings/power/mt8173-power.h" - for MT8173 type power domain.
6386a378bbSEnric Balletbo i Serra              "include/dt-bindings/power/mt8183-power.h" - for MT8183 type power domain.
64*343106d9SWeiyi Lu              "include/dt-bindings/power/mt8192-power.h" - for MT8192 type power domain.
65d392fe78SEnric Balletbo i Serra        maxItems: 1
66d392fe78SEnric Balletbo i Serra
67d392fe78SEnric Balletbo i Serra      clocks:
68d392fe78SEnric Balletbo i Serra        description: |
69d392fe78SEnric Balletbo i Serra          A number of phandles to clocks that need to be enabled during domain
70d392fe78SEnric Balletbo i Serra          power-up sequencing.
71d392fe78SEnric Balletbo i Serra
72d392fe78SEnric Balletbo i Serra      clock-names:
73d392fe78SEnric Balletbo i Serra        description: |
74d392fe78SEnric Balletbo i Serra          List of names of clocks, in order to match the power-up sequencing
75d392fe78SEnric Balletbo i Serra          for each power domain we need to group the clocks by name. BASIC
76d392fe78SEnric Balletbo i Serra          clocks need to be enabled before enabling the corresponding power
77d392fe78SEnric Balletbo i Serra          domain, and should not have a '-' in their name (i.e mm, mfg, venc).
78d392fe78SEnric Balletbo i Serra          SUSBYS clocks need to be enabled before releasing the bus protection,
79d392fe78SEnric Balletbo i Serra          and should contain a '-' in their name (i.e mm-0, isp-0, cam-0).
80d392fe78SEnric Balletbo i Serra
81d392fe78SEnric Balletbo i Serra          In order to follow properly the power-up sequencing, the clocks must
82d392fe78SEnric Balletbo i Serra          be specified by order, adding first the BASIC clocks followed by the
83d392fe78SEnric Balletbo i Serra          SUSBSYS clocks.
84d392fe78SEnric Balletbo i Serra
85d392fe78SEnric Balletbo i Serra      mediatek,infracfg:
86d392fe78SEnric Balletbo i Serra        $ref: /schemas/types.yaml#definitions/phandle
87d392fe78SEnric Balletbo i Serra        description: phandle to the device containing the INFRACFG register range.
88d392fe78SEnric Balletbo i Serra
89d392fe78SEnric Balletbo i Serra      mediatek,smi:
90d392fe78SEnric Balletbo i Serra        $ref: /schemas/types.yaml#definitions/phandle
91d392fe78SEnric Balletbo i Serra        description: phandle to the device containing the SMI register range.
92d392fe78SEnric Balletbo i Serra
93d392fe78SEnric Balletbo i Serra    patternProperties:
94d392fe78SEnric Balletbo i Serra      "^power-domain@[0-9a-f]+$":
95d392fe78SEnric Balletbo i Serra        type: object
96d392fe78SEnric Balletbo i Serra        description: |
97d392fe78SEnric Balletbo i Serra          Represents a power domain child within a power domain parent node.
98d392fe78SEnric Balletbo i Serra
99d392fe78SEnric Balletbo i Serra        properties:
100d392fe78SEnric Balletbo i Serra
101d392fe78SEnric Balletbo i Serra          '#power-domain-cells':
102d392fe78SEnric Balletbo i Serra            description:
103d392fe78SEnric Balletbo i Serra              Must be 0 for nodes representing a single PM domain and 1 for nodes
104d392fe78SEnric Balletbo i Serra              providing multiple PM domains.
105d392fe78SEnric Balletbo i Serra
106d392fe78SEnric Balletbo i Serra          '#address-cells':
107d392fe78SEnric Balletbo i Serra            const: 1
108d392fe78SEnric Balletbo i Serra
109d392fe78SEnric Balletbo i Serra          '#size-cells':
110d392fe78SEnric Balletbo i Serra            const: 0
111d392fe78SEnric Balletbo i Serra
112d392fe78SEnric Balletbo i Serra          reg:
113d392fe78SEnric Balletbo i Serra            maxItems: 1
114d392fe78SEnric Balletbo i Serra
115d392fe78SEnric Balletbo i Serra          clocks:
116d392fe78SEnric Balletbo i Serra            description: |
117d392fe78SEnric Balletbo i Serra              A number of phandles to clocks that need to be enabled during domain
118d392fe78SEnric Balletbo i Serra              power-up sequencing.
119d392fe78SEnric Balletbo i Serra
120d392fe78SEnric Balletbo i Serra          clock-names:
121d392fe78SEnric Balletbo i Serra            description: |
122d392fe78SEnric Balletbo i Serra              List of names of clocks, in order to match the power-up sequencing
123d392fe78SEnric Balletbo i Serra              for each power domain we need to group the clocks by name. BASIC
124d392fe78SEnric Balletbo i Serra              clocks need to be enabled before enabling the corresponding power
125d392fe78SEnric Balletbo i Serra              domain, and should not have a '-' in their name (i.e mm, mfg, venc).
126d392fe78SEnric Balletbo i Serra              SUSBYS clocks need to be enabled before releasing the bus protection,
127d392fe78SEnric Balletbo i Serra              and should contain a '-' in their name (i.e mm-0, isp-0, cam-0).
128d392fe78SEnric Balletbo i Serra
129d392fe78SEnric Balletbo i Serra              In order to follow properly the power-up sequencing, the clocks must
130d392fe78SEnric Balletbo i Serra              be specified by order, adding first the BASIC clocks followed by the
131d392fe78SEnric Balletbo i Serra              SUSBSYS clocks.
132d392fe78SEnric Balletbo i Serra
133d392fe78SEnric Balletbo i Serra          mediatek,infracfg:
134d392fe78SEnric Balletbo i Serra            $ref: /schemas/types.yaml#definitions/phandle
135d392fe78SEnric Balletbo i Serra            description: phandle to the device containing the INFRACFG register range.
136d392fe78SEnric Balletbo i Serra
137d392fe78SEnric Balletbo i Serra          mediatek,smi:
138d392fe78SEnric Balletbo i Serra            $ref: /schemas/types.yaml#definitions/phandle
139d392fe78SEnric Balletbo i Serra            description: phandle to the device containing the SMI register range.
140d392fe78SEnric Balletbo i Serra
141d392fe78SEnric Balletbo i Serra        patternProperties:
142d392fe78SEnric Balletbo i Serra          "^power-domain@[0-9a-f]+$":
143d392fe78SEnric Balletbo i Serra            type: object
144d392fe78SEnric Balletbo i Serra            description: |
145d392fe78SEnric Balletbo i Serra              Represents a power domain child within a power domain parent node.
146d392fe78SEnric Balletbo i Serra
147d392fe78SEnric Balletbo i Serra            properties:
148d392fe78SEnric Balletbo i Serra
149d392fe78SEnric Balletbo i Serra              '#power-domain-cells':
150d392fe78SEnric Balletbo i Serra                description:
151d392fe78SEnric Balletbo i Serra                  Must be 0 for nodes representing a single PM domain and 1 for nodes
152d392fe78SEnric Balletbo i Serra                  providing multiple PM domains.
153d392fe78SEnric Balletbo i Serra
154d392fe78SEnric Balletbo i Serra              '#address-cells':
155d392fe78SEnric Balletbo i Serra                const: 1
156d392fe78SEnric Balletbo i Serra
157d392fe78SEnric Balletbo i Serra              '#size-cells':
158d392fe78SEnric Balletbo i Serra                const: 0
159d392fe78SEnric Balletbo i Serra
160d392fe78SEnric Balletbo i Serra              reg:
161d392fe78SEnric Balletbo i Serra                maxItems: 1
162d392fe78SEnric Balletbo i Serra
163d392fe78SEnric Balletbo i Serra              clocks:
164d392fe78SEnric Balletbo i Serra                description: |
165d392fe78SEnric Balletbo i Serra                  A number of phandles to clocks that need to be enabled during domain
166d392fe78SEnric Balletbo i Serra                  power-up sequencing.
167d392fe78SEnric Balletbo i Serra
168d392fe78SEnric Balletbo i Serra              clock-names:
169d392fe78SEnric Balletbo i Serra                description: |
170d392fe78SEnric Balletbo i Serra                  List of names of clocks, in order to match the power-up sequencing
171d392fe78SEnric Balletbo i Serra                  for each power domain we need to group the clocks by name. BASIC
172d392fe78SEnric Balletbo i Serra                  clocks need to be enabled before enabling the corresponding power
173d392fe78SEnric Balletbo i Serra                  domain, and should not have a '-' in their name (i.e mm, mfg, venc).
174d392fe78SEnric Balletbo i Serra                  SUSBYS clocks need to be enabled before releasing the bus protection,
175d392fe78SEnric Balletbo i Serra                  and should contain a '-' in their name (i.e mm-0, isp-0, cam-0).
176d392fe78SEnric Balletbo i Serra
177d392fe78SEnric Balletbo i Serra                  In order to follow properly the power-up sequencing, the clocks must
178d392fe78SEnric Balletbo i Serra                  be specified by order, adding first the BASIC clocks followed by the
179d392fe78SEnric Balletbo i Serra                  SUSBSYS clocks.
180d392fe78SEnric Balletbo i Serra
181d392fe78SEnric Balletbo i Serra              mediatek,infracfg:
182d392fe78SEnric Balletbo i Serra                $ref: /schemas/types.yaml#definitions/phandle
183d392fe78SEnric Balletbo i Serra                description: phandle to the device containing the INFRACFG register range.
184d392fe78SEnric Balletbo i Serra
185d392fe78SEnric Balletbo i Serra              mediatek,smi:
186d392fe78SEnric Balletbo i Serra                $ref: /schemas/types.yaml#definitions/phandle
187d392fe78SEnric Balletbo i Serra                description: phandle to the device containing the SMI register range.
188d392fe78SEnric Balletbo i Serra
189d392fe78SEnric Balletbo i Serra            required:
190d392fe78SEnric Balletbo i Serra              - reg
191d392fe78SEnric Balletbo i Serra
192d392fe78SEnric Balletbo i Serra            additionalProperties: false
193d392fe78SEnric Balletbo i Serra
194d392fe78SEnric Balletbo i Serra        required:
195d392fe78SEnric Balletbo i Serra          - reg
196d392fe78SEnric Balletbo i Serra
197d392fe78SEnric Balletbo i Serra        additionalProperties: false
198d392fe78SEnric Balletbo i Serra
199d392fe78SEnric Balletbo i Serra    required:
200d392fe78SEnric Balletbo i Serra      - reg
201d392fe78SEnric Balletbo i Serra
202d392fe78SEnric Balletbo i Serra    additionalProperties: false
203d392fe78SEnric Balletbo i Serra
204d392fe78SEnric Balletbo i Serrarequired:
205d392fe78SEnric Balletbo i Serra  - compatible
206d392fe78SEnric Balletbo i Serra
207d392fe78SEnric Balletbo i SerraadditionalProperties: false
208d392fe78SEnric Balletbo i Serra
209d392fe78SEnric Balletbo i Serraexamples:
210d392fe78SEnric Balletbo i Serra  - |
211d392fe78SEnric Balletbo i Serra    #include <dt-bindings/clock/mt8173-clk.h>
212d392fe78SEnric Balletbo i Serra    #include <dt-bindings/power/mt8173-power.h>
213d392fe78SEnric Balletbo i Serra
214d392fe78SEnric Balletbo i Serra    soc {
215d392fe78SEnric Balletbo i Serra        #address-cells = <2>;
216d392fe78SEnric Balletbo i Serra        #size-cells = <2>;
217d392fe78SEnric Balletbo i Serra
218d392fe78SEnric Balletbo i Serra        scpsys: syscon@10006000 {
219d392fe78SEnric Balletbo i Serra            compatible = "syscon", "simple-mfd";
220d392fe78SEnric Balletbo i Serra            reg = <0 0x10006000 0 0x1000>;
221d392fe78SEnric Balletbo i Serra
222d392fe78SEnric Balletbo i Serra            spm: power-controller {
223d392fe78SEnric Balletbo i Serra                compatible = "mediatek,mt8173-power-controller";
224d392fe78SEnric Balletbo i Serra                #address-cells = <1>;
225d392fe78SEnric Balletbo i Serra                #size-cells = <0>;
226d392fe78SEnric Balletbo i Serra                #power-domain-cells = <1>;
227d392fe78SEnric Balletbo i Serra
228d392fe78SEnric Balletbo i Serra                /* power domains of the SoC */
229d392fe78SEnric Balletbo i Serra                power-domain@MT8173_POWER_DOMAIN_VDEC {
230d392fe78SEnric Balletbo i Serra                    reg = <MT8173_POWER_DOMAIN_VDEC>;
231d392fe78SEnric Balletbo i Serra                    clocks = <&topckgen CLK_TOP_MM_SEL>;
232d392fe78SEnric Balletbo i Serra                    clock-names = "mm";
233d392fe78SEnric Balletbo i Serra                    #power-domain-cells = <0>;
234d392fe78SEnric Balletbo i Serra                };
235d392fe78SEnric Balletbo i Serra                power-domain@MT8173_POWER_DOMAIN_VENC {
236d392fe78SEnric Balletbo i Serra                    reg = <MT8173_POWER_DOMAIN_VENC>;
237d392fe78SEnric Balletbo i Serra                    clocks = <&topckgen CLK_TOP_MM_SEL>,
238d392fe78SEnric Balletbo i Serra                             <&topckgen CLK_TOP_VENC_SEL>;
239d392fe78SEnric Balletbo i Serra                    clock-names = "mm", "venc";
240d392fe78SEnric Balletbo i Serra                    #power-domain-cells = <0>;
241d392fe78SEnric Balletbo i Serra                };
242d392fe78SEnric Balletbo i Serra                power-domain@MT8173_POWER_DOMAIN_ISP {
243d392fe78SEnric Balletbo i Serra                    reg = <MT8173_POWER_DOMAIN_ISP>;
244d392fe78SEnric Balletbo i Serra                    clocks = <&topckgen CLK_TOP_MM_SEL>;
245d392fe78SEnric Balletbo i Serra                    clock-names = "mm";
246d392fe78SEnric Balletbo i Serra                    #power-domain-cells = <0>;
247d392fe78SEnric Balletbo i Serra                };
248d392fe78SEnric Balletbo i Serra                power-domain@MT8173_POWER_DOMAIN_MM {
249d392fe78SEnric Balletbo i Serra                    reg = <MT8173_POWER_DOMAIN_MM>;
250d392fe78SEnric Balletbo i Serra                    clocks = <&topckgen CLK_TOP_MM_SEL>;
251d392fe78SEnric Balletbo i Serra                    clock-names = "mm";
252d392fe78SEnric Balletbo i Serra                    #power-domain-cells = <0>;
253d392fe78SEnric Balletbo i Serra                    mediatek,infracfg = <&infracfg>;
254d392fe78SEnric Balletbo i Serra                };
255d392fe78SEnric Balletbo i Serra                power-domain@MT8173_POWER_DOMAIN_VENC_LT {
256d392fe78SEnric Balletbo i Serra                    reg = <MT8173_POWER_DOMAIN_VENC_LT>;
257d392fe78SEnric Balletbo i Serra                    clocks = <&topckgen CLK_TOP_MM_SEL>,
258d392fe78SEnric Balletbo i Serra                             <&topckgen CLK_TOP_VENC_LT_SEL>;
259d392fe78SEnric Balletbo i Serra                    clock-names = "mm", "venclt";
260d392fe78SEnric Balletbo i Serra                    #power-domain-cells = <0>;
261d392fe78SEnric Balletbo i Serra                };
262d392fe78SEnric Balletbo i Serra                power-domain@MT8173_POWER_DOMAIN_AUDIO {
263d392fe78SEnric Balletbo i Serra                    reg = <MT8173_POWER_DOMAIN_AUDIO>;
264d392fe78SEnric Balletbo i Serra                    #power-domain-cells = <0>;
265d392fe78SEnric Balletbo i Serra                };
266d392fe78SEnric Balletbo i Serra                power-domain@MT8173_POWER_DOMAIN_USB {
267d392fe78SEnric Balletbo i Serra                    reg = <MT8173_POWER_DOMAIN_USB>;
268d392fe78SEnric Balletbo i Serra                    #power-domain-cells = <0>;
269d392fe78SEnric Balletbo i Serra                };
270d392fe78SEnric Balletbo i Serra                power-domain@MT8173_POWER_DOMAIN_MFG_ASYNC {
271d392fe78SEnric Balletbo i Serra                    reg = <MT8173_POWER_DOMAIN_MFG_ASYNC>;
272d392fe78SEnric Balletbo i Serra                    clocks = <&clk26m>;
273d392fe78SEnric Balletbo i Serra                    clock-names = "mfg";
274d392fe78SEnric Balletbo i Serra                    #address-cells = <1>;
275d392fe78SEnric Balletbo i Serra                    #size-cells = <0>;
276d392fe78SEnric Balletbo i Serra                    #power-domain-cells = <1>;
277d392fe78SEnric Balletbo i Serra
278d392fe78SEnric Balletbo i Serra                    power-domain@MT8173_POWER_DOMAIN_MFG_2D {
279d392fe78SEnric Balletbo i Serra                        reg = <MT8173_POWER_DOMAIN_MFG_2D>;
280d392fe78SEnric Balletbo i Serra                        #address-cells = <1>;
281d392fe78SEnric Balletbo i Serra                        #size-cells = <0>;
282d392fe78SEnric Balletbo i Serra                        #power-domain-cells = <1>;
283d392fe78SEnric Balletbo i Serra
284d392fe78SEnric Balletbo i Serra                        power-domain@MT8173_POWER_DOMAIN_MFG {
285d392fe78SEnric Balletbo i Serra                            reg = <MT8173_POWER_DOMAIN_MFG>;
286d392fe78SEnric Balletbo i Serra                            #power-domain-cells = <0>;
287d392fe78SEnric Balletbo i Serra                            mediatek,infracfg = <&infracfg>;
288d392fe78SEnric Balletbo i Serra                        };
289d392fe78SEnric Balletbo i Serra                    };
290d392fe78SEnric Balletbo i Serra                };
291d392fe78SEnric Balletbo i Serra            };
292d392fe78SEnric Balletbo i Serra        };
293d392fe78SEnric Balletbo i Serra    };
294