summaryrefslogtreecommitdiff
path: root/psu-manager
AgeCommit message (Collapse)AuthorFilesLines
2020-01-29Only rescan FRU on pmbus when PSU changesCheng C Yang1-3/+6
When a new PSU is inserted, only rescan the FRU on pmbus instead of rescan all the FRU on the system. Tested: Insert a new PSU, Redfish can show correct FRU of this PSU. Change-Id: I6868210868dda8f5f9f5fc5a52dad472cb129f88 Signed-off-by: Cheng C Yang <cheng.c.yang@intel.com>
2019-12-03Change the LED status for redundancy loss eventYong Li1-2/+2
EPS defines the redundancy loss as degraded state: Blinking green led. The log priority should be warn, to align with redfish event log. Tested: With two PSUs, disconnected one PSU to trigger this event, the green led will blink. Change-Id: I66f654f31af8cc6749741bbad4eae6491492cf35 Signed-off-by: Yong Li <yong.b.li@linux.intel.com>
2019-11-22Sync configuration data between settings and PSU redundancy serviceYong Li4-29/+108
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 Yang2-2/+40
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-30Fix PSU number incorrect issue.Cheng C Yang1-17/+15
When remove PSU2, it will report PSU1 removed log. Correct this logic bug. Tested: Remove PSU2, PSU2 removed Redfish log is recorded. Insert PSU2, PSU2 inserted Redfish log is recorded. Change-Id: Ifba3175b6ac965cb35de2283d59b7b058985fe0b Signed-off-by: Cheng C Yang <cheng.c.yang@intel.com>
2019-10-21Fix keeping printing i2c error issueCheng C Yang3-4/+64
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 Yang2-8/+160
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-09-10Fix no PSU remove and insert log.Cheng C Yang1-2/+2
Fix the problem that after removed or inserted PSU, no related Redfish log is asserted. Tested: Remove one PSU, PowerSupplyRemoved log has been recorded. Insert the PSU again, PowerSupplyInserted log has been recorded. Change-Id: I7bd2563e7f7c15a60e506a21ce31ec6f71309735 Signed-off-by: Cheng C Yang <cheng.c.yang@intel.com>
2019-08-16Add keep alive function for PSUCheng C Yang5-24/+149
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 Yang3-10/+107
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-07Checking PSU event to set PSU statusCheng C Yang1-0/+68
Checking PSU event to see if PSUs are normal status or not. Tested: Remove one PSU, check the PSU status is in ACLost. Change-Id: I1d83e1544d77adeed0b8961be5ae470330b5e9ab Signed-off-by: Cheng C Yang <cheng.c.yang@intel.com>
2019-08-01Implement basic function of Cold RedundancyCheng C Yang6-11/+354
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 Yang10-0/+843
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>