RedBoot™ User's Guide: Document Version 1.9, February 2003 | ||
---|---|---|
Prev | Chapter 5. Installation and Testing | Next |
RedBoot supports the serial port and the built-in ethernet port for communication and downloads. The default serial port settings are 115200,8,N,1. RedBoot also supports flash management for the onboard 8MB flash. Several basic RedBoot configurations are supported:
RedBoot running from the board's flash boot sector.
RedBoot running from RAM with RedBoot in the flash boot sector.
A special RedBoot command: diag is used to access a set of hardware diagnostics.
The board manufacturer provides a DOS application which is capable of programming the flash over the PCI bus, and this is required for initial installations of RedBoot. Please see the board manual for information on using this utility. In general, the process involves programming the flash based RedBoot to flash. RedBoot should be programmed to flash address 0x00000000 using the DOS utility.
Two sets of prebuilt files are provided in a tarball and zip format. Each set corresponds to one of the supported configurations and includes an ELF file (.elf), a binary image (.bin), and an S-record file (.srec).
For RedBoot running from the flash boot sector: loaders/iq80321/iq80321-rom.bin loaders/iq80321/iq80321-rom.elf loaders/iq80321/iq80321-rom.srec For RedBoot running from RAM with RedBoot in the flash boot sector: loaders/iq80321/iq80321-ram.bin loaders/iq80321/iq80321-ram.elf loaders/iq80321/iq80321-ram.srec |
To install RedBoot to run from the flash boot sector, use the manufacturer's flash utility to install the loaders/iq80321/iq80321-rom.bin image at address zero.
After booting the initial installation of RedBoot, this warning may be printed:
flash configuration checksum error or invalid key |
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 0xf07e0000-0xf0800000: . ... Erase from 0xf07e0000-0xf0800000: . ... Program from 0x01ddf000-0x01ddf400 at 0xf07e0000: . ... Lock from 0xf07e0000-0xf0800000: . |
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:
RedBoot uses the two digit LED display to indicate status during board initialization. Possible codes are:
LED Actions ------------------------------------------------------------- Power-On/Reset 88 Set the CPSR Enable coprocessor access Drain write and fill buffer Setup PBIU chip selects A1 Enable the Icache A2 Move FLASH chip select from 0x0 to 0xF0000000 Jump to new FLASH location A3 Setup and enable the MMU A4 I2C interface initialization 90 Wait for I2C initialization to complete 91 Send address (via I2C) to the DIMM 92 Wait for transmit complete 93 Read SDRAM PD data from DIMM 94 Read remainder of EEPROM data. An error will result in one of the following error codes on the LEDs: 77 BAD EEPROM checksum 55 I2C protocol error FF bank size error A5 Setup DDR memory interface A6 Enable branch target buffer Drain the write & fill buffers Flush Icache, Dcache and BTB Flush instuction and data TLBs Drain the write & fill buffers SL ECC Scrub Loop SE A7 Clean, drain, flush the main Dcache A8 Clean, drain, flush the mini Dcache Flush Dcache Drain the write & fill buffers A9 Enable ECC AA Save SDRAM size Move MMU tables into RAM AB Clean, drain, flush the main Dcache Clean, drain, flush the mini Dcache Drain the write & fill buffers AC Set the TTB register to DRAM mmu_table AD Set mode to IRQ mode A7 Move SWI & Undefined "vectors" to RAM (at 0x0) A6 Switch to supervisor mode A5 Move remaining "vectors" to RAM (at 0x0) A4 Copy DATA to RAM Initialize interrupt exception environment Initialize stack Clear BSS section A3 Call platform specific hardware initialization A2 Run through static constructors A1 Start up the eCos kernel or RedBoot |
To update the primary RedBoot images, follow the procedures detailed in the Section called Update the primary RedBoot flash image in Chapter 4, but the actual numbers used with the flags in the sample commands should be:
-f 0xf0000000 -b 0x100000 -l 0x40000 |
To update the secondary RedBoot image, follow the procedures detailed in the Section called Load and start a different version of RedBoot, running from RAM in Chapter 4, but the actual numbers used with the flags in the sample commands should be:
-f 0xf0040000 -b 0x20000 -r 0x20000 -l 0x40000 |
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): |
This test is used to test installed DDR SDRAM memory. Five different tests are run over the given address ranges. If errors are encountered, the test is aborted and information about the failure is printed. When selected, the user will be prompted to enter the base address of the test range and its size. The numbers must be in hex with no leading “0x”
Enter the menu item number (0 to quit): 1 Base address of memory to test (in hex): 100000 Size of memory to test (in hex): 200000 Testing memory from 0x00100000 to 0x002fffff. Walking 1's test: 0000000100000002000000040000000800000010000000200000004000000080 0000010000000200000004000000080000001000000020000000400000008000 0001000000020000000400000008000000100000002000000040000000800000 0100000002000000040000000800000010000000200000004000000080000000 passed 32-bit address test: passed 32-bit address bar test: passed 8-bit address test: passed Byte address bar test: passed Memory test done. |
The repeating memory tests are exactly the same as the above memory tests, except that the tests are automatically rerun after completion. The only way out of this test is to reset the board.
This is similar to the repeating memory tests except that when an error is found, the failing test continuously retries on the failing address.
This tests the operation of the sixteen position rotary switch. When run, this test will display the current position of the rotary switch on the LED display. Slowly dial through each position and confirm reading on LED.
This tests the operation of the seven segment displays. When run, each LED cycles through 0 through F and a decimal point.
This test initializes the ethernet controller’s serial EEPROM if the current contents are invalid. In any case, this test will also allow the user to enter a six byte ethernet MAC address into the serial EEPROM.
Enter the menu item number (0 to quit): 6 Current MAC address: 00:80:4d:46:00:02 Enter desired MAC address: 00:80:4d:46:00:01 Writing to the Serial EEPROM... Done ******** Reset The Board To Have Changes Take Effect ******** |
This tests the current status of the battery. First, the test checks to see if the battery is installed and reports that finding. If the battery is installed, the test further determines whether the battery status is one or more of the following:
Battery is charging.
Battery is fully discharged.
Battery voltage measures within normal operating range.
This tests the battery backup of SDRAM memory. This test is a three step process:
Select Battery backup test from main diag menu, then write data to SDRAM.
Turn off power for 60 seconds, then repower the board.
Select Battery backup test from main diag menu, then check data that was written in step 1.
This tests the internal timer by printing a number of dots at one second intervals.
This tests the secondary PCI-X bus and socket. This test requires that an IQ80310 board be plugged into the secondary slot of the IOP321 board. The test assumes at least 32MB of installed memory on the IQ80310. That memory is mapped into the IOP321 address space and the memory tests are run on that memory.
This test puts the CPU into a tight loop run entirely from the ICache. This should prevent all external bus accesses.
The build process is nearly identical for the 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 is:
% export TOPDIR=`pwd` % export ECOS_REPOSITORY=\ ${TOPDIR}/src/ecos-monitors/redboot-DATE-intel/packages % 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 |
% ecosconfig import \ ${ECOS_REPOSITORY}/hal/arm/xscale/iq80321/VERSION/misc/redboot_RAM.ecm |
RedBoot uses an interrupt vector table which is located at address 0x8004. Entries in this table are pointers to functions with this protoype::
int irq_handler( unsigned vector, unsigned data ) |
// *** 80200 CPU *** #define CYGNUM_HAL_INTERRUPT_DMA0_EOT 0 #define CYGNUM_HAL_INTERRUPT_DMA0_EOC 1 #define CYGNUM_HAL_INTERRUPT_DMA1_EOT 2 #define CYGNUM_HAL_INTERRUPT_DMA1_EOC 3 #define CYGNUM_HAL_INTERRUPT_RSVD_4 4 #define CYGNUM_HAL_INTERRUPT_RSVD_5 5 #define CYGNUM_HAL_INTERRUPT_AA_EOT 6 #define CYGNUM_HAL_INTERRUPT_AA_EOC 7 #define CYGNUM_HAL_INTERRUPT_CORE_PMON 8 #define CYGNUM_HAL_INTERRUPT_TIMER0 9 #define CYGNUM_HAL_INTERRUPT_TIMER1 10 #define CYGNUM_HAL_INTERRUPT_I2C_0 11 #define CYGNUM_HAL_INTERRUPT_I2C_1 12 #define CYGNUM_HAL_INTERRUPT_MESSAGING 13 #define CYGNUM_HAL_INTERRUPT_ATU_BIST 14 #define CYGNUM_HAL_INTERRUPT_PERFMON 15 #define CYGNUM_HAL_INTERRUPT_CORE_PMU 16 #define CYGNUM_HAL_INTERRUPT_BIU_ERR 17 #define CYGNUM_HAL_INTERRUPT_ATU_ERR 18 #define CYGNUM_HAL_INTERRUPT_MCU_ERR 19 #define CYGNUM_HAL_INTERRUPT_DMA0_ERR 20 #define CYGNUM_HAL_INTERRUPT_DMA1_ERR 22 #define CYGNUM_HAL_INTERRUPT_AA_ERR 23 #define CYGNUM_HAL_INTERRUPT_MSG_ERR 24 #define CYGNUM_HAL_INTERRUPT_SSP 25 #define CYGNUM_HAL_INTERRUPT_RSVD_26 26 #define CYGNUM_HAL_INTERRUPT_XINT0 27 #define CYGNUM_HAL_INTERRUPT_XINT1 28 #define CYGNUM_HAL_INTERRUPT_XINT2 29 #define CYGNUM_HAL_INTERRUPT_XINT3 30 #define CYGNUM_HAL_INTERRUPT_HPI 31 |
An application may create a normal C function with the above prototype to be an ISR. Just poke its address into the table at the correct index and enable the interrupt at its source. The return value of the ISR is ignored by RedBoot.
The RAM based page table is located at RAM start + 0x4000. RedBoot may be configured for one of two memory maps. The difference between them is the location of RAM and the PCI outbound windows. The alternative memory map may be used when building RedBoot or eCos by using the RAM_ALTMAP and ROM_ALTMAP startup types in the configuration.
NOTE: The virtual memory maps in this section use a C, B, and X column to indicate the caching policy for the region..
X C B Description - - - --------------------------------------------- 0 0 0 Uncached/Unbuffered 0 0 1 Uncached/Buffered 0 1 0 Cached/Buffered Write Through, Read Allocate 0 1 1 Cached/Buffered Write Back, Read Allocate 1 0 0 Invalid -- not used 1 0 1 Uncached/Buffered No write buffer coalescing 1 1 0 Mini DCache - Policy set by Aux Ctl Register 1 1 1 Cached/Buffered Write Back, Read/Write Allocate Physical Address Range Description ----------------------- ---------------------------------- 0x00000000 - 0x7fffffff ATU Outbound Direct Window 0x80000000 - 0x900fffff ATU Outbound Translate Windows 0xa0000000 - 0xbfffffff SDRAM 0xf0000000 - 0xf0800000 FLASH (PBIU CS0) 0xfe800000 - 0xfe800fff UART (PBIU CS1) 0xfe840000 - 0xfe840fff Left 7-segment LED (PBIU CS3) 0xfe850000 - 0xfe850fff Right 7-segment LED (PBIU CS2) 0xfe8d0000 - 0xfe8d0fff Rotary Switch (PBIU CS4) 0xfe8f0000 - 0xfe8f0fff Baterry Status (PBIU CS5) 0xfff00000 - 0xffffffff IOP321 Memory mapped Registers Default Virtual Map X C B Description ----------------------- - - - ---------------------------------- 0x00000000 - 0x1fffffff 1 1 1 SDRAM 0x20000000 - 0x9fffffff 0 0 0 ATU Outbound Direct Window 0xa0000000 - 0xb00fffff 0 0 0 ATU Outbound Translate Windows 0xc0000000 - 0xdfffffff 0 0 0 Uncached alias for SDRAM 0xe0000000 - 0xe00fffff 1 1 1 Cache flush region (no phys mem) 0xf0000000 - 0xf0800000 0 1 0 FLASH (PBIU CS0) 0xfe800000 - 0xfe800fff 0 0 0 UART (PBIU CS1) 0xfe840000 - 0xfe840fff 0 0 0 Left 7-segment LED (PBIU CS3) 0xfe850000 - 0xfe850fff 0 0 0 Right 7-segment LED (PBIU CS2) 0xfe8d0000 - 0xfe8d0fff 0 0 0 Rotary Switch (PBIU CS4) 0xfe8f0000 - 0xfe8f0fff 0 0 0 Baterry Status (PBIU CS5) 0xfff00000 - 0xffffffff 0 0 0 IOP321 Memory mapped Registers Alternate Virtual Map X C B Description ----------------------- - - - ---------------------------------- 0x00000000 - 0x000fffff 1 1 1 Alias for 1st MB of SDRAM 0x00100000 - 0x7fffffff 0 0 0 ATU Outbound Direct Window 0x80000000 - 0x900fffff 0 0 0 ATU Outbound Translate Windows 0xa0000000 - 0xbfffffff 1 1 1 SDRAM 0xc0000000 - 0xdfffffff 0 0 0 Uncached alias for SDRAM 0xe0000000 - 0xe00fffff 1 1 1 Cache flush region (no phys mem) 0xf0000000 - 0xf0800000 0 1 0 FLASH (PBIU CS0) 0xfe800000 - 0xfe800fff 0 0 0 UART (PBIU CS1) 0xfe840000 - 0xfe840fff 0 0 0 Left 7-segment LED (PBIU CS3) 0xfe850000 - 0xfe850fff 0 0 0 Right 7-segment LED (PBIU CS2) 0xfe8d0000 - 0xfe8d0fff 0 0 0 Rotary Switch (PBIU CS4) 0xfe8f0000 - 0xfe8f0fff 0 0 0 Baterry Status (PBIU CS5) 0xfff00000 - 0xffffffff 0 0 0 IOP321 Memory mapped Registers |
The flash based RedBoot image occupies flash addresses 0xf0000000 - 0xf003ffff and RAM addresses (0x00000000 - 0x0001ffff).
The RAM based RedBoot configuration is designed to run from RAM at addresses 0x00020000 - 0x0005ffff. RAM addresses from 0x00060000 to the end of RAM are available for general use, such as a temporary scratchpad for downloaded images before they are written to flash.
The IOP321 programmable timer0 is used for timeout support for networking and XModem file transfers.