2003-12-12 13:29:34 +00:00
|
|
|
#include "config.h"
|
|
|
|
|
2002-05-02 14:05:51 +00:00
|
|
|
ENTRY(start)
|
2005-07-18 12:40:29 +00:00
|
|
|
#ifdef CPU_COLDFIRE
|
2004-10-06 13:30:44 +00:00
|
|
|
OUTPUT_FORMAT(elf32-m68k)
|
2005-02-10 15:25:16 +00:00
|
|
|
#elif CONFIG_CPU == TCC730
|
|
|
|
OUTPUT_FORMAT(elf32-calmrisc16)
|
2004-10-06 13:30:44 +00:00
|
|
|
#else
|
2002-03-28 15:09:10 +00:00
|
|
|
OUTPUT_FORMAT(elf32-sh)
|
2004-10-06 13:30:44 +00:00
|
|
|
#endif
|
2002-05-29 09:12:34 +00:00
|
|
|
INPUT(crt0.o)
|
2002-08-01 08:12:17 +00:00
|
|
|
|
2005-02-10 22:37:09 +00:00
|
|
|
#if CONFIG_CPU == TCC730
|
|
|
|
MEMORY
|
|
|
|
{
|
|
|
|
FIRMWARE : ORIGIN = LOADADDRESS, LENGTH = 256K
|
|
|
|
FLASH (RX) : ORIGIN = 0x000000, LENGTH = 1024K
|
|
|
|
ICMEM (RX) : ORIGIN = 0x3FC000, LENGTH = 32K
|
|
|
|
IMEM1 : ORIGIN = 0x200000, LENGTH = 32K
|
2005-03-07 15:29:37 +00:00
|
|
|
IMEM2 : ORIGIN = 0x210000, LENGTH = 16K
|
|
|
|
IMEM3 : ORIGIN = 0x220000, LENGTH = 32K
|
2005-02-10 22:37:09 +00:00
|
|
|
IMEM4 : ORIGIN = 0x230000, LENGTH = 16K
|
|
|
|
|
|
|
|
DRAM : ORIGIN = 0x000000, LENGTH = 0x3F0000
|
|
|
|
}
|
|
|
|
|
|
|
|
SECTIONS
|
|
|
|
{
|
|
|
|
.text LOADADDRESS : {
|
|
|
|
*(.init.text)
|
|
|
|
*(.text)
|
|
|
|
}> FLASH AT> FIRMWARE
|
|
|
|
|
|
|
|
.icode 0x3FC040: {
|
|
|
|
*(.vectors)
|
2005-03-07 15:29:37 +00:00
|
|
|
*(.icode)
|
2005-02-10 22:37:09 +00:00
|
|
|
}> ICMEM AT> FIRMWARE
|
|
|
|
|
2005-02-11 18:42:57 +00:00
|
|
|
/* We start at 0x2000, to avoid overwriting Archos' loader datasegment.
|
|
|
|
* If it turns out that we won't call back the loader, this can be set to 0.
|
|
|
|
*/
|
|
|
|
.bss 0x2000 : {
|
|
|
|
*(.bss)
|
|
|
|
. = ALIGN(2);
|
|
|
|
}> DRAM
|
2005-02-10 22:37:09 +00:00
|
|
|
|
2005-02-11 18:42:57 +00:00
|
|
|
/* Data is put after BSS, to have all strings addresses > VIRT_PTR + VIRT_SIZE.
|
|
|
|
Strings are in rodata, so what we really assert is (.rodata > VIRT_PTR + VIRT_SIZE)
|
|
|
|
See settings.h for details */
|
|
|
|
.data ALIGN(2): {
|
2005-02-10 22:37:09 +00:00
|
|
|
*(.data)
|
|
|
|
. = ALIGN(2);
|
|
|
|
*(.rodata)
|
|
|
|
. = ALIGN(2);
|
|
|
|
*(.rodata.str1.2)
|
|
|
|
. = ALIGN(2);
|
|
|
|
}> DRAM AT> FIRMWARE
|
|
|
|
|
|
|
|
|
|
|
|
.stack ALIGN(2) : {
|
|
|
|
. = . + 0x2000;
|
|
|
|
}> DRAM
|
|
|
|
|
|
|
|
.idata 0x200000: {
|
|
|
|
*(.idata)
|
2005-02-25 09:12:44 +00:00
|
|
|
}> IMEM1
|
2005-02-10 22:37:09 +00:00
|
|
|
|
2005-03-07 15:29:37 +00:00
|
|
|
.idata2 0x220000: {
|
2005-02-25 09:12:44 +00:00
|
|
|
*(.idata2)
|
2005-03-07 15:29:37 +00:00
|
|
|
}> IMEM3
|
2005-02-10 22:37:09 +00:00
|
|
|
|
|
|
|
_codesize = SIZEOF(.text);
|
|
|
|
|
|
|
|
_icodecopy = LOADADDR(.icode);
|
|
|
|
_icodestart = ADDR(.icode);
|
|
|
|
_icodesize = SIZEOF(.icode);
|
|
|
|
|
|
|
|
_datacopy = LOADADDR(.data);
|
|
|
|
_datastart = ADDR(.data);
|
|
|
|
_datasize = SIZEOF(.data);
|
|
|
|
|
|
|
|
|
|
|
|
_bssstart = ADDR(.bss);
|
|
|
|
_bsssize = (SIZEOF(.bss) + 1) & ~ 1;
|
|
|
|
|
|
|
|
_stackbegin = ADDR(.stack);
|
|
|
|
_stackend = ADDR(.stack) + SIZEOF(.stack);
|
|
|
|
|
|
|
|
_idatastart = ADDR(.idata);
|
|
|
|
|
2005-04-05 11:33:58 +00:00
|
|
|
/* FIXME: Where to put audio buffer? */
|
2005-02-11 10:25:15 +00:00
|
|
|
|
2005-04-05 11:33:58 +00:00
|
|
|
_audiobuffer = 0;
|
2005-05-24 15:38:46 +00:00
|
|
|
_audiobufend = 0;
|
2005-02-11 10:25:15 +00:00
|
|
|
|
|
|
|
/* Plugins are not supported on the Gmini*/
|
|
|
|
|
|
|
|
_pluginbuf = 0;
|
|
|
|
|
2005-02-10 22:37:09 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
2005-06-27 21:23:03 +00:00
|
|
|
#define PLUGINSIZE PLUGIN_BUFFER_SIZE
|
|
|
|
#define CODECSIZE CODEC_SIZE
|
2003-06-29 16:33:04 +00:00
|
|
|
|
2005-06-22 02:47:54 +00:00
|
|
|
|
2003-02-26 16:05:30 +00:00
|
|
|
#ifdef DEBUG
|
2004-10-06 13:30:44 +00:00
|
|
|
#define STUBOFFSET 0x10000
|
2003-02-26 16:05:30 +00:00
|
|
|
#else
|
2004-10-06 13:30:44 +00:00
|
|
|
#define STUBOFFSET 0
|
2003-02-26 16:05:30 +00:00
|
|
|
#endif
|
2004-10-06 13:30:44 +00:00
|
|
|
|
2005-06-22 02:47:54 +00:00
|
|
|
#define DRAMSIZE (MEMORYSIZE * 0x100000) - PLUGINSIZE - STUBOFFSET - CODECSIZE
|
2003-02-26 09:18:13 +00:00
|
|
|
|
2005-07-09 07:46:42 +00:00
|
|
|
#if defined(IRIVER_H100_SERIES) || defined(IRIVER_H300)
|
2005-07-08 15:08:59 +00:00
|
|
|
#define DRAMORIG 0x31000000 + STUBOFFSET
|
2005-07-09 07:46:42 +00:00
|
|
|
#define IRAMORIG 0x10000000
|
2005-09-01 20:57:33 +00:00
|
|
|
#define IRAMSIZE 0xc000
|
2004-10-06 13:30:44 +00:00
|
|
|
#else
|
|
|
|
#define DRAMORIG 0x09000000 + STUBOFFSET
|
|
|
|
#define IRAMORIG 0x0f000000
|
|
|
|
#define IRAMSIZE 0x1000
|
|
|
|
#endif
|
|
|
|
|
2005-06-22 02:47:54 +00:00
|
|
|
/* 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)
|
2004-10-06 13:48:25 +00:00
|
|
|
|
2002-08-01 08:12:17 +00:00
|
|
|
MEMORY
|
|
|
|
{
|
2004-10-06 13:30:44 +00:00
|
|
|
DRAM : ORIGIN = DRAMORIG, LENGTH = DRAMSIZE
|
|
|
|
IRAM : ORIGIN = IRAMORIG, LENGTH = IRAMSIZE
|
2002-08-01 08:12:17 +00:00
|
|
|
}
|
|
|
|
|
2002-03-28 15:09:10 +00:00
|
|
|
SECTIONS
|
|
|
|
{
|
2002-08-01 08:12:17 +00:00
|
|
|
.vectors :
|
2002-03-28 15:09:10 +00:00
|
|
|
{
|
2005-03-31 08:47:02 +00:00
|
|
|
loadaddress = .;
|
|
|
|
_loadaddress = .;
|
2005-06-21 00:01:28 +00:00
|
|
|
KEEP(*(.resetvectors));
|
2002-05-29 09:12:34 +00:00
|
|
|
*(.resetvectors);
|
2005-06-21 00:01:28 +00:00
|
|
|
KEEP(*(.vectors));
|
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)
|
2005-06-21 00:01:28 +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
|
|
|
{
|
2005-06-21 00:01:28 +00:00
|
|
|
*(.rodata) /* problems without this, dunno why */
|
|
|
|
*(.rodata*)
|
2004-10-07 08:37:25 +00:00
|
|
|
*(.rodata.str1.1)
|
2004-07-24 17:56:38 +00:00
|
|
|
*(.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 = .;
|
2005-06-21 00:01:28 +00:00
|
|
|
*(.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
|
|
|
|
2005-07-24 15:32:28 +00:00
|
|
|
/DISCARD/ :
|
|
|
|
{
|
|
|
|
*(.eh_frame)
|
|
|
|
}
|
|
|
|
|
2004-10-07 08:37:25 +00:00
|
|
|
.iram IRAMORIG : AT ( _iramcopy)
|
2004-07-24 17:56:38 +00:00
|
|
|
{
|
|
|
|
_iramstart = .;
|
|
|
|
*(.icode)
|
|
|
|
*(.idata)
|
|
|
|
_iramend = .;
|
|
|
|
} > IRAM
|
|
|
|
|
2005-07-18 12:40:29 +00:00
|
|
|
#ifdef CPU_COLDFIRE
|
2005-03-01 12:25:30 +00:00
|
|
|
.stack :
|
|
|
|
{
|
|
|
|
*(.stack)
|
|
|
|
stackbegin = .;
|
2005-09-01 20:57:33 +00:00
|
|
|
. += 0x2000;
|
2005-03-01 12:25:30 +00:00
|
|
|
stackend = .;
|
|
|
|
} > IRAM
|
|
|
|
#else
|
2004-07-24 17:56:38 +00:00
|
|
|
/* 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
|
2005-03-01 12:25:30 +00:00
|
|
|
#endif
|
2002-05-24 15:37:26 +00:00
|
|
|
|
2005-07-18 12:40:29 +00:00
|
|
|
#ifdef CPU_COLDFIRE
|
2005-03-01 12:25:30 +00:00
|
|
|
.bss ADDR(.data) + SIZEOF(.data) + SIZEOF(.iram):
|
|
|
|
#else
|
2002-08-01 08:58:17 +00:00
|
|
|
.bss :
|
2005-03-01 12:25:30 +00:00
|
|
|
#endif
|
2002-08-01 08:58:17 +00:00
|
|
|
{
|
|
|
|
_edata = .;
|
2005-06-21 00:01:28 +00:00
|
|
|
*(.bss*)
|
2002-08-01 08:58:17 +00:00
|
|
|
*(COMMON)
|
2005-03-18 07:53:52 +00:00
|
|
|
. = ALIGN(0x4);
|
2002-08-01 08:58:17 +00:00
|
|
|
_end = .;
|
|
|
|
} > DRAM
|
|
|
|
|
2005-04-05 11:33:58 +00:00
|
|
|
.audiobuf ALIGN(4) :
|
2002-05-24 15:37:26 +00:00
|
|
|
{
|
2005-04-05 11:33:58 +00:00
|
|
|
_audiobuffer = .;
|
|
|
|
audiobuffer = .;
|
2002-08-01 08:12:17 +00:00
|
|
|
} > DRAM
|
2002-05-24 15:37:26 +00:00
|
|
|
|
2005-06-22 02:47:54 +00:00
|
|
|
.audiobufend ENDAUDIOADDR:
|
2002-05-24 15:37:26 +00:00
|
|
|
{
|
2005-04-05 11:33:58 +00:00
|
|
|
audiobufend = .;
|
|
|
|
_audiobufend = .;
|
2002-08-01 08:12:17 +00:00
|
|
|
} > DRAM
|
2002-03-28 15:09:10 +00:00
|
|
|
|
2005-06-22 02:47:54 +00:00
|
|
|
.codec ENDAUDIOADDR:
|
|
|
|
{
|
|
|
|
codecbuf = .;
|
|
|
|
_codecbuf = .;
|
|
|
|
}
|
|
|
|
|
2003-06-29 16:33:04 +00:00
|
|
|
.plugin ENDADDR:
|
|
|
|
{
|
|
|
|
_pluginbuf = .;
|
2005-02-03 08:36:18 +00:00
|
|
|
pluginbuf = .;
|
2003-06-29 16:33:04 +00:00
|
|
|
}
|
2002-05-24 15:37:26 +00:00
|
|
|
}
|
2005-02-10 22:37:09 +00:00
|
|
|
|
|
|
|
#endif
|