RedBoot for Intel XScale evaluation boards
February 14, 2003
README
========================================================================


This ReadMe contains instructions for running Redboot on the following
Intel XScale boards:

  - IQ80310
  - IQ80321
  - DBPXA27XC0
  - IXDP425
  - GRG

You will need the GNUPro xscale-elf toolchain which should be installed
as per the GNUPro documentation.


Overview
--------
These implementations of RedBoot support several configurations:

  * RedBoot running from the board's FLASH boot sector.

  * RedBoot running from RAM with RedBoot in the FLASH boot sector.

On the IQ80310 board only:

  * RedBoot running from FLASH address 0x40000 with ARM bootloader
    in FLASH boot sector.

  * RedBoot running from RAM with ARM bootloader in FLASH boot sector.

On the IQ80321 board only:

  * RedBoot running from the board's FLASH boot sector, but with RAM
    mapped at 0xa0000000.

  * RedBoot running from RAM mapped at 0xa0000000.


Installing Initial RedBoot Image
--------------------------------
Initial installations of RedBoot require the use of a flash utility or device
programmer as indicated by the board manufacturer. Please see appropriate
documentation for details on initial flash programming. A set of prebuilt files
are provided. This set corresponds to each of the supported configurations and
includes an ELF file with debug info (.elf), an ELF file without debug info
(.img), a binary image (.bin), and an S-record file (.srec).

* RedBoot on IQ80310

  - Running from the FLASH boot sector (ROM):

  build/iq80310/rom/install/bin/redboot.bin
  build/iq80310/rom/install/bin/redboot.elf
  build/iq80310/rom/install/bin/redboot.img
  build/iq80310/rom/install/bin/redboot.srec

  - Running from RAM with RedBoot in the FLASH boot sector (RAM):

  build/iq80310/ram/install/bin/redboot.bin
  build/iq80310/ram/install/bin/redboot.elf
  build/iq80310/ram/install/bin/redboot.img
  build/iq80310/ram/install/bin/redboot.srec

  - Running from the FLASH address 0x40000 with ARM bootloader (ROMA):
  May be built by the user.

  - Running from RAM with RedBoot in the FLASH at 0x40000 (RAMA):
  May be built by the user.


* RedBoot on IQ80321

  - Running from the FLASH boot sector (ROM):

  build/iq80321/rom/install/bin/redboot.bin
  build/iq80321/rom/install/bin/redboot.elf
  build/iq80321/rom/install/bin/redboot.img
  build/iq80321/rom/install/bin/redboot.srec

  - Running from RAM with RedBoot in the FLASH boot sector (RAM):

  build/iq80321/ram/install/bin/redboot.bin
  build/iq80321/ram/install/bin/redboot.elf
  build/iq80321/ram/install/bin/redboot.img
  build/iq80321/ram/install/bin/redboot.srec

  - Running from the FLASH with RAM mapped at 0xa0000000 (ROM_ALTMAP):
  May be built by the user.

  - Running from RAM mapped at 0xa0000000 (RAM_ALTMAP):
  May be built by the user.


* RedBoot on DBPXA27XC0

  - Running from the FLASH boot sector (ROM):

  build/dbpxa27xc0/rom/install/bin/redboot.bin
  build/dbpxa27xc0/rom/install/bin/redboot.elf
  build/dbpxa27xc0/rom/install/bin/redboot.img
  build/dbpxa27xc0/rom/install/bin/redboot.srec

  - Running from RAM with RedBoot in the FLASH boot sector (RAM):

  build/dbpxa27xc0/ram/install/bin/redboot.bin
  build/dbpxa27xc0/ram/install/bin/redboot.elf
  build/dbpxa27xc0/ram/install/bin/redboot.img
  build/dbpxa27xc0/ram/install/bin/redboot.srec


* RedBoot on IXDP425

  - Running from the FLASH boot sector (ROM):

  build/ixdp425/rom/install/bin/redboot.bin
  build/ixdp425/rom/install/bin/redboot.elf
  build/ixdp425/rom/install/bin/redboot.img
  build/ixdp425/rom/install/bin/redboot.srec

  - Running from RAM with RedBoot in the FLASH boot sector (RAM):

  build/ixdp425/ram/install/bin/redboot.bin
  build/ixdp425/ram/install/bin/redboot.elf
  build/ixdp425/ram/install/bin/redboot.img
  build/ixdp425/ram/install/bin/redboot.srec


* RedBoot on GRG (ADI Coyote)

  - Running from the FLASH boot sector (ROM):

  build/grg/rom/install/bin/redboot.bin
  build/grg/rom/install/bin/redboot.elf
  build/grg/rom/install/bin/redboot.img
  build/grg/rom/install/bin/redboot.srec

  - Running from RAM with RedBoot in the FLASH boot sector (RAM):

  build/grg/ram/install/bin/redboot.bin
  build/grg/ram/install/bin/redboot.elf
  build/grg/ram/install/bin/redboot.img
  build/grg/ram/install/bin/redboot.srec


