2004-09-03 13:16:19 +00:00
|
|
|
#include "config.h"
|
|
|
|
|
2004-09-03 13:02:16 +00:00
|
|
|
ENTRY(start)
|
2007-01-08 18:21:12 +00:00
|
|
|
|
2005-07-18 12:40:29 +00:00
|
|
|
#ifdef CPU_COLDFIRE
|
2005-01-28 13:19:01 +00:00
|
|
|
OUTPUT_FORMAT(elf32-m68k)
|
2008-04-29 06:19:32 +00:00
|
|
|
STARTUP(target/coldfire/crt0.o)
|
2006-08-31 19:45:05 +00:00
|
|
|
#elif defined(CPU_PP)
|
2007-01-08 18:21:12 +00:00
|
|
|
OUTPUT_FORMAT(elf32-littlearm)
|
2012-01-03 04:44:27 +00:00
|
|
|
STARTUP(target/arm/pp/crt0-pp.o)
|
2006-08-31 19:45:05 +00:00
|
|
|
#elif defined(CPU_ARM)
|
2007-01-08 18:21:12 +00:00
|
|
|
OUTPUT_FORMAT(elf32-littlearm)
|
2008-04-29 06:19:32 +00:00
|
|
|
STARTUP(target/arm/crt0.o)
|
2006-08-31 19:45:05 +00:00
|
|
|
#elif CONFIG_CPU == SH7034
|
2007-01-08 18:21:12 +00:00
|
|
|
OUTPUT_FORMAT(elf32-sh)
|
2008-04-29 06:19:32 +00:00
|
|
|
STARTUP(target/sh/crt0.o)
|
2006-08-31 19:45:05 +00:00
|
|
|
#else
|
2007-01-08 18:21:12 +00:00
|
|
|
OUTPUT_FORMAT(elf32-sh)
|
2008-04-29 06:19:32 +00:00
|
|
|
STARTUP(crt0.o)
|
2006-08-31 19:45:05 +00:00
|
|
|
#endif
|
|
|
|
|
2005-01-12 01:25:19 +00:00
|
|
|
|
2005-02-15 14:00:37 +00:00
|
|
|
#if MEMORYSIZE >= 32
|
2007-01-08 18:21:12 +00:00
|
|
|
#define PLUGINSIZE PLUGIN_BUFFER_SIZE
|
2005-02-15 14:00:37 +00:00
|
|
|
#else
|
2005-01-12 01:25:19 +00:00
|
|
|
#define PLUGINSIZE 0x8000
|
2005-02-15 14:00:37 +00:00
|
|
|
#endif
|
2005-01-12 01:25:19 +00:00
|
|
|
|
2005-01-28 13:19:01 +00:00
|
|
|
|
2007-01-08 18:21:12 +00:00
|
|
|
#ifdef IRIVER_H100_SERIES
|
|
|
|
#define CODECSIZE CODEC_SIZE
|
2005-04-20 06:48:17 +00:00
|
|
|
#define DRAMORIG 0x31000000
|
2005-01-28 13:19:01 +00:00
|
|
|
#define IRAMORIG 0x10000000
|
2007-01-08 18:21:12 +00:00
|
|
|
#define IRAMSIZE 0xc000
|
|
|
|
#define FLASHORIG 0x00100028
|
|
|
|
#define FLASHSIZE 0x000eff80
|
2005-01-28 13:19:01 +00:00
|
|
|
#else
|
|
|
|
#define DRAMORIG 0x09000000
|
2005-01-12 01:25:19 +00:00
|
|
|
#define IRAMORIG 0x0f000000
|
|
|
|
#define IRAMSIZE 0x1000
|
|
|
|
#define FLASHORIG 0x02000000 + ROM_START
|
|
|
|
#define FLASHSIZE 256K - ROM_START
|
2005-01-28 13:19:01 +00:00
|
|
|
#endif
|
2005-01-12 01:25:19 +00:00
|
|
|
|
2007-01-08 18:21:12 +00:00
|
|
|
#ifdef CODECSIZE
|
|
|
|
#define DRAMSIZE (MEMORYSIZE * 0x100000) - PLUGINSIZE - CODECSIZE
|
|
|
|
/* Where the codec buffer ends, and the plugin buffer starts */
|
|
|
|
#define ENDADDR (ENDAUDIOADDR + CODECSIZE)
|
|
|
|
#else
|
|
|
|
#define DRAMSIZE (MEMORYSIZE * 0x100000) - PLUGINSIZE
|
|
|
|
/* Where the audio buffer ends, and the plugin buffer starts */
|
|
|
|
#define ENDADDR ENDAUDIOADDR
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* End of the audio buffer, where the codec/plugin buffer starts */
|
|
|
|
#define ENDAUDIOADDR (DRAMORIG + DRAMSIZE)
|
2014-01-18 22:11:25 +00:00
|
|
|
#define CODECORIG ENDAUDIOADDR
|
|
|
|
|
2004-09-03 13:02:16 +00:00
|
|
|
MEMORY
|
|
|
|
{
|
2005-01-12 01:25:19 +00:00
|
|
|
DRAM : ORIGIN = DRAMORIG, LENGTH = DRAMSIZE
|
|
|
|
IRAM : ORIGIN = IRAMORIG, LENGTH = IRAMSIZE
|
|
|
|
FLASH : ORIGIN = FLASHORIG, LENGTH = FLASHSIZE
|
2004-09-03 13:02:16 +00:00
|
|
|
}
|
2014-01-18 22:11:25 +00:00
|
|
|
|
2004-09-03 13:02:16 +00:00
|
|
|
SECTIONS
|
|
|
|
{
|
2005-08-23 07:26:40 +00:00
|
|
|
.flashheader :
|
|
|
|
{
|
|
|
|
/* place flash link address first, so the plugin can check */
|
|
|
|
LONG(FLASHORIG);
|
|
|
|
/* followed by the start address, the first vector takes care of this. */
|
|
|
|
/* If we ever place the table elsewhere, put a constant here. */
|
|
|
|
} > FLASH
|
|
|
|
|
2004-09-03 13:02:16 +00:00
|
|
|
.vectors :
|
|
|
|
{
|
|
|
|
_datacopy = .;
|
|
|
|
} > FLASH
|
|
|
|
|
|
|
|
.data : AT ( _datacopy )
|
|
|
|
{
|
2005-03-31 08:47:02 +00:00
|
|
|
loadaddress = .;
|
|
|
|
_loadaddress = .;
|
2004-09-03 13:02:16 +00:00
|
|
|
_datastart = .;
|
2011-12-18 06:43:08 +00:00
|
|
|
KEEP(*(.resetvectors));
|
|
|
|
KEEP(*(.vectors));
|
2005-01-28 13:19:01 +00:00
|
|
|
. = ALIGN(0x200);
|
2014-01-20 09:42:02 +00:00
|
|
|
#ifdef HAVE_INIT_ATTR
|
|
|
|
*(.initdata*)
|
|
|
|
#endif
|
2011-12-18 07:09:00 +00:00
|
|
|
*(.data*)
|
2004-09-03 13:02:16 +00:00
|
|
|
. = ALIGN(0x4);
|
2007-01-08 18:21:12 +00:00
|
|
|
_dataend = .;
|
2004-09-06 07:05:12 +00:00
|
|
|
. = ALIGN(0x10); /* Maintain proper alignment for .text section */
|
2004-09-03 13:02:16 +00:00
|
|
|
} > DRAM
|
|
|
|
|
2007-01-08 18:21:12 +00:00
|
|
|
/DISCARD/ :
|
|
|
|
{
|
|
|
|
*(.eh_frame)
|
|
|
|
}
|
|
|
|
|
2004-09-06 07:05:12 +00:00
|
|
|
/* TRICK ALERT! Newer versions of the linker don't allow output sections
|
|
|
|
to overlap even if one of them is empty, so advance the location pointer
|
|
|
|
"by hand" */
|
|
|
|
.text LOADADDR(.data) + SIZEOF(.data) :
|
2004-09-03 13:02:16 +00:00
|
|
|
{
|
|
|
|
*(.init.text)
|
2014-01-18 22:11:25 +00:00
|
|
|
KEEP(*(.startup*));
|
2014-01-20 09:42:02 +00:00
|
|
|
#ifdef HAVE_INIT_ATTR
|
|
|
|
/* all this symbols are set to the same address so .init copy loop
|
|
|
|
will be skiped in crt0.S */
|
|
|
|
_initstart = .;
|
|
|
|
_initend = .;
|
|
|
|
_initcopy = .;
|
|
|
|
*(.init*)
|
|
|
|
#endif
|
2011-12-18 07:09:00 +00:00
|
|
|
*(.text*)
|
2004-09-03 13:02:16 +00:00
|
|
|
. = ALIGN(0x4);
|
|
|
|
} > FLASH
|
|
|
|
|
|
|
|
.rodata :
|
|
|
|
{
|
2011-12-18 07:09:00 +00:00
|
|
|
*(.rodata*)
|
2005-01-28 13:19:01 +00:00
|
|
|
*(.rodata.str1.1)
|
2004-09-03 13:02:16 +00:00
|
|
|
*(.rodata.str1.4)
|
|
|
|
. = ALIGN(0x4);
|
|
|
|
_iramcopy = .;
|
|
|
|
} > FLASH
|
|
|
|
|
2005-01-28 13:19:01 +00:00
|
|
|
.iram IRAMORIG : AT ( _iramcopy )
|
2004-09-03 13:02:16 +00:00
|
|
|
{
|
|
|
|
_iramstart = .;
|
|
|
|
*(.icode)
|
2005-10-19 19:35:24 +00:00
|
|
|
*(.irodata)
|
2004-09-03 13:02:16 +00:00
|
|
|
*(.idata)
|
|
|
|
_iramend = .;
|
|
|
|
} > IRAM
|
2007-01-08 18:21:12 +00:00
|
|
|
|
2005-10-19 19:35:24 +00:00
|
|
|
.ibss (NOLOAD) :
|
|
|
|
{
|
|
|
|
_iedata = .;
|
|
|
|
*(.ibss)
|
|
|
|
. = ALIGN(0x4);
|
|
|
|
_iend = .;
|
|
|
|
} > IRAM
|
|
|
|
|
2004-09-03 13:02:16 +00:00
|
|
|
.stack :
|
|
|
|
{
|
|
|
|
*(.stack)
|
|
|
|
_stackbegin = .;
|
2005-01-28 13:19:01 +00:00
|
|
|
stackbegin = .;
|
2004-09-03 13:02:16 +00:00
|
|
|
. += 0x2000;
|
|
|
|
_stackend = .;
|
2005-01-28 13:19:01 +00:00
|
|
|
stackend = .;
|
2007-01-08 19:19:23 +00:00
|
|
|
#if IRAMSIZE > 0x1000
|
2007-01-08 18:21:12 +00:00
|
|
|
} > IRAM
|
2007-01-08 19:19:23 +00:00
|
|
|
#else
|
|
|
|
} > DRAM
|
|
|
|
#endif
|
2004-09-03 13:02:16 +00:00
|
|
|
|
2007-01-08 18:21:12 +00:00
|
|
|
#ifdef CPU_COLDFIRE
|
|
|
|
.bss ADDR(.data) + SIZEOF(.data) + SIZEOF(.iram):
|
|
|
|
#else
|
2004-09-03 13:02:16 +00:00
|
|
|
.bss :
|
2007-01-08 18:21:12 +00:00
|
|
|
#endif
|
2004-09-03 13:02:16 +00:00
|
|
|
{
|
|
|
|
_edata = .;
|
2007-01-08 18:21:12 +00:00
|
|
|
*(.bss*)
|
2004-09-03 13:02:16 +00:00
|
|
|
*(COMMON)
|
2007-01-08 18:21:12 +00:00
|
|
|
. = ALIGN(0x4);
|
2004-09-03 13:02:16 +00:00
|
|
|
_end = .;
|
|
|
|
} > DRAM
|
|
|
|
|
2007-01-08 18:21:12 +00:00
|
|
|
.audiobuf ALIGN(4):
|
2004-09-03 13:02:16 +00:00
|
|
|
{
|
2005-04-05 11:33:58 +00:00
|
|
|
_audiobuffer = .;
|
2007-01-08 18:21:12 +00:00
|
|
|
audiobuffer = .;
|
2004-09-03 13:02:16 +00:00
|
|
|
} > DRAM
|
|
|
|
|
2007-01-08 18:21:12 +00:00
|
|
|
#ifdef CODECSIZE
|
|
|
|
.audiobufend ENDAUDIOADDR:
|
|
|
|
#else
|
2005-04-05 11:33:58 +00:00
|
|
|
.audiobufend ENDADDR:
|
2007-01-08 18:21:12 +00:00
|
|
|
#endif
|
2004-09-03 13:02:16 +00:00
|
|
|
{
|
2005-04-05 11:33:58 +00:00
|
|
|
_audiobufend = .;
|
2007-01-08 18:21:12 +00:00
|
|
|
audiobufend = .;
|
2004-09-03 13:02:16 +00:00
|
|
|
} > DRAM
|
|
|
|
|
2007-01-08 18:21:12 +00:00
|
|
|
#ifdef CODECSIZE
|
|
|
|
.codec ENDAUDIOADDR:
|
|
|
|
{
|
|
|
|
codecbuf = .;
|
|
|
|
_codecbuf = .;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2005-01-12 01:25:19 +00:00
|
|
|
.plugin ENDADDR:
|
2004-09-03 13:02:16 +00:00
|
|
|
{
|
|
|
|
_pluginbuf = .;
|
2007-01-08 18:21:12 +00:00
|
|
|
pluginbuf = .;
|
2004-09-03 13:02:16 +00:00
|
|
|
}
|
|
|
|
}
|