Updating SPL and U-Boot of Flash
To update SPL and U-Boot of flash for VisionFive 2, two methods are provided:
Note: For instructions to create SPL and
fw_payload (U-Boot) files, refer to Creating SPL
File and Creating fw_payload File sections in the VisionFive 2 Single
Board Computer Software Technical Reference Manual.
- Through the
tftpbootcommand as described in Through tftpboot Command. - Through the
flashcpcommand as described in Through flashcp Command.Note: Method 2 only supports versions equal to or later than VF2_v2.5.0.
Through tftpboot Command
To update SPL and U-Boot through the tftpboot command, perform the
following steps:
- Prepare the TFTP server. The following is an example command for Ubuntu
distribution.
sudo apt install tftpd-hpaNote: For instructions to deploy the TFTP server, refer to the step 2 to step 6 in Using Ethernet section of the VisionFive Single Board Computer Quick Start Guide. - Power on VisionFive 2 and wait until it enters the U-Boot command line interface.
- Configure the environment variables by
executing:
setenv ipaddr 192.168.120.222;setenv serverip 192.168.120.99 - Check the connectivity by pinging the host PC from VisionFive 2.
- Initialize SPI
flash:
sf probe - Update SPL
binary:
tftpboot 0xa0000000 ${serverip}:u-boot-spl.bin.normal.out sf update 0xa0000000 0x0 $filesize - Update U-Boot
binary:
tftpboot 0xa0000000 ${serverip}:visionfive2_fw_payload.img sf update 0xa0000000 0x100000 $filesize
Through flashcp Command
To update SPL and U-Boot through the flashcp command, perform the
following steps:
Note: This method only supports versions equal to or later
than VF2_v2.5.0.
- Install the mtd-utils package by executing the
following
command:
apt install mtd-utils - Transfer the latest u-boot-spl.bin.normal.out and visionfive2_fw_payload.img files to Debian system through SCP.
- Execute the following command to check the MTD
partition:
Example Output:cat /proc/mtdYou will see the partition information in the QSPI flash:
dev: size erasesize name mtd0: 00020000 00001000 "spl" mtd1: 00300000 00001000 "uboot" mtd2: 00100000 00001000 "data" - Update the SPL and U-Boot binaries according to different partitions:
- Example command to update
SPL:
flashcp -v u-boot-spl.bin.normal.out /dev/mtd0 - Example command to update
U-Boot:
flashcp -v visionfive2_fw_payload.img /dev/mtd1
# flashcp -v u-boot-spl.bin.normal.out /dev/mtd0 Erasing blocks: 32/32 (100%) Writing data: 124k/124k (100%) Verifying data: 124k/124k (100%) # flashcp -v visionfive2_fw_payload.img /dev/mtd1 Erasing blocks: 682/682 (100%) Writing data: 2727k/2727k (100%) Verifying data: 2727k/2727k (100%) - Example command to update
SPL:
- Restart the system to make the updates take effect.
