Skip to content

Commit

Permalink
fby3: PFR: send CHKPT_COMPLETE when BMC boot complete (#1014)
Browse files Browse the repository at this point in the history
Summary:
- send CHKPT_COMPLETE when BMC boot complete.
It could clear the watchdog timeout in CPLD in order to stop doing recovery.
Pull Request resolved: facebookexternal/openbmc.wiwynn#1014

Test Plan:
- Build and test pass on fbyv3.
root@bmc-oob:/# bash /etc/init.d/setup-pfr.sh
Bus: 12
Device address: 0x38
To write 2 bytes: 0xf 0x9
root@bmc-oob:~# i2craw 12 0x38 -r 1 -w "0x03"
Bus: 12
Device address: 0x38
To write 1 bytes: 0x3
To read 1 bytes.
Received:
  0xe
root@bmc-oob:~#

Reviewed By: williamspatrick

fbshipit-source-id: 3b6372dfb7
  • Loading branch information
benwei13 authored and facebook-github-bot committed Apr 17, 2020
1 parent 64cf5c7 commit de522bc
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
35 changes: 35 additions & 0 deletions meta-facebook/meta-fby3/recipes-fby3/plat-utils/files/setup-pfr.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/bin/sh
#
# Copyright 2019-present Facebook. All Rights Reserved.
#
# This program file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program in a file named COPYING; if not, write to the
# Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor,
# Boston, MA 02110-1301 USA

PATH=/sbin:/bin:/usr/sbin:/usr/bin

. /usr/local/fbpackages/utils/ast-functions

# CHKPT_COMPLETE

BOARD_ID=$(get_bmc_board_id)
# NIC EXP BMC
if [ $BOARD_ID -eq 9 ]; then
/usr/sbin/i2craw 9 0x38 -w "0x0F 0x09"
# Baseboard BMC
elif [ $BOARD_ID -eq 14 ] || [ $BOARD_ID -eq 7 ]; then
/usr/sbin/i2craw 12 0x38 -w "0x0F 0x09"
else
echo "Is board id correct(id=$BOARD_ID)?"
fi
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ SRC_URI = "file://ast-functions \
file://COPYING \
file://setup-dev.sh \
file://sol-util \
file://setup-pfr.sh \
"

pkgdir = "utils"
Expand Down Expand Up @@ -71,6 +72,11 @@ do_install() {
# install power-on.sh
install -m 755 power-on.sh ${D}${sysconfdir}/init.d/power-on.sh
update-rc.d -r ${D} power-on.sh start 70 5 .

# install setup-pfr.sh
install -m 755 setup-pfr.sh ${D}${sysconfdir}/init.d/setup-pfr.sh
update-rc.d -r ${D} setup-pfr.sh start 99 5 .

}

FILES_${PN} += "/usr/local ${sysconfdir}"

0 comments on commit de522bc

Please sign in to comment.