Versions Compared
Key
- This line was added.
- This line was removed.
- Formatting was changed.
Custom_table_size_100 |
---|
Introduction
Expand | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||
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.
The 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.
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. Boot Method Precedence The order of precedence for searching for boot components is as follows
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. |
Using the boot.src method
Install u-boot-tools on Linux OS
Before using the mkimage function, the u-boot-tools needs to be installed.
Code Block | ||||
---|---|---|---|---|
| ||||
sudo apt-get update sudo apt install u-boot-tools |
Generate boot.script file from boot.scr file
For the modification of the boot.scr file convert the existing boot.scr file into an boot.script file:
Code Block | ||||
---|---|---|---|---|
| ||||
dd if=boot.scr of=boot.script bs=72 skip=1 |
Modifying boot.script file
Modify the boot.script file based on your needs. For example, when booting image.ub from SD card, USB or QSPI flash, the following boot.script file should work after conversion into an boot.scr file. The boot.scr file could be located on all working boot_targets.
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
# This is a boot script for U-Boot # Generate boot.scr: # mkimage -c none -A arm -T script -d boot.script boot.scr # # Generate boot.script (for modifications in boot.scr): # dd if=boot.scr of=boot.script bs=72 skip=1 # ################ imageub_addr=0x10000000 # imageub_flash_addr=0x200000 imageub_flash_size=0xD90000 echo [TE_BOOT-01] Trenz Boot-file version 1.0 (development); echo [TE_BOOT-10] Found boot.scr in device: ${target} echo [TE_BOOT-11] Chosen Bootmode is ${modeboot} from boot_targets=${boot_targets}; echo [TE_BOOT-11] Use RAM Address ${imageub_addr} for linux image; for boot_target in ${boot_targets}; do #echo [TE_BOOT-11] currently trying to load from ${target}; #echo [TE_BOOT-12] boot_target = ${boot_target}; #echo [TE_BOOT-13] devtype = ${devtype}; #echo [TE_BOOT-14] devnum = ${devnum}; #echo [TE_BOOT-15] distro_bootpart = ${distro_bootpart}; #echo [TE_BOOT-16] boot_prefixes =for boot_target in ${boot_prefixestargets}; #echo [TE_BOOT-17] source = ${prefix}${script}; do # Boot target is mmc0 or usb0: image.ub on mmc0 or usb0 if test "${boot_target}" = "${devtype}0"; then if test -e ${devtype} 0:${distro_bootpart} /image.ub; then echo [TE_BOOT-20] boot_target is ${boot_target}. Found image.ub on ${devtype}0:${distro_bootpart} ; fatload ${devtype} 0:${distro_bootpart} ${imageub_addr} image.ub; bootm ${imageub_addr}; fi fi # Boot target is mmc1 or usb1: image.ub on mmc1 or usb1 if test "${boot_target}" = "${devtype}1"; then if test -e ${devtype} 1:${distro_bootpart} /image.ub; then echo [TE_BOOT-21] boot_target is ${boot_target}. Found image.ub on ${devtype}1:${distro_bootpart}; fatload ${devtype} 1:${distro_bootpart} ${imageub_addr} image.ub; bootm ${imageub_addr}; fi fi # Boot target is qspi: image.ub on qspi; image.ub is included in BOOT.bin if test "${boot_target}" = "qspi"; then echo [TE_BOOT-30] Try to use image.ub from ${boot_target}, load image.ub from qspi-flash address ${imageub_flash_addr}; echo [TE_BOOT-30] max. image.ub size is ${imageub_flash_size} ; sf probe 0 0 0; sf read ${imageub_addr} ${imageub_flash_addr} ${imageub_flash_size}; bootm ${imageub_addr}; fi done |
Info | ||
---|---|---|
| ||
The alias name ${devnum}, used in Xilinx default files, does not work in all variants tested, therefore the ${devtype} boot_targets were split up |
Generate boot.scr file from boot.script file
Please remember that the boot.script file needs to be converted back into the boot.scr file after the edits are complete
Code Block | ||||
---|---|---|---|---|
| ||||
mkimage -c none -A arm -T script -d boot.script boot.scr |
Distro Boot in SD-Boot mode
Expand | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Variant 1 (Boot.bin, image.ub and boot.scr on SD card):
Variant 2 (Boot.bin on SD card, image.ub and boot.scr on USB):
|
Distro Boot in QSPI-Boot mode
Expand | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Variant 1 (Boot.bin on QSPI Flash and image.ub and boot.scr on SD):
Variant 2 (Boot.bin, image.ub and boot.scr on QSPI Flash):
|
Code Snippets for Boot.scr file
Expand | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||
|
Expand | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||
|
Expand | |||||||||
---|---|---|---|---|---|---|---|---|---|
| |||||||||
|
Expand | |||||||||
---|---|---|---|---|---|---|---|---|---|
| |||||||||
|
References
https://wiki.ubuntu.com/ARM/EditBootscr
Custom_fix_page_content | |
---|---|
|