2009-02-09 10:02:38 +00:00
|
|
|
#include "config.h"
|
|
|
|
|
|
|
|
OUTPUT_FORMAT("elf32-littlemips")
|
|
|
|
OUTPUT_ARCH(MIPS)
|
|
|
|
ENTRY(_start)
|
|
|
|
STARTUP(target/mips/ingenic_jz47xx/crt0.o)
|
|
|
|
|
2018-06-28 10:24:26 +00:00
|
|
|
#define STUBOFFSET 0x4000
|
|
|
|
|
|
|
|
#define DRAMORIG (0x80000000 + STUBOFFSET)
|
|
|
|
#define DRAMSIZE (MEMORYSIZE * 0x100000 - STUBOFFSET)
|
2009-02-09 10:02:38 +00:00
|
|
|
#define IRAMORIG 0x80000000
|
2009-06-18 18:16:15 +00:00
|
|
|
#define IRAMSIZE 16K
|
2009-02-09 10:02:38 +00:00
|
|
|
|
|
|
|
/* End of the audio buffer, where the codec buffer starts */
|
2010-01-03 16:34:56 +00:00
|
|
|
#define ENDAUDIOADDR (DRAMORIG + DRAMSIZE - PLUGIN_BUFFER_SIZE - CODEC_SIZE)
|
2009-02-09 10:02:38 +00:00
|
|
|
|
|
|
|
/* Where the codec buffer ends, and the plugin buffer starts */
|
2010-01-03 16:34:56 +00:00
|
|
|
#define ENDCODECADDR (ENDAUDIOADDR + CODEC_SIZE)
|
2009-02-09 10:02:38 +00:00
|
|
|
|
|
|
|
MEMORY
|
|
|
|
{
|
|
|
|
DRAM : ORIGIN = DRAMORIG, LENGTH = DRAMSIZE
|
|
|
|
IRAM : ORIGIN = IRAMORIG, LENGTH = IRAMSIZE
|
|
|
|
}
|
|
|
|
|
|
|
|
SECTIONS
|
|
|
|
{
|
|
|
|
. = DRAMORIG;
|
|
|
|
|
|
|
|
.text :
|
|
|
|
{
|
|
|
|
loadaddress = .;
|
2009-03-12 07:43:20 +00:00
|
|
|
_loadaddress = .;
|
2009-02-09 10:02:38 +00:00
|
|
|
*(.init.text);
|
|
|
|
*(.text*);
|
|
|
|
} > DRAM
|
2009-06-18 18:16:15 +00:00
|
|
|
|
2009-02-09 10:02:38 +00:00
|
|
|
. = ALIGN(4);
|
|
|
|
|
|
|
|
.rodata :
|
|
|
|
{
|
|
|
|
*(.rodata*);
|
|
|
|
} > DRAM
|
2009-06-18 18:16:15 +00:00
|
|
|
|
2009-02-09 10:02:38 +00:00
|
|
|
. = ALIGN(4);
|
|
|
|
|
|
|
|
.data :
|
|
|
|
{
|
|
|
|
*(.data*);
|
|
|
|
*(.sdata*);
|
|
|
|
} > DRAM
|
2009-06-18 18:16:15 +00:00
|
|
|
|
2009-04-19 14:10:59 +00:00
|
|
|
/* Set the load address of .iram at the same address as .bss
|
|
|
|
* so RAM won't be wasted as .iram in the end will get copied
|
|
|
|
* to IRAM. */
|
|
|
|
.iram IRAMORIG: AT (_edata)
|
2009-02-09 10:02:38 +00:00
|
|
|
{
|
|
|
|
_iramstart = .;
|
2011-12-18 06:43:08 +00:00
|
|
|
KEEP(*(.vectors.1));
|
2009-02-09 10:02:38 +00:00
|
|
|
. = 0x100;
|
2011-12-18 06:43:08 +00:00
|
|
|
KEEP(*(.vectors.2));
|
2009-02-09 10:02:38 +00:00
|
|
|
. = 0x180;
|
2011-12-18 06:43:08 +00:00
|
|
|
KEEP(*(.vectors.3));
|
2009-02-09 10:02:38 +00:00
|
|
|
. = 0x200;
|
2011-12-18 06:43:08 +00:00
|
|
|
KEEP(*(.vectors.4));
|
|
|
|
KEEP(*(.vectors));
|
2009-06-18 18:16:15 +00:00
|
|
|
|
2009-02-09 10:02:38 +00:00
|
|
|
*(.icode);
|
|
|
|
*(.irodata);
|
|
|
|
*(.idata);
|
|
|
|
KEEP(*(.vectors))
|
|
|
|
*(.vectors);
|
|
|
|
_iramend = .;
|
2009-04-19 14:10:59 +00:00
|
|
|
} > IRAM
|
2009-02-09 10:02:38 +00:00
|
|
|
_iramcopy = LOADADDR(.iram);
|
2009-06-18 18:16:15 +00:00
|
|
|
|
2009-04-19 15:16:37 +00:00
|
|
|
. = ALIGN(4);
|
2009-06-18 18:16:15 +00:00
|
|
|
|
2009-04-19 15:16:37 +00:00
|
|
|
.stack (NOLOAD):
|
|
|
|
{
|
|
|
|
*(.stack);
|
|
|
|
stackbegin = .;
|
2020-07-15 15:02:28 +00:00
|
|
|
. += 0x1d00;
|
2009-04-19 15:16:37 +00:00
|
|
|
stackend = .;
|
2018-12-26 03:28:14 +00:00
|
|
|
irqstackbegin = .;
|
2020-07-15 15:02:28 +00:00
|
|
|
. += 0x400;
|
2018-12-26 03:28:14 +00:00
|
|
|
irqstackend = .;
|
2009-04-19 15:16:37 +00:00
|
|
|
} > IRAM
|
2009-02-09 10:02:38 +00:00
|
|
|
|
|
|
|
.bss (NOLOAD):
|
|
|
|
{
|
|
|
|
_edata = .;
|
|
|
|
*(.sbss*);
|
|
|
|
*(.bss*);
|
2009-06-18 18:16:15 +00:00
|
|
|
*(.ibss*); /* Don't put this in IRAM as there's not enough space */
|
2009-02-09 10:02:38 +00:00
|
|
|
*(COMMON);
|
|
|
|
*(.scommon*);
|
|
|
|
_end = .;
|
|
|
|
} > DRAM
|
2009-06-18 18:16:15 +00:00
|
|
|
|
2010-01-03 16:34:56 +00:00
|
|
|
.audiobuf :
|
2009-02-09 10:02:38 +00:00
|
|
|
{
|
2010-01-03 16:34:56 +00:00
|
|
|
. = ALIGN(4);
|
2009-02-09 10:02:38 +00:00
|
|
|
audiobuffer = .;
|
|
|
|
} > DRAM
|
|
|
|
|
2010-01-03 16:34:56 +00:00
|
|
|
audiobufend = ENDAUDIOADDR;
|
|
|
|
codecbuf = ENDAUDIOADDR;
|
|
|
|
pluginbuf = ENDCODECADDR;
|
2009-06-18 18:16:15 +00:00
|
|
|
|
2009-02-09 10:02:38 +00:00
|
|
|
/DISCARD/ :
|
|
|
|
{
|
|
|
|
*(.eh_frame);
|
2010-01-03 16:34:56 +00:00
|
|
|
*(.rel.dyn);
|
2009-02-09 10:02:38 +00:00
|
|
|
}
|
|
|
|
}
|