NVIDIA Tegra Tegra Linux Driver Package
Development Guide
October 20, 2016 | 21.5 Release

 
U-Boot Guide
 
Requirements
Downloading and Building U-Boot
Flashing U-Boot
Flashing Just U-Boot
Changing the eMMC Partition Layout
Testing RootFS By Device
Building Device Tree Compiler
Adding a Compiled Kernel to the Root File System
Example Sysboot Configuration Files
Debugging U-Boot Environment
U-Boot is the default boot loader for NVIDIA® Tegra® Linux Driver Package (L4T). It replaced Fastboot as of the R21.1 release. If you used an earlier release of L4T, check that your environment is fully updated for the new boot loader before compiling and flashing the boot loader and the kernel.
Requirements
The software requirements for Tegra Linux Driver Package (L4T) include:
Linux-based Host System
Functionality of the U-Boot build and flashing utilities was validated using an Ubuntu 12.04 host system. Later versions of Ubuntu or alternative Linux distributions may work with host-specific modifications.
Tegra Linux Driver Package (L4T)
Download the latest L4T package from the Tegra Developer Zone and follow the installation instructions in the user documentation. You can find L4T on the Tegra Developer Zone:
http://developer.nvidia.com/linux-tegra
Flex and Bison
To parse various configuration files, the U-Boot makefiles require Fast Lexical Analyzer (Flex) and Bison, a GNU general purpose parser generator. If Flex and Bison are not already installed on your host system, you must install them. On Ubuntu, use the following command:
$ sudo apt-get install flex bison
Device Tree Compiler (DTC)
The U-Boot make system must have the full path to the DTC binary. Pass the path as a variable or include the dtc directory in the local command path of the host machine. Most of the DTC packages available from standard Linux distribution package management systems (like apt) are not yet updated with a version of DTC supporting the features required by the U-Boot makefile. Therefore, an example of building DTC from source is included in this chapter. For the procedure, see Building Device Tree Compiler.
A pre-built DTC compiler is also included in the kernel directory of the release. This DTC compiler is built from the kernel sources in this release. The sources are located in the scripts/dtc directory. You build the DTC compiler by building the kernel dtbs target.
ARM tool chain for cross compilation
For more information, see Building Crosstool-ng Toolchain and glibc in this guide.
U-Boot source
For more information, see Downloading and Building U-Boot in this chapter.
Kernel source
For information, see the following sections in the Getting Started chapter:
Setting up the Root File System
Synchronizing the Kernel Sources
Building the NVIDIA Kernel
Also, see Adding a Compiled Kernel to the Root File System in this chapter.
Downloading and Building U-Boot
Before flashing U-Boot to your reference platform, you must download and build it on the Linux host system. NVIDIA offers a Git repository containing the source code for a U-Boot build suitable for L4T.
Prerequisite
Before copying U-Boot, back up the original u-boot.bin file in:
<top>/Linux_for_Tegra/bootloader/<platform>/u-boot.bin
Where <platform> is the Tegra hardware platform, such as ardbeg.
To download and build U-Boot
1. Download the L4T U-Boot source code:
$ mkdir -p <uboot_src_dir>
$ cd <uboot_src_dir>
$ git clone -n git://nv-tegra.nvidia.com/3rdparty/u-boot.git
Alternatively, use the source_sync.sh script in the L4T release.
When running source_sync.sh -u without parameters, the script prompts for the <TAG_NAME>, which is provided in the release notes.
The "-k" option to source_sync syncs only the kernel sources. A space between the -u and -k options is allowed. By default, if no option is provided, the script syncs both kernel and u-boot sources.
Additionally, you can run the script by passing the <TAG_NAME> as follows:
$ cd <your_L4T_root>/Linux_for_Tegra
$ ./source_sync.sh -u <TAG_NAME>
This syncs the source to:
<source_sync.sh_location>/sources/u-boot_source.
The <uboot_src_dir> directory becomes:
<your_L4T_root>/Linux_for_Tegra/sources/u-boot_source.
2. Check out the Git tag name:
$ cd u-boot
$ git checkout -b <branch_name> <tag_name>
Where:
<branch_name> is the name of your local branch.
<tag_name> is the release tag name provided in the Release Notes.
3. Set the build environment:
$ export ARCH=arm
$ export CROSS_COMPILE=<your_toolchain_location>
$ export DTC=<dtc_binary_location>
4. Build U-Boot by executing:
$ cd <uboot_src_dir>/u-boot
$ make distclean
$ make <target_board>_defconfig
$ make
Where <target_board> is the device, such as code-name jetson-tk1 for Jetson TK1.
Flashing U-Boot
You must flash U-Boot to internal eMMC only. During flashing, U-Boot fetches the boot script and kernel and mounts the rootfs, which may reside on one of the following storage devices:
Internal eMMC
An SD card
An USB storage device
An IP network
When executing the script that flashes U-Boot, you must specify a command-line option appropriate to the storage device containing the boot script, kernel, and rootfs. The following sections describe the script command for each configuration.
Support for BOARDID
NVIDIA uses the Board ID scheme to identify each board and the boot process checks for its ID to proceed. However, for some of the partners designing their own board, Board ID is not used and, thus, setting it should be skipped so the boot code knows not to check its ID and refuse booting if the check fails.
However, executing BOARDID should be uncommented in the jetson-tk1.conf file before executing flash.sh when you don’t have an EEPROM with a correctly flashed Board ID and you want to pass a custom, or known, Board ID while flashing. Doing so overrides the EEPROM value, if present. For example:
BOARDID="0x177 0x00 0x03";
Note: When booting from external media, you must run the flash.sh script as the last step when deploying/configuring the target. This is because the flash.sh script copies the appropriate extlinux.conf file and the only way to know that it is the proper file is when we know which device is being flashed during flash.sh.
To flash U-Boot and mount the rootfs from internal eMMC
Use the following command to fetch the boot script and kernel and mounts rootfs from internal eMMC:
$ sudo ./flash.sh <target_board> mmcblk0p1
Where <target_board> is jetson-tk1 for Jetson TK1.
Note: Check that your environment is fully updated for this change in boot loader before compiling and flashing the boot loader and the kernel.
To flash U-Boot and mount the rootfs from an SD card
Use the following command to fetch the boot script and kernel and mounts rootfs from an SD card:
$ sudo ./flash.sh <target_board> mmcblk1p1
Where <target_board> is jetson-tk1 for Jetson TK1.
To flash U-Boot and mount the rootfs from a USB storage device
Use the following command to fetch the boot script and kernel and to mount the rootfs from a USB storage device, such as a Pen Drive.
$ sudo ./flash.sh <target_board> sda1
Where <target_board> is jetson-tk1 for Jetson TK1.
Note: The U-Boot boot loader only detects USB external storage. The kernel detects both USB external storage and external SCSI_SATA storage.
Use only 1 external USB storage device at a time. If using more than 1 external device, a random device may be chosen as root device.
To flash U-Boot and mount the rootfs from an IP network
Use the following command to fetch the boot script and kernel and mount the rootfs from an IP network:
$ sudo ./flash.sh -N <IPA>:/<nfs directory> [-n <target IPA>:<host IPA>:<gateway IPA>:<netmask>] <target_board> <interface name>
Where:
<target_board> is jetson-tk1 for Jetson TK1.
<interface name> is eth0 for RJ45 connector and eth1 for USB Ethernet dongle.
<IPA> is the NFS server hosting the rootfs.
<nfs_directory> is the full path name of exported rootfs.
<target IPA> is the static IP address for the target device.
<host IPA> is the static IP address for the NFS server.
<gateway IPA> is the static IP address for the gateway.
<netmask> is the static netmask for the local network.
Note: The -n option is only recommended on point-to-point network connections where no DHCP server is configured.
Flashing Just U-Boot
You can find instructions for flashing the full L4T image to the reference platform in Flashing U-Boot in this chapter. If, however, you wish to flash just U-Boot, proceed as follows.
To copy U-Boot for flashing to the reference platform
Execute the following on your Linux host system:
$ cp <uboot_src_dir>/u-boot/u-boot-dtb-tegra.bin <your_L4T_root>/Linux_for_Tegra/bootloader/<platform>/u-boot.bin
To flash just new U-Boot
Execute the following:
$ sudo ./flash.sh -k EBT <target_board> mmcblk0p1
Where <target_board> is jetson-tk1 for Jetson TK1.
Changing the eMMC Partition Layout
The following information is based on eMMC hardware and software layout information in the following files:
<target_board>.conf
<top>/Linux_for_Tegra/bootloader/<platform>/cfg/gnu_linux_fastboot_emmc_full.cfg
Where <top> is the L4T root, where flash.sh generates the internal eMMC partition layout. When you use the NvFlash utility and the fastboot.bin flash application, L4T U-Boot does not use the kernel partition.
Applies to: R21.2 and earlier releases: Aside from this difference with respect to the kernel partition, U-Boot has the same internal eMMC partition layout as that used by Fastboot.
eMMC IC Parameter
The eMMC IC parameter is defined by 2 variables in the <target_board>.conf file. They limit the size of the total usable data area and determine the location of GPT partitions.
The BOOTPARTSIZE parameter specifies the eMMC boot partition size (boot0 partition size + boot1 partition size)
The EMMCSIZE parameter specifies the eMMC usable data size (BOOTPARTSIZE + user partition size)
Note: boot0, boot1, and user partition size can be obtained from the eMMC device data sheet.
RootFS Size
The rootfs partition is the largest of the partitions, and its size is one of the key factors in partition layout determination. By default, flash.sh sets the rootfs size at 14 GB. You can change this by modifying the value of the ROOTFSSIZE variable in the <target_board>.conf file.
Note: The total space used by all partitions cannot exceed EMMCSIZE.
GPT Partitions
The flash.sh script creates the primary and secondary GPT partitions automatically, based on the internal eMMC partition layout. The Protective MBR contains device information to prevent traditional boot loaders from performing destructive actions. The primary GPT partition contains the GUID Partition Table. The secondary GPT partition contains the same information as the primary GPT and serves as the backup. The Protective MBR is located at LBA 0, the primary GPT is located at LBA 1, and the secondary GPT is located at the last LBA of the boot device. The last Logical Block Address (LBA) varies from device to device. Both U-Boot and the kernel are able to obtain the last LBA.
LNX Partition
Normally, the LNX partition is not used by U-Boot; however, for compatibility, an empty LNX partition is allocated.
APP Partition
If rootfs storage is in eMMC, the rootfs is flashed to this partition. U-Boot expects boot script, kernel, and DTB files in the <rootfs>/boot directory; consequently, flash.sh flashes the following kernel files in the APP partition:
kernel (zImage)
device_tree_blob (tegra124-jetson_tk1-pm375-000-c00-00.dtb)
sysboot_config (extlinux.conf)
Note: The flash.sh script treats the rootfs-on-IP-network configuration as a special case and also flashes these kernel files in the <APP partition>:/boot directory.
Example Full Internal eMMC Partition Layout
An eMMC layout configuration file (cfg) generally has the following contents. The actual configuration file is named: gnu_linux_fastboot_emmc_full.cfg file.
Note: Under default settings, U-Boot does not use the kernel partition (LNX).
[device]
type=sdmmc
instance=3
 
