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.

Sansa E200v1 Bootloader attempt at enabling USB in boot loader

there is a 1MB free region that is used to load the firmware but we
shouldn't need that till after a USB connection

so here is my 2nd try

Change-Id: I2552db3a7fba019d7e7188984432f758ddafe548

authored by

William Wilgus and committed by
William Wilgus
7c67a483 75524a7e

+21 -5
+6 -1
bootloader/main-pp.c
··· 51 51 #if defined(SANSA_E200) || defined(SANSA_C200) || defined(PHILIPS_SA9200) 52 52 #include "usb_drv.h" 53 53 #endif 54 + #if defined(SANSA_E200) && defined(HAVE_BOOTLOADER_USB_MODE) 55 + #include "core_alloc.h" 56 + #endif 54 57 #if defined(SAMSUNG_YH925) 55 58 /* this function (in lcd-yh925.c) resets the screen orientation for the OF 56 59 * for use with dualbooting */ ··· 232 235 usb = USB_HANDLED; 233 236 usb_acknowledge(SYS_USB_CONNECTED_ACK); 234 237 usb_wait_for_disconnect(&q); 235 - break; 236 238 } 237 239 238 240 if (connect_timeout != TIMEOUT_BLOCK && ··· 299 301 int usb = USB_EXTRACTED; 300 302 301 303 system_init(); 304 + #if defined(SANSA_E200) && defined(HAVE_BOOTLOADER_USB_MODE) 305 + core_allocator_init(); 306 + #endif 302 307 kernel_init(); 303 308 304 309 #ifdef HAVE_BOOTLOADER_USB_MODE
+15 -4
firmware/core_alloc.c
··· 8 8 /* not static so it can be discovered by core_get_data() */ 9 9 struct buflib_context core_ctx; 10 10 11 - /* defined in linker script */ 12 11 #if (CONFIG_PLATFORM & PLATFORM_NATIVE) && !defined(__PCTOOL__) 12 + 13 13 #if defined(IPOD_VIDEO) && !defined(BOOTLOADER) 14 + /* defined in linker script */ 15 + extern unsigned char audiobuffer[]; 14 16 extern unsigned char *audiobufend_lds[]; 17 + /* pointer to end of audio buffer filled at runtime allocator_init */ 15 18 unsigned char *audiobufend; 16 - #else /* !IPOD_VIDEO */ 19 + #elif defined(SANSA_E200) && defined(HAVE_BOOTLOADER_USB_MODE) 20 + /* defined in linker script */ 21 + extern unsigned char freebuffer[]; 22 + extern unsigned char freebufferend[]; 23 + /* map linker symbol to the audiobuffer in order to use core_alloc */ 24 + unsigned char *audiobuffer = (unsigned char *)freebuffer; 25 + unsigned char *audiobufend = (unsigned char *)freebufferend; 26 + #else /* !IPOD_VIDEO, !SANSA_E200&&BOOTLOADERUSB */ 27 + /* defined in linker script */ 28 + extern unsigned char audiobuffer[]; 17 29 extern unsigned char audiobufend[]; 18 30 #endif 19 - /* defined in linker script */ 20 - extern unsigned char audiobuffer[]; 31 + 21 32 #else /* PLATFORM_HOSTED */ 22 33 static unsigned char audiobuffer[((MEMORYSIZE)*1024-768)*1024]; 23 34 unsigned char *audiobufend = audiobuffer + sizeof(audiobuffer);