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
|
|
|
|
|
2009-05-20 21:09:53 +00:00
|
|
|
/* End of the audio buffer, where the codec buffer starts */
|
2010-09-20 17:09:55 +00:00
|
|
|
#define ENDAUDIOADDR (DRAM_ORIG + DRAMSIZE)
|
2009-05-20 21:09:53 +00:00
|
|
|
|
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 */
|
2010-09-20 17:09:55 +00:00
|
|
|
#define DRAMSIZE (DRAM_SIZE - PLUGINSIZE - TTB_SIZE)
|
|
|
|
#define CODECORIG (IRAM_ORIG + (IRAM_SIZE - CODEC_SIZE))
|
2009-05-20 21:09:53 +00:00
|
|
|
#define IRAMSIZE (IRAM_SIZE - CODEC_SIZE)
|
2008-12-04 22:27:48 +00:00
|
|
|
#else
|
2010-09-20 17:09:55 +00:00
|
|
|
#define DRAMSIZE (DRAM_SIZE - 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
|
2010-09-20 17:09:55 +00:00
|
|
|
IRAM : ORIGIN = IRAM_ORIG, LENGTH = IRAMSIZE
|
|
|
|
DRAM : ORIGIN = DRAM_ORIG, LENGTH = DRAMSIZE
|
2008-11-09 06:17:21 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
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*)
|
|
|
|
*(.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 = .;
|
2011-12-17 02:00:59 +00:00
|
|
|
*(.icode*)
|
|
|
|
*(.irodata*)
|
|
|
|
*(.idata*)
|
2008-11-18 17:15:56 +00:00
|
|
|
. = 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)
|
2011-12-17 02:00:59 +00:00
|
|
|
*(.ibss*)
|
2008-12-04 22:27:48 +00:00
|
|
|
. = 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 = .;
|
2012-05-01 05:26:22 +00:00
|
|
|
*(.init*)
|
2010-03-03 23:20:32 +00:00
|
|
|
_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
|
|
|
}
|