[partition]
name=BCT
id=2
type=boot_config_table
allocation_policy=sequential
filesystem_type=basic
size=2097152 #BCTSIZE
file_system_attribute=0
partition_attribute=0
allocation_attribute=8
percent_reserved=0
 
[partition]
name=PPT
id=3
type=data
allocation_policy=sequential
filesystem_type=basic
size=8388608 #PPTSIZE
file_system_attribute=0
partition_attribute=0
allocation_attribute=8
percent_reserved=0
#filename=ppt.img
 
[partition]
name=PT
id=4
type=partition_table
allocation_policy=sequential
filesystem_type=basic
size=2097152
file_system_attribute=0
partition_attribute=0
allocation_attribute=8
percent_reserved=0
 
[partition]
name=EBT
id=5
type=bootloader
allocation_policy=sequential
filesystem_type=basic
size=4194304
file_system_attribute=0
partition_attribute=0
allocation_attribute=8
percent_reserved=0
filename=fastboot.bin
 
[partition]
name=LNX
id=6
type=data
allocation_policy=sequential
filesystem_type=basic
size=16777216
file_system_attribute=0
partition_attribute=0
allocation_attribute=8
percent_reserved=0
filename=boot.img
 
[partition]
name=SOS
id=7
type=data
allocation_policy=sequential
filesystem_type=basic
size=6291456
file_system_attribute=0
partition_attribute=0
allocation_attribute=8
percent_reserved=0
#filename=recovery.img
 
