NVIDIA Tegra
NVIDIA Tegra Linux Driver Package

Development Guide
28.1 Release


 
U-Boot Customization
 
Requirements
Downloading and Building U-Boot
Flashing U-Boot Full L4T Image
Flashing U-Boot Only
Changing the eMMC Partition Layout
Building the Device Tree Compiler
Replacing the Kernel
Copying the Root Filesystem
Boot Sequence and Sysboot Configuration Files
Optimizing U-Boot Boot Time
Environment Configuration
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
TX2 MB1 Platform Configuration
TX2 Prod Configuration
TX2 Configuring Pinmux GPIO and PAD
U-Boot is the default boot loader for NVIDIA® Tegra® Linux Driver Package (L4T).
Requirements
The software requirements and prerequisites include:
Linux-based Host System
Functionality of the U-Boot build and flashing utilities are validated using an Ubuntu <os_ver_host> host system. Later versions of Ubuntu, or alternative Linux distributions, may work with host-specific modifications.
Tegra Linux Driver Package (L4T)
Download and install the latest L4T package from the Tegra Developer Zone:
http://developer.nvidia.com/linux-tegra
Device Tree Compiler (DTC)
The DTC is used to compile device tree files contained in the U-Boot source tree. Many of the DTC packages available from standard Linux distribution package management systems, like APT, are not updated with a version of DTC that supports the features required by the U‑Boot makefile.
For a detailed example of building DTC from source see Building Device Tree Compiler.
A pre-built DTC binary is included in the kernel directory of the release. This binary is built from the kernel sources in this release. The sources are located in the scripts/dtc directory. You build DTC by building the kernel dtbs target.
Download the Linaro Aarch64 toolchain available at:
https://www.linaro.org/downloads/
U‑Boot source
For information, see Downloading and Building U-Boot.
Kernel source
For information, see:
Setting up the Root File System
Downloading the Kernel Source
Building the NVIDIA Kernel
Adding a Compiled Kernel to the Root File System
Downloading and Building U-Boot
 
Prerequisite
Before Flashing
Before flashing U-Boot to your reference platform, you must download and build it on your Linux host system. NVIDIA offers a Git repository containing the source code for a version of U‑Boot suitable for L4T.
Prerequisite
Before over-writing the U-Boot binaries with the extracted L4T release package, backup all of the original U-Boot files in:
Linux_for_Tegra/bootloader/<platform>/<board_and_rev>/
Where:
<platform> is the SOC name or platform.
<board_and_rev> is:
Jetson TX1: p2371-2180
Jetson TX2: p2771-0000/500
To download and build U-Boot
1. Perform either of the following options:
Execute the following command:
$ git clone -n git://nv-tegra.nvidia.com/3rdparty/u-boot.git
Use the source_sync.sh script in the L4T release.
If you run source_sync.sh -u without parameters, the script prompts for the <tag_name>, which is the release tag name as provided in the Release Notes.
The -k option to source_sync syncs the kernel sources. A space between the -u and -k options is allowed. By default, if no option is provided, the script syncs the kernel and u-boot sources.
Also, 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
Note:
The rest of these instructions assume your current working directory is the U-Boot source tree.
2. Checkout the Git tag name:
$ git checkout -b <branch_name> <tag_name>
Where:
<branch_name> is the name of your local branch.
<tag_name> is the release tag name as provided in the Release Notes.
3. Set the build environment:
$ export CROSS_COMPILE=<your_toolchain_location>
For example, export CROSS_COMPILE=aarch64-linux-gnu-
4. Build U-Boot by executing:
$ make distclean
$ make <board_and_rev>_defconfig
$ make
Where: <board_and_rev> is:
Jetson TX1: p2371-2180
Jetson TX2: p2771-0000-500
Before Flashing
Before flashing, you must copy the updated U-Boot to the L4T tree.
To copy the updated U-Boot for flashing, to the reference platform
Execute the following command on your Linux host system:
$ cp <uboot_src_dir>/u-boot{,.bin,.dtb,-dtb.bin} \
<your_L4T_root>/Linux_for_Tegra/bootloader/<platform>/<board_and_rev>
Where <board_and_rev> is:
Jetson TX1: p2371-2180
Jetson TX2: p2771-0000/500
Flashing U-Boot Full L4T Image
You must flash U-Boot to internal eMMC only. At boot time, U-Boot fetches the boot configuration file, kernel and device tree, which can reside on one of the following storage devices used for boot:
Internal eMMC
An SD card
When executing the script that flashes U-Boot, specify a command-line option to identify the storage device containing the root filesystem. This is required so that the appropriate boot configuration file is selected. The boot configuration file contains kernel command line parameters that control where the Linux kernel looks for the root filesystem.
To flash U-Boot and select the script to mount the root filesystem from internal eMMC
Select a boot configuration file that causes the kernel to mount the root filesystem from internal eMMC:
$ sudo ./flash.sh <platform> mmcblk0p1
To flash U-Boot and set the script to mount the root filesystem from an SD card
Select a boot configuration file that causes the kernel to mount the root filesystem from an SD card:
$ sudo ./flash.sh <platform> mmcblk1p1
To flash U-Boot and select the script to mount the root filesystem from an NFS server
Select a boot configuration file that causes the kernel to mount the root filesystem from an NFS server:
$ sudo ./flash.sh -N <IPA>:/<nfs directory> [-n <target IPA>:<host IPA>:<gateway IPA>:<netmask>] <platform> <interface name>
Where:
<interface name> is eth0 for RJ45 connector and eth1 for a USB Ethernet dongle.
<IPA> is the NFS server hosting the root filesystem.
<nfs_directory> is the full pathname of exported root filesystem.
<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 recommended on point-to-point network connections where no DHCP server is configured.
Flashing U-Boot Only
To flash the full L4T image to the reference platform see Flashing U-Boot Full L4T Image above. To flash a new version of U-Boot, perform the following:
To flash the new U-Boot
Execute the following command on Jetson TX1:
$ sudo ./flash.sh -k EBT <platform> mmcblk0p1
Execute the following command on Jetson TX2:
$ sudo ./flash.sh -k kernel <platform> mmcblk0p1
Changing the eMMC Partition Layout
 
