2008-11-09 06:17:21 +00:00
|
|
|
#include "config.h"
|
|
|
|
|
|
|
|
ENTRY(start)
|
|
|
|
|
|
|
|
OUTPUT_FORMAT(elf32-littlearm)
|
|
|
|
OUTPUT_ARCH(arm)
|
|
|
|
STARTUP(target/arm/crt0.o)
|
|
|
|
|
2008-12-04 22:27:48 +00:00
|
|
|
#if MEMORYSIZE <= 2
|
|
|
|
/* we put the codec buffer in IRAM */
|
|
|
|
#define LOWMEM
|
|
|
|
#endif
|
|
|
|
|
2008-11-09 06:17:21 +00:00
|
|
|
#define PLUGINSIZE PLUGIN_BUFFER_SIZE
|
|
|
|
#define CODECSIZE CODEC_SIZE
|
|
|
|
|
|
|
|
#ifdef DEBUG
|
|
|
|
#define STUBOFFSET 0x10000
|
|
|
|
#else
|
|
|
|
#define STUBOFFSET 0
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "cpu.h"
|
2008-12-04 22:27:48 +00:00
|
|
|
|
|
|
|
#ifdef LOWMEM
|
|
|
|
#define DRAMSIZE (MEMORYSIZE * 0x100000) - STUBOFFSET - PLUGINSIZE
|
2009-04-10 17:00:23 +00:00
|
|
|
#define CODECORIG (IRAMORIG + 0x50000 - CODEC_SIZE)
|
|
|
|
#define IRAMSIZE (0x50000 - CODEC_SIZE)
|
2008-12-04 22:27:48 +00:00
|
|
|
#else
|
2008-11-09 06:17:21 +00:00
|
|
|
#define DRAMSIZE (MEMORYSIZE * 0x100000) - STUBOFFSET - PLUGINSIZE - CODECSIZE
|
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
|
|
|
|
|
|
|
#define IRAMORIG 0x0
|
|
|
|
#define DRAMORIG 0x30000000 + STUBOFFSET
|
|
|
|
|
|
|
|
/* End of the audio buffer, where the codec buffer starts */
|
|
|
|
#define ENDAUDIOADDR (DRAMORIG + DRAMSIZE)
|
|
|
|
|
|
|
|
/* Where the codec buffer ends, and the plugin buffer starts */
|
2008-12-04 22:27:48 +00:00
|
|
|
#ifdef LOWMEM
|
|
|
|
#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
|
|
|
|
{
|
2008-12-04 22:27:48 +00:00
|
|
|
#ifdef LOWMEM
|
|
|
|
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
|
|
|
|
{
|
|
|
|
loadaddress = 0x30000000;
|
|
|
|
|
|
|
|
.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) /* problems without this, dunno why */
|
|
|
|
*(.rodata*)
|
|
|
|
*(.rodata.str1.1)
|
|
|
|
*(.rodata.str1.4)
|
|
|
|
. = 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 = .;
|
2008-12-04 22:27:48 +00:00
|
|
|
#ifdef LOWMEM
|
|
|
|
} > 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
|
|
|
}
|