diff options
author | Michael Sevakis <jethead71@rockbox.org> | 2009-02-20 02:33:40 +0000 |
---|---|---|
committer | Michael Sevakis <jethead71@rockbox.org> | 2009-02-20 02:33:40 +0000 |
commit | ec67912b638e0fae3cae7b4182d23db6d36c5135 (patch) | |
tree | 8101f45d02947a828d20174a45d1a6d19fafa3b2 /firmware/target/arm | |
parent | 07ae1e4fb9a1fd9d6ce9c48c5300b53e87303937 (diff) | |
download | rockbox-ec67912b638e0fae3cae7b4182d23db6d36c5135.tar.gz rockbox-ec67912b638e0fae3cae7b4182d23db6d36c5135.zip |
Reclaim .iram areas in DRAM by overlapping their load addresses with the uninitialized data sections. I did what I could test out-- not any flash image linker scripts or other target processors. Move any .iram copies in crt0.S's to be the first operation even if not _strictly_ necessary to be emphatic (aka. 'beware').
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20061 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/arm')
-rw-r--r-- | firmware/target/arm/crt0-pp.S | 25 | ||||
-rw-r--r-- | firmware/target/arm/ipod/app.lds | 4 | ||||
-rw-r--r-- | firmware/target/arm/iriver/app.lds | 4 | ||||
-rw-r--r-- | firmware/target/arm/olympus/app.lds | 4 | ||||
-rw-r--r-- | firmware/target/arm/philips/app.lds | 4 | ||||
-rw-r--r-- | firmware/target/arm/sandisk/app.lds | 6 |
6 files changed, 24 insertions, 23 deletions
diff --git a/firmware/target/arm/crt0-pp.S b/firmware/target/arm/crt0-pp.S index f698783017..210b560560 100644 --- a/firmware/target/arm/crt0-pp.S +++ b/firmware/target/arm/crt0-pp.S | |||
@@ -41,7 +41,6 @@ start: | |||
41 | .equ COP_CTRL, 0xcf004058 | 41 | .equ COP_CTRL, 0xcf004058 |
42 | .equ CPU_STATUS, 0xcf004050 | 42 | .equ CPU_STATUS, 0xcf004050 |
43 | .equ COP_STATUS, 0xcf004050 | 43 | .equ COP_STATUS, 0xcf004050 |
44 | .equ IIS_CONFIG, 0xc0002500 | ||
45 | .equ SLEEP, 0x000000ca | 44 | .equ SLEEP, 0x000000ca |
46 | .equ WAKE, 0x000000ce | 45 | .equ WAKE, 0x000000ce |
47 | .equ CPUSLEEPING, 0x00008000 | 46 | .equ CPUSLEEPING, 0x00008000 |
@@ -63,7 +62,6 @@ start: | |||
63 | .equ COP_ICLR, 0x60004038 | 62 | .equ COP_ICLR, 0x60004038 |
64 | .equ COP_CTRL, 0x60007004 | 63 | .equ COP_CTRL, 0x60007004 |
65 | .equ COP_STATUS, 0x60007004 | 64 | .equ COP_STATUS, 0x60007004 |
66 | .equ IIS_CONFIG, 0x70002800 | ||
67 | .equ SLEEP, 0x80000000 | 65 | .equ SLEEP, 0x80000000 |
68 | .equ WAKE, 0x00000000 | 66 | .equ WAKE, 0x00000000 |
69 | .equ CPUSLEEPING, 0x80000000 | 67 | .equ CPUSLEEPING, 0x80000000 |
@@ -186,6 +184,9 @@ cpu_init: | |||
186 | ldr r3, [r4] | 184 | ldr r3, [r4] |
187 | tst r3, #COPSLEEPING | 185 | tst r3, #COPSLEEPING |
188 | beq 1b | 186 | beq 1b |
187 | |||
188 | /* Vectors and IRAM copy is done first since they are reclaimed for | ||
189 | * other uninitialized sections */ | ||
189 | 190 | ||
190 | /* Copy exception handler code to address 0 */ | 191 | /* Copy exception handler code to address 0 */ |
191 | ldr r2, =_vectorsstart | 192 | ldr r2, =_vectorsstart |
@@ -196,16 +197,7 @@ cpu_init: | |||
196 | ldrhi r5, [r4], #4 | 197 | ldrhi r5, [r4], #4 |
197 | strhi r5, [r2], #4 | 198 | strhi r5, [r2], #4 |
198 | bhi 1b | 199 | bhi 1b |
199 | 200 | ||
200 | /* Zero out IBSS */ | ||
201 | ldr r2, =_iedata | ||
202 | ldr r3, =_iend | ||
203 | mov r4, #0 | ||
204 | 1: | ||
205 | cmp r3, r2 | ||
206 | strhi r4, [r2], #4 | ||
207 | bhi 1b | ||
208 | |||
209 | /* Copy the IRAM */ | 201 | /* Copy the IRAM */ |
210 | ldr r2, =_iramcopy | 202 | ldr r2, =_iramcopy |
211 | ldr r3, =_iramstart | 203 | ldr r3, =_iramstart |
@@ -216,6 +208,15 @@ cpu_init: | |||
216 | strhi r5, [r3], #4 | 208 | strhi r5, [r3], #4 |
217 | bhi 1b | 209 | bhi 1b |
218 | 210 | ||
211 | /* Zero out IBSS */ | ||
212 | ldr r2, =_iedata | ||
213 | ldr r3, =_iend | ||
214 | mov r4, #0 | ||
215 | 1: | ||
216 | cmp r3, r2 | ||
217 | strhi r4, [r2], #4 | ||
218 | bhi 1b | ||
219 | |||
219 | /* Initialise bss section to zero */ | 220 | /* Initialise bss section to zero */ |
220 | ldr r2, =_edata | 221 | ldr r2, =_edata |
221 | ldr r3, =_end | 222 | ldr r3, =_end |
diff --git a/firmware/target/arm/ipod/app.lds b/firmware/target/arm/ipod/app.lds index d7159e8e1e..22468192eb 100644 --- a/firmware/target/arm/ipod/app.lds +++ b/firmware/target/arm/ipod/app.lds | |||
@@ -103,6 +103,7 @@ SECTIONS | |||
103 | } AT> DRAM | 103 | } AT> DRAM |
104 | 104 | ||
105 | _vectorscopy = LOADADDR(.vectors); | 105 | _vectorscopy = LOADADDR(.vectors); |
106 | _noloaddram = LOADADDR(.vectors); | ||
106 | 107 | ||
107 | .ibss IRAMORIG (NOLOAD) : | 108 | .ibss IRAMORIG (NOLOAD) : |
108 | { | 109 | { |
@@ -148,8 +149,7 @@ SECTIONS | |||
148 | 149 | ||
149 | /* .bss and .ncbss are treated as a single section to use one init loop to | 150 | /* .bss and .ncbss are treated as a single section to use one init loop to |
150 | * zero it - note "_edata" and "_end" */ | 151 | * zero it - note "_edata" and "_end" */ |
151 | .bss ADDR(.data) + SIZEOF(.data) + SIZEOF(.ncdata) +\ | 152 | .bss _noloaddram (NOLOAD) : |
152 | SIZEOF(.iram) + SIZEOF(.vectors) (NOLOAD) : | ||
153 | { | 153 | { |
154 | _edata = .; | 154 | _edata = .; |
155 | *(.bss*) | 155 | *(.bss*) |
diff --git a/firmware/target/arm/iriver/app.lds b/firmware/target/arm/iriver/app.lds index d7159e8e1e..22468192eb 100644 --- a/firmware/target/arm/iriver/app.lds +++ b/firmware/target/arm/iriver/app.lds | |||
@@ -103,6 +103,7 @@ SECTIONS | |||
103 | } AT> DRAM | 103 | } AT> DRAM |
104 | 104 | ||
105 | _vectorscopy = LOADADDR(.vectors); | 105 | _vectorscopy = LOADADDR(.vectors); |
106 | _noloaddram = LOADADDR(.vectors); | ||
106 | 107 | ||
107 | .ibss IRAMORIG (NOLOAD) : | 108 | .ibss IRAMORIG (NOLOAD) : |
108 | { | 109 | { |
@@ -148,8 +149,7 @@ SECTIONS | |||
148 | 149 | ||
149 | /* .bss and .ncbss are treated as a single section to use one init loop to | 150 | /* .bss and .ncbss are treated as a single section to use one init loop to |
150 | * zero it - note "_edata" and "_end" */ | 151 | * zero it - note "_edata" and "_end" */ |
151 | .bss ADDR(.data) + SIZEOF(.data) + SIZEOF(.ncdata) +\ | 152 | .bss _noloaddram (NOLOAD) : |
152 | SIZEOF(.iram) + SIZEOF(.vectors) (NOLOAD) : | ||
153 | { | 153 | { |
154 | _edata = .; | 154 | _edata = .; |
155 | *(.bss*) | 155 | *(.bss*) |
diff --git a/firmware/target/arm/olympus/app.lds b/firmware/target/arm/olympus/app.lds index d7159e8e1e..22468192eb 100644 --- a/firmware/target/arm/olympus/app.lds +++ b/firmware/target/arm/olympus/app.lds | |||
@@ -103,6 +103,7 @@ SECTIONS | |||
103 | } AT> DRAM | 103 | } AT> DRAM |
104 | 104 | ||
105 | _vectorscopy = LOADADDR(.vectors); | 105 | _vectorscopy = LOADADDR(.vectors); |
106 | _noloaddram = LOADADDR(.vectors); | ||
106 | 107 | ||
107 | .ibss IRAMORIG (NOLOAD) : | 108 | .ibss IRAMORIG (NOLOAD) : |
108 | { | 109 | { |
@@ -148,8 +149,7 @@ SECTIONS | |||
148 | 149 | ||
149 | /* .bss and .ncbss are treated as a single section to use one init loop to | 150 | /* .bss and .ncbss are treated as a single section to use one init loop to |
150 | * zero it - note "_edata" and "_end" */ | 151 | * zero it - note "_edata" and "_end" */ |
151 | .bss ADDR(.data) + SIZEOF(.data) + SIZEOF(.ncdata) +\ | 152 | .bss _noloaddram (NOLOAD) : |
152 | SIZEOF(.iram) + SIZEOF(.vectors) (NOLOAD) : | ||
153 | { | 153 | { |
154 | _edata = .; | 154 | _edata = .; |
155 | *(.bss*) | 155 | *(.bss*) |
diff --git a/firmware/target/arm/philips/app.lds b/firmware/target/arm/philips/app.lds index d7159e8e1e..22468192eb 100644 --- a/firmware/target/arm/philips/app.lds +++ b/firmware/target/arm/philips/app.lds | |||
@@ -103,6 +103,7 @@ SECTIONS | |||
103 | } AT> DRAM | 103 | } AT> DRAM |
104 | 104 | ||
105 | _vectorscopy = LOADADDR(.vectors); | 105 | _vectorscopy = LOADADDR(.vectors); |
106 | _noloaddram = LOADADDR(.vectors); | ||
106 | 107 | ||
107 | .ibss IRAMORIG (NOLOAD) : | 108 | .ibss IRAMORIG (NOLOAD) : |
108 | { | 109 | { |
@@ -148,8 +149,7 @@ SECTIONS | |||
148 | 149 | ||
149 | /* .bss and .ncbss are treated as a single section to use one init loop to | 150 | /* .bss and .ncbss are treated as a single section to use one init loop to |
150 | * zero it - note "_edata" and "_end" */ | 151 | * zero it - note "_edata" and "_end" */ |
151 | .bss ADDR(.data) + SIZEOF(.data) + SIZEOF(.ncdata) +\ | 152 | .bss _noloaddram (NOLOAD) : |
152 | SIZEOF(.iram) + SIZEOF(.vectors) (NOLOAD) : | ||
153 | { | 153 | { |
154 | _edata = .; | 154 | _edata = .; |
155 | *(.bss*) | 155 | *(.bss*) |
diff --git a/firmware/target/arm/sandisk/app.lds b/firmware/target/arm/sandisk/app.lds index d7159e8e1e..3010644b72 100644 --- a/firmware/target/arm/sandisk/app.lds +++ b/firmware/target/arm/sandisk/app.lds | |||
@@ -103,6 +103,7 @@ SECTIONS | |||
103 | } AT> DRAM | 103 | } AT> DRAM |
104 | 104 | ||
105 | _vectorscopy = LOADADDR(.vectors); | 105 | _vectorscopy = LOADADDR(.vectors); |
106 | _noloaddram = LOADADDR(.vectors); | ||
106 | 107 | ||
107 | .ibss IRAMORIG (NOLOAD) : | 108 | .ibss IRAMORIG (NOLOAD) : |
108 | { | 109 | { |
@@ -145,11 +146,10 @@ SECTIONS | |||
145 | . += 0x2000; | 146 | . += 0x2000; |
146 | stackend = .; | 147 | stackend = .; |
147 | } > IRAM | 148 | } > IRAM |
148 | 149 | ||
149 | /* .bss and .ncbss are treated as a single section to use one init loop to | 150 | /* .bss and .ncbss are treated as a single section to use one init loop to |
150 | * zero it - note "_edata" and "_end" */ | 151 | * zero it - note "_edata" and "_end" */ |
151 | .bss ADDR(.data) + SIZEOF(.data) + SIZEOF(.ncdata) +\ | 152 | .bss _noloaddram (NOLOAD) : |
152 | SIZEOF(.iram) + SIZEOF(.vectors) (NOLOAD) : | ||
153 | { | 153 | { |
154 | _edata = .; | 154 | _edata = .; |
155 | *(.bss*) | 155 | *(.bss*) |