Mohaimen Alsamarai | 82a11d8 | 2021-06-24 16:59:29 -0500 | [diff] [blame] | 1 | SUMMARY = "Ampere Computing LLC Host Control Implementation" |
| 2 | DESCRIPTION = "A host control implementation suitable for Ampere Computing LLC's systems" |
| 3 | PR = "r1" |
| 4 | LICENSE = "Apache-2.0" |
| 5 | LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10" |
| 6 | |
| 7 | inherit systemd |
| 8 | inherit obmc-phosphor-systemd |
| 9 | |
| 10 | S = "${WORKDIR}" |
| 11 | |
| 12 | SRC_URI = "file://ampere-host-shutdown.service \ |
Mohaimen Alsamarai | 82a11d8 | 2021-06-24 16:59:29 -0500 | [diff] [blame] | 13 | file://ampere_power_util.sh \ |
| 14 | file://ampere-chassis-poweroff.service \ |
| 15 | file://ampere-chassis-poweron.service \ |
Charles Boyer | 17b216a | 2021-08-27 16:09:03 -0500 | [diff] [blame] | 16 | file://ampere-chassis-powercycle.service \ |
Charles Boyer | 1c51ca5 | 2021-08-24 11:25:03 -0500 | [diff] [blame] | 17 | file://ampere-host-shutdown-ack.service \ |
Mohaimen Alsamarai | 82a11d8 | 2021-06-24 16:59:29 -0500 | [diff] [blame] | 18 | file://ampere-host-power-cycle.service \ |
Charles Boyer | ab61616 | 2021-12-06 13:56:23 -0600 | [diff] [blame] | 19 | file://ampere-host-reset.service \ |
Mohaimen Alsamarai | 82a11d8 | 2021-06-24 16:59:29 -0500 | [diff] [blame] | 20 | " |
| 21 | |
| 22 | DEPENDS = "systemd" |
Mohaimen Alsamarai | f59d017 | 2021-08-17 09:34:22 -0500 | [diff] [blame] | 23 | RDEPENDS:${PN} = "bash" |
Mohaimen Alsamarai | 82a11d8 | 2021-06-24 16:59:29 -0500 | [diff] [blame] | 24 | |
| 25 | SYSTEMD_PACKAGES = "${PN}" |
Mohaimen Alsamarai | f59d017 | 2021-08-17 09:34:22 -0500 | [diff] [blame] | 26 | SYSTEMD_SERVICE:${PN} = " \ |
Mohaimen Alsamarai | 82a11d8 | 2021-06-24 16:59:29 -0500 | [diff] [blame] | 27 | ampere-host-shutdown.service \ |
Mohaimen Alsamarai | 82a11d8 | 2021-06-24 16:59:29 -0500 | [diff] [blame] | 28 | ampere-chassis-poweroff.service \ |
| 29 | ampere-chassis-poweron.service \ |
Charles Boyer | 17b216a | 2021-08-27 16:09:03 -0500 | [diff] [blame] | 30 | ampere-chassis-powercycle.service \ |
Charles Boyer | 1c51ca5 | 2021-08-24 11:25:03 -0500 | [diff] [blame] | 31 | ampere-host-shutdown-ack.service \ |
Mohaimen Alsamarai | 82a11d8 | 2021-06-24 16:59:29 -0500 | [diff] [blame] | 32 | ampere-host-power-cycle.service \ |
Charles Boyer | ab61616 | 2021-12-06 13:56:23 -0600 | [diff] [blame] | 33 | ampere-host-reset.service \ |
Mohaimen Alsamarai | 82a11d8 | 2021-06-24 16:59:29 -0500 | [diff] [blame] | 34 | " |
| 35 | # host power control |
| 36 | # overwrite the host shutdown to graceful shutdown |
| 37 | HOST_SHUTDOWN_TMPL = "ampere-host-shutdown.service" |
| 38 | HOST_SHUTDOWN_TGTFMT = "obmc-host-shutdown@{0}.target" |
| 39 | HOST_SHUTDOWN_FMT = "../${HOST_SHUTDOWN_TMPL}:${HOST_SHUTDOWN_TGTFMT}.requires/${HOST_SHUTDOWN_TMPL}" |
Patrick Williams | e83c220 | 2021-09-01 16:17:33 -0500 | [diff] [blame] | 40 | SYSTEMD_LINK:${PN} += "${@compose_list_zip(d, 'HOST_SHUTDOWN_FMT', 'OBMC_HOST_INSTANCES')}" |
Mohaimen Alsamarai | 82a11d8 | 2021-06-24 16:59:29 -0500 | [diff] [blame] | 41 | |
| 42 | # Force the power cycle target to run the ampere power cycle |
| 43 | HOST_REBOOT_SVC = "ampere-host-power-cycle.service" |
| 44 | HOST_REBOOT_SVC_TGTFMT = "obmc-host-reboot@{0}.target" |
| 45 | HOST_REBOOT_SVC_FMT = "../${HOST_REBOOT_SVC}:${HOST_REBOOT_SVC_TGTFMT}.requires/${HOST_REBOOT_SVC}" |
Patrick Williams | e83c220 | 2021-09-01 16:17:33 -0500 | [diff] [blame] | 46 | SYSTEMD_LINK:${PN} += "${@compose_list_zip(d, 'HOST_REBOOT_SVC_FMT', 'OBMC_HOST_INSTANCES')}" |
Mohaimen Alsamarai | 82a11d8 | 2021-06-24 16:59:29 -0500 | [diff] [blame] | 47 | |
Mohaimen Alsamarai | 82a11d8 | 2021-06-24 16:59:29 -0500 | [diff] [blame] | 48 | # chassis power control |
| 49 | CHASSIS_POWERON_SVC = "ampere-chassis-poweron.service" |
| 50 | CHASSIS_POWERON_TGTFMT = "obmc-chassis-poweron@{0}.target" |
| 51 | CHASSIS_POWERON_FMT = "../${CHASSIS_POWERON_SVC}:${CHASSIS_POWERON_TGTFMT}.requires/${CHASSIS_POWERON_SVC}" |
Patrick Williams | e83c220 | 2021-09-01 16:17:33 -0500 | [diff] [blame] | 52 | SYSTEMD_LINK:${PN} += "${@compose_list_zip(d, 'CHASSIS_POWERON_FMT', 'OBMC_CHASSIS_INSTANCES')}" |
Mohaimen Alsamarai | 82a11d8 | 2021-06-24 16:59:29 -0500 | [diff] [blame] | 53 | |
| 54 | CHASSIS_POWEROFF_SVC = "ampere-chassis-poweroff.service" |
| 55 | CHASSIS_POWEROFF_TGTFMT = "obmc-chassis-poweroff@{0}.target" |
| 56 | CHASSIS_POWEROFF_FMT = "../${CHASSIS_POWEROFF_SVC}:${CHASSIS_POWEROFF_TGTFMT}.requires/${CHASSIS_POWEROFF_SVC}" |
Patrick Williams | e83c220 | 2021-09-01 16:17:33 -0500 | [diff] [blame] | 57 | SYSTEMD_LINK:${PN} += "${@compose_list_zip(d, 'CHASSIS_POWEROFF_FMT', 'OBMC_CHASSIS_INSTANCES')}" |
Mohaimen Alsamarai | 82a11d8 | 2021-06-24 16:59:29 -0500 | [diff] [blame] | 58 | |
Charles Boyer | 17b216a | 2021-08-27 16:09:03 -0500 | [diff] [blame] | 59 | CHASSIS_POWERCYCLE_SVC = "ampere-chassis-powercycle.service" |
| 60 | CHASSIS_POWERCYCLE_TGTFMT = "obmc-chassis-powercycle@{0}.target" |
| 61 | CHASSIS_POWERCYCLE_FMT = "../${CHASSIS_POWERCYCLE_SVC}:${CHASSIS_POWERCYCLE_TGTFMT}.requires/${CHASSIS_POWERCYCLE_SVC}" |
Charles Boyer | 6e1b218 | 2021-11-22 11:58:31 -0600 | [diff] [blame] | 62 | SYSTEMD_LINK:${PN} += "${@compose_list_zip(d, 'CHASSIS_POWERCYCLE_FMT', 'OBMC_CHASSIS_INSTANCES')}" |
Charles Boyer | 17b216a | 2021-08-27 16:09:03 -0500 | [diff] [blame] | 63 | |
Mohaimen Alsamarai | 82a11d8 | 2021-06-24 16:59:29 -0500 | [diff] [blame] | 64 | TMPL = "phosphor-gpio-monitor@.service" |
| 65 | INSTFMT = "phosphor-gpio-monitor@{0}.service" |
| 66 | TGT = "multi-user.target" |
| 67 | FMT = "../${TMPL}:${TGT}.requires/${INSTFMT}" |
Patrick Williams | e83c220 | 2021-09-01 16:17:33 -0500 | [diff] [blame] | 68 | SYSTEMD_LINK:${PN} += "${@compose_list(d, 'FMT', 'OBMC_HOST_MONITOR_INSTANCES')}" |
Mohaimen Alsamarai | 82a11d8 | 2021-06-24 16:59:29 -0500 | [diff] [blame] | 69 | |
| 70 | do_install() { |
Charles Boyer | 2adad36 | 2021-11-24 15:58:03 -0600 | [diff] [blame] | 71 | install -d ${D}${libexecdir}/${PN} |
| 72 | install -m 0755 ${WORKDIR}/ampere_power_util.sh ${D}${libexecdir}/${PN}/ampere_power_util.sh |
Mohaimen Alsamarai | 82a11d8 | 2021-06-24 16:59:29 -0500 | [diff] [blame] | 73 | } |