summaryrefslogtreecommitdiffstats
path: root/meta-openbmc-machines
diff options
context:
space:
mode:
authorLei YU <mine260309@gmail.com>2017-02-14 20:41:35 +0800
committerPatrick Williams <patrick@stwcx.xyz>2017-02-24 16:55:43 +0000
commitec642c44cc62166de182b62dec51919999a3a97e (patch)
treefb1561482e010e0e8c524f1aaf67bb77a02995e0 /meta-openbmc-machines
parentd97f2cb302f209e79ba2f8cd5ef807269f6d146d (diff)
downloadtalos-openbmc-ec642c44cc62166de182b62dec51919999a3a97e.tar.gz
talos-openbmc-ec642c44cc62166de182b62dec51919999a3a97e.zip
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>
Diffstat (limited to 'meta-openbmc-machines')
-rw-r--r--meta-openbmc-machines/meta-openpower/meta-ibm/meta-romulus/recipes-phosphor/chassis/cpld-trigger.bb10
-rw-r--r--meta-openbmc-machines/meta-openpower/meta-ibm/meta-romulus/recipes-phosphor/chassis/cpld-trigger/cpld_reset.sh4
-rw-r--r--meta-openbmc-machines/meta-openpower/meta-ibm/meta-romulus/recipes-phosphor/chassis/cpld-trigger/cpld_reset@.service13
3 files changed, 26 insertions, 1 deletions
diff --git a/meta-openbmc-machines/meta-openpower/meta-ibm/meta-romulus/recipes-phosphor/chassis/cpld-trigger.bb b/meta-openbmc-machines/meta-openpower/meta-ibm/meta-romulus/recipes-phosphor/chassis/cpld-trigger.bb
index 542bd9431..41ff1f6bb 100644
--- a/meta-openbmc-machines/meta-openpower/meta-ibm/meta-romulus/recipes-phosphor/chassis/cpld-trigger.bb
+++ b/meta-openbmc-machines/meta-openpower/meta-ibm/meta-romulus/recipes-phosphor/chassis/cpld-trigger.bb
@@ -11,18 +11,26 @@ PROVIDES += 'virtual/p9-vcs-workaround'
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')}"
diff --git a/meta-openbmc-machines/meta-openpower/meta-ibm/meta-romulus/recipes-phosphor/chassis/cpld-trigger/cpld_reset.sh b/meta-openbmc-machines/meta-openpower/meta-ibm/meta-romulus/recipes-phosphor/chassis/cpld-trigger/cpld_reset.sh
new file mode 100644
index 000000000..f6f06eec7
--- /dev/null
+++ b/meta-openbmc-machines/meta-openpower/meta-ibm/meta-romulus/recipes-phosphor/chassis/cpld-trigger/cpld_reset.sh
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+# Reset CPLD
+gpioutil -p S7 -d out -v 1
diff --git a/meta-openbmc-machines/meta-openpower/meta-ibm/meta-romulus/recipes-phosphor/chassis/cpld-trigger/cpld_reset@.service b/meta-openbmc-machines/meta-openpower/meta-ibm/meta-romulus/recipes-phosphor/chassis/cpld-trigger/cpld_reset@.service
new file mode 100644
index 000000000..d1b8553cc
--- /dev/null
+++ b/meta-openbmc-machines/meta-openpower/meta-ibm/meta-romulus/recipes-phosphor/chassis/cpld-trigger/cpld_reset@.service
@@ -0,0 +1,13 @@
+[Unit]
+Description=Reset CPLD to wait after VDD is powered up
+Wants=op-wait-power-off@%i.service
+After=op-wait-power-off@%i.service
+Conflicts=obmc-power-chassis-on@%i.target
+
+[Service]
+ExecStart={bindir}/cpld_reset.sh
+Type=oneshot
+RemainAfterExit=yes
+
+[Install]
+WantedBy=obmc-power-chassis-off@%i.target
OpenPOWER on IntegriCloud