blob: eb9513b5b5974831e779b82d24cfd891333b3f21 [file] [log] [blame]
Brad Bishop86ee1cf2016-06-27 14:53:52 -04001SUMMARY = "org.openbmc.control.Power implemention for OpenPOWER"
2DESCRIPTION = "A power control implementation suitable for OpenPOWER systems."
3PR = "r1"
4
5inherit skeleton-gdbus
Brad Bishop0fe80462016-08-17 20:27:37 -04006inherit obmc-phosphor-dbus-service
7
Brad Bishop1122eb02016-10-05 20:10:23 -04008DEPENDS += "phosphor-mapper systemd"
Brad Bishopecd773d2016-08-31 23:43:19 -04009
Brad Bishop86ee1cf2016-06-27 14:53:52 -040010SKELETON_DIR = "op-pwrctl"
Brad Bishop0fe80462016-08-17 20:27:37 -040011
12FMT = "org.openbmc.control.Power@{0}.service"
13DBUS_SERVICE_${PN} += "${@compose_list(d, 'FMT', 'OBMC_POWER_INSTANCES')}"
14
15SYSTEMD_SERVICE_${PN} += " \
16 op-power-start@.service \
17 op-wait-power-on@.service \
18 op-power-stop@.service \
19 op-wait-power-off@.service \
20 "
21
22SYSTEMD_ENVIRONMENT_FILE_${PN} += "obmc/power_control"
23
24START_TMPL = "op-power-start@.service"
Andrew Geissler44761d22017-01-23 14:40:26 -060025START_TGTFMT = "obmc-power-chassis-on@{1}.target"
Brad Bishop0fe80462016-08-17 20:27:37 -040026START_INSTFMT = "op-power-start@{0}.service"
Andrew Geisslera31fba52017-02-08 15:54:25 -060027START_FMT = "../${START_TMPL}:${START_TGTFMT}.requires/${START_INSTFMT}"
Brad Bishop0fe80462016-08-17 20:27:37 -040028
29STOP_TMPL = "op-power-stop@.service"
Andrew Geissler44761d22017-01-23 14:40:26 -060030STOP_TGTFMT = "obmc-power-chassis-off@{1}.target"
Brad Bishop0fe80462016-08-17 20:27:37 -040031STOP_INSTFMT = "op-power-stop@{0}.service"
Andrew Geisslera31fba52017-02-08 15:54:25 -060032STOP_FMT = "../${STOP_TMPL}:${STOP_TGTFMT}.requires/${STOP_INSTFMT}"
Brad Bishop0fe80462016-08-17 20:27:37 -040033
34ON_TMPL = "op-wait-power-on@.service"
35ON_INSTFMT = "op-wait-power-on@{0}.service"
Andrew Geisslera31fba52017-02-08 15:54:25 -060036ON_FMT = "../${ON_TMPL}:${START_TGTFMT}.requires/${ON_INSTFMT}"
Brad Bishop0fe80462016-08-17 20:27:37 -040037
Andrew Geisslere2be4bb2016-12-19 09:05:39 -060038OFF_TMPL = "op-wait-power-off@.service"
Brad Bishop0fe80462016-08-17 20:27:37 -040039OFF_INSTFMT = "op-wait-power-off@{0}.service"
Andrew Geisslera31fba52017-02-08 15:54:25 -060040OFF_FMT = "../${OFF_TMPL}:${STOP_TGTFMT}.requires/${OFF_INSTFMT}"
Brad Bishop0fe80462016-08-17 20:27:37 -040041
Andrew Geisslera31fba52017-02-08 15:54:25 -060042# Build up requires relationship for START_TGTFMT and STOP_TGTFMT
Brad Bishop0fe80462016-08-17 20:27:37 -040043SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'START_FMT', 'OBMC_POWER_INSTANCES', 'OBMC_CHASSIS_INSTANCES')}"
44SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'STOP_FMT', 'OBMC_POWER_INSTANCES', 'OBMC_CHASSIS_INSTANCES')}"
45SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'ON_FMT', 'OBMC_POWER_INSTANCES', 'OBMC_CHASSIS_INSTANCES')}"
46SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'OFF_FMT', 'OBMC_POWER_INSTANCES', 'OBMC_CHASSIS_INSTANCES')}"
Andrew Geissler44761d22017-01-23 14:40:26 -060047
Andrew Geisslera31fba52017-02-08 15:54:25 -060048# Now show that the main control target requires these power targets
Andrew Geisslerfb7fa822017-01-26 08:07:15 -060049START_TMPL_CTRL = "obmc-power-chassis-on@.target"
50START_TGTFMT_CTRL = "obmc-chassis-start@{1}.target"
51START_INSTFMT_CTRL = "obmc-power-chassis-on@{0}.target"
Andrew Geisslera31fba52017-02-08 15:54:25 -060052START_FMT_CTRL = "../${START_TMPL_CTRL}:${START_TGTFMT_CTRL}.requires/${START_INSTFMT_CTRL}"
Andrew Geisslerfb7fa822017-01-26 08:07:15 -060053SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'START_FMT_CTRL', 'OBMC_POWER_INSTANCES', 'OBMC_CHASSIS_INSTANCES')}"
Andrew Geissler44761d22017-01-23 14:40:26 -060054
Andrew Geisslerfb7fa822017-01-26 08:07:15 -060055STOP_TMPL_CTRL = "obmc-power-chassis-off@.target"
56STOP_TGTFMT_CTRL = "obmc-chassis-stop@{1}.target"
57STOP_INSTFMT_CTRL = "obmc-power-chassis-off@{0}.target"
Andrew Geisslera31fba52017-02-08 15:54:25 -060058STOP_FMT_CTRL = "../${STOP_TMPL_CTRL}:${STOP_TGTFMT_CTRL}.requires/${STOP_INSTFMT_CTRL}"
Andrew Geisslerfb7fa822017-01-26 08:07:15 -060059SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'STOP_FMT_CTRL', 'OBMC_POWER_INSTANCES', 'OBMC_CHASSIS_INSTANCES')}"