Thang Q. Nguyen | bd7d633 | 2021-12-06 10:18:21 +0000 | [diff] [blame] | 1 | SUMMARY = "Ampere Computing LLC Host Gpio Handling" |
| 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 | |
| 8 | DEPENDS += "virtual/obmc-gpio-monitor" |
| 9 | RDEPENDS:${PN} += "virtual/obmc-gpio-monitor" |
| 10 | RDEPENDS:${PN} += "bash" |
| 11 | |
| 12 | SRC_URI += " \ |
| 13 | file://toggle_fault_led.sh \ |
| 14 | file://ampere_psu_reset_hotswap.sh \ |
| 15 | file://toggle_identify_led.sh \ |
| 16 | file://ampere_scp_failover.sh \ |
| 17 | " |
| 18 | |
| 19 | AMPERE_MONITOR_INSTANCES = " \ |
Thang Q. Nguyen | 3342379 | 2022-01-20 13:13:22 +0000 | [diff] [blame^] | 20 | reboot_ack shutdown_ack id_button S0_scp_auth_failure \ |
Thang Q. Nguyen | bd7d633 | 2021-12-06 10:18:21 +0000 | [diff] [blame] | 21 | S0_overtemp S0_hightemp_start S0_hightemp_stop \ |
| 22 | S1_overtemp S1_hightemp_start S1_hightemp_stop \ |
| 23 | S0_fault_alert_start S0_fault_alert_stop \ |
| 24 | S1_fault_alert_start S1_fault_alert_stop \ |
| 25 | PSU1_VIN_GOOD PSU2_VIN_GOOD \ |
| 26 | " |
| 27 | |
| 28 | SYSTEMD_ENVIRONMENT_FILE:${PN} +=" \ |
| 29 | obmc/gpio/reboot_ack \ |
| 30 | obmc/gpio/shutdown_ack \ |
| 31 | obmc/gpio/id_button \ |
| 32 | obmc/gpio/S0_scp_auth_failure \ |
| 33 | obmc/gpio/S0_overtemp \ |
| 34 | obmc/gpio/S0_hightemp_start \ |
| 35 | obmc/gpio/S0_hightemp_stop \ |
| 36 | obmc/gpio/S1_overtemp \ |
| 37 | obmc/gpio/S1_hightemp_start \ |
| 38 | obmc/gpio/S1_hightemp_stop \ |
| 39 | obmc/gpio/S0_fault_alert_start \ |
| 40 | obmc/gpio/S0_fault_alert_stop \ |
| 41 | obmc/gpio/S1_fault_alert_start \ |
| 42 | obmc/gpio/S1_fault_alert_stop \ |
| 43 | obmc/gpio/PSU1_VIN_GOOD \ |
| 44 | obmc/gpio/PSU2_VIN_GOOD \ |
| 45 | " |
| 46 | |
| 47 | TMPL = "phosphor-gpio-monitor@.service" |
| 48 | INSTFMT = "phosphor-gpio-monitor@{0}.service" |
| 49 | TGT = "multi-user.target" |
| 50 | FMT = "../${TMPL}:${TGT}.requires/${INSTFMT}" |
| 51 | |
| 52 | SYSTEMD_SERVICE:${PN} += " \ |
| 53 | ampere-host-shutdown-ack@.service \ |
| 54 | ampere_overtemp@.service \ |
| 55 | ampere_hightemp_start@.service \ |
| 56 | ampere_hightemp_stop@.service \ |
| 57 | ampere_fault_led_start@.service \ |
| 58 | ampere_fault_led_stop@.service \ |
| 59 | psu_hotswap_reset@.service \ |
| 60 | id-button-pressed.service \ |
| 61 | ampere_scp_failover.service \ |
| 62 | " |
| 63 | SYSTEMD_LINK:${PN} += "${@compose_list(d, 'FMT', 'AMPERE_MONITOR_INSTANCES')}" |
| 64 | |
| 65 | do_install() { |
| 66 | install -d ${D}${sbindir} |
| 67 | install -m 0755 ${WORKDIR}/toggle_fault_led.sh ${D}${sbindir}/ |
| 68 | install -m 0755 ${WORKDIR}/toggle_identify_led.sh ${D}${sbindir}/ |
| 69 | install -m 0755 ${WORKDIR}/ampere_psu_reset_hotswap.sh ${D}${sbindir}/ |
| 70 | install -m 0755 ${WORKDIR}/ampere_scp_failover.sh ${D}${sbindir}/ |
| 71 | } |