xref: /freebsd/sys/contrib/device-tree/Bindings/mfd/qcom-rpm.txt (revision c66ec88fed842fbaad62c30d510644ceb7bd2d71)
1*c66ec88fSEmmanuel VadotQualcomm Resource Power Manager (RPM)
2*c66ec88fSEmmanuel Vadot
3*c66ec88fSEmmanuel VadotThis driver is used to interface with the Resource Power Manager (RPM) found in
4*c66ec88fSEmmanuel Vadotvarious Qualcomm platforms. The RPM allows each component in the system to vote
5*c66ec88fSEmmanuel Vadotfor state of the system resources, such as clocks, regulators and bus
6*c66ec88fSEmmanuel Vadotfrequencies.
7*c66ec88fSEmmanuel Vadot
8*c66ec88fSEmmanuel Vadot- compatible:
9*c66ec88fSEmmanuel Vadot	Usage: required
10*c66ec88fSEmmanuel Vadot	Value type: <string>
11*c66ec88fSEmmanuel Vadot	Definition: must be one of:
12*c66ec88fSEmmanuel Vadot		    "qcom,rpm-apq8064"
13*c66ec88fSEmmanuel Vadot		    "qcom,rpm-msm8660"
14*c66ec88fSEmmanuel Vadot		    "qcom,rpm-msm8960"
15*c66ec88fSEmmanuel Vadot		    "qcom,rpm-ipq8064"
16*c66ec88fSEmmanuel Vadot		    "qcom,rpm-mdm9615"
17*c66ec88fSEmmanuel Vadot
18*c66ec88fSEmmanuel Vadot- reg:
19*c66ec88fSEmmanuel Vadot	Usage: required
20*c66ec88fSEmmanuel Vadot	Value type: <prop-encoded-array>
21*c66ec88fSEmmanuel Vadot	Definition: base address and size of the RPM's message ram
22*c66ec88fSEmmanuel Vadot
23*c66ec88fSEmmanuel Vadot- interrupts:
24*c66ec88fSEmmanuel Vadot	Usage: required
25*c66ec88fSEmmanuel Vadot	Value type: <prop-encoded-array>
26*c66ec88fSEmmanuel Vadot	Definition: three entries specifying the RPM's:
27*c66ec88fSEmmanuel Vadot		    1. acknowledgement interrupt
28*c66ec88fSEmmanuel Vadot		    2. error interrupt
29*c66ec88fSEmmanuel Vadot		    3. wakeup interrupt
30*c66ec88fSEmmanuel Vadot
31*c66ec88fSEmmanuel Vadot- interrupt-names:
32*c66ec88fSEmmanuel Vadot	Usage: required
33*c66ec88fSEmmanuel Vadot	Value type: <string-array>
34*c66ec88fSEmmanuel Vadot	Definition: must be the three strings "ack", "err" and "wakeup", in order
35*c66ec88fSEmmanuel Vadot
36*c66ec88fSEmmanuel Vadot- qcom,ipc:
37*c66ec88fSEmmanuel Vadot	Usage: required
38*c66ec88fSEmmanuel Vadot	Value type: <prop-encoded-array>
39*c66ec88fSEmmanuel Vadot
40*c66ec88fSEmmanuel Vadot	Definition: three entries specifying the outgoing ipc bit used for
41*c66ec88fSEmmanuel Vadot		    signaling the RPM:
42*c66ec88fSEmmanuel Vadot		    - phandle to a syscon node representing the apcs registers
43*c66ec88fSEmmanuel Vadot		    - u32 representing offset to the register within the syscon
44*c66ec88fSEmmanuel Vadot		    - u32 representing the ipc bit within the register
45*c66ec88fSEmmanuel Vadot
46*c66ec88fSEmmanuel Vadot
47*c66ec88fSEmmanuel Vadot= SUBNODES
48*c66ec88fSEmmanuel Vadot
49*c66ec88fSEmmanuel VadotThe RPM exposes resources to its subnodes. The below bindings specify the set
50*c66ec88fSEmmanuel Vadotof valid subnodes that can operate on these resources.
51*c66ec88fSEmmanuel Vadot
52*c66ec88fSEmmanuel Vadot== Regulators
53*c66ec88fSEmmanuel Vadot
54*c66ec88fSEmmanuel VadotRegulator nodes are identified by their compatible:
55*c66ec88fSEmmanuel Vadot
56*c66ec88fSEmmanuel Vadot- compatible:
57*c66ec88fSEmmanuel Vadot	Usage: required
58*c66ec88fSEmmanuel Vadot	Value type: <string>
59*c66ec88fSEmmanuel Vadot	Definition: must be one of:
60*c66ec88fSEmmanuel Vadot		    "qcom,rpm-pm8058-regulators"
61*c66ec88fSEmmanuel Vadot		    "qcom,rpm-pm8901-regulators"
62*c66ec88fSEmmanuel Vadot		    "qcom,rpm-pm8921-regulators"
63*c66ec88fSEmmanuel Vadot		    "qcom,rpm-pm8018-regulators"
64*c66ec88fSEmmanuel Vadot		    "qcom,rpm-smb208-regulators"
65*c66ec88fSEmmanuel Vadot
66*c66ec88fSEmmanuel Vadot- vdd_l0_l1_lvs-supply:
67*c66ec88fSEmmanuel Vadot- vdd_l2_l11_l12-supply:
68*c66ec88fSEmmanuel Vadot- vdd_l3_l4_l5-supply:
69*c66ec88fSEmmanuel Vadot- vdd_l6_l7-supply:
70*c66ec88fSEmmanuel Vadot- vdd_l8-supply:
71*c66ec88fSEmmanuel Vadot- vdd_l9-supply:
72*c66ec88fSEmmanuel Vadot- vdd_l10-supply:
73*c66ec88fSEmmanuel Vadot- vdd_l13_l16-supply:
74*c66ec88fSEmmanuel Vadot- vdd_l14_l15-supply:
75*c66ec88fSEmmanuel Vadot- vdd_l17_l18-supply:
76*c66ec88fSEmmanuel Vadot- vdd_l19_l20-supply:
77*c66ec88fSEmmanuel Vadot- vdd_l21-supply:
78*c66ec88fSEmmanuel Vadot- vdd_l22-supply:
79*c66ec88fSEmmanuel Vadot- vdd_l23_l24_l25-supply:
80*c66ec88fSEmmanuel Vadot- vdd_ncp-supply:
81*c66ec88fSEmmanuel Vadot- vdd_s0-supply:
82*c66ec88fSEmmanuel Vadot- vdd_s1-supply:
83*c66ec88fSEmmanuel Vadot- vdd_s2-supply:
84*c66ec88fSEmmanuel Vadot- vdd_s3-supply:
85*c66ec88fSEmmanuel Vadot- vdd_s4-supply:
86*c66ec88fSEmmanuel Vadot	Usage: optional (pm8058 only)
87*c66ec88fSEmmanuel Vadot	Value type: <phandle>
88*c66ec88fSEmmanuel Vadot	Definition: reference to regulator supplying the input pin, as
89*c66ec88fSEmmanuel Vadot		    described in the data sheet
90*c66ec88fSEmmanuel Vadot
91*c66ec88fSEmmanuel Vadot- lvs0_in-supply:
92*c66ec88fSEmmanuel Vadot- lvs1_in-supply:
93*c66ec88fSEmmanuel Vadot- lvs2_in-supply:
94*c66ec88fSEmmanuel Vadot- lvs3_in-supply:
95*c66ec88fSEmmanuel Vadot- mvs_in-supply:
96*c66ec88fSEmmanuel Vadot- vdd_l0-supply:
97*c66ec88fSEmmanuel Vadot- vdd_l1-supply:
98*c66ec88fSEmmanuel Vadot- vdd_l2-supply:
99*c66ec88fSEmmanuel Vadot- vdd_l3-supply:
100*c66ec88fSEmmanuel Vadot- vdd_l4-supply:
101*c66ec88fSEmmanuel Vadot- vdd_l5-supply:
102*c66ec88fSEmmanuel Vadot- vdd_l6-supply:
103*c66ec88fSEmmanuel Vadot- vdd_s0-supply:
104*c66ec88fSEmmanuel Vadot- vdd_s1-supply:
105*c66ec88fSEmmanuel Vadot- vdd_s2-supply:
106*c66ec88fSEmmanuel Vadot- vdd_s3-supply:
107*c66ec88fSEmmanuel Vadot- vdd_s4-supply:
108*c66ec88fSEmmanuel Vadot	Usage: optional (pm8901 only)
109*c66ec88fSEmmanuel Vadot	Value type: <phandle>
110*c66ec88fSEmmanuel Vadot	Definition: reference to regulator supplying the input pin, as
111*c66ec88fSEmmanuel Vadot		    described in the data sheet
112*c66ec88fSEmmanuel Vadot
113*c66ec88fSEmmanuel Vadot- vdd_l1_l2_l12_l18-supply:
114*c66ec88fSEmmanuel Vadot- vdd_l3_l15_l17-supply:
115*c66ec88fSEmmanuel Vadot- vdd_l4_l14-supply:
116*c66ec88fSEmmanuel Vadot- vdd_l5_l8_l16-supply:
117*c66ec88fSEmmanuel Vadot- vdd_l6_l7-supply:
118*c66ec88fSEmmanuel Vadot- vdd_l9_l11-supply:
119*c66ec88fSEmmanuel Vadot- vdd_l10_l22-supply:
120*c66ec88fSEmmanuel Vadot- vdd_l21_l23_l29-supply:
121*c66ec88fSEmmanuel Vadot- vdd_l24-supply:
122*c66ec88fSEmmanuel Vadot- vdd_l25-supply:
123*c66ec88fSEmmanuel Vadot- vdd_l26-supply:
124*c66ec88fSEmmanuel Vadot- vdd_l27-supply:
125*c66ec88fSEmmanuel Vadot- vdd_l28-supply:
126*c66ec88fSEmmanuel Vadot- vdd_ncp-supply:
127*c66ec88fSEmmanuel Vadot- vdd_s1-supply:
128*c66ec88fSEmmanuel Vadot- vdd_s2-supply:
129*c66ec88fSEmmanuel Vadot- vdd_s4-supply:
130*c66ec88fSEmmanuel Vadot- vdd_s5-supply:
131*c66ec88fSEmmanuel Vadot- vdd_s6-supply:
132*c66ec88fSEmmanuel Vadot- vdd_s7-supply:
133*c66ec88fSEmmanuel Vadot- vdd_s8-supply:
134*c66ec88fSEmmanuel Vadot- vin_5vs-supply:
135*c66ec88fSEmmanuel Vadot- vin_lvs1_3_6-supply:
136*c66ec88fSEmmanuel Vadot- vin_lvs2-supply:
137*c66ec88fSEmmanuel Vadot- vin_lvs4_5_7-supply:
138*c66ec88fSEmmanuel Vadot	Usage: optional (pm8921 only)
139*c66ec88fSEmmanuel Vadot	Value type: <phandle>
140*c66ec88fSEmmanuel Vadot	Definition: reference to regulator supplying the input pin, as
141*c66ec88fSEmmanuel Vadot		    described in the data sheet
142*c66ec88fSEmmanuel Vadot
143*c66ec88fSEmmanuel Vadot- vin_lvs1-supply:
144*c66ec88fSEmmanuel Vadot- vdd_l7-supply:
145*c66ec88fSEmmanuel Vadot- vdd_l8-supply:
146*c66ec88fSEmmanuel Vadot- vdd_l9_l10_l11_l12-supply:
147*c66ec88fSEmmanuel Vadot	Usage: optional (pm8018 only)
148*c66ec88fSEmmanuel Vadot	Value type: <phandle>
149*c66ec88fSEmmanuel Vadot	Definition: reference to regulator supplying the input pin, as
150*c66ec88fSEmmanuel Vadot		    described in the data sheet
151*c66ec88fSEmmanuel Vadot
152*c66ec88fSEmmanuel VadotThe regulator node houses sub-nodes for each regulator within the device. Each
153*c66ec88fSEmmanuel Vadotsub-node is identified using the node's name, with valid values listed for each
154*c66ec88fSEmmanuel Vadotof the pmics below.
155*c66ec88fSEmmanuel Vadot
156*c66ec88fSEmmanuel Vadotpm8058:
157*c66ec88fSEmmanuel Vadot	l0, l1, l2, l3, l4, l5, l6, l7, l8, l9, l10, l11, l12, l13, l14, l15,
158*c66ec88fSEmmanuel Vadot	l16, l17, l18, l19, l20, l21, l22, l23, l24, l25, s0, s1, s2, s3, s4,
159*c66ec88fSEmmanuel Vadot	lvs0, lvs1, ncp
160*c66ec88fSEmmanuel Vadot
161*c66ec88fSEmmanuel Vadotpm8901:
162*c66ec88fSEmmanuel Vadot	l0, l1, l2, l3, l4, l5, l6, s0, s1, s2, s3, s4, lvs0, lvs1, lvs2, lvs3,
163*c66ec88fSEmmanuel Vadot	mvs
164*c66ec88fSEmmanuel Vadot
165*c66ec88fSEmmanuel Vadotpm8921:
166*c66ec88fSEmmanuel Vadot	s1, s2, s3, s4, s7, s8, l1, l2, l3, l4, l5, l6, l7, l8, l9, l10, l11,
167*c66ec88fSEmmanuel Vadot	l12, l14, l15, l16, l17, l18, l21, l22, l23, l24, l25, l26, l27, l28,
168*c66ec88fSEmmanuel Vadot	l29, lvs1, lvs2, lvs3, lvs4, lvs5, lvs6, lvs7, usb-switch, hdmi-switch,
169*c66ec88fSEmmanuel Vadot	ncp
170*c66ec88fSEmmanuel Vadot
171*c66ec88fSEmmanuel Vadotpm8018:
172*c66ec88fSEmmanuel Vadot	s1, s2, s3, s4, s5, , l1, l2, l3, l4, l5, l6, l7, l8, l9, l10, l11,
173*c66ec88fSEmmanuel Vadot	l12, l14, lvs1
174*c66ec88fSEmmanuel Vadot
175*c66ec88fSEmmanuel Vadotsmb208:
176*c66ec88fSEmmanuel Vadot	s1a, s1b, s2a, s2b
177*c66ec88fSEmmanuel Vadot
178*c66ec88fSEmmanuel VadotThe content of each sub-node is defined by the standard binding for regulators -
179*c66ec88fSEmmanuel Vadotsee regulator.txt - with additional custom properties described below:
180*c66ec88fSEmmanuel Vadot
181*c66ec88fSEmmanuel Vadot=== Switch-mode Power Supply regulator custom properties
182*c66ec88fSEmmanuel Vadot
183*c66ec88fSEmmanuel Vadot- bias-pull-down:
184*c66ec88fSEmmanuel Vadot	Usage: optional
185*c66ec88fSEmmanuel Vadot	Value type: <empty>
186*c66ec88fSEmmanuel Vadot	Definition: enable pull down of the regulator when inactive
187*c66ec88fSEmmanuel Vadot
188*c66ec88fSEmmanuel Vadot- qcom,switch-mode-frequency:
189*c66ec88fSEmmanuel Vadot	Usage: required
190*c66ec88fSEmmanuel Vadot	Value type: <u32>
191*c66ec88fSEmmanuel Vadot	Definition: Frequency (Hz) of the switch-mode power supply;
192*c66ec88fSEmmanuel Vadot		    must be one of:
193*c66ec88fSEmmanuel Vadot		    19200000, 9600000, 6400000, 4800000, 3840000, 3200000,
194*c66ec88fSEmmanuel Vadot		    2740000, 2400000, 2130000, 1920000, 1750000, 1600000,
195*c66ec88fSEmmanuel Vadot		    1480000, 1370000, 1280000, 1200000
196*c66ec88fSEmmanuel Vadot
197*c66ec88fSEmmanuel Vadot- qcom,force-mode:
198*c66ec88fSEmmanuel Vadot	Usage: optional (default if no other qcom,force-mode is specified)
199*c66ec88fSEmmanuel Vadot	Value type: <u32>
200*c66ec88fSEmmanuel Vadot	Definition: indicates that the regulator should be forced to a
201*c66ec88fSEmmanuel Vadot		   particular mode, valid values are:
202*c66ec88fSEmmanuel Vadot		   QCOM_RPM_FORCE_MODE_NONE - do not force any mode
203*c66ec88fSEmmanuel Vadot		   QCOM_RPM_FORCE_MODE_LPM - force into low power mode
204*c66ec88fSEmmanuel Vadot		   QCOM_RPM_FORCE_MODE_HPM - force into high power mode
205*c66ec88fSEmmanuel Vadot		   QCOM_RPM_FORCE_MODE_AUTO - allow regulator to automatically
206*c66ec88fSEmmanuel Vadot					      select its own mode based on
207*c66ec88fSEmmanuel Vadot					      realtime current draw, only for:
208*c66ec88fSEmmanuel Vadot					      pm8921 smps and ftsmps
209*c66ec88fSEmmanuel Vadot
210*c66ec88fSEmmanuel Vadot- qcom,power-mode-hysteretic:
211*c66ec88fSEmmanuel Vadot	Usage: optional
212*c66ec88fSEmmanuel Vadot	Value type: <empty>
213*c66ec88fSEmmanuel Vadot	Definition: select that the power supply should operate in hysteretic
214*c66ec88fSEmmanuel Vadot		    mode, instead of the default pwm mode
215*c66ec88fSEmmanuel Vadot
216*c66ec88fSEmmanuel Vadot=== Low-dropout regulator custom properties
217*c66ec88fSEmmanuel Vadot
218*c66ec88fSEmmanuel Vadot- bias-pull-down:
219*c66ec88fSEmmanuel Vadot	Usage: optional
220*c66ec88fSEmmanuel Vadot	Value type: <empty>
221*c66ec88fSEmmanuel Vadot	Definition: enable pull down of the regulator when inactive
222*c66ec88fSEmmanuel Vadot
223*c66ec88fSEmmanuel Vadot- qcom,force-mode:
224*c66ec88fSEmmanuel Vadot	Usage: optional
225*c66ec88fSEmmanuel Vadot	Value type: <u32>
226*c66ec88fSEmmanuel Vadot	Definition: indicates that the regulator should not be forced to any
227*c66ec88fSEmmanuel Vadot		   particular mode, valid values are:
228*c66ec88fSEmmanuel Vadot		   QCOM_RPM_FORCE_MODE_NONE - do not force any mode
229*c66ec88fSEmmanuel Vadot		   QCOM_RPM_FORCE_MODE_LPM - force into low power mode
230*c66ec88fSEmmanuel Vadot		   QCOM_RPM_FORCE_MODE_HPM - force into high power mode
231*c66ec88fSEmmanuel Vadot		   QCOM_RPM_FORCE_MODE_BYPASS - set regulator to use bypass
232*c66ec88fSEmmanuel Vadot						mode, i.e.  to act as a switch
233*c66ec88fSEmmanuel Vadot						and not regulate, only for:
234*c66ec88fSEmmanuel Vadot						pm8921 pldo, nldo and nldo1200
235*c66ec88fSEmmanuel Vadot
236*c66ec88fSEmmanuel Vadot=== Negative Charge Pump custom properties
237*c66ec88fSEmmanuel Vadot
238*c66ec88fSEmmanuel Vadot- qcom,switch-mode-frequency:
239*c66ec88fSEmmanuel Vadot	Usage: required
240*c66ec88fSEmmanuel Vadot	Value type: <u32>
241*c66ec88fSEmmanuel Vadot	Definition: Frequency (Hz) of the switch mode power supply;
242*c66ec88fSEmmanuel Vadot		    must be one of:
243*c66ec88fSEmmanuel Vadot		    19200000, 9600000, 6400000, 4800000, 3840000, 3200000,
244*c66ec88fSEmmanuel Vadot		    2740000, 2400000, 2130000, 1920000, 1750000, 1600000,
245*c66ec88fSEmmanuel Vadot		    1480000, 1370000, 1280000, 1200000
246*c66ec88fSEmmanuel Vadot
247*c66ec88fSEmmanuel Vadot= EXAMPLE
248*c66ec88fSEmmanuel Vadot
249*c66ec88fSEmmanuel Vadot	#include <dt-bindings/mfd/qcom-rpm.h>
250*c66ec88fSEmmanuel Vadot
251*c66ec88fSEmmanuel Vadot	rpm@108000 {
252*c66ec88fSEmmanuel Vadot		compatible = "qcom,rpm-msm8960";
253*c66ec88fSEmmanuel Vadot		reg = <0x108000 0x1000>;
254*c66ec88fSEmmanuel Vadot		qcom,ipc = <&apcs 0x8 2>;
255*c66ec88fSEmmanuel Vadot
256*c66ec88fSEmmanuel Vadot		interrupts = <0 19 0>, <0 21 0>, <0 22 0>;
257*c66ec88fSEmmanuel Vadot		interrupt-names = "ack", "err", "wakeup";
258*c66ec88fSEmmanuel Vadot
259*c66ec88fSEmmanuel Vadot		regulators {
260*c66ec88fSEmmanuel Vadot			compatible = "qcom,rpm-pm8921-regulators";
261*c66ec88fSEmmanuel Vadot			vdd_l1_l2_l12_l18-supply = <&pm8921_s4>;
262*c66ec88fSEmmanuel Vadot
263*c66ec88fSEmmanuel Vadot			s1 {
264*c66ec88fSEmmanuel Vadot				regulator-min-microvolt = <1225000>;
265*c66ec88fSEmmanuel Vadot				regulator-max-microvolt = <1225000>;
266*c66ec88fSEmmanuel Vadot
267*c66ec88fSEmmanuel Vadot				bias-pull-down;
268*c66ec88fSEmmanuel Vadot
269*c66ec88fSEmmanuel Vadot				qcom,switch-mode-frequency = <3200000>;
270*c66ec88fSEmmanuel Vadot			};
271*c66ec88fSEmmanuel Vadot
272*c66ec88fSEmmanuel Vadot			pm8921_s4: s4 {
273*c66ec88fSEmmanuel Vadot				regulator-min-microvolt = <1800000>;
274*c66ec88fSEmmanuel Vadot				regulator-max-microvolt = <1800000>;
275*c66ec88fSEmmanuel Vadot
276*c66ec88fSEmmanuel Vadot				qcom,switch-mode-frequency = <1600000>;
277*c66ec88fSEmmanuel Vadot				bias-pull-down;
278*c66ec88fSEmmanuel Vadot
279*c66ec88fSEmmanuel Vadot				qcom,force-mode = <QCOM_RPM_FORCE_MODE_AUTO>;
280*c66ec88fSEmmanuel Vadot			};
281*c66ec88fSEmmanuel Vadot		};
282*c66ec88fSEmmanuel Vadot	};
283*c66ec88fSEmmanuel Vadot
284