blob: 7c4fb2b238353eecec1c2dfa5921740b161c9bc8 [file] [log] [blame]
Brad Bishop5f9be072016-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 Bishop1d525fa2016-08-17 20:27:37 -04006inherit obmc-phosphor-dbus-service
7
Brad Bishop12e3d602016-10-05 20:10:23 -04008DEPENDS += "phosphor-mapper systemd"
Brad Bishop860fcde2016-08-31 23:43:19 -04009
Brad Bishop5f9be072016-06-27 14:53:52 -040010SKELETON_DIR = "op-pwrctl"
Brad Bishop1d525fa2016-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 \
Andrew Geisslere4577f62017-03-05 20:36:50 -060020 op-reset-pgood-check@.service \
21 op-reset-set-power-on@.service \
Brad Bishop1d525fa2016-08-17 20:27:37 -040022 "
23
24SYSTEMD_ENVIRONMENT_FILE_${PN} += "obmc/power_control"
25
26START_TMPL = "op-power-start@.service"
Andrew Geisslerd8819ed2017-01-23 14:40:26 -060027START_TGTFMT = "obmc-power-chassis-on@{1}.target"
Brad Bishop1d525fa2016-08-17 20:27:37 -040028START_INSTFMT = "op-power-start@{0}.service"
Andrew Geissler3c35a8c2017-02-08 15:54:25 -060029START_FMT = "../${START_TMPL}:${START_TGTFMT}.requires/${START_INSTFMT}"
Brad Bishop1d525fa2016-08-17 20:27:37 -040030
31STOP_TMPL = "op-power-stop@.service"
Andrew Geisslerd8819ed2017-01-23 14:40:26 -060032STOP_TGTFMT = "obmc-power-chassis-off@{1}.target"
Brad Bishop1d525fa2016-08-17 20:27:37 -040033STOP_INSTFMT = "op-power-stop@{0}.service"
Andrew Geissler3c35a8c2017-02-08 15:54:25 -060034STOP_FMT = "../${STOP_TMPL}:${STOP_TGTFMT}.requires/${STOP_INSTFMT}"
Brad Bishop1d525fa2016-08-17 20:27:37 -040035
36ON_TMPL = "op-wait-power-on@.service"
37ON_INSTFMT = "op-wait-power-on@{0}.service"
Andrew Geissler3c35a8c2017-02-08 15:54:25 -060038ON_FMT = "../${ON_TMPL}:${START_TGTFMT}.requires/${ON_INSTFMT}"
Brad Bishop1d525fa2016-08-17 20:27:37 -040039
Andrew Geissler93490722016-12-19 09:05:39 -060040OFF_TMPL = "op-wait-power-off@.service"
Brad Bishop1d525fa2016-08-17 20:27:37 -040041OFF_INSTFMT = "op-wait-power-off@{0}.service"
Andrew Geissler3c35a8c2017-02-08 15:54:25 -060042OFF_FMT = "../${OFF_TMPL}:${STOP_TGTFMT}.requires/${OFF_INSTFMT}"
Brad Bishop1d525fa2016-08-17 20:27:37 -040043
Andrew Geisslere4577f62017-03-05 20:36:50 -060044RESET_TMPL = "op-reset-pgood-check@.service"
45RESET_TGTFMT = "obmc-chassis-reset@{1}.target"
46RESET_INSTFMT = "op-reset-pgood-check@{0}.service"
47RESET_FMT = "../${RESET_TMPL}:${RESET_TGTFMT}.requires/${RESET_INSTFMT}"
48
49RESET_ON_TMPL = "op-reset-set-power-on@.service"
50RESET_ON_INSTFMT = "op-reset-set-power-on@{0}.service"
51RESET_ON_FMT = "../${RESET_ON_TMPL}:${RESET_TGTFMT}.requires/${RESET_ON_INSTFMT}"
52
Andrew Geissler3c35a8c2017-02-08 15:54:25 -060053# Build up requires relationship for START_TGTFMT and STOP_TGTFMT
Brad Bishop1d525fa2016-08-17 20:27:37 -040054SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'START_FMT', 'OBMC_POWER_INSTANCES', 'OBMC_CHASSIS_INSTANCES')}"
55SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'STOP_FMT', 'OBMC_POWER_INSTANCES', 'OBMC_CHASSIS_INSTANCES')}"
56SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'ON_FMT', 'OBMC_POWER_INSTANCES', 'OBMC_CHASSIS_INSTANCES')}"
57SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'OFF_FMT', 'OBMC_POWER_INSTANCES', 'OBMC_CHASSIS_INSTANCES')}"
Andrew Geisslere4577f62017-03-05 20:36:50 -060058SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'RESET_FMT', 'OBMC_POWER_INSTANCES', 'OBMC_CHASSIS_INSTANCES')}"
59SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'RESET_ON_FMT', 'OBMC_POWER_INSTANCES', 'OBMC_CHASSIS_INSTANCES')}"
Andrew Geisslerd8819ed2017-01-23 14:40:26 -060060
Andrew Geissler3c35a8c2017-02-08 15:54:25 -060061# Now show that the main control target requires these power targets
Andrew Geissler2478d372017-01-26 08:07:15 -060062START_TMPL_CTRL = "obmc-power-chassis-on@.target"
63START_TGTFMT_CTRL = "obmc-chassis-start@{1}.target"
64START_INSTFMT_CTRL = "obmc-power-chassis-on@{0}.target"
Andrew Geissler3c35a8c2017-02-08 15:54:25 -060065START_FMT_CTRL = "../${START_TMPL_CTRL}:${START_TGTFMT_CTRL}.requires/${START_INSTFMT_CTRL}"
Andrew Geissler2478d372017-01-26 08:07:15 -060066SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'START_FMT_CTRL', 'OBMC_POWER_INSTANCES', 'OBMC_CHASSIS_INSTANCES')}"
Andrew Geisslerd8819ed2017-01-23 14:40:26 -060067
Andrew Geissler2478d372017-01-26 08:07:15 -060068STOP_TMPL_CTRL = "obmc-power-chassis-off@.target"
69STOP_TGTFMT_CTRL = "obmc-chassis-stop@{1}.target"
70STOP_INSTFMT_CTRL = "obmc-power-chassis-off@{0}.target"
Andrew Geissler3c35a8c2017-02-08 15:54:25 -060071STOP_FMT_CTRL = "../${STOP_TMPL_CTRL}:${STOP_TGTFMT_CTRL}.requires/${STOP_INSTFMT_CTRL}"
Andrew Geissler2478d372017-01-26 08:07:15 -060072SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'STOP_FMT_CTRL', 'OBMC_POWER_INSTANCES', 'OBMC_CHASSIS_INSTANCES')}"