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