Fix a bunch of boot.lds files so that they build with newer ld. The stack/bss section...
[kugel-rb.git] / firmware / target / arm / tms320dm320 / app.lds
blob4e23b533a99cb8c0d1f38684a22a4de7606c2947
1 #include "config.h"
3 ENTRY(start)
5 OUTPUT_FORMAT(elf32-littlearm)
6 OUTPUT_ARCH(arm)
7 STARTUP(target/arm/tms320dm320/crt0.o)
9 #ifdef DEBUG
10 #define STUBOFFSET 0x10000
11 #else
12 #define STUBOFFSET 0
13 #endif
15 #ifndef LCD_NATIVE_WIDTH
16 #define LCD_NATIVE_WIDTH LCD_WIDTH
17 #endif
19 #ifndef LCD_NATIVE_HEIGHT
20 #define LCD_NATIVE_HEIGHT LCD_HEIGHT
21 #endif
23 #define LCD_FUDGE       LCD_NATIVE_WIDTH%32
25 #define LCD_BUFFER_SIZE  ((LCD_NATIVE_WIDTH+LCD_FUDGE)*LCD_NATIVE_HEIGHT*2)
27 /* must be 16Kb (0x4000) aligned */
28 #define TTB_SIZE        0x4000
30 /* Give this some memory to allow it to align to the MMU boundary.
31  * Note that since there are two buffers (YUV/RGB) it calculates the approximate
32  * memory needed in steps of 1 Meg.
33  */
34 #define LCD_TTB_AREA    0x100000*((LCD_BUFFER_SIZE>>19)+1)
36 #define DRAMSIZE (MEMORYSIZE * 0x100000) - STUBOFFSET
38 #define DRAMORIG        0x00900000 + STUBOFFSET
39 #define IRAMORIG        0x00000000
40 #define IRAMSIZE        0x4000
42 /* End of the audio buffer, where the codec buffer starts */
43 #define ENDAUDIOADDR  (DRAMORIG + DRAMSIZE - PLUGIN_BUFFER_SIZE - CODEC_SIZE - LCD_TTB_AREA)
45 MEMORY
47     DRAM : ORIGIN = DRAMORIG, LENGTH = DRAMSIZE
48     IRAM : ORIGIN = IRAMORIG, LENGTH = IRAMSIZE
51 SECTIONS
53     .text :
54     {
55         loadaddress = .;
56         _loadaddress = .;
57         *(.init.text)
58         *(.text*)
59         *(.glue_7)
60         *(.glue_7t)
61         . = ALIGN(0x4);
62     } > DRAM
64     .rodata :
65     {
66         *(.rodata)  /* problems without this, dunno why */
67         *(.rodata*)
68         . = ALIGN(0x4);
69     } > DRAM
71     .data : 
72     {
73         *(.data*)
74         . = ALIGN(0x4);
75     } > DRAM
77     /DISCARD/ :
78     {
79         *(.eh_frame)
80     }
82     .vectors IRAMORIG :
83     {
84         _vectorsstart = .;
85         *(.vectors);
86         _vectorsend = .;
87     } > IRAM AT> DRAM
89     _vectorscopy = LOADADDR(.vectors);
91     .iram :
92     {
93         _iramstart = .;
94         *(.icode)
95         *(.irodata*)
96         *(.idata)
97         . = ALIGN(0x4);
98         _iramend = .;
99     } > IRAM AT> DRAM
101     _iramcopy = LOADADDR(.iram);
102     
103     .ibss (NOLOAD) :
104     {
105         _iedata = .;
106         *(.ibss)
107         . = ALIGN(0x4);
108         _iend = .;
109     } > IRAM
111     .stack (NOLOAD) :
112     {
113        *(.stack)
114        stackbegin = .;
115        . += 0x2000;
116        stackend = .;
117     } > IRAM
119     .irqstack (NOLOAD) :
120     {
121        *(.stack)
122        . += 0x400;
123        irq_stack = .;
124     } > IRAM
125     
126     .fiqstack (NOLOAD) :
127     {
128        *(.stack)
129        . += 0x400;
130        fiq_stack = .;
131     } > IRAM
132     
133     /* This overwrites the iram (in ram), so make sure that the iram is copied 
134      *  out in crt0.s before the bss section and the rest are used.
135      */
136     .bss (NOLOAD) :
137     {
138         . = ADDR(.data) + SIZEOF(.data);
139         _edata = .;
140         *(.bss*)
141         *(COMMON)
142         . = ALIGN(0x4);
143         _end = .;
144     } > DRAM
146     .audiobuf (NOLOAD) :
147     {
148         . = ALIGN(4);
149         audiobuffer = .;
150     } > DRAM
152     .audiobufend ENDAUDIOADDR (NOLOAD) :
153     {
154         audiobufend = .;
155     } > DRAM
157     .codec ENDAUDIOADDR (NOLOAD) :
158     {
159         codecbuf = .;
160         . += CODEC_SIZE;
161     } > DRAM
163     .plugin (NOLOAD) :
164     {
165         pluginbuf = .;
166         . += PLUGIN_BUFFER_SIZE;
167     } > DRAM
168     
169     .ttbtable (NOLOAD) :
170     {
171         . = ALIGN (0x4000);
172         _ttbstart = .;
173         . += TTB_SIZE;
174     } > DRAM
175     
176     /* The LCD buffer should be at the end of memory to protect against
177      * overflowing something else when the YUV blitter is fudging the screen 
178      * size.
179      */
180     
181     .lcdbuffer (NOLOAD) :
182     {
183         _lcdbuf = .;
184         . += LCD_BUFFER_SIZE;
185     } > DRAM
186     
187     .lcdbuffer2 (NOLOAD) :
188     {
189         _lcdbuf2 = .;
190         . += LCD_BUFFER_SIZE;
191     } > DRAM