2008-11-09 06:17:21 +00:00
|
|
|
#include "config.h"
|
2009-05-20 21:09:53 +00:00
|
|
|
#include "cpu.h"
|
2008-11-09 06:17:21 +00:00
|
|
|
|
|
|
|
ENTRY(start)
|
|
|
|
|
|
|
|
OUTPUT_FORMAT(elf32-littlearm)
|
|
|
|
OUTPUT_ARCH(arm)
|
|
|
|
STARTUP(target/arm/crt0.o)
|
|
|
|
|
|
|
|
#define PLUGINSIZE PLUGIN_BUFFER_SIZE
|
|
|
|
#define CODECSIZE CODEC_SIZE
|
|
|
|
|
|
|
|
#ifdef DEBUG
|
|
|
|
#define STUBOFFSET 0x10000
|
|
|
|
#else
|
|
|
|
#define STUBOFFSET 0
|
|
|
|
#endif
|
|
|
|
|
2008-12-04 22:27:48 +00:00
|
|
|
|
2009-05-20 21:09:53 +00:00
|
|
|
#define IRAMORIG IRAM_ORIG
|
|
|
|
#define DRAMORIG (DRAM_ORIG + STUBOFFSET)
|
|
|
|
|
|
|
|
/* End of the audio buffer, where the codec buffer starts */
|
|
|
|
#define ENDAUDIOADDR (DRAMORIG + DRAMSIZE)
|
|
|
|
|
2010-04-05 19:18:15 +00:00
|
|
|
#define CODEC_BUFFER_FILLS_IRAM defined(AMS_LOWMEM) || (CONFIG_CPU == AS3525v2)
|
2009-05-20 21:09:53 +00:00
|
|
|
|
2010-04-05 19:18:15 +00:00
|
|
|
#if CODEC_BUFFER_FILLS_IRAM
|
|
|
|
/* Entire codec buffer in IRAM */
|
2009-05-20 21:09:53 +00:00
|
|
|
#define DRAMSIZE (DRAM_SIZE - STUBOFFSET - PLUGINSIZE - TTB_SIZE)
|
|
|
|
#define CODECORIG (IRAMORIG + (IRAM_SIZE - CODEC_SIZE))
|
|
|
|
#define IRAMSIZE (IRAM_SIZE - CODEC_SIZE)
|
2008-12-04 22:27:48 +00:00
|
|
|
#else
|
2009-05-20 21:09:53 +00:00
|
|
|
#define DRAMSIZE (DRAM_SIZE - STUBOFFSET - PLUGINSIZE - CODECSIZE - TTB_SIZE)
|
2008-12-04 23:03:05 +00:00
|
|
|
#define CODECORIG (ENDAUDIOADDR)
|
2009-04-10 17:00:23 +00:00
|
|
|
#define IRAMSIZE (0x20000)
|
2008-12-04 22:27:48 +00:00
|
|
|
#endif
|
2008-11-09 06:17:21 +00:00
|
|
|
|
|
|
|
|
|
|
|
/* Where the codec buffer ends, and the plugin buffer starts */
|
2010-04-05 19:18:15 +00:00
|
|
|
#if CODEC_BUFFER_FILLS_IRAM
|
2008-12-04 22:27:48 +00:00
|
|
|
#define ENDADDR (ENDAUDIOADDR)
|
|
|
|
#else
|
2008-11-09 06:17:21 +00:00
|
|
|
#define ENDADDR (ENDAUDIOADDR + CODECSIZE)
|
2008-12-04 22:27:48 +00:00
|
|
|
#endif
|
2008-11-09 06:17:21 +00:00
|
|
|
|
|
|
|
MEMORY
|
|
|
|
{
|
2010-04-05 19:18:15 +00:00
|
|
|
#if CODEC_BUFFER_FILLS_IRAM
|
2008-12-04 22:27:48 +00:00
|
|
|
CODEC_IRAM : ORIGIN = CODECORIG, LENGTH = CODEC_SIZE
|
|
|
|
#endif
|
2009-04-10 17:00:23 +00:00
|
|
|
IRAM : ORIGIN = IRAMORIG, LENGTH = IRAMSIZE
|
2008-11-09 06:17:21 +00:00
|
|
|
DRAM : ORIGIN = DRAMORIG, LENGTH = DRAMSIZE
|
|
|
|
}
|
|
|
|
|
|
|
|
SECTIONS
|
|
|
|
{
|
2009-05-20 21:09:53 +00:00
|
|
|
loadaddress = DRAM_ORIG;
|
2008-11-09 06:17:21 +00:00
|
|
|
|
2009-06-08 23:05:33 +00:00
|
|
|
.vectors :
|
|
|
|
{
|
|
|
|
_vectors_start = .;
|
|
|
|
*(.init.text)
|
|
|
|
} > DRAM
|
|
|
|
|
2008-11-09 06:17:21 +00:00
|
|
|
.text :
|
|
|
|
{
|
2008-12-01 03:54:27 +00:00
|
|
|
_loadaddress = .;
|
2008-11-09 06:17:21 +00:00
|
|
|
_textstart = .;
|
|
|
|
*(.text)
|
|
|
|
*(.text*)
|
|
|
|
*(.glue_7)
|
|
|
|
*(.glue_7t)
|
|
|
|
. = ALIGN(0x4);
|
|
|
|
} > DRAM
|
|
|
|
|
|
|
|
.rodata :
|
|
|
|
{
|
|
|
|
*(.rodata*)
|
|
|
|
. = ALIGN(0x4);
|
|
|
|
} > DRAM
|
|
|
|
|
|
|
|
.data :
|
|
|
|
{
|
|
|
|
*(.data*)
|
|
|
|
. = ALIGN(0x4);
|
|
|
|
} > DRAM
|
|
|
|
|
|
|
|
/DISCARD/ :
|
|
|
|
{
|
|
|
|
*(.eh_frame)
|
|
|
|
}
|
|
|
|
|
2008-12-04 22:27:48 +00:00
|
|
|
.iram :
|
2008-11-18 17:15:56 +00:00
|
|
|
{
|
|
|
|
_iramstart = .;
|
|
|
|
*(.icode)
|
|
|
|
*(.irodata)
|
|
|
|
*(.idata)
|
|
|
|
. = ALIGN(0x4);
|
|
|
|
_iramend = .;
|
|
|
|
} > IRAM AT> DRAM
|
|
|
|
|
2010-03-03 23:20:32 +00:00
|
|
|
_iramcopy = LOADADDR(.iram);
|
|
|
|
|
2008-12-04 22:27:48 +00:00
|
|
|
.ibss (NOLOAD) :
|
|
|
|
{
|
|
|
|
_iedata = .;
|
|
|
|
*(.qharray)
|
|
|
|
*(.ibss)
|
|
|
|
. = ALIGN(0x4);
|
|
|
|
_iend = .;
|
|
|
|
} > IRAM
|
|
|
|
|
2010-04-06 10:21:58 +00:00
|
|
|
.init CODECORIG :
|
2010-03-03 23:20:32 +00:00
|
|
|
{
|
|
|
|
. = ALIGN(4);
|
|
|
|
_initstart = .;
|
|
|
|
*(.init)
|
|
|
|
_initend = .;
|
|
|
|
} AT> DRAM
|
|
|
|
|
|
|
|
_initcopy = LOADADDR(.init);
|
2008-11-18 17:15:56 +00:00
|
|
|
|
2010-03-03 23:20:32 +00:00
|
|
|
.stack _iramcopy (NOLOAD) :
|
2008-12-01 03:54:27 +00:00
|
|
|
{
|
|
|
|
*(.stack)
|
|
|
|
stackbegin = .;
|
|
|
|
. += 0x2000;
|
|
|
|
stackend = .;
|
|
|
|
} > DRAM
|
|
|
|
|
|
|
|
.bss (NOLOAD) :
|
|
|
|
{
|
|
|
|
_edata = .;
|
|
|
|
*(.bss*)
|
|
|
|
*(COMMON)
|
|
|
|
. = ALIGN(0x4);
|
|
|
|
_end = .;
|
|
|
|
} > DRAM
|
|
|
|
|
2008-11-09 06:17:21 +00:00
|
|
|
.audiobuf (NOLOAD) :
|
|
|
|
{
|
|
|
|
. = ALIGN(4);
|
|
|
|
_audiobuffer = .;
|
|
|
|
audiobuffer = .;
|
|
|
|
} > DRAM
|
|
|
|
|
|
|
|
.audiobufend ENDAUDIOADDR (NOLOAD) :
|
|
|
|
{
|
|
|
|
audiobufend = .;
|
|
|
|
_audiobufend = .;
|
|
|
|
} > DRAM
|
|
|
|
|
2008-12-04 22:27:48 +00:00
|
|
|
.codec CODECORIG (NOLOAD) :
|
2008-11-09 06:17:21 +00:00
|
|
|
{
|
|
|
|
codecbuf = .;
|
|
|
|
_codecbuf = .;
|
2010-04-05 19:18:15 +00:00
|
|
|
#if CODEC_BUFFER_FILLS_IRAM
|
2008-12-04 22:27:48 +00:00
|
|
|
} > CODEC_IRAM
|
|
|
|
#else
|
|
|
|
} > DRAM
|
|
|
|
#endif
|
2008-11-09 06:17:21 +00:00
|
|
|
|
|
|
|
.plugin ENDADDR (NOLOAD) :
|
|
|
|
{
|
|
|
|
_pluginbuf = .;
|
|
|
|
pluginbuf = .;
|
2008-12-04 23:03:05 +00:00
|
|
|
}
|
2008-11-09 06:17:21 +00:00
|
|
|
}
|