the industry standard "distro boot" boot flow for U-boot has been implemented as default by Xilinx. (see xilinx-wiki.atlassian "Using Distro Boot With Xilinx U-Boot") The distro boot functionality is implemented as an extension of the existing U-Boot bootcmd functionality in U-Boot. It extends its functionality by redirecting the call to bootcmd to a call to the distro_bootcmd variable. Code Block |
---|
language | bash |
---|
theme | Midnight |
---|
| bootcmd=run distro_bootcmd |
Distro_bootcmd and Boot_targetsThe distro_bootcmd variable typically contains a sequence of commands that scans a pre-defined list of potential boot targets in search of boot collateral as shown below in an snippet of the printenv Code Block |
---|
language | bash |
---|
theme | Midnight |
---|
| scriptaddr=0x3000000
script_offset_f=fc0000
script_size_f=0x40000
boot_targets=qspi jtag mmc0 mmc1 qspi nand nor usb0 usb1 pxe dhcp
distro_bootcmd=for target in ${boot_targets}; do run bootcmd_${target}; done
bootcmd_qspi=sf probe 0 0 0 && sf read ${scriptaddr} ${script_offset_f} ${script_size_f} && echo QSPI: Trying to boot script at ${scriptaddr} && source ${scriptaddr}; echo QSPI: SCRIPT FAILED: continuing...;
bootcmd_mmc0=devnum=0; run mmc_boot
mmc_boot=if mmc dev ${devnum}; then devtype=mmc; run scan_dev_for_boot_part; fi
|
The boot_targets list is defined in the platform definition in the U-Boot source tree. Depending on the specifics of the target platform, the distro boot infrastructure can either use the boot_targets list to explicitly find specific boot collateral (eg. hard-coded loading once a valid boot target is located) or it can be used to locate some kind of decoupled configuration information. Note |
---|
Not all devices listed in the boot_target list are available. Which devices can be used depends on - the target platform used
- the correct configuration of the hardware in Vivado
- the correct configuration of the u-boot and the device tree in Petalinux
Configuration examples can be found in the corresponding reference designs. |
Boot Method PrecedenceThe order of precedence for searching for boot components is as follows - extlinux.conf file (located in /extlinux/ or /boot/extlinux/)
- boot.scr file + image.ub file
- boot.scr file + individual files (Image, system.dtb, etc.)
In absence of a valid extlinux.conf file, U-Boot will scan the boot_targets list looking for a file named boot.scr.uimg or boot.scr (in that order) and run any commands located in the script file. If your environment requires a different sequence of commands or behaviour, you can edit the boot.scr file to suit your needs.
|