define __irq_flags in linker scripts

rebase dtcm
mirror itcm and rebase perceived code area
This commit is contained in:
Dave Murphy 2006-04-26 05:07:56 +00:00
parent 917434a9fe
commit d09118a70a
6 changed files with 34 additions and 18 deletions

View File

@ -15,6 +15,8 @@ __sp_irq = __iwram_end - 0x60;
__sp_svc = __sp_irq - 0x100;
__sp_usr = __sp_svc - 0x100;
__irq_flags = 0x0380fff8;
SECTIONS
{
.init :

View File

@ -4,19 +4,21 @@ ENTRY(_start)
MEMORY {
rom : ORIGIN = 0x08000000, LENGTH = 32M
rom : ORIGIN = 0x08000000, LENGTH = 32M
ewram : ORIGIN = 0x02000000, LENGTH = 4M - 4k
dtcm : ORIGIN = 0x00800000, LENGTH = 16K
itcm : ORIGIN = 0x00000000, LENGTH = 32K
dtcm : ORIGIN = 0x0b000000, LENGTH = 16K
itcm : ORIGIN = 0x01000000, LENGTH = 32K
}
__itcm_start = 0x00000000;
__ewram_end = 0x02400000;
__eheap_end = 0x023ff000;
__dtcm_start = 0x00800000;
__dtcm_end = 0x00804000;
__itcm_start = ORIGIN(itcm);
__ewram_end = ORIGIN(ewram) + LENGTH(ewram);
__eheap_end = ORIGIN(ewram) + LENGTH(ewram);
__dtcm_start = ORIGIN(dtcm);
__dtcm_top = ORIGIN(dtcm) + LENGTH(dtcm);
__irq_flags = __dtcm_top - 0x08;
__irq_vector = __dtcm_top - 0x04;
__sp_svc = __dtcm_end - 0x100;
__sp_svc = __dtcm_top - 0x100;
__sp_irq = __sp_svc - 0x100;
__sp_usr = __sp_irq - 0x100;
@ -28,10 +30,12 @@ SECTIONS
KEEP (*(.init))
. = ALIGN(4); /* REQUIRED. LD is flaky without it. */
} >ewram = 0xff
.plt : { *(.plt) } >ewram = 0xff
.text : /* ALIGN (4): */
{
*(EXCLUDE_FILE (*.itcm*) .text)
*(.text.*)
*(.stub)
@ -124,7 +128,6 @@ SECTIONS
.dtcm __dtcm_start : AT (__dtcm_lma)
{
__dtcm_start = ABSOLUTE(.);
*(.dtcm)
*(.dtcm.*)
. = ALIGN(4);
@ -136,9 +139,8 @@ SECTIONS
.itcm __itcm_start : AT (__itcm_lma)
{
__itcm_start = ABSOLUTE(.);
*(.itcm)
*(.itcm.*)
*itcm.*(.text)
. = ALIGN(4);
} >itcm = 0xff
__itcm_end = . ;

View File

@ -51,7 +51,7 @@ _start:
add r0,r0,#0x304
strh r1, [r0]
ldr r1, =0x00002078 @ disable DTCM and protection unit
ldr r1, =0x00002078 @ disable TCM and protection unit
mcr p15, 0, r1, c1, c0
@---------------------------------------------------------------------------------
@ -65,8 +65,13 @@ _start:
@ Wait for write buffer to empty
mcr p15, 0, r0, c7, c10, 4
ldr r0, =0x0080000A
mcr p15, 0, r0, c9, c1 @ TCM base = 0x00800*4096, size = 16 KB
ldr r0, =__dtcm_start
orr r0,r0,#0x0a
mcr p15, 0, r0, c9, c1,0 @ DTCM base = __dtcm_start, size = 16 KB
mov r0,#0x20
mcr p15, 0, r0, c9, c1,1 @ ITCM base = 0 , size = 32 MB
@---------------------------------------------------------------------------------
@ Setup memory regions similar to Release Version
@---------------------------------------------------------------------------------
@ -98,14 +103,15 @@ _start:
@-------------------------------------------------------------------------
@ Region 4 - DTCM
@-------------------------------------------------------------------------
@ldr r0,=( PAGE_16K | 0x027C0000 | 1)
ldr r0,=( PAGE_16K | 0x00800000 | 1)
ldr r0,=__dtcm_start
orr r0,r0,#(PAGE_16K | 1)
mcr p15, 0, r0, c6, c4, 0
@-------------------------------------------------------------------------
@ Region 5 - ITCM
@-------------------------------------------------------------------------
ldr r0,=( PAGE_32K | 0x00000000 | 1)
ldr r0,=__itcm_start
orr r0,r0,#(PAGE_32K | 1)
mcr p15, 0, r0, c6, c5, 0
@-------------------------------------------------------------------------

View File

@ -16,6 +16,8 @@ __sp_irq = 0x03810000 - 0x60;
__sp_svc = __sp_irq - 0x100;
__sp_usr = __sp_svc - 0x100;
__irq_flags = 0x0380fff8;
SECTIONS
{
.init :

View File

@ -64,6 +64,8 @@ __iwram_end = 0x3008000;
__sp_irq = __iwram_end - 0x100;
__sp_usr = __sp_irq - 0x100;
__irq_flags = 0x03007ff8;
SECTIONS
{
. = __text_start;

View File

@ -56,6 +56,8 @@ __iwram_end = 0x3008000;
__sp_irq = __iwram_end - 0x100;
__sp_usr = __sp_irq - 0x100;
__irq_flags = 0x03007ff8;
SECTIONS
{
. = __text_start;