ChorusOS 4.0 Porting Guide

Banks

The banks folder contains definitions of the system image memory banks.

A system image memory bank is specified by an object of the type Bank. The following fields of a Bank object are defined in a target.xml file:

The board-specific configuration can define any number of memory banks. A board-specific configuration must define a Bank object named sys_bank.

For example, the SBC8260 board-specific configuration defines two memory banks trampoline_bank and sys_bank.

trampoline_bank will contain the power-up initialization (trampoline) program (see "Power-up Program Implementation"). sys_bank will contain the remains of the system image.

Example 5-2 is an extract of the SBC8260 board-specific configuration file, and defines the trampoline_bank and sys_bank objects.


Example 5-2 SBC8260 Bank Configuration

	
<folder name='Banks'>

    <description>system image memory banks</description>

    <definition name='sys_bank'>
      <description>default system image memory bank</description>
      <condition>
        <equal><var name='BOOT_MODE' /><const>RAM</const></equal>
      </condition>

      <type name='Bank' />
      <value field='ram'><true /></value>
      <value field='addr'><const>0x00100000</const></value>
      <value field='size'><const>0x00f00000</const></value>
    </definition>

    <definition name='trampoline_bank'>
      <description>memory bank for a 'trampoline' (eg. power-up) binary</description>
      <condition>
        <equal><var name='BOOT_MODE' /><const>ROM</const></equal>
      </condition>
      <type name='Bank' />
      <value field='ram'><false /></value>
      <value field='addr'><const>0xfff00000</const></value>
      <value field='size'><const>0x00001000</const></value>
    </definition>

    <definition name='sys_bank'>
      <description>default system image memory bank</description>
      <condition>
        <equal><var name='BOOT_MODE' /><const>ROM</const></equal>
      </condition>
      <type name='Bank' />
      <value field='ram'><false /></value>
      <value field='addr'><const>0xfff01000</const></value>
      <value field='size'><const>0x000ff000</const></value>
    </definition>

  </folder>

Two bank configurations are provided. The first configuration is used when the system is configured to boot from ROM. This configuration is selected when the value of the BOOT_MODE configuration variable is set to ROM. In this case, trampoline_bank will start at the address 0xfff00000 and can contain up to 4K bytes, sufficient for thetrampoline program to run. sys_bank starts immediately after trampoline_bank at the address 0xfff01000 and it can contain up to 0xff000 bytes.

The second configuration is used when the system is configured to boot from RAM. In this case, trampoline_bank is not defined. sys_bank starts at the address 0x00100000 and it can contain up to 0xf00000 bytes. The RAM occupied by the bank will be tagged as allocated when the initial state of the RAM allocator is generated, because the value of the ram field is true.