P. Person

Running code in RAM from FLASH (PowerPC 8270)

Discussion created by P. Person on Mar 22, 2006
Latest reply on Mar 23, 2006 by Teo
I'm running the code from FLASH currently, but want to speed things up by copying the code to RAM at boot up and executing there. What do I have to change in the CodeWarrior project settings and/or linker file to have the boot code in FLASH copy the executable to RAM and jump there?

My current .lcf file is:

MEMORY
{
SDRAM: org = 0x00000000, len = 0x02000000 // 32 Meg
IMMR: org = 0x04700000, len = 0x00020000 // 128 K
LBUS_SDRAM: org = 0xD0000000, len = 0x00800000 // 8 Meg
FLASH: org = 0xFF000000, len = 0x01000000 // 16 Meg

rom: org = 0xFFF00100, len = 0x000FFF00 /* Flash */
ram: org = 0x00100000, len = 0x00100000 /* SDRAM */
kernel_data: org = 0x00200000, len = 0x00A00000 /* SDRAM */
pflash: org = 0x00C00000, len = 0x00400000 /* 4 MB */

}

SECTIONS
{

GROUP : {

.code (TEXT) :
{

* (.vector0100)
. = ALIGN(0x100);
* (.vector0200)
. = ALIGN(0x100);
* (.dsExcpt)
. = ALIGN(0x100);
* (.isExcpt)
. = ALIGN(0x100);
* (.vector0500)
. = ALIGN(0x100);
* (.vector0600)
. = ALIGN(0x100);
* (.vector0700)
. = ALIGN(0x100);
* (.vector0800)
. = ALIGN(0x100);
* (.vector0900)
. = ALIGN(0x100);
* (.vector0A00)
. = ALIGN(0x100);
. = . +0x100;
* (.vector0C00)
. = ALIGN(0x100);
. = . +0x300;
* (itlb_miss)
. = ALIGN(0x100);
* (dtlb_miss_load)
. = ALIGN(0x100);
* (dtlb_miss_store)
. = ALIGN(0x100);
* (.vector1300)
. = ALIGN(0x100);
* (.vector1400)
. = ALIGN(0x100);
. = . +0x1B00;
* (DISPATCH)
* (IPSUM)
* (.text)
* (.eini)
* (.fini)
* (.init)
* (tlb_data_violation)
* (tlb_inst_violation)
}
.ctors (CONST) : {}
.dtors (CONST) : {}
.rodata (CONST) : {
*(.rdata)
*(.rodata)
}
extab : {}
extabindex : {}

} > rom

GROUP : {
.data : {}
.sdata : {}
.sbss : {}
.sdata2 : {}
.sbss2 : {}
.bss : {}

} > ram

flashp (TEXT) : {tc_flash.o} > pflash
}

__DEFAULT_PROCESSOR_NUMBER = 1;
__KERNEL_DATA_VERIFY_ENABLE = 0;

__SDRAM_BASE = ADDR(SDRAM);
__SDRAM_SIZE = SIZEOF(SDRAM);

__IMMR_BASE = ADDR(IMMR);
__IMMR_SIZE = SIZEOF(IMMR);

__LBUS_SDRAM_BASE = ADDR(LBUS_SDRAM);
__LBUS_SDRAM_SIZE = SIZEOF(LBUS_SDRAM);

__FLASH_BASE = ADDR(FLASH);
__FLASH_SIZE = SIZEOF(FLASH);

_stack_addr = ADDR(ram) + SIZEOF(ram);
__SP_INIT = ADDR(ram) + SIZEOF(ram);
_stack_end = _stack_addr - 0x1000;

__KERNEL_DATA_START = ADDR(kernel_data);
__KERNEL_DATA_END = ADDR(kernel_data) + SIZEOF(kernel_data) - 1;

/* EOF */

Outcomes