Brad Bishop | 5f9be07 | 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 | 1d525fa | 2016-08-17 20:27:37 -0400 | [diff] [blame] | 6 | inherit obmc-phosphor-dbus-service |
| 7 | |
Brad Bishop | 12e3d60 | 2016-10-05 20:10:23 -0400 | [diff] [blame] | 8 | DEPENDS += "phosphor-mapper systemd" |
Brad Bishop | 860fcde | 2016-08-31 23:43:19 -0400 | [diff] [blame] | 9 | |
Brad Bishop | 5f9be07 | 2016-06-27 14:53:52 -0400 | [diff] [blame] | 10 | SKELETON_DIR = "op-pwrctl" |
Brad Bishop | 1d525fa | 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 \ |
| 20 | " |
| 21 | |
| 22 | SYSTEMD_ENVIRONMENT_FILE_${PN} += "obmc/power_control" |
| 23 | |
| 24 | START_TMPL = "op-power-start@.service" |
Andrew Geissler | d8819ed | 2017-01-23 14:40:26 -0600 | [diff] [blame] | 25 | START_TGTFMT = "obmc-power-chassis-on@{1}.target" |
Brad Bishop | 1d525fa | 2016-08-17 20:27:37 -0400 | [diff] [blame] | 26 | START_INSTFMT = "op-power-start@{0}.service" |
| 27 | START_FMT = "../${START_TMPL}:${START_TGTFMT}.wants/${START_INSTFMT}" |
| 28 | |
| 29 | STOP_TMPL = "op-power-stop@.service" |
Andrew Geissler | d8819ed | 2017-01-23 14:40:26 -0600 | [diff] [blame] | 30 | STOP_TGTFMT = "obmc-power-chassis-off@{1}.target" |
Brad Bishop | 1d525fa | 2016-08-17 20:27:37 -0400 | [diff] [blame] | 31 | STOP_INSTFMT = "op-power-stop@{0}.service" |
| 32 | STOP_FMT = "../${STOP_TMPL}:${STOP_TGTFMT}.wants/${STOP_INSTFMT}" |
| 33 | |
| 34 | ON_TMPL = "op-wait-power-on@.service" |
| 35 | ON_INSTFMT = "op-wait-power-on@{0}.service" |
| 36 | ON_FMT = "../${ON_TMPL}:${START_TGTFMT}.wants/${ON_INSTFMT}" |
| 37 | |
Andrew Geissler | 9349072 | 2016-12-19 09:05:39 -0600 | [diff] [blame] | 38 | OFF_TMPL = "op-wait-power-off@.service" |
Brad Bishop | 1d525fa | 2016-08-17 20:27:37 -0400 | [diff] [blame] | 39 | OFF_INSTFMT = "op-wait-power-off@{0}.service" |
| 40 | OFF_FMT = "../${OFF_TMPL}:${STOP_TGTFMT}.wants/${OFF_INSTFMT}" |
| 41 | |
Andrew Geissler | 2478d37 | 2017-01-26 08:07:15 -0600 | [diff] [blame^] | 42 | # Build up wants relationship for START_TGTFMT and STOP_TGTFMT |
Brad Bishop | 1d525fa | 2016-08-17 20:27:37 -0400 | [diff] [blame] | 43 | SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'START_FMT', 'OBMC_POWER_INSTANCES', 'OBMC_CHASSIS_INSTANCES')}" |
| 44 | SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'STOP_FMT', 'OBMC_POWER_INSTANCES', 'OBMC_CHASSIS_INSTANCES')}" |
| 45 | SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'ON_FMT', 'OBMC_POWER_INSTANCES', 'OBMC_CHASSIS_INSTANCES')}" |
| 46 | SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'OFF_FMT', 'OBMC_POWER_INSTANCES', 'OBMC_CHASSIS_INSTANCES')}" |
Andrew Geissler | d8819ed | 2017-01-23 14:40:26 -0600 | [diff] [blame] | 47 | |
Andrew Geissler | 2478d37 | 2017-01-26 08:07:15 -0600 | [diff] [blame^] | 48 | # Now show that the main control target wants these power targets |
| 49 | START_TMPL_CTRL = "obmc-power-chassis-on@.target" |
| 50 | START_TGTFMT_CTRL = "obmc-chassis-start@{1}.target" |
| 51 | START_INSTFMT_CTRL = "obmc-power-chassis-on@{0}.target" |
| 52 | START_FMT_CTRL = "../${START_TMPL_CTRL}:${START_TGTFMT_CTRL}.wants/${START_INSTFMT_CTRL}" |
| 53 | SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'START_FMT_CTRL', 'OBMC_POWER_INSTANCES', 'OBMC_CHASSIS_INSTANCES')}" |
Andrew Geissler | d8819ed | 2017-01-23 14:40:26 -0600 | [diff] [blame] | 54 | |
Andrew Geissler | 2478d37 | 2017-01-26 08:07:15 -0600 | [diff] [blame^] | 55 | STOP_TMPL_CTRL = "obmc-power-chassis-off@.target" |
| 56 | STOP_TGTFMT_CTRL = "obmc-chassis-stop@{1}.target" |
| 57 | STOP_INSTFMT_CTRL = "obmc-power-chassis-off@{0}.target" |
| 58 | STOP_FMT_CTRL = "../${STOP_TMPL_CTRL}:${STOP_TGTFMT_CTRL}.wants/${STOP_INSTFMT_CTRL}" |
| 59 | SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'STOP_FMT_CTRL', 'OBMC_POWER_INSTANCES', 'OBMC_CHASSIS_INSTANCES')}" |