diff options
author | Andrew Geissler <andrewg@us.ibm.com> | 2017-03-06 05:36:50 +0300 |
---|---|---|
committer | Andrew Geissler <geissonator@yahoo.com> | 2017-03-15 22:55:21 +0300 |
commit | e4577f6245a58771807b75652ab20a3b279a04b9 (patch) | |
tree | 55d6393d07e8be89a36b6a6c9f55e719ecc191f9 /meta-phosphor/common/recipes-phosphor/chassis | |
parent | b8c47703036a3ebcfda7491da42cff5c2c11b084 (diff) | |
download | openbmc-e4577f6245a58771807b75652ab20a3b279a04b9.tar.xz |
Targets and services to check for pgood on bmc reset
Once enabled these targets and services will be run after
a BMC reboot to check if pgood is on and if so, to create
a file which will be used by other power on services
to know whether they need to run or not.
Change-Id: Id2e75f9bce20f362d2f57a79e91ece1eaf7d7c45
Signed-off-by: Andrew Geissler <andrewg@us.ibm.com>
Diffstat (limited to 'meta-phosphor/common/recipes-phosphor/chassis')
3 files changed, 45 insertions, 0 deletions
diff --git a/meta-phosphor/common/recipes-phosphor/chassis/obmc-op-control-power.bb b/meta-phosphor/common/recipes-phosphor/chassis/obmc-op-control-power.bb index eb9513b5b5..7c4fb2b238 100644 --- a/meta-phosphor/common/recipes-phosphor/chassis/obmc-op-control-power.bb +++ b/meta-phosphor/common/recipes-phosphor/chassis/obmc-op-control-power.bb @@ -17,6 +17,8 @@ SYSTEMD_SERVICE_${PN} += " \ op-wait-power-on@.service \ op-power-stop@.service \ op-wait-power-off@.service \ + op-reset-pgood-check@.service \ + op-reset-set-power-on@.service \ " SYSTEMD_ENVIRONMENT_FILE_${PN} += "obmc/power_control" @@ -39,11 +41,22 @@ OFF_TMPL = "op-wait-power-off@.service" OFF_INSTFMT = "op-wait-power-off@{0}.service" OFF_FMT = "../${OFF_TMPL}:${STOP_TGTFMT}.requires/${OFF_INSTFMT}" +RESET_TMPL = "op-reset-pgood-check@.service" +RESET_TGTFMT = "obmc-chassis-reset@{1}.target" +RESET_INSTFMT = "op-reset-pgood-check@{0}.service" +RESET_FMT = "../${RESET_TMPL}:${RESET_TGTFMT}.requires/${RESET_INSTFMT}" + +RESET_ON_TMPL = "op-reset-set-power-on@.service" +RESET_ON_INSTFMT = "op-reset-set-power-on@{0}.service" +RESET_ON_FMT = "../${RESET_ON_TMPL}:${RESET_TGTFMT}.requires/${RESET_ON_INSTFMT}" + # Build up requires relationship for START_TGTFMT and STOP_TGTFMT SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'START_FMT', 'OBMC_POWER_INSTANCES', 'OBMC_CHASSIS_INSTANCES')}" SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'STOP_FMT', 'OBMC_POWER_INSTANCES', 'OBMC_CHASSIS_INSTANCES')}" SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'ON_FMT', 'OBMC_POWER_INSTANCES', 'OBMC_CHASSIS_INSTANCES')}" SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'OFF_FMT', 'OBMC_POWER_INSTANCES', 'OBMC_CHASSIS_INSTANCES')}" +SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'RESET_FMT', 'OBMC_POWER_INSTANCES', 'OBMC_CHASSIS_INSTANCES')}" +SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'RESET_ON_FMT', 'OBMC_POWER_INSTANCES', 'OBMC_CHASSIS_INSTANCES')}" # Now show that the main control target requires these power targets START_TMPL_CTRL = "obmc-power-chassis-on@.target" diff --git a/meta-phosphor/common/recipes-phosphor/chassis/obmc-op-control-power/op-reset-pgood-check@.service b/meta-phosphor/common/recipes-phosphor/chassis/obmc-op-control-power/op-reset-pgood-check@.service new file mode 100644 index 0000000000..b0095371f7 --- /dev/null +++ b/meta-phosphor/common/recipes-phosphor/chassis/obmc-op-control-power/op-reset-pgood-check@.service @@ -0,0 +1,16 @@ +[Unit] +Description=Check Chassis%i pgood on reset +Wants=mapper-wait@-org-openbmc-control-power%i.service +After=mapper-wait@-org-openbmc-control-power%i.service +Wants=obmc-power-reset-on@%i.target +Before=obmc-power-reset-on@%i.target +Conflicts=obmc-power-chassis-off@%i.target + +[Service] +RemainAfterExit=no +Type=oneshot +ExecStart=/bin/sh -c "busctl get-property `mapper get-service /org/openbmc/control/power%i` /org/openbmc/control/power%i org.openbmc.control.Power pgood | sed 's/i\s*[1]/on/' | grep on" + + +[Install] +WantedBy=obmc-chassis-reset@%i.target diff --git a/meta-phosphor/common/recipes-phosphor/chassis/obmc-op-control-power/op-reset-set-power-on@.service b/meta-phosphor/common/recipes-phosphor/chassis/obmc-op-control-power/op-reset-set-power-on@.service new file mode 100644 index 0000000000..4d58d61a0e --- /dev/null +++ b/meta-phosphor/common/recipes-phosphor/chassis/obmc-op-control-power/op-reset-set-power-on@.service @@ -0,0 +1,16 @@ +[Unit] +Description=Create file to indicate chassis%i pgood is on +After=obmc-power-reset-on@%i.target +Requires=obmc-power-reset-on@%i.target +After=op-reset-pgood-check@%i.service +Requires=op-reset-pgood-check@%i.service +Conflicts=obmc-power-chassis-off@%i.target + +[Service] +RemainAfterExit=no +Type=oneshot +ExecStart=/bin/sh -c "mkdir -p /run/openbmc/ && touch /run/openbmc/chassis@%i-on" + + +[Install] +WantedBy=obmc-chassis-reset@%i.target |