blob: 2889517c43a550072c638d65174d54463c93a4ef [file] [log] [blame]
Thang Q. Nguyenbd7d6332021-12-06 10:18:21 +00001SUMMARY = "Ampere Computing LLC Host Gpio Handling"
2PR = "r1"
3LICENSE = "Apache-2.0"
4LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"
5
6inherit obmc-phosphor-systemd
7
8DEPENDS += "virtual/obmc-gpio-monitor"
9RDEPENDS:${PN} += "virtual/obmc-gpio-monitor"
10RDEPENDS:${PN} += "bash"
11
12SRC_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
19AMPERE_MONITOR_INSTANCES = " \
Thang Q. Nguyen33423792022-01-20 13:13:22 +000020 reboot_ack shutdown_ack id_button S0_scp_auth_failure \
Thang Q. Nguyenbd7d6332021-12-06 10:18:21 +000021 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
28SYSTEMD_ENVIRONMENT_FILE:${PN} +=" \
29 obmc/gpio/reboot_ack \
30 obmc/gpio/shutdown_ack \
Thang Q. Nguyenbd7d6332021-12-06 10:18:21 +000031 obmc/gpio/S0_scp_auth_failure \
32 obmc/gpio/S0_overtemp \
33 obmc/gpio/S0_hightemp_start \
34 obmc/gpio/S0_hightemp_stop \
35 obmc/gpio/S1_overtemp \
36 obmc/gpio/S1_hightemp_start \
37 obmc/gpio/S1_hightemp_stop \
38 obmc/gpio/S0_fault_alert_start \
39 obmc/gpio/S0_fault_alert_stop \
40 obmc/gpio/S1_fault_alert_start \
41 obmc/gpio/S1_fault_alert_stop \
42 obmc/gpio/PSU1_VIN_GOOD \
43 obmc/gpio/PSU2_VIN_GOOD \
44 "
45
46TMPL = "phosphor-gpio-monitor@.service"
47INSTFMT = "phosphor-gpio-monitor@{0}.service"
48TGT = "multi-user.target"
49FMT = "../${TMPL}:${TGT}.requires/${INSTFMT}"
50
51SYSTEMD_SERVICE:${PN} += " \
52 ampere-host-shutdown-ack@.service \
53 ampere_overtemp@.service \
54 ampere_hightemp_start@.service \
55 ampere_hightemp_stop@.service \
56 ampere_fault_led_start@.service \
57 ampere_fault_led_stop@.service \
58 psu_hotswap_reset@.service \
Thang Q. Nguyenbd7d6332021-12-06 10:18:21 +000059 ampere_scp_failover.service \
60 "
61SYSTEMD_LINK:${PN} += "${@compose_list(d, 'FMT', 'AMPERE_MONITOR_INSTANCES')}"
62
63do_install() {
64 install -d ${D}${sbindir}
65 install -m 0755 ${WORKDIR}/toggle_fault_led.sh ${D}${sbindir}/
66 install -m 0755 ${WORKDIR}/toggle_identify_led.sh ${D}${sbindir}/
67 install -m 0755 ${WORKDIR}/ampere_psu_reset_hotswap.sh ${D}${sbindir}/
68 install -m 0755 ${WORKDIR}/ampere_scp_failover.sh ${D}${sbindir}/
69}