blob: 658063cbe69f290d683ab86874c2c0cb7c18b76b [file] [log] [blame]
Kuiying Wang8bce44a2018-11-10 09:06:17 +08001SUMMARY = "Power Control service for Intel based platform"
2DESCRIPTION = "Power Control service for Intel based platfrom"
3PR = "r1"
4PV = "1.0+git${SRCPV}"
5LICENSE = "Apache-2.0"
6LIC_FILES_CHKSUM = "file://LICENSE;md5=86d3f3a95c324c9479bd8986968f4327"
7
8S = "${WORKDIR}/git"
9SRC_URI += "git://github.com/openbmc/x86-power-control.git"
Andrew Geissler7d1b62a2019-02-15 16:50:45 +000010SRCREV = "6ce6ab45484d0dc89f82fe15db024da534c456c1"
Kuiying Wang8bce44a2018-11-10 09:06:17 +080011
12inherit cmake pkgconfig pythonnative systemd
13
Kuiying Wangfbcd11d2019-01-28 18:53:04 +080014SYSTEMD_SERVICE_${PN} += "xyz.openbmc_project.Chassis.Control.Power@.service"
Kuiying Wang8bce44a2018-11-10 09:06:17 +080015
16# Force the standby target to run these services
17SYSD_TGT = "${SYSTEMD_DEFAULT_TARGET}"
18
19POWER_TMPL_CTRL = "xyz.openbmc_project.Chassis.Control.Power@.service"
20#SYSD_TGT = "${SYSTEMD_DEFAULT_TARGET}"
21POWER_INSTFMT_CTRL = "xyz.openbmc_project.Chassis.Control.Power@{0}.service"
22POWER_FMT_CTRL = "../${POWER_TMPL_CTRL}:${SYSD_TGT}.wants/${POWER_INSTFMT_CTRL}"
23SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'POWER_FMT_CTRL', 'OBMC_HOST_INSTANCES')}"
24
25SYSTEMD_SERVICE_${PN} += " \
26 obmc-host-start@.target \
27 obmc-host-startmin@.target \
28 obmc-host-stop@.target \
29 obmc-host-reboot@.target \
30 obmc-chassis-poweroff@.target \
31 obmc-chassis-poweron@.target \
32 obmc-chassis-hard-poweroff@.target \
33 obmc-host-soft-reboot@.target \
34 obmc-host-warm-reset@.target \
35 obmc-chassis-powerreset@.target \
36 "
37
38RESET_TGTFMT = "obmc-chassis-powerreset@{0}.target"
39
40RESET_ON_TMPL = "op-reset-chassis-running@.service"
41RESET_ON_INSTFMT = "op-reset-chassis-running@{0}.service"
42RESET_ON_FMT = "../${RESET_ON_TMPL}:${RESET_TGTFMT}.requires/${RESET_ON_INSTFMT}"
43SYSTEMD_SERVICE_${PN} += "${RESET_ON_TMPL}"
44SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'RESET_ON_FMT', 'OBMC_CHASSIS_INSTANCES')}"
45
46RESET_ON_CHASSIS_TMPL = "op-reset-chassis-on@.service"
47RESET_ON_CHASSIS_INSTFMT = "op-reset-chassis-on@{0}.service"
48RESET_ON_CHASSIS_FMT = "../${RESET_ON_CHASSIS_TMPL}:${RESET_TGTFMT}.requires/${RESET_ON_CHASSIS_INSTFMT}"
49SYSTEMD_SERVICE_${PN} += "${RESET_ON_CHASSIS_TMPL}"
50SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'RESET_ON_CHASSIS_FMT', 'OBMC_CHASSIS_INSTANCES')}"
51
52# Force the standby target to run the chassis reset check target
53RESET_TMPL_CTRL = "obmc-chassis-powerreset@.target"
54SYSD_TGT = "${SYSTEMD_DEFAULT_TARGET}"
55RESET_INSTFMT_CTRL = "obmc-chassis-powerreset@{0}.target"
56RESET_FMT_CTRL = "../${RESET_TMPL_CTRL}:${SYSD_TGT}.wants/${RESET_INSTFMT_CTRL}"
57SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'RESET_FMT_CTRL', 'OBMC_CHASSIS_INSTANCES')}"
58
59START_TMPL = "intel-power-start@.service"
60START_TGTFMT = "obmc-chassis-poweron@{0}.target"
61START_INSTFMT = "intel-power-start@{0}.service"
62START_FMT = "../${START_TMPL}:${START_TGTFMT}.requires/${START_INSTFMT}"
63SYSTEMD_SERVICE_${PN} += "${START_TMPL}"
64
65STOP_TMPL = "intel-power-stop@.service"
66STOP_TGTFMT = "obmc-chassis-poweroff@{0}.target"
67STOP_INSTFMT = "intel-power-stop@{0}.service"
68STOP_FMT = "../${STOP_TMPL}:${STOP_TGTFMT}.requires/${STOP_INSTFMT}"
69SYSTEMD_SERVICE_${PN} += "${STOP_TMPL}"
70
71WARM_RESET_TMPL = "intel-power-warm-reset@.service"
72WARM_RESET_TGTFMT = "obmc-host-warm-reset@{0}.target"
73WARM_RESET_INSTFMT = "intel-power-warm-reset@{0}.service"
74WARM_RESET_FMT = "../${WARM_RESET_TMPL}:${WARM_RESET_TGTFMT}.requires/${WARM_RESET_INSTFMT}"
75SYSTEMD_SERVICE_${PN} += "${WARM_RESET_TMPL}"
76
77# Build up requires relationship for START_TGTFMT and STOP_TGTFMT
78SYSTEMD_LINK_${PN} += "${@compose_list(d, 'START_FMT', 'OBMC_CHASSIS_INSTANCES')}"
79SYSTEMD_LINK_${PN} += "${@compose_list(d, 'STOP_FMT', 'OBMC_CHASSIS_INSTANCES')}"
80SYSTEMD_LINK_${PN} += "${@compose_list(d, 'WARM_RESET_FMT', 'OBMC_CHASSIS_INSTANCES')}"
81
82#The main control target requires these power targets
83START_TMPL_CTRL = "obmc-chassis-poweron@.target"
84START_TGTFMT_CTRL = "obmc-host-startmin@{0}.target"
85START_INSTFMT_CTRL = "obmc-chassis-poweron@{0}.target"
86START_FMT_CTRL = "../${START_TMPL_CTRL}:${START_TGTFMT_CTRL}.requires/${START_INSTFMT_CTRL}"
87SYSTEMD_LINK_${PN} += "${@compose_list(d, 'START_FMT_CTRL', 'OBMC_CHASSIS_INSTANCES')}"
88
89# Chassis off requires host off
90STOP_TMPL_CTRL = "obmc-host-stop@.target"
91STOP_TGTFMT_CTRL = "obmc-chassis-poweroff@{0}.target"
92STOP_INSTFMT_CTRL = "obmc-host-stop@{0}.target"
93STOP_FMT_CTRL = "../${STOP_TMPL_CTRL}:${STOP_TGTFMT_CTRL}.requires/${STOP_INSTFMT_CTRL}"
94SYSTEMD_LINK_${PN} += "${@compose_list(d, 'STOP_FMT_CTRL', 'OBMC_CHASSIS_INSTANCES')}"
95
96# Hard power off requires chassis off
97HARD_OFF_TMPL_CTRL = "obmc-chassis-poweroff@.target"
98HARD_OFF_TGTFMT_CTRL = "obmc-chassis-hard-poweroff@{0}.target"
99HARD_OFF_INSTFMT_CTRL = "obmc-chassis-poweroff@{0}.target"
100HARD_OFF_FMT_CTRL = "../${HARD_OFF_TMPL_CTRL}:${HARD_OFF_TGTFMT_CTRL}.requires/${HARD_OFF_INSTFMT_CTRL}"
101SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'HARD_OFF_FMT_CTRL', 'OBMC_CHASSIS_INSTANCES')}"
102
103# Host soft reboot to run the shutdown target
104HOST_SHUTDOWN_TMPL = "obmc-host-shutdown@.target"
105HOST_SOFT_REBOOT_TMPL = "obmc-host-soft-reboot@.target"
106HOST_SOFT_REBOOT_TGTFMT = "obmc-host-soft-reboot@{0}.target"
107HOST_SHUTDOWN_INSTFMT = "obmc-host-shutdown@{0}.target"
108HOST_SOFT_REBOOT_FMT = "../${HOST_SHUTDOWN_TMPL}:${HOST_SOFT_REBOOT_TGTFMT}.requires/${HOST_SHUTDOWN_INSTFMT}"
109SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'HOST_SOFT_REBOOT_FMT', 'OBMC_HOST_INSTANCES')}"
110# And also to call the host startmin service
111HOST_SOFT_REBOOT_SVC = "phosphor-reboot-host@.service"
112HOST_SOFT_REBOOT_SVC_INST = "phosphor-reboot-host@{0}.service"
113HOST_SOFT_REBOOT_SVC_FMT = "../${HOST_SOFT_REBOOT_SVC}:${HOST_SOFT_REBOOT_TGTFMT}.requires/${HOST_SOFT_REBOOT_SVC_INST}"
114SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'HOST_SOFT_REBOOT_SVC_FMT', 'OBMC_HOST_INSTANCES')}"
115
116#Broadcast Host state
117PRE_HOST_START_TMPL = "obmc-send-signal-pre-host-start@.service"
118PRE_HOST_START_TGTFMT = "obmc-host-start-pre@{0}.target"
119PRE_HOST_START_INSTFMT = "obmc-send-signal-pre-host-start@{0}.service"
120PRE_HOST_START_FMT = "../${PRE_HOST_START_TMPL}:${PRE_HOST_START_TGTFMT}.requires/${PRE_HOST_START_INSTFMT}"
121SYSTEMD_SERVICE_${PN} += "${PRE_HOST_START_TMPL}"
122SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'PRE_HOST_START_FMT', 'OBMC_HOST_INSTANCES')}"
123
124POST_HOST_START_TMPL = "obmc-send-signal-post-host-start@.service"
125POST_HOST_START_TGTFMT = "obmc-host-started@{0}.target"
126POST_HOST_START_INSTFMT = "obmc-send-signal-post-host-start@{0}.service"
127POST_HOST_START_FMT = "../${POST_HOST_START_TMPL}:${POST_HOST_START_TGTFMT}.requires/${POST_HOST_START_INSTFMT}"
128SYSTEMD_SERVICE_${PN} += "${POST_HOST_START_TMPL}"
129SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'POST_HOST_START_FMT', 'OBMC_HOST_INSTANCES')}"
130
131HOST_STARTING_TMPL = "obmc-send-signal-host-starting@.service"
132HOST_STARTING_TGTFMT = "obmc-host-starting@{0}.target"
133HOST_STARTING_INSTFMT = "obmc-send-signal-host-starting@{0}.service"
134HOST_STARTING_FMT = "../${HOST_STARTING_TMPL}:${HOST_STARTING_TGTFMT}.requires/${HOST_STARTING_INSTFMT}"
135SYSTEMD_SERVICE_${PN} += "${HOST_STARTING_TMPL}"
136SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'HOST_STARTING_FMT', 'OBMC_HOST_INSTANCES')}"
137
138PRE_HOST_STOP_TMPL = "obmc-send-signal-pre-host-stop@.service"
139PRE_HOST_STOP_TGTFMT = "obmc-host-stop-pre@{0}.target"
140PRE_HOST_STOP_INSTFMT = "obmc-send-signal-pre-host-stop@{0}.service"
141PRE_HOST_STOP_FMT = "../${PRE_HOST_STOP_TMPL}:${PRE_HOST_STOP_TGTFMT}.requires/${PRE_HOST_STOP_INSTFMT}"
142SYSTEMD_SERVICE_${PN} += "${PRE_HOST_STOP_TMPL}"
143SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'PRE_HOST_STOP_FMT', 'OBMC_HOST_INSTANCES')}"
144
145POST_HOST_STOP_TMPL = "obmc-send-signal-post-host-stop@.service"
146POST_HOST_STOP_TGTFMT = "obmc-host-stopped@{0}.target"
147POST_HOST_STOP_INSTFMT = "obmc-send-signal-post-host-stop@{0}.service"
148POST_HOST_STOP_FMT = "../${POST_HOST_STOP_TMPL}:${POST_HOST_STOP_TGTFMT}.requires/${POST_HOST_STOP_INSTFMT}"
149SYSTEMD_SERVICE_${PN} += "${POST_HOST_STOP_TMPL}"
150SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'POST_HOST_STOP_FMT', 'OBMC_HOST_INSTANCES')}"
151
152HOST_STOPPING_TMPL = "obmc-send-signal-host-stopping@.service"
153HOST_STOPPING_TGTFMT = "obmc-host-stopping@{0}.target"
154HOST_STOPPING_INSTFMT = "obmc-send-signal-host-stopping@{0}.service"
155HOST_STOPPING_FMT = "../${HOST_STOPPING_TMPL}:${HOST_STOPPING_TGTFMT}.requires/${HOST_STOPPING_INSTFMT}"
156SYSTEMD_SERVICE_${PN} += "${HOST_STOPPING_TMPL}"
157SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'HOST_STOPPING_FMT', 'OBMC_HOST_INSTANCES')}"
158
159DEPENDS += " \
160 autoconf-archive-native \
161 boost \
162 systemd \
163 sdbusplus \
164 sdbusplus-native \
165 phosphor-dbus-interfaces \
166 phosphor-dbus-interfaces-native \
167 phosphor-logging \
168 "
169
170EXTRA_OECMAKE = " -DENABLE_GTEST=OFF "