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