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 \ |
| 13 | file://ampere-host-reset.service \ |
| 14 | file://ampere_power_util.sh \ |
| 15 | file://ampere-chassis-poweroff.service \ |
| 16 | file://ampere-chassis-poweron.service \ |
Charles Boyer | 17b216a | 2021-08-27 16:09:03 -0500 | [diff] [blame] | 17 | file://ampere-chassis-powercycle.service \ |
Charles Boyer | 1c51ca5 | 2021-08-24 11:25:03 -0500 | [diff] [blame] | 18 | file://ampere-host-shutdown-ack.service \ |
Mohaimen Alsamarai | 82a11d8 | 2021-06-24 16:59:29 -0500 | [diff] [blame] | 19 | file://ampere-host-force-reset.service \ |
| 20 | file://ampere-host-power-cycle.service \ |
| 21 | " |
| 22 | |
| 23 | DEPENDS = "systemd" |
Mohaimen Alsamarai | f59d017 | 2021-08-17 09:34:22 -0500 | [diff] [blame] | 24 | RDEPENDS:${PN} = "bash" |
Mohaimen Alsamarai | 82a11d8 | 2021-06-24 16:59:29 -0500 | [diff] [blame] | 25 | |
| 26 | SYSTEMD_PACKAGES = "${PN}" |
Mohaimen Alsamarai | f59d017 | 2021-08-17 09:34:22 -0500 | [diff] [blame] | 27 | SYSTEMD_SERVICE:${PN} = " \ |
Mohaimen Alsamarai | 82a11d8 | 2021-06-24 16:59:29 -0500 | [diff] [blame] | 28 | ampere-host-shutdown.service \ |
| 29 | ampere-host-reset.service \ |
| 30 | ampere-chassis-poweroff.service \ |
| 31 | ampere-chassis-poweron.service \ |
Charles Boyer | 17b216a | 2021-08-27 16:09:03 -0500 | [diff] [blame] | 32 | ampere-chassis-powercycle.service \ |
Charles Boyer | 1c51ca5 | 2021-08-24 11:25:03 -0500 | [diff] [blame] | 33 | ampere-host-shutdown-ack.service \ |
Mohaimen Alsamarai | 82a11d8 | 2021-06-24 16:59:29 -0500 | [diff] [blame] | 34 | ampere-host-force-reset.service \ |
| 35 | ampere-host-power-cycle.service \ |
| 36 | " |
| 37 | # host power control |
| 38 | # overwrite the host shutdown to graceful shutdown |
| 39 | HOST_SHUTDOWN_TMPL = "ampere-host-shutdown.service" |
| 40 | HOST_SHUTDOWN_TGTFMT = "obmc-host-shutdown@{0}.target" |
| 41 | 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] | 42 | 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] | 43 | |
| 44 | # Force the power cycle target to run the ampere power cycle |
| 45 | HOST_REBOOT_SVC = "ampere-host-power-cycle.service" |
| 46 | HOST_REBOOT_SVC_TGTFMT = "obmc-host-reboot@{0}.target" |
| 47 | 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] | 48 | 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] | 49 | |
| 50 | # overwrite the host reset to graceful reset |
| 51 | HOST_WARM_REBOOT_SOFT_SVC = "ampere-host-reset.service" |
| 52 | HOST_WARM_REBOOT_TGTFMT = "obmc-host-warm-reboot@{0}.target" |
| 53 | HOST_WARM_REBOOT_SOFT_SVC_FMT = "../${HOST_WARM_REBOOT_SOFT_SVC}:${HOST_WARM_REBOOT_TGTFMT}.requires/${HOST_WARM_REBOOT_SOFT_SVC}" |
Patrick Williams | e83c220 | 2021-09-01 16:17:33 -0500 | [diff] [blame] | 54 | SYSTEMD_LINK:${PN} += "${@compose_list_zip(d, 'HOST_WARM_REBOOT_SOFT_SVC_FMT', 'OBMC_HOST_INSTANCES')}" |
Mohaimen Alsamarai | 82a11d8 | 2021-06-24 16:59:29 -0500 | [diff] [blame] | 55 | |
| 56 | # overwrite force reboot |
| 57 | HOST_WARM_REBOOT_FORCE_TGT = "ampere-host-force-reset.service" |
| 58 | HOST_WARM_REBOOT_FORCE_TGTFMT = "obmc-host-force-warm-reboot@{0}.target" |
| 59 | HOST_WARM_REBOOT_FORCE_TARGET_FMT = "../${HOST_WARM_REBOOT_FORCE_TGT}:${HOST_WARM_REBOOT_FORCE_TGTFMT}.requires/${HOST_WARM_REBOOT_FORCE_TGT}" |
Patrick Williams | e83c220 | 2021-09-01 16:17:33 -0500 | [diff] [blame] | 60 | SYSTEMD_LINK:${PN} += "${@compose_list_zip(d, 'HOST_WARM_REBOOT_FORCE_TARGET_FMT', 'OBMC_HOST_INSTANCES')}" |
Mohaimen Alsamarai | 82a11d8 | 2021-06-24 16:59:29 -0500 | [diff] [blame] | 61 | |
| 62 | # chassis power control |
| 63 | CHASSIS_POWERON_SVC = "ampere-chassis-poweron.service" |
| 64 | CHASSIS_POWERON_TGTFMT = "obmc-chassis-poweron@{0}.target" |
| 65 | 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] | 66 | 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] | 67 | |
| 68 | CHASSIS_POWEROFF_SVC = "ampere-chassis-poweroff.service" |
| 69 | CHASSIS_POWEROFF_TGTFMT = "obmc-chassis-poweroff@{0}.target" |
| 70 | 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] | 71 | 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] | 72 | |
Charles Boyer | 17b216a | 2021-08-27 16:09:03 -0500 | [diff] [blame] | 73 | CHASSIS_POWERCYCLE_SVC = "ampere-chassis-powercycle.service" |
| 74 | CHASSIS_POWERCYCLE_TGTFMT = "obmc-chassis-powercycle@{0}.target" |
| 75 | 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^] | 76 | 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] | 77 | |
Mohaimen Alsamarai | 82a11d8 | 2021-06-24 16:59:29 -0500 | [diff] [blame] | 78 | TMPL = "phosphor-gpio-monitor@.service" |
| 79 | INSTFMT = "phosphor-gpio-monitor@{0}.service" |
| 80 | TGT = "multi-user.target" |
| 81 | FMT = "../${TMPL}:${TGT}.requires/${INSTFMT}" |
Patrick Williams | e83c220 | 2021-09-01 16:17:33 -0500 | [diff] [blame] | 82 | SYSTEMD_LINK:${PN} += "${@compose_list(d, 'FMT', 'OBMC_HOST_MONITOR_INSTANCES')}" |
Mohaimen Alsamarai | 82a11d8 | 2021-06-24 16:59:29 -0500 | [diff] [blame] | 83 | |
| 84 | do_install() { |
| 85 | install -d ${D}/usr/sbin |
| 86 | install -m 0755 ${WORKDIR}/ampere_power_util.sh ${D}/${sbindir}/ampere_power_util.sh |
| 87 | } |