diff options
author | Yong Li <yong.b.li@linux.intel.com> | 2019-11-19 13:25:01 +0300 |
---|---|---|
committer | Li, Yong B <yong.b.li@intel.com> | 2019-11-22 07:22:23 +0300 |
commit | 62d865faae2c183a64455abed5114d67aa61b311 (patch) | |
tree | bda3d55ad6f802977b76d944003fbe45e83c7a75 /psu-manager/include/cold_redundancy.hpp | |
parent | d095ccea8df74f9de228ab83b658d80b4fb79460 (diff) | |
download | provingground-62d865faae2c183a64455abed5114d67aa61b311.tar.xz |
Sync configuration data between settings and PSU redundancy service
Add support for reading configuration from settings service,
and store all these data into dbus;
Rank order configuration needs to be queried from PSU redundancy service,
since it will be changed from time to time.
Tested:
Applied https://gerrit.openbmc-project.xyz/#/c/openbmc/intel-ipmi-oem/+/27220/,
With two PSUs, AC cycle the board,
// two PSUs available
ipmitool raw 0x30 0x2E 0x05
05 02
// Return the default order 0,0, instead of the default settings is 0
root@intel-obmc:~# ipmitool raw 0x30 0x2E 0x03
03 01 00 00
Wait for 2 minutes, the order will be changed to ascending order,
and start the rotation
ipmitool raw 0x30 0x2e 0x3
03 00 01 02
// Set a new order 1,2
root@intel-obmc:~# ipmitool raw 0x30 0x2d 0x03 0x01 0x01 0x02
00
// Return the new order
root@intel-obmc:~# ipmitool raw 0x30 0x2E 0x03
03 01 01 02
Signed-off-by: Yong Li <yong.b.li@linux.intel.com>
Change-Id: I50c469ae7b2f089d3e7cc70932e5eed4f7164f74
Diffstat (limited to 'psu-manager/include/cold_redundancy.hpp')
-rw-r--r-- | psu-manager/include/cold_redundancy.hpp | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/psu-manager/include/cold_redundancy.hpp b/psu-manager/include/cold_redundancy.hpp index cd7a5f6..81c56d1 100644 --- a/psu-manager/include/cold_redundancy.hpp +++ b/psu-manager/include/cold_redundancy.hpp @@ -21,7 +21,6 @@ const constexpr char* psuInterface = "/xyz/openbmc_project/inventory/system/powersupply/"; const constexpr int secondsInOneDay = 86400; -const constexpr uint8_t bmcSpecific = 0; using Association = std::tuple<std::string, std::string, std::string>; @@ -47,14 +46,10 @@ class ColdRedundancy private: bool crSupported = true; - bool crEnabled = true; - bool rotationEnabled = true; - std::string rotationAlgo = - "xyz.openbmc_project.Control.PowerSupplyRedundancy.Algo.bmcSpecific"; uint8_t psOrder; uint8_t numberOfPSU = 0; - uint32_t rotationPeriod = 7 * secondsInOneDay; uint8_t redundancyPSURequire = 1; + std::vector<uint8_t> settingsOrder = {}; void startRotateCR(void); void startCRCheck(void); @@ -91,7 +86,7 @@ class PowerSupply { public: PowerSupply( - std::string name, uint8_t bus, uint8_t address, + std::string& name, uint8_t bus, uint8_t address, uint8_t order, const std::shared_ptr<sdbusplus::asio::connection>& dbusConnection); ~PowerSupply(); std::string name; |