xref: /OK3568_Linux_fs/kernel/Documentation/devicetree/bindings/powerpc/opal/power-mgt.txt (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593SmuzhiyunIBM Power-Management Bindings
2*4882a593Smuzhiyun=============================
3*4882a593Smuzhiyun
4*4882a593SmuzhiyunLinux running on baremetal POWER machines has access to the processor
5*4882a593Smuzhiyunidle states. The description of these idle states is exposed via the
6*4882a593Smuzhiyunnode @power-mgt in the device-tree by the firmware.
7*4882a593Smuzhiyun
8*4882a593SmuzhiyunDefinitions:
9*4882a593Smuzhiyun----------------
10*4882a593SmuzhiyunTypically each idle state has the following associated properties:
11*4882a593Smuzhiyun
12*4882a593Smuzhiyun- name: The name of the idle state as defined by the firmware.
13*4882a593Smuzhiyun
14*4882a593Smuzhiyun- flags: indicating some aspects of this idle states such as the
15*4882a593Smuzhiyun         extent of state-loss, whether timebase is stopped on this
16*4882a593Smuzhiyun         idle states and so on. The flag bits are as follows:
17*4882a593Smuzhiyun
18*4882a593Smuzhiyun- exit-latency: The latency involved in transitioning the state of the
19*4882a593Smuzhiyun		CPU from idle to running.
20*4882a593Smuzhiyun
21*4882a593Smuzhiyun- target-residency: The minimum time that the CPU needs to reside in
22*4882a593Smuzhiyun		    this idle state in order to accrue power-savings
23*4882a593Smuzhiyun		    benefit.
24*4882a593Smuzhiyun
25*4882a593SmuzhiyunProperties
26*4882a593Smuzhiyun----------------
27*4882a593SmuzhiyunThe following properties provide details about the idle states. These
28*4882a593Smuzhiyunproperties are exposed as arrays. Each entry in the property array
29*4882a593Smuzhiyunprovides the value of that property for the idle state associated with
30*4882a593Smuzhiyunthe array index of that entry.
31*4882a593Smuzhiyun
32*4882a593SmuzhiyunIf idle-states are defined, then the properties
33*4882a593Smuzhiyun"ibm,cpu-idle-state-names" and "ibm,cpu-idle-state-flags" are
34*4882a593Smuzhiyunrequired. The other properties are required unless mentioned
35*4882a593Smuzhiyunotherwise. The length of all the property arrays must be the same.
36*4882a593Smuzhiyun
37*4882a593Smuzhiyun- ibm,cpu-idle-state-names:
38*4882a593Smuzhiyun	Array of strings containing the names of the idle states.
39*4882a593Smuzhiyun
40*4882a593Smuzhiyun- ibm,cpu-idle-state-flags:
41*4882a593Smuzhiyun	Array of unsigned 32-bit values containing the values of the
42*4882a593Smuzhiyun	flags associated with the the aforementioned idle-states. The
43*4882a593Smuzhiyun	flag bits are as follows:
44*4882a593Smuzhiyun		0x00000001 /* Decrementer would stop */
45*4882a593Smuzhiyun		0x00000002 /* Needs timebase restore */
46*4882a593Smuzhiyun		0x00001000 /* Restore GPRs like nap */
47*4882a593Smuzhiyun		0x00002000 /* Restore hypervisor resource from PACA pointer */
48*4882a593Smuzhiyun		0x00004000 /* Program PORE to restore PACA pointer */
49*4882a593Smuzhiyun		0x00010000 /* This is a nap state (POWER7,POWER8) */
50*4882a593Smuzhiyun		0x00020000 /* This is a fast-sleep state (POWER8)*/
51*4882a593Smuzhiyun		0x00040000 /* This is a winkle state (POWER8) */
52*4882a593Smuzhiyun		0x00080000 /* This is a fast-sleep state which requires a */
53*4882a593Smuzhiyun			   /* software workaround for restoring the */
54*4882a593Smuzhiyun			   /* timebase (POWER8) */
55*4882a593Smuzhiyun		0x00800000 /* This state uses SPR PMICR instruction */
56*4882a593Smuzhiyun			   /* (POWER8)*/
57*4882a593Smuzhiyun		0x00100000 /* This is a fast stop state (POWER9) */
58*4882a593Smuzhiyun		0x00200000 /* This is a deep-stop state (POWER9) */
59*4882a593Smuzhiyun
60*4882a593Smuzhiyun- ibm,cpu-idle-state-latencies-ns:
61*4882a593Smuzhiyun	Array of unsigned 32-bit values containing the values of the
62*4882a593Smuzhiyun	exit-latencies (in ns) for the idle states in
63*4882a593Smuzhiyun	ibm,cpu-idle-state-names.
64*4882a593Smuzhiyun
65*4882a593Smuzhiyun- ibm,cpu-idle-state-residency-ns:
66*4882a593Smuzhiyun	Array of unsigned 32-bit values containing the values of the
67*4882a593Smuzhiyun	target-residency (in ns) for the idle states in
68*4882a593Smuzhiyun	ibm,cpu-idle-state-names. On POWER8 this is an optional
69*4882a593Smuzhiyun	property. If the property is absent, the target residency for
70*4882a593Smuzhiyun	the "Nap", "FastSleep" are defined to 10000 and 300000000
71*4882a593Smuzhiyun	respectively by the kernel. On POWER9 this property is required.
72*4882a593Smuzhiyun
73*4882a593Smuzhiyun- ibm,cpu-idle-state-psscr:
74*4882a593Smuzhiyun	Array of unsigned 64-bit values containing the values for the
75*4882a593Smuzhiyun	PSSCR for each of the idle states in ibm,cpu-idle-state-names.
76*4882a593Smuzhiyun	This property is required on POWER9 and absent on POWER8.
77*4882a593Smuzhiyun
78*4882a593Smuzhiyun- ibm,cpu-idle-state-psscr-mask:
79*4882a593Smuzhiyun	Array of unsigned 64-bit values containing the masks
80*4882a593Smuzhiyun	indicating which psscr fields are set in the corresponding
81*4882a593Smuzhiyun	entries of ibm,cpu-idle-state-psscr. This property is
82*4882a593Smuzhiyun	required on POWER9 and absent on POWER8.
83*4882a593Smuzhiyun
84*4882a593Smuzhiyun	Whenever the firmware sets an entry in
85*4882a593Smuzhiyun	ibm,cpu-idle-state-psscr-mask value to 0xf, it implies that
86*4882a593Smuzhiyun	only the Requested Level (RL) field of the corresponding entry
87*4882a593Smuzhiyun	in ibm,cpu-idle-state-psscr should be considered by the
88*4882a593Smuzhiyun	kernel. For such idle states, the kernel would set the
89*4882a593Smuzhiyun	remaining fields of the psscr to the following sane-default
90*4882a593Smuzhiyun	values.
91*4882a593Smuzhiyun
92*4882a593Smuzhiyun		- ESL and EC bits are to 1. So wakeup from any stop
93*4882a593Smuzhiyun		  state will be at vector 0x100.
94*4882a593Smuzhiyun
95*4882a593Smuzhiyun		- MTL and PSLL are set to the maximum allowed value as
96*4882a593Smuzhiyun		  per the ISA, i.e. 15.
97*4882a593Smuzhiyun
98*4882a593Smuzhiyun		- The Transition Rate, TR is set to the Maximum value
99*4882a593Smuzhiyun                  3.
100*4882a593Smuzhiyun
101*4882a593Smuzhiyun	For all the other values of the entry in
102*4882a593Smuzhiyun	ibm,cpu-idle-state-psscr-mask, the kernel expects all the
103*4882a593Smuzhiyun	psscr fields of the corresponding entry in
104*4882a593Smuzhiyun	ibm,cpu-idle-state-psscr to be correctly set by the firmware.
105*4882a593Smuzhiyun
106*4882a593Smuzhiyun- ibm,cpu-idle-state-pmicr:
107*4882a593Smuzhiyun	Array of unsigned 64-bit values containing the pmicr values
108*4882a593Smuzhiyun	for the idle states in ibm,cpu-idle-state-names. This 64-bit
109*4882a593Smuzhiyun	register value is to be set in pmicr for the corresponding
110*4882a593Smuzhiyun	state if the flag indicates that pmicr SPR should be set. This
111*4882a593Smuzhiyun	is an optional property on POWER8 and is absent on
112*4882a593Smuzhiyun	POWER9.
113*4882a593Smuzhiyun
114*4882a593Smuzhiyun- ibm,cpu-idle-state-pmicr-mask:
115*4882a593Smuzhiyun	Array of unsigned 64-bit values containing the mask indicating
116*4882a593Smuzhiyun	which of the fields of the PMICR are set in the corresponding
117*4882a593Smuzhiyun	entries in ibm,cpu-idle-state-pmicr. This is an optional
118*4882a593Smuzhiyun	property on POWER8 and is absent on POWER9.
119