xref: /openbmc/docs/designs/oem/ibm/system-power-mode.md (revision f4febd002df578bad816239b70950f84ea4567e8)
133bd07baSPatrick Williams# System Power Mode and Idle Power Saver Support
233bd07baSPatrick Williams
3*f4febd00SPatrick WilliamsAuthor: Chris Cain
433bd07baSPatrick Williams
5*f4febd00SPatrick WilliamsOther contributors: Martha Broyles
633bd07baSPatrick Williams
7*f4febd00SPatrick WilliamsCreated: 12/03/2020
833bd07baSPatrick Williams
933bd07baSPatrick Williams## Problem Description
1033bd07baSPatrick Williams
11*f4febd00SPatrick WilliamsPower management on POWER platforms needs assistance from the BMC for managing
12*f4febd00SPatrick Williamsthe system power mode and idle power save modes. We need the ability to set and
13*f4febd00SPatrick Williamsquery the system power mode and also the ability to control and set idle power
14*f4febd00SPatrick Williamssave parameters. This design is only applicable to POWER processors.
1533bd07baSPatrick Williams
1633bd07baSPatrick Williams## Background and References
1733bd07baSPatrick Williams
18*f4febd00SPatrick WilliamsEach POWER processor contains an embedded PowerPC 405 processor that is referred
19*f4febd00SPatrick Williamsto as the On Chip Controller or OCC. The OCC provides real time power and
20*f4febd00SPatrick Williamsthermal monitoring and control. When a system is powered on, the OCCs will go to
21*f4febd00SPatrick Williamsan Active state. Anytime the OCC state changes to active, the BMC will need to
22*f4febd00SPatrick Williamssend a mode change and idle power saver (IPS) settings to the OCC. It will also
2333bd07baSPatrick Williamsneed to send the commands if the user changes the mode or idle power save
2433bd07baSPatrick Williamsparameters.
2533bd07baSPatrick Williams
2633bd07baSPatrick Williams## Requirements
2733bd07baSPatrick Williams
28*f4febd00SPatrick WilliamsWhen a system is booted, the OCC will move to an ACTIVE state. In the ACTIVE
29*f4febd00SPatrick Williamsstate, the OCC is managing the processor frequency, power consumption, and
30*f4febd00SPatrick Williamsmonitoring the systems thermal sensors. For certain error conditions it may be
31*f4febd00SPatrick Williamsnecessary to reset the OCC. When this happens, the OCC will move out of ACTIVE
32*f4febd00SPatrick Williamsstate. After recovery, the OCC will be put back into the ACTIVE state. Anytime
33*f4febd00SPatrick Williamsthe OCC state changes to ACTIVE or the customer updates these new parameters at
34*f4febd00SPatrick Williamsruntime, the BMC will need to send the mode and the idle power saver settings to
35*f4febd00SPatrick Williamsthe OCC.
3633bd07baSPatrick Williams
3733bd07baSPatrick WilliamsPowerMode was added to version 2021.1 Redfish Schema Supplement:
3833bd07baSPatrick Williamshttps://www.dmtf.org/sites/default/files/standards/documents/DSP0268_2021.1.pdf
3933bd07baSPatrick Williams
4033bd07baSPatrick WilliamsCurrent Customer Settable System Power Modes that will be sent to the OCCs:
41*f4febd00SPatrick Williams
4233bd07baSPatrick Williams- Static
4333bd07baSPatrick Williams- Power Saver
4433bd07baSPatrick Williams- Maximum Performance
4533bd07baSPatrick Williams
46*f4febd00SPatrick WilliamsA proposal for adding Idle Power Saving parameters was submitted to the Redfish
47*f4febd00SPatrick Williamscommittee and will be used if/when approved.
4833bd07baSPatrick Williams
4933bd07baSPatrick WilliamsCustomer Settable Idle Power Save Parameters:
50*f4febd00SPatrick Williams
5133bd07baSPatrick Williams- Enabled / Disabled
5233bd07baSPatrick Williams- Enter Delay Time (in seconds)
5333bd07baSPatrick Williams- Enter Utilization threshold (percentage)
5433bd07baSPatrick Williams- Exit Delay Time (in seconds)
5533bd07baSPatrick Williams- Exit Utilization threshold (percentage)
5633bd07baSPatrick Williams
5733bd07baSPatrick WilliamsDefaults will need to be configurable by the system owner (via JSON file)
5833bd07baSPatrick Williams
5933bd07baSPatrick Williams## Proposed Design
60*f4febd00SPatrick Williams
61*f4febd00SPatrick WilliamsThe new code would be part of the openpower-occ-control repository. New code
62*f4febd00SPatrick Williamswill be triggered by the following:
63*f4febd00SPatrick Williams
6433bd07baSPatrick Williams- OCC poll response data showing a new state of Active (0x03)
6533bd07baSPatrick Williams- OCC Active sensor is enabled (may be covered in above bullet)
6633bd07baSPatrick Williams- Customer updates system power mode user interface or Redfish interface
6733bd07baSPatrick Williams- Customer updates idle power save setting or Redfish interface
6833bd07baSPatrick Williams
69*f4febd00SPatrick WilliamsCode will need to trigger off of OCC state changes. The kernel currently sends a
70*f4febd00SPatrick WilliamsPOLL command to the OCC periodically (every second). The OCC state is available
71*f4febd00SPatrick Williamsin the OCC poll response data.
7233bd07baSPatrick Williams
73*f4febd00SPatrick WilliamsWhen initiated, the new code will send a SET_MODE_AND_STATE command (0x20) to
74*f4febd00SPatrick Williamsthe OCC and a SET_CONFIG_DATA (0x21) command with the Idle Power Saver
75*f4febd00SPatrick Williamsparameters. These commands are defined in the OCC Interface Spec:
7633bd07baSPatrick Williamshttps://github.com/open-power/docs/blob/master/occ/OCC_P9_FW_Interfaces.pdf
7733bd07baSPatrick Williams
7833bd07baSPatrick WilliamsDefault values will also be defined for Power Mode and Idle Power Saver
7933bd07baSPatrick Williamsparameters for the system. If the customer has not yet set any of these
80*f4febd00SPatrick Williamsparameters, these default values will be used. If/when the customer does set any
81*f4febd00SPatrick Williamsof these, that new customer parameter will become current and the default value
82*f4febd00SPatrick Williamswill no longer be used.
8333bd07baSPatrick Williams
84*f4febd00SPatrick WilliamsThe customer requested PowerMode and Idle Power Saver parameters will be stored
85*f4febd00SPatrick Williamsas D-Bus object in the phosphor-dbus-interfaces repository:
86*f4febd00SPatrick Williamsxyz/openbmc_project/Control/Power/Mode.interface.yaml Once set, these values
87*f4febd00SPatrick Williamswill be retained across power cycles, AC loss, code updates, etc.
8833bd07baSPatrick Williams
8933bd07baSPatrick Williams## Alternatives Considered
90*f4febd00SPatrick Williams
91*f4febd00SPatrick Williams- Using hardcoded power mode and Idle Power Save parameters (no flexibility to
92*f4febd00SPatrick Williams  control system power usage)
9333bd07baSPatrick Williams
9433bd07baSPatrick Williams## Impacts
95*f4febd00SPatrick Williams
9633bd07baSPatrick WilliamsNew interfaces that were described in the requirements section will be
97*f4febd00SPatrick Williamsimplemented. Parameters should be able to be set via user interface or via
98*f4febd00SPatrick WilliamsRedfish. API impact - Add Redfish support for new parameters as well as new user
9933bd07baSPatrick Williamsinterface to allow customer to set power mode and idle power saver settings
100*f4febd00SPatrick WilliamsSecurity impact - update of these parameters should be able to be restricted to
101*f4febd00SPatrick Williamsspecific users/groups (may not want any user updating these parameters)
102*f4febd00SPatrick WilliamsDocumentation impact - need to document new parameters Performance impact -
103*f4febd00SPatrick Williamsminimal, new code will only execute on OCC state change which should normally
104*f4febd00SPatrick Williamshappen once at boot time or when user changes parameters. The new code is only
105*f4febd00SPatrick Williamssending 2 additional commands which should complete within a few seconds.
106*f4febd00SPatrick WilliamsDeveloper impact - code to be written by OCC team with guidance from OpenBMC
107*f4febd00SPatrick Williamspower management team Upgradability impact - None
10833bd07baSPatrick Williams
10933bd07baSPatrick Williams## Testing
110*f4febd00SPatrick Williams
111*f4febd00SPatrick WilliamsThis will be able to be tested by directly updating the power mode and idle
112*f4febd00SPatrick Williamspower saver setting. This testing will be automated
113