diff options
Diffstat (limited to 'meta-openbmc-machines')
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 |