forked from len0rd/rockbox
Real fake IRAM by placing .i.... section in the analagous DRAM sections in the linker scripts that hasn't done this yet.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17449 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
ab15fa7e00
commit
209aa8eda5
7 changed files with 39 additions and 114 deletions
|
|
@ -30,8 +30,7 @@
|
|||
/* Code performs slower in IRAM on PP502x and there is no space in
|
||||
mpegplayer on the PP5002. S3C2440 doesn't have any IRAM available for
|
||||
codecs */
|
||||
#if defined(CPU_PP502x) || (CONFIG_CPU == PP5002 && defined(MPEGPLAYER)) || \
|
||||
(CONFIG_CPU==S3C2440) || (CONFIG_CPU==IMX31L)
|
||||
#if defined(CPU_PP502x) || (CONFIG_CPU == PP5002 && defined(MPEGPLAYER))
|
||||
#define ICODE_SECTION_MPA_ARM .text
|
||||
#define ICODE_ATTR_MPA_SYNTH
|
||||
#else
|
||||
|
|
@ -39,11 +38,7 @@
|
|||
#define ICODE_ATTR_MPA_SYNTH ICODE_ATTR
|
||||
#endif
|
||||
|
||||
#if CONFIG_CPU == S3C2440 || CONFIG_CPU == IMX31L
|
||||
#define IBSS_SECTION_MPA_ARM .bss
|
||||
#else
|
||||
#define IBSS_SECTION_MPA_ARM .ibss
|
||||
#endif
|
||||
|
||||
#ifndef ICONST_ATTR_MPA_HUFFMAN
|
||||
#define ICONST_ATTR_MPA_HUFFMAN ICONST_ATTR
|
||||
|
|
|
|||
|
|
@ -63,14 +63,12 @@ OUTPUT_FORMAT(elf32-sh)
|
|||
#define IRAMSIZE 0x9000
|
||||
#elif CONFIG_CPU == S3C2440
|
||||
#define DRAMORIG 0x0 + STUBOFFSET
|
||||
#define IRAMORIG DRAMORIG
|
||||
#define IRAMSIZE 4K
|
||||
#define IRAM DRAM
|
||||
#define IRAMSIZE 0
|
||||
#elif CONFIG_CPU == IMX31L
|
||||
#define DRAMORIG 0x0 + STUBOFFSET
|
||||
#define IRAMORIG DRAMORIG
|
||||
#define IRAMSIZE 0x4000
|
||||
#define IRAM DRAM
|
||||
#define IRAMSIZE 0
|
||||
#elif CONFIG_CPU==DM320
|
||||
#define DRAMORIG 0x00900000 + STUBOFFSET
|
||||
#define IRAMORIG DRAMORIG
|
||||
|
|
@ -100,7 +98,7 @@ OUTPUT_FORMAT(elf32-sh)
|
|||
MEMORY
|
||||
{
|
||||
PLUGIN_RAM : ORIGIN = THIS_ORIGIN, LENGTH = THIS_LENGTH
|
||||
#if defined(IRAMSIZE)
|
||||
#if defined(IRAMSIZE) && IRAMSIZE != 0
|
||||
PLUGIN_IRAM : ORIGIN = IRAMORIG, LENGTH = IRAMSIZE
|
||||
#endif
|
||||
}
|
||||
|
|
@ -116,6 +114,9 @@ SECTIONS
|
|||
.text :
|
||||
{
|
||||
*(.text*)
|
||||
#if defined(IRAMSIZE) && IRAMSIZE == 0
|
||||
*(.icode)
|
||||
#endif
|
||||
#ifdef CPU_ARM
|
||||
*(.glue_7)
|
||||
*(.glue_7t)
|
||||
|
|
@ -125,12 +126,18 @@ SECTIONS
|
|||
.rodata :
|
||||
{
|
||||
*(.rodata*)
|
||||
#if defined(IRAMSIZE) && IRAMSIZE == 0
|
||||
*(.irodata)
|
||||
#endif
|
||||
. = ALIGN(0x4);
|
||||
} > PLUGIN_RAM
|
||||
|
||||
.data :
|
||||
{
|
||||
*(.data*)
|
||||
#if defined(IRAMSIZE) && IRAMSIZE == 0
|
||||
*(.idata)
|
||||
#endif
|
||||
} > PLUGIN_RAM
|
||||
|
||||
#if NOCACHE_BASE != 0
|
||||
|
|
@ -151,7 +158,7 @@ SECTIONS
|
|||
*(.eh_frame)
|
||||
}
|
||||
|
||||
#if defined(IRAMSIZE)
|
||||
#if defined(IRAMSIZE) && IRAMSIZE != 0
|
||||
.iram IRAMORIG : AT ( iramcopy)
|
||||
{
|
||||
iramstart = .;
|
||||
|
|
@ -175,6 +182,9 @@ SECTIONS
|
|||
{
|
||||
plugin_bss_start = .;
|
||||
*(.bss*)
|
||||
#if defined(IRAMSIZE) && IRAMSIZE == 0
|
||||
*(.ibss)
|
||||
#endif
|
||||
*(COMMON)
|
||||
. = ALIGN(0x4);
|
||||
} > PLUGIN_RAM
|
||||
|
|
|
|||
|
|
@ -46,6 +46,7 @@ SECTIONS
|
|||
. = ALIGN(0x200);
|
||||
*(.init.text)
|
||||
*(.text*)
|
||||
*(.icode)
|
||||
*(.glue_7)
|
||||
*(.glue_7t)
|
||||
. = ALIGN(0x4);
|
||||
|
|
@ -57,6 +58,7 @@ SECTIONS
|
|||
*(.rodata*)
|
||||
*(.rodata.str1.1)
|
||||
*(.rodata.str1.4)
|
||||
*(.irodata)
|
||||
. = ALIGN(0x4);
|
||||
|
||||
/* Pseudo-allocate the copies of the data sections */
|
||||
|
|
@ -70,6 +72,7 @@ SECTIONS
|
|||
{
|
||||
_datastart = .;
|
||||
*(.data*)
|
||||
*(.idata)
|
||||
. = ALIGN(0x4);
|
||||
_dataend = .;
|
||||
} > DRAM
|
||||
|
|
@ -88,26 +91,6 @@ SECTIONS
|
|||
|
||||
_vectorscopy = LOADADDR(.vectors);
|
||||
|
||||
.iram :
|
||||
{
|
||||
_iramstart = .;
|
||||
*(.icode)
|
||||
*(.irodata)
|
||||
*(.idata)
|
||||
. = ALIGN(0x4);
|
||||
_iramend = .;
|
||||
} > DRAM
|
||||
|
||||
_iramcopy = LOADADDR(.iram);
|
||||
|
||||
.ibss (NOLOAD) :
|
||||
{
|
||||
_iedata = .;
|
||||
*(.ibss)
|
||||
. = ALIGN(0x4);
|
||||
_iend = .;
|
||||
} > DRAM
|
||||
|
||||
.stack :
|
||||
{
|
||||
*(.stack)
|
||||
|
|
@ -120,6 +103,7 @@ SECTIONS
|
|||
{
|
||||
_edata = .;
|
||||
*(.bss*)
|
||||
*(.ibss)
|
||||
*(COMMON)
|
||||
. = ALIGN(0x4);
|
||||
_end = .;
|
||||
|
|
|
|||
|
|
@ -229,25 +229,6 @@ remap_end:
|
|||
ldrhi r5, [r4], #4
|
||||
strhi r5, [r2], #4
|
||||
bhi 1b
|
||||
#else
|
||||
/* Zero out IBSS */
|
||||
ldr r2, =_iedata
|
||||
ldr r3, =_iend
|
||||
mov r4, #0
|
||||
1:
|
||||
cmp r3, r2
|
||||
strhi r4, [r2], #4
|
||||
bhi 1b
|
||||
|
||||
/* Copy the IRAM */
|
||||
ldr r2, =_iramcopy
|
||||
ldr r3, =_iramstart
|
||||
ldr r4, =_iramend
|
||||
1:
|
||||
cmp r4, r3
|
||||
ldrhi r5, [r2], #4
|
||||
strhi r5, [r3], #4
|
||||
bhi 1b
|
||||
#endif /* BOOTLOADER */
|
||||
|
||||
/* Initialise bss section to zero */
|
||||
|
|
|
|||
|
|
@ -51,6 +51,7 @@ SECTIONS
|
|||
_textstart = .;
|
||||
*(.text)
|
||||
*(.text*)
|
||||
*(.icode)
|
||||
*(.glue_7)
|
||||
*(.glue_7t)
|
||||
. = ALIGN(0x4);
|
||||
|
|
@ -64,12 +65,14 @@ SECTIONS
|
|||
*(.rodata*)
|
||||
*(.rodata.str1.1)
|
||||
*(.rodata.str1.4)
|
||||
*(.irodata*)
|
||||
. = ALIGN(0x4);
|
||||
} > DRAM
|
||||
|
||||
.data :
|
||||
{
|
||||
*(.data*)
|
||||
*(.idata*)
|
||||
. = ALIGN(0x4);
|
||||
} > DRAM
|
||||
|
||||
|
|
@ -78,27 +81,9 @@ SECTIONS
|
|||
*(.eh_frame)
|
||||
}
|
||||
|
||||
.iram :
|
||||
{
|
||||
_iramstart = .;
|
||||
*(.icode)
|
||||
*(.irodata)
|
||||
*(.idata)
|
||||
. = ALIGN(0x4);
|
||||
_iramend = .;
|
||||
} > DRAM
|
||||
_initdata_end =.;
|
||||
|
||||
_iramcopy = LOADADDR(.iram);
|
||||
|
||||
.ibss :
|
||||
{
|
||||
_iedata = .;
|
||||
*(.ibss)
|
||||
. = ALIGN(0x4);
|
||||
_iend = .;
|
||||
} > DRAM
|
||||
|
||||
.stack :
|
||||
.stack (NOLOAD) :
|
||||
{
|
||||
*(.stack)
|
||||
stackbegin = .;
|
||||
|
|
@ -106,34 +91,36 @@ SECTIONS
|
|||
stackend = .;
|
||||
} > DRAM
|
||||
|
||||
.bss :
|
||||
.bss (NOLOAD) :
|
||||
{
|
||||
_edata = .;
|
||||
*(.bss*)
|
||||
*(.ibss*)
|
||||
*(COMMON)
|
||||
. = ALIGN(0x4);
|
||||
_end = .;
|
||||
} > DRAM
|
||||
|
||||
.audiobuf ALIGN(4) :
|
||||
.audiobuf (NOLOAD) :
|
||||
{
|
||||
. = ALIGN(4);
|
||||
_audiobuffer = .;
|
||||
audiobuffer = .;
|
||||
} > DRAM
|
||||
|
||||
.audiobufend ENDAUDIOADDR:
|
||||
.audiobufend ENDAUDIOADDR (NOLOAD) :
|
||||
{
|
||||
audiobufend = .;
|
||||
_audiobufend = .;
|
||||
} > DRAM
|
||||
|
||||
.codec ENDAUDIOADDR:
|
||||
.codec ENDAUDIOADDR (NOLOAD) :
|
||||
{
|
||||
codecbuf = .;
|
||||
_codecbuf = .;
|
||||
}
|
||||
|
||||
.plugin ENDADDR:
|
||||
.plugin ENDADDR (NOLOAD) :
|
||||
{
|
||||
_pluginbuf = .;
|
||||
pluginbuf = .;
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@ SECTIONS
|
|||
_textstart = .;
|
||||
*(.text)
|
||||
*(.text*)
|
||||
*(.icode)
|
||||
*(.glue_7)
|
||||
*(.glue_7t)
|
||||
. = ALIGN(0x4);
|
||||
|
|
@ -46,12 +47,14 @@ SECTIONS
|
|||
*(.rodata*)
|
||||
*(.rodata.str1.1)
|
||||
*(.rodata.str1.4)
|
||||
*(.irodata)
|
||||
. = ALIGN(0x4);
|
||||
} > DRAM
|
||||
|
||||
.data :
|
||||
{
|
||||
*(.data*)
|
||||
*(.idata)
|
||||
. = ALIGN(0x4);
|
||||
} > DRAM
|
||||
|
||||
|
|
@ -60,26 +63,6 @@ SECTIONS
|
|||
*(.eh_frame)
|
||||
}
|
||||
|
||||
.iram :
|
||||
{
|
||||
_iramstart = .;
|
||||
*(.icode)
|
||||
*(.irodata)
|
||||
*(.idata)
|
||||
. = ALIGN(0x4);
|
||||
_iramend = .;
|
||||
} > DRAM
|
||||
|
||||
_iramcopy = LOADADDR(.iram);
|
||||
|
||||
.ibss :
|
||||
{
|
||||
_iedata = .;
|
||||
*(.ibss)
|
||||
. = ALIGN(0x4);
|
||||
_iend = .;
|
||||
} > DRAM
|
||||
|
||||
.stack :
|
||||
{
|
||||
*(.stack)
|
||||
|
|
@ -92,6 +75,7 @@ SECTIONS
|
|||
{
|
||||
_edata = .;
|
||||
*(.bss*)
|
||||
*(.ibss)
|
||||
*(COMMON)
|
||||
. = ALIGN(0x4);
|
||||
_end = .;
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@ start:
|
|||
|
||||
/* Calculate the length of the code needed to run/copy */
|
||||
ldr r1, = _vectorstart
|
||||
ldr r2, = _iramend
|
||||
ldr r2, = _initdata_end
|
||||
sub r2, r2, r1
|
||||
|
||||
add r3, r2, #0x30000000
|
||||
|
|
@ -364,7 +364,7 @@ start:
|
|||
|
||||
/* Copy code to 0x30000000 */
|
||||
ldr r2, = _vectorstart
|
||||
ldr r3, = _iramend
|
||||
ldr r3, = _initdata_end
|
||||
|
||||
sub r2, r3, r2 /* length of loader */
|
||||
|
||||
|
|
@ -408,22 +408,6 @@ donecopy:
|
|||
|
||||
bl enable_mmu
|
||||
|
||||
/* Zero out IBSS */
|
||||
ldr r2, =_iedata
|
||||
ldr r3, =_iend
|
||||
mov r4, #0
|
||||
ibsszero:
|
||||
cmp r3, r2
|
||||
strhi r4, [r2], #4
|
||||
bhi ibsszero
|
||||
|
||||
/* Copy the IRAM */
|
||||
ldr r0, =_iramcopy
|
||||
ldr r1, =_iramstart
|
||||
ldr r2, =_iramend
|
||||
sub r2, r2, r1
|
||||
bl word_copy
|
||||
|
||||
/* Initialise bss section to zero */
|
||||
ldr r2, =_edata
|
||||
ldr r3, =_end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue