Matsushita MN103E010 (AM33/2.0) ASB2303 Board

Overview

RedBoot supports both serial ports for communication and downloads. The default serial port settings are 115200,8,N,1. RedBoot can run from either flash, and can support flash management for either the boot PROM or the system flash regions. These configurations are supported:

Initial Installation

Unless a pre-programmed system flash module is available to be plugged into a new board, RedBoot must be installed with the aid of a JTAG interface unit. To achieve this, the FULLRAM based RedBoot must be loaded directly into RAM by JTAG and started, and then that must be used to store the ROM based RedBoot into the boot PROM.

These instructions assume that you have binary images of the RAM-based and boot PROM-based RedBoot images available.

Preparing to program the board

If the board is to be programmed, whether via JTAG or RedBoot, some hardware settings need to be changed:

  • Jumper across ST10 on the board to allow write access to the boot PROM.

  • Set the switch ST6 (on the front of the board) to boot from whichever flash is not being programmed. Note that the RedBoot image cannot access the flash from which it is currently executing (it can only access the other flash).

The RedBoot binary image files should also be copied to the TFTP pickup area on the host providing TFTP services if that is how RedBoot should pick up the images it is going to program into the flash. Alternatively, the images can be passed by YMODEM over the serial link.

Preparing to use the JTAG debugger

The JTAG debugger will also need setting up:

  1. Install the JTAG debugger software (WICE103E) on a PC running Windows (WinNT is probably the best choice for this) in “C:/PanaX”.

  2. Install the Matsushita provided “project” into the “C:/Panax/wice103e/prj” directory.

  3. Install the RedBoot image files into the “C:/Panax/wice103e/prj” directory under the names redboot.ram and redboot.prom.

  4. Make sure the PC's BIOS has the parallel port set to full bidirectional mode.

  5. Connect the JTAG debugger to the PC's parallel port.

  6. Connect the JTAG debugger to the board.

  7. Set the switch on the front of the board to boot from “boot PROM”.

  8. Power up the JTAG debugger and then power up the board.

  9. Connect the board's Debug Serial port to a computer by a null modem cable.

  10. Start minicom or some other serial communication software and set for 115200 baud, 1-N-8 with no flow control.

Loading the RAM-based RedBoot via JTAG

To perform the first half of the operation, the following steps should be followed:

  1. Start the JTAG debugger software.

  2. Run the following commands at the JTAG debugger's prompt to set up the MMU registers on the CPU.

    ed 0xc0002000, 0x12040580
    
    ed 0xd8c00100, 0x8400fe01
    ed 0xd8c00200, 0x21111000
    ed 0xd8c00204, 0x00100200
    ed 0xd8c00208, 0x00000004
    ed 0xd8c00110, 0x8000fc01
    ed 0xd8c00210, 0x21111000
    ed 0xd8c00214, 0x00100200
    ed 0xd8c00218, 0x04000004
    ed 0xd8c00120, 0x8600fff1
    ed 0xd8c00220, 0x21111000
    ed 0xd8c00224, 0x00100200
    ed 0xd8c00228, 0x00000004
    
    ed 0xda000000,0x55561645
    ed 0xda000004,0x00000c30
    ed 0xda000008,0x9000fe01
    ed 0xda00000c,0x9200fe01
    ed 0xda000000,0xa89b0654
  3. Run the following commands at the JTAG debugger's prompt to tell it what regions of the CPU's address space it can access:

    ex 0x80000000,0x81ffffff,/mexram
    ex 0x84000000,0x85ffffff,/mexram
    ex 0x86000000,0x867fffff,/mexram
    ex 0x90000000,0x93ffffff,/mexram
  4. Instruct the debugger to load the RAM RedBoot image into RAM:

    _pc=90000000
    u_pc
    rd redboot_FULLRAM.bin,90000000
  5. Load the boot PROM RedBoot into RAM:

    rd redboot_ROM.bin,90100000
  6. Start RedBoot in RAM:

    g

Loading the boot PROM-based RedBoot via the RAM RedBoot

