summaryrefslogtreecommitdiff
path: root/firmware/boot.lds
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/boot.lds')
-rw-r--r--firmware/boot.lds454
1 files changed, 0 insertions, 454 deletions
diff --git a/firmware/boot.lds b/firmware/boot.lds
deleted file mode 100644
index e6c9326c7c..0000000000
--- a/firmware/boot.lds
+++ /dev/null
@@ -1,454 +0,0 @@
1#include "config.h"
2
3ENTRY(start)
4#ifdef CPU_COLDFIRE
5OUTPUT_FORMAT(elf32-m68k)
6INPUT(target/coldfire/crt0.o)
7#elif defined (CPU_ARM)
8OUTPUT_FORMAT(elf32-littlearm)
9OUTPUT_ARCH(arm)
10#ifdef CPU_PP
11INPUT(target/arm/crt0-pp-bl.o)
12#elif CONFIG_CPU==DM320
13INPUT(target/arm/tms320dm320/crt0.o)
14#elif CONFIG_CPU==S3C2440
15INPUT(target/arm/s3c2440/crt0.o)
16#elif defined(CPU_TCC77X)
17INPUT(target/arm/tcc77x/crt0.o)
18#elif defined(CPU_TCC780X)
19INPUT(target/arm/tcc780x/crt0.o)
20#elif CONFIG_CPU==IMX31L
21INPUT(target/arm/imx31/crt0.o)
22#else
23INPUT(target/arm/crt0.o)
24#endif
25#else
26OUTPUT_FORMAT(elf32-sh)
27INPUT(target/sh/crt0.o)
28#endif
29
30#define DRAMSIZE (MEMORYSIZE * 0x100000)
31
32#ifdef IRIVER_H100_SERIES
33#define DRAMORIG 0x31000000
34#define IRAMORIG 0x10000000
35#define IRAMSIZE 0x18000
36#define FLASHORIG 0x001f0000
37#define FLASHSIZE 2M
38#elif defined(IRIVER_H300_SERIES)
39#define DRAMORIG 0x31000000
40#define IRAMORIG 0x10000000
41#define IRAMSIZE 0x18000
42#define FLASHORIG 0x003f0000
43#define FLASHSIZE 4M
44#elif defined(IAUDIO_X5) || defined(IAUDIO_M5)
45#define DRAMORIG 0x31000000
46#define IRAMORIG 0x10000000
47#define IRAMSIZE 0x20000
48#define FLASHORIG 0x00010000
49#define FLASHSIZE 4M
50#elif defined(IAUDIO_M3)
51#define DRAMORIG 0x31000000
52#define IRAMORIG 0x10000000
53#define IRAMSIZE 0x18000
54#define FLASHORIG 0x00010000
55#define FLASHSIZE 4M
56#elif CONFIG_CPU == PP5020
57#define DRAMORIG 0x10000000
58#define IRAMORIG 0x40000000
59#define IRAMSIZE 0x18000
60#define FLASHORIG 0x001f0000
61#define FLASHSIZE 2M
62#elif (CONFIG_CPU == PP5022) || (CONFIG_CPU == PP5024)
63#define DRAMORIG 0x10000000
64#ifndef IRAMORIG
65#define IRAMORIG 0x40000000
66#endif
67#define IRAMSIZE 0x20000
68#define FLASHORIG 0x001f0000
69#define FLASHSIZE 2M
70#elif CONFIG_CPU == S3C2440
71#define DRAMORIG 0x30000000
72#define IRAMORIG 0x40000000
73#define IRAMSIZE 4K
74#define FLASHORIG 0x0000000
75#define FLASHSIZE 1M
76#elif CONFIG_CPU == DM320
77#define DRAMORIG 0x00900000
78#define IRAMORIG 0x00000000
79#define IRAMSIZE 16K
80#define FLASHORIG 0x00100000
81#define FLASHSIZE 8M
82#elif CONFIG_CPU == PP5002
83#define DRAMORIG 0x28000000
84#define IRAMORIG 0x40000000
85#define IRAMSIZE 0x18000
86#define FLASHORIG 0x001f0000
87#define FLASHSIZE 2M
88#elif CONFIG_CPU == IMX31L
89#define DRAMORIG (0x02000000-0x00100000)
90#undef DRAMSIZE
91#define DRAMSIZE (1 << 20) /* Limit 1 MB for bootloader */
92#define IRAM DRAM
93#define IRAMORIG 0x1FFFC000
94#define IRAMSIZE 16K
95#define FLASHORIG 0x0000000
96#define FLASHSIZE 1M
97#elif defined(CPU_TCC77X)
98#define DRAMORIG 0x20000000
99#define IRAMORIG 0x00000000
100#define IRAMSIZE 64K
101#define FLASHORIG 0x0000000
102#define FLASHSIZE 1M
103#elif defined(CPU_TCC780X)
104#define DRAMORIG 0x20000000
105#define IRAMORIG 0x00000000
106#define IRAMSIZE 4K
107#define FLASHORIG 0x0000000
108#define FLASHSIZE 1M
109#else
110#define DRAMORIG 0x09000000
111#define IRAMORIG 0x0f000000
112#define IRAMSIZE 0x1000
113#define FLASHORIG 0x02000000 + ROM_START
114#define FLASHSIZE 256K - ROM_START
115#endif
116
117#if defined(CPU_TCC77X) || defined(CPU_TCC780X)
118MEMORY
119{
120#ifdef TCCBOOT
121 DRAM : ORIGIN = DRAMORIG + DRAMSIZE - 0x100000, LENGTH = 0x100000
122#else
123 DRAM : ORIGIN = DRAMORIG, LENGTH = DRAMSIZE
124#endif
125 IRAM : ORIGIN = IRAMORIG, LENGTH = IRAMSIZE
126}
127#elif CONFIG_CPU == IMX31L
128MEMORY
129{
130 DRAM : ORIGIN = DRAMORIG, LENGTH = DRAMSIZE
131}
132#elif !defined(CPU_PP) && (CONFIG_CPU!=S3C2440)
133MEMORY
134{
135 DRAM : ORIGIN = DRAMORIG, LENGTH = DRAMSIZE
136 IRAM : ORIGIN = IRAMORIG, LENGTH = IRAMSIZE
137 FLASH : ORIGIN = FLASHORIG, LENGTH = FLASHSIZE
138}
139#endif
140
141SECTIONS
142#ifdef CPU_PP
143{
144 . = IRAMORIG;
145
146 .text : {
147 *(.init.text)
148 *(.text*)
149 }
150
151 .data : {
152 *(.icode)
153 *(.irodata)
154 *(.idata)
155 *(.data*)
156 _dataend = . ;
157 }
158
159 .stack :
160 {
161 *(.stack)
162 _stackbegin = .;
163 stackbegin = .;
164 . += 0x2000;
165 _stackend = .;
166 stackend = .;
167 }
168
169 /* The bss section is too large for IRAM - we just move it 16MB into the
170 DRAM */
171
172 . = (DRAMORIG+16*1024*1024);
173 .bss : {
174 _edata = .;
175 *(.bss*);
176 *(.ibss);
177 _end = .;
178 }
179}
180#elif (CONFIG_CPU==S3C2440)
181{
182 . = DRAMORIG + 0x1000000;
183
184 .text : {
185 *(.init.text)
186 *(.text*)
187 }
188
189 .data : {
190 *(.icode)
191 *(.irodata)
192 *(.idata)
193 *(.data*)
194 . = ALIGN(0x4);
195 _dataend = . ;
196 }
197
198 .stack :
199 {
200 *(.stack)
201 _stackbegin = .;
202 stackbegin = .;
203 . += 0x2000;
204 _stackend = .;
205 stackend = .;
206 }
207 .bss : {
208 _edata = .;
209 *(.bss*);
210 *(.ibss);
211 *(COMMON)
212 _end = .;
213 }
214}
215#elif defined(CPU_TCC77X) || defined(CPU_TCC780X)
216{
217 .text : {
218 *(.init.text)
219 *(.text)
220 *(.text*)
221 *(.glue_7)
222 *(.glue_7t)
223 } > DRAM
224
225 .data : {
226 *(.icode)
227 *(.irodata)
228 *(.idata)
229 *(.data*)
230 *(.rodata.*)
231 . = ALIGN(0x4);
232 _dataend = . ;
233 } > DRAM
234
235 .stack :
236 {
237 *(.stack)
238 _stackbegin = .;
239 stackbegin = .;
240 . += 0x2000;
241 _stackend = .;
242 stackend = .;
243 } > DRAM
244 .bss : {
245 _edata = .;
246 *(.bss*);
247 *(.ibss);
248 *(COMMON)
249 _end = .;
250 } > DRAM
251}
252#elif (CONFIG_CPU==DM320)
253{
254 . = DRAMORIG + 0x1000000;
255
256 .text : {
257 loadaddress = .;
258 _loadaddress = .;
259 *(.init.text)
260 *(.text*)
261 *(.glue_7)
262 *(.glue_7t)
263 . = ALIGN(0x4);
264 } > DRAM
265
266 .rodata :
267 {
268 *(.rodata) /* problems without this, dunno why */
269 *(.rodata*)
270 *(.rodata.str1.1)
271 *(.rodata.str1.4)
272 . = ALIGN(0x4);
273
274 /* Pseudo-allocate the copies of the data sections */
275 _datacopy = .;
276 } > DRAM
277
278 .data : {
279 *(.icode)
280 *(.irodata)
281 *(.idata)
282 *(.data*)
283 . = ALIGN(0x4);
284 _dataend = . ;
285 } > DRAM
286
287 .stack :
288 {
289 *(.stack)
290 _stackbegin = .;
291 stackbegin = .;
292 . += 0x2000;
293 _stackend = .;
294 stackend = .;
295 } > DRAM
296
297 .bss :
298 {
299 _edata = .;
300 *(.bss*);
301 *(.ibss);
302 *(COMMON)
303 _end = .;
304 } > DRAM
305
306 .vectors IRAMORIG :
307 {
308 _vectorsstart = .;
309 KEEP(*(.resetvectors));
310 *(.resetvectors);
311 KEEP(*(.vectors));
312 *(.vectors);
313 _vectorsend = .;
314 } AT > DRAM
315 _vectorscopy = LOADADDR(.vectors);
316}
317#elif (CONFIG_CPU==IMX31L)
318{
319 . = DRAMORIG;
320
321 .text :
322 {
323 *(.init.text)
324 *(.text*)
325 *(.icode)
326 *(.glue_7)
327 *(.glue_7t)
328 . = ALIGN(0x4);
329 } > DRAM
330
331 .rodata :
332 {
333 *(.rodata) /* problems without this, dunno why */
334 *(.rodata*)
335 *(.rodata.str1.1)
336 *(.rodata.str1.4)
337 . = ALIGN(0x4);
338
339 /* Pseudo-allocate the copies of the data sections */
340 _datacopy = .;
341 } > DRAM
342
343 .data :
344 {
345 *(.irodata)
346 *(.idata)
347 *(.data*)
348 . = ALIGN(0x4);
349 _dataend = . ;
350 } > DRAM
351
352 .stack :
353 {
354 *(.stack)
355 _stackbegin = .;
356 stackbegin = .;
357 . += 0x2000;
358 _stackend = .;
359 stackend = .;
360 } > IRAM
361
362 .bss :
363 {
364 _edata = .;
365 *(.bss*);
366 *(.ibss);
367 *(COMMON)
368 _end = .;
369 } > DRAM
370
371 .vectors 0x0 :
372 {
373 _vectorsstart = .;
374 *(.vectors);
375 KEEP(*(.vectors));
376 _vectorsend = .;
377 } AT > DRAM
378 _vectorscopy = LOADADDR(.vectors);
379}
380#else
381{
382 .vectors :
383 {
384#if defined(IAUDIO_X5) || defined(IAUDIO_M5) || defined(IAUDIO_M3)
385 *(.init.text)
386#endif
387 _datacopy = .;
388 } > FLASH
389
390 .data : AT ( _datacopy )
391 {
392 _datastart = .;
393 KEEP(*(.resetvectors));
394 *(.resetvectors);
395 KEEP(*(.vectors));
396 *(.vectors);
397 . = ALIGN(0x200);
398 *(.icode)
399 *(.irodata)
400 *(.idata)
401 *(.data*)
402 . = ALIGN(0x4);
403 _dataend = .;
404 . = ALIGN(0x10); /* Maintain proper alignment for .text section */
405 } > IRAM
406
407 /* TRICK ALERT! Newer versions of the linker don't allow output sections
408 to overlap even if one of them is empty, so advance the location pointer
409 "by hand" */
410 .text LOADADDR(.data) + SIZEOF(.data) :
411 {
412 *(.init.text)
413 *(.text*)
414 . = ALIGN(0x4);
415 } > FLASH
416
417 .rodata :
418 {
419 *(.rodata*)
420 . = ALIGN(0x4);
421 _iramcopy = .;
422 } > FLASH
423
424 .stack :
425 {
426 *(.stack)
427 _stackbegin = .;
428 stackbegin = .;
429 . += 0x2000;
430 _stackend = .;
431 stackend = .;
432 } > IRAM
433
434#if defined(IRIVER_H100_SERIES) || defined(IRIVER_H300_SERIES) \
435 || defined(IAUDIO_X5) || defined(IAUDIO_M5) || defined(IAUDIO_M3)
436 .bss DRAMORIG+0x800000:
437#else
438 .bss :
439#endif
440 {
441 _edata = .;
442 *(.ibss)
443 *(.bss*)
444 *(COMMON)
445 _end = .;
446#if defined(IRIVER_H100_SERIES) || defined(IRIVER_H300_SERIES) \
447 || defined(IAUDIO_X5) || defined(IAUDIO_M5) || defined(IAUDIO_M3)
448 } > DRAM
449#else
450 } > IRAM
451#endif
452
453}
454#endif