blob: 2ca18a0bec70050b976223ef766c76e5039d3781 [file] [log] [blame]
Chanh Nguyencf71ae02021-06-11 17:05:38 +07001SUMMARY = "Ampere Computing LLC PSU Hot Swap Reseting application"
2PR = "r1"
3LICENSE = "Apache-2.0"
4LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"
5
6inherit obmc-phosphor-systemd
7inherit allarch
8
9DEPENDS += "virtual/obmc-gpio-monitor"
Thang Q. Nguyenfa1aa4d2021-08-07 05:09:50 +000010RDEPENDS:${PN} += "virtual/obmc-gpio-monitor"
Chanh Nguyencf71ae02021-06-11 17:05:38 +070011
12OBMC_PSU_MONITOR_INSTANCES = "PSU1_B25 PSU2_B25"
13
14# Copies config file having arguments for psu
15# via GPIO assertion
Thang Q. Nguyenca3e1d92021-08-12 10:21:36 +000016SYSTEMD_ENVIRONMENT_FILE_${PN} +="obmc/gpio/PSU1_B25 \
Chanh Nguyencf71ae02021-06-11 17:05:38 +070017 obmc/gpio/PSU2_B25 \
18 "
Thang Q. Nguyenfa1aa4d2021-08-07 05:09:50 +000019SYSTEMD_SERVICE:${PN} ?= "psu1_hotswap_reset.service psu2_hotswap_reset.service"
Chanh Nguyencf71ae02021-06-11 17:05:38 +070020
21SRC_URI += "file://ampere_psu_reset_hotswap.sh"
22
23do_install() {
Thang Q. Nguyenca3e1d92021-08-12 10:21:36 +000024 install -d ${D}${sbindir}
25 install -m 0755 ${WORKDIR}/ampere_psu_reset_hotswap.sh ${D}${sbindir}/
Chanh Nguyencf71ae02021-06-11 17:05:38 +070026}
27
28GPIO_MONITOR_TMPL = "phosphor-gpio-monitor@.service"
29GPIO_MONITOR_TGTFMT = "phosphor-gpio-monitor@{0}.service"
30TGT = "multi-user.target"
31PSU_MONITOR_FMT = "../${GPIO_MONITOR_TMPL}:${TGT}.requires/${GPIO_MONITOR_TGTFMT}"
Thang Q. Nguyenca3e1d92021-08-12 10:21:36 +000032SYSTEMD_LINK_${PN} += "${@compose_list(d, 'PSU_MONITOR_FMT', 'OBMC_PSU_MONITOR_INSTANCES', 'OBMC_HOST_INSTANCES')}"