2008-03-13 03:48:23 +00:00
|
|
|
#include "config.h"
|
|
|
|
|
2011-02-06 20:10:45 +00:00
|
|
|
ENTRY(_start)
|
2008-03-13 03:48:23 +00:00
|
|
|
|
|
|
|
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
|
|
|
|
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
|
|
|
/* must be 16Kb (0x4000) aligned */
|
|
|
|
#define TTB_SIZE 0x4000
|
2008-03-13 03:48:23 +00:00
|
|
|
|
2021-07-08 16:23:18 +00:00
|
|
|
#define DRAMSIZE (MEMORYSIZE * 0x100000)
|
|
|
|
#define DRAMORIG CONFIG_SDRAM_START
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef MROBE_500
|
|
|
|
#define LCD_FUDGE LCD_NATIVE_WIDTH%32
|
|
|
|
#define LCD_BUFFER_SIZE ((LCD_NATIVE_WIDTH+LCD_FUDGE)*LCD_NATIVE_HEIGHT*2)
|
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.
|
|
|
|
*/
|
2021-07-08 16:23:18 +00:00
|
|
|
#define LCD_TTB_AREA (0x100000*((LCD_BUFFER_SIZE>>19)+1))
|
|
|
|
#else
|
|
|
|
#define LCD_BUFFER_SIZE (LCD_NATIVE_WIDTH*LCD_NATIVE_HEIGHT*2)
|
|
|
|
#define LCD_TTB_AREA (TTB_SIZE + LCD_BUFFER_SIZE)
|
|
|
|
#endif
|
2008-03-13 03:48:23 +00:00
|
|
|
|
2021-07-08 16:23:18 +00:00
|
|
|
/* End of the audio buffer, where the codec buffer starts */
|
|
|
|
#define ENDAUDIOADDR \
|
|
|
|
(DRAMORIG + DRAMSIZE - PLUGIN_BUFFER_SIZE - CODEC_SIZE - LCD_TTB_AREA)
|
2011-02-06 20:10:45 +00:00
|
|
|
|
|
|
|
#define FLASHORIG 0x00100000
|
|
|
|
#define FLASHSIZE 0x00800000
|
|
|
|
|
|
|
|
#define ITCMORIG 0x00000000
|
|
|
|
#define ITCMSIZE 0x4000
|
|
|
|
|
|
|
|
#define DTCMORIG 0x00020000
|
|
|
|
#define DTCMSIZE 0x4000
|
|
|
|
|
|
|
|
PRO_STACK_SIZE = 0x2000;
|
|
|
|
IRQ_STACK_SIZE = 0x600;
|
|
|
|
FIQ_STACK_SIZE = 0x400;
|
2009-04-01 03:21:18 +00:00
|
|
|
|
2008-03-13 03:48:23 +00:00
|
|
|
MEMORY
|
|
|
|
{
|
|
|
|
DRAM : ORIGIN = DRAMORIG, LENGTH = DRAMSIZE
|
2011-02-06 20:10:45 +00:00
|
|
|
ITCM : ORIGIN = ITCMORIG, LENGTH = ITCMSIZE
|
|
|
|
DTCM : ORIGIN = DTCMORIG, LENGTH = DTCMSIZE
|
2008-03-13 03:48:23 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
SECTIONS
|
|
|
|
{
|
2011-02-06 20:10:45 +00:00
|
|
|
/* Set up variables needed for memory initialization */
|
|
|
|
_sdram_start = DRAMORIG;
|
|
|
|
_sdram_sizem = ((_endsdram - _sdram_start) / 0x100000);
|
|
|
|
|
|
|
|
_flash_start = FLASHORIG;
|
|
|
|
_flash_sizem = (FLASHSIZE / 0x100000);
|
|
|
|
|
|
|
|
/* crt0.S initialization */
|
|
|
|
.init :
|
2008-03-13 03:48:23 +00:00
|
|
|
{
|
2011-02-06 20:10:45 +00:00
|
|
|
. = ALIGN(0x4);
|
2008-03-13 03:48:23 +00:00
|
|
|
loadaddress = .;
|
2011-12-09 20:45:14 +00:00
|
|
|
_loadaddress = .;
|
2011-02-06 20:10:45 +00:00
|
|
|
*(.init)
|
|
|
|
} > DRAM
|
|
|
|
|
|
|
|
.vectors ITCMORIG :
|
|
|
|
{
|
2008-03-13 03:48:23 +00:00
|
|
|
. = ALIGN(0x4);
|
2011-02-06 20:10:45 +00:00
|
|
|
_vectorsstart = .;
|
2011-12-18 06:43:08 +00:00
|
|
|
KEEP(*(.vectors));
|
2011-02-06 20:10:45 +00:00
|
|
|
_vectorsend = .;
|
|
|
|
} > ITCM AT> DRAM
|
|
|
|
|
|
|
|
_vectorscopy = LOADADDR(.vectors);
|
|
|
|
|
|
|
|
.text :
|
|
|
|
{
|
|
|
|
. = ALIGN(0x4);
|
|
|
|
*(.text*)
|
|
|
|
} > DRAM
|
|
|
|
|
|
|
|
/* Thumb interworking sections - for some reason LD dies even if these
|
|
|
|
* sections are empty.
|
|
|
|
*/
|
|
|
|
.glue :
|
|
|
|
{
|
|
|
|
. = ALIGN(0x4);
|
|
|
|
*(.glue_7) /* ARM calling Thumb */
|
|
|
|
*(.glue_7t) /* Thumb calling ARM */
|
2008-03-13 03:48:23 +00:00
|
|
|
} > DRAM
|
|
|
|
|
|
|
|
.rodata :
|
|
|
|
{
|
|
|
|
. = ALIGN(0x4);
|
2011-02-06 20:10:45 +00:00
|
|
|
*(.rodata*)
|
2008-03-13 03:48:23 +00:00
|
|
|
} > DRAM
|
|
|
|
|
2021-07-08 16:23:18 +00:00
|
|
|
.data :
|
2008-03-13 03:48:23 +00:00
|
|
|
{
|
|
|
|
. = ALIGN(0x4);
|
2011-02-06 20:10:45 +00:00
|
|
|
*(.data*)
|
2009-04-01 03:21:18 +00:00
|
|
|
} > DRAM
|
2008-03-13 03:48:23 +00:00
|
|
|
|
|
|
|
.iram :
|
|
|
|
{
|
2011-02-06 20:10:45 +00:00
|
|
|
. = ALIGN(0x4);
|
2008-03-13 03:48:23 +00:00
|
|
|
_iramstart = .;
|
2011-12-17 01:43:32 +00:00
|
|
|
*(.icode*)
|
|
|
|
*(.irodata*)
|
|
|
|
*(.idata*)
|
2008-03-13 03:48:23 +00:00
|
|
|
_iramend = .;
|
2011-02-06 20:10:45 +00:00
|
|
|
} > ITCM AT> DRAM
|
2008-03-13 03:48:23 +00:00
|
|
|
|
|
|
|
_iramcopy = LOADADDR(.iram);
|
2011-02-06 20:10:45 +00:00
|
|
|
|
2011-02-07 04:55:31 +00:00
|
|
|
.bss (NOLOAD) :
|
|
|
|
{
|
|
|
|
. = ALIGN(0x4);
|
|
|
|
_bss_start = .;
|
|
|
|
*(.bss*)
|
|
|
|
*(COMMON)
|
|
|
|
_bss_end = .;
|
2011-12-09 20:45:14 +00:00
|
|
|
_end = .;
|
2011-02-07 04:55:31 +00:00
|
|
|
} > DRAM
|
|
|
|
|
|
|
|
.ibss (NOLOAD) :
|
2008-03-13 03:48:23 +00:00
|
|
|
{
|
|
|
|
. = ALIGN(0x4);
|
2011-02-06 20:10:45 +00:00
|
|
|
_ibss_start = .;
|
2011-12-17 01:43:32 +00:00
|
|
|
*(.ibss*)
|
2011-02-06 20:10:45 +00:00
|
|
|
_ibss_end = .;
|
2011-02-07 04:55:31 +00:00
|
|
|
} > ITCM
|
2008-03-13 03:48:23 +00:00
|
|
|
|
2011-02-06 20:10:45 +00:00
|
|
|
/* Program stack space */
|
2021-07-08 16:23:18 +00:00
|
|
|
.pro_stack (NOLOAD):
|
2008-03-13 03:48:23 +00:00
|
|
|
{
|
2011-02-06 20:10:45 +00:00
|
|
|
. = ALIGN(0x4);
|
|
|
|
*(.stack)
|
|
|
|
stackbegin = .; /* Variable for thread.c */
|
2021-07-08 16:23:18 +00:00
|
|
|
_pro_stack_end = .;
|
2011-02-06 20:10:45 +00:00
|
|
|
. += PRO_STACK_SIZE;
|
|
|
|
_pro_stack_start = .;
|
|
|
|
stackend = .; /* Variable for tread.c */
|
2011-02-07 04:55:31 +00:00
|
|
|
} > ITCM
|
2009-08-12 02:34:07 +00:00
|
|
|
|
2011-02-06 20:10:45 +00:00
|
|
|
/* IRQ stack space */
|
|
|
|
.irq_stack (NOLOAD):
|
2009-08-12 02:34:07 +00:00
|
|
|
{
|
2011-02-06 20:10:45 +00:00
|
|
|
. = ALIGN(0x4);
|
|
|
|
_irq_stack_end = .;
|
|
|
|
. += IRQ_STACK_SIZE;
|
|
|
|
_irq_stack_start = .;
|
2011-02-07 04:55:31 +00:00
|
|
|
} > ITCM
|
2011-02-06 20:10:45 +00:00
|
|
|
|
|
|
|
/* FIQ stack space */
|
|
|
|
.fiq_stack (NOLOAD):
|
2009-04-01 03:54:48 +00:00
|
|
|
{
|
|
|
|
. = ALIGN(0x4);
|
2011-02-06 20:10:45 +00:00
|
|
|
_fiq_stack_end = .;
|
|
|
|
. += FIQ_STACK_SIZE;
|
|
|
|
_fiq_stack_start = .;
|
2011-02-07 04:55:31 +00:00
|
|
|
} > ITCM
|
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
|
2021-07-08 16:23:18 +00:00
|
|
|
|
2011-02-06 20:10:45 +00:00
|
|
|
_endsdram = .;
|
|
|
|
|
2021-07-08 16:23:18 +00:00
|
|
|
#ifdef MROBE_500
|
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
|
2021-07-08 16:23:18 +00:00
|
|
|
|
2009-04-09 04:22:14 +00:00
|
|
|
/* The LCD buffer should be at the end of memory to protect against
|
2021-07-08 16:23:18 +00:00
|
|
|
* overflowing something else when the YUV blitter is fudging the screen
|
2009-04-09 04:22:14 +00:00
|
|
|
* size.
|
|
|
|
*/
|
2021-07-08 16:23: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
|
2021-07-08 16:23:18 +00:00
|
|
|
|
2009-04-21 04:29:10 +00:00
|
|
|
.lcdbuffer2 (NOLOAD) :
|
|
|
|
{
|
|
|
|
_lcdbuf2 = .;
|
|
|
|
. += LCD_BUFFER_SIZE;
|
|
|
|
} > DRAM
|
2021-07-08 16:23:18 +00:00
|
|
|
#else
|
|
|
|
.lcdbuffer (NOLOAD) :
|
|
|
|
{
|
|
|
|
. = ALIGN(32);
|
|
|
|
_lcdbuf = .;
|
|
|
|
. += LCD_BUFFER_SIZE;
|
|
|
|
} > DRAM
|
|
|
|
|
|
|
|
/* Place TTB at the end of RAM to minimize alignment losses */
|
|
|
|
.ttbtable (NOLOAD) :
|
|
|
|
{
|
|
|
|
. = ALIGN (0x4000);
|
|
|
|
_ttbstart = .;
|
|
|
|
. += TTB_SIZE;
|
|
|
|
} > DRAM
|
|
|
|
#endif
|
2008-03-13 03:48:23 +00:00
|
|
|
}
|
|
|
|
|