summaryrefslogtreecommitdiff
path: root/meta-fii/meta-kudo/recipes-kudo/kudo-fw-utility
diff options
context:
space:
mode:
authorjmbills <jason.m.bills@intel.com>2021-08-31 21:23:16 +0300
committerGitHub <noreply@github.com>2021-08-31 21:23:16 +0300
commit04cd92067d2481643df5010cb39b2134b648cf4d (patch)
treed98626c9763ad9048ac9bfd8269e12eced18d496 /meta-fii/meta-kudo/recipes-kudo/kudo-fw-utility
parent10ad77d5bc86709d8ff7f95e7040e39f1c153903 (diff)
parent6f106a0a4ce15fe0678d4ffefd572e6978c72597 (diff)
downloadopenbmc-04cd92067d2481643df5010cb39b2134b648cf4d.tar.xz
Merge pull request #70 from Intel-BMC/update2021-0.701-0.70
Update
Diffstat (limited to 'meta-fii/meta-kudo/recipes-kudo/kudo-fw-utility')
-rw-r--r--meta-fii/meta-kudo/recipes-kudo/kudo-fw-utility/kudo-fw/kudo-fw-ver.sh4
-rw-r--r--meta-fii/meta-kudo/recipes-kudo/kudo-fw-utility/kudo-fw/kudo-fw.sh82
2 files changed, 82 insertions, 4 deletions
diff --git a/meta-fii/meta-kudo/recipes-kudo/kudo-fw-utility/kudo-fw/kudo-fw-ver.sh b/meta-fii/meta-kudo/recipes-kudo/kudo-fw-utility/kudo-fw/kudo-fw-ver.sh
index e0697b906..90ec84aba 100644
--- a/meta-fii/meta-kudo/recipes-kudo/kudo-fw-utility/kudo-fw/kudo-fw-ver.sh
+++ b/meta-fii/meta-kudo/recipes-kudo/kudo-fw-utility/kudo-fw/kudo-fw-ver.sh
@@ -8,12 +8,12 @@ function fw_rev() {
case $1 in
cpldb)
rsp=($(i2cget -y -f -a 13 0x76 0x00 i 5))
- ver=$(printf '%d.%d.%d.%d' ${rsp[6]} ${rsp[5]} ${rsp[4]} ${rsp[3]})
+ ver=$(printf '%d.%d.%d.%d' ${rsp[5]} ${rsp[4]} ${rsp[3]} ${rsp[2]})
;;
cpldm)
I2C_BUS_DEV=$(readlink "/sys/bus/i2c/devices/4-0077/channel-2" | cut -c 8-)
rsp=($(i2cget -y -f -a $I2C_BUS_DEV 0x76 0x00 i 5))
- ver=$(printf '%d.%d.%d.%d' ${rsp[6]} ${rsp[5]} ${rsp[4]} ${rsp[3]})
+ ver=$(printf '%d.%d.%d.%d' ${rsp[5]} ${rsp[4]} ${rsp[3]} ${rsp[2]})
;;
*)
;;
diff --git a/meta-fii/meta-kudo/recipes-kudo/kudo-fw-utility/kudo-fw/kudo-fw.sh b/meta-fii/meta-kudo/recipes-kudo/kudo-fw-utility/kudo-fw/kudo-fw.sh
index d103747b2..a63c3e61c 100644
--- a/meta-fii/meta-kudo/recipes-kudo/kudo-fw-utility/kudo-fw/kudo-fw.sh
+++ b/meta-fii/meta-kudo/recipes-kudo/kudo-fw-utility/kudo-fw/kudo-fw.sh
@@ -28,6 +28,10 @@ function fwbios() {
fi
echo "Flashing BIOS @/dev/$BIOS_MTD"
flashcp -v $1 /dev/$BIOS_MTD
+ if [ $? -ne 0 ]; then
+ echo "Flashing the bios failed " >&2
+ exit 1
+ fi
wait
# switch the SPI mux from BMC to Host
@@ -36,23 +40,38 @@ function fwbios() {
fi
i2cset -y -f -a 13 0x76 0x10 0x00
+ # Disable LPI mode NV_SI_CPU_LPI_FREQ_DISABLE.
+ # Moved to before SCP as fwscp function returns 0 on success
+ nvparm -s 0x1 -o 0x114090
+ # TODO: Disabled toggling of SMPro heartbeat (require CPLD v 1.12.0.0+)
+ # nvparm -s 0x1 -o 0x5F0638
+ if [ $? -ne 0 ]; then
+ echo "Setting default nvparms failed " >&2
+ exit 1
+ fi
+
if [[ $(find ${1} -type f -size +17156k 2>/dev/null) ]]; then
echo "Extracting the SCP from the image"
dd if=$1 bs=1024 skip=17156 count=256 of=/run/initramfs/myscp.img
fwscp /run/initramfs/myscp.img
fi
- # Disable LPI mode NV_SI_CPU_LPI_FREQ_DISABLE.
- nvparm -s 0x1 -o 0x114090
+
rm -f $1
+ exit 0
}
function fwbmccpld() {
# BMC_JTAG_MUX_1 #218 0:BMC 1:MB
set_gpio_ctrl 218 out 0
loadsvf -d /dev/jtag0 -s $1 -m 0
+ if [ $? -ne 0 ]; then
+ echo "BMC CPLD update failed" >&2
+ exit 1
+ fi
wait
set_gpio_ctrl 218 out 1
rm -f $1
+ exit 0
}
function fwmbcpld() {
@@ -61,8 +80,13 @@ function fwmbcpld() {
set_gpio_ctrl 218 out 1
set_gpio_ctrl 164 out 1
loadsvf -d /dev/jtag0 -s $1 -m 0
+ if [ $? -ne 0 ]; then
+ echo "Mobo CPLD update failed" >&2
+ exit 1
+ fi
wait
rm -f $1
+ exit 0
}
function fwscp() {
@@ -72,10 +96,15 @@ function fwscp() {
set_gpio_ctrl 85 out 0
I2C_BUS_DEV=$(ls -l $devpath/"13-0077/" | grep channel-0 | awk '{ print $11}' | cut -c 8-)
ampere_eeprom_prog -b $I2C_BUS_DEV -s 0x50 -p -f $1
+ if [ $? -ne 0 ]; then
+ echo "SCP eeprom update failed" >&2
+ exit 1
+ fi
wait
set_gpio_ctrl 85 out 1
set_gpio_ctrl 168 out 1
rm -f $1
+ exit 0
}
function fwscpback() {
@@ -85,12 +114,58 @@ function fwscpback() {
set_gpio_ctrl 85 out 0
I2C_BUS_DEV=$(ls -l $devpath/"13-0077/" | grep channel-0 | awk '{ print $11}' | cut -c 8-)
ampere_eeprom_prog -b $I2C_BUS_DEV -s 0x50 -p -f $1
+ if [ $? -ne 0 ]; then
+ echo "SCP BACKUP eeprom update failed" >&2
+ exit 1
+ fi
wait
set_gpio_ctrl 85 out 1
set_gpio_ctrl 168 out 1
rm -f $1
+ exit 0
+}
+
+function fwmb_pwr_seq(){
+ #$1 0x40 seq config file
+ #$2 0x41 seq config file
+ if [[ ! -e $1 ]]; then
+ echo "$1 file does not exist"
+ exit 1
+ fi
+ if [[ ! -e $2 ]]; then
+ echo "$2 file does not exist"
+ exit 1
+ fi
+ echo 32-0040 > /sys/bus/i2c/drivers/adm1266/unbind
+ echo 32-0041 > /sys/bus/i2c/drivers/adm1266/unbind
+ adm1266_fw_fx $1 $2
+ if [ $? -ne 0 ]; then
+ echo "The power seq flash failed" >&2
+ exit 1
+ fi
+ echo 32-0040 > /sys/bus/i2c/drivers/adm1266/bind
+ echo 32-0041 > /sys/bus/i2c/drivers/adm1266/bind
+ rm -f $1
+ rm -f $2
+ exit 0
}
+if [[ ! $(which flashcp) ]]; then
+ echo "flashcp utility not installed"
+ exit 1
+fi
+if [[ ! $(which ampere_eeprom_prog) ]]; then
+ echo "ampere_eeprom_prog utility not installed"
+ exit 1
+fi
+if [[ ! $(which loadsvf) ]]; then
+ echo "loadsvf utility not installed"
+ exit 1
+fi
+if [[ ! -e /dev/jtag0 ]]; then
+ echo "Jtag device driver not functional"
+ exit 1
+fi
case $1 in
bios)
@@ -108,6 +183,9 @@ case $1 in
scpback)
fwscpback $2
;;
+ mbseq)
+ fwmb_pwr_seq $2 $3
+ ;;
*)
;;
esac