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
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 fc0edd6..e0a7c02 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 @@
### 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 56319a3..c1c16ab 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 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 @@
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"