Add Eco mode support
Add support for new modes:
- Efficiency Favor Performance
- Efficiency Favor Power
- Balanced Performance
- Non-Deterministic (lab only)
Tested on Rainier by setting/reading all new/old modes.
Change-Id: I5479a3016bce962127a3ecbec2db155994dd26b0
Signed-off-by: Chris Cain <cjcain@us.ibm.com>
diff --git a/occ_command.hpp b/occ_command.hpp
index b3983ff..a8c5dd4 100644
--- a/occ_command.hpp
+++ b/occ_command.hpp
@@ -47,14 +47,17 @@
enum class SysPwrMode
{
NO_CHANGE = 0,
- STATIC = 0x01, // Static Base Frequencey
- SFP = 0x03, // Static Frequency Point (requires freqPt)
+ STATIC = 0x01, // Static Base Frequencey
+ NON_DETERMINISTIC = 0x02, // Non-Deterministic
+ SFP = 0x03, // Static Frequency Point (requires freqPt)
SAFE = 0x04, // reported when system is in SAFE mode (not settable)
POWER_SAVING = 0x05, // Static Power Saving
- MAX_FREQ = 0x09, // Maximum Frequency (per chip)
- DYNAMIC_PERF = 0x0A, // Dynamic / Balanced Performance
- FFO = 0x0B, // Fixed Frequency Override (requires freqPt)
- MAX_PERF = 0x0C // Maximum Performance
+ EFF_FAVOR_POWER = 0x06, // Efficiency - Favor Power
+ EFF_FAVOR_PERF = 0x07, // Efficiency - Favor Performance
+ MAX_FREQ = 0x09, // Maximum Frequency (per chip)
+ BALANCED_PERF = 0x0A, // Balanced Performance
+ FFO = 0x0B, // Fixed Frequency Override (requires freqPt)
+ MAX_PERF = 0x0C // Maximum Performance
};
static inline auto format_as(SysPwrMode spm)
@@ -65,10 +68,13 @@
// Only some of the SysPwrModes are currently supported and allowed to be set
#define VALID_POWER_MODE_SETTING(mode) \
((mode == SysPwrMode::STATIC) || (mode == SysPwrMode::POWER_SAVING) || \
- (mode == SysPwrMode::DYNAMIC_PERF) || (mode == SysPwrMode::MAX_PERF))
+ (mode == SysPwrMode::BALANCED_PERF) || (mode == SysPwrMode::MAX_PERF) || \
+ (mode == SysPwrMode::EFF_FAVOR_POWER) || \
+ (mode == SysPwrMode::EFF_FAVOR_PERF))
#define VALID_OEM_POWER_MODE_SETTING(mode) \
((mode == SysPwrMode::SFP) || (mode == SysPwrMode::FFO) || \
- (mode == SysPwrMode::MAX_FREQ))
+ (mode == SysPwrMode::MAX_FREQ) || \
+ (mode == SysPwrMode::NON_DETERMINISTIC))
enum class RspStatus
{
diff --git a/powermode.cpp b/powermode.cpp
index e367afc..342188e 100644
--- a/powermode.cpp
+++ b/powermode.cpp
@@ -174,6 +174,18 @@
{
pmode = SysPwrMode::STATIC;
}
+ else if (mode == Mode::PowerMode::EfficiencyFavorPower)
+ {
+ pmode = SysPwrMode::EFF_FAVOR_POWER;
+ }
+ else if (mode == Mode::PowerMode::EfficiencyFavorPerformance)
+ {
+ pmode = SysPwrMode::EFF_FAVOR_PERF;
+ }
+ else if (mode == Mode::PowerMode::BalancedPerformance)
+ {
+ pmode = SysPwrMode::BALANCED_PERF;
+ }
else
{
if (mode != Mode::PowerMode::OEM)
@@ -303,6 +315,15 @@
case SysPwrMode::MAX_PERF:
dBusMode = Mode::PowerMode::MaximumPerformance;
break;
+ case SysPwrMode::EFF_FAVOR_POWER:
+ dBusMode = Mode::PowerMode::EfficiencyFavorPower;
+ break;
+ case SysPwrMode::EFF_FAVOR_PERF:
+ dBusMode = Mode::PowerMode::EfficiencyFavorPerformance;
+ break;
+ case SysPwrMode::BALANCED_PERF:
+ dBusMode = Mode::PowerMode::BalancedPerformance;
+ break;
default:
dBusMode = Mode::PowerMode::OEM;
}