blob: f8e2954018e8d03a8bcad1cb9d7026137f0d446a [file] [log] [blame]
Tung Nguyen8f221bf2020-12-16 05:52:18 +00001SUMMARY = "Ampere Computing LLC Host Control Implementation"
2DESCRIPTION = "A host control implementation suitable for Ampere Computing LLC's systems"
3PR = "r1"
4LICENSE = "Apache-2.0"
5LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"
6
7inherit systemd
8inherit obmc-phosphor-systemd
9
10# For now, monitoring shutdown_ack and reboot_ack are the only usecases
11OBMC_HOST_MONITOR_INSTANCES = "shutdown_ack reboot_ack"
12SYSTEMD_ENVIRONMENT_FILE_${PN} +="obmc/gpio/shutdown_ack obmc/gpio/reboot_ack"
13
14S = "${WORKDIR}"
15
ThuBaNguyen98f43be2021-07-01 22:29:49 +070016SRC_URI = " \
Tung Nguyen8f221bf2020-12-16 05:52:18 +000017 file://ampere-host-reset.service \
18 file://ampere_power_util.sh \
Tung Nguyen8f221bf2020-12-16 05:52:18 +000019 file://ampere-chassis-poweron.service \
20 file://ampere-host-reset-ack.service \
21 file://ampere-host-force-reset.service \
22 file://ampere-host-power-cycle.service \
23 "
24
25DEPENDS = "systemd virtual/obmc-gpio-monitor"
26RDEPENDS_${PN} = "bash virtual/obmc-gpio-monitor"
27
28SYSTEMD_PACKAGES = "${PN}"
29SYSTEMD_SERVICE_${PN} = " \
Tung Nguyen8f221bf2020-12-16 05:52:18 +000030 ampere-host-reset.service \
Tung Nguyen8f221bf2020-12-16 05:52:18 +000031 ampere-chassis-poweron.service \
32 ampere-host-reset-ack.service \
33 ampere-host-force-reset.service \
34 ampere-host-power-cycle.service \
35 "
36# host power control
Tung Nguyen8f221bf2020-12-16 05:52:18 +000037# Force the power cycle target to run the ampere power cycle
38HOST_REBOOT_SVC = "ampere-host-power-cycle.service"
39HOST_REBOOT_SVC_TGTFMT = "obmc-host-reboot@{0}.target"
40HOST_REBOOT_SVC_FMT = "../${HOST_REBOOT_SVC}:${HOST_REBOOT_SVC_TGTFMT}.requires/${HOST_REBOOT_SVC}"
41SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'HOST_REBOOT_SVC_FMT', 'OBMC_HOST_INSTANCES')}"
42
43# overwrite the host reset to graceful reset
44HOST_WARM_REBOOT_SOFT_SVC = "ampere-host-reset.service"
45HOST_WARM_REBOOT_TGTFMT = "obmc-host-warm-reboot@{0}.target"
46HOST_WARM_REBOOT_SOFT_SVC_FMT = "../${HOST_WARM_REBOOT_SOFT_SVC}:${HOST_WARM_REBOOT_TGTFMT}.requires/${HOST_WARM_REBOOT_SOFT_SVC}"
47SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'HOST_WARM_REBOOT_SOFT_SVC_FMT', 'OBMC_HOST_INSTANCES')}"
48
49# overwrite force reboot
50HOST_WARM_REBOOT_FORCE_TGT = "ampere-host-force-reset.service"
51HOST_WARM_REBOOT_FORCE_TGTFMT = "obmc-host-force-warm-reboot@{0}.target"
52HOST_WARM_REBOOT_FORCE_TARGET_FMT = "../${HOST_WARM_REBOOT_FORCE_TGT}:${HOST_WARM_REBOOT_FORCE_TGTFMT}.requires/${HOST_WARM_REBOOT_FORCE_TGT}"
53SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'HOST_WARM_REBOOT_FORCE_TARGET_FMT', 'OBMC_HOST_INSTANCES')}"
54
55# chassis power control
56CHASSIS_POWERON_SVC = "ampere-chassis-poweron.service"
57CHASSIS_POWERON_TGTFMT = "obmc-chassis-poweron@{0}.target"
58CHASSIS_POWERON_FMT = "../${CHASSIS_POWERON_SVC}:${CHASSIS_POWERON_TGTFMT}.requires/${CHASSIS_POWERON_SVC}"
59SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'CHASSIS_POWERON_FMT', 'OBMC_CHASSIS_INSTANCES')}"
60
Tung Nguyen8f221bf2020-12-16 05:52:18 +000061TMPL = "phosphor-gpio-monitor@.service"
62INSTFMT = "phosphor-gpio-monitor@{0}.service"
63TGT = "multi-user.target"
64FMT = "../${TMPL}:${TGT}.requires/${INSTFMT}"
65SYSTEMD_LINK_${PN} += "${@compose_list(d, 'FMT', 'OBMC_HOST_MONITOR_INSTANCES')}"
66
67do_install() {
68 install -d ${D}/usr/sbin
69 install -m 0755 ${WORKDIR}/ampere_power_util.sh ${D}/${sbindir}/ampere_power_util.sh
70}
71