pseq: Add GPIO formatting for UCD90160
Add support for formatting GPIO values when a pgood error is detected by
a UCD90160.
Write the GPIO names and values to the journal and store them in the
error log additional data.
This formatting support already exists for the UCD90320.
Tested:
* Test where pgood error occurs while chassis is powering on
* Verify correct GPIO values are captured
* Verify GPIO names and values are written to journal
* Verify GPIO names and values are stored in error log
* Test where pgood error occurs after chassis is powered on
* Verify correct GPIO values are captured
* Verify correct GPIO names and values are written to journal
* Verify correct GPIO names and values are stored in error log
* Test where the number of GPIO values is unexpected
* Verify all values stored in additional data with no names
* Verify all values written to the journal with no names
Change-Id: I9a761670bd8af020deb7f85d59d409ad6b5d5b2c
Signed-off-by: Shawn McCarney <shawnmm@us.ibm.com>
diff --git a/phosphor-power-sequencer/src/ucd90160_monitor.hpp b/phosphor-power-sequencer/src/ucd90160_monitor.hpp
index 31d4567..00a3cd8 100644
--- a/phosphor-power-sequencer/src/ucd90160_monitor.hpp
+++ b/phosphor-power-sequencer/src/ucd90160_monitor.hpp
@@ -5,6 +5,9 @@
#include <sdbusplus/bus.hpp>
#include <cstdint>
+#include <map>
+#include <string>
+#include <vector>
namespace phosphor::power::sequencer
{
@@ -32,6 +35,12 @@
*/
UCD90160Monitor(sdbusplus::bus_t& bus, std::uint8_t i2cBus,
std::uint16_t i2cAddress);
+
+ protected:
+ /** @copydoc UCD90xMonitor::formatGpioValues() */
+ void formatGpioValues(
+ const std::vector<int>& values, unsigned int numberLines,
+ std::map<std::string, std::string>& additionalData) const override;
};
} // namespace phosphor::power::sequencer