pseq: Add is_power_supply_rail JSON file property
Enhance the JSON configuration file for the phosphor-power-sequencer
application. Add an "is_power_supply_rail" property to the "rail"
object.
Update the config file documentation, config file parser, Rail class,
and the associated tests.
Change-Id: I3d0e8276324dd9cf25f386016c6f275b540515aa
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 5445449..6ac8610 100644
--- a/phosphor-power-sequencer/src/rail.hpp
+++ b/phosphor-power-sequencer/src/rail.hpp
@@ -71,6 +71,8 @@
* must be present in order for the rail to be present
* @param page Optional PMBus PAGE number of the rail. Required if
* checkStatusVout or compareVoltageToLimits is true.
+ * @param isPowerSupplyRail Specifies whether the rail is produced by a
+ * power supply
* @param checkStatusVout Specifies whether to check the value of the PMBus
* STATUS_VOUT command when determining the pgood
* status of the rail
@@ -83,11 +85,12 @@
*/
explicit Rail(const std::string& name,
const std::optional<std::string>& presence,
- const std::optional<uint8_t>& page, bool checkStatusVout,
- bool compareVoltageToLimits,
+ const std::optional<uint8_t>& page, bool isPowerSupplyRail,
+ bool checkStatusVout, bool compareVoltageToLimits,
const std::optional<GPIO>& gpio) :
name{name},
- presence{presence}, page{page}, checkStatusVout{checkStatusVout},
+ presence{presence}, page{page}, isPsuRail{isPowerSupplyRail},
+ checkStatusVout{checkStatusVout},
compareVoltageToLimits{compareVoltageToLimits}, gpio{gpio}
{
// If checking STATUS_VOUT or output voltage, verify PAGE was specified
@@ -129,6 +132,16 @@
}
/**
+ * Returns whether the rail is produced by a power supply.
+ *
+ * @return true if rail is produced by a power supply, false otherwise
+ */
+ bool isPowerSupplyRail() const
+ {
+ return isPsuRail;
+ }
+
+ /**
* Returns whether the value of the PMBus STATUS_VOUT command is checked
* when determining the pgood status of the rail.
*
@@ -180,6 +193,11 @@
std::optional<uint8_t> page{};
/**
+ * Specifies whether the rail is produced by a power supply.
+ */
+ bool isPsuRail{false};
+
+ /**
* Specifies whether to check the value of the PMBus STATUS_VOUT command
* when determining the pgood status of the rail.
*