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 \ |
Andrew Geissler | 997ed66 | 2017-03-05 20:36:50 -0600 | [diff] [blame] | 20 | op-reset-pgood-check@.service \ |
| 21 | op-reset-set-power-on@.service \ |
Andrew Geissler | 7dc1433 | 2017-03-07 13:47:23 -0600 | [diff] [blame] | 22 | op-reset-chassis-on@.service \ |
Brad Bishop | 0fe8046 | 2016-08-17 20:27:37 -0400 | [diff] [blame] | 23 | " |
| 24 | |
| 25 | SYSTEMD_ENVIRONMENT_FILE_${PN} += "obmc/power_control" |
| 26 | |
| 27 | START_TMPL = "op-power-start@.service" |
Andrew Geissler | 44761d2 | 2017-01-23 14:40:26 -0600 | [diff] [blame] | 28 | START_TGTFMT = "obmc-power-chassis-on@{1}.target" |
Brad Bishop | 0fe8046 | 2016-08-17 20:27:37 -0400 | [diff] [blame] | 29 | START_INSTFMT = "op-power-start@{0}.service" |
Andrew Geissler | a31fba5 | 2017-02-08 15:54:25 -0600 | [diff] [blame] | 30 | START_FMT = "../${START_TMPL}:${START_TGTFMT}.requires/${START_INSTFMT}" |
Brad Bishop | 0fe8046 | 2016-08-17 20:27:37 -0400 | [diff] [blame] | 31 | |
| 32 | STOP_TMPL = "op-power-stop@.service" |
Andrew Geissler | 44761d2 | 2017-01-23 14:40:26 -0600 | [diff] [blame] | 33 | STOP_TGTFMT = "obmc-power-chassis-off@{1}.target" |
Brad Bishop | 0fe8046 | 2016-08-17 20:27:37 -0400 | [diff] [blame] | 34 | STOP_INSTFMT = "op-power-stop@{0}.service" |
Andrew Geissler | a31fba5 | 2017-02-08 15:54:25 -0600 | [diff] [blame] | 35 | STOP_FMT = "../${STOP_TMPL}:${STOP_TGTFMT}.requires/${STOP_INSTFMT}" |
Brad Bishop | 0fe8046 | 2016-08-17 20:27:37 -0400 | [diff] [blame] | 36 | |
| 37 | ON_TMPL = "op-wait-power-on@.service" |
| 38 | ON_INSTFMT = "op-wait-power-on@{0}.service" |
Andrew Geissler | a31fba5 | 2017-02-08 15:54:25 -0600 | [diff] [blame] | 39 | ON_FMT = "../${ON_TMPL}:${START_TGTFMT}.requires/${ON_INSTFMT}" |
Brad Bishop | 0fe8046 | 2016-08-17 20:27:37 -0400 | [diff] [blame] | 40 | |
Andrew Geissler | e2be4bb | 2016-12-19 09:05:39 -0600 | [diff] [blame] | 41 | OFF_TMPL = "op-wait-power-off@.service" |
Brad Bishop | 0fe8046 | 2016-08-17 20:27:37 -0400 | [diff] [blame] | 42 | OFF_INSTFMT = "op-wait-power-off@{0}.service" |
Andrew Geissler | a31fba5 | 2017-02-08 15:54:25 -0600 | [diff] [blame] | 43 | OFF_FMT = "../${OFF_TMPL}:${STOP_TGTFMT}.requires/${OFF_INSTFMT}" |
Brad Bishop | 0fe8046 | 2016-08-17 20:27:37 -0400 | [diff] [blame] | 44 | |
Andrew Geissler | 997ed66 | 2017-03-05 20:36:50 -0600 | [diff] [blame] | 45 | RESET_TMPL = "op-reset-pgood-check@.service" |
| 46 | RESET_TGTFMT = "obmc-chassis-reset@{1}.target" |
| 47 | RESET_INSTFMT = "op-reset-pgood-check@{0}.service" |
| 48 | RESET_FMT = "../${RESET_TMPL}:${RESET_TGTFMT}.requires/${RESET_INSTFMT}" |
| 49 | |
| 50 | RESET_ON_TMPL = "op-reset-set-power-on@.service" |
| 51 | RESET_ON_INSTFMT = "op-reset-set-power-on@{0}.service" |
| 52 | RESET_ON_FMT = "../${RESET_ON_TMPL}:${RESET_TGTFMT}.requires/${RESET_ON_INSTFMT}" |
| 53 | |
Andrew Geissler | 7dc1433 | 2017-03-07 13:47:23 -0600 | [diff] [blame] | 54 | RESET_ON_CHASSIS_TMPL = "op-reset-chassis-on@.service" |
| 55 | RESET_ON_CHASSIS_INSTFMT = "op-reset-chassis-on@{0}.service" |
| 56 | RESET_ON_CHASSIS_FMT = "../${RESET_ON_CHASSIS_TMPL}:${RESET_TGTFMT}.requires/${RESET_ON_CHASSIS_INSTFMT}" |
| 57 | |
Andrew Geissler | a31fba5 | 2017-02-08 15:54:25 -0600 | [diff] [blame] | 58 | # Build up requires relationship for START_TGTFMT and STOP_TGTFMT |
Brad Bishop | 0fe8046 | 2016-08-17 20:27:37 -0400 | [diff] [blame] | 59 | SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'START_FMT', 'OBMC_POWER_INSTANCES', 'OBMC_CHASSIS_INSTANCES')}" |
| 60 | SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'STOP_FMT', 'OBMC_POWER_INSTANCES', 'OBMC_CHASSIS_INSTANCES')}" |
| 61 | SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'ON_FMT', 'OBMC_POWER_INSTANCES', 'OBMC_CHASSIS_INSTANCES')}" |
| 62 | 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] | 63 | SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'RESET_FMT', 'OBMC_POWER_INSTANCES', 'OBMC_CHASSIS_INSTANCES')}" |
| 64 | 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] | 65 | 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] | 66 | |
Andrew Geissler | a31fba5 | 2017-02-08 15:54:25 -0600 | [diff] [blame] | 67 | # Now show that the main control target requires these power targets |
Andrew Geissler | fb7fa82 | 2017-01-26 08:07:15 -0600 | [diff] [blame] | 68 | START_TMPL_CTRL = "obmc-power-chassis-on@.target" |
| 69 | START_TGTFMT_CTRL = "obmc-chassis-start@{1}.target" |
| 70 | START_INSTFMT_CTRL = "obmc-power-chassis-on@{0}.target" |
Andrew Geissler | a31fba5 | 2017-02-08 15:54:25 -0600 | [diff] [blame] | 71 | 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] | 72 | 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] | 73 | |
Andrew Geissler | fb7fa82 | 2017-01-26 08:07:15 -0600 | [diff] [blame] | 74 | STOP_TMPL_CTRL = "obmc-power-chassis-off@.target" |
| 75 | STOP_TGTFMT_CTRL = "obmc-chassis-stop@{1}.target" |
| 76 | STOP_INSTFMT_CTRL = "obmc-power-chassis-off@{0}.target" |
Andrew Geissler | a31fba5 | 2017-02-08 15:54:25 -0600 | [diff] [blame] | 77 | STOP_FMT_CTRL = "../${STOP_TMPL_CTRL}:${STOP_TGTFMT_CTRL}.requires/${STOP_INSTFMT_CTRL}" |
Andrew Geissler | 7dc1433 | 2017-03-07 13:47:23 -0600 | [diff] [blame] | 78 | SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'STOP_FMT_CTRL', 'OBMC_POWER_INSTANCES', 'OBMC_CHASSIS_INSTANCES')}" |
| 79 | |
| 80 | # Force the standby target to run the chassis reset check target |
| 81 | RESET_TMPL_CTRL = "obmc-chassis-reset@.target" |
| 82 | SYSD_TGT = "${SYSTEMD_DEFAULT_TARGET}" |
| 83 | RESET_INSTFMT_CTRL = "obmc-chassis-reset@{0}.target" |
| 84 | RESET_FMT_CTRL = "../${RESET_TMPL_CTRL}:${SYSD_TGT}.wants/${RESET_INSTFMT_CTRL}" |
| 85 | SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'RESET_FMT_CTRL', 'OBMC_CHASSIS_INSTANCES')}" |