Gunnar Mills | e5b3860 | 2018-08-31 12:39:15 -0500 | [diff] [blame] | 1 | SUMMARY = "org.openbmc.control.Power implementation for OpenPOWER" |
Brad Bishop | 5f9be07 | 2016-06-27 14:53:52 -0400 | [diff] [blame] | 2 | DESCRIPTION = "A power control implementation suitable for OpenPOWER systems." |
| 3 | PR = "r1" |
Patrick Venture | 6eff7c0 | 2018-10-09 20:13:01 -0700 | [diff] [blame] | 4 | PV = "1.0+git${SRCPV}" |
Brad Bishop | 5f9be07 | 2016-06-27 14:53:52 -0400 | [diff] [blame] | 5 | |
| 6 | inherit skeleton-gdbus |
Brad Bishop | 1d525fa | 2016-08-17 20:27:37 -0400 | [diff] [blame] | 7 | inherit obmc-phosphor-dbus-service |
Saqib Khan | 02917df | 2017-11-13 10:47:54 -0600 | [diff] [blame] | 8 | inherit pkgconfig |
Brad Bishop | 1d525fa | 2016-08-17 20:27:37 -0400 | [diff] [blame] | 9 | |
Patrick Williams | 0450a02 | 2022-10-07 21:23:47 -0500 | [diff] [blame] | 10 | DEPENDS += "libmapper systemd" |
Brad Bishop | 860fcde | 2016-08-31 23:43:19 -0400 | [diff] [blame] | 11 | |
Brad Bishop | 5f9be07 | 2016-06-27 14:53:52 -0400 | [diff] [blame] | 12 | SKELETON_DIR = "op-pwrctl" |
Brad Bishop | 1d525fa | 2016-08-17 20:27:37 -0400 | [diff] [blame] | 13 | |
Jim Wright | 6277965 | 2022-02-09 12:44:14 -0600 | [diff] [blame] | 14 | OBMC_CONTROL_POWER_FMT ?= "org.openbmc.control.Power@{0}.service" |
| 15 | DBUS_SERVICE:${PN} += "${@compose_list(d, 'OBMC_CONTROL_POWER_FMT', 'OBMC_POWER_INSTANCES')}" |
Brad Bishop | 1d525fa | 2016-08-17 20:27:37 -0400 | [diff] [blame] | 16 | |
Patrick Williams | 12fc939 | 2021-08-06 09:16:53 -0500 | [diff] [blame] | 17 | SYSTEMD_SERVICE:${PN} += " \ |
Brad Bishop | 1d525fa | 2016-08-17 20:27:37 -0400 | [diff] [blame] | 18 | op-wait-power-on@.service \ |
Brad Bishop | 1d525fa | 2016-08-17 20:27:37 -0400 | [diff] [blame] | 19 | op-wait-power-off@.service \ |
| 20 | " |
| 21 | |
Patrick Williams | e83c220 | 2021-09-01 16:17:33 -0500 | [diff] [blame] | 22 | SYSTEMD_ENVIRONMENT_FILE:${PN} += "obmc/power_control" |
Brad Bishop | 1d525fa | 2016-08-17 20:27:37 -0400 | [diff] [blame] | 23 | |
Josh D. King | b9ee536 | 2017-04-06 14:43:46 -0500 | [diff] [blame] | 24 | START_TGTFMT = "obmc-chassis-poweron@{1}.target" |
Brad Bishop | 1d525fa | 2016-08-17 20:27:37 -0400 | [diff] [blame] | 25 | ON_TMPL = "op-wait-power-on@.service" |
| 26 | ON_INSTFMT = "op-wait-power-on@{0}.service" |
Andrew Geissler | 3c35a8c | 2017-02-08 15:54:25 -0600 | [diff] [blame] | 27 | ON_FMT = "../${ON_TMPL}:${START_TGTFMT}.requires/${ON_INSTFMT}" |
Brad Bishop | 1d525fa | 2016-08-17 20:27:37 -0400 | [diff] [blame] | 28 | |
Andrew Geissler | b5138ed | 2022-11-11 14:00:30 -0600 | [diff] [blame^] | 29 | STOP_TGTFMT = "obmc-chassis-poweroff@{1}.target" |
Andrew Geissler | 9349072 | 2016-12-19 09:05:39 -0600 | [diff] [blame] | 30 | OFF_TMPL = "op-wait-power-off@.service" |
Brad Bishop | 1d525fa | 2016-08-17 20:27:37 -0400 | [diff] [blame] | 31 | OFF_INSTFMT = "op-wait-power-off@{0}.service" |
Andrew Geissler | 3c35a8c | 2017-02-08 15:54:25 -0600 | [diff] [blame] | 32 | OFF_FMT = "../${OFF_TMPL}:${STOP_TGTFMT}.requires/${OFF_INSTFMT}" |
Brad Bishop | 1d525fa | 2016-08-17 20:27:37 -0400 | [diff] [blame] | 33 | |
Andrew Geissler | 3c35a8c | 2017-02-08 15:54:25 -0600 | [diff] [blame] | 34 | # Build up requires relationship for START_TGTFMT and STOP_TGTFMT |
Patrick Williams | e83c220 | 2021-09-01 16:17:33 -0500 | [diff] [blame] | 35 | SYSTEMD_LINK:${PN} += "${@compose_list_zip(d, 'ON_FMT', 'OBMC_POWER_INSTANCES', 'OBMC_CHASSIS_INSTANCES')}" |
| 36 | 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] | 37 | |
Andrew Geissler | 3c35a8c | 2017-02-08 15:54:25 -0600 | [diff] [blame] | 38 | # Now show that the main control target requires these power targets |
Josh D. King | b9ee536 | 2017-04-06 14:43:46 -0500 | [diff] [blame] | 39 | START_TMPL_CTRL = "obmc-chassis-poweron@.target" |
Andrew Geissler | 5c76e0c | 2018-03-27 13:56:26 -0700 | [diff] [blame] | 40 | START_TGTFMT_CTRL = "obmc-host-startmin@{1}.target" |
Josh D. King | b9ee536 | 2017-04-06 14:43:46 -0500 | [diff] [blame] | 41 | START_INSTFMT_CTRL = "obmc-chassis-poweron@{0}.target" |
Andrew Geissler | 3c35a8c | 2017-02-08 15:54:25 -0600 | [diff] [blame] | 42 | START_FMT_CTRL = "../${START_TMPL_CTRL}:${START_TGTFMT_CTRL}.requires/${START_INSTFMT_CTRL}" |
Patrick Williams | e83c220 | 2021-09-01 16:17:33 -0500 | [diff] [blame] | 43 | 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] | 44 | |
Andrew Geissler | 191e1ff | 2017-07-20 10:28:34 -0500 | [diff] [blame] | 45 | # Chassis off requires host off |
| 46 | STOP_TMPL_CTRL = "obmc-host-stop@.target" |
| 47 | STOP_TGTFMT_CTRL = "obmc-chassis-poweroff@{0}.target" |
| 48 | STOP_INSTFMT_CTRL = "obmc-host-stop@{1}.target" |
Andrew Geissler | 3c35a8c | 2017-02-08 15:54:25 -0600 | [diff] [blame] | 49 | STOP_FMT_CTRL = "../${STOP_TMPL_CTRL}:${STOP_TGTFMT_CTRL}.requires/${STOP_INSTFMT_CTRL}" |
Patrick Williams | e83c220 | 2021-09-01 16:17:33 -0500 | [diff] [blame] | 50 | SYSTEMD_LINK:${PN} += "${@compose_list_zip(d, 'STOP_FMT_CTRL', 'OBMC_CHASSIS_INSTANCES', 'OBMC_HOST_INSTANCES')}" |
Andrew Geissler | 191e1ff | 2017-07-20 10:28:34 -0500 | [diff] [blame] | 51 | |
| 52 | # Hard power off requires chassis off |
| 53 | HARD_OFF_TMPL_CTRL = "obmc-chassis-poweroff@.target" |
| 54 | HARD_OFF_TGTFMT_CTRL = "obmc-chassis-hard-poweroff@{0}.target" |
| 55 | HARD_OFF_INSTFMT_CTRL = "obmc-chassis-poweroff@{0}.target" |
| 56 | HARD_OFF_FMT_CTRL = "../${HARD_OFF_TMPL_CTRL}:${HARD_OFF_TGTFMT_CTRL}.requires/${HARD_OFF_INSTFMT_CTRL}" |
Patrick Williams | e83c220 | 2021-09-01 16:17:33 -0500 | [diff] [blame] | 57 | SYSTEMD_LINK:${PN} += "${@compose_list_zip(d, 'HARD_OFF_FMT_CTRL', 'OBMC_CHASSIS_INSTANCES')}" |
Andrew Geissler | 579c8e0 | 2017-03-07 13:47:23 -0600 | [diff] [blame] | 58 | |
| 59 | # Force the standby target to run the chassis reset check target |
Andrew Geissler | dd08ef0 | 2017-05-09 15:24:41 -0500 | [diff] [blame] | 60 | RESET_TMPL_CTRL = "obmc-chassis-powerreset@.target" |
Brad Bishop | fc81e38 | 2019-04-06 13:58:07 -0400 | [diff] [blame] | 61 | SYSD_TGT = "multi-user.target" |
Andrew Geissler | dd08ef0 | 2017-05-09 15:24:41 -0500 | [diff] [blame] | 62 | RESET_INSTFMT_CTRL = "obmc-chassis-powerreset@{0}.target" |
Andrew Geissler | 579c8e0 | 2017-03-07 13:47:23 -0600 | [diff] [blame] | 63 | RESET_FMT_CTRL = "../${RESET_TMPL_CTRL}:${SYSD_TGT}.wants/${RESET_INSTFMT_CTRL}" |
Patrick Williams | e83c220 | 2021-09-01 16:17:33 -0500 | [diff] [blame] | 64 | SYSTEMD_LINK:${PN} += "${@compose_list_zip(d, 'RESET_FMT_CTRL', 'OBMC_CHASSIS_INSTANCES')}" |