summaryrefslogtreecommitdiff
path: root/meta-ampere
diff options
context:
space:
mode:
authorchaul.ampere <chaul@amperecomputing.com>2022-07-23 07:28:42 +0300
committerchaul.ampere <chaul@amperecomputing.com>2022-07-25 06:35:08 +0300
commit7b6d85fdbbe97391b07e0c3dc87faaf80ae23b97 (patch)
tree2283f9bb6b42b8cf27ebfe4a77376f5462704ea3 /meta-ampere
parent8632c910a37fd802038098d8b112cb5bf5351ea6 (diff)
downloadopenbmc-7b6d85fdbbe97391b07e0c3dc87faaf80ae23b97.tar.xz
meta-ampere: mtjade: Fix SCP failover handling
"BMC_I2C_BACKUP_SEL" was not defined anywhere, so script "ampere_scp_failover.sh" fails to execute and SCP can't switch to the secondary EEPROM to boot in case of failed primary EEPROM firmware. This commit defines BMC_I2C_BACKUP_SEL to 8 in "gpio-defs.sh" , which is gpio B0 Tested: 1. BMC on, Host on, flash good SCP firmware to secondary EEPROM, flash bad SCP firmware to primary EEPROM that simulate SCP authentication failure => Host boots OK with secondary EEPROM Check gpio BMC_I2C_BACKUP_SEL => it will be set to 0 Signed-off-by: chaul.ampere <chaul@amperecomputing.com> Change-Id: Ibb891042deb051f8100f9a88dd3619bce12c181f
Diffstat (limited to 'meta-ampere')
-rw-r--r--meta-ampere/meta-jade/recipes-ampere/platform/ampere-utils/gpio-defs.sh1
-rw-r--r--meta-ampere/meta-jade/recipes-phosphor/gpio/ampere-gpio-handling/ampere_scp_failover.sh6
2 files changed, 5 insertions, 2 deletions
diff --git a/meta-ampere/meta-jade/recipes-ampere/platform/ampere-utils/gpio-defs.sh b/meta-ampere/meta-jade/recipes-ampere/platform/ampere-utils/gpio-defs.sh
index fc0edd6fc9..e0a7c020e3 100644
--- a/meta-ampere/meta-jade/recipes-ampere/platform/ampere-utils/gpio-defs.sh
+++ b/meta-ampere/meta-jade/recipes-ampere/platform/ampere-utils/gpio-defs.sh
@@ -18,6 +18,7 @@ S0_SYSRESET_L=91
### Table 1: GPIO Assignments
+BMC_I2C_BACKUP_SEL=8
S0_CPU_FW_BOOT_OK=48
CPU_BMC_OVERTEMP_L=51
CPU_BMC_HIGHTEMP_L=72
diff --git a/meta-ampere/meta-jade/recipes-phosphor/gpio/ampere-gpio-handling/ampere_scp_failover.sh b/meta-ampere/meta-jade/recipes-phosphor/gpio/ampere-gpio-handling/ampere_scp_failover.sh
index 56319a3074..c1c16aba5c 100644
--- a/meta-ampere/meta-jade/recipes-phosphor/gpio/ampere-gpio-handling/ampere_scp_failover.sh
+++ b/meta-ampere/meta-jade/recipes-phosphor/gpio/ampere-gpio-handling/ampere_scp_failover.sh
@@ -7,6 +7,8 @@
# and logs an event in SEL.
# shellcheck disable=SC1091
+# shellcheck disable=SC2046
+
source /usr/sbin/gpio-lib.sh
source /usr/sbin/gpio-defs.sh
@@ -16,7 +18,7 @@ if [ "${I2C_BACKUP_SEL}" == "1" ]; then
# If it is HIGH, set it LOW. Then reset the Host to boot from
# the failover Boot EEPROM.
echo "scp-failover: switch HOST to failover boot EEPROM"
- gpioset "$(gpiofind BMC_SELECT_EEPROM)"=0
+ gpioset $(gpiofind BMC_SELECT_EEPROM)=0
# Reset the Host to boot on the failover EEPROM
ampere_power_util.sh mb force_reset
@@ -25,7 +27,7 @@ else
obmcutil chassisoff
echo "scp-failover: switch HOST back to the main Boot EEPROM"
- gpioset "$(gpiofind BMC_SELECT_EEPROM)"=1
+ gpioset $(gpiofind BMC_SELECT_EEPROM)=1
# Log event
ampere_add_redfishevent.sh OpenBMC.0.1.GeneralFirmwareSecurityViolation.Critical "SCP Authentication failure"