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/ucd90x_monitor.cpp b/phosphor-power-sequencer/src/ucd90x_monitor.cpp
index 2dc4675..f36d734 100644
--- a/phosphor-power-sequencer/src/ucd90x_monitor.cpp
+++ b/phosphor-power-sequencer/src/ucd90x_monitor.cpp
@@ -287,8 +287,12 @@
log<level::INFO>(
fmt::format("GPIO chip number of lines: {}", numberLines).c_str());
- // Workaround libgpiod bulk line maximum by getting values from individual
- // lines
+ // Read GPIO values. Work around libgpiod bulk line maximum by getting
+ // values from individual lines. The libgpiod line offsets are the same as
+ // the Pin IDs defined in the UCD90xxx PMBus interface documentation. These
+ // Pin IDs are different from the pin numbers on the chip. For example, on
+ // the UCD90160, "FPWM1/GPIO5" is Pin ID/line offset 0, but it is pin number
+ // 17 on the chip.
std::vector<int> values;
try
{