[partition]
name=NVC
id=8
type=data #TEGRABOOT
allocation_policy=sequential
filesystem_type=basic
size=2097152
file_system_attribute=0
partition_attribute=0
allocation_attribute=8
percent_reserved=0
#filename=nvtboot.bin
 
[partition]
name=MPB
id=9
type=data #MTSPREBOOT
allocation_policy=sequential
filesystem_type=basic
size=6291456
file_system_attribute=0
partition_attribute=0
allocation_attribute=8
percent_reserved=0
#filename=mts_preboot_si
 
[partition]
name=MBP
id=10
type=data #MTSBOOTPACK
allocation_policy=sequential
filesystem_type=basic
size=6291456
file_system_attribute=0
partition_attribute=0
allocation_attribute=8
percent_reserved=0
#filename=mts_si
 
[partition]
name=GP1
id=11
type=GP1
allocation_policy=sequential
filesystem_type=basic
size=2097152
file_system_attribute=0
partition_attribute=0
allocation_attribute=8
percent_reserved=0
 
[partition]
name=APP
id=12
type=data
allocation_policy=sequential
filesystem_type=basic
size=1073741824
file_system_attribute=0
partition_attribute=0
allocation_attribute=8
percent_reserved=0
filename=system.img
 
[partition]
name=DTB
id=13
type=data
allocation_policy=sequential
filesystem_type=basic
size=4194304
file_system_attribute=0
partition_attribute=0
allocation_attribute=8
percent_reserved=0
#filename=tegra.dtb
 
