meta-ampere: mtjade: fix hostfw update sometime fail

When executing Host UEFI firmware update, the ampere_flash_bios.sh check
for pnor partition available. If not, it binds the driver so that can
access the device to flash.
There is a case that the driver is already bound but no pnor device
available. This makes the Host firmware flash fail.
This commit adds codes to check for this case and unbind the driver so
that the next binding success.

Tested:
1. Flash UEFI firmware successful in above case

Signed-off-by: Thang Q. Nguyen <thang@os.amperecomputing.com>
Change-Id: I410621cf916d9ae139f420469357e4687ae138ab
diff --git a/meta-ampere/meta-jade/recipes-ampere/platform/ampere-utils/ampere_flash_bios.sh b/meta-ampere/meta-jade/recipes-ampere/platform/ampere-utils/ampere_flash_bios.sh
index 2824508..7852dc4 100755
--- a/meta-ampere/meta-jade/recipes-ampere/platform/ampere-utils/ampere_flash_bios.sh
+++ b/meta-ampere/meta-jade/recipes-ampere/platform/ampere-utils/ampere_flash_bios.sh
@@ -19,6 +19,14 @@
 	HOST_MTD=$(< /proc/mtd grep "pnor-uefi" | sed -n 's/^\(.*\):.*/\1/p')
 	if [ -z "$HOST_MTD" ];
 	then
+		# Check the ASpeed SMC driver bound before
+		HOST_SPI=/sys/bus/platform/drivers/spi-aspeed-smc/1e630000.spi
+		if [ -d "$HOST_SPI" ]; then
+			echo "Unbind the ASpeed SMC driver"
+			echo 1e630000.spi > /sys/bus/platform/drivers/spi-aspeed-smc/unbind
+			sleep 2
+		fi
+
 		# If the PNOR partition is not available, then bind again driver
 		echo "--- Bind the ASpeed SMC driver"
 		echo 1e630000.spi > /sys/bus/platform/drivers/spi-aspeed-smc/bind