diff options
author | Kyle Nieman <kyle.nieman@fii-na.com> | 2023-05-15 19:15:54 +0300 |
---|---|---|
committer | Vivekanand Veeracholan <vveerach@google.com> | 2023-06-30 20:08:09 +0300 |
commit | 6f32677b4230f90fb60eae10959708619534a44e (patch) | |
tree | 02f75d737e6ea6f5053ec84aaaff411a51bc22ed /meta-fii/meta-mori/recipes-mori | |
parent | d59c185b55e4b8f83a0657744fdc0ca113d7399d (diff) | |
download | openbmc-6f32677b4230f90fb60eae10959708619534a44e.tar.xz |
meta-fii: meta-mori: Add installation check for firmware utilities
Check that utilities used for flashing and version retrieval are
installed prior to being used to prevent unintended behavior.
Change-Id: I0d4547c43d78f03462e9e05ae465162cccb21f46
Signed-off-by: Kyle Nieman <kyle.nieman@fii-na.com>
Diffstat (limited to 'meta-fii/meta-mori/recipes-mori')
-rw-r--r-- | meta-fii/meta-mori/recipes-mori/mori-fw-utility/mori-fw/mori-fw.sh | 20 | ||||
-rw-r--r-- | meta-fii/meta-mori/recipes-mori/mori-sys-utility/mori-cmd/mori.sh | 6 |
2 files changed, 20 insertions, 6 deletions
diff --git a/meta-fii/meta-mori/recipes-mori/mori-fw-utility/mori-fw/mori-fw.sh b/meta-fii/meta-mori/recipes-mori/mori-fw-utility/mori-fw/mori-fw.sh index 656ba3467b..a0f11544e5 100644 --- a/meta-fii/meta-mori/recipes-mori/mori-fw-utility/mori-fw/mori-fw.sh +++ b/meta-fii/meta-mori/recipes-mori/mori-fw-utility/mori-fw/mori-fw.sh @@ -97,7 +97,7 @@ function fwbootstrap() { #switch access to BMC set_gpio_ctrl CPU_EEPROM_SEL 0 - if [ "$(ampere_eeprom_prog -b ${I2C_CPU_EEPROM[0]} -s 0x${I2C_CPU_EEPROM[1]} -p -f $1)" -ne 0 ]; then + if [ "$(bootstrap_flash -b ${I2C_CPU_EEPROM[0]} -s 0x${I2C_CPU_EEPROM[1]} -p -f $1)" -ne 0 ]; then echo "CPU bootstrap EEPROM update failed" >&2 return 1 fi @@ -118,16 +118,18 @@ function fwmb_pwr_seq(){ echo "The file $1 does not exist" return 1 fi - echo "${I2C_MB_PWRSEQ[0]}"-00"${I2C_MB_PWRSEQ[1]}" > /sys/bus/i2c/drivers/adm1266/unbind - #Parameters passed to adm1266_fw_fx to be used to flash PS + echo "${I2C_MB_PWRSEQ[0]}"-00"${I2C_MB_PWRSEQ[1]}" > \ + /sys/bus/i2c/drivers/adm1266/unbind + #Parameters passed to mb_power_sequencer_flash to be used to flash PS #1st I2C bus number of PS's #2nd PS seq config file - if [ "$(adm1266_fw_fx ${I2C_MB_PWRSEQ[0]} $1)" -ne 0 ]; then + if [ "$(mb_power_sequencer_flash ${I2C_MB_PWRSEQ[0]} $1)" -ne 0 ]; then echo "The power seq flash failed" >&2 return 1 fi - echo "${I2C_MB_PWRSEQ[0]}"-00"${I2C_MB_PWRSEQ[1]}" > /sys/bus/i2c/drivers/adm1266/bind + echo "${I2C_MB_PWRSEQ[0]}"-00"${I2C_MB_PWRSEQ[1]}" > \ + /sys/bus/i2c/drivers/adm1266/bind return 0 } @@ -140,6 +142,14 @@ if [[ ! $(which loadsvf) ]]; then echo "loadsvf utility not installed" exit 1 fi +if [[ ! $(which mb_power_sequencer_flash) ]]; then + echo "mb_power_sequencer_flash utility not installed" + exit 1 +fi +if [[ ! $(which bootstrap_flash) ]]; then + echo "bootstrap_flash utility not installed" + exit 1 +fi if [[ ! -e /dev/jtag0 ]]; then echo "Jtag device driver not functional" exit 1 diff --git a/meta-fii/meta-mori/recipes-mori/mori-sys-utility/mori-cmd/mori.sh b/meta-fii/meta-mori/recipes-mori/mori-sys-utility/mori-cmd/mori.sh index 93fe1098c3..26730df614 100644 --- a/meta-fii/meta-mori/recipes-mori/mori-sys-utility/mori-cmd/mori.sh +++ b/meta-fii/meta-mori/recipes-mori/mori-sys-utility/mori-cmd/mori.sh @@ -129,8 +129,12 @@ function fw_rev() { echo " Bios: $cmd" fi - adm1266_ver "${I2C_MB_PWRSEQ[0]}" | grep REVISION + if [[ ! $(which mb_power_sequencer_version) ]]; then + echo "mb_power_sequencer_version utility not installed" + return + fi + mb_power_sequencer_version "${I2C_MB_PWRSEQ[0]}" | grep REVISION } function uartmux() { |