meta-romulus: Add cpld_reset on power off
Reset CPLD trigger so that it waits after VDD is powered up.
Change-Id: Ide5ac98547b31a29fdcf3ac73d8a6f16ee62848e
Signed-off-by: Lei YU <mine260309@gmail.com>
diff --git a/meta-ibm/meta-romulus/recipes-phosphor/chassis/cpld-trigger.bb b/meta-ibm/meta-romulus/recipes-phosphor/chassis/cpld-trigger.bb
index 542bd94..41ff1f6 100644
--- a/meta-ibm/meta-romulus/recipes-phosphor/chassis/cpld-trigger.bb
+++ b/meta-ibm/meta-romulus/recipes-phosphor/chassis/cpld-trigger.bb
@@ -11,18 +11,26 @@
RPROVIDES_${PN} += 'virtual-p9-vcs-workaround'
S = "${WORKDIR}"
-SRC_URI += "file://cpld_trigger.sh"
+SRC_URI += "file://cpld_trigger.sh \
+ file://cpld_reset.sh"
do_install() {
install -d ${D}${bindir}
install -m 0755 ${WORKDIR}/cpld_trigger.sh ${D}${bindir}/cpld_trigger.sh
+ install -m 0755 ${WORKDIR}/cpld_reset.sh ${D}${bindir}/cpld_reset.sh
}
TMPL = "cpld_trigger@.service"
+TMPL_RESET = "cpld_reset@.service"
INSTFMT = "cpld_trigger@{0}.service"
+INSTFMT_RESET = "cpld_reset@{0}.service"
TGTFMT = "obmc-power-chassis-on@{0}.target"
+TGTFMT_RESET = "obmc-power-chassis-off@{0}.target"
FMT = "../${TMPL}:${TGTFMT}.wants/${INSTFMT}"
+FMT_RESET = "../${TMPL_RESET}:${TGTFMT_RESET}.wants/${INSTFMT_RESET}"
SYSTEMD_SERVICE_${PN} += "${TMPL}"
SYSTEMD_LINK_${PN} += "${@compose_list(d, 'FMT', 'OBMC_CHASSIS_INSTANCES')}"
+SYSTEMD_SERVICE_${PN} += "${TMPL_RESET}"
+SYSTEMD_LINK_${PN} += "${@compose_list(d, 'FMT_RESET', 'OBMC_CHASSIS_INSTANCES')}"