summaryrefslogtreecommitdiff
path: root/firmware/target/arm/tcc780x/app.lds
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/arm/tcc780x/app.lds')
-rw-r--r--firmware/target/arm/tcc780x/app.lds170
1 files changed, 170 insertions, 0 deletions
diff --git a/firmware/target/arm/tcc780x/app.lds b/firmware/target/arm/tcc780x/app.lds
new file mode 100644
index 0000000000..069dd24b9c
--- /dev/null
+++ b/firmware/target/arm/tcc780x/app.lds
@@ -0,0 +1,170 @@
1#include "config.h"
2
3ENTRY(start)
4
5OUTPUT_FORMAT(elf32-littlearm)
6OUTPUT_ARCH(arm)
7INPUT(target/arm/tcc780x/crt0.o)
8
9#define PLUGINSIZE PLUGIN_BUFFER_SIZE
10#define CODECSIZE CODEC_SIZE
11
12#ifdef DEBUG
13#define STUBOFFSET 0x10000
14#else
15#define STUBOFFSET 0
16#endif
17
18#define DRAMSIZE (MEMORYSIZE * 0x100000) - PLUGINSIZE - STUBOFFSET - CODECSIZE
19
20#define DRAMORIG 0x20000000 + STUBOFFSET
21#define ITCMORIG 0x00000000
22#define ITCMSIZE 0x1000
23#define DTCMORIG 0xA0000000
24#define DTCMSIZE 0x2000
25#define SRAMORIG 0x10000000
26#define SRAMSIZE 0xc000
27
28/* End of the audio buffer, where the codec buffer starts */
29#define ENDAUDIOADDR (DRAMORIG + DRAMSIZE)
30
31/* Where the codec buffer ends, and the plugin buffer starts */
32#define ENDADDR (ENDAUDIOADDR + CODECSIZE)
33
34MEMORY
35{
36 DRAM : ORIGIN = DRAMORIG, LENGTH = DRAMSIZE
37 /* Seperate data & instruction TCMs plus SRAM. */
38 ITCM : ORIGIN = ITCMORIG, LENGTH = ITCMSIZE
39 DTCM : ORIGIN = DTCMORIG, LENGTH = DTCMSIZE
40 SRAM : ORIGIN = SRAMORIG, LENGTH = SRAMSIZE
41}
42
43SECTIONS
44{
45 .text :
46 {
47 loadaddress = .;
48 _loadaddress = .;
49 . = ALIGN(0x200);
50 *(.init.text)
51 *(.text*)
52 *(.glue_7)
53 *(.glue_7t)
54 . = ALIGN(0x4);
55 } > DRAM
56
57 .rodata :
58 {
59 *(.rodata) /* problems without this, dunno why */
60 *(.rodata*)
61 *(.rodata.str1.1)
62 *(.rodata.str1.4)
63 . = ALIGN(0x4);
64
65 /* Pseudo-allocate the copies of the data sections */
66 _datacopy = .;
67 } > DRAM
68
69 /* TRICK ALERT! For RAM execution, we put the .data section at the
70 same load address as the copy. Thus, we don't waste extra RAM
71 when we don't actually need the copy. */
72 .data : AT ( _datacopy )
73 {
74 _datastart = .;
75 *(.data*)
76 . = ALIGN(0x4);
77 _dataend = .;
78 } > DRAM
79
80 /DISCARD/ :
81 {
82 *(.eh_frame)
83 }
84
85 .vectors ITCMORIG :
86 {
87 _vectorsstart = .;
88 *(.vectors);
89 _vectorsend = .;
90 } > ITCM AT> DRAM
91
92 _vectorscopy = LOADADDR(.vectors);
93
94 .itcm :
95 {
96 _itcmstart = .;
97 _itcmend = .;
98 } > ITCM AT> DRAM
99
100 _itcmcopy = LOADADDR(.itcm);
101
102 .dtcm :
103 {
104 _dtcmstart = .;
105 _dtcmend = .;
106 } > DTCM AT> DRAM
107
108 _dtcmcopy = LOADADDR(.dtcm);
109
110 .iram :
111 {
112 _iramstart = .;
113 *(.irodata)
114 *(.idata)
115 *(.icode)
116 . = ALIGN(0x4);
117 _iramend = .;
118 } > SRAM AT> DRAM
119
120 _iramcopy = LOADADDR(.iram);
121
122 .ibss (NOLOAD) :
123 {
124 _iedata = .;
125 *(.ibss)
126 . = ALIGN(0x4);
127 _iend = .;
128 } > SRAM
129
130 .stack :
131 {
132 *(.stack)
133 stackbegin = .;
134 . += 0x2000;
135 stackend = .;
136 } > SRAM
137
138 .bss :
139 {
140 _edata = .;
141 *(.bss*)
142 *(COMMON)
143 . = ALIGN(0x4);
144 _end = .;
145 } > DRAM
146
147 .audiobuf ALIGN(4) :
148 {
149 _audiobuffer = .;
150 audiobuffer = .;
151 } > DRAM
152
153 .audiobufend ENDAUDIOADDR:
154 {
155 audiobufend = .;
156 _audiobufend = .;
157 } > DRAM
158
159 .codec ENDAUDIOADDR:
160 {
161 codecbuf = .;
162 _codecbuf = .;
163 }
164
165 .plugin ENDADDR:
166 {
167 _pluginbuf = .;
168 pluginbuf = .;
169 }
170}