psu-ng: Add in handling of specific MFR faults
Add in a function to determine what the various bits in statusMFR may be
indicating for a fault, based on the type of power supply (device driver
bound).
Add in PS_Kill, 12Vcs, and 12V CS faults for IBM power supply types.
Add in creating error logs for PS_Kill, 12Vcs, and 12V CS faults. The
12Vcs and 12V CS faults can essentially be treated the same as VOUT_UV
faults (same error type, same call out).
Tested:
Verified no PS_Kill, 12Vcs, or 12V CS fault on normal Rainier 2S4U
Simulated PS_Kill fault:
MFR fault: STATUS_WORD = 0x1840 STATUS_MFR_SPECIFIC = 0x10
Simulated 12Vcs fault:
PGOOD fault: STATUS_WORD = 0x1840, STATUS_MFR_SPECIFIC = 0x40
MFR fault: STATUS_WORD = 0x1840 STATUS_MFR_SPECIFIC = 0x40
Simulated 12V CS fault/warning:
MFR fault: STATUS_WORD = 0x1000 STATUS_MFR_SPECIFIC = 0x80
Change-Id: Ie89a58836ecec86dfa2e124eb6ab03e9dccce929
Signed-off-by: Brandon Wyman <bjwyman@gmail.com>
diff --git a/phosphor-power-supply/power_supply.cpp b/phosphor-power-supply/power_supply.cpp
index 908f04f..a48441d 100644
--- a/phosphor-power-supply/power_supply.cpp
+++ b/phosphor-power-supply/power_supply.cpp
@@ -189,6 +189,28 @@
}
}
+void PowerSupply::determineMFRFault()
+{
+ if (bindPath.string().find("ibm-cffps") != std::string::npos)
+ {
+ // IBM MFR_SPECIFIC[4] is PS_Kill fault
+ if (statusMFR & 0x10)
+ {
+ psKillFault = true;
+ }
+ // IBM MFR_SPECIFIC[6] is 12Vcs fault.
+ if (statusMFR & 0x40)
+ {
+ ps12VcsFault = true;
+ }
+ // IBM MFR_SPECIFIC[7] is 12V Current-Share fault.
+ if (statusMFR & 0x80)
+ {
+ psCS12VFault = true;
+ }
+ }
+}
+
void PowerSupply::analyze()
{
using namespace phosphor::pmbus;
@@ -360,6 +382,7 @@
}
mfrFault = true;
+ determineMFRFault();
}
if (statusWord & status_word::VIN_UV_FAULT)
@@ -395,6 +418,9 @@
.c_str());
pgoodFault = 0;
}
+ psKillFault = false;
+ ps12VcsFault = false;
+ psCS12VFault = false;
}
}
catch (const ReadFailure& e)
@@ -451,6 +477,9 @@
fanFault = false;
tempFault = false;
pgoodFault = 0;
+ psKillFault = false;
+ ps12VcsFault = false;
+ psCS12VFault = false;
readFail = 0;
try