eMMC IC Parameter
Root Filesystem Size
GPT Partitions
LNX Partition
APP Partition
Full Internal eMMC Partition Layout
The following information is based on eMMC hardware and software layout information in the following files:
Linux_for_Tegra/<target_board>.conf.common
Linux_for_Tegra/bootloader/<platform>/cfg/gnu_linux_tegraboot_emmc_full.xml
 
Linux_for_Tegra/bootloader/<platform>/cfg/flash_l4t_t186.xml
 
Note:
The kernel is installed into the filesystem alongside the boot configuration file.
On T210 and T186 systems, the kernel (LNX) partition contains U-Boot.
Aside from this difference, U-Boot has the same internal eMMC partition layout as that used by cboot.
eMMC IC Parameter
The eMMC IC parameter is defined by two variables in the Linux_for_Tegra/<target_board>.conf.common file to:
Limit the size of the total usable data area
Determine the location of GPT partitions
The eMMC ID parameter includes:
BOOTPARTSIZE: specifies the eMMC boot partition size which consists of boot0 partition size + boot1 partition size.
EMMCSIZE: specifies the eMMC usable data size which consists of BOOTPARTSIZE + user partition size.
Note:
boot0, boot1, and user partition size can be obtained from the eMMC device datasheet.
Root Filesystem Size
The root filesystem partition is the largest of the partitions. The size of this partition is one of the key factors in partition layout determination.
To modify the root filesystem partition size
Modify the value of the ROOTFSSIZE variable in the Linux_for_Tegra/<target_board>.conf.common 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. It is located at LBA 0.
The primary GPT partition contains the GUID Partition Table. It is located at LBA 1.
The secondary GPT partition contains the same information as the primary GPT and serves as the backup. It 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
The LNX partition nominally contains the kernel.
On T210 systems, when using U-Boot, this partition is not used.
On T186 systems, when using U-Boot, this partition is used to contain U-Boot.
APP Partition
If root filesystem storage is in eMMC, the root filesystem is flashed to this partition. U-Boot expects the boot configuration file and kernel files to exist in the <rootfs>/boot directory. The flash.sh flashes the following kernel files in the APP partition:
kernel (Image)
boot configuration file (extlinux/extlinux.conf)
Note:
The flash.sh script treats the root filesystem-on-IP-network configuration as a special case. It flashes these kernel files in the <APP partition>:/boot directory.
Full Internal eMMC Partition Layout
For an example of the configuration file, see the following:
For TX1 systems: gnu_linux_tegraboot_emmc_full.xml file
For TX2 systems: flash_l4t_t186.xml file
Building the Device Tree Compiler
The Device Tree Compiler (DTC) must be built from source code.
Note:
If you do not wish to pass in the DTC filename as a parameter to the U Boot environment, ensure a local command path that contains DTC, such as /usr/local/bin or another choice, is at the beginning of the shell command path.
To build DTC from source
1. Download the DTC source code by executing the following git clone command:
$ git clone git://git.kernel.org/pub/scm/utils/dtc/dtc.git
$ cd dtc
The rest of this procedure assumes your current working directory is the DTC source tree.
2. Build DTC by executing:
$ make
3. To install into the default directory $HOME, execute:
$ make install
4. To install to a specific directory, execute:
$ make install PREFIX=/usr/local
In either case, the following directories are created below the installation directory:
bin
lib
include
Replacing the Kernel
You can replace the kernel with your own custom kernel. Use the procedure that applies to the type of storage device from which your device boots.
To replace the kernel in systems that boot from internal eMMC
These steps can be used in SD card and USB storage device cases.
1. Boot the Jetson TX1/TX2 system.
2. Copy the new kernel files, using scp, into the /boot directory.
3. Reboot the Jetson TX1/TX2 system.
To replace the kernel in systems that boot from an SD Card or USB device
1. Connect the SD Card or USB device to your host system.
2. Copy the new kernel files to the /boot directory on the SD Card or USB device.
3. Disconnect the SD Card or USB device from the host system.
4. Connect the SD Card or USB device to the Jetson TX1/TX2 system.
5. Reboot the Jetson TX1/TX2 system.
To replace the kernel in systems that boot from an NFS server
1. Boot the Jetson TX1/TX2 system.
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 TX1/TX2 system.
Copying the Root Filesystem
For external media, you must copy the root filesystem to the device after running the flash.sh command. Then you attach the device to the target system. This is required because the flash.sh script adds the required files to the root filesystem directory on the host when it runs.
Boot Sequence and Sysboot Configuration Files
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 partition in the device:
<rootfs>/boot/extlinux
Upon finding the extlinux.conf file, U-Boot performs the following.
Uses the sysboot command to read out boot configuration from extlinux.conf
Loads kernel Image file
Boots the kernel
The Image is 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 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 for each supported board:
extlinux.conf.emmc
extlinux.conf.sdcard
extlinux.conf.usb
extlinux.conf.nfs
During flashing, flash.sh copies the appropriate variant to the following location on the target:
<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 on your host system at:
bootloader/<platform>/<board>/
Where:
<platform> is the SOC name or platform.
<board> is:
Jetson TX1: p2371-2180
Jetson TX2: p2771-0000
Optimizing U-Boot Boot Time
 
