summaryrefslogtreecommitdiffstats
path: root/firmware/target/arm/as3525/app.lds
diff options
context:
space:
mode:
authorRafaël Carré <rafael.carre@gmail.com>2008-12-04 22:27:48 +0000
committerRafaël Carré <rafael.carre@gmail.com>2008-12-04 22:27:48 +0000
commit6aa807d32170eb463ede46397cb43c1c4088cbe9 (patch)
treebad103ff445aa938ca8e579ab72ccf513122749c /firmware/target/arm/as3525/app.lds
parent8ea82ff4a8b03141c7bc0491dda351dc0645ccd8 (diff)
downloadrockbox-6aa807d32170eb463ede46397cb43c1c4088cbe9.tar.gz
rockbox-6aa807d32170eb463ede46397cb43c1c4088cbe9.zip
Sansa AMS: PCM driver (FS#9592)
Note that on low memory targets (Clip/m200v4 tested) you will encounter random crashes. Applying FS#9332 seems to help a lot. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19342 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/arm/as3525/app.lds')
-rw-r--r--firmware/target/arm/as3525/app.lds53
1 files changed, 38 insertions, 15 deletions
diff --git a/firmware/target/arm/as3525/app.lds b/firmware/target/arm/as3525/app.lds
index bf8e68f048..21cdac528b 100644
--- a/firmware/target/arm/as3525/app.lds
+++ b/firmware/target/arm/as3525/app.lds
@@ -6,6 +6,11 @@ OUTPUT_FORMAT(elf32-littlearm)
OUTPUT_ARCH(arm)
STARTUP(target/arm/crt0.o)
+#if MEMORYSIZE <= 2
+/* we put the codec buffer in IRAM */
+#define LOWMEM
+#endif
+
#define PLUGINSIZE PLUGIN_BUFFER_SIZE
#define CODECSIZE CODEC_SIZE
@@ -16,8 +21,15 @@ STARTUP(target/arm/crt0.o)
#endif
#include "cpu.h"
+
#define IRAMSIZE 0x50000
+
+#ifdef LOWMEM
+#define DRAMSIZE (MEMORYSIZE * 0x100000) - STUBOFFSET - PLUGINSIZE
+#define CODECORIG (IRAMORIG + IRAMSIZE - CODEC_SIZE)
+#else
#define DRAMSIZE (MEMORYSIZE * 0x100000) - STUBOFFSET - PLUGINSIZE - CODECSIZE
+#endif
#define IRAMORIG 0x0
#define DRAMORIG 0x30000000 + STUBOFFSET
@@ -26,11 +38,20 @@ STARTUP(target/arm/crt0.o)
#define ENDAUDIOADDR (DRAMORIG + DRAMSIZE)
/* Where the codec buffer ends, and the plugin buffer starts */
+#ifdef LOWMEM
+#define ENDADDR (ENDAUDIOADDR)
+#else
#define ENDADDR (ENDAUDIOADDR + CODECSIZE)
+#endif
MEMORY
{
+#ifdef LOWMEM
+ IRAM : ORIGIN = IRAMORIG, LENGTH = (IRAMSIZE - CODEC_SIZE)
+ CODEC_IRAM : ORIGIN = CODECORIG, LENGTH = CODEC_SIZE
+#else
IRAM : ORIGIN = IRAMORIG, LENGTH = IRAMSIZE
+#endif
DRAM : ORIGIN = DRAMORIG, LENGTH = DRAMSIZE
}
@@ -69,8 +90,6 @@ SECTIONS
*(.eh_frame)
}
- _initdata_end =.;
-
.vectors IRAMORIG:
{
_vectors_start = .;
@@ -79,16 +98,7 @@ SECTIONS
_vectorscopy = LOADADDR(.vectors);
- .ibss (NOLOAD) :
- {
- _iedata = .;
- *(.qharray)
- *(.ibss)
- . = ALIGN(0x4);
- _iend = .;
- } > IRAM
-
- .iram _iend :
+ .iram :
{
_iramstart = .;
*(.icode)
@@ -98,6 +108,15 @@ SECTIONS
_iramend = .;
} > IRAM AT> DRAM
+ .ibss (NOLOAD) :
+ {
+ _iedata = .;
+ *(.qharray)
+ *(.ibss)
+ . = ALIGN(0x4);
+ _iend = .;
+ } > IRAM
+
_iramcopy = LOADADDR(.iram);
.stack (NOLOAD) :
@@ -130,15 +149,19 @@ SECTIONS
_audiobufend = .;
} > DRAM
- .codec ENDAUDIOADDR (NOLOAD) :
+ .codec CODECORIG (NOLOAD) :
{
codecbuf = .;
_codecbuf = .;
- }
+#ifdef LOWMEM
+ } > CODEC_IRAM
+#else
+ } > DRAM
+#endif
.plugin ENDADDR (NOLOAD) :
{
_pluginbuf = .;
pluginbuf = .;
- }
+ } > DRAM
}