psu-ng: Add code to detect VOUT_UV_FAULT
If the output voltage hits an undervoltage condition, the VOUT
fault/warn bit in STATUS_WORD will be on, but the VOUT_OV_FAULT bit will
be off.
Check for VOUT_UV_FAULT after check for VOUT_OV_FAULT, create error,
call out the power supply indicating that fault.
Tested:
Verify no fault detected or error logged in normal conditions on
real hardware.
Simulate VOUT_UV fault:
VOUT_UV_FAULT fault: STATUS_WORD = 0x8000, STATUS_MFR_SPECIFIC = 0x0, STATUS_VOUT = 0x0
and
VOUT_UV_FAULT fault: STATUS_WORD = 0x8000, STATUS_MFR_SPECIFIC = 0x0, STATUS_VOUT = 0x30
Change-Id: I2605a197634616c4c2ad49f0275eaccaef7cc5f0
Signed-off-by: Brandon Wyman <bjwyman@gmail.com>
diff --git a/phosphor-power-supply/psu_manager.cpp b/phosphor-power-supply/psu_manager.cpp
index 282412c..1c9378b 100644
--- a/phosphor-power-supply/psu_manager.cpp
+++ b/phosphor-power-supply/psu_manager.cpp
@@ -494,6 +494,21 @@
psu->setFaultLogged();
}
+ else if (psu->hasVoutUVFault())
+ {
+ // Include STATUS_VOUT for Vout faults.
+ additionalData["STATUS_VOUT"] =
+ fmt::format("{:#02x}", psu->getStatusVout());
+
+ additionalData["CALLOUT_INVENTORY_PATH"] =
+ psu->getInventoryPath();
+
+ createError(
+ "xyz.openbmc_project.Power.PowerSupply.Error.Fault",
+ additionalData);
+
+ psu->setFaultLogged();
+ }
else if (psu->hasTempFault())
{
// Include STATUS_TEMPERATURE for temperature faults.