RedBoot for the IXDP425 miniHOWTO

Last update: $Date: 2005-10-10 06:49:39 $
Maintained at sourceforge  See the project management page  or the project  home page

Introduction

This miniHOWTO provides adjunct informaton that may not be covered in the published documents or is not redily available.  

Document Sections


Copyright

This document is Copyright (C) 2003 Rob Ranslam gelloglue AT comcast DOT net.

This document is free documentation. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is located at http://www.gnu.org/licenses/fdl.html.

Disclaimer

This document is distributed in the hope that it will be useful, but without any warantee, without even the implied warantee of merchantabilty or fitness for a particular purpose.

Use the information in this document at your own risk. I disavow any potential liability for the contents of this document. Use of the concepts, examples, and/or other content of this document is entirely at your own risk.

All copyrights are owned by their owners, unless specifically noted otherwise. Use of a term in this document should not be regarded as affecting the validity of any trademark or service mark.

Naming of particular products or brands should not be seen as endorsements.

You are strongly recommended to take a backup of your system before major installation and backups at regular intervals.


Prerequisites

Before going any further,  see the existing documention:

RedBoot Version

The "Convenience" RedBoot originally provided by Intel for the IXDP425 reports a version number of 2.0. This a contrived number.  The source tree that was actually used would create a v1.5 RedBoot.  The latest verion reports v1.92.  This does NOT mean the version is regressing, but rather RedBoot for the IXDP425 now correctly reports the version of the software source tree release.  Also version 1.92 has source available for adding the NPE support so that the NPE ethernet devices can be used to load/transfer images.  The RedHat binaries do not support the NPE's.

Host system setup for using RedBoot

See the  Host system setup HOWTO for details.  At a minimum, minicom (teminal communication program) and tftp must be setup to allow for loading images.   You can also transfer images via the serial link using xmodem, but this is slower. See the RedBoot doumentation for details.

Example RedBoot Use

The easiest way to use RedBoot is to have and example to follow. Then cut and paste the commands into a terminal session to the RedBoot prompt. The commands that are presented in the next sections are specific to loading the demo images.  This is a convenient way to show the steps in using redboot.


Redboot Setup on the IXDP425

To setup RedBoot on the IXDP425 requires entering the fis init -f  and fconfig -i commands. The commands and the output generated is show below.  The keystokes entered are in white.  Accept the defaults by pressing the "Enter" key as each line is displayed



RedBoot> fis init -f
About to initialize [format] FLASH image system - continue (y/n)? y
*** Initialize FLASH Image System
... Erase from 0x50040000-0x50fc0000: ................................... <truncated>
... Erase from 0x50fe0000-0x50fe0000:
... Erase from 0x51000000-0x51000000:
... Unlock from 0x50fe0000-0x51000000: .
... Erase from 0x50fe0000-0x51000000: .
... Program from 0x0ffdf000-0x0ffff000 at 0x50fe0000: .
... Lock from 0x50fe0000-0x51000000:

RedBoot> fconfig -i
Initialize non-volatile configuration - continue (y/n)? y
Run script at boot: false
Use BOOTP for network configuration: true
Console baud rate: 115200
DNS server IP address:
GDB connection port: 9000
Force console for special debug messages: false
Network debug at boot time: false
Default network device: i82559_eth0
Update RedBoot non-volatile configuration - continue (y/n)? y
... Unlock from 0x50fc0000-0x50fc1000: .
... Erase from 0x50fc0000-0x50fc1000: .
... Program from 0x0ffd2000-0x0ffd3000 at 0x50fc0000: .
... Lock from 0x50fc0000-0x50fc1000: .
RedBoot>



NPE ethernet setup

For RedBoot to recognized and use ANY ethernet device,  the network device MUST have it's MAC address set. For the EtherPRO10/100  PCI adpater this is already set, but for a new RedBoot install, the NPE MAC addresses need to be initialized. This is done using the Set MAC address command. 

RedBoot> set_npe_mac -p 0 00:12:34:56:78:9a

Setting the default ethernet port 

This is done using the fconfig command. The ethernet port must be set to one of the following
    i82559_eth0
    npe_eth0
    npe_eth1

