diff options
author | Thang Q. Nguyen <thang@os.amperecomputing.com> | 2021-07-20 11:48:50 +0300 |
---|---|---|
committer | Thang Q. Nguyen <thang@os.amperecomputing.com> | 2021-08-04 10:31:41 +0300 |
commit | 509991d6a5f34772788ca6d8401c19109e6280a6 (patch) | |
tree | b5a43e4aacbe365d47a456cd47cb4a8af4068ce7 /meta-ampere/meta-jade/recipes-ampere | |
parent | 98f43bec14af073da25f53db2122fe3546f54095 (diff) | |
download | openbmc-509991d6a5f34772788ca6d8401c19109e6280a6.tar.xz |
meta-ampere: mtjade: flash UEFI firmware at 4MB offset
UEFI firmware for Ampere Altra-based platform starts at offset 0x400000
but currently the firmware image is flashed start at offset 0. This
makes the Host fail to boot.
This commit supports offset option for the mtd-util's flashcp utility
and update the script to flash UEFI firmware starting at offset
0x400000.
Tested:
1. Turn on the Host.
2. Flash UEFI firmware. Wait for the flash complete and check if Host
can boot successfully.
4. Turn off the Host.
5. Flash UEFI firmware. Wait for the flash complete.
6. Turn on the Host and check if Host can boot successfully.
Signed-off-by: Tung Nguyen <tung.nguyen@amperecomputing.com>
Signed-off-by: Thang Q. Nguyen <thang@os.amperecomputing.com>
Change-Id: I0d48bfd0a7b7350b46a98bf10fe4de3887f09f02
Diffstat (limited to 'meta-ampere/meta-jade/recipes-ampere')
-rwxr-xr-x | meta-ampere/meta-jade/recipes-ampere/flash/ampere-flash-utils/ampere_flash_bios.sh | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/meta-ampere/meta-jade/recipes-ampere/flash/ampere-flash-utils/ampere_flash_bios.sh b/meta-ampere/meta-jade/recipes-ampere/flash/ampere-flash-utils/ampere_flash_bios.sh index 876671c1b..7a9ace30e 100755 --- a/meta-ampere/meta-jade/recipes-ampere/flash/ampere-flash-utils/ampere_flash_bios.sh +++ b/meta-ampere/meta-jade/recipes-ampere/flash/ampere-flash-utils/ampere_flash_bios.sh @@ -15,6 +15,8 @@ # limitations under the License. do_flash () { + OFFSET=$1 + # Check the PNOR partition available HOST_MTD=$(cat /proc/mtd | grep "pnor" | sed -n 's/^\(.*\):.*/\1/p') if [ -z "$HOST_MTD" ]; @@ -30,18 +32,10 @@ do_flash () { echo "Fail to probe Host SPI-NOR device" exit 1 fi - - echo "--- Flashing firmware to @/dev/$HOST_MTD" - flash_eraseall /dev/$HOST_MTD - flashcp -v $IMAGE /dev/$HOST_MTD - - echo "--- Unbind the ASpeed SMC driver" - echo 1e630000.spi > /sys/bus/platform/drivers/aspeed-smc/unbind - else - echo "--- Flashing firmware to @/dev/$HOST_MTD" - flash_eraseall /dev/$HOST_MTD - flashcp -v $IMAGE /dev/$HOST_MTD fi + + echo "--- Flashing firmware to @/dev/$HOST_MTD offset=$OFFSET" + flashcp -v $IMAGE /dev/$HOST_MTD $OFFSET } @@ -84,7 +78,7 @@ if [[ $? -ne 0 ]]; then fi # Flash the firmware -do_flash +do_flash 0x400000 # Switch the host SPI bus to HOST." echo "--- Switch the host SPI bus to HOST." @@ -99,5 +93,5 @@ if [ "$chassisstate" == 'On' ]; then sleep 5 echo "Turn on the Host" - obmcutil chassison + obmcutil poweron fi |