Disabling PCIe Support
Enabling/Disabling ASPM Support
Disabling USB Support
By default, U-Boot includes a default configuration that enables all supported hardware features. It searches the available devices for boot scripts. This enables out-of-the-box support for the widest possible variety of storage devices and boot configurations.
This flexibility delays execution of the final operating system because hardware support takes time to initialize and scanning all attached storage and network devices takes time. In constrained or pre-configured systems, this flexibility may not be necessary. You may know ahead of time, which storage device contains the required files, or that certain devices are not required to be initialized by the boot-loader. To optimize boot time, configure U-Boot to allow for these constraints and reduce system boot time.
These changes must be made in the kernel sources.
Disabling PCIe Support
U-Boot delays enumerating and initializing PCIe devices until the user, or a boot script, explicitly attempts to access a PCIe device. Consequently, disabling PCIe support does not reduce boot time.
To disable PCIe support
1. Remove the following values from include/configs/<board>.h:
CONFIG_PCI_EHCI
CONFIG_PCI_TEGRA
CONFIG_CMD_PCI
2. Remove the following values from configs/<board_and_rev>_defconfig:
CONFIG_PCI_TEGRA
CONFIG_RTL8169
CONFIG_E1000
Where:
<board> is:
Jetson TX1: p2371-2180
Jetson TX2: p2771-0000
<board_and_rev> is:
Jetson TX1: p2371-2180
Jetson TX2: p2771-0000-500
Enabling/Disabling ASPM Support
U-Boot delays enumerating and initializing Active State Power Management (ASPM) PCIe devices until the user, or a boot device, explicitly attempts to access a PCIe ASPM device. Consequently, disabling ASPM support does not reduce boot time.
To enable ASPM support
1. Remove the following value from configs/<board_and_rev>_defconfig:
CONFIG_PCIEASPM
2. Add the following value.
CONFIG_PCIEASPM_POWERSAVE=y
Where:
<board_and_rev> is:
Jetson TX1: p2371-2180
Jetson TX2: p2771-0000-500
To disable ASPM support
1. Remove the following value from configs/<board_and_rev>_defconfig:
CONFIG_PCIEASPM_POWERSAVE=y
2. Add the following value.
CONFIG_PCIEASPM
Where:
<board_and_rev> is:
Jetson TX1: p2371-2180
Jetson TX2: p2771-0000-500
Disabling USB Support
U-Boot delays enumerating and initializing USB devices until the user, or a boot script, explicitly attempts to access a USB device. Consequently, disabling USB support does not reduce boot time.
To disable USB support
1. Remove the following values from configs/<board_and_rev>_defconfig:
CONFIG_CMD_USB
CONFIG_CMD_USB_MASS_STORAGE
CONFIG_USB
CONFIG_USB_GADGET
CONFIG_USB_GADGET_DOWNLOAD
2. Edit include/configs/<board>.h to remove the #include of tegra-common-usb-gadget.h.
3. Edit include/configs/tegra-common-post.h to remove the USB entry from BOOT_TARGET_DEVICES.
Where:
<board> is:
Jetson TX1: p2371-2180
Jetson TX2: p2771-0000
<board_and_rev> is:
Jetson TX1: p2371-2180
Jetson TX2: p2771-0000-500
Environment Configuration
 
