This how-to topic is applicable for only LSDK 18.09 and older releases.
Follow these steps to update the U-Boot binary in QSPI NOR flash.
Prerequisites
- Ubuntu 18.04 64-bit should be installed on the Linux host machine for building LSDK 18.06 or LSDK 18.09 U-Boot binary.
cpld reset boots the board from QSPI NOR flash0 and cpld reset altbank boots the board from QSPI NOR flash1.
sf probe 0:1 means that the alternate bank will be written to. So, if the board boots from QSPI NOR flash0 and sf probe 0:1 is entered at the U-Boot prompt, the commands that follow will program QSPI NOR flash1.
Compiling U-Boot binary
Clone the u-boot repository.
- $ git clone https://source.codeaurora.org/external/qoriq/qoriq-components/u-boot.git
- $ cd u-boot
- $ git checkout -b <new branch name> LSDK-<LSDK version>. For example, $ git checkout -b LSDK-18.09 LSDK-18.09
- $ export ARCH=arm64
- $ export CROSS_COMPILE=aarch64-linux-gnu-
- $ make distclean
- $ make ls1046ardb_qspi_defconfig
- If required, make changes to the U-Boot files.
- $ make
If the make command shows the error "*** Your GCC is older than 6.0 and is not supported", ensure that you are using Ubuntu 18.04 64-bit version for building LSDK 18.06 or LSDK 18.09 U-Boot binary.
The compiled U-Boot image, u-boot.bin, is available in the directory u-boot/.
Flashing U-Boot binary to QSPI NOR flash
U-Boot image can be loaded to LS1046ARDB from a TFTP server or from a mass storage device (SD, USB, or SATA).
Option 1: Load image from the TFTP server
- Boot LS1046ARDB from QSPI. Ensure that the switches are set to boot the board from QSPI. For booting from QSPI, SW5[1:8] = 00100010
- Boot from QSPI NOR flash0: => cpld reset
In boot log, you’ll see:
Board: LS1046ARDB, boot from QSPI vBank 0
Set up Ethernet connection
When the board boots up, U-Boot prints a list of enabled Ethernet interfaces.
FM1@DTSEC3 [PRIME], FM1@DTSEC4, FM1@DTSEC5, FM1@DTSEC6, FM1@TGEC1, FM1@TGEC2
- Set server IP to the IP of the host machine on which you have configured the TFTP server.
=> setenv serverip <ipaddress1>
Set ethact and ethprime as the Ethernet interface connected to the TFTP server.
=> setenv ethprime <name of interface connected to TFTP server>
For example:
=> setenv ethprime FM1@DTSEC4
=> setenv ethact <name of interface connected to TFTP server>
For example:
=> setenv ethact FM1@DTSEC4
- Set IP address of the board. You can set a static IP address or, if the board can connect to a dhcp server, you can use the dhcp command.
Static IP address assignment:
=> setenv ipaddr <ipaddress2>
=> setenv netmask <subnet mask>
Dynamic IP address assignment:
=> dhcp
- Save the settings.
=> saveenv
- Check the connection between the board and the TFTP server.
=> ping $serverip
Using FM1@DTSEC4 device
host 192.168.1.1 is alive
Load U-Boot image from the TFTP server
Program QSPI NOR flash1: => sf probe 0:1
- Flash U-Boot image:
- => tftp 0xa0000000 u-boot.bin
- => print filesize
filesize=ae84a
- Program U-Boot image to QSPI NOR flash: => sf erase 0x100000 +$filesize && sf write 0xa0000000 0x100000 $filesize
Address 0x100000 is the location of U-Boot in QSPI NOR flash. Refer Flash layout for boot flow with PPA – LSDK 18.09 and older releases for the complete flash memory layout.
- Boot from QSPI NOR flash1: => cpld reset altbank
In boot log, you’ll see:
Board: LS1046ARDB, boot from QSPI vBank 4
Ensure that SD card, USB flash drive, or SCSI hard disk installed with LSDK Ubuntu distribution is plugged into the board to boot the board to Ubuntu. If U-Boot does not find LSDK on a mass storage device, it will boot TinyDistro from lsdk_linux_arm64_ tiny.itb stored in QSPI NOR flash.
Option 2: Load image from partition on mass storage device (SD, USB, or SATA)
- Boot LS1046ARDB from QSPI NOR flash. Ensure that the switches are set to boot the board from QSPI. For booting from QSPI, SW5[1:8] = 00100010
- Boot from QSPI NOR flash0: => cpld reset
In boot log, you’ll see:
Board: LS1046ARDB, boot from QSPI vBank 0
- Select mass storage device to use.
=> mmc rescan
=> mmc info
Or
=> usb start
=> usb info
Or
=> scsi scan
=> scsi info
- Optional – List files on storage device
=> ls mmc <device:partition>
For example:
=> ls mmc 0:3
System Volume Information/
714826 u-boot.bin
1 file(s), 1 dir(s)
Or
=> ls usb <device:partition>
For example:
=> ls usb 0:1
Or
=> ls scsi <device:partition>
For example:
=> ls scsi 0:2
If the ls command fails to run, check that U-Boot in QSPI NOR flash0 supports the command by typing ls at the U-Boot prompt:
=> ls
ls - Lists files in a directory (default)
Usage:
ls <interface> [<dev[:part]> [directory]]
- Lists files in directory [directory] of partition [part] on device type [interface] and instance [dev].
If U-Boot does not support this command, then update the composite firmware image in QSPI NOR flash0.
For steps to update composite firmware image in QSPI NOR flash, see LS1046ARDB - How to update composite firmware image in QSPI NOR flash.
- Program QSPI NOR flash1: => sf probe 0:1
- Load U-Boot image from the storage device.
=> load mmc <device:partition> a0000000 <image name>
=> print filesize
For example:
=> load mmc 0:3 a0000000 u-boot.bin
714826 bytes read in 52 ms (13.1 MiB/s)
=> print filesize
filesize=ae84a
Or
=> load usb <device:partition> a0000000 <image name>
=> print filesize
Or
=> load scsi <device:partition> a0000000 <image name>
=> print filesize
- Program U-Boot image to QSPI NOR flash: => sf erase 0x100000 +$filesize && sf write 0xa0000000 0x100000 $filesize
Address 0x100000 is the location of U-Boot in QSPI NOR flash. Refer Flash layout for boot flow with PPA – LSDK 18.09 and older releases for the complete flash memory layout.
- Boot from QSPI NOR flash1: => cpld reset altbank
In boot log, you’ll see:
Board: LS1046ARDB, boot from QSPI vBank 4
Ensure that SD card, USB flash drive, or SCSI hard disk installed with LSDK Ubuntu distribution is plugged into the board to boot the board to Ubuntu. If U-Boot does not find LSDK on a mass storage device, it will boot TinyDistro from lsdk_linux_arm64_ tiny.itb stored in QSPI NOR flash.