2003-12-12 13:29:34 +00:00
|
|
|
#include "config.h"
|
|
|
|
|
2002-05-02 14:05:51 +00:00
|
|
|
ENTRY(start)
|
2002-03-28 15:09:10 +00:00
|
|
|
OUTPUT_FORMAT(elf32-sh)
|
2002-05-29 09:12:34 +00:00
|
|
|
INPUT(crt0.o)
|
2002-08-01 08:12:17 +00:00
|
|
|
|
2003-06-29 16:33:04 +00:00
|
|
|
#define PLUGINSIZE 0x8000
|
|
|
|
|
2003-02-26 16:05:30 +00:00
|
|
|
#ifdef DEBUG
|
2003-06-29 16:33:04 +00:00
|
|
|
#define DRAMSIZE 0x1f0000 - PLUGINSIZE
|
2003-02-26 16:05:30 +00:00
|
|
|
#define ORIGADDR 0x09010000
|
2003-06-29 16:33:04 +00:00
|
|
|
|
2003-02-26 16:05:30 +00:00
|
|
|
#else
|
2003-06-29 16:33:04 +00:00
|
|
|
#define DRAMSIZE (MEMORYSIZE * 0x100000) - PLUGINSIZE
|
2003-02-26 16:05:30 +00:00
|
|
|
#define ORIGADDR 0x09000000
|
|
|
|
#endif
|
2003-06-29 16:33:04 +00:00
|
|
|
#define ENDADDR (ORIGADDR + DRAMSIZE)
|
2003-02-26 09:18:13 +00:00
|
|
|
|
2002-08-01 08:12:17 +00:00
|
|
|
MEMORY
|
|
|
|
{
|
2003-12-12 13:29:34 +00:00
|
|
|
#ifdef NEO_MEMORY
|
|
|
|
ROM : ORIGIN = 0x00020000, LENGTH = 0x1E0000
|
|
|
|
SRAM : ORIGIN = 0x0C000000, LENGTH = 0x40000
|
|
|
|
#else
|
2003-02-26 16:05:30 +00:00
|
|
|
DRAM : ORIGIN = ORIGADDR, LENGTH = DRAMSIZE
|
2003-12-12 13:29:34 +00:00
|
|
|
#endif
|
2002-08-01 08:12:17 +00:00
|
|
|
IRAM : ORIGIN = 0x0f000000, LENGTH = 0x1000
|
|
|
|
}
|
|
|
|
|
2002-03-28 15:09:10 +00:00
|
|
|
SECTIONS
|
|
|
|
{
|
2003-12-12 13:29:34 +00:00
|
|
|
#ifdef NEO_MEMORY
|
|
|
|
.bss :
|
|
|
|
{
|
|
|
|
_edata = .;
|
|
|
|
*(.bss)
|
|
|
|
*(COMMON)
|
|
|
|
_end = .;
|
|
|
|
} > SRAM
|
|
|
|
|
|
|
|
.text :
|
|
|
|
{
|
|
|
|
. = ALIGN(0x4);
|
|
|
|
*(.vectors);
|
|
|
|
. = ALIGN(0x200);
|
|
|
|
*(.init.text)
|
|
|
|
*(.text)
|
|
|
|
} > ROM
|
|
|
|
|
|
|
|
.rodata :
|
|
|
|
{
|
|
|
|
*(.rodata)
|
|
|
|
*(.rodata.str1.4)
|
|
|
|
. = ALIGN(0x4);
|
|
|
|
} > ROM
|
|
|
|
|
|
|
|
.data : AT ( LOADADDR(.romdata) )
|
|
|
|
{
|
|
|
|
_datastart = .;
|
|
|
|
*(.data)
|
|
|
|
_dataend = .;
|
|
|
|
} > SRAM
|
|
|
|
|
|
|
|
.iram : AT ( _iramcopy )
|
|
|
|
{
|
|
|
|
_iramstart = .;
|
|
|
|
*(.icode)
|
|
|
|
*(.idata)
|
|
|
|
_iramend = .;
|
|
|
|
} > IRAM
|
|
|
|
|
|
|
|
.romdata :
|
|
|
|
{
|
|
|
|
_datacopy = .;
|
|
|
|
. += SIZEOF(.data);
|
|
|
|
_iramcopy = .;
|
|
|
|
. += SIZEOF(.iram);
|
|
|
|
} > ROM
|
|
|
|
|
|
|
|
.stack :
|
|
|
|
{
|
|
|
|
_stackbegin = .;
|
|
|
|
*(.stack)
|
|
|
|
. += 0x1000;
|
|
|
|
_stackend = .;
|
|
|
|
} > SRAM
|
|
|
|
|
|
|
|
.mp3buf :
|
|
|
|
{
|
|
|
|
_mp3buffer = .;
|
|
|
|
} > SRAM
|
|
|
|
|
|
|
|
.mp3end 0x0C040000 - 0x300:
|
|
|
|
{
|
|
|
|
_mp3end = .;
|
|
|
|
} > SRAM
|
|
|
|
|
|
|
|
.plugin 0x0C040000:
|
|
|
|
{
|
|
|
|
_pluginbuf = .;
|
|
|
|
} > SRAM
|
|
|
|
#else
|
2002-08-01 08:12:17 +00:00
|
|
|
.vectors :
|
2002-03-28 15:09:10 +00:00
|
|
|
{
|
2002-05-29 09:12:34 +00:00
|
|
|
*(.resetvectors);
|
2002-03-28 15:09:10 +00:00
|
|
|
*(.vectors);
|
2002-08-01 08:12:17 +00:00
|
|
|
} > DRAM
|
2002-05-02 14:05:51 +00:00
|
|
|
|
|
|
|
.text :
|
|
|
|
{
|
2004-07-24 17:56:38 +00:00
|
|
|
. = ALIGN(0x200);
|
|
|
|
*(.init.text)
|
2002-03-28 15:09:10 +00:00
|
|
|
*(.text)
|
2003-04-24 20:25:10 +00:00
|
|
|
. = ALIGN(0x4);
|
2002-08-01 08:12:17 +00:00
|
|
|
} > DRAM
|
2002-03-28 15:09:10 +00:00
|
|
|
|
2004-07-24 17:56:38 +00:00
|
|
|
.rodata :
|
2002-05-02 14:05:51 +00:00
|
|
|
{
|
2004-07-24 17:56:38 +00:00
|
|
|
*(.rodata)
|
|
|
|
*(.rodata.str1.4)
|
2004-01-28 20:43:31 +00:00
|
|
|
. = ALIGN(0x4);
|
2004-07-24 17:56:38 +00:00
|
|
|
|
|
|
|
/* Pseudo-allocate the copies of the data sections */
|
|
|
|
_datacopy = .;
|
2002-08-01 08:12:17 +00:00
|
|
|
} > DRAM
|
2002-05-02 14:05:51 +00:00
|
|
|
|
2004-07-24 17:56:38 +00:00
|
|
|
/* 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 )
|
2002-05-02 14:05:51 +00:00
|
|
|
{
|
2004-07-24 17:56:38 +00:00
|
|
|
_datastart = .;
|
|
|
|
*(.data)
|
2003-04-24 20:25:10 +00:00
|
|
|
. = ALIGN(0x4);
|
2004-07-24 17:56:38 +00:00
|
|
|
_dataend = .;
|
|
|
|
_iramcopy = .;
|
2002-08-01 08:12:17 +00:00
|
|
|
} > DRAM
|
2002-05-24 15:37:26 +00:00
|
|
|
|
2004-07-24 17:56:38 +00:00
|
|
|
.iram 0xf000000 : AT ( _iramcopy)
|
|
|
|
{
|
|
|
|
_iramstart = .;
|
|
|
|
*(.icode)
|
|
|
|
*(.idata)
|
|
|
|
_iramend = .;
|
|
|
|
} > IRAM
|
|
|
|
|
|
|
|
/* TRICK ALERT! We want 0x2000 bytes of stack, but we set the section
|
|
|
|
size smaller, and allow the stack to grow into the .iram copy */
|
2004-08-09 21:35:57 +00:00
|
|
|
.stack ADDR(.data) + SIZEOF(.data) + SIZEOF(.iram):
|
2002-05-24 15:37:26 +00:00
|
|
|
{
|
|
|
|
*(.stack)
|
2004-08-09 21:35:57 +00:00
|
|
|
_stackbegin = . - SIZEOF(.iram);
|
|
|
|
. += 0x2000 - SIZEOF(.iram);
|
2002-07-15 22:15:00 +00:00
|
|
|
_stackend = .;
|
2002-08-01 08:12:17 +00:00
|
|
|
} > DRAM
|
2002-05-24 15:37:26 +00:00
|
|
|
|
2002-08-01 08:58:17 +00:00
|
|
|
.bss :
|
|
|
|
{
|
|
|
|
_edata = .;
|
|
|
|
*(.bss)
|
|
|
|
*(COMMON)
|
|
|
|
_end = .;
|
|
|
|
} > DRAM
|
|
|
|
|
2002-05-24 15:37:26 +00:00
|
|
|
.mp3buf :
|
|
|
|
{
|
2003-05-09 16:01:21 +00:00
|
|
|
_mp3buffer = .;
|
2002-08-01 08:12:17 +00:00
|
|
|
} > DRAM
|
2002-05-24 15:37:26 +00:00
|
|
|
|
2003-10-12 16:40:45 +00:00
|
|
|
.mp3end ENDADDR:
|
2002-05-24 15:37:26 +00:00
|
|
|
{
|
|
|
|
_mp3end = .;
|
2002-08-01 08:12:17 +00:00
|
|
|
} > DRAM
|
2002-03-28 15:09:10 +00:00
|
|
|
|
2003-06-29 16:33:04 +00:00
|
|
|
.plugin ENDADDR:
|
|
|
|
{
|
|
|
|
_pluginbuf = .;
|
|
|
|
}
|
|
|
|
|
2003-12-12 13:29:34 +00:00
|
|
|
#endif
|
2002-05-24 15:37:26 +00:00
|
|
|
}
|