Loading Linux thanks to u-boot

  • About U-Boot
  • Setting the hardware
  • Configuration of the host PC
  • Configuration of AT91RM9200DK through U-Boot
  • About U-Boot

    U-boot is a boot loader for AT91RM9200DK that can be installed in a Flash and used to configure AT91RM9200DK and to run linux in SDRAM thanks to its ability to download kernel images and ramdisks. U-Boot offers a user interface through the AT91RM9200 DBGU serial link. 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.

    Setting the hardware

    Configuration of the host PC

    Configuration of AT91RM9200DK through U-Boot

  • General Setup
  • For Kernel download
  • For local ramdisk download
  • Kernel boot message
  • General Setup

    You have to set up some variables like network ones (Ethenet address, IP address...) and bootdelay. It goes like this :
     U-Boot > setenv ethaddr 12:34:56:78:99:aa
     U-Boot > setenv ipaddr 10.159.245.178
     U-Boot > setenv serverip 10.159.245.156
     U-Boot > setenv bootdelay 3
     U-Boot > 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.

    For Kernel

    Before we hit the command setting let's have a look at how a TFTP server works. TFTP (Trivial File Transfer Protocol) allows to exchange files across the network, a TFTPSERVER that is running on a PC(host) handles all TFTP request. Files sought out are fetched from a root directory already configured in TFTPSERVER config file. the paths used in the following commands start from the root directory of TFTPSERVER. The command used to download a kernel image and place it in a specific SDRAM address is :
     Uboot > tftp 21000000 uImage
     Uboot > tftp 21100000 ramdisk-rmk7
    Uboot > saveenv

    For local ramdisk In order to download a remote ramdisk and mount it localy on the board you have to set a variable that will lead U-Boot to it. It goes like this :

     Uboot > setenv bootargs root=/dev/ram rw initrd=0x21100000,6000000 ramdisk_size=15360 console=ttyS0,115200 mem=32M
     Uboot > bootm 21000000
    As shown before you can make the boot sequence automatic by setting a "bootcmd" variable. It goes like this :
     U-Boot > setenv bootcmd tftp 21100000 ramdisk-rmk7\; tftp 21000000 uImage\; bootm 21000000
     U-Boot > saveenv
     U-Boot > run bootcmd

    Kernel boot message

    Linux version 2.4.19-rmk7 (amine@PC0142) (gcc version 2.95.3 20010315 (release)) #40 Wed Jun 25 19:19:12 CEST 2003
    CPU: Arm920Tid(wb) revision 0
    Machine: ATMEL AT91RM9200
    On node 0 totalpages: 8192
    zone(0): 8192 pages.
    zone(1): 0 pages.
    zone(2): 0 pages.
    Kernel command line: root=/dev/ram rw initrd=0x21100000,6000000 ramdisk_size=15360 console=ttyS0,115200 mem=32M
    Relocating machine vectors to 0xffff0000
    Calibrating delay loop... 89.70 BogoMIPS
    Memory: 32MB = 32MB total
    Memory: 24964KB available (1273K code, 228K data, 52K init)
    Dentry cache hash table entries: 4096 (order: 3, 32768 bytes)
    Inode cache hash table entries: 2048 (order: 2, 16384 bytes)
    Mount-cache hash table entries: 512 (order: 0, 4096 bytes)
    Buffer-cache hash table entries: 1024 (order: 0, 4096 bytes)
    Page-cache hash table entries: 8192 (order: 3, 32768 bytes)
    POSIX conformance testing by UNIFIX
    Linux NET4.0 for Linux 2.4
    Based upon Swansea University Computer Society NET3.039
    Initializing RT netlink socket
    Starting kswapd
    devfs: v1.12a (20020514) Richard Gooch (rgooch@atnf.csiro.au)
    devfs: boot_options: 0x1
    JFFS2 version 2.1. (C) 2001 Red Hat, Inc., designed by Axis Communications AB.
    i2c-core.o: i2c core module
    i2c-dev.o: i2c /dev entries driver module
    RAMDISK driver initialized: 16 RAM disks of 15360K size 1024 blocksize
    physmap flash device: 200000 at 10000000
    CFI: Found no Physically mapped flash device at location zero
    Search for id:(06 ea00) interleave(1) type(2)
    Search for id:(1f c0) interleave(1) type(2)
    Found: Atmel AT49BV16X
    Physically mapped flash: Found 1 x16 devices at 0x0 in 16-bit mode
    number of JEDEC chips: 1
    usb.c: registered new driver hub
    ttyS%d0 at MEM 0xfefff200 (irq = 1) is a AT91_SERIAL
    ttyS%d1 at MEM 0xfefc4000 (irq = 7) is a AT91_SERIAL
    eth0: Link now 100-FullDuplex
    eth0: AT91 ethernet at 0xfefbc000 int=24 100-FullDuplex (12:34:56:78:99:aa)
    AT91 Watchdog Timer enabled (5 seconds)
    AT91 Real Time Clock driver
    usb-ohci.c: USB OHCI at membase 0xc2a06000, IRQ 23
    usb.c: new USB bus registered, assigned bus number 1
    hub.c: USB hub found
    hub.c: 2 ports detected
    i2c-dev.o: Registered 'AT91RM9200' as minor 0
    Found AT91 i2c
    AT91 SPI driver loaded
    at91_dataflash: Atmel AT45DB642 detected [spi0] (8650752 bytes)
    SmartMedia card inserted.
    NAND device: Manufacture ID: 0x98, Chip ID: 0xe6 (Toshiba TC58V64AFT/DC)
    NET4: Linux TCP/IP 1.0 for NET4.0
    IP Protocols: ICMP, UDP, TCP
    IP: routing cache hash table of 512 buckets, 4Kbytes
    TCP: Hash tables configured (established 2048 bind 2048)
    NET4: Unix domain sockets 1.0/SMP for Linux NET4.0.
    NetWinder Floating Point Emulator V0.95 (c) 1998-1999 Rebel.com
    RAMDISK: Compressed image found at block 0
    Freeing initrd memory: 5859K
    EXT2-fs warning: mounting fs with errors, running e2fsck is recommended
    VFS: Mounted root (ext2 filesystem).
    Mounted devfs on /dev
    Freeing init memory: 52K