pseq: Check STATUS_VOUT first to find pgood fault
Enhance the support for finding the correct voltage rail when a pgood
fault occurs.
First check the PMBus STATUS_VOUT register for all rails. Check the
rails in power-on-sequence order.
Checking STATUS_VOUT is usually the most accurate method. For example,
if a pgood fault occurs, the power sequencer device may automatically
shut off related rails. Ideally the device will only set fault bits in
STATUS_VOUT for the rail with the pgood fault. However, all the related
rails will likely appear to be faulted by the other methods.
If no fault is found by checking STATUS_VOUT, then check the GPIOs and
output voltage for all rails. Check the rails in power-on-sequence
order.
Tested:
* Verified all automated test cases run successfully.
Change-Id: Ida8732db573013f1b72edac8ed54e3cfc38da146
Signed-off-by: Shawn McCarney <shawnmm@us.ibm.com>
diff --git a/phosphor-power-sequencer/src/standard_device.hpp b/phosphor-power-sequencer/src/standard_device.hpp
index 210494f..2c1cf3b 100644
--- a/phosphor-power-sequencer/src/standard_device.hpp
+++ b/phosphor-power-sequencer/src/standard_device.hpp
@@ -110,6 +110,27 @@
virtual std::vector<int> getGPIOValuesIfPossible(Services& services);
/**
+ * Checks whether a pgood fault has occurred on one of the rails being
+ * monitored by this device.
+ *
+ * If a pgood fault was found in a rail, a pointer to the Rail object is
+ * returned.
+ *
+ * Throws an exception if an error occurs while trying to obtain the status
+ * of the rails.
+ *
+ * @param services System services like hardware presence and the journal
+ * @param gpioValues GPIO values obtained from the device (if any)
+ * @param additionalData Additional data to include in the error log if
+ * a pgood fault was found
+ * @return pointer to Rail object where fault was found, or nullptr if no
+ * Rail found
+ */
+ virtual Rail* findRailWithPgoodFault(
+ Services& services, const std::vector<int>& gpioValues,
+ std::map<std::string, std::string>& additionalData);
+
+ /**
* Store pgood fault debug data in the specified additional data map.
*
* The default implementation stores the device name and then calls