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/rail.hpp b/phosphor-power-sequencer/src/rail.hpp
index b4b6f95..ee331ca 100644
--- a/phosphor-power-sequencer/src/rail.hpp
+++ b/phosphor-power-sequencer/src/rail.hpp
@@ -257,14 +257,6 @@
                        const std::vector<int>& gpioValues,
                        std::map<std::string, std::string>& additionalData);
 
-  private:
-    /**
-     * Verifies that a PMBus PAGE number is defined for the rail.
-     *
-     * Throws an exception if a PAGE number is not defined.
-     */
-    void verifyHasPage();
-
     /**
      * Returns whether the PMBus STATUS_VOUT command indicates a pgood fault
      * has occurred on the rail.
@@ -290,12 +282,13 @@
      * status.
      *
      * @param device Power sequencer device that enables and monitors the rail
+     * @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 an error log if this
      *                       method returns true
      * @return true if a pgood fault was found on the rail, false otherwise
      */
-    bool hasPgoodFaultGPIO(Services& services,
+    bool hasPgoodFaultGPIO(PowerSequencerDevice& device, Services& services,
                            const std::vector<int>& gpioValues,
                            std::map<std::string, std::string>& additionalData);
 
@@ -316,6 +309,14 @@
         PowerSequencerDevice& device, Services& services,
         std::map<std::string, std::string>& additionalData);
 
+  private:
+    /**
+     * Verifies that a PMBus PAGE number is defined for the rail.
+     *
+     * Throws an exception if a PAGE number is not defined.
+     */
+    void verifyHasPage();
+
     /**
      * Store pgood fault debug data in the specified additional data map.
      *