U-Boot for MPL SBC User Manual High-Tech • Made in Switzerland U-Boot Bootloader for MPL Single Board Computer The U-Boot is the bootloader of the MPL Single Board Computers PIP405, MIP405, MIP405T and the VCMA9. Its main purpose is to initialize the hardware, set-up the SDRAM and boot a kernel image. But it acts also as monitor and has build in a lot of useful functions such as memory dump, memory write etc. It allows to update the U-Boot without having to boot an operating system.
U-Boot for MPL SBC User Manual High-Tech • Made in Switzerland Table of contents 1. 1.1 1.2 2. 2.1 2.2 3. INTRODUCTION.........................................................................................................................................................4 About this manual..................................................................................................................................................4 Conventions ...........................................................
U-Boot for MPL SBC User Manual High-Tech • Made in Switzerland 3.3.45 pip405/mip405/vcma9 - Board specific Cmds............................................................................................25 3.4 U-Boot Environment Variables ............................................................................................................................26 3.4.1 Board properties Variables ...............................................................................................................
U-Boot for MPL SBC User Manual High-Tech • Made in Switzerland 1. Introduction 1.1 About this manual This manual gives a brief introduction of the U-Boot bootloader. Since the U-Boot is an open source project which might be updated frequently, some information may be not up to date. The purpose of this manual is to provide enough information for using (booting) the MPL Single Board Computers. For more information please refer to the source code and its documentation at http://u-boot.sourceforge.net/.
U-Boot for MPL SBC User Manual High-Tech • Made in Switzerland 2. General Information and Specifications This chapter provides a general overview over the U-Boot and its features. Please note that some of these features (such as SCSI, VGA) are board depended and may not apply to your MPL Single Board Computer. 2.
U-Boot for MPL SBC User Manual High-Tech • Made in Switzerland 3. Using U-Boot This section describes the generally use of the U-Boot. Normally the MPL boards use serial line 0 as its console device. The parameters of this serial communication are as follows by default: • • • • • 9600 baud 8 bits parity none 1 stop bit no handshake Use your favorite terminal program (kermit, minicom, ..) to get in contact with U-Boot’s command interface.
U-Boot for MPL SBC User Manual High-Tech • Made in Switzerland 3.2 U-Boot Command Interface 3.2.1 Help system If you type help on the U-Boot prompt, you get a list with all possible commands for your board. Please note that the commands may be abbreviated, as long as the command can be clearly identified. Since the development of the U-Boot is still going on, following list represents only the version 0.3.
U-Boot for MPL SBC User Manual High-Tech • Made in Switzerland sleep - delay execution for some time tftpboot- boot image via network using TFTP protocol and env variables ipaddr and serverip usbboot - boot from USB device usb - USB sub-system version - print monitor version pip405 - PIP405 specific Cmds ? - alias for 'help' Please note that the command pip405 is the “Board specific Command”, which is the board name. To get help on a specific command type help .
U-Boot for MPL SBC User Manual High-Tech • Made in Switzerland 3.3 U-Boot Commands Following chapters describes the most used commands in alphabetic order. 3.3.1 base - print or set address offset Abbreviation: ba => help base base - print address offset for memory commands base off - set address offset for memory commands to 'off' => With this command you can set the base address of the memory region you like to access. When set, you need only to work with the offsets to this address.
U-Boot for MPL SBC User Manual High-Tech • Made in Switzerland 3.3.3 bootd - boot default, i.e run ‘bootcmd’ Abbreviation: bootd This command is an alias to the command ‘run bootcmd’. If invoked, the commands in the environment variable bootcmd will be executed. This variable contains the necessary commands to boot the default way. Example: => printenv bootcmd bootcmd=usb stop; diskboot 400000 0:1; bootm => run bootd: => bootd stopping USB..
U-Boot for MPL SBC User Manual High-Tech • Made in Switzerland 3.3.5 bootp - boot image via network using BOOTP/TFTP protocol Used to load a image via network using the BOOTP/TFTP protocol. Abbreviation: bootp => help bootp bootp [loadAddress] [bootfilename] => To use this command, you need to set-up a bootp server. 3.3.6 cmp - memory compare The cmp command compares the first memory area with the second one. The command stops on the first non matching address or if the count parameter is reached.
U-Boot for MPL SBC User Manual High-Tech • Made in Switzerland 3.3.9 crc32 - checksum calculation The crc32 command is used to calculate the crc32 checksum over a certain memory area. Abbreviation: crc => help crc32 crc32 address count [addr] - compute CRC32 checksum [save at addr] Example: => crc ffc00000 400 CRC32 for ffc00000 ... ffc003ff ==> 056ec8f3 If issued with 3 parameters, the crc32 checksum is written to the specified location. => crc ffc00000 400 400000 CRC32 for ffc00000 ...
U-Boot for MPL SBC User Manual High-Tech • Made in Switzerland Booting from a CD-ROM is slightly different, since CD-ROMs doesn’t have partitions. Only CD-ROMs with bootfile (no harddisk or floppy emulation) are supported. => ide part Partition Map for IDE device 1 Part 0 1 => Start 194229 190743 -- Partition Type: ISO Sect x Size Type 1744 2048 U-Boot 1741 2048 U-Boot The term ‘Part’ denotes the image number. Please note that the image number starts with 0.
U-Boot for MPL SBC User Manual High-Tech • Made in Switzerland You can also use sector address to erase a portion of the flash. The flash banks are numbered starting with 1, while flash sectors start with 0. => era 1:0-55 Erase Flash Sectors 0-55 in Bank # 1 ........................................................ done => 3.3.16 fdcboot - boot from floppy device The floppy disk boot uses similar parameters as the diskboot.
U-Boot for MPL SBC User Manual High-Tech • Made in Switzerland 3.3.20 ide - IDE sub-system The IDE subsystem is controlled with the ide command.
U-Boot for MPL SBC User Manual High-Tech • Made in Switzerland 3.3.22 iminfo - print header information for application image Print information about the loaded image in the memory. The images are created with the mkimage command, see Chapter 3.5.4 Creating bootable kernel images. Abbreviation: imi => help imi iminfo addr [addr ...
U-Boot for MPL SBC User Manual High-Tech • Made in Switzerland 3.3.25 md - memory display Displays the memory contents on the given address. Abbreviation: md => help md md [.b, .w, .l] address [# of objects] - memory display => Example: Display 16 longs from address 0xFFC00000 => md.l ffc00000 10 ffc00000: 27051956 65d6b450 ffc00010: 00000000 00000000 ffc00020: 6b65726e 656c2061 ffc00030: 6420666f 72205049 => 3cbc2652 43450692 6e642069 50343035 003738ef 05070401 6e697472 00000000 '..Ve..P<.&R.78. ....
U-Boot for MPL SBC User Manual High-Tech • Made in Switzerland 3.3.28 mw - memory write (fill) The memory write command is used to fill a memory area with a pattern. Depending on the modifier, the pattern size is a byte (8 Bit), word (16 Bit) or a long (32 Bit). Note that the count parameter has also the base of the modifier. Abbreviation: mw => help mw mw [.b, .w, .l] address value [count] - write memory => Example: => md.b 400000 10 00400000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ............
U-Boot for MPL SBC User Manual High-Tech • Made in Switzerland 3.3.30 nboot - boot from NAND device Used to load the image residing in the NAND flash. To write an image into the NAND flash, refer to the previous chapter. Abbreviation: nb => help nboot nboot loadAddr dev => Example: => nboot 33000000 0 Loading from device 0: at 0x4E000000 (offset 0x0) Image Name: Linux-2.4.
U-Boot for MPL SBC User Manual High-Tech • Made in Switzerland 3.3.33 printenv- print environment variables Abbreviation: pri => help pri printenv - print values of all environment variables printenv name ... - print value of environment variable 'name' => Example: => printenv bootargs=console=ttyS0,9600 root=/dev/hda5 baudrate=9600 loads_echo=1 preboot= serial#=MIP405_100 ethaddr=00.60.C2.0A.00.5E bootdelay=-1 ipaddr=192.168.3.37 serverip=192.168.3.
U-Boot for MPL SBC User Manual High-Tech • Made in Switzerland FFC50000 RO FFCA0000 RO FFCF0000 RO FFD40000 RO FFD90000 RO FFDE0000 RO FFE30000 RO FFE80000 RO FFED0000 RO FFF20000 RO FFF70000 RO FFFC0000 RO FFFF4000 ERO FFFFE000 RO FFC60000 RO FFCB0000 RO FFD00000 RO FFD50000 RO FFDA0000 RO FFDF0000 RO FFE40000 RO FFE90000 RO FFEE0000 RO FFF30000 RO FFF80000 RO FFFD0000 ERO FFFF6000 ERO FFC70000 RO FFCC0000 RO FFD10000 RO FFD60000 RO FFDB0000 RO FFE00000 RO FFE50000 RO FFEA0000 RO FFEF0000 RO FFF40000 R
U-Boot for MPL SBC User Manual High-Tech • Made in Switzerland 3.3.38 saveenv - save environment variables to persistent storage On boot-up the environment is copied from the EEPROM to the RAM, and all changes on the environment variables are done in the RAM. So the environment is volatile. To store the actual environment to the persistent storage use this command. Abbreviation: save => save Saving Environment to EEPROM... => 3.3.
U-Boot for MPL SBC User Manual High-Tech • Made in Switzerland 3.3.42 tftpboot- boot image via network using TFTP protocol Used to load the image via the network using the TFTP protocol. For this purpose following environment variables must be set: ipaddr The IP address of the board • netmask The appropriate netmask • serverip The IP address of the TFTP Server • Abbreviation: tftp => help tftp tftpboot [loadAddress] [bootfilename] => To use this command, you need to set-up a tftp server.
U-Boot for MPL SBC User Manual High-Tech • Made in Switzerland usb tree shows all the USB devices in a tree structure how the devices are connected: => usb tree Device Tree: 1 Hub (12MBit/s, 0mA) | UHCI Root Hub | +-2 Mass Storage (12MBit/s, 500mA) | MITSUMI MITSUMI USB FDD | +-3 Hub (12MBit/s, 100mA) | Generic USB Hub | +-4 Human Interface (1.5MBit/s, 100mA) | Chicony KMp | +-5 Human Interface (1.5MBit/s, 50mA) Logitech USB Mouse => usb info [dev] shows detailed information about the specified device.
U-Boot for MPL SBC User Manual High-Tech • Made in Switzerland 3.3.44 usbboot - boot from USB device Booting from USB is a little bit more complex than from other boot sources. This is because the usb subsystem must first be started. For more information refer to 3.3.43 usb - USB sub-system. Note: Booting via USB is only tested with floppy, although other devices may also work. => usb start (Re)start USB... USB: scanning bus for devices...
U-Boot for MPL SBC User Manual High-Tech • Made in Switzerland 3.4 U-Boot Environment Variables One of the powerful features of the U-Boot are the environment variables. They are stored in the on board EEPROM and protected with a CRC32 checksum. These variables are used to store the board properties and control the boot behavior. 3.4.
U-Boot for MPL SBC User Manual High-Tech • Made in Switzerland 3.4.5 Automatically updated Variables filesize contains the file size in bytes after loading an image into the memory. This can be used when writing an image to the flash. Depending on your server configuration some of the following variables will be updated after an ‘dhcp’, ‘rarpb’ or ‘bootp’ command: • ipaddr • serverip • netmask • gatewayip • dnsip • bootfile • rootpath • hostname 2003 by MPL AG 27 MEH-10082-002 Rev.
U-Boot for MPL SBC User Manual High-Tech • Made in Switzerland 3.5 Procedures 3.5.1 Updating the bootloader To update the U-Boot you need a new U-Boot image, which is available on www.mpl.ch. The image may be in a zipped file containing 3 different file format: • u-boot-X.Y.Z-BOARD_zip.img This is a compressed bootloader image file. • u-boot-X.Y.Z-BOARD.img This is a uncompressed bootloader image file. It is only used for boards with the ppcboot version < 1.1.3 • u-boot-X.Y.Z-BOARD.
U-Boot for MPL SBC User Manual High-Tech • Made in Switzerland 3.5.2 Programming a kernel image into the flash The location whereas the kernel image should written to, is board depending. MIP405/PIP405: The flash is used to store the bootloader and the unused flash memory can be used to store a kernel image. The bootloader is programmed from address 0xFFF80000 to 0xFFFFFFFF and must not be overwritten. The remaining flash memory depends on the populated flash.
U-Boot for MPL SBC User Manual High-Tech • Made in Switzerland 3.5.2.3 Write the image into the flash On MIP405/PIP405 use the command cp to copy the image into the flash. Refer to the chapter 3.3.8 cp - memory copy for more information: => cp.b 400000 ffc00000 $filesize Copy to Flash... .......................................................done => imi ffc00000 ## Checking Image at ffc00000 ...
U-Boot for MPL SBC User Manual High-Tech • Made in Switzerland 3.5.3 Console assignment The default console is the RS232 interface. On some boards alternatively in/output devices can be used, for example: PIP405: • Onboard keyboard controller • USB keyboard • Onboard VGA MIP405: • USB keyboard • PC/104-Plus VGA card (currently only ct69000 boards) VCMA9: • Onboard LCD controller (not yet implemented) • USB keyboard (not yet implemented) 3.5.3.
U-Boot for MPL SBC User Manual High-Tech • Made in Switzerland 3.5.3.2 Working with an USB Keyboard To use an USB keyboard you have to start the USB Sub-system first. To start this automatically on start-up, you have to set the environment variable preboot: => setenv preboot usb start => setenv stdin usbkbd => saveenv Saving Environment to EEPROM... => Warning: Please make sure to stop the USB subsystem before booting an OS.
U-Boot for MPL SBC User Manual High-Tech • Made in Switzerland 3.5.4 Creating bootable kernel images This chapter explains how a kernel binary is converted into a u-boot image. If you are looking for information how to build a kernel, refer to the kernel documentation. The main purpose of u-boot is to load data into the memory and perform the appropriate action with this data. In case of a kernel, the action is to write it to the specified Memory location passing parameters to it and execute it.
U-Boot for MPL SBC User Manual High-Tech • Made in Switzerland 3.5.5 Creating a new U-Boot Image Provided that you have already build a appropriate toolchain use following steps to build a new u-boot: • Download the latest u-boot sources from www.u-boot.sourceforge.net • Set the environment variable CROSS_COMPILE accordingly to your toolchain and make sure that the path to your cross toolchain is included in your PATH variable.
U-Boot for MPL SBC User Manual High-Tech • Made in Switzerland 4. Support Information 4.1 U-Boot project The U-Boot project has a mailing list which is available at www.u-boot.sourceforge.net. 4.2 MPL AG In case of questions contact MPL AG or your local distributor. MPL AG homepage: Email address: 2003 by MPL AG www.mpl.ch support@mpl.ch 35 MEH-10082-002 Rev.
U-Boot for MPL SBC User Manual High-Tech • Made in Switzerland COPYRIGHT AND REVISION HISTORY Copyright 2003 by MPL AG Elektronikunternehmen. All rights reserved. Reproduction of this document in part or whole, by any means is prohibited, without written permission from MPL AG Elektronikunternehmen. This manual reflects U-Boot 0.4.0.