Add GPU error logging functions
Add functions to log the GPU PGOOD and overtemp
errors.
Change-Id: I6f58d76883f8a78a3301481dbacd111c74b396d4
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
diff --git a/power-sequencer/ucd90160.cpp b/power-sequencer/ucd90160.cpp
index c819d66..8317837 100644
--- a/power-sequencer/ucd90160.cpp
+++ b/power-sequencer/ucd90160.cpp
@@ -283,5 +283,31 @@
return gpioDevicePath;
}
+void UCD90160::gpuPGOODError(const std::string& callout)
+{
+ util::NamesValues nv;
+ nv.add("STATUS_WORD", readStatusWord());
+ nv.add("MFR_STATUS", readMFRStatus());
+
+ using metadata = xyz::openbmc_project::Power::Fault::GPUPowerFault;
+
+ report<GPUPowerFault>(
+ metadata::RAW_STATUS(nv.get().c_str()),
+ metadata::GPU(callout.c_str()));
+}
+
+void UCD90160::gpuOverTempError(const std::string& callout)
+{
+ util::NamesValues nv;
+ nv.add("STATUS_WORD", readStatusWord());
+ nv.add("MFR_STATUS", readMFRStatus());
+
+ using metadata = xyz::openbmc_project::Power::Fault::GPUOverTemp;
+
+ report<GPUOverTemp>(
+ metadata::RAW_STATUS(nv.get().c_str()),
+ metadata::GPU(callout.c_str()));
+}
+
}
}
diff --git a/power-sequencer/ucd90160.hpp b/power-sequencer/ucd90160.hpp
index e470614..cf4baad 100644
--- a/power-sequencer/ucd90160.hpp
+++ b/power-sequencer/ucd90160.hpp
@@ -61,6 +61,20 @@
private:
/**
+ * Reports an error for a GPU PGOOD failure
+ *
+ * @param[in] callout - the GPU callout string
+ */
+ void gpuPGOODError(const std::string& callout);
+
+ /**
+ * Reports an error for a GPU OverTemp failure
+ *
+ * @param[in] callout - the GPU callout string
+ */
+ void gpuOverTempError(const std::string& callout);
+
+ /**
* Given the device path for a chip, find its gpiochip
* path
*