Utilite U-Boot User How-To's
From Utilite Wiki
Get help with U-Boot commands
Each of the following commands print the full list of commands supported by U-Boot:
To get help for a specific command, run:
Working with environment variables
The U-Boot environment is a collection of settings which are stored in environment variables. You can view, create, delete, and modify environment variables using U-Boot commands.All changes you make to the environment will be discarded after reset, unless the
saveenvcommand is used to save the changes.
- To see all the environment variables and their values, run
- To see the value of only one variable, run
When typing the variable name, you can press Tab to auto complete the variable name, or see a list of completion candidates if there's more than one possible completion.
- To set a value to an environment variable, run
setenv <variable_name> '<new_value>'
The above command will create the environment variable if it does not exist.
- To delete an environment variable, run
Working with storage
U-Boot supports various types of storage, including USB, MMC, SATA, and NAND. With the exception of NAND, all storage types should be detected manually before they can be used. NAND storage is detected automatically by U-Boot.
- The following command detects the SATA storage
- The following command scans for an MMC/SD card
- The following command detects all USB devices connected to the system
Once the storage has been detected, it is possible to read/write into the storage, as well as get information on the storage device. The ls and load commands can be used to display and load the contents of storage devices regardless of the device type and the filesystem on it. To use the ls and load commands, first determine the number of the storage device:
- On NAND, the device number is always 0
- On SATA, the device number is always 0
- On MMC, the device number is always 2
- On USB, the device number can be between 0 and 4. To find the number of the USB storage you want to use, run
Once you've determined the interface and device number for the storage, you are ready to use the ls and load commands. For example:
- To display the contents of the first USB storage device run
ls usb 0
- To load a file from the first USB storage to the memory address 0x10800000, run
load usb 0 10800000 <filename>
To setup networking, run
The above command will contact the local DHCP server and obtain network parameters such as IP address, netmask, TFTP server IP, and more. All of the network parameters can also be setup manually by editing the appropriate environment variables. See Working with environment variables for instructions on how to modify U-Boot environment variables.
List of networking environment variables:
- ipaddr: the IP address assigned to the module
- serverip: the default IP for the TFTP and NFS servers when using the 'tftp' or 'nfs' command
After the network is setup, you can use U-Boot network commands.
- To ping an IP address, run
ping <IP address>
- To load a file to memory using TFTP, run
tftp <memory address> <filename>
- To load a file to memory using NFS, run
nfs <memory address> <filename>
tftp 10800000 myscript.img
Then, to run the script, execute
Enabling HDMI console
- The following commands enable HDMI console:
setenv panel HDMI setenv stdout serial,vga setenv stderr serial,vga saveenv
Enabling USB keyboard
- Plug a USB keyboard into a USB port
- Use the following command to make U-Boot detect it:
- To tell U-Boot to accept console input from a USB keyboard, run the following commands:
setenv stdin serial,usbkbd saveenv
- To make U-Boot detect the USB keyboard on boot, run the following commands:
setenv preboot "usb start" saveenv
The steps for booting linux are:
- Setup the kernel arguments by modifying the bootargs environment variable. For example:
setenv bootargs 'console=ttymxc3,115200 root=/dev/sda2 rootfstype=ext4 rw rootwait'
See Working with environment variables for instructions on how to modify U-Boot environment variables.
- Load the kernel from where it is stored. For example, for a kernel stored on SSD:
sata init load sata 0 10800000 uImage-cm-fx6
- Execute the boot command
OS boot countdown
- After booting, U-Boot begins a countdown before initiating OS boot. OS boot can be interrupted before countdown reaches 0 by pressing any key.
- If the countdown time is set to 0 seconds, it is still possible to stop OS boot by holding Ctrl+C while U-Boot boots.
- To change the countdown time, run the following commands:
setenv bootdelay <seconds> saveenv