diff options
Diffstat (limited to 'meta-facebook/recipes-phosphor/state')
3 files changed, 46 insertions, 1 deletions
diff --git a/meta-facebook/recipes-phosphor/state/phosphor-state-manager/greatlakes/power-ctrl-init b/meta-facebook/recipes-phosphor/state/phosphor-state-manager/greatlakes/power-ctrl-init new file mode 100644 index 0000000000..da4c278c29 --- /dev/null +++ b/meta-facebook/recipes-phosphor/state/phosphor-state-manager/greatlakes/power-ctrl-init @@ -0,0 +1,24 @@ +#!/bin/bash +# Provide source directive to shellcheck. +gpioInitHighTable=( + "power-nic-bmc-enable" + "usb-bmc-enable" + "reset-cause-usb-hub" + "bmc-ready" + "fan0-bmc-cpld-enable" + "fan1-bmc-cpld-enable" + "fan2-bmc-cpld-enable" + "fan3-bmc-cpld-enable" +) + +gpio-init() +{ + for gpioInitHigh in "${gpioInitHighTable[@]}" + do + # need the word splitting for gpiofind command. + # shellcheck disable=SC2046 + gpioset $(gpiofind "${gpioInitHigh}")=1 + done +} + +gpio-init diff --git a/meta-facebook/recipes-phosphor/state/phosphor-state-manager/greatlakes/power-ctrl-init.service b/meta-facebook/recipes-phosphor/state/phosphor-state-manager/greatlakes/power-ctrl-init.service new file mode 100644 index 0000000000..18def6d2cb --- /dev/null +++ b/meta-facebook/recipes-phosphor/state/phosphor-state-manager/greatlakes/power-ctrl-init.service @@ -0,0 +1,15 @@ +[Unit] +Description=Power Control Initialization +Wants=obmc-mapper.target +After=obmc-mapper.target +Wants=xyz.openbmc_project.Logging.service +After=xyz.openbmc_project.Logging.service +Before=mapper-wait@-xyz.openbmc_project.State.Chassis@0.service +Before=mapper-wait@-xyz-openbmc_project-state-bmc.service + +[Service] +Type=oneshot +ExecStart=/usr/libexec/phosphor-state-manager/power-ctrl-init + +[Install] +WantedBy=multi-user.target diff --git a/meta-facebook/recipes-phosphor/state/phosphor-state-manager_%.bbappend b/meta-facebook/recipes-phosphor/state/phosphor-state-manager_%.bbappend index 42c7117941..8c608355d5 100644 --- a/meta-facebook/recipes-phosphor/state/phosphor-state-manager_%.bbappend +++ b/meta-facebook/recipes-phosphor/state/phosphor-state-manager_%.bbappend @@ -25,6 +25,7 @@ SRC_URI:append:greatlakes = " \ file://host-poweron@.service \ file://host-powercycle@.service \ file://host-powerreset@.service \ + file://power-ctrl-init.service \ file://chassis-poweroff \ file://chassis-poweron \ file://chassis-powercycle \ @@ -33,6 +34,7 @@ SRC_URI:append:greatlakes = " \ file://host-powercycle \ file://host-powerreset \ file://power-cmd \ + file://power-ctrl-init \ " RDEPENDS:${PN}:append:greatlakes = " bash" @@ -41,7 +43,7 @@ do_install:append:greatlakes() { install -d ${D}${systemd_system_unitdir} install -m 0644 ${WORKDIR}/*.service ${D}${systemd_system_unitdir}/ - install -d ${D}${libexecdir} + install -d ${D}${libexecdir}/${PN} install -m 0777 ${WORKDIR}/chassis-poweroff ${D}${libexecdir}/ install -m 0777 ${WORKDIR}/chassis-poweron ${D}${libexecdir}/ install -m 0777 ${WORKDIR}/chassis-powercycle ${D}${libexecdir}/ @@ -50,5 +52,9 @@ do_install:append:greatlakes() { install -m 0777 ${WORKDIR}/host-powercycle ${D}${libexecdir}/ install -m 0777 ${WORKDIR}/host-powerreset ${D}${libexecdir}/ install -m 0777 ${WORKDIR}/power-cmd ${D}${libexecdir}/ + install -m 0777 ${WORKDIR}/power-ctrl-init ${D}${libexecdir}/${PN}/ } + FILES:${PN} += " /lib/systemd/system/*.service" + +SYSTEMD_SERVICE:${PN}-bmc:append:greatlakes = "power-ctrl-init.service" |