Skip to content

Commit

Permalink
meta-ampere: ampere-host-check: Overide [email protected]
Browse files Browse the repository at this point in the history
…rvice

When BMC boots, phosphor-host-check uses the software interfaces (IPMI inband
Hearbeat command or PLDM interface) to verify the host state and create the
host on indicator file. Ampere Altra SoCs don't support those software
interfaces. They use the GPIO interface. GPIO pin S0_FW_BOOT_OK go high
when the host is on.
This commit appends [email protected] to phosphor-state-manager
This service will replaces the role of [email protected].

Tested:
        1. Boot up BMC with the host is off/on. Verify CurrentHostState.

Signed-off-by: Thu B Nguyen <[email protected]>
  • Loading branch information
Thu B Nguyen authored and thangqn-ampere committed Jun 29, 2021
1 parent 7190f22 commit eb0522e
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[Unit]
Description=Check Host%i status on BMC reset
Wants=phosphor-ipmi-host.service
After=phosphor-ipmi-host.service
Wants=obmc-host-reset-running@%i.target
Before=obmc-host-reset-running@%i.target
Wants=op-reset-chassis-on@%i.service
After=op-reset-chassis-on@%i.service
Conflicts=obmc-host-stop@%i.target
OnFailure=obmc-host-quiesce@%i.target
OnFailureJobMode=flush
ConditionPathExists=!/run/openbmc/host@%i-on

[Service]
RemainAfterExit=yes
Type=oneshot
ExecStart=/usr/sbin/ampere_host_check.sh 1 0

[Install]
WantedBy=obmc-host-reset@%i.target
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,20 @@ DEPS_CFG = "resetreason.conf"
DEPS_TGT = "[email protected]"
SYSTEMD_OVERRIDE_${PN}-discover_append = "${DEPS_CFG}:${DEPS_TGT}.d/${DEPS_CFG}"

SRC_URI += " \
file://[email protected] \
"

# We don't want the obmc-host-shutdown (softoff) to require
# obmc-chassis-poweroff. obmc-chassis-poweroff will be activated once
# the Shutdown ACK pin is toggled (monitored by phosphor-gpio-monitor)
HOST_STOP_FMT = ""
HOST_REBOOT_FMT = ""
AMPERE_RESET_HOST_CHECK_TMPL = "[email protected]"

do_install_append() {
install -m 0644 ${WORKDIR}/${AMPERE_RESET_HOST_CHECK_TMPL} ${D}${systemd_unitdir}/system/phosphor-reset-host-check@.service
}

pkg_postinst_${PN}-obmc-targets_append() {
rm "$D$systemd_system_unitdir/[email protected]/[email protected]"
Expand Down

0 comments on commit eb0522e

Please sign in to comment.