Brad Bishop | 86ee1cf | 2016-06-27 14:53:52 -0400 | [diff] [blame] | 1 | SUMMARY = "org.openbmc.control.Power implemention for OpenPOWER" |
| 2 | DESCRIPTION = "A power control implementation suitable for OpenPOWER systems." |
| 3 | PR = "r1" |
| 4 | |
| 5 | inherit skeleton-gdbus |
Brad Bishop | 0fe8046 | 2016-08-17 20:27:37 -0400 | [diff] [blame] | 6 | inherit obmc-phosphor-dbus-service |
| 7 | |
Brad Bishop | 1122eb0 | 2016-10-05 20:10:23 -0400 | [diff] [blame] | 8 | DEPENDS += "phosphor-mapper systemd" |
Brad Bishop | ecd773d | 2016-08-31 23:43:19 -0400 | [diff] [blame] | 9 | |
Brad Bishop | 86ee1cf | 2016-06-27 14:53:52 -0400 | [diff] [blame] | 10 | SKELETON_DIR = "op-pwrctl" |
Brad Bishop | 0fe8046 | 2016-08-17 20:27:37 -0400 | [diff] [blame] | 11 | |
| 12 | FMT = "org.openbmc.control.Power@{0}.service" |
| 13 | DBUS_SERVICE_${PN} += "${@compose_list(d, 'FMT', 'OBMC_POWER_INSTANCES')}" |
| 14 | |
| 15 | SYSTEMD_SERVICE_${PN} += " \ |
| 16 | op-power-start@.service \ |
| 17 | op-wait-power-on@.service \ |
| 18 | op-power-stop@.service \ |
| 19 | op-wait-power-off@.service \ |
Josh D. King | c41163a | 2017-05-18 09:33:36 -0500 | [diff] [blame] | 20 | op-reset-chassis-running@.service \ |
Andrew Geissler | 7dc1433 | 2017-03-07 13:47:23 -0600 | [diff] [blame] | 21 | op-reset-chassis-on@.service \ |
Brad Bishop | 0fe8046 | 2016-08-17 20:27:37 -0400 | [diff] [blame] | 22 | " |
| 23 | |
| 24 | SYSTEMD_ENVIRONMENT_FILE_${PN} += "obmc/power_control" |
| 25 | |
| 26 | START_TMPL = "op-power-start@.service" |
Josh D. King | b57615e | 2017-04-06 14:43:46 -0500 | [diff] [blame] | 27 | START_TGTFMT = "obmc-chassis-poweron@{1}.target" |
Brad Bishop | 0fe8046 | 2016-08-17 20:27:37 -0400 | [diff] [blame] | 28 | START_INSTFMT = "op-power-start@{0}.service" |
Andrew Geissler | a31fba5 | 2017-02-08 15:54:25 -0600 | [diff] [blame] | 29 | START_FMT = "../${START_TMPL}:${START_TGTFMT}.requires/${START_INSTFMT}" |
Brad Bishop | 0fe8046 | 2016-08-17 20:27:37 -0400 | [diff] [blame] | 30 | |
| 31 | STOP_TMPL = "op-power-stop@.service" |
Josh D. King | b57615e | 2017-04-06 14:43:46 -0500 | [diff] [blame] | 32 | STOP_TGTFMT = "obmc-chassis-poweroff@{1}.target" |
Brad Bishop | 0fe8046 | 2016-08-17 20:27:37 -0400 | [diff] [blame] | 33 | STOP_INSTFMT = "op-power-stop@{0}.service" |
Andrew Geissler | a31fba5 | 2017-02-08 15:54:25 -0600 | [diff] [blame] | 34 | STOP_FMT = "../${STOP_TMPL}:${STOP_TGTFMT}.requires/${STOP_INSTFMT}" |
Brad Bishop | 0fe8046 | 2016-08-17 20:27:37 -0400 | [diff] [blame] | 35 | |
| 36 | ON_TMPL = "op-wait-power-on@.service" |
| 37 | ON_INSTFMT = "op-wait-power-on@{0}.service" |
Andrew Geissler | a31fba5 | 2017-02-08 15:54:25 -0600 | [diff] [blame] | 38 | ON_FMT = "../${ON_TMPL}:${START_TGTFMT}.requires/${ON_INSTFMT}" |
Brad Bishop | 0fe8046 | 2016-08-17 20:27:37 -0400 | [diff] [blame] | 39 | |
Andrew Geissler | e2be4bb | 2016-12-19 09:05:39 -0600 | [diff] [blame] | 40 | OFF_TMPL = "op-wait-power-off@.service" |
Brad Bishop | 0fe8046 | 2016-08-17 20:27:37 -0400 | [diff] [blame] | 41 | OFF_INSTFMT = "op-wait-power-off@{0}.service" |
Andrew Geissler | a31fba5 | 2017-02-08 15:54:25 -0600 | [diff] [blame] | 42 | OFF_FMT = "../${OFF_TMPL}:${STOP_TGTFMT}.requires/${OFF_INSTFMT}" |
Brad Bishop | 0fe8046 | 2016-08-17 20:27:37 -0400 | [diff] [blame] | 43 | |
Andrew Geissler | bc253aa | 2017-05-09 15:24:41 -0500 | [diff] [blame] | 44 | RESET_TGTFMT = "obmc-chassis-powerreset@{1}.target" |
Andrew Geissler | 997ed66 | 2017-03-05 20:36:50 -0600 | [diff] [blame] | 45 | |
Josh D. King | c41163a | 2017-05-18 09:33:36 -0500 | [diff] [blame] | 46 | RESET_ON_TMPL = "op-reset-chassis-running@.service" |
| 47 | RESET_ON_INSTFMT = "op-reset-chassis-running@{0}.service" |
Andrew Geissler | 997ed66 | 2017-03-05 20:36:50 -0600 | [diff] [blame] | 48 | RESET_ON_FMT = "../${RESET_ON_TMPL}:${RESET_TGTFMT}.requires/${RESET_ON_INSTFMT}" |
| 49 | |
Andrew Geissler | 7dc1433 | 2017-03-07 13:47:23 -0600 | [diff] [blame] | 50 | RESET_ON_CHASSIS_TMPL = "op-reset-chassis-on@.service" |
| 51 | RESET_ON_CHASSIS_INSTFMT = "op-reset-chassis-on@{0}.service" |
| 52 | RESET_ON_CHASSIS_FMT = "../${RESET_ON_CHASSIS_TMPL}:${RESET_TGTFMT}.requires/${RESET_ON_CHASSIS_INSTFMT}" |
| 53 | |
Andrew Geissler | a31fba5 | 2017-02-08 15:54:25 -0600 | [diff] [blame] | 54 | # Build up requires relationship for START_TGTFMT and STOP_TGTFMT |
Brad Bishop | 0fe8046 | 2016-08-17 20:27:37 -0400 | [diff] [blame] | 55 | SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'START_FMT', 'OBMC_POWER_INSTANCES', 'OBMC_CHASSIS_INSTANCES')}" |
| 56 | SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'STOP_FMT', 'OBMC_POWER_INSTANCES', 'OBMC_CHASSIS_INSTANCES')}" |
| 57 | SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'ON_FMT', 'OBMC_POWER_INSTANCES', 'OBMC_CHASSIS_INSTANCES')}" |
| 58 | SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'OFF_FMT', 'OBMC_POWER_INSTANCES', 'OBMC_CHASSIS_INSTANCES')}" |
Andrew Geissler | 997ed66 | 2017-03-05 20:36:50 -0600 | [diff] [blame] | 59 | SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'RESET_ON_FMT', 'OBMC_POWER_INSTANCES', 'OBMC_CHASSIS_INSTANCES')}" |
Andrew Geissler | 7dc1433 | 2017-03-07 13:47:23 -0600 | [diff] [blame] | 60 | SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'RESET_ON_CHASSIS_FMT', 'OBMC_POWER_INSTANCES', 'OBMC_CHASSIS_INSTANCES')}" |
Andrew Geissler | 44761d2 | 2017-01-23 14:40:26 -0600 | [diff] [blame] | 61 | |
Andrew Geissler | a31fba5 | 2017-02-08 15:54:25 -0600 | [diff] [blame] | 62 | # Now show that the main control target requires these power targets |
Josh D. King | b57615e | 2017-04-06 14:43:46 -0500 | [diff] [blame] | 63 | START_TMPL_CTRL = "obmc-chassis-poweron@.target" |
Josh D. King | a283e07 | 2017-04-06 15:56:37 -0500 | [diff] [blame] | 64 | START_TGTFMT_CTRL = "obmc-host-start@{1}.target" |
Josh D. King | b57615e | 2017-04-06 14:43:46 -0500 | [diff] [blame] | 65 | START_INSTFMT_CTRL = "obmc-chassis-poweron@{0}.target" |
Andrew Geissler | a31fba5 | 2017-02-08 15:54:25 -0600 | [diff] [blame] | 66 | START_FMT_CTRL = "../${START_TMPL_CTRL}:${START_TGTFMT_CTRL}.requires/${START_INSTFMT_CTRL}" |
Andrew Geissler | fb7fa82 | 2017-01-26 08:07:15 -0600 | [diff] [blame] | 67 | SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'START_FMT_CTRL', 'OBMC_POWER_INSTANCES', 'OBMC_CHASSIS_INSTANCES')}" |
Andrew Geissler | 44761d2 | 2017-01-23 14:40:26 -0600 | [diff] [blame] | 68 | |
Andrew Geissler | 4a0f332 | 2017-07-20 10:28:34 -0500 | [diff] [blame] | 69 | # Chassis off requires host off |
| 70 | STOP_TMPL_CTRL = "obmc-host-stop@.target" |
| 71 | STOP_TGTFMT_CTRL = "obmc-chassis-poweroff@{0}.target" |
| 72 | STOP_INSTFMT_CTRL = "obmc-host-stop@{1}.target" |
Andrew Geissler | a31fba5 | 2017-02-08 15:54:25 -0600 | [diff] [blame] | 73 | STOP_FMT_CTRL = "../${STOP_TMPL_CTRL}:${STOP_TGTFMT_CTRL}.requires/${STOP_INSTFMT_CTRL}" |
Andrew Geissler | 4a0f332 | 2017-07-20 10:28:34 -0500 | [diff] [blame] | 74 | SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'STOP_FMT_CTRL', 'OBMC_CHASSIS_INSTANCES', 'OBMC_HOST_INSTANCES')}" |
| 75 | |
| 76 | # Hard power off requires chassis off |
| 77 | HARD_OFF_TMPL_CTRL = "obmc-chassis-poweroff@.target" |
| 78 | HARD_OFF_TGTFMT_CTRL = "obmc-chassis-hard-poweroff@{0}.target" |
| 79 | HARD_OFF_INSTFMT_CTRL = "obmc-chassis-poweroff@{0}.target" |
| 80 | HARD_OFF_FMT_CTRL = "../${HARD_OFF_TMPL_CTRL}:${HARD_OFF_TGTFMT_CTRL}.requires/${HARD_OFF_INSTFMT_CTRL}" |
| 81 | SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'HARD_OFF_FMT_CTRL', 'OBMC_CHASSIS_INSTANCES')}" |
Andrew Geissler | 7dc1433 | 2017-03-07 13:47:23 -0600 | [diff] [blame] | 82 | |
| 83 | # Force the standby target to run the chassis reset check target |
Andrew Geissler | bc253aa | 2017-05-09 15:24:41 -0500 | [diff] [blame] | 84 | RESET_TMPL_CTRL = "obmc-chassis-powerreset@.target" |
Andrew Geissler | 7dc1433 | 2017-03-07 13:47:23 -0600 | [diff] [blame] | 85 | SYSD_TGT = "${SYSTEMD_DEFAULT_TARGET}" |
Andrew Geissler | bc253aa | 2017-05-09 15:24:41 -0500 | [diff] [blame] | 86 | RESET_INSTFMT_CTRL = "obmc-chassis-powerreset@{0}.target" |
Andrew Geissler | 7dc1433 | 2017-03-07 13:47:23 -0600 | [diff] [blame] | 87 | RESET_FMT_CTRL = "../${RESET_TMPL_CTRL}:${SYSD_TGT}.wants/${RESET_INSTFMT_CTRL}" |
| 88 | SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'RESET_FMT_CTRL', 'OBMC_CHASSIS_INSTANCES')}" |