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
This commit is contained in:
Rafaël Carré 2008-12-04 22:27:48 +00:00
parent 8ea82ff4a8
commit 6aa807d321
5 changed files with 146 additions and 31 deletions

View file

@ -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,6 +98,16 @@ SECTIONS
_vectorscopy = LOADADDR(.vectors);
.iram :
{
_iramstart = .;
*(.icode)
*(.irodata)
*(.idata)
. = ALIGN(0x4);
_iramend = .;
} > IRAM AT> DRAM
.ibss (NOLOAD) :
{
_iedata = .;
@ -88,16 +117,6 @@ SECTIONS
_iend = .;
} > IRAM
.iram _iend :
{
_iramstart = .;
*(.icode)
*(.irodata)
*(.idata)
. = ALIGN(0x4);
_iramend = .;
} > IRAM AT> DRAM
_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
}