TS-7250-V3 U-Boot 2020.01 Reference Manual
U-Boot
This platform includes U-Boot as the bootloader to load and boot the full operating system. The i.MX6UL processor loads U-Boot from the eMMC flash at power-on. U-Boot allows booting images from the microSD, eMMC, NFS, or USB. U-Boot is a general purpose bootloader that is capable of booting into common Linux distributions, Android, QNX, or others.
Most users will not need to customize u-boot further, and can skip this section.
On a normal boot, output from U-Boot will be similar to the following:
U-Boot 2016.03-00305-g75344a5 (Dec 15 2017 - 13:53:14 -0800)
CPU: Freescale i.MX6UL rev1.1 at 396 MHz
Reset cause: WDOG
Board: Technologic Systems TS-7553-V2
I2C: ready
DRAM: 512 MiB
MMC: FSL_SDHC: 0, FSL_SDHC: 1
Net: FEC0 [PRIME]
Booting from the SD card ...
** File not found /boot/boot.ub **
34511 bytes read in 162 ms (208 KiB/s)
5460520 bytes read in 391 ms (13.3 MiB/s)
NO CHRG jumper is set, not waiting
Kernel image @ 0x80800000 [ 0x000000 - 0x535228 ]
## Flattened Device Tree blob at 83000000
Booting using the fdt blob at 0x83000000
Using Device Tree in place at 83000000, end 8300b6ce
Starting kernel ...
U-Boot Distro Boot
U-Boot uses the upstream distro boot flow to decide where to load Linux from. As shipped, this board boots from the preprogrammed eMMC Debian image.
By default this checks:
| Order | U-Boot device name | Description |
|---|---|---|
| 1 | usb0 | First detected USB mass storage device |
| 2 | mmc1 | microSD card |
| 3 | mmc0 | Onboard eMMC storage |
| 4 | dhcp | DHCP-advertised boot script |
| 5 | pxe | DHCP-advertised PXE file |
The boot order can be changed from the U-Boot shell:
# Boot straight to eMMC
env set boot_targets 'mmc0'
env save
# Boot to USB, then eMMC
env set boot_targets 'usb0 mmc0'
env save
# Restore the default boot order
env set boot_targets 'usb0 mmc1 mmc0 dhcp pxe'
env save
U-Boot searches the first partition, or the GPT bootable partition, for these boot files:
| Order | Search for | Paths | Description |
|---|---|---|---|
| 1 | extlinux | /extlinux/extlinux.conf, /boot/extlinux/extlinux.conf | Menu configuration for kernels |
| 2 | U-Boot script | /boot.scr.uimg, /boot.scr, /boot/boot.scr.uimg, /boot/boot.scr | Script with OS load instructions |
| 3 | EFI binary | efi/boot/bootarm.efi | EFI binary such as GRUB |
The embeddedTS Debian images use /boot/boot.scr.uimg.
U-Boot Environment
The U-Boot environment is stored in the on-board eMMC hardware boot partition at /dev/mmcblk0boot0.
# Print all environment variables
env print -a
# Set the boot shell timeout to 5 seconds
env set bootdelay 5
# Variables can contain commands
env set hellocmd 'led 0 off; echo Hello world; led 1 on;'
# Execute commands saved in a variable
env run hellocmd
# Save environment changes
env save
# Restore the default environment
env default -a
# Remove a variable
env delete hellocmd
U-Boot Commands
# Get command help
help
help i2c
# Boot a Linux zImage loaded at $loadaddr
bootz
bootz ${loadaddr} - ${fdtaddr}
# Copy files from boot media
load mmc 0:1 ${loadaddr} /boot/zImage
load mmc 1:1 ${loadaddr} /boot/zImage
usb start
load usb 0:1 ${loadaddr} /boot/zImage
# View the device tree from U-Boot
load mmc 0:1 ${fdtaddr} /boot/imx6ul-ts7250v3.dtb
fdt addr ${fdtaddr}
fdt print
# Jump to a loaded binary
load mmc 0:1 ${loadaddr} /boot/custombinary
go ${loadaddr}
# Browse filesystems
ls mmc 0:1 /
# Test memory
mtest
# Rescan and inspect microSD media
mmc rescan
mmc dev 1
mmcinfo
Modify Linux Kernel cmdline
The Linux kernel cmdline can be customized by modifying the
cmdline_append variable. If new arguments are added, the existing value
should also be included with the new arguments.
env set cmdline_append rw rootwait console=ttymxc0,115200 quiet
env save
The kernel command line can also be modified from from the onboard Linux. From the linux shell prompt run the following commands to install the necessary tools and create the script:
apt-get update && apt-get install u-boot-tools -y
echo "env set cmdline_append rw rootwait console=ttymxc0,115200 quiet" > /boot/boot.scr
mkimage -A arm -T script -C none -n 'tsimx6ul boot script' -d /boot/boot.scr /boot/boot.ub
The boot.scr includes the plain text commands to be run in U-Boot on startup. The mkimage tool adds a checksum and header to this file which can be loaded by U-Boot. The .ub file should not be edited directly.
Booting From NFS
U-Boot's NFS support can be used to load a kernel, device tree binary, and root filesystem. The default scripts include an example NFS boot script. Because of the way U-Boot tries to infer server data, the script we use will bypass this, making it more straightforward to use an NFS root that will not be heavily dependent on a particular network configuration.
# Set this to your NFS server IP and NFS directory path
env set serverip 192.168.0.1
env set nfsroot ${serverip}:/path/to/nfs/rootfs/
env save
To boot your NFS root:
# Boot to NFS once
run nfsboot;
# To make the NFS boot the persistent default
env set bootcmd run nfsboot;
env save
If bootcmd is used to test for whether the system should stop at the U-Boot shell or continue, the above will make it difficult to get back to the U-Boot shell as it will always attempt to boot regardless of jumper status.
U-Boot Development
This upstream section is still marked incomplete and subject to change for TS-7250-V3 engineering sampling hardware.
embeddedTS provides U-Boot sources, but rebuilding bootloader binaries is not recommended unless necessary because invalid binaries can leave the board unbootable.
git clone https://github.com/embeddedTS/u-boot-imx.git -b v2020.01-ts u-boot-ts7250v3
cd u-boot-ts7250v3
export ARCH=arm
export CROSS_COMPILE=arm-linux-gnueabihf-
make ts7180_defconfig clean all
The build outputs SPL and u-boot-dtb.img, which are the files used when updating the bootloader.