[partition]
name=EFI
id=14
type=data
allocation_policy=sequential
filesystem_type=basic
size=67108864 #EFISIZE
file_system_attribute=0
partition_attribute=0
allocation_attribute=8
percent_reserved=0
#filename=efi.img
 
[partition]
name=USP
id=15
type=data
allocation_policy=sequential
filesystem_type=basic
size=4194304
file_system_attribute=0
partition_attribute=0
allocation_attribute=8
percent_reserved=0
 
[partition]
name=TP1
id=16
type=data
allocation_policy=sequential
filesystem_type=basic
size=4194304
file_system_attribute=0
partition_attribute=0
allocation_attribute=8
percent_reserved=0
 
[partition]
name=TP2
id=17
type=data
allocation_policy=sequential
filesystem_type=basic
size=4194304
file_system_attribute=0
partition_attribute=0
allocation_attribute=8
percent_reserved=0
 
[partition]
name=TP3
id=18
type=data
allocation_policy=sequential
filesystem_type=basic
size=4194304
file_system_attribute=0
partition_attribute=0
allocation_attribute=8
percent_reserved=0
 
[partition]
name=WB0
id=19
type=data #WB0BOOT
allocation_policy=sequential
filesystem_type=basic
size=2097152
file_system_attribute=0
partition_attribute=0
allocation_attribute=8
percent_reserved=0
#filename=nvtbootwb0.bin
 
[partition]
name=UDA
id=20
type=data
allocation_policy=sequential
filesystem_type=basic
size=2097152
file_system_attribute=0
partition_attribute=0
allocation_attribute=0x808
percent_reserved=0
 
