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 / boot.lds
blobc4223ddb6229a613a3b35642125bed7821648af0
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 BOOT_OFFSET     0x1000000
38 #define DRAMSIZE (MEMORYSIZE * 0x100000) - STUBOFFSET - BOOT_OFFSET
40 #define DRAMORIG    (0x00900000+BOOT_OFFSET) /* actually it's 0x00900000 */
41 #define IRAMORIG    0x00000000
42 #define IRAMSIZE    0x4000
43 #define FLASHORIG   0x00100000
44 #define FLASHSIZE   8M
46 /* End of the audio buffer, where the codec buffer starts */
47 #define TTB_BEGIN   (DRAMORIG + DRAMSIZE - LCD_TTB_AREA)
49 MEMORY
51    DRAM : ORIGIN = DRAMORIG, LENGTH = DRAMSIZE
52    IRAM : ORIGIN = IRAMORIG, LENGTH = IRAMSIZE
53    FLASH : ORIGIN = FLASHORIG, LENGTH = FLASHSIZE
56 SECTIONS
58     . = DRAMORIG;
60     .text : {
61         loadaddress = .;
62         _loadaddress = .;
63         *(.init.text)
64         *(.text*)
65         *(.glue_7)
66         *(.glue_7t)
67         . = ALIGN(0x4);
68     } > DRAM
70     .rodata :
71     {
72         *(.rodata)  /* problems without this, dunno why */
73         *(.rodata*)
74         *(.rodata.str1.1)
75         *(.rodata.str1.4)
76         . = ALIGN(0x4);
78         /* Pseudo-allocate the copies of the data sections */
79         _datacopy = .;
80     } > DRAM
82     .data : {
83         *(.data*)
84         . = ALIGN(0x4);
85         _dataend = . ;
86     } > DRAM
88     .vectors IRAMORIG :
89     {
90         _vectorsstart = .;
91         KEEP(*(.resetvectors));
92         *(.resetvectors);
93         KEEP(*(.vectors));
94         *(.vectors);
95         _vectorsend = .;
96     } > IRAM AT > DRAM
97     _vectorscopy = LOADADDR(.vectors);
98     
99     .iram :
100     {
101         _iramstart = .;
102         *(.icode)
103         *(.irodata*)
104         *(.idata)
105         . = ALIGN(0x4);
106         _iramend = .;
107     } > IRAM AT> DRAM
109     _iramcopy = LOADADDR(.iram);
110     
111     .ibss (NOLOAD) :
112     {
113         _iedata = .;
114         *(.ibss)
115         . = ALIGN(0x4);
116         _iend = .;
117     } > IRAM
119     .stack (NOLOAD) :
120     {
121          *(.stack)
122          stackbegin = .;
123          . += 0x2000;
124          stackend = .;
125     } > IRAM
126     
127     .irqstack (NOLOAD) :
128     {
129        *(.stack)
130        . += 0x400;
131        irq_stack = .;
132     } > IRAM
133     
134     .fiqstack (NOLOAD) :
135     {
136        *(.stack)
137        . += 0x100;
138        fiq_stack = .;
139     } > IRAM
140     
141         .bss (NOLOAD) :
142     {
143         . = ADDR(.data) + SIZEOF(.data) + SIZEOF(.vectors) + SIZEOF(.iram);
144         _edata = .;
145         *(.bss*)
146         *(COMMON)
147         . = ALIGN(0x4);
148         _end = .;
149     } > DRAM
150     
151     .ttbtable TTB_BEGIN (NOLOAD) :
152     {
153         . = ALIGN (0x4000);
154         _ttbstart = .;
155         . += TTB_SIZE;
156     } > DRAM
157     
158     /* The LCD buffer should be at the end of memory to protect against
159      * overflowing something else when the YUV blitter is fudging the screen 
160      * size.
161      */
162     
163     .lcdbuffer (NOLOAD) :
164     {
165         _lcdbuf = .;
166         . += LCD_BUFFER_SIZE;
167     } > DRAM
168     
169     .lcdbuffer2 (NOLOAD) :
170     {
171         _lcdbuf2 = .;
172         . += LCD_BUFFER_SIZE;
173     } > DRAM