summaryrefslogtreecommitdiffstats
path: root/firmware/target/coldfire
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2009-02-20 02:33:40 +0000
committerMichael Sevakis <jethead71@rockbox.org>2009-02-20 02:33:40 +0000
commitec67912b638e0fae3cae7b4182d23db6d36c5135 (patch)
tree8101f45d02947a828d20174a45d1a6d19fafa3b2 /firmware/target/coldfire
parent07ae1e4fb9a1fd9d6ce9c48c5300b53e87303937 (diff)
downloadrockbox-ec67912b638e0fae3cae7b4182d23db6d36c5135.tar.gz
rockbox-ec67912b638e0fae3cae7b4182d23db6d36c5135.tar.bz2
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/coldfire')
-rw-r--r--firmware/target/coldfire/crt0.S21
-rw-r--r--firmware/target/coldfire/iaudio/app.lds14
-rw-r--r--firmware/target/coldfire/iriver/app.lds14
3 files changed, 28 insertions, 21 deletions
diff --git a/firmware/target/coldfire/crt0.S b/firmware/target/coldfire/crt0.S
index dbf01a347c..bc8a370823 100644
--- a/firmware/target/coldfire/crt0.S
+++ b/firmware/target/coldfire/crt0.S
@@ -234,15 +234,8 @@ start:
movec.l %d0,%acr1
#ifndef BOOTLOADER
- /* zero out .ibss */
- lea _iedata,%a2
- lea _iend,%a4
- bra.b .iedatastart
-.iedataloop:
- clr.l (%a2)+
-.iedatastart:
- cmp.l %a2,%a4
- bhi.b .iedataloop
+ /* .iram copy is done first since it is reclaimed for other
+ * uninitialized sections */
/* copy the .iram section */
lea _iramcopy,%a2
@@ -254,6 +247,16 @@ start:
.iramstart:
cmp.l %a3,%a4
bhi.b .iramloop
+
+ /* zero out .ibss */
+ lea _iedata,%a2
+ lea _iend,%a4
+ bra.b .iedatastart
+.iedataloop:
+ clr.l (%a2)+
+.iedatastart:
+ cmp.l %a2,%a4
+ bhi.b .iedataloop
#endif /* !BOOTLOADER */
#ifdef IRIVER_H300_SERIES
diff --git a/firmware/target/coldfire/iaudio/app.lds b/firmware/target/coldfire/iaudio/app.lds
index d3ccce24f0..5cb2f6cb3f 100644
--- a/firmware/target/coldfire/iaudio/app.lds
+++ b/firmware/target/coldfire/iaudio/app.lds
@@ -94,6 +94,7 @@ SECTIONS
} > IRAM AT> DRAM
_iramcopy = LOADADDR(.iram);
+ _noloaddram = LOADADDR(.iram);
.ibss (NOLOAD) :
{
@@ -103,7 +104,7 @@ SECTIONS
_iend = .;
} > IRAM
- .stack :
+ .stack (NOLOAD) :
{
*(.stack)
stackbegin = .;
@@ -111,7 +112,7 @@ SECTIONS
stackend = .;
} > IRAM
- .bss ADDR(.data) + SIZEOF(.data) + SIZEOF(.iram):
+ .bss _noloaddram (NOLOAD):
{
_edata = .;
*(.bss*)
@@ -120,25 +121,26 @@ SECTIONS
_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/coldfire/iriver/app.lds b/firmware/target/coldfire/iriver/app.lds
index ae21ecd9de..d087f997c8 100644
--- a/firmware/target/coldfire/iriver/app.lds
+++ b/firmware/target/coldfire/iriver/app.lds
@@ -90,6 +90,7 @@ SECTIONS
} > IRAM AT> DRAM
_iramcopy = LOADADDR(.iram);
+ _noloaddram = LOADADDR(.iram);
.ibss (NOLOAD) :
{
@@ -99,7 +100,7 @@ SECTIONS
_iend = .;
} > IRAM
- .stack :
+ .stack (NOLOAD) :
{
*(.stack)
stackbegin = .;
@@ -107,7 +108,7 @@ SECTIONS
stackend = .;
} > IRAM
- .bss ADDR(.data) + SIZEOF(.data) + SIZEOF(.iram):
+ .bss _noloaddram (NOLOAD) :
{
_edata = .;
*(.bss*)
@@ -116,25 +117,26 @@ SECTIONS
_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 = .;