THe default ethernet device is set to i82559_eth0 after runnng the fconfig -i command.  To change this run the fconfig command, accept the defaults for each choice until you reach the line
Default network device: i82559_eth0
Backspace (delete ) the device name and enter the npe port if you want to use the NPE ethernet as the default network device.

Loading Images from FLASH and Running on the IXDP425

This section provides the steps to place images into flash and setup the RedBoot boot script.  This allows for a kernel and ramdisk image to be loaded and executed automatically on a power cycle.
 NOTE: The kernel and ramdisk images shown in the example are from the prebuilt linux images. 

Using RedBoot v1.92

This is the latest release of RedBoot. The command to load and execute images has changed. RedBoot v1.92 adds NPE support to allow the MII interfaces to be used to load images. The "go" now has the -n argument.  This informs RedBoot to stop the NPE's befor passing control over to the loaded imaged.  The "exec" command does this automatically.

These RedBoot commands  to load and setup images for use by the boot script in RedBoot v1.92 are...


RedBoot> load -r -v -b 0x01600000 zImage
RedBoot> fis create -b 0x01600000 -l 0xb0000 zimage
RedBoot> load -r -v -b 0x00800000 ramdisk.gz
RedBoot> fis create -b 0x00800000 -l 0x282000 ramdisk


Using the fconfig command, setup the boot script. Commands entered are shown as white text. Otherwise use the default values


RedBoot> fconfig
Run script at boot: true
Enter script, terminate with empty line
>> fis load ramdisk
>> fis load zimage
>> go -n 0x01600000
>>
Boot script timeout (1000ms resolution): 3
Use BOOTP for network configuration: true
Console baud rate: 115200
DNS server IP address:
GDB connection port: 9000
Force console for special debug messages: true
Console number for special debug messages: 0
Network debug at boot time: false
Default network device: npe_eth0
Update RedBoot non-volatile configuration - continue (y/n)? y
... Unlock from 0x50fc0000-0x50fc1000: .
... Erase from 0x50fc0000-0x50fc1000: .
... Program from 0x0ffd2000-0x0ffd3000 at 0x50fc0000: .
... Lock from 0x50fc0000-0x50fc1000: .
RedBoot>


 The images are loaded ans executed each time the board power cycled.

Using Redboot 2.0

Redboot v2.0 does not contain NPE support. The commands are nearly identical to those in v1.92. The changes are identified in red. The main change is the addess base. The -n argument for the go command is not available. The "exec" command is not available


RedBoot> load -r -v -b 0x11600000 zImage
RedBoot> fis create -b 0x11600000 -l 0xb0000 zimage
RedBoot> load -r -v -b 0x10800000 ramdisk.gz
RedBoot> fis create -b 0x10800000 -l 0x282000 ramdisk


Change the go command to remove the -n argument

RedBoot> go 0x11600000


Rebuilding Redboot

The details for rebuilding redboot are provided in the Release notes.  In order to automate the  build, a script (or a makefile) can be used. A script is provided here for your convenience. The steps can also be placed in a Makefile.

To use the script, save as a file named build-redboot and then make it executable with the command...

chmod +x build-redboot


Refer the readme.txt file in the redboot source for additional information on building Redboot.


Productizing RedBoot

When delivering a product, you may need to modify RedBoot to meet the product requirements.  This section identies those areas that you should consider addressing

Version and compile time

As soon as you compile redboot the build time reported changeds. So  the verions number reported and the state of being a RedHat certified release  cannot be comfirmed.  You may want to modify the verision reported by RedBoot so that you can accomodate this on a product by product basis.  The compile time is a valid diferentiator as this indicated that the source was recompiled and may have been modified, even though the version number reported is the same.  If you customize RedBoot, be sure to add this to the  verion reporting.

Available Commands

The default setup of RedBoot is for a developement environment- e,g, debug stub, IP address assignment, etc.  You may wan to consider 'defeaturing' redboot to limit the commands and functionality available.

Machine type ID