[partition]
name=GPT
id=21
type=GPT
allocation_policy=sequential
filesystem_type=basic
size=0xFFFFFFFFFFFFFFFF
file_system_attribute=0
partition_attribute=0
allocation_attribute=8
percent_reserved=0
#filename=spt.img
Testing RootFS By Device
You must test the root file system location by device. A Y in the output indicates that correct U-Boot initialization and hand-off to the kernel occurred.
RootFS Location
Jetson TK1
mmcblk0p1
Y
mmcblk1p1
Y
sda1
Y
eth0
Y
eth1
Y
Building Device Tree Compiler
Build the Device Tree Compiler (DTC) from source code included in L4T, specifying the features required by the U-Boot makefile.
Note: In the following procedure, if you do not want to pass in dtc as a parameter to the U-Boot environment, ensure a local command path (such as ./usr/local/bin or another choice) is at the beginning of the shell command path. Furthermore, if you execute:
$ make install
The dtc makefile installs the binary into the first entry of shell PATH variable. Therefore, it is important that the local command path is at the beginning of the shell PATH variable.
To build DTC from source
1. Execute the following commands:
$ export PATH=<local_command_path>:${PATH}
2. Create a directory to contain the dtc source code and change directories into it:
$ mkdir -p <dtc_src_dir>
$ cd <dtc_src_dir>
3. Download dtc source code by executing the following git clone command:
$ git clone git://git.kernel.org/pub/scm/utils/dtc/dtc.git
4. Build and optionally install dtc by executing:
$ cd <dtc_src_dir>/dtc
$ make
Or, alternatively, if you want it installed on your local host file system execute:
$ make install
Adding a Compiled Kernel to the Root File System
 
Adding a new Kernel
U-Boot requires a kernel image on the rootfs. First you must configure the file system for U-Boot. Then you add the kernel image to the rootfs.
Prerequisite
You have compiled the kernel as described in Getting Started in this guide.
To configure a file system for U-Boot
1. Use the apply_binaries script to copy the zImage in the kernel directory into the rootfs directory in the /boot folder.
2. Install the rootfs directory onto your device.
For U-Boot to function properly, there must be zImage and dtb files in the /boot directory of the target file system.
For more information on installing the rootfs directory onto your device, see Setting Up the Root File System in the Getting Started chapter.
3. If you have already installed your rootfs onto a device, manually copy the zImage file and dtb files to the installed root file system.
To configure a file system installed in the internal eMMC
1. Optionally, backup the existing release kernel and dtb files to avoid overwriting.
2. Copy the compiled zImage and dtb files over the current L4T release kernel directory by executing the following commands:
$ cp arch/arm/boot/zImage <L4T_path>/Linux_for_Tegra/kernel
$ cp arch/arm/boot/dts/tegra124-jetson_tk1-pm375-000-c00-00.dtb <L4T_path>/Linux_for_Tegra/kernel/dtb
flash.sh automatically copies the zImage to the internal eMMC rootfs.
Adding a new Kernel
After U-Boot has been flashed as the default boot loader, you can replace the kernel. The procedure you should follow depends on the kind of storage device from which your device boots.
To replace the kernel in systems that boot from internal eMMC
1. Boot the Jetson TK1 system and log in.
2. Copy the new kernel files (using scp) into the /boot directory.
3. Reboot the Jetson TK1 system.
To replace the kernel in systems that boot from an SD Card or USB Pen Drive
1. Connect the SD Card or USB Pen Drive to your host system.
2. Copy the new kernel files to a /boot directory on the SD Card or USB Pen Drive.
3. Disconnect the SD Card or USB Pen Drive from the host system.
4. Connect the SD Card or USB Pen Drive to the Jetson TK1 system.
5. Reboot the Jetson TK1 system.
To replace the kernel in systems that boot from an IP network
1. Boot the Jetson TK1 system and log in.
2. On the target system enter the following command:
$ sudo mount /dev/mmcblk0p1 /mnt
3. Copy the new kernel files (using scp) to the mnt/boot directory.
4. Reboot the Jetson TK1 system.
Example Sysboot Configuration Files
 
eMMC Sysboot extlinux.conf File
For external media, you must copy the rootfs to the device after running the flash.sh command. Then you attach the device.
The U-Boot functionality includes a default booting scan sequence. It scans bootable devices in the following order:
External SD Card
Internal eMMC
USB Device
NFS Device
It looks for an extlinux.conf configuration file in the following directory of the bootable device:
<rootfs>/boot/extlinux
Upon finding the extlinux.conf file, U-Boot does the following.
Uses the sysboot command to read out boot configuration from extlinux.conf,
Loads kernel zImage file and device tree file, and then
Boots the kernel.
The zImage and device tree files are all user-accessible in the <rootfs>/boot location after booting. The extlinux.conf file is user accessible in the <rootfs>/boot/extlinux location. Users can easily change these files to test their own kernel without flashing.
The file extlinux.conf is a standard text-format sysboot configuration file that contains all boot information. It indicates the U-Boot kernel image filename, the device tree blob filename, and the kernel boot command line. There are four example extlinux.conf files provided in the L4T release:
<target_board>_extlinux.conf.emmc
<target_board>_extlinux.conf.sdcard
<target_board>_extlinux.conf.usb
<target_board>_extlinux.conf.nfs
During flashing, flash.sh copies the appropriate variant to the following location:
<rootfs>/boot/extlinux/extlinux.conf
The extlinux.conf files are very similar except for different kernel boot command lines. You can find the extlinux.conf files in the following location:
bootloader/<platform>/
Where <platform> is ardbeg for Jetson TK1.
eMMC Sysboot extlinux.conf File
The extlinux.conf file has the following contents.
TIMEOUT 30
DEFAULT primary
 
