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