meta-ampere: mtjade: fix services start fail

Fix ampere-mac-update and ampere-gpio-handling starts failure,
including:
- Update ampere_update_mac.sh to recheck if the first MAC Address
reading fail. Also fix incorrect checking if setting new MAC Address
success or not.
- Fix typo in SCP failover service.

Tested:
1. Check if the ampere_update_mac.service starts succesfully.
2. Check if no error report from iS0_scp_auth_failure

Signed-off-by: Thang Q. Nguyen <thang@os.amperecomputing.com>
Change-Id: I6c03e352d8d51030d04cd303e438835e5b724afe
diff --git a/meta-ampere/meta-jade/recipes-ampere/platform/ampere-mac-update/ampere_update_mac.sh b/meta-ampere/meta-jade/recipes-ampere/platform/ampere-mac-update/ampere_update_mac.sh
index 8182b4c..5669239 100644
--- a/meta-ampere/meta-jade/recipes-ampere/platform/ampere-mac-update/ampere_update_mac.sh
+++ b/meta-ampere/meta-jade/recipes-ampere/platform/ampere-mac-update/ampere_update_mac.sh
@@ -12,8 +12,15 @@
 ifconfig ${ETHERNET_NCSI} up
 
 # Read FRU Board Custom Field 1 to get the MAC address
-CUSTOM_FIELD_1=$(busctl get-property xyz.openbmc_project.FruDevice /xyz/openbmc_project/FruDevice/Mt_Jade_Motherboard xyz.openbmc_project.FruDevice BOARD_INFO_AM1)
-MAC_ADDR=$(echo "$CUSTOM_FIELD_1" | cut -d "\"" -f 2)
+for i in {1..10}; do
+	if CUSTOM_FIELD_1=$(busctl get-property xyz.openbmc_project.FruDevice /xyz/openbmc_project/FruDevice/Mt_Jade_Motherboard xyz.openbmc_project.FruDevice BOARD_INFO_AM1);
+	then
+		MAC_ADDR=$(echo "$CUSTOM_FIELD_1" | cut -d "\"" -f 2)
+		echo "mac-update: detect BMC MAC $MAC_ADDR at loop $i"
+		break
+	fi
+	sleep 2
+done
 
 # Check if BMC MAC address is exported
 if [ -z "${MAC_ADDR}" ]; then
@@ -29,9 +36,7 @@
 fi
 
 # Request to update the MAC address
-fw_setenv ${ENV_ETH} "${MAC_ADDR}"
-
-if fw_setenv ${ENV_ETH} "${MAC_ADDR}";
+if ! fw_setenv ${ENV_ETH} "${MAC_ADDR}";
 then
 	echo "ERROR: Fail to set MAC address to ${ENV_ETH}"
 	exit 1
diff --git a/meta-ampere/meta-jade/recipes-phosphor/gpio/ampere-gpio-handling.bb b/meta-ampere/meta-jade/recipes-phosphor/gpio/ampere-gpio-handling.bb
index bf019ed..62b25b1 100644
--- a/meta-ampere/meta-jade/recipes-phosphor/gpio/ampere-gpio-handling.bb
+++ b/meta-ampere/meta-jade/recipes-phosphor/gpio/ampere-gpio-handling.bb
@@ -17,7 +17,7 @@
            "
 
 AMPERE_MONITOR_INSTANCES = " \
-                            reboot_ack shutdown_ack id_button iS0_scp_auth_failure \
+                            reboot_ack shutdown_ack id_button S0_scp_auth_failure \
                             S0_overtemp S0_hightemp_start S0_hightemp_stop \
                             S1_overtemp S1_hightemp_start S1_hightemp_stop \
                             S0_fault_alert_start S0_fault_alert_stop \