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