summaryrefslogtreecommitdiff
path: root/firmware/target/arm/as3525/app.lds
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/arm/as3525/app.lds')
-rw-r--r--firmware/target/arm/as3525/app.lds53
1 files changed, 38 insertions, 15 deletions
diff --git a/firmware/target/arm/as3525/app.lds b/firmware/target/arm/as3525/app.lds
index bf8e68f048..21cdac528b 100644
--- a/firmware/target/arm/as3525/app.lds
+++ b/firmware/target/arm/as3525/app.lds
@@ -6,6 +6,11 @@ OUTPUT_FORMAT(elf32-littlearm)
6OUTPUT_ARCH(arm) 6OUTPUT_ARCH(arm)
7STARTUP(target/arm/crt0.o) 7STARTUP(target/arm/crt0.o)
8 8
9#if MEMORYSIZE <= 2
10/* we put the codec buffer in IRAM */
11#define LOWMEM
12#endif
13
9#define PLUGINSIZE PLUGIN_BUFFER_SIZE 14#define PLUGINSIZE PLUGIN_BUFFER_SIZE
10#define CODECSIZE CODEC_SIZE 15#define CODECSIZE CODEC_SIZE
11 16
@@ -16,8 +21,15 @@ STARTUP(target/arm/crt0.o)
16#endif 21#endif
17 22
18#include "cpu.h" 23#include "cpu.h"
24
19#define IRAMSIZE 0x50000 25#define IRAMSIZE 0x50000
26
27#ifdef LOWMEM
28#define DRAMSIZE (MEMORYSIZE * 0x100000) - STUBOFFSET - PLUGINSIZE
29#define CODECORIG (IRAMORIG + IRAMSIZE - CODEC_SIZE)
30#else
20#define DRAMSIZE (MEMORYSIZE * 0x100000) - STUBOFFSET - PLUGINSIZE - CODECSIZE 31#define DRAMSIZE (MEMORYSIZE * 0x100000) - STUBOFFSET - PLUGINSIZE - CODECSIZE
32#endif
21 33
22#define IRAMORIG 0x0 34#define IRAMORIG 0x0
23#define DRAMORIG 0x30000000 + STUBOFFSET 35#define DRAMORIG 0x30000000 + STUBOFFSET
@@ -26,11 +38,20 @@ STARTUP(target/arm/crt0.o)
26#define ENDAUDIOADDR (DRAMORIG + DRAMSIZE) 38#define ENDAUDIOADDR (DRAMORIG + DRAMSIZE)
27 39
28/* Where the codec buffer ends, and the plugin buffer starts */ 40/* Where the codec buffer ends, and the plugin buffer starts */
41#ifdef LOWMEM
42#define ENDADDR (ENDAUDIOADDR)
43#else
29#define ENDADDR (ENDAUDIOADDR + CODECSIZE) 44#define ENDADDR (ENDAUDIOADDR + CODECSIZE)
45#endif
30 46
31MEMORY 47MEMORY
32{ 48{
49#ifdef LOWMEM
50 IRAM : ORIGIN = IRAMORIG, LENGTH = (IRAMSIZE - CODEC_SIZE)
51 CODEC_IRAM : ORIGIN = CODECORIG, LENGTH = CODEC_SIZE
52#else
33 IRAM : ORIGIN = IRAMORIG, LENGTH = IRAMSIZE 53 IRAM : ORIGIN = IRAMORIG, LENGTH = IRAMSIZE
54#endif
34 DRAM : ORIGIN = DRAMORIG, LENGTH = DRAMSIZE 55 DRAM : ORIGIN = DRAMORIG, LENGTH = DRAMSIZE
35} 56}
36 57
@@ -69,8 +90,6 @@ SECTIONS
69 *(.eh_frame) 90 *(.eh_frame)
70 } 91 }
71 92
72 _initdata_end =.;
73
74 .vectors IRAMORIG: 93 .vectors IRAMORIG:
75 { 94 {
76 _vectors_start = .; 95 _vectors_start = .;
@@ -79,16 +98,7 @@ SECTIONS
79 98
80 _vectorscopy = LOADADDR(.vectors); 99 _vectorscopy = LOADADDR(.vectors);
81 100
82 .ibss (NOLOAD) : 101 .iram :
83 {
84 _iedata = .;
85 *(.qharray)
86 *(.ibss)
87 . = ALIGN(0x4);
88 _iend = .;
89 } > IRAM
90
91 .iram _iend :
92 { 102 {
93 _iramstart = .; 103 _iramstart = .;
94 *(.icode) 104 *(.icode)
@@ -98,6 +108,15 @@ SECTIONS
98 _iramend = .; 108 _iramend = .;
99 } > IRAM AT> DRAM 109 } > IRAM AT> DRAM
100 110
111 .ibss (NOLOAD) :
112 {
113 _iedata = .;
114 *(.qharray)
115 *(.ibss)
116 . = ALIGN(0x4);
117 _iend = .;
118 } > IRAM
119
101 _iramcopy = LOADADDR(.iram); 120 _iramcopy = LOADADDR(.iram);
102 121
103 .stack (NOLOAD) : 122 .stack (NOLOAD) :
@@ -130,15 +149,19 @@ SECTIONS
130 _audiobufend = .; 149 _audiobufend = .;
131 } > DRAM 150 } > DRAM
132 151
133 .codec ENDAUDIOADDR (NOLOAD) : 152 .codec CODECORIG (NOLOAD) :
134 { 153 {
135 codecbuf = .; 154 codecbuf = .;
136 _codecbuf = .; 155 _codecbuf = .;
137 } 156#ifdef LOWMEM
157 } > CODEC_IRAM
158#else
159 } > DRAM
160#endif
138 161
139 .plugin ENDADDR (NOLOAD) : 162 .plugin ENDADDR (NOLOAD) :
140 { 163 {
141 _pluginbuf = .; 164 _pluginbuf = .;
142 pluginbuf = .; 165 pluginbuf = .;
143 } 166 } > DRAM
144} 167}