diff options
-rw-r--r-- | bootloader/Makefile | 2 | ||||
-rw-r--r-- | firmware/boot.lds | 454 | ||||
-rw-r--r-- | firmware/target/arm/imx31/boot.lds | 84 | ||||
-rw-r--r-- | firmware/target/arm/ipod/boot.lds | 69 | ||||
-rw-r--r-- | firmware/target/arm/iriver/boot.lds | 53 | ||||
-rw-r--r-- | firmware/target/arm/olympus/boot.lds | 53 | ||||
-rw-r--r-- | firmware/target/arm/s3c2440/boot.lds | 50 | ||||
-rw-r--r-- | firmware/target/arm/sandisk/boot.lds | 56 | ||||
-rw-r--r-- | firmware/target/arm/tcc77x/boot.lds | 62 | ||||
-rw-r--r-- | firmware/target/arm/tcc780x/boot.lds | 62 | ||||
-rw-r--r-- | firmware/target/arm/tms320dm320/boot.lds | 87 | ||||
-rw-r--r-- | firmware/target/coldfire/iaudio/boot.lds | 90 | ||||
-rw-r--r-- | firmware/target/coldfire/iriver/boot.lds | 89 | ||||
-rw-r--r-- | firmware/target/sh/archos/boot.lds | 81 |
14 files changed, 837 insertions, 455 deletions
diff --git a/bootloader/Makefile b/bootloader/Makefile index 4c63cfea18..dd60a228f5 100644 --- a/bootloader/Makefile +++ b/bootloader/Makefile | |||
@@ -11,7 +11,7 @@ INCLUDES= $(TARGET_INC) -I$(FIRMDIR)/include -I$(FIRMDIR)/export -I. -I$(OBJDIR) | |||
11 | -I$(BUILDDIR) | 11 | -I$(BUILDDIR) |
12 | 12 | ||
13 | DEPFILE = $(OBJDIR)/dep-bootloader | 13 | DEPFILE = $(OBJDIR)/dep-bootloader |
14 | LDS := $(FIRMDIR)/boot.lds | 14 | LDS := $(FIRMDIR)/target/$(CPU)/$(MANUFACTURER)/boot.lds |
15 | 15 | ||
16 | ifdef DEBUG | 16 | ifdef DEBUG |
17 | DEFINES := -DDEBUG | 17 | DEFINES := -DDEBUG |
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 | |||
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 CONFIG_CPU==DM320 | ||
13 | INPUT(target/arm/tms320dm320/crt0.o) | ||
14 | #elif CONFIG_CPU==S3C2440 | ||
15 | INPUT(target/arm/s3c2440/crt0.o) | ||
16 | #elif defined(CPU_TCC77X) | ||
17 | INPUT(target/arm/tcc77x/crt0.o) | ||
18 | #elif defined(CPU_TCC780X) | ||
19 | INPUT(target/arm/tcc780x/crt0.o) | ||
20 | #elif CONFIG_CPU==IMX31L | ||
21 | INPUT(target/arm/imx31/crt0.o) | ||
22 | #else | ||
23 | INPUT(target/arm/crt0.o) | ||
24 | #endif | ||
25 | #else | ||
26 | OUTPUT_FORMAT(elf32-sh) | ||
27 | INPUT(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) | ||
118 | MEMORY | ||
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 | ||
128 | MEMORY | ||
129 | { | ||
130 | DRAM : ORIGIN = DRAMORIG, LENGTH = DRAMSIZE | ||
131 | } | ||
132 | #elif !defined(CPU_PP) && (CONFIG_CPU!=S3C2440) | ||
133 | MEMORY | ||
134 | { | ||
135 | DRAM : ORIGIN = DRAMORIG, LENGTH = DRAMSIZE | ||
136 | IRAM : ORIGIN = IRAMORIG, LENGTH = IRAMSIZE | ||
137 | FLASH : ORIGIN = FLASHORIG, LENGTH = FLASHSIZE | ||
138 | } | ||
139 | #endif | ||
140 | |||
141 | SECTIONS | ||
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 | ||
diff --git a/firmware/target/arm/imx31/boot.lds b/firmware/target/arm/imx31/boot.lds new file mode 100644 index 0000000000..84597d5ad1 --- /dev/null +++ b/firmware/target/arm/imx31/boot.lds | |||
@@ -0,0 +1,84 @@ | |||
1 | #include "config.h" | ||
2 | |||
3 | ENTRY(start) | ||
4 | OUTPUT_FORMAT(elf32-littlearm) | ||
5 | OUTPUT_ARCH(arm) | ||
6 | INPUT(target/arm/imx31/crt0.o) | ||
7 | |||
8 | #define DRAMSIZE (1 << 20) /* Limit 1 MB for bootloader */ | ||
9 | |||
10 | #define DRAMORIG (0x02000000-0x00100000) | ||
11 | #define IRAM DRAM | ||
12 | #define IRAMORIG 0x1FFFC000 | ||
13 | #define IRAMSIZE 16K | ||
14 | #define FLASHORIG 0x0000000 | ||
15 | #define FLASHSIZE 1M | ||
16 | |||
17 | MEMORY | ||
18 | { | ||
19 | DRAM : ORIGIN = DRAMORIG, LENGTH = DRAMSIZE | ||
20 | } | ||
21 | |||
22 | SECTIONS | ||
23 | { | ||
24 | . = DRAMORIG; | ||
25 | |||
26 | .text : | ||
27 | { | ||
28 | *(.init.text) | ||
29 | *(.text*) | ||
30 | *(.icode) | ||
31 | *(.glue_7) | ||
32 | *(.glue_7t) | ||
33 | . = ALIGN(0x4); | ||
34 | } > DRAM | ||
35 | |||
36 | .rodata : | ||
37 | { | ||
38 | *(.rodata) /* problems without this, dunno why */ | ||
39 | *(.rodata*) | ||
40 | *(.rodata.str1.1) | ||
41 | *(.rodata.str1.4) | ||
42 | . = ALIGN(0x4); | ||
43 | |||
44 | /* Pseudo-allocate the copies of the data sections */ | ||
45 | _datacopy = .; | ||
46 | } > DRAM | ||
47 | |||
48 | .data : | ||
49 | { | ||
50 | *(.irodata) | ||
51 | *(.idata) | ||
52 | *(.data*) | ||
53 | . = ALIGN(0x4); | ||
54 | _dataend = . ; | ||
55 | } > DRAM | ||
56 | |||
57 | .stack : | ||
58 | { | ||
59 | *(.stack) | ||
60 | _stackbegin = .; | ||
61 | stackbegin = .; | ||
62 | . += 0x2000; | ||
63 | _stackend = .; | ||
64 | stackend = .; | ||
65 | } > IRAM | ||
66 | |||
67 | .bss : | ||
68 | { | ||
69 | _edata = .; | ||
70 | *(.bss*); | ||
71 | *(.ibss); | ||
72 | *(COMMON) | ||
73 | _end = .; | ||
74 | } > DRAM | ||
75 | |||
76 | .vectors 0x0 : | ||
77 | { | ||
78 | _vectorsstart = .; | ||
79 | *(.vectors); | ||
80 | KEEP(*(.vectors)); | ||
81 | _vectorsend = .; | ||
82 | } AT > DRAM | ||
83 | _vectorscopy = LOADADDR(.vectors); | ||
84 | } | ||
diff --git a/firmware/target/arm/ipod/boot.lds b/firmware/target/arm/ipod/boot.lds new file mode 100644 index 0000000000..2f2f4f91a1 --- /dev/null +++ b/firmware/target/arm/ipod/boot.lds | |||
@@ -0,0 +1,69 @@ | |||
1 | #include "config.h" | ||
2 | |||
3 | ENTRY(start) | ||
4 | OUTPUT_FORMAT(elf32-littlearm) | ||
5 | OUTPUT_ARCH(arm) | ||
6 | INPUT(target/arm/crt0-pp-bl.o) | ||
7 | |||
8 | #define DRAMSIZE (MEMORYSIZE * 0x100000) | ||
9 | |||
10 | #if CONFIG_CPU == PP5020 | ||
11 | #define DRAMORIG 0x10000000 | ||
12 | #define IRAMORIG 0x40000000 | ||
13 | #define IRAMSIZE 0x18000 | ||
14 | #define FLASHORIG 0x001f0000 | ||
15 | #define FLASHSIZE 2M | ||
16 | #elif (CONFIG_CPU == PP5022) || (CONFIG_CPU == PP5024) | ||
17 | #define DRAMORIG 0x10000000 | ||
18 | #ifndef IRAMORIG | ||
19 | #define IRAMORIG 0x40000000 | ||
20 | #endif | ||
21 | #define IRAMSIZE 0x20000 | ||
22 | #define FLASHORIG 0x001f0000 | ||
23 | #define FLASHSIZE 2M | ||
24 | #elif CONFIG_CPU == PP5002 | ||
25 | #define DRAMORIG 0x28000000 | ||
26 | #define IRAMORIG 0x40000000 | ||
27 | #define IRAMSIZE 0x18000 | ||
28 | #define FLASHORIG 0x001f0000 | ||
29 | #define FLASHSIZE 2M | ||
30 | #endif | ||
31 | |||
32 | SECTIONS | ||
33 | { | ||
34 | . = IRAMORIG; | ||
35 | |||
36 | .text : { | ||
37 | *(.init.text) | ||
38 | *(.text*) | ||
39 | } | ||
40 | |||
41 | .data : { | ||
42 | *(.icode) | ||
43 | *(.irodata) | ||
44 | *(.idata) | ||
45 | *(.data*) | ||
46 | _dataend = . ; | ||
47 | } | ||
48 | |||
49 | .stack : | ||
50 | { | ||
51 | *(.stack) | ||
52 | _stackbegin = .; | ||
53 | stackbegin = .; | ||
54 | . += 0x2000; | ||
55 | _stackend = .; | ||
56 | stackend = .; | ||
57 | } | ||
58 | |||
59 | /* The bss section is too large for IRAM - we just move it 16MB into the | ||
60 | DRAM */ | ||
61 | |||
62 | . = (DRAMORIG+16*1024*1024); | ||
63 | .bss : { | ||
64 | _edata = .; | ||
65 | *(.bss*); | ||
66 | *(.ibss); | ||
67 | _end = .; | ||
68 | } | ||
69 | } | ||
diff --git a/firmware/target/arm/iriver/boot.lds b/firmware/target/arm/iriver/boot.lds new file mode 100644 index 0000000000..5fbe999333 --- /dev/null +++ b/firmware/target/arm/iriver/boot.lds | |||
@@ -0,0 +1,53 @@ | |||
1 | #include "config.h" | ||
2 | |||
3 | ENTRY(start) | ||
4 | OUTPUT_FORMAT(elf32-littlearm) | ||
5 | OUTPUT_ARCH(arm) | ||
6 | INPUT(target/arm/crt0-pp-bl.o) | ||
7 | |||
8 | #define DRAMSIZE (MEMORYSIZE * 0x100000) | ||
9 | |||
10 | #define DRAMORIG 0x10000000 | ||
11 | #define IRAMORIG 0x40000000 | ||
12 | #define IRAMSIZE 0x18000 | ||
13 | #define FLASHORIG 0x001f0000 | ||
14 | #define FLASHSIZE 2M | ||
15 | |||
16 | SECTIONS | ||
17 | { | ||
18 | . = IRAMORIG; | ||
19 | |||
20 | .text : { | ||
21 | *(.init.text) | ||
22 | *(.text*) | ||
23 | } | ||
24 | |||
25 | .data : { | ||
26 | *(.icode) | ||
27 | *(.irodata) | ||
28 | *(.idata) | ||
29 | *(.data*) | ||
30 | _dataend = . ; | ||
31 | } | ||
32 | |||
33 | .stack : | ||
34 | { | ||
35 | *(.stack) | ||
36 | _stackbegin = .; | ||
37 | stackbegin = .; | ||
38 | . += 0x2000; | ||
39 | _stackend = .; | ||
40 | stackend = .; | ||
41 | } | ||
42 | |||
43 | /* The bss section is too large for IRAM - we just move it 16MB into the | ||
44 | DRAM */ | ||
45 | |||
46 | . = (DRAMORIG+16*1024*1024); | ||
47 | .bss : { | ||
48 | _edata = .; | ||
49 | *(.bss*); | ||
50 | *(.ibss); | ||
51 | _end = .; | ||
52 | } | ||
53 | } | ||
diff --git a/firmware/target/arm/olympus/boot.lds b/firmware/target/arm/olympus/boot.lds new file mode 100644 index 0000000000..5fbe999333 --- /dev/null +++ b/firmware/target/arm/olympus/boot.lds | |||
@@ -0,0 +1,53 @@ | |||
1 | #include "config.h" | ||
2 | |||
3 | ENTRY(start) | ||
4 | OUTPUT_FORMAT(elf32-littlearm) | ||
5 | OUTPUT_ARCH(arm) | ||
6 | INPUT(target/arm/crt0-pp-bl.o) | ||
7 | |||
8 | #define DRAMSIZE (MEMORYSIZE * 0x100000) | ||
9 | |||
10 | #define DRAMORIG 0x10000000 | ||
11 | #define IRAMORIG 0x40000000 | ||
12 | #define IRAMSIZE 0x18000 | ||
13 | #define FLASHORIG 0x001f0000 | ||
14 | #define FLASHSIZE 2M | ||
15 | |||
16 | SECTIONS | ||
17 | { | ||
18 | . = IRAMORIG; | ||
19 | |||
20 | .text : { | ||
21 | *(.init.text) | ||
22 | *(.text*) | ||
23 | } | ||
24 | |||
25 | .data : { | ||
26 | *(.icode) | ||
27 | *(.irodata) | ||
28 | *(.idata) | ||
29 | *(.data*) | ||
30 | _dataend = . ; | ||
31 | } | ||
32 | |||
33 | .stack : | ||
34 | { | ||
35 | *(.stack) | ||
36 | _stackbegin = .; | ||
37 | stackbegin = .; | ||
38 | . += 0x2000; | ||
39 | _stackend = .; | ||
40 | stackend = .; | ||
41 | } | ||
42 | |||
43 | /* The bss section is too large for IRAM - we just move it 16MB into the | ||
44 | DRAM */ | ||
45 | |||
46 | . = (DRAMORIG+16*1024*1024); | ||
47 | .bss : { | ||
48 | _edata = .; | ||
49 | *(.bss*); | ||
50 | *(.ibss); | ||
51 | _end = .; | ||
52 | } | ||
53 | } | ||
diff --git a/firmware/target/arm/s3c2440/boot.lds b/firmware/target/arm/s3c2440/boot.lds new file mode 100644 index 0000000000..cc20fbe86f --- /dev/null +++ b/firmware/target/arm/s3c2440/boot.lds | |||
@@ -0,0 +1,50 @@ | |||
1 | #include "config.h" | ||
2 | |||
3 | ENTRY(start) | ||
4 | OUTPUT_FORMAT(elf32-littlearm) | ||
5 | OUTPUT_ARCH(arm) | ||
6 | INPUT(target/arm/s3c2440/crt0.o) | ||
7 | |||
8 | #define DRAMSIZE (MEMORYSIZE * 0x100000) | ||
9 | |||
10 | #define DRAMORIG 0x30000000 | ||
11 | #define IRAMORIG 0x40000000 | ||
12 | #define IRAMSIZE 4K | ||
13 | #define FLASHORIG 0x0000000 | ||
14 | #define FLASHSIZE 1M | ||
15 | |||
16 | SECTIONS | ||
17 | { | ||
18 | . = DRAMORIG + 0x1000000; | ||
19 | |||
20 | .text : { | ||
21 | *(.init.text) | ||
22 | *(.text*) | ||
23 | } | ||
24 | |||
25 | .data : { | ||
26 | *(.icode) | ||
27 | *(.irodata) | ||
28 | *(.idata) | ||
29 | *(.data*) | ||
30 | . = ALIGN(0x4); | ||
31 | _dataend = . ; | ||
32 | } | ||
33 | |||
34 | .stack : | ||
35 | { | ||
36 | *(.stack) | ||
37 | _stackbegin = .; | ||
38 | stackbegin = .; | ||
39 | . += 0x2000; | ||
40 | _stackend = .; | ||
41 | stackend = .; | ||
42 | } | ||
43 | .bss : { | ||
44 | _edata = .; | ||
45 | *(.bss*); | ||
46 | *(.ibss); | ||
47 | *(COMMON) | ||
48 | _end = .; | ||
49 | } | ||
50 | } | ||
diff --git a/firmware/target/arm/sandisk/boot.lds b/firmware/target/arm/sandisk/boot.lds new file mode 100644 index 0000000000..a087a7250d --- /dev/null +++ b/firmware/target/arm/sandisk/boot.lds | |||
@@ -0,0 +1,56 @@ | |||
1 | #include "config.h" | ||
2 | |||
3 | ENTRY(start) | ||
4 | OUTPUT_FORMAT(elf32-littlearm) | ||
5 | OUTPUT_ARCH(arm) | ||
6 | INPUT(target/arm/crt0-pp-bl.o) | ||
7 | |||
8 | #define DRAMSIZE (MEMORYSIZE * 0x100000) | ||
9 | |||
10 | #define DRAMORIG 0x10000000 | ||
11 | #ifndef IRAMORIG | ||
12 | #define IRAMORIG 0x40000000 | ||
13 | #endif | ||
14 | #define IRAMSIZE 0x20000 | ||
15 | #define FLASHORIG 0x001f0000 | ||
16 | #define FLASHSIZE 2M | ||
17 | |||
18 | |||
19 | SECTIONS | ||
20 | { | ||
21 | . = IRAMORIG; | ||
22 | |||
23 | .text : { | ||
24 | *(.init.text) | ||
25 | *(.text*) | ||
26 | } | ||
27 | |||
28 | .data : { | ||
29 | *(.icode) | ||
30 | *(.irodata) | ||
31 | *(.idata) | ||
32 | *(.data*) | ||
33 | _dataend = . ; | ||
34 | } | ||
35 | |||
36 | .stack : | ||
37 | { | ||
38 | *(.stack) | ||
39 | _stackbegin = .; | ||
40 | stackbegin = .; | ||
41 | . += 0x2000; | ||
42 | _stackend = .; | ||
43 | stackend = .; | ||
44 | } | ||
45 | |||
46 | /* The bss section is too large for IRAM - we just move it 16MB into the | ||
47 | DRAM */ | ||
48 | |||
49 | . = (DRAMORIG+16*1024*1024); | ||
50 | .bss : { | ||
51 | _edata = .; | ||
52 | *(.bss*); | ||
53 | *(.ibss); | ||
54 | _end = .; | ||
55 | } | ||
56 | } | ||
diff --git a/firmware/target/arm/tcc77x/boot.lds b/firmware/target/arm/tcc77x/boot.lds new file mode 100644 index 0000000000..aa4b05c5ae --- /dev/null +++ b/firmware/target/arm/tcc77x/boot.lds | |||
@@ -0,0 +1,62 @@ | |||
1 | #include "config.h" | ||
2 | |||
3 | ENTRY(start) | ||
4 | OUTPUT_FORMAT(elf32-littlearm) | ||
5 | OUTPUT_ARCH(arm) | ||
6 | INPUT(target/arm/tcc77x/crt0.o) | ||
7 | |||
8 | #define DRAMSIZE (MEMORYSIZE * 0x100000) | ||
9 | |||
10 | #define DRAMORIG 0x20000000 | ||
11 | #define IRAMORIG 0x00000000 | ||
12 | #define IRAMSIZE 64K | ||
13 | #define FLASHORIG 0x0000000 | ||
14 | #define FLASHSIZE 1M | ||
15 | |||
16 | MEMORY | ||
17 | { | ||
18 | #ifdef TCCBOOT | ||
19 | DRAM : ORIGIN = DRAMORIG + DRAMSIZE - 0x100000, LENGTH = 0x100000 | ||
20 | #else | ||
21 | DRAM : ORIGIN = DRAMORIG, LENGTH = DRAMSIZE | ||
22 | #endif | ||
23 | IRAM : ORIGIN = IRAMORIG, LENGTH = IRAMSIZE | ||
24 | } | ||
25 | |||
26 | SECTIONS | ||
27 | { | ||
28 | .text : { | ||
29 | *(.init.text) | ||
30 | *(.text) | ||
31 | *(.text*) | ||
32 | *(.glue_7) | ||
33 | *(.glue_7t) | ||
34 | } > DRAM | ||
35 | |||
36 | .data : { | ||
37 | *(.icode) | ||
38 | *(.irodata) | ||
39 | *(.idata) | ||
40 | *(.data*) | ||
41 | *(.rodata.*) | ||
42 | . = ALIGN(0x4); | ||
43 | _dataend = . ; | ||
44 | } > DRAM | ||
45 | |||
46 | .stack : | ||
47 | { | ||
48 | *(.stack) | ||
49 | _stackbegin = .; | ||
50 | stackbegin = .; | ||
51 | . += 0x2000; | ||
52 | _stackend = .; | ||
53 | stackend = .; | ||
54 | } > DRAM | ||
55 | .bss : { | ||
56 | _edata = .; | ||
57 | *(.bss*); | ||
58 | *(.ibss); | ||
59 | *(COMMON) | ||
60 | _end = .; | ||
61 | } > DRAM | ||
62 | } | ||
diff --git a/firmware/target/arm/tcc780x/boot.lds b/firmware/target/arm/tcc780x/boot.lds new file mode 100644 index 0000000000..657f31901a --- /dev/null +++ b/firmware/target/arm/tcc780x/boot.lds | |||
@@ -0,0 +1,62 @@ | |||
1 | #include "config.h" | ||
2 | |||
3 | ENTRY(start) | ||
4 | OUTPUT_FORMAT(elf32-littlearm) | ||
5 | OUTPUT_ARCH(arm) | ||
6 | INPUT(target/arm/tcc780x/crt0.o) | ||
7 | |||
8 | #define DRAMSIZE (MEMORYSIZE * 0x100000) | ||
9 | |||
10 | #define DRAMORIG 0x20000000 | ||
11 | #define IRAMORIG 0x00000000 | ||
12 | #define IRAMSIZE 4K | ||
13 | #define FLASHORIG 0x0000000 | ||
14 | #define FLASHSIZE 1M | ||
15 | |||
16 | MEMORY | ||
17 | { | ||
18 | #ifdef TCCBOOT | ||
19 | DRAM : ORIGIN = DRAMORIG + DRAMSIZE - 0x100000, LENGTH = 0x100000 | ||
20 | #else | ||
21 | DRAM : ORIGIN = DRAMORIG, LENGTH = DRAMSIZE | ||
22 | #endif | ||
23 | IRAM : ORIGIN = IRAMORIG, LENGTH = IRAMSIZE | ||
24 | } | ||
25 | |||
26 | SECTIONS | ||
27 | { | ||
28 | .text : { | ||
29 | *(.init.text) | ||
30 | *(.text) | ||
31 | *(.text*) | ||
32 | *(.glue_7) | ||
33 | *(.glue_7t) | ||
34 | } > DRAM | ||
35 | |||
36 | .data : { | ||
37 | *(.icode) | ||
38 | *(.irodata) | ||
39 | *(.idata) | ||
40 | *(.data*) | ||
41 | *(.rodata.*) | ||
42 | . = ALIGN(0x4); | ||
43 | _dataend = . ; | ||
44 | } > DRAM | ||
45 | |||
46 | .stack : | ||
47 | { | ||
48 | *(.stack) | ||
49 | _stackbegin = .; | ||
50 | stackbegin = .; | ||
51 | . += 0x2000; | ||
52 | _stackend = .; | ||
53 | stackend = .; | ||
54 | } > DRAM | ||
55 | .bss : { | ||
56 | _edata = .; | ||
57 | *(.bss*); | ||
58 | *(.ibss); | ||
59 | *(COMMON) | ||
60 | _end = .; | ||
61 | } > DRAM | ||
62 | } | ||
diff --git a/firmware/target/arm/tms320dm320/boot.lds b/firmware/target/arm/tms320dm320/boot.lds new file mode 100644 index 0000000000..8fb40ae135 --- /dev/null +++ b/firmware/target/arm/tms320dm320/boot.lds | |||
@@ -0,0 +1,87 @@ | |||
1 | #include "config.h" | ||
2 | |||
3 | ENTRY(start) | ||
4 | OUTPUT_FORMAT(elf32-littlearm) | ||
5 | OUTPUT_ARCH(arm) | ||
6 | INPUT(target/arm/tms320dm320/crt0.o) | ||
7 | |||
8 | #define DRAMSIZE (MEMORYSIZE * 0x100000) | ||
9 | |||
10 | #define DRAMORIG 0x00900000 | ||
11 | #define IRAMORIG 0x00000000 | ||
12 | #define IRAMSIZE 16K | ||
13 | #define FLASHORIG 0x00100000 | ||
14 | #define FLASHSIZE 8M | ||
15 | |||
16 | MEMORY | ||
17 | { | ||
18 | DRAM : ORIGIN = DRAMORIG, LENGTH = DRAMSIZE | ||
19 | IRAM : ORIGIN = IRAMORIG, LENGTH = IRAMSIZE | ||
20 | FLASH : ORIGIN = FLASHORIG, LENGTH = FLASHSIZE | ||
21 | } | ||
22 | |||
23 | SECTIONS | ||
24 | { | ||
25 | . = DRAMORIG + 0x1000000; | ||
26 | |||
27 | .text : { | ||
28 | loadaddress = .; | ||
29 | _loadaddress = .; | ||
30 | *(.init.text) | ||
31 | *(.text*) | ||
32 | *(.glue_7) | ||
33 | *(.glue_7t) | ||
34 | . = ALIGN(0x4); | ||
35 | } > DRAM | ||
36 | |||
37 | .rodata : | ||
38 | { | ||
39 | *(.rodata) /* problems without this, dunno why */ | ||
40 | *(.rodata*) | ||
41 | *(.rodata.str1.1) | ||
42 | *(.rodata.str1.4) | ||
43 | . = ALIGN(0x4); | ||
44 | |||
45 | /* Pseudo-allocate the copies of the data sections */ | ||
46 | _datacopy = .; | ||
47 | } > DRAM | ||
48 | |||
49 | .data : { | ||
50 | *(.icode) | ||
51 | *(.irodata) | ||
52 | *(.idata) | ||
53 | *(.data*) | ||
54 | . = ALIGN(0x4); | ||
55 | _dataend = . ; | ||
56 | } > DRAM | ||
57 | |||
58 | .stack : | ||
59 | { | ||
60 | *(.stack) | ||
61 | _stackbegin = .; | ||
62 | stackbegin = .; | ||
63 | . += 0x2000; | ||
64 | _stackend = .; | ||
65 | stackend = .; | ||
66 | } > DRAM | ||
67 | |||
68 | .bss : | ||
69 | { | ||
70 | _edata = .; | ||
71 | *(.bss*); | ||
72 | *(.ibss); | ||
73 | *(COMMON) | ||
74 | _end = .; | ||
75 | } > DRAM | ||
76 | |||
77 | .vectors IRAMORIG : | ||
78 | { | ||
79 | _vectorsstart = .; | ||
80 | KEEP(*(.resetvectors)); | ||
81 | *(.resetvectors); | ||
82 | KEEP(*(.vectors)); | ||
83 | *(.vectors); | ||
84 | _vectorsend = .; | ||
85 | } AT > DRAM | ||
86 | _vectorscopy = LOADADDR(.vectors); | ||
87 | } | ||
diff --git a/firmware/target/coldfire/iaudio/boot.lds b/firmware/target/coldfire/iaudio/boot.lds new file mode 100644 index 0000000000..17b1457747 --- /dev/null +++ b/firmware/target/coldfire/iaudio/boot.lds | |||
@@ -0,0 +1,90 @@ | |||
1 | #include "config.h" | ||
2 | |||
3 | ENTRY(start) | ||
4 | OUTPUT_FORMAT(elf32-m68k) | ||
5 | INPUT(target/coldfire/crt0.o) | ||
6 | |||
7 | #define DRAMSIZE (MEMORYSIZE * 0x100000) | ||
8 | |||
9 | #if defined(IAUDIO_X5) || defined(IAUDIO_M5) | ||
10 | #define DRAMORIG 0x31000000 | ||
11 | #define IRAMORIG 0x10000000 | ||
12 | #define IRAMSIZE 0x20000 | ||
13 | #define FLASHORIG 0x00010000 | ||
14 | #define FLASHSIZE 4M | ||
15 | #elif defined(IAUDIO_M3) | ||
16 | #define DRAMORIG 0x31000000 | ||
17 | #define IRAMORIG 0x10000000 | ||
18 | #define IRAMSIZE 0x18000 | ||
19 | #define FLASHORIG 0x00010000 | ||
20 | #define FLASHSIZE 4M | ||
21 | #endif | ||
22 | |||
23 | MEMORY | ||
24 | { | ||
25 | DRAM : ORIGIN = DRAMORIG, LENGTH = DRAMSIZE | ||
26 | IRAM : ORIGIN = IRAMORIG, LENGTH = IRAMSIZE | ||
27 | FLASH : ORIGIN = FLASHORIG, LENGTH = FLASHSIZE | ||
28 | } | ||
29 | |||
30 | SECTIONS | ||
31 | { | ||
32 | .vectors : | ||
33 | { | ||
34 | *(.init.text) | ||
35 | _datacopy = .; | ||
36 | } > FLASH | ||
37 | |||
38 | .data : AT ( _datacopy ) | ||
39 | { | ||
40 | _datastart = .; | ||
41 | KEEP(*(.resetvectors)); | ||
42 | *(.resetvectors); | ||
43 | KEEP(*(.vectors)); | ||
44 | *(.vectors); | ||
45 | . = ALIGN(0x200); | ||
46 | *(.icode) | ||
47 | *(.irodata) | ||
48 | *(.idata) | ||
49 | *(.data*) | ||
50 | . = ALIGN(0x4); | ||
51 | _dataend = .; | ||
52 | . = ALIGN(0x10); /* Maintain proper alignment for .text section */ | ||
53 | } > IRAM | ||
54 | |||
55 | /* TRICK ALERT! Newer versions of the linker don't allow output sections | ||
56 | to overlap even if one of them is empty, so advance the location pointer | ||
57 | "by hand" */ | ||
58 | .text LOADADDR(.data) + SIZEOF(.data) : | ||
59 | { | ||
60 | *(.init.text) | ||
61 | *(.text*) | ||
62 | . = ALIGN(0x4); | ||
63 | } > FLASH | ||
64 | |||
65 | .rodata : | ||
66 | { | ||
67 | *(.rodata*) | ||
68 | . = ALIGN(0x4); | ||
69 | _iramcopy = .; | ||
70 | } > FLASH | ||
71 | |||
72 | .stack : | ||
73 | { | ||
74 | *(.stack) | ||
75 | _stackbegin = .; | ||
76 | stackbegin = .; | ||
77 | . += 0x2000; | ||
78 | _stackend = .; | ||
79 | stackend = .; | ||
80 | } > IRAM | ||
81 | |||
82 | .bss DRAMORIG+0x800000: | ||
83 | { | ||
84 | _edata = .; | ||
85 | *(.ibss) | ||
86 | *(.bss*) | ||
87 | *(COMMON) | ||
88 | _end = .; | ||
89 | } > DRAM | ||
90 | } | ||
diff --git a/firmware/target/coldfire/iriver/boot.lds b/firmware/target/coldfire/iriver/boot.lds new file mode 100644 index 0000000000..4e2619f764 --- /dev/null +++ b/firmware/target/coldfire/iriver/boot.lds | |||
@@ -0,0 +1,89 @@ | |||
1 | #include "config.h" | ||
2 | |||
3 | ENTRY(start) | ||
4 | OUTPUT_FORMAT(elf32-m68k) | ||
5 | INPUT(target/coldfire/crt0.o) | ||
6 | |||
7 | #define DRAMSIZE (MEMORYSIZE * 0x100000) | ||
8 | |||
9 | #ifdef IRIVER_H100_SERIES | ||
10 | #define DRAMORIG 0x31000000 | ||
11 | #define IRAMORIG 0x10000000 | ||
12 | #define IRAMSIZE 0x18000 | ||
13 | #define FLASHORIG 0x001f0000 | ||
14 | #define FLASHSIZE 2M | ||
15 | #elif defined(IRIVER_H300_SERIES) | ||
16 | #define DRAMORIG 0x31000000 | ||
17 | #define IRAMORIG 0x10000000 | ||
18 | #define IRAMSIZE 0x18000 | ||
19 | #define FLASHORIG 0x003f0000 | ||
20 | #define FLASHSIZE 4M | ||
21 | #endif | ||
22 | |||
23 | MEMORY | ||
24 | { | ||
25 | DRAM : ORIGIN = DRAMORIG, LENGTH = DRAMSIZE | ||
26 | IRAM : ORIGIN = IRAMORIG, LENGTH = IRAMSIZE | ||
27 | FLASH : ORIGIN = FLASHORIG, LENGTH = FLASHSIZE | ||
28 | } | ||
29 | |||
30 | SECTIONS | ||
31 | { | ||
32 | .vectors : | ||
33 | { | ||
34 | _datacopy = .; | ||
35 | } > FLASH | ||
36 | |||
37 | .data : AT ( _datacopy ) | ||
38 | { | ||
39 | _datastart = .; | ||
40 | KEEP(*(.resetvectors)); | ||
41 | *(.resetvectors); | ||
42 | KEEP(*(.vectors)); | ||
43 | *(.vectors); | ||
44 | . = ALIGN(0x200); | ||
45 | *(.icode) | ||
46 | *(.irodata) | ||
47 | *(.idata) | ||
48 | *(.data*) | ||
49 | . = ALIGN(0x4); | ||
50 | _dataend = .; | ||
51 | . = ALIGN(0x10); /* Maintain proper alignment for .text section */ | ||
52 | } > IRAM | ||
53 | |||
54 | /* TRICK ALERT! Newer versions of the linker don't allow output sections | ||
55 | to overlap even if one of them is empty, so advance the location pointer | ||
56 | "by hand" */ | ||
57 | .text LOADADDR(.data) + SIZEOF(.data) : | ||
58 | { | ||
59 | *(.init.text) | ||
60 | *(.text*) | ||
61 | . = ALIGN(0x4); | ||
62 | } > FLASH | ||
63 | |||
64 | .rodata : | ||
65 | { | ||
66 | *(.rodata*) | ||
67 | . = ALIGN(0x4); | ||
68 | _iramcopy = .; | ||
69 | } > FLASH | ||
70 | |||
71 | .stack : | ||
72 | { | ||
73 | *(.stack) | ||
74 | _stackbegin = .; | ||
75 | stackbegin = .; | ||
76 | . += 0x2000; | ||
77 | _stackend = .; | ||
78 | stackend = .; | ||
79 | } > IRAM | ||
80 | |||
81 | .bss DRAMORIG+0x800000: | ||
82 | { | ||
83 | _edata = .; | ||
84 | *(.ibss) | ||
85 | *(.bss*) | ||
86 | *(COMMON) | ||
87 | _end = .; | ||
88 | } > DRAM | ||
89 | } | ||
diff --git a/firmware/target/sh/archos/boot.lds b/firmware/target/sh/archos/boot.lds new file mode 100644 index 0000000000..8002f6e87f --- /dev/null +++ b/firmware/target/sh/archos/boot.lds | |||
@@ -0,0 +1,81 @@ | |||
1 | #include "config.h" | ||
2 | |||
3 | ENTRY(start) | ||
4 | OUTPUT_FORMAT(elf32-sh) | ||
5 | INPUT(target/sh/crt0.o) | ||
6 | |||
7 | #define DRAMSIZE (MEMORYSIZE * 0x100000) | ||
8 | |||
9 | #define DRAMORIG 0x09000000 | ||
10 | #define IRAMORIG 0x0f000000 | ||
11 | #define IRAMSIZE 0x1000 | ||
12 | #define FLASHORIG 0x02000000 + ROM_START | ||
13 | #define FLASHSIZE 256K - ROM_START | ||
14 | |||
15 | MEMORY | ||
16 | { | ||
17 | DRAM : ORIGIN = DRAMORIG, LENGTH = DRAMSIZE | ||
18 | IRAM : ORIGIN = IRAMORIG, LENGTH = IRAMSIZE | ||
19 | FLASH : ORIGIN = FLASHORIG, LENGTH = FLASHSIZE | ||
20 | } | ||
21 | |||
22 | SECTIONS | ||
23 | { | ||
24 | .vectors : | ||
25 | { | ||
26 | _datacopy = .; | ||
27 | } > FLASH | ||
28 | |||
29 | .data : AT ( _datacopy ) | ||
30 | { | ||
31 | _datastart = .; | ||
32 | KEEP(*(.resetvectors)); | ||
33 | *(.resetvectors); | ||
34 | KEEP(*(.vectors)); | ||
35 | *(.vectors); | ||
36 | . = ALIGN(0x200); | ||
37 | *(.icode) | ||
38 | *(.irodata) | ||
39 | *(.idata) | ||
40 | *(.data*) | ||
41 | . = ALIGN(0x4); | ||
42 | _dataend = .; | ||
43 | . = ALIGN(0x10); /* Maintain proper alignment for .text section */ | ||
44 | } > IRAM | ||
45 | |||
46 | /* TRICK ALERT! Newer versions of the linker don't allow output sections | ||
47 | to overlap even if one of them is empty, so advance the location pointer | ||
48 | "by hand" */ | ||
49 | .text LOADADDR(.data) + SIZEOF(.data) : | ||
50 | { | ||
51 | *(.init.text) | ||
52 | *(.text*) | ||
53 | . = ALIGN(0x4); | ||
54 | } > FLASH | ||
55 | |||
56 | .rodata : | ||
57 | { | ||
58 | *(.rodata*) | ||
59 | . = ALIGN(0x4); | ||
60 | _iramcopy = .; | ||
61 | } > FLASH | ||
62 | |||
63 | .stack : | ||
64 | { | ||
65 | *(.stack) | ||
66 | _stackbegin = .; | ||
67 | stackbegin = .; | ||
68 | . += 0x2000; | ||
69 | _stackend = .; | ||
70 | stackend = .; | ||
71 | } > IRAM | ||
72 | |||
73 | .bss : | ||
74 | { | ||
75 | _edata = .; | ||
76 | *(.ibss) | ||
77 | *(.bss*) | ||
78 | *(COMMON) | ||
79 | _end = .; | ||
80 | } > IRAM | ||
81 | } | ||