Tung Nguyen | 8f221bf | 2020-12-16 05:52:18 +0000 | [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 | |
Thang Q. Nguyen | d57a5fb | 2022-02-18 05:57:04 +0000 | [diff] [blame] | 10 | RDEPENDS:${PN} = "bash" |
Tung Nguyen | 8f221bf | 2020-12-16 05:52:18 +0000 | [diff] [blame] | 11 | S = "${WORKDIR}" |
| 12 | |
ThuBaNguyen | 98f43be | 2021-07-01 22:29:49 +0700 | [diff] [blame] | 13 | SRC_URI = " \ |
Thang Q. Nguyen | d57a5fb | 2022-02-18 05:57:04 +0000 | [diff] [blame] | 14 | file://ampere-host-force-reset@.service \ |
| 15 | file://ampere-host-on-host-check@.service \ |
| 16 | file://ampere_host_check.sh \ |
Thu Nguyen | 6c188d6 | 2022-08-29 09:46:09 +0700 | [diff] [blame] | 17 | file://obmc-power-already-on@.target \ |
| 18 | file://obmc-host-already-on@.target \ |
| 19 | file://ampere-bmc-reboot-host-check@.service \ |
Tung Nguyen | 8f221bf | 2020-12-16 05:52:18 +0000 | [diff] [blame] | 20 | " |
| 21 | |
Tung Nguyen | 8f221bf | 2020-12-16 05:52:18 +0000 | [diff] [blame] | 22 | SYSTEMD_PACKAGES = "${PN}" |
Thang Q. Nguyen | fa1aa4d | 2021-08-07 05:09:50 +0000 | [diff] [blame] | 23 | SYSTEMD_SERVICE:${PN} = " \ |
Thang Q. Nguyen | d57a5fb | 2022-02-18 05:57:04 +0000 | [diff] [blame] | 24 | ampere-host-force-reset@.service \ |
Thu Nguyen | 6c188d6 | 2022-08-29 09:46:09 +0700 | [diff] [blame] | 25 | obmc-power-already-on@.target \ |
| 26 | obmc-host-already-on@.target \ |
| 27 | ampere-bmc-reboot-host-check@.service \ |
Thang Q. Nguyen | d57a5fb | 2022-02-18 05:57:04 +0000 | [diff] [blame] | 28 | " |
Tung Nguyen | 8f221bf | 2020-12-16 05:52:18 +0000 | [diff] [blame] | 29 | |
ThuBaNguyen | fb21478 | 2021-07-08 14:20:43 +0700 | [diff] [blame] | 30 | # append force reboot |
ThuBaNguyen | 2f95214 | 2021-07-05 13:32:26 +0700 | [diff] [blame] | 31 | HOST_WARM_REBOOT_FORCE_TGT = "ampere-host-force-reset@.service" |
ThuBaNguyen | fb21478 | 2021-07-08 14:20:43 +0700 | [diff] [blame] | 32 | HOST_WARM_REBOOT_FORCE_INSTMPL = "ampere-host-force-reset@{0}.service" |
Tung Nguyen | 8f221bf | 2020-12-16 05:52:18 +0000 | [diff] [blame] | 33 | HOST_WARM_REBOOT_FORCE_TGTFMT = "obmc-host-force-warm-reboot@{0}.target" |
ThuBaNguyen | fb21478 | 2021-07-08 14:20:43 +0700 | [diff] [blame] | 34 | HOST_WARM_REBOOT_FORCE_TARGET_FMT = "../${HOST_WARM_REBOOT_FORCE_TGT}:${HOST_WARM_REBOOT_FORCE_TGTFMT}.requires/${HOST_WARM_REBOOT_FORCE_INSTMPL}" |
Patrick Williams | e83c220 | 2021-09-01 16:17:33 -0500 | [diff] [blame] | 35 | SYSTEMD_LINK:${PN} += "${@compose_list_zip(d, 'HOST_WARM_REBOOT_FORCE_TARGET_FMT', 'OBMC_HOST_INSTANCES')}" |
Thang Q. Nguyen | fa1aa4d | 2021-08-07 05:09:50 +0000 | [diff] [blame] | 36 | SYSTEMD_SERVICE:${PN} += "${HOST_WARM_REBOOT_FORCE_TGT}" |
Tung Nguyen | 8f221bf | 2020-12-16 05:52:18 +0000 | [diff] [blame] | 37 | |
ThuBaNguyen | 7b45282 | 2021-06-06 14:36:07 +0700 | [diff] [blame] | 38 | HOST_ON_RESET_HOSTTMPL = "ampere-host-on-host-check@.service" |
| 39 | HOST_ON_RESET_HOSTINSTMPL = "ampere-host-on-host-check@{0}.service" |
| 40 | HOST_ON_RESET_HOSTTGTFMT = "obmc-host-startmin@{0}.target" |
| 41 | HOST_ON_RESET_HOSTFMT = "../${HOST_ON_RESET_HOSTTMPL}:${HOST_ON_RESET_HOSTTGTFMT}.requires/${HOST_ON_RESET_HOSTINSTMPL}" |
Patrick Williams | e83c220 | 2021-09-01 16:17:33 -0500 | [diff] [blame] | 42 | SYSTEMD_LINK:${PN} += "${@compose_list_zip(d, 'HOST_ON_RESET_HOSTFMT', 'OBMC_HOST_INSTANCES')}" |
Thang Q. Nguyen | fa1aa4d | 2021-08-07 05:09:50 +0000 | [diff] [blame] | 43 | SYSTEMD_SERVICE:${PN} += "${HOST_ON_RESET_HOSTTMPL}" |
Thang Q. Nguyen | d57a5fb | 2022-02-18 05:57:04 +0000 | [diff] [blame] | 44 | |
Thang Q. Nguyen | fa06f1f | 2022-12-09 09:03:53 +0700 | [diff] [blame] | 45 | # append on phosphor-wait-power-on |
Thu Nguyen | 6c188d6 | 2022-08-29 09:46:09 +0700 | [diff] [blame] | 46 | AMPERE_POWER_ON_TGT = "obmc-power-already-on@.target" |
| 47 | AMPERE_POWER_ON_INSTMPL = "obmc-power-already-on@{0}.target" |
Thang Q. Nguyen | fa06f1f | 2022-12-09 09:03:53 +0700 | [diff] [blame] | 48 | OP_WAIT_POWER_ON = "phosphor-wait-power-on@{0}.service" |
Thu Nguyen | 6c188d6 | 2022-08-29 09:46:09 +0700 | [diff] [blame] | 49 | AMPERE_POWER_ON_TARGET_FMT = "../${AMPERE_POWER_ON_TGT}:${OP_WAIT_POWER_ON}.wants/${AMPERE_POWER_ON_INSTMPL}" |
| 50 | SYSTEMD_LINK:${PN} += "${@compose_list_zip(d, 'AMPERE_POWER_ON_TARGET_FMT', 'OBMC_HOST_INSTANCES')}" |
| 51 | |
| 52 | # append on obmc-chassis-poweron but will start after phosphor-state-manager init |
| 53 | # host state as running |
| 54 | HOST_CHECK_BMC_REBOOT_HOSTTMPL = "ampere-bmc-reboot-host-check@.service" |
| 55 | HOST_CHECK_BMC_REBOOT_HOSTINSTMPL = "ampere-bmc-reboot-host-check@{0}.service" |
| 56 | HOST_CHECK_BMC_REBOOT_HOSTTGTFMT = "obmc-chassis-poweron@{0}.target" |
| 57 | HOST_CHECK_BMC_REBOOT_HOSTFMT = "../${HOST_CHECK_BMC_REBOOT_HOSTTMPL}:${HOST_CHECK_BMC_REBOOT_HOSTTGTFMT}.requires/${HOST_CHECK_BMC_REBOOT_HOSTINSTMPL}" |
| 58 | SYSTEMD_LINK:${PN} += "${@compose_list_zip(d, 'HOST_CHECK_BMC_REBOOT_HOSTFMT', 'OBMC_HOST_INSTANCES')}" |
| 59 | |
Thang Q. Nguyen | d57a5fb | 2022-02-18 05:57:04 +0000 | [diff] [blame] | 60 | do_install() { |
| 61 | install -d ${D}/usr/sbin |
| 62 | install -m 0755 ${WORKDIR}/ampere_host_check.sh ${D}/${sbindir}/ |
| 63 | } |