Setting up U-Boot environmental Variables



U-boot is a boot loader for AT91RM9200DK, that can be installed in a boot ROM and used to configure AT91RM9200DK and to run linux in SDRAM thanks to its ability to download kernel images and ramdisks. Binaries can be downloaded using either Kermit through the serial link or through TFTP transfer using the ethernet link. The development of U-Boot is closely related to Linux: some parts of the source code originate in the Linux source tree, we have some header files in common, and special provision has been made to support booting of Linux images.

For more U-boot information, go to Tools->AT91RM9200-DK

  • Sample Monitor Commands
  • Sample Environment Variables
  • General Setup
  • bootargs command for local ramdisk
  • bootargs command for NFS ramdisk
  • Sample Monitor Commands

    go
    run
    bootm
    bootp
    tftpboot
     
    loadb
    printenv
    setenv
    saveenv
    - start application at address 'addr'
    - run commands in an environment variable
    - boot application image from memory
    - boot image via network using BootP/TFTP protocol
    - boot image via network using TFTP protocol and env variables
       "ipaddr" and "serverip" (and eventually "gatewayip")
    - load binary file over serial line (kermit mode)
    - print environment variables
    - set environment variables
    - save environment variables to persistent storage

    Sample Environment Variables

    baudrate
    bootdelay
    bootcmd
    bootargs
    bootfile
    ipaddr
    serverip
    loadaddr
    ethaddr

    General Setup

    You have to set up some variables like network and bootdelay ones. It goes like this :
     Uboot > setenv ethaddr 12:34:56:78:99:aa
     Uboot > setenv ipaddr 10.159.245.178
     Uboot > setenv serverip 10.159.245.156
     Uboot > setenv bootdelay 3
    Uboot > saveenv

    Note : The values given to these variables should be set to whatever your system and network, especially for ip and ethernet addresses which should match your network parameters.

    If you want to save this variable and make U-Boot automaticaly fetch the kernel image and turn it on you have to save it in a bootcmd, it goes like this :
     Uboot > setenv bootcmd tftp 21000000 uImage\; tftp 21100000 ramdisk-rmk7\; bootm 21000000
     Uboot > saveenv

    bootargs command for local ramdisk

    Uboot > setenv bootargs root=/dev/ram rw initrd=0x21100000,6000000 ramdisk_size=15360 console=ttyS0,115200 mem=32M
    Uboot > saveenv

    bootargs command for NFS ramdisk

     Uboot > setenv bootargs root=/dev/nfs rw nfsroot=10.159.245.142:/usr/home/amine/RD/rd ip=10.159.245.180 console=ttyS4,115200 mem=31M

     Uboot > saveenv