Add some screenshots for Sansa c200.
[Rockbox.git] / firmware / boot.lds
blob999e1b0f26a086194fdbcd5cb0e77d47f2a6554b
1 #include "config.h"
3 ENTRY(start)
4 #ifdef CPU_COLDFIRE
5 OUTPUT_FORMAT(elf32-m68k)
6 INPUT(target/coldfire/crt0.o)
7 #elif defined (CPU_ARM)
8 OUTPUT_FORMAT(elf32-littlearm)
9 OUTPUT_ARCH(arm)
10 #ifdef CPU_PP
11 INPUT(target/arm/crt0-pp-bl.o)
12 #else
13 INPUT(target/arm/crt0.o)
14 #endif
15 #else
16 OUTPUT_FORMAT(elf32-sh)
17 INPUT(target/sh/crt0.o)
18 #endif
20 #define DRAMSIZE (MEMORYSIZE * 0x100000)
22 #ifdef IRIVER_H100_SERIES
23 #define DRAMORIG 0x31000000
24 #define IRAMORIG 0x10000000
25 #define IRAMSIZE 0x18000
26 #define FLASHORIG 0x001f0000
27 #define FLASHSIZE 2M
28 #elif defined(IRIVER_H300_SERIES)
29 #define DRAMORIG 0x31000000
30 #define IRAMORIG 0x10000000
31 #define IRAMSIZE 0x18000
32 #define FLASHORIG 0x003f0000
33 #define FLASHSIZE 4M
34 #elif defined(IAUDIO_X5) || defined(IAUDIO_M5)
35 #define DRAMORIG 0x31000000
36 #define IRAMORIG 0x10000000
37 #define IRAMSIZE 0x20000
38 #define FLASHORIG 0x00010000
39 #define FLASHSIZE 4M
40 #elif CONFIG_CPU == PP5020
41 #define DRAMORIG 0x10000000
42 #define IRAMORIG 0x40000000
43 #define IRAMSIZE 0x18000
44 #define FLASHORIG 0x001f0000
45 #define FLASHSIZE 2M
46 #elif (CONFIG_CPU == PP5022) || (CONFIG_CPU == PP5024)
47 #define DRAMORIG 0x10000000
48 #ifndef IRAMORIG
49 #define IRAMORIG 0x40000000
50 #endif
51 #define IRAMSIZE 0x20000
52 #define FLASHORIG 0x001f0000
53 #define FLASHSIZE 2M
54 #elif CONFIG_CPU == S3C2440
55 #define DRAMORIG 0x30000000
56 #define IRAMORIG 0x40000000
57 #define IRAMSIZE 4K
58 #define FLASHORIG 0x0000000
59 #define FLASHSIZE 1M
60 #elif CONFIG_CPU == DM320
61 #define DRAMORIG 0x00900000
62 #define IRAMORIG 0x00000000
63 #define IRAMSIZE 16K
64 #define FLASHORIG 0x00100000
65 #define FLASHSIZE 8M
66 #elif CONFIG_CPU == PP5002
67 #define DRAMORIG 0x28000000
68 #define IRAMORIG 0x40000000
69 #define IRAMSIZE 0x18000
70 #define FLASHORIG 0x001f0000
71 #define FLASHSIZE 2M
72 #elif CONFIG_CPU == IMX31L
73 #define DRAMORIG 0x80000000
74 #define IRAMORIG 0x1FFFC000
75 #define IRAMSIZE 16K
76 #define FLASHORIG 0x0000000
77 #define FLASHSIZE 1M
78 #else
79 #define DRAMORIG 0x09000000
80 #define IRAMORIG 0x0f000000
81 #define IRAMSIZE 0x1000
82 #define FLASHORIG 0x02000000 + ROM_START
83 #define FLASHSIZE 256K - ROM_START
84 #endif
86 #if !defined(CPU_PP) && (CONFIG_CPU!=S3C2440) && (CONFIG_CPU!=IMX31L)
87 MEMORY
89    DRAM : ORIGIN = DRAMORIG, LENGTH = DRAMSIZE
90    IRAM : ORIGIN = IRAMORIG, LENGTH = IRAMSIZE
91    FLASH : ORIGIN = FLASHORIG, LENGTH = FLASHSIZE
93 #endif
95 SECTIONS
96 #ifdef CPU_PP
98   . = IRAMORIG;
100   .text : { 
101     *(.init.text)
102     *(.text*)
103   }
105   .data : { 
106     *(.icode)
107     *(.irodata)
108     *(.idata)
109     *(.data*)
110     _dataend = . ;
111    }
113   .stack :
114   {
115      *(.stack)
116      _stackbegin = .;
117      stackbegin = .;
118      . += 0x2000;
119      _stackend = .;
120      stackend = .;
121   }
123   /* The bss section is too large for IRAM - we just move it 16MB into the
124      DRAM */
126   . = (DRAMORIG+16*1024*1024);
127   .bss : {
128      _edata = .;
129      *(.bss*);
130      *(.ibss);
131      _end = .;
132    }
134 #elif (CONFIG_CPU==S3C2440)
136     . = DRAMORIG + 0x1000000;
138     .text : {
139         *(.init.text)
140         *(.text*)
141     }
143     .data : {
144         *(.icode)
145         *(.irodata)
146         *(.idata)
147         *(.data*)
148         . = ALIGN(0x4);
149         _dataend = . ;
150      }
152     .stack :
153     {
154          *(.stack)
155          _stackbegin = .;
156          stackbegin = .;
157          . += 0x2000;
158          _stackend = .;
159          stackend = .;
160     }
161     .bss : {
162          _edata = .;
163          *(.bss*);
164          *(.ibss);
165          _end = .;
166      }
168 #elif (CONFIG_CPU==DM320)
170     . = DRAMORIG + 0x1000000;
172     .vectors 0x0 :
173     {
174         _vectorsstart = .;
175         *(.vectors);
176         _vectorsend = .;
177     } AT> DRAM
178     _vectorscopy = LOADADDR(.vectors);
180     .text : {
181         *(.init.text)
182         *(.text*)
183         *(.glue_7)
184         *(.glue_7t)
185         . = ALIGN(0x4);
186     } > DRAM
188     .rodata :
189     {
190         *(.rodata)  /* problems without this, dunno why */
191         *(.rodata*)
192         *(.rodata.str1.1)
193         *(.rodata.str1.4)
194         . = ALIGN(0x4);
196         /* Pseudo-allocate the copies of the data sections */
197         _datacopy = .;
198     } > DRAM
200     .data : {
201         *(.icode)
202         *(.irodata)
203         *(.idata)
204         *(.data*)
205         . = ALIGN(0x4);
206         _dataend = . ;
207      } >DRAM
209     .stack :
210     {
211          *(.stack)
212          _stackbegin = .;
213          stackbegin = .;
214          . += 0x2000;
215          _stackend = .;
216          stackend = .;
217     } >DRAM
218     .bss : {
219          _edata = .;
220          *(.bss*);
221          *(.ibss);
222          _end = .;
223      }>DRAM
225 #elif (CONFIG_CPU==IMX31L)
227   . = 0x88201000;
228   .vectors : 
229   {  
230     KEEP(*(.vectors*));
231     *(.vectors*);
232   }  
233   .text : {
234     *(.init.text)
235     *(.text*)
236   }
237   .data : {
238     *(.icode)
239     *(.irodata)
240     *(.idata)
241     *(.data*)
242     _dataend = . ;
243    }
244   .stack :
245   {
246      *(.stack)
247      _stackbegin = .;
248      stackbegin = .;
249      . += 0x2000;
250      _stackend = .;
251      stackend = .;
252   }
253   .bss : {
254      _edata = .;
255      *(.bss*);
256      *(.ibss);
257      _end = .;
258    }
260 #else
262     .vectors :
263     {
264 #if defined(IAUDIO_X5) || defined(IAUDIO_M5)
265         *(.init.text)
266 #endif
267         _datacopy = .;
268     } > FLASH
270     .data : AT ( _datacopy )
271     {
272         _datastart = .;
273         KEEP(*(.resetvectors));
274         *(.resetvectors);
275         KEEP(*(.vectors));
276         *(.vectors);
277         . = ALIGN(0x200);
278         *(.icode)
279         *(.irodata)
280         *(.idata)
281         *(.data*)
282         . = ALIGN(0x4);
283         _dataend = .;
284         . = ALIGN(0x10);  /* Maintain proper alignment for .text section */
285     } > IRAM
287     /* TRICK ALERT! Newer versions of the linker don't allow output sections
288        to overlap even if one of them is empty, so advance the location pointer
289        "by hand" */
290     .text LOADADDR(.data) + SIZEOF(.data) :
291     {
292         *(.init.text)
293         *(.text*)
294         . = ALIGN(0x4);
295     } > FLASH
297     .rodata :
298     {
299         *(.rodata*)
300         . = ALIGN(0x4);
301         _iramcopy = .;
302     } > FLASH
304     .stack :
305     {
306        *(.stack)
307        _stackbegin = .;
308        stackbegin = .;
309        . += 0x2000;
310        _stackend = .;
311        stackend = .;
312     } > IRAM
314 #if defined(IRIVER_H100_SERIES) || defined(IRIVER_H300_SERIES) \
315  || defined(IAUDIO_X5) || defined(IAUDIO_M5)
316     .bss DRAMORIG+0x800000:
317 #else
318     .bss :
319 #endif
320     {
321        _edata = .;
322         *(.ibss)
323         *(.bss*)
324         *(COMMON)
325        _end = .;
326 #if defined(IRIVER_H100_SERIES) || defined(IRIVER_H300_SERIES) \
327  || defined(IAUDIO_X5) || defined(IAUDIO_M5)
328     } > DRAM
329 #else
330     } > IRAM
331 #endif
334 #endif