2008-03-13 03:48:23 +00:00
|
|
|
#include "config.h"
|
|
|
|
|
|
|
|
ENTRY(start)
|
|
|
|
|
|
|
|
OUTPUT_FORMAT(elf32-littlearm)
|
|
|
|
OUTPUT_ARCH(arm)
|
2008-04-29 06:19:32 +00:00
|
|
|
STARTUP(target/arm/tcc780x/crt0.o)
|
2008-03-13 03:48:23 +00:00
|
|
|
|
|
|
|
#define PLUGINSIZE PLUGIN_BUFFER_SIZE
|
|
|
|
#define CODECSIZE CODEC_SIZE
|
|
|
|
|
2009-09-01 21:35:37 +00:00
|
|
|
#include "cpu.h"
|
2010-09-20 17:09:55 +00:00
|
|
|
#define DRAMSIZE (MEMORYSIZE * 0x100000) - PLUGINSIZE - CODECSIZE - TTB_SIZE
|
2008-03-13 03:48:23 +00:00
|
|
|
|
2010-09-20 17:09:55 +00:00
|
|
|
#define DRAMORIG 0x20000000
|
2008-03-13 03:48:23 +00:00
|
|
|
#define ITCMORIG 0x00000000
|
|
|
|
#define ITCMSIZE 0x1000
|
|
|
|
#define DTCMORIG 0xA0000000
|
|
|
|
#define DTCMSIZE 0x2000
|
|
|
|
#define SRAMORIG 0x10000000
|
|
|
|
#define SRAMSIZE 0xc000
|
|
|
|
|
|
|
|
/* End of the audio buffer, where the codec buffer starts */
|
|
|
|
#define ENDAUDIOADDR (DRAMORIG + DRAMSIZE)
|
|
|
|
|
|
|
|
/* Where the codec buffer ends, and the plugin buffer starts */
|
|
|
|
#define ENDADDR (ENDAUDIOADDR + CODECSIZE)
|
|
|
|
|
|
|
|
MEMORY
|
|
|
|
{
|
|
|
|
DRAM : ORIGIN = DRAMORIG, LENGTH = DRAMSIZE
|
|
|
|
/* Seperate data & instruction TCMs plus SRAM. */
|
|
|
|
ITCM : ORIGIN = ITCMORIG, LENGTH = ITCMSIZE
|
|
|
|
DTCM : ORIGIN = DTCMORIG, LENGTH = DTCMSIZE
|
|
|
|
SRAM : ORIGIN = SRAMORIG, LENGTH = SRAMSIZE
|
|
|
|
}
|
|
|
|
|
|
|
|
SECTIONS
|
|
|
|
{
|
|
|
|
.text :
|
|
|
|
{
|
|
|
|
loadaddress = .;
|
|
|
|
_loadaddress = .;
|
|
|
|
. = ALIGN(0x200);
|
|
|
|
*(.init.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);
|
|
|
|
|
|
|
|
/* Pseudo-allocate the copies of the data sections */
|
|
|
|
_datacopy = .;
|
|
|
|
} > DRAM
|
|
|
|
|
|
|
|
/* TRICK ALERT! For RAM execution, we put the .data section at the
|
|
|
|
same load address as the copy. Thus, we don't waste extra RAM
|
|
|
|
when we don't actually need the copy. */
|
|
|
|
.data : AT ( _datacopy )
|
|
|
|
{
|
|
|
|
_datastart = .;
|
|
|
|
*(.data*)
|
|
|
|
. = ALIGN(0x4);
|
|
|
|
_dataend = .;
|
|
|
|
} > DRAM
|
|
|
|
|
|
|
|
/DISCARD/ :
|
|
|
|
{
|
|
|
|
*(.eh_frame)
|
|
|
|
}
|
|
|
|
|
|
|
|
.vectors ITCMORIG :
|
|
|
|
{
|
|
|
|
_vectorsstart = .;
|
|
|
|
*(.vectors);
|
|
|
|
_vectorsend = .;
|
|
|
|
} > ITCM AT> DRAM
|
|
|
|
|
|
|
|
_vectorscopy = LOADADDR(.vectors);
|
|
|
|
|
|
|
|
.itcm :
|
|
|
|
{
|
|
|
|
_itcmstart = .;
|
|
|
|
_itcmend = .;
|
|
|
|
} > ITCM AT> DRAM
|
|
|
|
|
|
|
|
_itcmcopy = LOADADDR(.itcm);
|
|
|
|
|
|
|
|
.dtcm :
|
|
|
|
{
|
|
|
|
_dtcmstart = .;
|
|
|
|
_dtcmend = .;
|
|
|
|
} > DTCM AT> DRAM
|
|
|
|
|
|
|
|
_dtcmcopy = LOADADDR(.dtcm);
|
|
|
|
|
|
|
|
.iram :
|
|
|
|
{
|
|
|
|
_iramstart = .;
|
|
|
|
*(.irodata)
|
|
|
|
*(.idata)
|
|
|
|
*(.icode)
|
|
|
|
. = ALIGN(0x4);
|
|
|
|
_iramend = .;
|
2010-05-31 21:00:25 +00:00
|
|
|
} > SRAM AT> DRAM
|
2008-03-13 03:48:23 +00:00
|
|
|
|
|
|
|
_iramcopy = LOADADDR(.iram);
|
|
|
|
|
|
|
|
.ibss (NOLOAD) :
|
|
|
|
{
|
|
|
|
_iedata = .;
|
|
|
|
*(.ibss)
|
|
|
|
. = ALIGN(0x4);
|
|
|
|
_iend = .;
|
2010-05-31 21:00:25 +00:00
|
|
|
} > SRAM
|
2008-03-13 03:48:23 +00:00
|
|
|
|
|
|
|
.stack :
|
|
|
|
{
|
|
|
|
*(.stack)
|
|
|
|
stackbegin = .;
|
|
|
|
. += 0x2000;
|
|
|
|
stackend = .;
|
2010-05-31 21:00:25 +00:00
|
|
|
} > SRAM
|
2008-03-13 03:48:23 +00:00
|
|
|
|
|
|
|
.bss :
|
|
|
|
{
|
|
|
|
_edata = .;
|
|
|
|
*(.bss*)
|
|
|
|
*(COMMON)
|
|
|
|
. = ALIGN(0x4);
|
|
|
|
_end = .;
|
|
|
|
} > DRAM
|
|
|
|
|
|
|
|
.audiobuf ALIGN(4) :
|
|
|
|
{
|
|
|
|
_audiobuffer = .;
|
|
|
|
audiobuffer = .;
|
|
|
|
} > DRAM
|
|
|
|
|
|
|
|
.audiobufend ENDAUDIOADDR:
|
|
|
|
{
|
|
|
|
audiobufend = .;
|
|
|
|
_audiobufend = .;
|
|
|
|
} > DRAM
|
|
|
|
|
|
|
|
.codec ENDAUDIOADDR:
|
|
|
|
{
|
|
|
|
codecbuf = .;
|
|
|
|
_codecbuf = .;
|
|
|
|
}
|
|
|
|
|
|
|
|
.plugin ENDADDR:
|
|
|
|
{
|
|
|
|
_pluginbuf = .;
|
|
|
|
pluginbuf = .;
|
|
|
|
}
|
|
|
|
}
|