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)
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef AMS_LOWMEM
|
|
|
|
#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 */
|
2009-05-20 21:09:53 +00:00
|
|
|
#ifdef AMS_LOWMEM
|
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
|
|
|
|
{
|
2009-05-20 21:09:53 +00:00
|
|
|
#ifdef AMS_LOWMEM
|
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
|
|
|
|
|
|
|
.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-11-18 17:15:56 +00:00
|
|
|
.vectors IRAMORIG:
|
|
|
|
{
|
|
|
|
_vectors_start = .;
|
|
|
|
*(.init.text)
|
|
|
|
} > IRAM AT > DRAM
|
|
|
|
|
|
|
|
_vectorscopy = LOADADDR(.vectors);
|
|
|
|
|
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
|
|
|
|
|
2008-12-04 22:27:48 +00:00
|
|
|
.ibss (NOLOAD) :
|
|
|
|
{
|
|
|
|
_iedata = .;
|
|
|
|
*(.qharray)
|
|
|
|
*(.ibss)
|
|
|
|
. = ALIGN(0x4);
|
|
|
|
_iend = .;
|
|
|
|
} > IRAM
|
|
|
|
|
2008-11-18 17:15:56 +00:00
|
|
|
_iramcopy = LOADADDR(.iram);
|
|
|
|
|
2008-12-01 03:54:27 +00:00
|
|
|
.stack (NOLOAD) :
|
|
|
|
{
|
|
|
|
*(.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 = .;
|
2009-05-20 21:09:53 +00:00
|
|
|
#ifdef AMS_LOWMEM
|
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
|
|
|
}
|