Taskit ARM9 CPU-module with Linux Stamp9261-series Stamp9261 (64F/64R) 542310 Data Sheet
Product codes
542310
Linux Guide
taskit GmbH
U-Boot> echo $(filesize)\; echo Hello
U-Boot> 171a4; echo Hello
U-Boot> 171a4; echo Hello
A list of all U-Boot environment variables can be found at the end of this document
(chapter U-Boot environment variables).
(chapter U-Boot environment variables).
4.5. Creating a bootscript
To demonstrate U-Boot's scripting capabilities, we will now describe the construction of a
boot script step by step.
This script loads a RAM-disk image from the network via TFTP and starts a kernel found in
flash memory with the appropriate boot arguments for size and RAM-disk address.
The following tasks must be carried out: The RAM-disk image needs to be loaded from the
network via TFTP, the boot arguments need to be set, and the kernel needs to be booted.
The assumption is made that the following prerequisites have been satisfied: a bootloader
and kernel images are stored in flash memory at the correct address and the network
environment is configured correctly.
boot script step by step.
This script loads a RAM-disk image from the network via TFTP and starts a kernel found in
flash memory with the appropriate boot arguments for size and RAM-disk address.
The following tasks must be carried out: The RAM-disk image needs to be loaded from the
network via TFTP, the boot arguments need to be set, and the kernel needs to be booted.
The assumption is made that the following prerequisites have been satisfied: a bootloader
and kernel images are stored in flash memory at the correct address and the network
environment is configured correctly.
In the first step, the boot arguments are divided into logical sections and the environment
variable basicargs, which contains the static boot arguments, is defined.
variable basicargs, which contains the static boot arguments, is defined.
U-Boot> setenv basicargs console=ttyS0,115200 mem=64M root=/dev/ram rw
U-Boot> printenv basicargs
U-Boot> basicargs=console=ttyS0,115200 mem=64M root=/dev/ram rw
U-Boot> printenv basicargs
U-Boot> basicargs=console=ttyS0,115200 mem=64M root=/dev/ram rw
Then the MTD (memory technology devices) partitions for the flash unit are defined in
another variable: mtdparts.
Be sure to note the backslash escape character (\) in front of the semicolon, which
prevents the partitioning of the dataflash from being interpreted as a command.
another variable: mtdparts.
Be sure to note the backslash escape character (\) in front of the semicolon, which
prevents the partitioning of the dataflash from being interpreted as a command.
U-Boot> setenv mtdparts mtdparts=physmap_flash.0:384k(boot)ro,
1664k(linux)ro,3072k(initrd)ro,10240(cfg),-(custom)
U-Boot> printenv mtdparts
mtdparts=mtdparts=phys_mapped_flash:384k(boot)ro,1664k(linux)ro,
3072k(initrd) ro,1024(cfg),-(custom)
3072k(initrd) ro,1024(cfg),-(custom)
The size and address of the initrd can only be determined later, when the current image
has been loaded from the network.
has been loaded from the network.
The address of the kernel is now stored in a variable and the environment variable
bootcmd is created. bootcmd is automatically called by the boot/bootd command.
bootcmd is created. bootcmd is automatically called by the boot/bootd command.
U-Boot> setenv kerneladdr 10060000
U-Boot> setenv bootcmd run ramboot
U-Boot> printenv kerneladdr bootcmd
U-Boot> setenv bootcmd run ramboot
U-Boot> printenv kerneladdr bootcmd
kerneladdr=10060000
bootcmd=run ramboot
bootcmd=run ramboot
In the variable ramboot, we will specify the actual command sequence necessary for
booting the kernel.
booting the kernel.
U-Boot> setenv ramboot tftpboot 21400000 initrd.bin\;setenv bootargs
Page 12 of 65
Version 1.26
(2008-04-30)