MENU TITLE Jetson-TK1 eMMC boot option
 
LABEL primary
      MENU LABEL primary kernel
      LINUX zImage
      FDT /boot/tegra124-jetson_tk1-pm375-000-c00-00.dtb
      APPEND console=ttyS0,115200n8 console=tty1 no_console_suspend=1
lp0_vec=2064@0xf46ff000 video=tegrafb mem=1862M@2048M memtype=255
ddr_die=2048M@2048M section=256M pmuboard=0x0177:0x0000:0x02:0x43:0x00
vpr=151M@3945M tsec=32M@3913M otf_key=c75e5bb91eb3bd947560357b64422f85
usbcore.old_scheme_first=1 core_edp_mv=1150 core_edp_ma=4000
tegraid=40.1.1.0.0 debug_uartport=lsport,3 power_supply=Adapter
audio_codec=rt5640 modem_id=0 android.kerneltype=normal
usb_port_owner_info=0 fbcon=map:1 commchip_id=0 usb_port_owner_info=0
lane_owner_info=6 emc_max_dvfs=0 touch_id=0@0
tegra_fbmem=32899072@0xad012000
board_info=0x0177:0x0000:0x02:0x43:0x00 root=/dev/mmcblk0p1 rw
rootwait tegraboot=sdmmc gpt
Different boot methods have different APPEND strings in the extlinux.conf file. Check each file for details.
Note: NFS booting also uses eMMC as boot device. <rootfs>/boot is flashed into to eMMC but kernel mounts NFS device as rootfs.
Debugging U-Boot Environment
 
