1# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2%YAML 1.2
3---
4$id: http://devicetree.org/schemas/power/qcom,rpmpd.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: Qualcomm RPM/RPMh Power domains
8
9maintainers:
10  - Rajendra Nayak <rnayak@codeaurora.org>
11
12description:
13  For RPM/RPMh Power domains, we communicate a performance state to RPM/RPMh
14  which then translates it into a corresponding voltage on a rail.
15
16properties:
17  compatible:
18    enum:
19      - qcom,msm8976-rpmpd
20      - qcom,msm8996-rpmpd
21      - qcom,msm8998-rpmpd
22      - qcom,qcs404-rpmpd
23      - qcom,sc7180-rpmhpd
24      - qcom,sdm845-rpmhpd
25      - qcom,sm8150-rpmhpd
26
27  '#power-domain-cells':
28    const: 1
29
30  operating-points-v2: true
31
32  opp-table:
33    type: object
34
35required:
36  - compatible
37  - '#power-domain-cells'
38  - operating-points-v2
39
40additionalProperties: false
41
42examples:
43  - |
44
45    // Example 1 (rpmh power domain controller and OPP table):
46
47    #include <dt-bindings/power/qcom-rpmpd.h>
48
49    rpmhpd: power-controller {
50      compatible = "qcom,sdm845-rpmhpd";
51      #power-domain-cells = <1>;
52      operating-points-v2 = <&rpmhpd_opp_table>;
53
54      rpmhpd_opp_table: opp-table {
55        compatible = "operating-points-v2";
56
57        rpmhpd_opp_ret: opp1 {
58          opp-level = <RPMH_REGULATOR_LEVEL_RETENTION>;
59        };
60
61        rpmhpd_opp_min_svs: opp2 {
62          opp-level = <RPMH_REGULATOR_LEVEL_MIN_SVS>;
63        };
64
65        rpmhpd_opp_low_svs: opp3 {
66          opp-level = <RPMH_REGULATOR_LEVEL_LOW_SVS>;
67        };
68
69        rpmhpd_opp_svs: opp4 {
70          opp-level = <RPMH_REGULATOR_LEVEL_SVS>;
71        };
72
73        rpmhpd_opp_svs_l1: opp5 {
74          opp-level = <RPMH_REGULATOR_LEVEL_SVS_L1>;
75        };
76
77        rpmhpd_opp_nom: opp6 {
78          opp-level = <RPMH_REGULATOR_LEVEL_NOM>;
79        };
80
81        rpmhpd_opp_nom_l1: opp7 {
82          opp-level = <RPMH_REGULATOR_LEVEL_NOM_L1>;
83        };
84
85        rpmhpd_opp_nom_l2: opp8 {
86          opp-level = <RPMH_REGULATOR_LEVEL_NOM_L2>;
87        };
88
89        rpmhpd_opp_turbo: opp9 {
90          opp-level = <RPMH_REGULATOR_LEVEL_TURBO>;
91        };
92
93        rpmhpd_opp_turbo_l1: opp10 {
94          opp-level = <RPMH_REGULATOR_LEVEL_TURBO_L1>;
95        };
96      };
97    };
98
99  - |
100
101    // Example 2 (rpm power domain controller and OPP table):
102
103    rpmpd: power-controller {
104      compatible = "qcom,msm8996-rpmpd";
105      #power-domain-cells = <1>;
106      operating-points-v2 = <&rpmpd_opp_table>;
107
108      rpmpd_opp_table: opp-table {
109        compatible = "operating-points-v2";
110
111        rpmpd_opp_low: opp1 {
112          opp-level = <1>;
113        };
114
115        rpmpd_opp_ret: opp2 {
116          opp-level = <2>;
117        };
118
119        rpmpd_opp_svs: opp3 {
120          opp-level = <3>;
121        };
122
123        rpmpd_opp_normal: opp4 {
124          opp-level = <4>;
125        };
126
127        rpmpd_opp_high: opp5 {
128          opp-level = <5>;
129        };
130
131        rpmpd_opp_turbo: opp6 {
132          opp-level = <6>;
133        };
134      };
135    };
136
137  - |
138
139    // Example 3 (Client/Consumer device using OPP table):
140
141    leaky-device0@12350000 {
142      compatible = "foo,i-leak-current";
143      reg = <0x12350000 0x1000>;
144      power-domains = <&rpmhpd 0>;
145      operating-points-v2 = <&leaky_opp_table>;
146    };
147
148    leaky_opp_table: opp-table {
149      compatible = "operating-points-v2";
150      opp1 {
151        opp-hz = /bits/ 64 <144000>;
152        required-opps = <&rpmhpd_opp_low>;
153      };
154
155      opp2 {
156        opp-hz = /bits/ 64 <400000>;
157        required-opps = <&rpmhpd_opp_ret>;
158      };
159
160      opp3 {
161        opp-hz = /bits/ 64 <20000000>;
162        required-opps = <&rpmpd_opp_svs>;
163      };
164
165      opp4 {
166        opp-hz = /bits/ 64 <25000000>;
167        required-opps = <&rpmpd_opp_normal>;
168      };
169    };
170...
171