Once the RAM RedBoot is up and running, it can be communicated with by way of the serial port. Commands can now be entered directly to RedBoot for flashing the boot PROM.

  1. Instruct RedBoot to initialise the boot PROM:

    fis init
  2. Write the previously loaded redboot_ROM.bin image into the boot PROM:

    fis create RedBoot -b 0x90100000
  3. Check that RedBoot has written the image:

    dump -b 0x90100000
    dump -b 0x80000000

    Other than the difference in address, the two dumps should be the same.

  4. Close the JTAG software and power-cycle the board. The RedBoot banners should be displayed again over the serial port, followed by the RedBoot prompt. The boot PROM-based RedBoot will now be running.

  5. Run the following command to initialise the system flash:

    fi init

    Then program the system flash based RedBoot into the system flash:

    load -r -b 0x90100000 -m ymodem

    Use the terminal software to download redboot_FLASH.bin using YMODEM protocol.

    fis create RedBoot -b 0x90100000

    NOTE: RedBoot arranges the flashes on booting such that they always appear at the same addresses, no matter which one was booted from.

  6. A similar sequence of commands can be used to program the boot PROM when RedBoot has been booted from an image stored in the system flash.

    load -r -b 0x90100000 -m ymodem

    Use the terminal software to download redboot_ROM.bin using YMODEM protocol.

    fis cre RedBoot -b 0x90100000

    See the Section called Persistent State Flash-based Configuration and Control in Chapter 2 for details on configuring the RedBoot in general, and also the Section called Flash Image System (FIS) in Chapter 2 for more details on programming the system flash.

Additional Commands

The exec command which allows the loading and execution of Linux kernels, is supported for this architecture (see the Section called Executing Programs from RedBoot in Chapter 2). The exec parameters used for ASB2303 board are:

-w <time>

Wait time in seconds before starting kernel

-c "params"

Parameters passed to kernel

<addr>

Kernel entry point, defaulting to the entry point of the last image loaded

The parameter string is stored in the on-chip memory at location 0x8C001000, and is prefixed by “cmdline:” if it was supplied.

Memory Maps

RedBoot sets up the following memory map on the ASB2303 board.

NOTE: The regions mapped between 0x80000000-0x9FFFFFFF are cached by the CPU. However, all those regions can be accessed uncached by adding 0x20000000 to the address.

Physical Address Range   Description
-----------------------  -----------
0x80000000 - 0x9FFFFFFF  Cached Region
0x80000000 - 0x81FFFFFF  Boot PROM
0x84000000 - 0x85FFFFFF  System Flash
0x86000000 - 0x867FFFFF  8KB Configuration ROM
0x8C000000 - 0x8FFFFFFF  On-Chip Memory (repeated 16Kb SRAM)
0x90000000 - 0x93FFFFFF  SDRAM
0xDB000008               7-segment LED

The ASB2303 HAL makes use of the on-chip memory in the following way:

0x8C000000 - 0x8C0000FF  hal_vsr_table
0x8C000100 - 0x8C0001FF  hal_virtual_vector_table
0x8C001000 -             Linux command line (RedBoot exec command)
           - 0x8C003FFF  Emergency DoubleFault Exception Stack

Currently the CPU's interrupt table lies at the beginning of the RedBoot image, which must therefore be aligned to a 0xFF000000 mask.

Resource Usage

The flash based RedBoot image occupies flash addresses 0x80000000 - 0x8001ffff. RedBoot also reserves RAM (0x90000000 - 0x9001ffff) for RedBoot runtime uses. FULLRAM based RedBoot configurations are designed to run from RAM at physical addresses 0x90000000 - 0x9001ffff. RAM based RedBoot configurations are designed to run from RAM at physical addresses 0x90020000 - 0x9003ffff. RAM physical addresses from 0x90040000 to the end of RAM are available for general use, such as a temporary scratchpad for downloaded images, before they are written to flash.

NOTE: The location at which RedBoot can be started is highly restricted due to the way in which the address of the Trap Vector Table is specified to the CPU.

Rebuilding RedBoot

The instructions in Chapter 3 should be followed. The values for TARGET, ARCH_DIR and PLATFORM_DIR on this platform are “asb”, “mn10300” and “asb” respectively. Note that the configuration export files supplied in the hal/mn10300/asb/VERSION/misc directory in the RedBoot source tree should be used.