summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2008-05-10 22:03:45 +0000
committerMichael Sevakis <jethead71@rockbox.org>2008-05-10 22:03:45 +0000
commit209aa8eda5b5c7cecde65885e6beaf37c92ba622 (patch)
tree6beddeac6d9714732931b211c2d4cd84ce5db920
parentab15fa7e00a4d98685dba186125d0805d1deb22c (diff)
downloadrockbox-209aa8eda5b5c7cecde65885e6beaf37c92ba622.tar.gz
rockbox-209aa8eda5b5c7cecde65885e6beaf37c92ba622.zip
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
-rw-r--r--apps/codecs/libmad/mad_iram.h7
-rw-r--r--apps/plugins/plugin.lds22
-rw-r--r--firmware/target/arm/imx31/app.lds24
-rw-r--r--firmware/target/arm/imx31/crt0.S19
-rw-r--r--firmware/target/arm/s3c2440/app.lds37
-rw-r--r--firmware/target/arm/s3c2440/boot.lds24
-rw-r--r--firmware/target/arm/s3c2440/crt0.S20
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 @@
30/* Code performs slower in IRAM on PP502x and there is no space in 30/* Code performs slower in IRAM on PP502x and there is no space in
31 mpegplayer on the PP5002. S3C2440 doesn't have any IRAM available for 31 mpegplayer on the PP5002. S3C2440 doesn't have any IRAM available for
32 codecs */ 32 codecs */
33#if defined(CPU_PP502x) || (CONFIG_CPU == PP5002 && defined(MPEGPLAYER)) || \ 33#if defined(CPU_PP502x) || (CONFIG_CPU == PP5002 && defined(MPEGPLAYER))
34 (CONFIG_CPU==S3C2440) || (CONFIG_CPU==IMX31L)
35#define ICODE_SECTION_MPA_ARM .text 34#define ICODE_SECTION_MPA_ARM .text
36#define ICODE_ATTR_MPA_SYNTH 35#define ICODE_ATTR_MPA_SYNTH
37#else 36#else
@@ -39,11 +38,7 @@
39#define ICODE_ATTR_MPA_SYNTH ICODE_ATTR 38#define ICODE_ATTR_MPA_SYNTH ICODE_ATTR
40#endif 39#endif
41 40
42#if CONFIG_CPU == S3C2440 || CONFIG_CPU == IMX31L
43#define IBSS_SECTION_MPA_ARM .bss
44#else
45#define IBSS_SECTION_MPA_ARM .ibss 41#define IBSS_SECTION_MPA_ARM .ibss
46#endif
47 42
48#ifndef ICONST_ATTR_MPA_HUFFMAN 43#ifndef ICONST_ATTR_MPA_HUFFMAN
49#define ICONST_ATTR_MPA_HUFFMAN ICONST_ATTR 44#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)
63#define IRAMSIZE 0x9000 63#define IRAMSIZE 0x9000
64#elif CONFIG_CPU == S3C2440 64#elif CONFIG_CPU == S3C2440
65#define DRAMORIG 0x0 + STUBOFFSET 65#define DRAMORIG 0x0 + STUBOFFSET
66#define IRAMORIG DRAMORIG
67#define IRAMSIZE 4K
68#define IRAM DRAM 66#define IRAM DRAM
67#define IRAMSIZE 0
69#elif CONFIG_CPU == IMX31L 68#elif CONFIG_CPU == IMX31L
70#define DRAMORIG 0x0 + STUBOFFSET 69#define DRAMORIG 0x0 + STUBOFFSET
71#define IRAMORIG DRAMORIG
72#define IRAMSIZE 0x4000
73#define IRAM DRAM 70#define IRAM DRAM
71#define IRAMSIZE 0
74#elif CONFIG_CPU==DM320 72#elif CONFIG_CPU==DM320
75#define DRAMORIG 0x00900000 + STUBOFFSET 73#define DRAMORIG 0x00900000 + STUBOFFSET
76#define IRAMORIG DRAMORIG 74#define IRAMORIG DRAMORIG
@@ -100,7 +98,7 @@ OUTPUT_FORMAT(elf32-sh)
100MEMORY 98MEMORY
101{ 99{
102 PLUGIN_RAM : ORIGIN = THIS_ORIGIN, LENGTH = THIS_LENGTH 100 PLUGIN_RAM : ORIGIN = THIS_ORIGIN, LENGTH = THIS_LENGTH
103#if defined(IRAMSIZE) 101#if defined(IRAMSIZE) && IRAMSIZE != 0
104 PLUGIN_IRAM : ORIGIN = IRAMORIG, LENGTH = IRAMSIZE 102 PLUGIN_IRAM : ORIGIN = IRAMORIG, LENGTH = IRAMSIZE
105#endif 103#endif
106} 104}
@@ -116,6 +114,9 @@ SECTIONS
116 .text : 114 .text :
117 { 115 {
118 *(.text*) 116 *(.text*)
117#if defined(IRAMSIZE) && IRAMSIZE == 0
118 *(.icode)
119#endif
119#ifdef CPU_ARM 120#ifdef CPU_ARM
120 *(.glue_7) 121 *(.glue_7)
121 *(.glue_7t) 122 *(.glue_7t)
@@ -125,12 +126,18 @@ SECTIONS
125 .rodata : 126 .rodata :
126 { 127 {
127 *(.rodata*) 128 *(.rodata*)
129#if defined(IRAMSIZE) && IRAMSIZE == 0
130 *(.irodata)
131#endif
128 . = ALIGN(0x4); 132 . = ALIGN(0x4);
129 } > PLUGIN_RAM 133 } > PLUGIN_RAM
130 134
131 .data : 135 .data :
132 { 136 {
133 *(.data*) 137 *(.data*)
138#if defined(IRAMSIZE) && IRAMSIZE == 0
139 *(.idata)
140#endif
134 } > PLUGIN_RAM 141 } > PLUGIN_RAM
135 142
136#if NOCACHE_BASE != 0 143#if NOCACHE_BASE != 0
@@ -151,7 +158,7 @@ SECTIONS
151 *(.eh_frame) 158 *(.eh_frame)
152 } 159 }
153 160
154#if defined(IRAMSIZE) 161#if defined(IRAMSIZE) && IRAMSIZE != 0
155 .iram IRAMORIG : AT ( iramcopy) 162 .iram IRAMORIG : AT ( iramcopy)
156 { 163 {
157 iramstart = .; 164 iramstart = .;
@@ -175,6 +182,9 @@ SECTIONS
175 { 182 {
176 plugin_bss_start = .; 183 plugin_bss_start = .;
177 *(.bss*) 184 *(.bss*)
185#if defined(IRAMSIZE) && IRAMSIZE == 0
186 *(.ibss)
187#endif
178 *(COMMON) 188 *(COMMON)
179 . = ALIGN(0x4); 189 . = ALIGN(0x4);
180 } > PLUGIN_RAM 190 } > 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
46 . = ALIGN(0x200); 46 . = ALIGN(0x200);
47 *(.init.text) 47 *(.init.text)
48 *(.text*) 48 *(.text*)
49 *(.icode)
49 *(.glue_7) 50 *(.glue_7)
50 *(.glue_7t) 51 *(.glue_7t)
51 . = ALIGN(0x4); 52 . = ALIGN(0x4);
@@ -57,6 +58,7 @@ SECTIONS
57 *(.rodata*) 58 *(.rodata*)
58 *(.rodata.str1.1) 59 *(.rodata.str1.1)
59 *(.rodata.str1.4) 60 *(.rodata.str1.4)
61 *(.irodata)
60 . = ALIGN(0x4); 62 . = ALIGN(0x4);
61 63
62 /* Pseudo-allocate the copies of the data sections */ 64 /* Pseudo-allocate the copies of the data sections */
@@ -70,6 +72,7 @@ SECTIONS
70 { 72 {
71 _datastart = .; 73 _datastart = .;
72 *(.data*) 74 *(.data*)
75 *(.idata)
73 . = ALIGN(0x4); 76 . = ALIGN(0x4);
74 _dataend = .; 77 _dataend = .;
75 } > DRAM 78 } > DRAM
@@ -88,26 +91,6 @@ SECTIONS
88 91
89 _vectorscopy = LOADADDR(.vectors); 92 _vectorscopy = LOADADDR(.vectors);
90 93
91 .iram :
92 {
93 _iramstart = .;
94 *(.icode)
95 *(.irodata)
96 *(.idata)
97 . = ALIGN(0x4);
98 _iramend = .;
99 } > DRAM
100
101 _iramcopy = LOADADDR(.iram);
102
103 .ibss (NOLOAD) :
104 {
105 _iedata = .;
106 *(.ibss)
107 . = ALIGN(0x4);
108 _iend = .;
109 } > DRAM
110
111 .stack : 94 .stack :
112 { 95 {
113 *(.stack) 96 *(.stack)
@@ -120,6 +103,7 @@ SECTIONS
120 { 103 {
121 _edata = .; 104 _edata = .;
122 *(.bss*) 105 *(.bss*)
106 *(.ibss)
123 *(COMMON) 107 *(COMMON)
124 . = ALIGN(0x4); 108 . = ALIGN(0x4);
125 _end = .; 109 _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:
229 ldrhi r5, [r4], #4 229 ldrhi r5, [r4], #4
230 strhi r5, [r2], #4 230 strhi r5, [r2], #4
231 bhi 1b 231 bhi 1b
232#else
233 /* Zero out IBSS */
234 ldr r2, =_iedata
235 ldr r3, =_iend
236 mov r4, #0
2371:
238 cmp r3, r2
239 strhi r4, [r2], #4
240 bhi 1b
241
242 /* Copy the IRAM */
243 ldr r2, =_iramcopy
244 ldr r3, =_iramstart
245 ldr r4, =_iramend
2461:
247 cmp r4, r3
248 ldrhi r5, [r2], #4
249 strhi r5, [r3], #4
250 bhi 1b
251#endif /* BOOTLOADER */ 232#endif /* BOOTLOADER */
252 233
253 /* Initialise bss section to zero */ 234 /* 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
51 _textstart = .; 51 _textstart = .;
52 *(.text) 52 *(.text)
53 *(.text*) 53 *(.text*)
54 *(.icode)
54 *(.glue_7) 55 *(.glue_7)
55 *(.glue_7t) 56 *(.glue_7t)
56 . = ALIGN(0x4); 57 . = ALIGN(0x4);
@@ -64,12 +65,14 @@ SECTIONS
64 *(.rodata*) 65 *(.rodata*)
65 *(.rodata.str1.1) 66 *(.rodata.str1.1)
66 *(.rodata.str1.4) 67 *(.rodata.str1.4)
68 *(.irodata*)
67 . = ALIGN(0x4); 69 . = ALIGN(0x4);
68 } > DRAM 70 } > DRAM
69 71
70 .data : 72 .data :
71 { 73 {
72 *(.data*) 74 *(.data*)
75 *(.idata*)
73 . = ALIGN(0x4); 76 . = ALIGN(0x4);
74 } > DRAM 77 } > DRAM
75 78
@@ -78,27 +81,9 @@ SECTIONS
78 *(.eh_frame) 81 *(.eh_frame)
79 } 82 }
80 83
81 .iram : 84 _initdata_end =.;
82 {
83 _iramstart = .;
84 *(.icode)
85 *(.irodata)
86 *(.idata)
87 . = ALIGN(0x4);
88 _iramend = .;
89 } > DRAM
90
91 _iramcopy = LOADADDR(.iram);
92
93 .ibss :
94 {
95 _iedata = .;
96 *(.ibss)
97 . = ALIGN(0x4);
98 _iend = .;
99 } > DRAM
100 85
101 .stack : 86 .stack (NOLOAD) :
102 { 87 {
103 *(.stack) 88 *(.stack)
104 stackbegin = .; 89 stackbegin = .;
@@ -106,34 +91,36 @@ SECTIONS
106 stackend = .; 91 stackend = .;
107 } > DRAM 92 } > DRAM
108 93
109 .bss : 94 .bss (NOLOAD) :
110 { 95 {
111 _edata = .; 96 _edata = .;
112 *(.bss*) 97 *(.bss*)
98 *(.ibss*)
113 *(COMMON) 99 *(COMMON)
114 . = ALIGN(0x4); 100 . = ALIGN(0x4);
115 _end = .; 101 _end = .;
116 } > DRAM 102 } > DRAM
117 103
118 .audiobuf ALIGN(4) : 104 .audiobuf (NOLOAD) :
119 { 105 {
106 . = ALIGN(4);
120 _audiobuffer = .; 107 _audiobuffer = .;
121 audiobuffer = .; 108 audiobuffer = .;
122 } > DRAM 109 } > DRAM
123 110
124 .audiobufend ENDAUDIOADDR: 111 .audiobufend ENDAUDIOADDR (NOLOAD) :
125 { 112 {
126 audiobufend = .; 113 audiobufend = .;
127 _audiobufend = .; 114 _audiobufend = .;
128 } > DRAM 115 } > DRAM
129 116
130 .codec ENDAUDIOADDR: 117 .codec ENDAUDIOADDR (NOLOAD) :
131 { 118 {
132 codecbuf = .; 119 codecbuf = .;
133 _codecbuf = .; 120 _codecbuf = .;
134 } 121 }
135 122
136 .plugin ENDADDR: 123 .plugin ENDADDR (NOLOAD) :
137 { 124 {
138 _pluginbuf = .; 125 _pluginbuf = .;
139 pluginbuf = .; 126 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
33 _textstart = .; 33 _textstart = .;
34 *(.text) 34 *(.text)
35 *(.text*) 35 *(.text*)
36 *(.icode)
36 *(.glue_7) 37 *(.glue_7)
37 *(.glue_7t) 38 *(.glue_7t)
38 . = ALIGN(0x4); 39 . = ALIGN(0x4);
@@ -46,12 +47,14 @@ SECTIONS
46 *(.rodata*) 47 *(.rodata*)
47 *(.rodata.str1.1) 48 *(.rodata.str1.1)
48 *(.rodata.str1.4) 49 *(.rodata.str1.4)
50 *(.irodata)
49 . = ALIGN(0x4); 51 . = ALIGN(0x4);
50 } > DRAM 52 } > DRAM
51 53
52 .data : 54 .data :
53 { 55 {
54 *(.data*) 56 *(.data*)
57 *(.idata)
55 . = ALIGN(0x4); 58 . = ALIGN(0x4);
56 } > DRAM 59 } > DRAM
57 60
@@ -60,26 +63,6 @@ SECTIONS
60 *(.eh_frame) 63 *(.eh_frame)
61 } 64 }
62 65
63 .iram :
64 {
65 _iramstart = .;
66 *(.icode)
67 *(.irodata)
68 *(.idata)
69 . = ALIGN(0x4);
70 _iramend = .;
71 } > DRAM
72
73 _iramcopy = LOADADDR(.iram);
74
75 .ibss :
76 {
77 _iedata = .;
78 *(.ibss)
79 . = ALIGN(0x4);
80 _iend = .;
81 } > DRAM
82
83 .stack : 66 .stack :
84 { 67 {
85 *(.stack) 68 *(.stack)
@@ -92,6 +75,7 @@ SECTIONS
92 { 75 {
93 _edata = .; 76 _edata = .;
94 *(.bss*) 77 *(.bss*)
78 *(.ibss)
95 *(COMMON) 79 *(COMMON)
96 . = ALIGN(0x4); 80 . = ALIGN(0x4);
97 _end = .; 81 _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:
97 97
98 /* Calculate the length of the code needed to run/copy */ 98 /* Calculate the length of the code needed to run/copy */
99 ldr r1, = _vectorstart 99 ldr r1, = _vectorstart
100 ldr r2, = _iramend 100 ldr r2, = _initdata_end
101 sub r2, r2, r1 101 sub r2, r2, r1
102 102
103 add r3, r2, #0x30000000 103 add r3, r2, #0x30000000
@@ -364,7 +364,7 @@ start:
364 364
365 /* Copy code to 0x30000000 */ 365 /* Copy code to 0x30000000 */
366 ldr r2, = _vectorstart 366 ldr r2, = _vectorstart
367 ldr r3, = _iramend 367 ldr r3, = _initdata_end
368 368
369 sub r2, r3, r2 /* length of loader */ 369 sub r2, r3, r2 /* length of loader */
370 370
@@ -408,22 +408,6 @@ donecopy:
408 408
409 bl enable_mmu 409 bl enable_mmu
410 410
411 /* Zero out IBSS */
412 ldr r2, =_iedata
413 ldr r3, =_iend
414 mov r4, #0
415ibsszero:
416 cmp r3, r2
417 strhi r4, [r2], #4
418 bhi ibsszero
419
420 /* Copy the IRAM */
421 ldr r0, =_iramcopy
422 ldr r1, =_iramstart
423 ldr r2, =_iramend
424 sub r2, r2, r1
425 bl word_copy
426
427 /* Initialise bss section to zero */ 411 /* Initialise bss section to zero */
428 ldr r2, =_edata 412 ldr r2, =_edata
429 ldr r3, =_end 413 ldr r3, =_end