blob: 62b25b1f12eceff1cc19575353364ab389b8e34e [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 \
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
47TMPL = "phosphor-gpio-monitor@.service"
48INSTFMT = "phosphor-gpio-monitor@{0}.service"
49TGT = "multi-user.target"
50FMT = "../${TMPL}:${TGT}.requires/${INSTFMT}"
51
52SYSTEMD_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 "
63SYSTEMD_LINK:${PN} += "${@compose_list(d, 'FMT', 'AMPERE_MONITOR_INSTANCES')}"
64
65do_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}