summaryrefslogtreecommitdiff
path: root/firmware/target/arm/tms320dm320/app.lds
diff options
context:
space:
mode:
authorTomasz Moń <desowin@gmail.com>2021-07-08 18:23:18 +0200
committerTomasz Moń <desowin@gmail.com>2021-07-09 09:24:38 +0000
commit60e2cd6de946c0c473c0e9bfde5b7b1d47a5b28f (patch)
tree07ebe2764bc37a0189da55a62312524769a5ecab /firmware/target/arm/tms320dm320/app.lds
parent2e9b93dc5df5aff35a64c55493bc2d2d74b4aa0d (diff)
downloadrockbox-60e2cd6de946c0c473c0e9bfde5b7b1d47a5b28f.tar.gz
rockbox-60e2cd6de946c0c473c0e9bfde5b7b1d47a5b28f.zip
DM320: Regorganize LCD and TTB memory layout
Do not introduce any change for M:Robe 500 as it uses the two LCD frames in non-obvious way. Sansa Connect and Creative ZVM use only single front framebuffer. Place TTB at DRAM end to minimize memory loss due to alignment. Reserve as little as possible memory for the LCD frames. On Sansa Connect this change extends audio buffer by 858 KiB. Change-Id: I21bdeec4cfba86d71803a39acd651a87e73767e6
Diffstat (limited to 'firmware/target/arm/tms320dm320/app.lds')
-rw-r--r--firmware/target/arm/tms320dm320/app.lds60
1 files changed, 40 insertions, 20 deletions
diff --git a/firmware/target/arm/tms320dm320/app.lds b/firmware/target/arm/tms320dm320/app.lds
index 6ceb512d21..b35ace1ce6 100644
--- a/firmware/target/arm/tms320dm320/app.lds
+++ b/firmware/target/arm/tms320dm320/app.lds
@@ -14,22 +14,29 @@ STARTUP(target/arm/tms320dm320/crt0.o)
14#define LCD_NATIVE_HEIGHT LCD_HEIGHT 14#define LCD_NATIVE_HEIGHT LCD_HEIGHT
15#endif 15#endif
16 16
17#define LCD_FUDGE LCD_NATIVE_WIDTH%32
18
19#define LCD_BUFFER_SIZE ((LCD_NATIVE_WIDTH+LCD_FUDGE)*LCD_NATIVE_HEIGHT*2)
20
21/* must be 16Kb (0x4000) aligned */ 17/* must be 16Kb (0x4000) aligned */
22#define TTB_SIZE 0x4000 18#define TTB_SIZE 0x4000
23 19
20#define DRAMSIZE (MEMORYSIZE * 0x100000)
21#define DRAMORIG CONFIG_SDRAM_START
22
23
24#ifdef MROBE_500
25#define LCD_FUDGE LCD_NATIVE_WIDTH%32
26#define LCD_BUFFER_SIZE ((LCD_NATIVE_WIDTH+LCD_FUDGE)*LCD_NATIVE_HEIGHT*2)
24/* Give this some memory to allow it to align to the MMU boundary. 27/* Give this some memory to allow it to align to the MMU boundary.
25 * Note that since there are two buffers (YUV/RGB) it calculates the approximate 28 * Note that since there are two buffers (YUV/RGB) it calculates the approximate
26 * memory needed in steps of 1 Meg. 29 * memory needed in steps of 1 Meg.
27 */ 30 */
28#define LCD_TTB_AREA 0x100000*((LCD_BUFFER_SIZE>>19)+1) 31#define LCD_TTB_AREA (0x100000*((LCD_BUFFER_SIZE>>19)+1))
29 32#else
30#define DRAMSIZE (MEMORYSIZE * 0x100000) 33#define LCD_BUFFER_SIZE (LCD_NATIVE_WIDTH*LCD_NATIVE_HEIGHT*2)
34#define LCD_TTB_AREA (TTB_SIZE + LCD_BUFFER_SIZE)
35#endif
31 36
32#define DRAMORIG CONFIG_SDRAM_START 37/* End of the audio buffer, where the codec buffer starts */
38#define ENDAUDIOADDR \
39 (DRAMORIG + DRAMSIZE - PLUGIN_BUFFER_SIZE - CODEC_SIZE - LCD_TTB_AREA)
33 40
34#define FLASHORIG 0x00100000 41#define FLASHORIG 0x00100000
35#define FLASHSIZE 0x00800000 42#define FLASHSIZE 0x00800000
@@ -44,10 +51,6 @@ PRO_STACK_SIZE = 0x2000;
44IRQ_STACK_SIZE = 0x600; 51IRQ_STACK_SIZE = 0x600;
45FIQ_STACK_SIZE = 0x400; 52FIQ_STACK_SIZE = 0x400;
46 53
47/* End of the audio buffer, where the codec buffer starts */
48#define ENDAUDIOADDR \
49 (DRAMORIG + DRAMSIZE - PLUGIN_BUFFER_SIZE - CODEC_SIZE - LCD_TTB_AREA)
50
51MEMORY 54MEMORY
52{ 55{
53 DRAM : ORIGIN = DRAMORIG, LENGTH = DRAMSIZE 56 DRAM : ORIGIN = DRAMORIG, LENGTH = DRAMSIZE
@@ -105,7 +108,7 @@ SECTIONS
105 *(.rodata*) 108 *(.rodata*)
106 } > DRAM 109 } > DRAM
107 110
108 .data : 111 .data :
109 { 112 {
110 . = ALIGN(0x4); 113 . = ALIGN(0x4);
111 *(.data*) 114 *(.data*)
@@ -142,12 +145,12 @@ SECTIONS
142 } > ITCM 145 } > ITCM
143 146
144 /* Program stack space */ 147 /* Program stack space */
145 .pro_stack (NOLOAD): 148 .pro_stack (NOLOAD):
146 { 149 {
147 . = ALIGN(0x4); 150 . = ALIGN(0x4);
148 *(.stack) 151 *(.stack)
149 stackbegin = .; /* Variable for thread.c */ 152 stackbegin = .; /* Variable for thread.c */
150 _pro_stack_end = .; 153 _pro_stack_end = .;
151 . += PRO_STACK_SIZE; 154 . += PRO_STACK_SIZE;
152 _pro_stack_start = .; 155 _pro_stack_start = .;
153 stackend = .; /* Variable for tread.c */ 156 stackend = .; /* Variable for tread.c */
@@ -193,31 +196,48 @@ SECTIONS
193 pluginbuf = .; 196 pluginbuf = .;
194 . += PLUGIN_BUFFER_SIZE; 197 . += PLUGIN_BUFFER_SIZE;
195 } > DRAM 198 } > DRAM
196 199
197 _endsdram = .; 200 _endsdram = .;
198 201
202#ifdef MROBE_500
199 .ttbtable (NOLOAD) : 203 .ttbtable (NOLOAD) :
200 { 204 {
201 . = ALIGN (0x4000); 205 . = ALIGN (0x4000);
202 _ttbstart = .; 206 _ttbstart = .;
203 . += TTB_SIZE; 207 . += TTB_SIZE;
204 } > DRAM 208 } > DRAM
205 209
206 /* The LCD buffer should be at the end of memory to protect against 210 /* The LCD buffer should be at the end of memory to protect against
207 * overflowing something else when the YUV blitter is fudging the screen 211 * overflowing something else when the YUV blitter is fudging the screen
208 * size. 212 * size.
209 */ 213 */
210 214
211 .lcdbuffer (NOLOAD) : 215 .lcdbuffer (NOLOAD) :
212 { 216 {
213 _lcdbuf = .; 217 _lcdbuf = .;
214 . += LCD_BUFFER_SIZE; 218 . += LCD_BUFFER_SIZE;
215 } > DRAM 219 } > DRAM
216 220
217 .lcdbuffer2 (NOLOAD) : 221 .lcdbuffer2 (NOLOAD) :
218 { 222 {
219 _lcdbuf2 = .; 223 _lcdbuf2 = .;
220 . += LCD_BUFFER_SIZE; 224 . += LCD_BUFFER_SIZE;
221 } > DRAM 225 } > DRAM
226#else
227 .lcdbuffer (NOLOAD) :
228 {
229 . = ALIGN(32);
230 _lcdbuf = .;
231 . += LCD_BUFFER_SIZE;
232 } > DRAM
233
234 /* Place TTB at the end of RAM to minimize alignment losses */
235 .ttbtable (NOLOAD) :
236 {
237 . = ALIGN (0x4000);
238 _ttbstart = .;
239 . += TTB_SIZE;
240 } > DRAM
241#endif
222} 242}
223 243