summaryrefslogtreecommitdiff
path: root/psu-manager/include
AgeCommit message (Collapse)AuthorFilesLines
2019-11-22Sync configuration data between settings and PSU redundancy serviceYong Li2-10/+5
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
2019-11-11Add LED Support for Power RedundancyCheng C Yang1-1/+13
Add status LED support for Power Unit Redundancy. Tested: AC off or remove one PSU, status LED changes to amber blinking. AC on the PSU again, status LED changes back to solid green. Change-Id: I86c9e03c0e2a5f035a6bf5140c850c1551fb40a7 Signed-off-by: Cheng C Yang <cheng.c.yang@intel.com>
2019-10-21Fix keeping printing i2c error issueCheng C Yang1-0/+2
i2cget function in cold redundancy will keep printing i2c error message in BMC debug console when there is only one PSU in the system. Add a ping flag to fix this. Tested: Only insert one PSU, BMC console will not keep printing i2c error message. Change-Id: I639b7fe036fd383fbdbc4c4868c77560cc91a63c Signed-off-by: Cheng C Yang <cheng.c.yang@intel.com>
2019-10-07Implement Power Unit RedundancyCheng C Yang1-0/+4
Implement Power Unit Redundancy, when PSU numbers has been changed or any PSU event happen, Power Unit Redundancy event may be triggered. Tested: With the related change on Redfish Event Log in bmcweb, when there are two PSU on the sytem, remove one AC cable on PSU. Then bellow Redfish log will be created. { "@odata.context": "/redfish/v1/$metadata#LogEntry.LogEntry", "@odata.id": "/redfish/v1/Systems/system/LogServices/EventLog/Entries/ 205610", "@odata.type": "#LogEntry.v1_4_0.LogEntry", "Created": "1970-01-03T09:06:50+00:00", "EntryType": "Event", "Id": "205610", "Message": "Power Unit Redundancy lost.", "MessageArgs": [], "MessageId": "OpenBMC.0.1.PowerUnitRedundancyLost", "Name": "System Event Log Entry", "Severity": "Warning" }, { "@odata.context": "/redfish/v1/$metadata#LogEntry.LogEntry", "@odata.id": "/redfish/v1/Systems/system/LogServices/EventLog/Entries/ 205610_1", "@odata.type": "#LogEntry.v1_4_0.LogEntry", "Created": "1970-01-03T09:06:50+00:00", "EntryType": "Event", "Id": "205610_1", "Message": "Power Unit Nonredundant but has sufficient resource.", "MessageArgs": [], "MessageId": "OpenBMC.0.1.PowerUnitNonRedundantSufficient", "Name": "System Event Log Entry", "Severity": "Warning" }, Plug in the AC cable again, the Redfish log will show { "@odata.context": "/redfish/v1/$metadata#LogEntry.LogEntry", "@odata.id": "/redfish/v1/Systems/system/LogServices/EventLog/Entries/ 205621", "@odata.type": "#LogEntry.v1_4_0.LogEntry", "Created": "1970-01-03T09:07:01+00:00", "EntryType": "Event", "Id": "205621", "Message": "Power Unit Redundancy regained.", "MessageArgs": [], "MessageId": "OpenBMC.0.1.PowerUnitRedundancyRegained", "Name": "System Event Log Entry", "Severity": "OK" } Change-Id: Id20a1ccf83497fd5982c9dfee9c972895f395112 Signed-off-by: Cheng C Yang <cheng.c.yang@intel.com>
2019-08-16Add keep alive function for PSUCheng C Yang2-6/+10
Add keep alive function to monitor the FRU of PSU. If FRU cannot be accessed, it means one PSU have been removed, need to rescan FRU. Tested: Only insert one PSU and start system. Check entity-manager, only one PSU will be found. Insert another PSU then, wait for a while and check entity-manager again, two PSU should be found now, add redfish log show { "@odata.context": "/redfish/v1/$metadata#LogEntry.LogEntry", "@odata.id": "/redfish/v1/Systems/system/LogServices/EventLog/Entries/ 1563892418", "@odata.type": "#LogEntry.v1_4_0.LogEntry", "Created": "2019-07-23T14:33:38+00:00", "EntryType": "Event", "Id": "1563892418", "Message": "Power supply PSU1 inserted.", "MessageArgs": [ "PSU0" ], "MessageId": "OpenBMC.0.1.PowerSupplyInserted", "Name": "System Event Log Entry", "Severity": "OK" }, Then remove one PSU again, now only one PSU should be showed in entity-manager. And redfish log show: { "@odata.context": "/redfish/v1/$metadata#LogEntry.LogEntry", "@odata.id": "/redfish/v1/Systems/system/LogServices/EventLog/Entries/ 1563892532", "@odata.type": "#LogEntry.v1_4_0.LogEntry", "Created": "2019-07-23T14:35:32+00:00", "EntryType": "Event", "Id": "1563892532", "Message": "Power supply PSU1 removed.", "MessageArgs": [ "PSU0" ], "MessageId": "OpenBMC.0.1.PowerSupplyRemoved", "Name": "System Event Log Entry", "Severity": "Warning" }, Change-Id: Icbd70407892a334a52208e5fa6da1c4bbd75bcab Signed-off-by: Cheng C Yang <cheng.c.yang@intel.com>
2019-08-07Support Cold Redundancy ipmi commandCheng C Yang2-1/+5
Support ipmi command or redfish to change Cold Redundancy related config parameters. Tested: With Cold Redundancy ipmi command code change, run ipmi command to change config paramters - RotationEnable, RotationAlgorithm, RotationRankOrder, periodOfRotation and PowerSupplyRedundancyEnabled, the parameters in Cold Redundancy service will also be changed. Change-Id: I254553c7c9f1a2e33ef07a17433bd1ecd8a992f1 Signed-off-by: Cheng C Yang <cheng.c.yang@intel.com>
2019-08-01Implement basic function of Cold RedundancyCheng C Yang2-4/+15
Implement basic function of Cold Redundancy include rotation, config, check and reRanking. Tested: Change rotationPeriod to a smaller value such as 60 seconds. Insert two PSU on system, and check PSU rank order register 0xd0. After 60s The value of rank order in PSU1 will change to 2, and the value of rank order in PSU2 will change to 1. If removed AC Cable on one PSU. The rank order in this PSU will be always 0, and the rank order in the other PSU will be always 1. Change-Id: Idc14f783ec83db005ecf9fc53332431ba6a6daee Signed-off-by: Cheng C Yang <cheng.c.yang@intel.com>
2019-07-27Update first patch for Cold RedundancyCheng C Yang2-0/+127
Update first patch for PowerSupply Cold Redundancy feature. The first patch will get PSU information from entity manager and base on the information, create PSU class for Cold Redundancy. Tested: With later Cold Redundancy patch, basic function, keep alive and PSU status all can work correctly. Change-Id: Ib2279043c0cbfade9c02f4107ae2137af17ba942 Signed-off-by: Cheng C Yang <cheng.c.yang@intel.com>