Interrupting U-Boot
Getting Help
Listing a Directory Structure
Listing the Contents of a Directory
Printing the U-Boot Environment
Printing/Setting Environment Variables
Use these debugging tips to help you debug your U-Boot environment. These examples do not represent a comprehensive listing of U-Boot functionality. For a full list of supported commands and their usage by U-Boot, consult U-Boot documentation and source.
When creating your own kernel, U-Boot sometimes has trouble finding it. To eliminate this issue, use the commands in these examples to verify that U-Boot can read the device and can see the files in the system. If a boot device is not found, or the device has trouble booting with a kernel other than the reference kernel provided in the L4T release, review these examples for debugging purposes.
Interrupting U-Boot
You can interrupt U-Boot during boot.
To interrupt U-Boot
Press any key during boot.
Getting Help
On the U-Boot terminal screen, type help at any time for the list of supported commands from the U-Boot terminal.
To see the U-Boot Help text
To see the U-Boot help text enter the following command:
# help
The following example Help information is printed when executing help on a Jetson TK1 device.
?       - alias for 'help'
base    - print or set address offset
bdinfo  - print Board Info structure
boot    - boot default, i.e., run 'bootcmd'
bootd   - boot default, i.e., run 'bootcmd'
bootelf - Boot from an ELF image in memory
bootm   - boot application image from memory
bootp   - boot image via network using BOOTP/TFTP protocol
bootvx  - Boot vxWorks from an ELF image
bootz   - boot Linux zImage image from memory
cmp     - memory compare
coninfo - print console devices and information
cp      - memory copy
crc32   - checksum calculation
dfu - Device Firmware Upgrade
dhcp - boot image via network using DHCP/TFTP protocol
dm - Driver model low level access
echo    - echo args to console
editenv - edit environment variable
enterrcm- reset Tegra and enter USB Recovery Mode
env     - environment handling commands
exit    - exit script
ext2load- load binary file from a Ext2 filesystem
ext2ls  - list files in a directory (default /)
ext4load- load binary file from a Ext4 filesystem
ext4ls  - list files in a directory (default /)
false   - do nothing, unsuccessfully
fatinfo - print information about filesystem
fatload - load binary file from a dos filesystem
fatls   - list files in a directory (default /)
fdt     - flattened device tree utility commands
go      - start application at address 'addr'
gpio    - query and control gpio pins
help    - print command description/usage
i2c     - I2C sub-system
imxtract- extract a part of a multi-image
itest   - return true/false on integer compare
load    - load binary file from a filesystem
loadb   - load binary file over serial line (kermit mode)
loads   - load S-Record file over serial line
loadx   - load binary file over serial line (xmodem mode)
loady   - load binary file over serial line (ymodem mode)
loop    - infinite loop on address range
ls      - list files in a directory (default /)
md      - memory display
mii     - MII utility commands
mm      - memory modify (auto-incrementing address)
mmc     - MMC sub system
mmcinfo - display MMC info
mw      - memory write (fill)
nm      - memory modify (constant address)
part    - disk partition related commands
pci - list and access PCI Configuration Space
ping    - send ICMP ECHO_REQUEST to network host
printenv- print environment variables
pxe     - commands to get and boot from pxe files
reset   - Perform RESET of the CPU
run     - run commands in an environment variable
saveenv - save environment variables to persistent storage
setenv  - set environment variables
sf      - SPI flash sub-system
showvar - print local hushshell variables
size - determine a file’s size
sleep   - delay execution for some timesource  - run script from memorysspi    - SPI utility command
sysboot - command to get and boot from syslinux files
test    - minimal test like /bin/sh
tftpboot- boot image via network using TFTP protocol
true    - do nothing, successfully
ums - Use the UMS [User Mass Storage]
usb     - USB sub-system
usbboot - boot from USB device
version - print monitor, compiler and linker version
Listing a Directory Structure
You can list the directory structure of a particular device. For example, to list the directory structure of sda1 in U-Boot by type: mmc 0:1 (for eMMC device 0 partition 1).
To list the directory structure
To list the directory structure enter the following command:
# ext2ls mmc 0:1
This also functions correctly on EXT3/EXT4 file systems.
Example output follows:
<DIR> 4096 .
<DIR> 4096 ..
<DIR> 4096 bin
<DIR> 4096 boot
<DIR> 4096 dev
<DIR> 4096 etc
<DIR> 4096 home
<DIR> 4096 lib
<DIR> 4096 lost+found
<DIR> 4096 media
<DIR> 4096 mnt
<DIR> 4096 opt
<DIR> 4096 proc
<DIR> 4096 root
<DIR> 4096 sbin
<DIR> 4096 selinux
<DIR> 4096 srv
<DIR> 4096 sys
<DIR> 4096 tmp
<DIR> 4096 usr
<DIR> 4096 var
Listing the Contents of a Directory
You can list the contents of any directory.
To list the contents of a directory
List directory contents with the following command:
# ext2ls mmc 0:1 <directory>
Where <directory> is an expected path on the device.
For example, to list contents of the /boot directory where the zImage file should be, (as shown in the example output below), use the following command:
# ext2ls mmc 0:1 /boot
<DIR>       1024 .
<DIR>       1024 ..
           34642 tegra124-pm375.dtb
             908 extlinux.conf
         5910248 zImage
Printing the U-Boot Environment
You can print the entire U-Boot environment.
To print the U-Boot environment
Execute the following command:
# printenv
Printing/Setting Environment Variables
You can print and set environment variables.
To print an environment variable
Execute the following command:
# printenv <environment_variable>
Where <environment_variable> refers to an environment variable in U-Boot.
For example, to print the boot device partition number, execute:
# printenv pn
Output can be as follows:
pn=1
To set an environment variable
Execute the following command:
# setenv <environment_variable> <new_value>
Where <environment_variable> refers to an environment variable in U-Boot and <new_value> is the new value for that variable.
For example, to set the partition number variable, enter the following command:
# setenv pn 1
To save the modified environment
Execute the following command:
# saveenv
The saved modified environment is preserved in case of resets and reboots.