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 | |
Brad Bishop | 12e3d60 | 2016-10-05 20:10:23 -0400 | [diff] [blame] | 10 | DEPENDS += "phosphor-mapper 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-power-start@.service \ |
| 19 | op-wait-power-on@.service \ |
| 20 | op-power-stop@.service \ |
| 21 | op-wait-power-off@.service \ |
Josh D. King | f7de631 | 2017-05-18 09:33:36 -0500 | [diff] [blame] | 22 | op-reset-chassis-running@.service \ |
Andrew Geissler | 579c8e0 | 2017-03-07 13:47:23 -0600 | [diff] [blame] | 23 | op-reset-chassis-on@.service \ |
Matthew Barth | 253a5aa | 2018-01-10 09:16:28 -0600 | [diff] [blame] | 24 | op-powered-off@.service \ |
Brad Bishop | 1d525fa | 2016-08-17 20:27:37 -0400 | [diff] [blame] | 25 | " |
| 26 | |
Patrick Williams | e83c220 | 2021-09-01 16:17:33 -0500 | [diff] [blame] | 27 | SYSTEMD_ENVIRONMENT_FILE:${PN} += "obmc/power_control" |
Brad Bishop | 1d525fa | 2016-08-17 20:27:37 -0400 | [diff] [blame] | 28 | |
| 29 | START_TMPL = "op-power-start@.service" |
Josh D. King | b9ee536 | 2017-04-06 14:43:46 -0500 | [diff] [blame] | 30 | START_TGTFMT = "obmc-chassis-poweron@{1}.target" |
Brad Bishop | 1d525fa | 2016-08-17 20:27:37 -0400 | [diff] [blame] | 31 | START_INSTFMT = "op-power-start@{0}.service" |
Andrew Geissler | 3c35a8c | 2017-02-08 15:54:25 -0600 | [diff] [blame] | 32 | START_FMT = "../${START_TMPL}:${START_TGTFMT}.requires/${START_INSTFMT}" |
Brad Bishop | 1d525fa | 2016-08-17 20:27:37 -0400 | [diff] [blame] | 33 | |
| 34 | STOP_TMPL = "op-power-stop@.service" |
Josh D. King | b9ee536 | 2017-04-06 14:43:46 -0500 | [diff] [blame] | 35 | STOP_TGTFMT = "obmc-chassis-poweroff@{1}.target" |
Brad Bishop | 1d525fa | 2016-08-17 20:27:37 -0400 | [diff] [blame] | 36 | STOP_INSTFMT = "op-power-stop@{0}.service" |
Andrew Geissler | 3c35a8c | 2017-02-08 15:54:25 -0600 | [diff] [blame] | 37 | STOP_FMT = "../${STOP_TMPL}:${STOP_TGTFMT}.requires/${STOP_INSTFMT}" |
Brad Bishop | 1d525fa | 2016-08-17 20:27:37 -0400 | [diff] [blame] | 38 | |
Matthew Barth | 253a5aa | 2018-01-10 09:16:28 -0600 | [diff] [blame] | 39 | POWERED_OFF_TMPL = "op-powered-off@.service" |
| 40 | POWERED_OFF_INSTFMT = "op-powered-off@{0}.service" |
| 41 | POWERED_OFF_FMT = "../${POWERED_OFF_TMPL}:${STOP_TGTFMT}.requires/${POWERED_OFF_INSTFMT}" |
| 42 | |
Brad Bishop | 1d525fa | 2016-08-17 20:27:37 -0400 | [diff] [blame] | 43 | ON_TMPL = "op-wait-power-on@.service" |
| 44 | ON_INSTFMT = "op-wait-power-on@{0}.service" |
Andrew Geissler | 3c35a8c | 2017-02-08 15:54:25 -0600 | [diff] [blame] | 45 | ON_FMT = "../${ON_TMPL}:${START_TGTFMT}.requires/${ON_INSTFMT}" |
Brad Bishop | 1d525fa | 2016-08-17 20:27:37 -0400 | [diff] [blame] | 46 | |
Andrew Geissler | 9349072 | 2016-12-19 09:05:39 -0600 | [diff] [blame] | 47 | OFF_TMPL = "op-wait-power-off@.service" |
Brad Bishop | 1d525fa | 2016-08-17 20:27:37 -0400 | [diff] [blame] | 48 | OFF_INSTFMT = "op-wait-power-off@{0}.service" |
Andrew Geissler | 3c35a8c | 2017-02-08 15:54:25 -0600 | [diff] [blame] | 49 | OFF_FMT = "../${OFF_TMPL}:${STOP_TGTFMT}.requires/${OFF_INSTFMT}" |
Brad Bishop | 1d525fa | 2016-08-17 20:27:37 -0400 | [diff] [blame] | 50 | |
Andrew Geissler | dd08ef0 | 2017-05-09 15:24:41 -0500 | [diff] [blame] | 51 | RESET_TGTFMT = "obmc-chassis-powerreset@{1}.target" |
Andrew Geissler | e4577f6 | 2017-03-05 20:36:50 -0600 | [diff] [blame] | 52 | |
Josh D. King | f7de631 | 2017-05-18 09:33:36 -0500 | [diff] [blame] | 53 | RESET_ON_TMPL = "op-reset-chassis-running@.service" |
| 54 | RESET_ON_INSTFMT = "op-reset-chassis-running@{0}.service" |
Andrew Geissler | e4577f6 | 2017-03-05 20:36:50 -0600 | [diff] [blame] | 55 | RESET_ON_FMT = "../${RESET_ON_TMPL}:${RESET_TGTFMT}.requires/${RESET_ON_INSTFMT}" |
| 56 | |
Andrew Geissler | 579c8e0 | 2017-03-07 13:47:23 -0600 | [diff] [blame] | 57 | RESET_ON_CHASSIS_TMPL = "op-reset-chassis-on@.service" |
| 58 | RESET_ON_CHASSIS_INSTFMT = "op-reset-chassis-on@{0}.service" |
| 59 | RESET_ON_CHASSIS_FMT = "../${RESET_ON_CHASSIS_TMPL}:${RESET_TGTFMT}.requires/${RESET_ON_CHASSIS_INSTFMT}" |
| 60 | |
Andrew Geissler | 3c35a8c | 2017-02-08 15:54:25 -0600 | [diff] [blame] | 61 | # Build up requires relationship for START_TGTFMT and STOP_TGTFMT |
Patrick Williams | e83c220 | 2021-09-01 16:17:33 -0500 | [diff] [blame] | 62 | SYSTEMD_LINK:${PN} += "${@compose_list_zip(d, 'START_FMT', 'OBMC_POWER_INSTANCES', 'OBMC_CHASSIS_INSTANCES')}" |
| 63 | SYSTEMD_LINK:${PN} += "${@compose_list_zip(d, 'STOP_FMT', 'OBMC_POWER_INSTANCES', 'OBMC_CHASSIS_INSTANCES')}" |
| 64 | SYSTEMD_LINK:${PN} += "${@compose_list_zip(d, 'POWERED_OFF_FMT', 'OBMC_POWER_INSTANCES', 'OBMC_CHASSIS_INSTANCES')}" |
| 65 | SYSTEMD_LINK:${PN} += "${@compose_list_zip(d, 'ON_FMT', 'OBMC_POWER_INSTANCES', 'OBMC_CHASSIS_INSTANCES')}" |
| 66 | SYSTEMD_LINK:${PN} += "${@compose_list_zip(d, 'OFF_FMT', 'OBMC_POWER_INSTANCES', 'OBMC_CHASSIS_INSTANCES')}" |
| 67 | SYSTEMD_LINK:${PN} += "${@compose_list_zip(d, 'RESET_ON_FMT', 'OBMC_POWER_INSTANCES', 'OBMC_CHASSIS_INSTANCES')}" |
| 68 | SYSTEMD_LINK:${PN} += "${@compose_list_zip(d, 'RESET_ON_CHASSIS_FMT', 'OBMC_POWER_INSTANCES', 'OBMC_CHASSIS_INSTANCES')}" |
Andrew Geissler | d8819ed | 2017-01-23 14:40:26 -0600 | [diff] [blame] | 69 | |
Andrew Geissler | 3c35a8c | 2017-02-08 15:54:25 -0600 | [diff] [blame] | 70 | # Now show that the main control target requires these power targets |
Josh D. King | b9ee536 | 2017-04-06 14:43:46 -0500 | [diff] [blame] | 71 | START_TMPL_CTRL = "obmc-chassis-poweron@.target" |
Andrew Geissler | 5c76e0c | 2018-03-27 13:56:26 -0700 | [diff] [blame] | 72 | START_TGTFMT_CTRL = "obmc-host-startmin@{1}.target" |
Josh D. King | b9ee536 | 2017-04-06 14:43:46 -0500 | [diff] [blame] | 73 | START_INSTFMT_CTRL = "obmc-chassis-poweron@{0}.target" |
Andrew Geissler | 3c35a8c | 2017-02-08 15:54:25 -0600 | [diff] [blame] | 74 | 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] | 75 | 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] | 76 | |
Andrew Geissler | 191e1ff | 2017-07-20 10:28:34 -0500 | [diff] [blame] | 77 | # Chassis off requires host off |
| 78 | STOP_TMPL_CTRL = "obmc-host-stop@.target" |
| 79 | STOP_TGTFMT_CTRL = "obmc-chassis-poweroff@{0}.target" |
| 80 | STOP_INSTFMT_CTRL = "obmc-host-stop@{1}.target" |
Andrew Geissler | 3c35a8c | 2017-02-08 15:54:25 -0600 | [diff] [blame] | 81 | 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] | 82 | 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] | 83 | |
| 84 | # Hard power off requires chassis off |
| 85 | HARD_OFF_TMPL_CTRL = "obmc-chassis-poweroff@.target" |
| 86 | HARD_OFF_TGTFMT_CTRL = "obmc-chassis-hard-poweroff@{0}.target" |
| 87 | HARD_OFF_INSTFMT_CTRL = "obmc-chassis-poweroff@{0}.target" |
| 88 | 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] | 89 | 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] | 90 | |
| 91 | # Force the standby target to run the chassis reset check target |
Andrew Geissler | dd08ef0 | 2017-05-09 15:24:41 -0500 | [diff] [blame] | 92 | RESET_TMPL_CTRL = "obmc-chassis-powerreset@.target" |
Brad Bishop | fc81e38 | 2019-04-06 13:58:07 -0400 | [diff] [blame] | 93 | SYSD_TGT = "multi-user.target" |
Andrew Geissler | dd08ef0 | 2017-05-09 15:24:41 -0500 | [diff] [blame] | 94 | RESET_INSTFMT_CTRL = "obmc-chassis-powerreset@{0}.target" |
Andrew Geissler | 579c8e0 | 2017-03-07 13:47:23 -0600 | [diff] [blame] | 95 | RESET_FMT_CTRL = "../${RESET_TMPL_CTRL}:${SYSD_TGT}.wants/${RESET_INSTFMT_CTRL}" |
Patrick Williams | e83c220 | 2021-09-01 16:17:33 -0500 | [diff] [blame] | 96 | SYSTEMD_LINK:${PN} += "${@compose_list_zip(d, 'RESET_FMT_CTRL', 'OBMC_CHASSIS_INSTANCES')}" |