diff options
author | Thang Q. Nguyen <thang@os.amperecomputing.com> | 2022-07-05 16:25:08 +0300 |
---|---|---|
committer | Thang Q. Nguyen <thang@os.amperecomputing.com> | 2022-07-14 05:45:43 +0300 |
commit | 0401a586f81ed29b61c289d69efd5cbf5b0dbdd0 (patch) | |
tree | a20b3c0fc141ed265de79efda7615c59ab8ccbeb /meta-ampere | |
parent | 83d442f5fdb4204c2cedadaee0e3654a142e2ac8 (diff) | |
download | openbmc-0401a586f81ed29b61c289d69efd5cbf5b0dbdd0.tar.xz |
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
Diffstat (limited to 'meta-ampere')
-rwxr-xr-x | meta-ampere/meta-jade/recipes-ampere/platform/ampere-utils/ampere_flash_bios.sh | 8 |
1 files changed, 8 insertions, 0 deletions
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 2824508bd7..7852dc4acc 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 @@ do_flash () { 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 |