Reflash
Reflashing can be done in two ways:
- From U-Boot, using the firmware-builder SD card image (if the onboard flash is unusable)
The firmware-builder sdcard is configured to offer reflash as a menu option.
- From the recovery environment.
Using SD card¶
You can obtain a firmware-builder SD card image which allows the board to boot directly from SD and perform the flashing operation within the U-Boot environment.
Select Reflash board from the menu presented.
It will execute a script that performs the flash sequence:
90817 bytes read in 23 ms (3.8 MiB/s)
Erasing 0x00000000 ... 0x000fffff (16 eraseblock(s))
Writing 1048576 byte(s) at offset 0x00000000
1114723 bytes read in 71 ms (15 MiB/s)
Erasing 0x00000000 ... 0x001fffff (32 eraseblock(s))
Writing 2097152 byte(s) at offset 0x00000000
937920 bytes read in 63 ms (14.2 MiB/s)
Erasing 0x00000000 ... 0x001fffff (32 eraseblock(s))
Writing 2097152 byte(s) at offset 0x00000000
10302 bytes read in 18 ms (558.6 KiB/s)
Erasing 0x00000000 ... 0x0003ffff (4 eraseblock(s))
Writing 262144 byte(s) at offset 0x00000000
562 bytes read in 17 ms (32.2 KiB/s)
Erasing 0x00000000 ... 0x0003ffff (4 eraseblock(s))
Writing 262144 byte(s) at offset 0x00000000
19765 bytes read in 19 ms (1015.6 KiB/s)
Erasing 0x00000000 ... 0x0003ffff (4 eraseblock(s))
Writing 262144 byte(s) at offset 0x00000000
This sequence is stored on the sdcard as spi_fw/flash-qspi.scr
, you can execute it manually with:
U-Boot=> load mmc 0 ${load_addr} spi_fw/flash-qspi.scr; source ${load_addr}
Using U-Boot¶
You can achieve the same result as the boot menu command above using the mtd erase
and mtd write
commands. You will need to load the binaries, either from mass storage
(using the load
command) or network (with tftpboot
)
# Probe the NOR flash
sf probe 0:0
# Reset environment to default (to get correct mtdparts=)
env default -a
# Ensure the MTD subsystem parses the mtdparts=
mtd list
load mmc 0 $load_addr 'spi_fw/bl2_qspi.pbl'
mtd erase bl2
mtd write bl2 $load_addr +$filesize
load mmc 0 $load_addr 'spi_fw/fip.bin'
mtd erase bl3
mtd write bl3 $load_addr +$filesize
load mmc 0 $load_addr 'mcfirmware/mc_ls1088a.itb'
mtd erase mcfirmware
mtd write mcfirmware $load_addr +$filesize
load mmc 0 $load_addr 'dpaa2config/eth-dpl-all.dtb'
mtd erase dpl
mtd write dpl $load_addr +$filesize
load mmc 0 $load_addr 'dpaa2config/dpc.0x1D-0x0D.dtb'
mtd erase dpc
mtd write dpc $load_addr +$filesize
load mmc 0 $load_addr 'spi_fw/traverse-ten64-a.dtb'
mtd erase devicetree
mtd write devicetree $load_addr +$filesize
From a Linux environment¶
Note
The SPI-NOR and MTD stack in kernel versions earlier than ~5.4 did not properly handle write operations to SPI-NOR using the newer fsl-quadspi driver.
You can also flash binaries from Linux using the mtd
tool - this needs to be done
from a system that has access to the QSPI flash - such as recovery - the QSPI
controller is disabled for block device (e.g EFI) operating systems.
mtd erase bl2
mtd write bl2_qspi.pbl bl2
and so on..