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-21 04:29:10 +00:00
|
|
|
/* Give this some memory to allow it to align to the MMU boundary.
|
|
|
|
* Note that since there are two buffers (YUV/RGB) it calculates the approximate
|
|
|
|
* memory needed in steps of 1 Meg.
|
|
|
|
*/
|
|
|
|
#define LCD_TTB_AREA 0x100000*((LCD_BUFFER_SIZE>>19)+1)
|
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*)
|
|
|
|
. = 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-08-12 02:34:07 +00:00
|
|
|
|
|
|
|
.irqstack (NOLOAD) :
|
|
|
|
{
|
|
|
|
*(.stack)
|
|
|
|
. += 0x400;
|
|
|
|
irq_stack = .;
|
|
|
|
} > IRAM
|
|
|
|
|
|
|
|
.fiqstack (NOLOAD) :
|
|
|
|
{
|
|
|
|
*(.stack)
|
|
|
|
. += 0x100;
|
|
|
|
fiq_stack = .;
|
|
|
|
} > IRAM
|
2009-04-01 03:21:18 +00:00
|
|
|
|
2009-06-13 20:59:03 +00:00
|
|
|
/* This overwrites the iram (in ram), so make sure that the iram is copied
|
|
|
|
* out in crt0.s before the bss section and the rest are used.
|
2009-04-01 03:54:48 +00:00
|
|
|
*/
|
2009-06-13 20:59:03 +00:00
|
|
|
.bss (NOLOAD) :
|
2009-04-01 03:54:48 +00:00
|
|
|
{
|
2009-06-13 20:59:03 +00:00
|
|
|
. = ADDR(.data) + SIZEOF(.data);
|
2009-04-01 03:54:48 +00:00
|
|
|
_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 = .;
|
|
|
|
} > DRAM
|
|
|
|
|
2009-04-01 03:21:18 +00:00
|
|
|
.audiobufend ENDAUDIOADDR (NOLOAD) :
|
2008-03-13 03:48:23 +00:00
|
|
|
{
|
|
|
|
audiobufend = .;
|
|
|
|
} > DRAM
|
|
|
|
|
2009-04-01 03:21:18 +00:00
|
|
|
.codec ENDAUDIOADDR (NOLOAD) :
|
2008-03-13 03:48:23 +00:00
|
|
|
{
|
|
|
|
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 = .;
|
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
|
2009-04-21 04:29:10 +00:00
|
|
|
|
|
|
|
.lcdbuffer2 (NOLOAD) :
|
|
|
|
{
|
|
|
|
_lcdbuf2 = .;
|
|
|
|
. += LCD_BUFFER_SIZE;
|
|
|
|
} > DRAM
|
2008-03-13 03:48:23 +00:00
|
|
|
}
|
|
|
|
|