Add YAML and error function for MEM_GOODx faults

Add a section to the error and metadata YAML files for the MEM_GOODx
faults. Use that to update/generate a new elog-errors.hpp include file.

Update the power sequencer source to have a memGoodFault function for
handling callouts for MEM_GOODx type errors.

Change-Id: Ia08dc88f29f00f749e7995f97f37647b02135a2b
Signed-off-by: Brandon Wyman <bjwyman@gmail.com>
diff --git a/power-sequencer/types.hpp b/power-sequencer/types.hpp
index fcb30e3..7edfa59 100644
--- a/power-sequencer/types.hpp
+++ b/power-sequencer/types.hpp
@@ -24,7 +24,9 @@
 {
     none,
     gpuPGOOD,
-    gpuOverTemp
+    gpuOverTemp,
+    memGOOD0,
+    memGOOD1
 };
 
 /**
diff --git a/power-sequencer/ucd90160.cpp b/power-sequencer/ucd90160.cpp
index 203004d..2b83918 100644
--- a/power-sequencer/ucd90160.cpp
+++ b/power-sequencer/ucd90160.cpp
@@ -476,5 +476,27 @@
         metadata::CALLOUT_INVENTORY_PATH(callout.c_str()));
 }
 
+void UCD90160::memGoodError(const std::string& callout)
+{
+    util::NamesValues nv;
+
+    try
+    {
+        nv.add("STATUS_WORD", readStatusWord());
+        nv.add("MFR_STATUS", readMFRStatus());
+    }
+    catch (device_error::ReadFailure& e)
+    {
+        log<level::ERR>("ReadFailure when collecting metadata");
+        commit<device_error::ReadFailure>();
+    }
+
+    using metadata = org::open_power::Witherspoon::Fault::MemoryPowerFault;
+
+    report<power_error::MemoryPowerFault>(
+        metadata::RAW_STATUS(nv.get().c_str()),
+        metadata::CALLOUT_INVENTORY_PATH(callout.c_str()));
+}
+
 } // namespace power
 } // namespace witherspoon
diff --git a/power-sequencer/ucd90160.hpp b/power-sequencer/ucd90160.hpp
index 5eedda8..3169de6 100644
--- a/power-sequencer/ucd90160.hpp
+++ b/power-sequencer/ucd90160.hpp
@@ -79,6 +79,13 @@
     void gpuOverTempError(const std::string& callout);
 
     /**
+     * Reports an error for a MEM_GOODx failure.
+     *
+     * @param[in] callout - The MEM callout string
+     */
+    void memGoodError(const std::string& callout);
+
+    /**
      * Given the device path for a chip, find its gpiochip
      * path
      *