summaryrefslogtreecommitdiff
path: root/firmware/target/coldfire/app.lds
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/coldfire/app.lds')
-rw-r--r--firmware/target/coldfire/app.lds143
1 files changed, 143 insertions, 0 deletions
diff --git a/firmware/target/coldfire/app.lds b/firmware/target/coldfire/app.lds
new file mode 100644
index 0000000000..5364157fdd
--- /dev/null
+++ b/firmware/target/coldfire/app.lds
@@ -0,0 +1,143 @@
1#include "config.h"
2
3ENTRY(start)
4
5OUTPUT_FORMAT(elf32-m68k)
6STARTUP(target/coldfire/crt0.o)
7
8#define PLUGINSIZE PLUGIN_BUFFER_SIZE
9#define CODECSIZE CODEC_SIZE
10
11#define DRAMSIZE (MEMORYSIZE * 0x100000) - PLUGINSIZE - CODECSIZE
12
13#define DRAMORIG 0x31000000
14#define IRAMORIG 0x10000000
15#if CONFIG_CPU == MCF5250
16#define IRAMSIZE 0xc800
17#else
18#define IRAMSIZE 0xc000
19#endif
20
21/* End of the audio buffer, where the codec buffer starts */
22#define ENDAUDIOADDR (DRAMORIG + DRAMSIZE)
23
24/* Where the codec buffer ends, and the plugin buffer starts */
25#define ENDADDR (ENDAUDIOADDR + CODECSIZE)
26
27MEMORY
28{
29 DRAM : ORIGIN = DRAMORIG, LENGTH = DRAMSIZE
30 IRAM : ORIGIN = IRAMORIG, LENGTH = IRAMSIZE
31}
32
33SECTIONS
34{
35 .vectors :
36 {
37 loadaddress = .;
38 _loadaddress = .;
39 KEEP(*(.resetvectors));
40 *(.resetvectors);
41 KEEP(*(.vectors));
42 *(.vectors);
43 } > DRAM
44
45 .text :
46 {
47 . = ALIGN(0x200);
48 *(.init.text)
49 *(.text*)
50 . = ALIGN(0x4);
51 } > DRAM
52
53 .rodata :
54 {
55 *(.rodata) /* problems without this, dunno why */
56 *(.rodata*)
57 *(.rodata.str1.1)
58 *(.rodata.str1.4)
59 . = ALIGN(0x4);
60
61 /* Pseudo-allocate the copies of the data sections */
62 _datacopy = .;
63 } > DRAM
64
65 /* TRICK ALERT! For RAM execution, we put the .data section at the
66 same load address as the copy. Thus, we don't waste extra RAM
67 when we don't actually need the copy. */
68 .data : AT ( _datacopy )
69 {
70 _datastart = .;
71 *(.data*)
72 . = ALIGN(0x4);
73 _dataend = .;
74 } > DRAM
75
76 /DISCARD/ :
77 {
78 *(.eh_frame)
79 }
80
81 .iram IRAMORIG :
82 {
83 _iramstart = .;
84 *(.icode)
85 *(.irodata)
86 *(.idata)
87 _iramend = .;
88 } > IRAM AT> DRAM
89
90 _iramcopy = LOADADDR(.iram);
91 _noloaddram = LOADADDR(.iram);
92
93 .ibss (NOLOAD) :
94 {
95 _iedata = .;
96 *(.ibss)
97 . = ALIGN(0x4);
98 _iend = .;
99 } > IRAM
100
101 .stack (NOLOAD) :
102 {
103 *(.stack)
104 stackbegin = .;
105 . += 0x2000;
106 stackend = .;
107 } > IRAM
108
109 .bss _noloaddram (NOLOAD):
110 {
111 _edata = .;
112 *(.bss*)
113 *(COMMON)
114 . = ALIGN(0x4);
115 _end = .;
116 } > DRAM
117
118 .audiobuf (NOLOAD) :
119 {
120 . = ALIGN(4);
121 _audiobuffer = .;
122 audiobuffer = .;
123 } > DRAM
124
125 .audiobufend ENDAUDIOADDR (NOLOAD) :
126 {
127 audiobufend = .;
128 _audiobufend = .;
129 } > DRAM
130
131 .codec ENDAUDIOADDR (NOLOAD) :
132 {
133 codecbuf = .;
134 _codecbuf = .;
135 }
136
137 .plugin ENDADDR (NOLOAD) :
138 {
139 _pluginbuf = .;
140 pluginbuf = .;
141 }
142}
143