From 209aa8eda5b5c7cecde65885e6beaf37c92ba622 Mon Sep 17 00:00:00 2001 From: Michael Sevakis Date: Sat, 10 May 2008 22:03:45 +0000 Subject: 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 --- apps/codecs/libmad/mad_iram.h | 7 +------ apps/plugins/plugin.lds | 22 +++++++++++++++------ firmware/target/arm/imx31/app.lds | 24 ++++------------------- firmware/target/arm/imx31/crt0.S | 19 ------------------ firmware/target/arm/s3c2440/app.lds | 37 ++++++++++++------------------------ firmware/target/arm/s3c2440/boot.lds | 24 ++++------------------- firmware/target/arm/s3c2440/crt0.S | 20 ++----------------- 7 files changed, 39 insertions(+), 114 deletions(-) diff --git a/apps/codecs/libmad/mad_iram.h b/apps/codecs/libmad/mad_iram.h index ffa6be8881..08d218a1d8 100644 --- a/apps/codecs/libmad/mad_iram.h +++ b/apps/codecs/libmad/mad_iram.h @@ -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 diff --git a/apps/plugins/plugin.lds b/apps/plugins/plugin.lds index 92365c6269..13a048acaf 100644 --- a/apps/plugins/plugin.lds +++ b/apps/plugins/plugin.lds @@ -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 diff --git a/firmware/target/arm/imx31/app.lds b/firmware/target/arm/imx31/app.lds index 9b35e8dd53..80123fee9d 100644 --- a/firmware/target/arm/imx31/app.lds +++ b/firmware/target/arm/imx31/app.lds @@ -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 = .; diff --git a/firmware/target/arm/imx31/crt0.S b/firmware/target/arm/imx31/crt0.S index 046578b5bf..55cd74180f 100644 --- a/firmware/target/arm/imx31/crt0.S +++ b/firmware/target/arm/imx31/crt0.S @@ -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 */ diff --git a/firmware/target/arm/s3c2440/app.lds b/firmware/target/arm/s3c2440/app.lds index 7321df8af2..a436d65770 100644 --- a/firmware/target/arm/s3c2440/app.lds +++ b/firmware/target/arm/s3c2440/app.lds @@ -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 - - _iramcopy = LOADADDR(.iram); - - .ibss : - { - _iedata = .; - *(.ibss) - . = ALIGN(0x4); - _iend = .; - } > DRAM + _initdata_end =.; - .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 = .; diff --git a/firmware/target/arm/s3c2440/boot.lds b/firmware/target/arm/s3c2440/boot.lds index 3cb88c9e7b..2f22b7603f 100644 --- a/firmware/target/arm/s3c2440/boot.lds +++ b/firmware/target/arm/s3c2440/boot.lds @@ -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 = .; diff --git a/firmware/target/arm/s3c2440/crt0.S b/firmware/target/arm/s3c2440/crt0.S index 7f1ebf8dec..efdb3f7248 100644 --- a/firmware/target/arm/s3c2440/crt0.S +++ b/firmware/target/arm/s3c2440/crt0.S @@ -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 -- cgit v1.2.3