Initial installations deal with the FLASH based RedBoots. Installation and
use of RAM based RedBoots is documented elsewhere.

To install RedBoot to run from the FLASH boot sector, use the manufacturer's
flash utility to install the redboot_ROM.bin image.

After booting the initial installation of RedBoot, this warning may be
printed:

  FLASH configuration checksum error or invalid key

This is normal and indicates that the FLASH must be configured for use by
RedBoot. Even if the above message is not printed, it may be a good idea
to reinitialize the FLASH anyway. Do this with the fis command:

  RedBoot> fis init
  About to initialize [format] FLASH image system - are you sure (y/n)? y
  *** Initialize FLASH Image System
      Warning: device contents not erased, some blocks may not be usable
  ... Unlock from 0xf1fc0000-0xf2000000: .
  ... Erase from 0xf1fc0000-0xf2000000: .
  ... Program from 0x03fbf000-0x03fff000 at 0xf1fc0000: .
  ... Lock from 0xf1fc0000-0xf2000000: .


Followed by the fconfig command:

  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
  Update RedBoot non-volatile configuration - continue (y/n)? y
  ... Unlock from 0xf1f80000-0xf1f81000: .
  ... Erase from 0xf1f80000-0xf1f81000: .
  ... Program from 0x03fb2000-0x03fb3000 at 0xf1f80000: .
  ... Lock from 0xf1f80000-0xf1f81000: .


Using RedBoot with ARM Bootloader on the IQ80310
------------------------------------------------
RedBoot can coexist with ARM tools in FLASH on the IQ80310 board. In this
configuration, the ARM bootloader will occupy the FLASH boot sector while
RedBoot is located at FLASH address 0x40000. The sixteen position rotary switch
is used to tell the ARM bootloader to jump to the RedBoot image located at
address 0x40000. RedBoot is selected by switch position 0 or 1. Other switch
positions are used by other software and RedBoot will not be started.

IQ80310 Diagnostics
-------------------
RedBoot has a 'diag' command which will provide access to a menu of hardware
setup and diagnostic functions:

  RedBoot> diag
  Entering Hardware Diagnostics - Disabling Data Cache!

  Select your Host test system

  Make a selection by typing a number.

  1 - Cyclone SB923
  2 - Personal Computer or other

After selecting 1 or 2, this menu appears:

    IQ80310 Hardware Tests

   1 - Memory Tests
   2 - Repeating Memory Tests
   3 - 16C552 DUART Serial Port Tests
   4 - Rotary Switch S1 Test
   5 - 7 Segment LED Tests
   6 - Backplane Detection Test
   7 - Battery Status Test
   8 - External Timer Test
   9 - i82559 Ethernet Configuration
  10 - i82559 Ethernet Test
  11 - i960Rx/303 PCI Interrupt Test
  12 - Internal Timer Test
  13 - Secondary PCI Bus Test
  14 - Primary PCI Bus Test
  15 - Battery Backup SDRAM Memory Test
  16 - GPIO Test
  17 - Repeat-On-Fail Memory Test
  18 - Coyonosa Cache Loop (No return)
  19 - Show Software and Hardware Revision
   0 - quit

Tests for various hardware subsystems are provided. Some tests require special
hardware in order to execute normally. The Ethernet Configuration item may be
used to set the board ethernet address.

IQ80321 Switch Settings
-----------------------
The 80321 board is highly configurable through a number of switches and
jumpers. RedBoot makes some assumptions about board configuration and attention
must be paid to these assumptions for reliable RedBoot operation:

The onboard ethernet and the secondary slot may be placed in a private space so
that they are not seen by a PC BIOS. If the board is to be used in a PC with
BIOS, then the ethernet should be placed in this private space so that RedBoot
and the BIOS do not conflict.

RedBoot assumes that the board is plugged into a PC with BIOS. This requires
RedBoot to detect when the BIOS has configured the PCI-X secondary bus. If the
board is placed in a backplane, RedBoot will never see the BIOS configure the
secondary bus. To prevent this wait, set switch S7E1-3 to ON when using the
board in a backplane.

      For the remaining switch settings, the following is a known good configuration: 

       S1D1            All OFF
       S7E1            7 is ON, all others OFF
       S8E1            2,3,5,6 are ON, all others OFF
       S8E2            2,3 are ON, all others OFF
       S9E1            3 is ON, all others OFF
       S4D1            1,3 are ON, all others OFF
       J9E1            2,3 jumpered
       J9F1            2,3 jumpered
       J3F1            Nothing jumpered
       J3G1            2,3 jumpered
       J1G2            2,3 jumpered