Setting Environment Variables
Compile-Time
Manufacturing and Flashing Time
extlinux.conf Modifications
U-Boot runtime behavior is controlled by scripts contained in the U-Boot environment. When U-Boot begins execution, it waits for <bootdelay> seconds before executing the automatic boot sequence. During this time, the user may interrupt the boot process to access the U-Boot shell. If not interrupted, U-Boot executes <bootcmd> as a shell command. <bootcmd> contains a series of commands to search storage devices for boot scripts and execute them.
By modifying the values of these variables at compile or manufacturing time, U‑Boot can be directed to boot from a specific device in a specific manner, thereby reducing boot time.
The following table identifies the variables that can be modified.
Variable
Description
bootdelay
Contains the number of seconds that U-Boot pauses to determine whether the user wishes to interrupt the boot sequence.
To avoid delay, set to 0.
Note: Although this value avoids delay, if the user has requested to interrupt the boot process before the U-Boot shell is reached, that request is honored.
To avoid a delay and user interruption of the boot process, set bootdelay to a negative value.
bootcmd
Contains a sequence of U-Boot shell commands to be executed automatically at boot.
For systems with custom requirements, this value can be completely replaced. However, simple customizations, such as selecting a specific storage device for booting, does not require editing this value.
boot_targets
Contains a space-separated list of storage devices or network protocols that U-Boot scans to find boot scripts.
Valid values include:
mmc0 - the built-in eMMC.
mmc1 - the SD card slot.
usb0 - any attached USB Mass Storage device.
pxe - network, using DHCP to receive an IP address, then PXE to download a syslinux configuration file.
dhcp - network using DHCP to receive an IP address, then TFTP to download a U-Boot boot script.
This variable can be set to a single specific device, or a more restrictive list than the default.
scan_dev_for_boot_part
Contains a script to parse the device partition table and determines which partition U-Boot must scan for boot files.
If the partition number is known ahead of time, replace the script with a simpler script that hardcodes the value of <devplist> with a single partition number (represented in hexadecimal), and then runs either or both of the following variables:
scan_dev_for_extlinux or
scan_dev_for_boot_scripts
boot_prefixes
Contains a list of filesystem directories to scan for boot scripts or configuration files.
File system layouts vary between installations.
For example, /boot may be a separate partition containing boot scripts, or part of the root filesystem.
By default, U-Boot searches both locations for boot scripts.
In constrained cases, the user may set this variable to a single directory name so that U-Boot does not search unnecessary directories.
Note: All entries in this variable must contain both a leading and a trailing /.
scan_dev_for_extlinux
Contains a script to search for extlinux configuration files. If found, boots the system based on their content.
If the system is known not to use extlinux configuration files, replace this script with commands that do nothing.
For best results, set this variable to an innocuous value, such as “true”, rather than leaving it empty, so that U-Boot does not complain about attempts to execute an empty variable as a script.
scan_dev_for_scripts
Contains a script to search for U-Boot boot scripts. If found, loads and executes them.
If the system is known not to use U-Boot boot scripts, replace this script with commands that do nothing.
Note: The default boot scripts execute <scan_dev_for_extlinux> prior to executing <scan_dev_for_scripts>. Therefore, modifying this variable does not affect systems that boot using extlinux configuration files because this script will never be executed.
For best results, set this variable to an innocuous value, such as “true”, rather than leaving it empty, so that U-Boot does not complain about attempts to execute an empty variable as a script.
boot_scripts
Contains a space-separated list of U-Boot script names for <scan_dev_for_scripts> to search for.
If the script name is known ahead of time, set this variable to the desired value rather than the default list.
Setting Environment Variables
You can set environment variable at:
Compile-Time
Manufacturing Time
Flashing Time
Compile-Time
When U-Boot starts executing, it attempts to initialize the environment variables from data stored in flash memory. The location of the data is determined by the U-Boot configuration file on the board. If the data is missing or corrupted, U-Boot uses the default set of values that are built into the U-Boot binary.
The default L4T flashing process does not write this data into flash memory, so the built-in copy is always used initially. The built-in default environment values are set in the following places in the U-Boot source code:
U-Boot Source Code
Variable Value
include/config_distro_bootcmd.h
This file defines the variables and scripts related to the automatic boot process.
include/config/auto.conf
The value of CONFIG_BOOTDELAY determines the default value of <bootdelay>.
include/configs/tegra-common-post.h
The value of BOOT_TARGET_DEVICES determines:
The default value of <boot_targets>.
The set of legal values that can appear in <boot_targets>.
Removing entries from this variable prevents the use of those values in <boot_targets> at all.
To modify this value at compile-time:
1. Modify include/config_distro_bootcmd.h to avoid setting <boot_targets> if the board-specific configuration file has already defined this value.
2. Modify include/config/<board>.h to set <boot_targets>.
Manufacturing and Flashing Time
You can modify your manufacturing flow to add an extra step that writes a saved copy of the environment variables to flash. The following provides a set of alternatives to use for modifying your manufacturing flow:
After flashing the board, arrange for the board to execute U-Boot, and cause U-Boot to execute commands that modify and save the environment:
Reset the board so that U-Boot runs and sends commands to U-Boot using the serial console. You must write and execute some program on your host system to detect when U-Boot begins executing, interrupt the U-Boot automatic boot process, and then send the commands to U-Boot.
Execute a sequence of commands similar to the following:
env default -f -a; setenv boot_targets mmc0; saveenv
Manually edit the U-Boot environment interactively, save the result, and extract the appropriate flash memory region to a file on your host system. Then, modify the L4T partition layout XML file to that the data is written to flash during any subsequent flashing process.
Alternatively, apply this technique if your manufacturing process programs flash chips directly, rather than using the L4T flashing tools on each board. You must merge the extracted saved environment data into your flash image file, rather than referencing it from the L4T partition layout XML file.
Generate a set of saved environment data using the U-Boot fw_env tool located in the tools/env directory in the U-Boot source code. Then, modify the L4T partition layout XML file so that data is written to flash during any subsequent flashing process.
Alternatively, apply this technique if your manufacturing process programs flash chips directly, rather than using the L4T flashing tools on each board. You must merge the extracted saved environment data into your flash image file, rather than referencing it from the L4T partition layout XML file.
extlinux.conf Modifications
L4T includes an extlinux.conf file that tells U-Boot which kernel filenames to load. It also includes the command line to pass to the kernel. The file is configured to display a boot menu to the user for 3 seconds before automatically booting. To reduce boot processing time, you can remove this timeout.
To remove extlinux.conf timeout boot menu
Edit extlinux.conf file to remove the lines containing the following keywords:
TIMEOUT
MENU
On an installed L4T target system, this file is located at:
/boot/extlinux/extlinux.conf
Prior to flashing, this file is located in the host L4T flashing directory at
bootloader/<platform>/<board_and_rev>/extlinux.conf.emmc
Where:
<platform> is the SOC name or platform.
<board_and_rev> is:
Jetson TX1: p2371-2180
Jetson TX2: p2771-0000/500
Debugging U-Boot Environment
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.
Interrupting U-Boot
You can interrupt U-Boot during boot.
To interrupt U-Boot
1. Connect a terminal application to the serial port of the board.
2. Power on or reset the board.
3. Wait for the U-Boot sign on message to appear. Key presses before this point in time may be ignored.
4. Press any key to interrupt the automatic boot process.
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
Listing a Directory Structure
You can list the directory structure of a particular device.
To list the directory structure
To list the directory structure of eMMC device 0 partition 1, enter the following command on the target:
# ls mmc 0:1
This command functions correctly on EXT2/3/4 and FAT 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:
# ls mmc 0:1 <directory>
Where <directory> is a pathname in the filesystem.
For example, to list contents of the /boot directory where the Image file should be, (as shown in the example output below), use the following command:
# ext2ls mmc 0:1 /boot
<DIR>       1024 .
<DIR>       1024 ..
             908 extlinux
         5910248 Image
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 list of devices U-Boot sends console output to, execute:
# printenv stdout
Output can be as follows:
stdout=serial
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 modify the set of devices that U-Boot sends console output to, execute:
# setenv stdout serial
To save the modified environment
Execute the following command:
# saveenv
The saved modified environment is preserved in case of resets and reboots.