psu-ng: Add code to detect VOUT_OV_FAULT
If the output voltage hits an overvoltage condition, the VOUT_OV_FAULT
bit (bit 5 of STATUS_WORD low byte) should turn on. The PMBus spec
indicates that VOUT fault/warning (bit 7 high byte) and VOUT_OV_FAULT
are associated with status in the STATUS_VOUT command response.
Check for VOUT_OV_FAULT after check for VIN_UV_FAULT, create error if
the fault is indicated.
Change-Id: Ia68b4f986393f0ba0184401deb29b4f5d25a2ed0
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 ca9c084..2102e53 100644
--- a/phosphor-power-supply/power_supply.cpp
+++ b/phosphor-power-supply/power_supply.cpp
@@ -211,6 +211,8 @@
statusInput = pmbusIntf->read(STATUS_INPUT, Type::Debug);
statusMFR = pmbusIntf->read(STATUS_MFR, Type::Debug);
statusCML = pmbusIntf->read(STATUS_CML, Type::Debug);
+ auto status0Vout = pmbusIntf->insertPageNum(STATUS_VOUT, 0);
+ statusVout = pmbusIntf->read(status0Vout, Type::Debug);
if (statusWord & status_word::CML_FAULT)
{
if (!cmlFault)
@@ -241,6 +243,21 @@
inputFault = true;
}
+ if (statusWord & status_word::VOUT_OV_FAULT)
+ {
+ if (!voutOVFault)
+ {
+ log<level::INFO>(
+ fmt::format("INPUT fault: STATUS_WORD = {:#04x}, "
+ "STATUS_MFR_SPECIFIC = {:#02x}, "
+ "STATUS_VOUT = {:#02x}",
+ statusWord, statusMFR, statusVout)
+ .c_str());
+ }
+ faultFound = true;
+ voutOVFault = true;
+ }
+
if (statusWord & status_word::MFR_SPECIFIC_FAULT)
{
if (!mfrFault)
@@ -279,6 +296,7 @@
inputFault = false;
mfrFault = false;
vinUVFault = false;
+ voutOVFault = false;
}
}
catch (const ReadFailure& e)
@@ -330,6 +348,7 @@
statusMFR = 0;
vinUVFault = false;
cmlFault = false;
+ voutOVFault = false;
readFail = 0;
try