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