UBoot

From SolidRun CuBox Wiki
(Redirected from U-Boot)
Jump to: navigation, search

The bootloader loads the kernel, which is told the root device where the operating system is installed.

U-Boot is capable of loading from ext2/3, FAT, NFS, or via TFTP. CuBox can boot from the internal flash, a uSD card, eSATA, the upper USB port, over network, or serial line. The default bootloader does not understand the GPT.

Cancel automatic boot to control U-Boot directly

Contents

Command line

Direct control over uBoot is possible using a serial console. After power on, press a key within a few seconds to stop autoboot.

CuBox>>

If you do not get to this prompt, you might need to bootstrap.

To get an overview of all available commands

help

To print all environment variables

print

To set a variable (and store)

set variable value
save

Until the first save, the MAC-address isn't stored in the variable ethaddr, which makes further network configuration difficult. The screen resolution is set as kernel parameter, e.g. video=dovefb:lcd0:1280x720-32@60-edid in the variable bootargs.

set bootargs parameters

Examples

Assume (the default on CuBox)

set loadaddr 0x02000000

Load a kernel from the first partition of an ext2/3 formatted uSD card

mmcinfo
ext2load mmc 0:1 $loadaddr /uImage
bootm

Load and execute a script from FAT – see also boot from USB device

usb start
fatload usb 0:1 $loadaddr /boot.scr
source

Load from ext4 in the first partition of the second device on eSATA

ide info
ext4load ide 1:1 $loadaddr /uImage

See also boot over network

By default, the bootcmd looks for a boot.scr file in / and in /boot. You can't change that, except with a patch, but a few variables control its behavior:

set trydev 'usb mmc ide'
set trypart '1 2'
set trydir '/ /boot/'

Create a boot script

Write commands into a text file, e.g. boot.txt, and install uboot-mkimage.

mkimage -A arm -O linux -T script -C none -n "uBoot commands" -d boot.txt boot.scr

Write to flash

The CuBox has a 4 MB NAND flash built-in via SPI, where the bootloader is stored. The CuBox Installer can download and update for you. The new version adds support for ext4 file systems.

Binaries are available from the download server
See also building U-Boot

Prefer upgrading from a running Linux system, or use bubt if you have a PXE setup in your network.

First, load the uboot-spi.bin to RAM, e.g. from a USB stick

usb start
fatload usb 0:1 $loadaddr /boot/u-boot.bin

Then store the new bootloader on the internal flash:

set size 0xc0000
sf protect off
sf erase 0 $size
sf erase $size 0x10000
sf write $loadaddr 0 $filesize
sf protect on

To keep the environment variables, do not execute the second erase command!

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox