diff options
author | Delphine CC Chiu <Delphine_CC_Chiu@wiwynn.com> | 2022-11-24 06:02:38 +0300 |
---|---|---|
committer | Patrick Williams <patrick@stwcx.xyz> | 2023-02-02 22:45:09 +0300 |
commit | deb20e4b2c6281b801c85dc680940989d6d0ebd9 (patch) | |
tree | 64e4672fc123f24ec83810d7600465e7ca4e6c0c /meta-facebook/recipes-phosphor/state/phosphor-state-manager | |
parent | 0528ecd60ca357896da8b993291ed7a725ef0102 (diff) | |
download | openbmc-deb20e4b2c6281b801c85dc680940989d6d0ebd9.tar.xz |
meta-facebook: Add service for power control initialization in phosphor-state-manager
Description:
Add service to for power control initialization use.
Test Case:
Get corresponding BMC register configuration.
Change-Id: I8d227da66ddca4e38142744606ee130c1ce7aa7f
Signed-off-by: Delphine CC Chiu <Delphine_CC_Chiu@wiwynn.com>
Diffstat (limited to 'meta-facebook/recipes-phosphor/state/phosphor-state-manager')
2 files changed, 39 insertions, 0 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 |