doc/
help
command show a brief summary of the built-in commands of U-Boot. Here is a selection of useful commands :
U-Boot> help ? - 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' bootm - boot application image from memory bootp - boot image via network using BOOTP/TFTP protocol bootz - boot Linux zImage image from memory cls - clear screen cmp - memory compare coninfo - print console devices and information cp - memory copy crc32 - checksum calculation dhcp - boot image via network using DHCP/TFTP protocol echo - echo args to console editenv - edit environment variable env - environment handling commands erase - erase FLASH memory exit - exit script false - do nothing, unsuccessfully fatinfo - print information about filesystem fatload - load binary file from a dos filesystem fatls - list files in a directory (default /) fatsize - determine a file's size fatwrite- write file into a dos filesystem fdt - flattened device tree utility commands flinfo - print FLASH memory information go - start application at address 'addr' help - print command description/usage iminfo - print header information for application image imls - list all images found in flash imxtract- extract a part of a multi-image itest - return true/false on integer compare loadb - load binary file over serial line (kermit mode) loadx - load binary file over serial line (xmodem mode) loady - load binary file over serial line (ymodem mode) loop - infinite loop on address range md - memory display mdio - MDIO utility commands mii - MII utility commands mm - memory modify (auto-incrementing address) mmc - MMC sub system mmcinfo - display MMC info mw - memory write (fill) nand - NAND sub-system nboot - boot from NAND device nfs - boot image via network using NFS protocol nm - memory modify (constant address) ping - send ICMP ECHO_REQUEST to network host printenv- print environment variables protect - enable or disable FLASH write protection 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 sleep - delay execution for some time source - run script from memory test - minimal test like /bin/sh tftpboot- boot image via network using TFTP protocol true - do nothing, successfully usb - USB sub-system usbboot - boot from USB device version - print monitor, compiler and linker version U-Boot>Refer to the U-Boot manual page for the command line interface
setenv boot_addr 0x21400000 setenv linux 'tftp ${boot_addr} linux-2.6.x.img' setenv ramdisk_addr 0x21100000 setenv ramdisk 'tftp ${ramdisk_addr} sam9-ramdisk.gz' setenv go 'run linux; run ramdisk; bootm ${boot_addr}' saveenvThe
setenv linux 'tftp ${boot_addr} linux-2.6.x.img'
line is equivalent of typing tftp 0x21400000 linux-2.6.x.img
but combined with others and stored in flash, it allows you to save time, and automate. For executing a Linux kernel bootup, using this snippet, simply type run go
bootcmd
in default at91 board: bootcmd=nand read 0x21000000 0x00180000 0x00080000; nand read 0x22000000 0x00200000 0x00600000;bootz 0x22000000 - 0x21000000
bootargs
: bootargs_nand=console=ttyS0,115200 mtdparts=atmel_nand:256k(bootstrap)ro,512k(uboot)ro,256K(env),256k(env_redundent),256k(spare),512k(dtb),6M(kernel)ro,-(rootfs) rootfstype=ubifs ubi.mtd=7 root=ubi0:rootfs bootargs_nfs=console=ttyS0,115200 mtdparts=atmel_nand:8M(kernel)ro,220M(rootfs),20M(test),-(protect) rw root=/dev/nfs rw nfsroot=10.217.12.45:/nfsroot/rootfs/yocto ip=dhcp
Board name | Hardware changes required |
SAMA5D4 Xplained | R32 must be moved to position R33 |
---|---|
SAMA5D3 Xplained | None |
SAMA5D2 Xplained | None |
SAMA5D2 PTC EK | R95 must be populated |
SAMA5D2 SOM1 EK | None |
SAMA5D2 WLSOM1 EK | None |
SAM9X60-EK | None |
U-Boot 2018.07-linux4sam_6.0 (Oct 03 2018 - 16:03:04 +0000) CPU: SAMA5D27-CU Crystal frequency: 12 MHz CPU clock : 498 MHz Master clock : 166 MHz DRAM: 512 MiB MMC: sdio-host@a0000000: 0, sdio-host@b0000000: 1 Loading Environment from SPI Flash... SF: Detected at25df321a with page size 256 Bytes, erase size 4 KiB, total 4 MiB OK In: serial@f8020000 Out: serial@f8020000 Err: serial@f8020000 PDA TM5000 detected Net: eth0: ethernet@f8008000 Hit any key to stop autoboot: 0In this example we can see that PDA TM5000 was detected. Further more, if we inspect the U-boot environment:
=> print baudrate=115200 bootargs=console=ttyS0,115200 root=/dev/mmcblk0p1 rw rootfstype=ext4 rootwait atmel.pm_modes=standby,ulp1 bootcmd=ext4load mmc 0 0x24000000 boot/sama5d2_xplained.itb; bootm 0x24000000#kernel_dtb bootdelay=1 ethaddr=fc:c2:3d:0d:1f:4b fdtcontroladdr=3fb773c8 pda=5000 stderr=serial@f8020000 stdin=serial@f8020000 stdout=serial@f8020000We can see that the variable 'pda' was configured. This can be used in the booting mechanism to inform the OS that the PDA is connected.
mkimage -A arm -O linux -C none -T kernel -a 20008000 -e 20008000 -n linux-2.6 -d arch/arm/boot/Image uImageCommands to generate a compressed uImage file {{
mkimage -A arm -O linux -C none -T kernel -a 20008000 -e 20008000 -n linux-2.6 -d arch/arm/boot/zImage uImage
bootm
or bootz
with two arguments:
bootm 0x22000000 - 0x21000000
or bootz 0x22000000 - 0x21000000
First argument is the address in memory of the Linux kernel, second one is the initrd (missing in the example, we can see a dash), third one is the address of the DTB binary.
fatload mmc 0:1 0x24000000 zImage; fatload mmc 0:1 0x21000000 board.dtb; bootz 0x24000000 - 0x21000000;We can see the DTB is passed as the third argument to the command.
setenv fdtaddr 0x21000000; fatload mmc 0:1 ${fdtaddr} board.dtbThis will load the DTBO into memory
setenv fdtovaddr 0x23000000; fatload mmc 0:1 ${fdtovaddr} someoverlay.dtbo;This will configure the address for fdt operations (we set it to the DRAM address where we loaded the base DTB)
fdt addr ${fdtaddr}This will resize the original DTB to accommodate more space for the overlay
fdt resize 8192This will apply the DTBO loaded at fdtovaddr on top of the DTB at the address we configured with fdt addr
fdt apply ${fdtovaddr}This will boot the kernel with the DTB at fdtaddr which now includes both the original DTB and the applied DTBO
bootz 0x24000000 - ${fdtaddr}
setenv ethaddr 3e:36:65:ba:6f:be
setenv serverip 10.159.245.186
setenv ipaddr 10.159.245.180
dhcp
command if you already have DHCP server in your network.setenv get_ip 'setenv old_serverip ${serverip};setenv autoload no;dhcp;setenv serverip ${old_serverip}'
run get_ip
saveenv
tftp
command (Cf. U-Boot script capability chapter).
bootm
or boot
command.
setenv ethact macb0,gmac0 setenv ethprime gmac0
bootm 0x24000000#kernel_dtbThis will load the FIT image from address 0x24000000 in memory and then run the configuration named 'kernel_dtb'. This configuration includes the kernel plus the base Device Tree Blob built with the kernel. To load additional FIT configurations, just append another configuration to the command. Example to load the image sensor controller Device Tree overlay + sensor omnivision 0v7740:
bootm 0x24000000#kernel_dtb#isc#ov7740
Name | Board Supported | Comment | Related Tags |
---|---|---|---|
github sources: u-boot-2019.04-at91![]() |
All Microchip boards supported Boards with demo available: SAM9X60-EK, SAMA5D4 Xplained, SAMA5D3 Xplained, SAMA5D2 Xplained, SAMA5D2 PTC EK, SAMA5D2 SOM1 EK, SAMA5D2 WLSOM1 EK, |
Maintained, stable | linux4sam_6.1 linux4sam_6.2 |
github sources: u-boot-2018.07-at91![]() |
All Atmel boards supported Boards with demo available: SAMA5D4 Xplained, SAMA5D3 Xplained, SAMA5D2 Xplained, SAMA5D2 PTC EK, SAMA5D2 SOM1 EK, |
Old branch don't use for new developments |
linux4sam_6.0 |
github sources: u-boot-2015.01-at91![]() |
All Atmel boards supported Boards with demo available: SAMA5D4 Xplained, SAMA5D4-EK, SAMA5D3 Xplained, SAMA5D3-EK SAMA5D2 Xplained, |
Old branch don't use for new developments |
linux4sam_4.7, linux4sam_5.0-alpha7 |
github sources: u-boot-2014.07-at91![]() |
All Atmel boards supported Boards with demo available: SAMA5D4 Xplained, SAMA5D4-EK, SAMA5D3 Xplained, SAMA5D3-EK, AT91SAM9X5-EK, AT91SAM9N12, Legacy |
Old branch don't use for new developments |
linux4sam_4.6, linux4sam_4.5 |
linux4sam_6.2
linux4sam_6.1
linux4sam_6.0
linux4sam_4.7
linux4sam_4.5
$ git clone git://github.com/linux4sam/u-boot-at91.git Cloning into 'u-boot-at91'... remote: Enumerating objects: 106920, done. remote: Counting objects: 100% (106920/106920), done. remote: Compressing objects: 100% (24617/24617), done. remote: Total 566593 (delta 84756), reused 96342 (delta 81351), pack-reused 459673 Receiving objects: 100% (566593/566593), 131.67 MiB | 430.00 KiB/s, done. Resolving deltas: 100% (456142/456142), done. $ cd u-boot-at91
$ git branch -r origin/HEAD -> origin/master origin/master origin/u-boot-2012.10-at91 origin/u-boot-2013.07-at91 origin/u-boot-2014.07-at91 origin/u-boot-2015.01-at91 origin/u-boot-2016.03-at91 origin/u-boot-2017.03-at91 origin/u-boot-2018.07-at91 origin/u-boot-2019.04-at91 origin/uboot_5series_1.x $ git checkout origin/u-boot-2019.04-at91 -b u-boot-2019.04-at91 Branch u-boot-2019.04-at91 set up to track remote branch u-boot-2019.04-at91 from origin. Switched to a new branch 'u-boot-2019.04-at91'
sudo apt-get install gcc-arm-linux-gnueabi export CROSS_COMPILE=arm-linux-gnueabi-
wget -c https://releases.linaro.org/components/toolchain/binaries/7.3-2018.05/arm-linux-gnueabi/gcc-linaro-7.3.1-2018.05-x86_64_arm-linux-gnueabi.tar.xz tar xf gcc-linaro-7.3.1-2018.05-x86_64_arm-linux-gnueabi.tar.xz export CROSS_COMPILE=`pwd`/gcc-linaro-7.3.1-2018.05-x86_64_arm-linux-gnueabi/bin/arm-linux-gnueabi-
configs/
to find the exact target when invoking make.
The U-Boot environment variables can be stored in different media, above config files can specify where to store the U-Boot environment.
# To put environment variables in serial flash: sama5d3xek_spiflash_defconfig # To put environment variables in nandflash (default): sama5d3xek_nandflash_defconfig # To put environment variables in SD/MMC card: sama5d3xek_mmc_defconfigHere are the building steps for the SAMA5D3x-EK board:
# You can change the config according to your needs. make sama5d3xek_nandflash_defconfig makeThe result of these operations is a fresh U-Boot binary called
u-boot.bin
corresponding to the binary ELF file u-boot
. u-boot.bin
is the file you should store on the board
u-boot
is the ELF format binary file you may use to debug U-Boot through a JTag link for instance.
setenv load_add 22000000 setenv erase_uboot 'nand erase 40000 80000' # erase U-Boot in nand. setenv mmc_uboot_file 'u-boot.bin' # u-boot file name in mmc card setenv flash_uboot_from_mmc 'run erase_uboot;fatload mmc 0 ${load_addr} ${mmc_uboot_file}; nand write ${load_addr} 40000 ${filesize};' run flash_uboot_from_mmc
I | Attachment | Action | Size | Date | Who | Comment |
---|---|---|---|---|---|---|
![]() |
ECC_config_4bit.PNG | manage | 14.0 K | 2013-02-04 - 03:48 | UnknownUser | |
![]() |
SAM-BA_mainwin.PNG | manage | 40.0 K | 2013-02-04 - 03:46 | UnknownUser | SAM-BA Windows to flash u-boot |
![]() |
SAM-BA_selectboard.PNG | manage | 10.5 K | 2013-02-04 - 03:47 | UnknownUser |
Copyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Linux® is the registered trademark of Linus Torvalds in the U.S. and other countries.
Atmel® and others, are registered trademarks or trademarks of Atmel Corporation or its subsidiaries.
ARM® and others are registered trademarks or trademarks of ARM Ltd. Other terms and product names may be trademarks of others.
Ideas, requests, contributions ? Connect to LinksToCommunities page.