summaryrefslogtreecommitdiff
path: root/firmware/target/coldfire/iaudio/boot.lds
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/coldfire/iaudio/boot.lds')
-rw-r--r--firmware/target/coldfire/iaudio/boot.lds90
1 files changed, 90 insertions, 0 deletions
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
3ENTRY(start)
4OUTPUT_FORMAT(elf32-m68k)
5INPUT(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
23MEMORY
24{
25 DRAM : ORIGIN = DRAMORIG, LENGTH = DRAMSIZE
26 IRAM : ORIGIN = IRAMORIG, LENGTH = IRAMSIZE
27 FLASH : ORIGIN = FLASHORIG, LENGTH = FLASHSIZE
28}
29
30SECTIONS
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}