The machine type ID is passed to Linux as part of the tagged list of kernel arguments that the bootloader MUST setup.  It is also used by the decompressor ( see linux/Documentation/arm/Booting for more detail in the latest kernel). If the ID that RedBoot passes to the Kernel is different than expected, the kernel decompression halts.  The machine type ID is setup and passed to the kernel by the exec(and go) commands in RedBoot. For the exec command source see the file
hal/arm/arch/current/src/redboot_linuxexec.c
The variable that is used to set the machine type is HAL_PLATFORM_MACHINE_TYPE.    The value for the machine type in the RedBoot sourece tree is  set in the cdl file
packages/hal/arm/xscale/<platform>/current/cdl/hal_arm_xscale_<platform>.cdl

The machine type ID is different for the IXDP425 and the GRG ( Coyote).  The key here is that this number must match the number assigned via the define - MACHINE_TYPE_ID -  in the linux source tree in the file
linux/include/asm/mach-types.h 
The mahuice typ ID is then assigned via  the CONFIG_ARCH_<NAME>  variable and this is used in the kernel source file
linux/arch/arm/boot/compressed/head-xscale.S
You should request a new machine type if you are creating a reference design  or custom modified from the base platform board and expect the board to be generally or widely available, but it is not necessary.  If you are keeping the board propriatery, then use the machine ID for the IXDP425.  

Note that the file mach-types.h is generated and should not be edited.  To add a new machine to the list see the instructions in then file
linux/arch/arm/tools/mach-types 
If you make changes to RedBoot, the Linux kernel and associated configuration (like a custom BSP) then you should comsider requesting a machine ID.  This way the configuration changes to the kernel can be tied to the the machine type ID

Bootp timeout

Disable this when shipping the product, or modify the source to reducee the time out an retries.  See the file
redboot/current/src/net/bootp.c
The defines RETRY_TIME and MAX_RETRIES are set to defualt values that work in  a development environment, but not in a product.

miniFAQ

How come the RedBoot prompt is delayed for 30s?

The RedBoot prompt can be delayed from showing for several reasons.  If the network  support is not intialized, then RedBoot will delay trying for a network connection ( bootp).  By initializing the flash and setting the network parameters this can be reduced significantly.

In productizing RedBoot, you may decide that the time out for obtaining an IP address is too long.  This can be reduced by modifying the
bootp related timeout and retries in RedBoot source.  See redboot/current/erc/net/bootp.c RETRY_TIME  is set to 1 second.  MAX_RETRIES is set to 30.

Power cycling issues - running "reboot" from the linux command line, may cause RedBoot to not find a network adapter after reset, unless you initialize the default network.

How come the kerne boot stops?

The problem may be due to a configuration mismatch.  The kernel expects to have the machine ID passed to it by the bootloader.  If the machine ID is noe what the kernel expectes then you'll see this


RedBoot> go -n 0x01600000
Uncompressing Linux................................................ done, booting the kernel.
 


Then nothing else.  See the notes on  machine type ID

How do I know that RedBoot has NPE support?

The version of redboot that supports the NPE accesses is v1.92.  From the redboot prompt enter help command.  If your version of RedBoot   contains the NPE support, then the help will show the command set_npe_mac.
Set/Read MAC address for NPE ethernet ports
   set_npe_mac [-p <portnum>] [xx:xx:xx:xx:xx:xx]

How can I set up Redboot to update itself?

Since Redboot runs out of flash, is cannot update is self. An image loaded and executing from  RAM is required. These steps show how to set up Two Redboot Images in flash ( and RAM and ROM image, so that the ROM image can be updated with out an external flash programmer.


How to remove this message -What does this mean?

FLASH configuration checksum error or invalid key

This message indicates that the flash image management and configuation (for managing images ) is not initialized,  e.g. it has not been formatted.  This message appears after loading a new RedBoot image in flash after erasing the entire flash. So, you need to run the commands  fis init -f and fconfig -i accepting the defaults to complete the flash initilization.

See the RedBoot ON-line documentation -  Persistent State Flash-based Configuration and Control

What other Hardware devices are supported by RedBoot?

See the Supported Hardware list for a generic list of platforms and devices supported by RedBoot.