IQ80321 Diagnostics
-------------------
A special RedBoot command, diag, is used to access a set of hardware
diagnostics. To access the diagnostic menu, enter diag at the RedBoot prompt:
 RedBoot> diag
 Entering Hardware Diagnostics - Disabling Data Cache!

   IQ80321 Hardware Tests

  1 - Memory Tests
  2 - Repeating Memory Tests
  3 - Repeat-On-Fail Memory Tests
  4 - Rotary Switch S1 Test
  5 - 7 Segment LED Tests
  6 - i82544 Ethernet Configuration
  7 - Baterry Status Test
  8 - Battery Backup SDRAM Memory Test
  9 - Timer Test
 10 - PCI Bus test
 11 - CPU Cache Loop (No Return)
  0 - quit
 Enter the menu item number (0 to quit):


Tests for various hardware subsystems are provided, and some tests require
special hardware in order to execute normally. The Ethernet Configuration item
may be used to set the board ethernet address.


DBPXA27XC0 Switch Settings
-----------------------

DBPXA27XC0 switches should be setup so that RedBoot boots from CPU card flash
on a 32-bit bus:

   Baseboard: SW1 - dot
              SW2 - dot

   CPU board: SW3 - dot

CPU core speed is set through the rotary hex switch SW9 on the DBPXA27XC0 board:

   Value   Core (MHz)
   -----   ----------
     0        91.0
     1        39.0
     2        65.0
     3        91.0
     4       117.0
     5       143.0
     6       169.0
     7       195.0

Rebuilding RedBoot
------------------

The build process is nearly identical all of the four supported configurations.
Assuming that the provided RedBoot source tree is located in the current 
directory and that we want to build a RedBoot that runs from the FLASH boot
sector, the build process for the IQ80310 is:

  % export TOPDIR=`pwd`
  % export ECOS_REPOSITORY=${TOPDIR}/packages
  % export VERSION=current
  % mkdir ${TOPDIR}/build
  % cd ${TOPDIR}/build
  % ecosconfig new iq80310 redboot
  % ecosconfig import ${ECOS_REPOSITORY}/hal/arm/xscale/iq80310/${VERSION}/misc/redboot_ROM.ecm
  % ecosconfig tree
  % make

For the IQ80321 the build process is:

  % export TOPDIR=`pwd`
  % export ECOS_REPOSITORY=${TOPDIR}/packages
  % export VERSION=current
  % mkdir ${TOPDIR}/build
  % cd ${TOPDIR}/build
  % ecosconfig new iq80321 redboot
  % ecosconfig import ${ECOS_REPOSITORY}/hal/arm/xscale/iq80321/${VERSION}/misc/redboot_ROM.ecm
  % ecosconfig tree
  % make

For DBPXA27XC0 the build process is:

  % export TOPDIR=`pwd`
  % export ECOS_REPOSITORY=${TOPDIR}/packages
  % export VERSION=current
  % mkdir ${TOPDIR}/build
  % cd ${TOPDIR}/build
  % ecosconfig new DBPXA27XC0 redboot
  % ecosconfig import ${ECOS_REPOSITORY}/hal/arm/xscale/dbpxa27xc0/${VERSION}/misc/redboot_ROM.ecm
  % ecosconfig tree
  % make

For the IXDP425 board, the build process is:

  % export TOPDIR=`pwd`
  % export ECOS_REPOSITORY=${TOPDIR}/packages
  % export VERSION=current
  % mkdir ${TOPDIR}/build
  % cd ${TOPDIR}/build
  % ecosconfig new ixdp425 redboot
  % ecosconfig import ${ECOS_REPOSITORY}/hal/arm/xscale/ixdp425/${VERSION}/misc/redboot_ROM.ecm
  % ecosconfig tree
  % make

For the GRG board, the build process is:

  % export TOPDIR=`pwd`
  % export ECOS_REPOSITORY=${TOPDIR}/packages
  % export VERSION=current
  % mkdir ${TOPDIR}/build
  % cd ${TOPDIR}/build
  % ecosconfig new grg redboot
  % ecosconfig import ${ECOS_REPOSITORY}/hal/arm/xscale/grg/${VERSION}/misc/redboot_ROM.ecm
  % ecosconfig tree
  % make

If a different configuration is desired, simply use the above build processes but
substitute an alternate configuration file for the ecosconfig import command.

Building ecosconfig
-------------------

An ecosconfig binary is supplied in the bin directory, but you may wish
to build it from source.

Detailed instructions for building the command-line tool ecosconfig
on UNIX can be found in host/README. For example:

  mkdir $TEMP/redboot-build
  cd $TEMP/redboot-build
  $TOPDIR/host/configure --prefix=$TEMP/redboot-build --with-tcl=/usr
  make 
