From 6aa807d32170eb463ede46397cb43c1c4088cbe9 Mon Sep 17 00:00:00 2001 From: Rafaël Carré Date: Thu, 4 Dec 2008 22:27:48 +0000 Subject: 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 --- firmware/target/arm/as3525/app.lds | 53 +++++++++++++++++++++++++++----------- 1 file changed, 38 insertions(+), 15 deletions(-) (limited to 'firmware/target/arm/as3525/app.lds') 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 } -- cgit v1.2.3