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/tms320dm320/crt0.o)
|
2008-03-13 03:48:23 +00:00
|
|
|
|
|
|
|
#ifdef DEBUG
|
|
|
|
#define STUBOFFSET 0x10000
|
|
|
|
#else
|
|
|
|
#define STUBOFFSET 0
|
|
|
|
#endif
|
|
|
|
|
2009-04-09 04:45:19 +00:00
|
|
|
#ifndef LCD_NATIVE_WIDTH
|
|
|
|
#define LCD_NATIVE_WIDTH LCD_WIDTH
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef LCD_NATIVE_HEIGHT
|
|
|
|
#define LCD_NATIVE_HEIGHT LCD_HEIGHT
|
|
|
|
#endif
|
|
|
|
|
2009-04-09 04:22:14 +00:00
|
|
|
#define LCD_FUDGE LCD_NATIVE_WIDTH%32
|
2009-04-01 03:21:18 +00:00
|
|
|
|
2009-04-09 04:22:14 +00:00
|
|
|
#define LCD_BUFFER_SIZE ((LCD_NATIVE_WIDTH+LCD_FUDGE)*LCD_NATIVE_HEIGHT*2)
|
2008-03-13 03:48:23 +00:00
|
|
|
|
2009-04-09 04:22:14 +00:00
|
|
|
/* must be 16Kb (0x4000) aligned */
|
|
|
|
#define TTB_SIZE 0x4000
|
2008-03-13 03:48:23 +00:00
|
|
|
|
2009-04-09 04:22:14 +00:00
|
|
|
/* Give this 1 meg to allow it to align to the MMU boundary */
|
|
|
|
#define LCD_TTB_AREA 0x100000
|
2008-03-13 03:48:23 +00:00
|
|
|
|
2009-04-09 04:22:14 +00:00
|
|
|
#define DRAMSIZE (MEMORYSIZE * 0x100000) - STUBOFFSET
|
2008-03-13 03:48:23 +00:00
|
|
|
|
2009-04-09 04:22:14 +00:00
|
|
|
#define DRAMORIG 0x00900000 + STUBOFFSET
|
|
|
|
#define IRAMORIG 0x00000000
|
|
|
|
#define IRAMSIZE 0x4000
|
2009-04-01 03:21:18 +00:00
|
|
|
|
2009-04-09 04:22:14 +00:00
|
|
|
/* End of the audio buffer, where the codec buffer starts */
|
|
|
|
#define ENDAUDIOADDR (DRAMORIG + DRAMSIZE - PLUGIN_BUFFER_SIZE - CODEC_SIZE - LCD_TTB_AREA)
|
2009-04-01 03:21:18 +00:00
|
|
|
|
2008-03-13 03:48:23 +00:00
|
|
|
MEMORY
|
|
|
|
{
|
|
|
|
DRAM : ORIGIN = DRAMORIG, LENGTH = DRAMSIZE
|
|
|
|
IRAM : ORIGIN = IRAMORIG, LENGTH = IRAMSIZE
|
|
|
|
}
|
|
|
|
|
|
|
|
SECTIONS
|
|
|
|
{
|
|
|
|
.text :
|
|
|
|
{
|
|
|
|
loadaddress = .;
|
|
|
|
_loadaddress = .;
|
|
|
|
*(.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);
|
|
|
|
} > DRAM
|
|
|
|
|
2009-04-01 03:21:18 +00:00
|
|
|
.data :
|
2008-03-13 03:48:23 +00:00
|
|
|
{
|
|
|
|
*(.data*)
|
|
|
|
. = ALIGN(0x4);
|
2009-04-01 03:21:18 +00:00
|
|
|
} > DRAM
|
2008-03-13 03:48:23 +00:00
|
|
|
|
|
|
|
/DISCARD/ :
|
|
|
|
{
|
|
|
|
*(.eh_frame)
|
|
|
|
}
|
|
|
|
|
|
|
|
.vectors IRAMORIG :
|
|
|
|
{
|
|
|
|
_vectorsstart = .;
|
|
|
|
*(.vectors);
|
|
|
|
_vectorsend = .;
|
|
|
|
} > IRAM AT> DRAM
|
|
|
|
|
|
|
|
_vectorscopy = LOADADDR(.vectors);
|
|
|
|
|
|
|
|
.iram :
|
|
|
|
{
|
|
|
|
_iramstart = .;
|
|
|
|
*(.icode)
|
2009-04-01 03:21:18 +00:00
|
|
|
*(.irodata*)
|
2008-03-13 03:48:23 +00:00
|
|
|
*(.idata)
|
2008-04-07 18:24:23 +00:00
|
|
|
. = ALIGN(0x4);
|
2008-03-13 03:48:23 +00:00
|
|
|
_iramend = .;
|
|
|
|
} > IRAM AT> DRAM
|
|
|
|
|
|
|
|
_iramcopy = LOADADDR(.iram);
|
2009-04-01 03:21:18 +00:00
|
|
|
|
2008-03-13 03:48:23 +00:00
|
|
|
.ibss (NOLOAD) :
|
|
|
|
{
|
|
|
|
_iedata = .;
|
|
|
|
*(.ibss)
|
|
|
|
. = ALIGN(0x4);
|
|
|
|
_iend = .;
|
|
|
|
} > IRAM
|
|
|
|
|
2009-04-01 03:21:18 +00:00
|
|
|
.stack (NOLOAD) :
|
2008-03-13 03:48:23 +00:00
|
|
|
{
|
|
|
|
*(.stack)
|
|
|
|
stackbegin = .;
|
|
|
|
. += 0x2000;
|
|
|
|
stackend = .;
|
|
|
|
} > IRAM
|
2009-04-01 03:21:18 +00:00
|
|
|
|
2009-04-01 03:54:48 +00:00
|
|
|
/* This could probably be shortened so that the audio buffer overwrites
|
|
|
|
* at the IRAM stuff (assuming that it is copied first in crt0.S), but
|
|
|
|
* leave it for now since the space is not critical at the moment.
|
|
|
|
*/
|
|
|
|
.bss (NOLOAD) :
|
|
|
|
{
|
|
|
|
. = ADDR(.data) + SIZEOF(.data) + SIZEOF(.vectors) + SIZEOF(.iram);
|
|
|
|
_edata = .;
|
|
|
|
*(.bss*)
|
|
|
|
*(COMMON)
|
|
|
|
. = ALIGN(0x4);
|
|
|
|
_end = .;
|
|
|
|
} > DRAM
|
|
|
|
|
2008-03-13 03:48:23 +00:00
|
|
|
|
2009-04-01 03:21:18 +00:00
|
|
|
.audiobuf (NOLOAD) :
|
2008-03-13 03:48:23 +00:00
|
|
|
{
|
2009-04-01 03:21:18 +00:00
|
|
|
. = ALIGN(4);
|
2008-03-13 03:48:23 +00:00
|
|
|
_audiobuffer = .;
|
|
|
|
audiobuffer = .;
|
|
|
|
} > DRAM
|
|
|
|
|
2009-04-01 03:21:18 +00:00
|
|
|
.audiobufend ENDAUDIOADDR (NOLOAD) :
|
2008-03-13 03:48:23 +00:00
|
|
|
{
|
|
|
|
audiobufend = .;
|
|
|
|
_audiobufend = .;
|
|
|
|
} > DRAM
|
|
|
|
|
2009-04-01 03:21:18 +00:00
|
|
|
.codec ENDAUDIOADDR (NOLOAD) :
|
2008-03-13 03:48:23 +00:00
|
|
|
{
|
|
|
|
codecbuf = .;
|
|
|
|
_codecbuf = .;
|
2009-04-09 04:22:14 +00:00
|
|
|
. += CODEC_SIZE;
|
|
|
|
} > DRAM
|
2008-03-13 03:48:23 +00:00
|
|
|
|
2009-04-09 04:22:14 +00:00
|
|
|
.plugin (NOLOAD) :
|
2008-03-13 03:48:23 +00:00
|
|
|
{
|
|
|
|
_pluginbuf = .;
|
|
|
|
pluginbuf = .;
|
2009-04-09 04:22:14 +00:00
|
|
|
. += PLUGIN_BUFFER_SIZE;
|
|
|
|
} > DRAM
|
2009-04-01 03:21:18 +00:00
|
|
|
|
2009-04-09 04:22:14 +00:00
|
|
|
.ttbtable (NOLOAD) :
|
2009-04-01 03:21:18 +00:00
|
|
|
{
|
2009-04-09 04:22:14 +00:00
|
|
|
. = ALIGN (0x4000);
|
|
|
|
_ttbstart = .;
|
|
|
|
. += TTB_SIZE;
|
|
|
|
} > DRAM
|
|
|
|
|
|
|
|
/* The LCD buffer should be at the end of memory to protect against
|
|
|
|
* overflowing something else when the YUV blitter is fudging the screen
|
|
|
|
* size.
|
|
|
|
*/
|
2009-04-01 03:21:18 +00:00
|
|
|
|
2009-04-09 04:22:14 +00:00
|
|
|
.lcdbuffer (NOLOAD) :
|
2009-04-01 03:21:18 +00:00
|
|
|
{
|
2009-04-09 04:22:14 +00:00
|
|
|
_lcdbuf = .;
|
|
|
|
. += LCD_BUFFER_SIZE;
|
|
|
|
} > DRAM
|
2008-03-13 03:48:23 +00:00
|
|
|
}
|
|
|
|
|