Rockbox open source high quality audio player as a Music Player Daemon
mpris rockbox mpd libadwaita audio rust zig deno
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

+93 -42
+9 -2
apps/plugins/plugin.lds
··· 36 36 37 37 #elif CONFIG_CPU==DM320 38 38 39 - /* Give this 1 meg to allow it to align to the MMU boundary */ 40 39 #ifndef LCD_NATIVE_WIDTH 41 40 #define LCD_NATIVE_WIDTH LCD_WIDTH 42 41 #endif ··· 45 44 #define LCD_NATIVE_HEIGHT LCD_HEIGHT 46 45 #endif 47 46 47 + #ifdef MROBE_500 48 + /* Give this 1 meg to allow it to align to the MMU boundary */ 48 49 #define LCD_FUDGE LCD_NATIVE_WIDTH%32 49 - #define LCD_BUFFER_SIZE ((LCD_NATIVE_WIDTH+LCD_FUDGE)*LCD_NATIVE_HEIGHT*2) 50 + #define LCD_BUFFER_SIZE ((LCD_NATIVE_WIDTH+LCD_FUDGE)*LCD_NATIVE_HEIGHT*2) 50 51 #define LCD_TTB_AREA 0x100000*((LCD_BUFFER_SIZE>>19)+1) 52 + #else 53 + /* must be 16Kb (0x4000) aligned */ 54 + #define TTB_SIZE (0x4000) 55 + #define LCD_BUFFER_SIZE (LCD_NATIVE_WIDTH*LCD_NATIVE_HEIGHT*2) 56 + #define LCD_TTB_AREA (TTB_SIZE + LCD_BUFFER_SIZE) 57 + #endif 51 58 52 59 #define DRAMSIZE (MEMORYSIZE * 0x100000) - STUBOFFSET - PLUGIN_BUFFER_SIZE - CODEC_SIZE - LCD_TTB_AREA 53 60
+4
firmware/export/dm320.h
··· 30 30 #if !defined(__ASSEMBLER__) && !defined(__LD__) 31 31 /* These variables are created during linking (app/boot.lds) */ 32 32 extern unsigned long _lcdbuf; 33 + #ifdef MROBE_500 33 34 extern unsigned long _lcdbuf2; 35 + #endif 34 36 extern unsigned long _ttbstart; 35 37 #endif 36 38 37 39 #define TTB_BASE_ADDR (_ttbstart) /* End of memory */ 38 40 #define FRAME ((short *) (&_lcdbuf)) /* Right after TTB */ 41 + #ifdef MROBE_500 39 42 #define FRAME2 ((short *) (&_lcdbuf2)) /* Right after FRAME */ 43 + #endif 40 44 41 45 #define PHY_IO_BASE 0x00030000 42 46 #define DM320_REG(addr) (*(volatile unsigned short *)(PHY_IO_BASE + (addr)))
+40 -20
firmware/target/arm/tms320dm320/app.lds
··· 14 14 #define LCD_NATIVE_HEIGHT LCD_HEIGHT 15 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 17 /* must be 16Kb (0x4000) aligned */ 22 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 27 /* Give this some memory to allow it to align to the MMU boundary. 25 28 * Note that since there are two buffers (YUV/RGB) it calculates the approximate 26 29 * memory needed in steps of 1 Meg. 27 30 */ 28 - #define LCD_TTB_AREA 0x100000*((LCD_BUFFER_SIZE>>19)+1) 29 - 30 - #define DRAMSIZE (MEMORYSIZE * 0x100000) 31 + #define LCD_TTB_AREA (0x100000*((LCD_BUFFER_SIZE>>19)+1)) 32 + #else 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 41 #define FLASHORIG 0x00100000 35 42 #define FLASHSIZE 0x00800000 ··· 43 50 PRO_STACK_SIZE = 0x2000; 44 51 IRQ_STACK_SIZE = 0x600; 45 52 FIQ_STACK_SIZE = 0x400; 46 - 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 53 51 54 MEMORY 52 55 { ··· 105 108 *(.rodata*) 106 109 } > DRAM 107 110 108 - .data : 111 + .data : 109 112 { 110 113 . = ALIGN(0x4); 111 114 *(.data*) ··· 142 145 } > ITCM 143 146 144 147 /* Program stack space */ 145 - .pro_stack (NOLOAD): 148 + .pro_stack (NOLOAD): 146 149 { 147 150 . = ALIGN(0x4); 148 151 *(.stack) 149 152 stackbegin = .; /* Variable for thread.c */ 150 - _pro_stack_end = .; 153 + _pro_stack_end = .; 151 154 . += PRO_STACK_SIZE; 152 155 _pro_stack_start = .; 153 156 stackend = .; /* Variable for tread.c */ ··· 193 196 pluginbuf = .; 194 197 . += PLUGIN_BUFFER_SIZE; 195 198 } > DRAM 196 - 199 + 197 200 _endsdram = .; 198 201 202 + #ifdef MROBE_500 199 203 .ttbtable (NOLOAD) : 200 204 { 201 205 . = ALIGN (0x4000); 202 206 _ttbstart = .; 203 207 . += TTB_SIZE; 204 208 } > DRAM 205 - 209 + 206 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 212 * size. 209 213 */ 210 - 214 + 211 215 .lcdbuffer (NOLOAD) : 212 216 { 213 217 _lcdbuf = .; 214 218 . += LCD_BUFFER_SIZE; 215 219 } > DRAM 216 - 220 + 217 221 .lcdbuffer2 (NOLOAD) : 218 222 { 219 223 _lcdbuf2 = .; 220 224 . += LCD_BUFFER_SIZE; 221 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
+40 -20
firmware/target/arm/tms320dm320/boot.lds
··· 14 14 #define LCD_NATIVE_HEIGHT LCD_HEIGHT 15 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 17 /* must be 16Kb (0x4000) aligned */ 22 18 #define TTB_SIZE (0x4000) 23 19 20 + /* Bootloader only uses/knows about the upper 32 M */ 21 + #define DRAMSIZE (MEMORYSIZE * 0x100000 / 2) 22 + #define DRAMORIG CONFIG_SDRAM_START+DRAMSIZE 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 27 /* Give this some memory to allow it to align to the MMU boundary. 25 28 * Note that since there are two buffers (YUV/RGB) it calculates the approximate 26 29 * memory needed in steps of 1 Meg. 27 30 */ 28 - #define LCD_TTB_AREA 0x100000*((LCD_BUFFER_SIZE>>19)+1) 29 - 30 - /* Bootloader only uses/knows about the upper 32 M */ 31 - #define DRAMORIG CONFIG_SDRAM_START+0x02000000 32 - #define DRAMSIZE (MEMORYSIZE * 0x80000) 31 + #define LCD_TTB_AREA (0x100000*((LCD_BUFFER_SIZE>>19)+1)) 32 + /* End of the audio buffer, where the codec buffer starts */ 33 + #define TTB_BEGIN (DRAMORIG + DRAMSIZE - LCD_TTB_AREA) 34 + #else 35 + #define LCD_BUFFER_SIZE (LCD_NATIVE_WIDTH*LCD_NATIVE_HEIGHT*2) 36 + #define LCD_TTB_AREA (TTB_SIZE + LCD_BUFFER_SIZE) 37 + #define LCD_BEGIN (DRAMORIG + DRAMSIZE - LCD_TTB_AREA) 38 + #endif 33 39 34 40 #define IRAMORIG 0x00000000 35 41 #define IRAMSIZE 0x4000 ··· 58 64 PRO_STACK_SIZE = 0x2000; 59 65 IRQ_STACK_SIZE = 0x400; 60 66 FIQ_STACK_SIZE = 0x400; 61 - 62 - /* End of the audio buffer, where the codec buffer starts */ 63 - #define TTB_BEGIN (DRAMORIG + DRAMSIZE - LCD_TTB_AREA) 64 67 65 68 MEMORY 66 69 { ··· 148 151 } > IRAM AT> FLASH 149 152 150 153 _iramcopy = LOADADDR(.iram); 151 - 154 + 152 155 .ibss (NOLOAD) : 153 156 { 154 157 . = ALIGN(0x4); ··· 158 161 } > IRAM 159 162 160 163 /* Program stack space */ 161 - .pro_stack (NOLOAD): 164 + .pro_stack (NOLOAD): 162 165 { 163 166 . = ALIGN(0x4); 164 167 *(.stack) 165 168 stackbegin = .; /* Variable for thread.c */ 166 - _pro_stack_end = .; 169 + _pro_stack_end = .; 167 170 . += PRO_STACK_SIZE; 168 171 _pro_stack_start = .; 169 172 stackend = .; /* Variable for tread.c */ ··· 186 189 . += FIQ_STACK_SIZE; 187 190 _fiq_stack_start = .; 188 191 } > IRAM 189 - 192 + 193 + #ifdef MROBE_500 190 194 .ttbtable TTB_BEGIN (NOLOAD) : 191 195 { 192 196 . = ALIGN (0x4000); 193 197 _ttbstart = .; 194 198 . += TTB_SIZE; 195 199 } > DRAM 196 - 200 + 197 201 /* The LCD buffer should be at the end of memory to protect against 198 - * overflowing something else when the YUV blitter is fudging the screen 202 + * overflowing something else when the YUV blitter is fudging the screen 199 203 * size. 200 204 */ 201 - 205 + 202 206 .lcdbuffer (NOLOAD) : 203 207 { 204 208 _lcdbuf = .; 205 209 . += LCD_BUFFER_SIZE; 206 210 } > DRAM 207 - 211 + 208 212 .lcdbuffer2 (NOLOAD) : 209 213 { 210 214 _lcdbuf2 = .; 211 215 . += LCD_BUFFER_SIZE; 212 216 } > DRAM 217 + #else 218 + .lcdbuffer LCD_BEGIN (NOLOAD) : 219 + { 220 + . = ALIGN(32); 221 + _lcdbuf = .; 222 + . += LCD_BUFFER_SIZE; 223 + } > DRAM 224 + 225 + /* Place TTB at the end of RAM to minimize alignment losses */ 226 + .ttbtable (NOLOAD) : 227 + { 228 + . = ALIGN (0x4000); 229 + _ttbstart = .; 230 + . += TTB_SIZE; 231 + } > DRAM 232 + #endif 213 233 }