Support chassis power cycle
A new system is being designed which will utilize phosphor-state-manager
and it requires the chassis system power cycle feature.
Test plan:
Change property "RequestedPowerTransition" to trigger
chassis power cycle target.
Change-Id: I30b0efd7c0fc72a9fb378f48e47c4c1af2b22ad6
Signed-off-by: Bonnie Lo <Bonnie_Lo@wiwynn.com>
diff --git a/chassis_state_manager.cpp b/chassis_state_manager.cpp
index ba30c73..db5ae96 100644
--- a/chassis_state_manager.cpp
+++ b/chassis_state_manager.cpp
@@ -45,6 +45,8 @@
"obmc-chassis-hard-poweroff@{}.target";
constexpr auto CHASSIS_STATE_POWERON_TGT_FMT = "obmc-chassis-poweron@{}.target";
constexpr auto CHASSIS_BLACKOUT_TGT_FMT = "obmc-chassis-blackout@{}.target";
+constexpr auto CHASSIS_STATE_POWERCYCLE_TGT_FMT =
+ "obmc-chassis-powercycle@{}.target";
constexpr auto AUTO_POWER_RESTORE_SVC_FMT =
"phosphor-discover-system-state@{}.service";
constexpr auto ACTIVE_STATE = "active";
@@ -92,7 +94,9 @@
systemdTargetTable = {
// Use the hard off target to ensure we shutdown immediately
{Transition::Off, fmt::format(CHASSIS_STATE_HARD_POWEROFF_TGT_FMT, id)},
- {Transition::On, fmt::format(CHASSIS_STATE_POWERON_TGT_FMT, id)}};
+ {Transition::On, fmt::format(CHASSIS_STATE_POWERON_TGT_FMT, id)},
+ {Transition::PowerCycle,
+ fmt::format(CHASSIS_STATE_POWERCYCLE_TGT_FMT, id)}};
}
// TODO - Will be rewritten once sdbusplus client bindings are in place