From da190727e768dea9e647989b3e765f910e9d0fbc Mon Sep 17 00:00:00 2001 From: Johannes Rauh Date: Sat, 15 Aug 2020 18:04:47 +0200 Subject: Enable boot from SD for Sansa e200 Change-Id: I0940f2cd5fc914d6d5061b5798b1a636009649b7 --- firmware/export/config/sansae200.h | 11 ++++++++--- firmware/export/mi4-loader.h | 19 +++++++++++++++++++ 2 files changed, 27 insertions(+), 3 deletions(-) (limited to 'firmware/export') diff --git a/firmware/export/config/sansae200.h b/firmware/export/config/sansae200.h index e03784a204..59e531241f 100644 --- a/firmware/export/config/sansae200.h +++ b/firmware/export/config/sansae200.h @@ -8,6 +8,12 @@ #define HW_SAMPR_CAPS (SAMPR_CAP_48 | SAMPR_CAP_44 | SAMPR_CAP_32) +/* Define if boot data from bootloader has been enabled for the target */ +#define HAVE_BOOTDATA + +/* define boot redirect file name allows booting from external drives */ +#define BOOT_REDIR "rockbox_main.e200" + /* define this if you have recording possibility */ #define HAVE_RECORDING @@ -178,11 +184,10 @@ #define FIRMWARE_OFFSET_FILE_CRC 0x0 #define FIRMWARE_OFFSET_FILE_DATA 0x8 -#ifndef BOOTLOADER #define HAVE_MULTIDRIVE +//#define HAVE_MULTIVOLUME #define NUM_DRIVES 2 -#define HAVE_HOTSWAP -#endif +#define HAVE_HOTSWAP /* required to access sd from bootloader */ /* USB On-the-go */ #define CONFIG_USBOTG USBOTG_ARC diff --git a/firmware/export/mi4-loader.h b/firmware/export/mi4-loader.h index 1b4a4b93b2..f66164ec2c 100644 --- a/firmware/export/mi4-loader.h +++ b/firmware/export/mi4-loader.h @@ -49,3 +49,22 @@ struct tea_key { int load_mi4(unsigned char* buf, const char* firmware, unsigned int buffer_size); const char *mi4_strerror(int8_t errno); + +#ifdef HAVE_MULTIBOOT /* defined by config.h */ +/* Check in root of this for rockbox_main. + * if this file empty or there is a single slash '/' + * buf = '//\0' + * If instead '/<*DIRECTORY*>' is supplied + * addpath will be set to this DIRECTORY buf = + * '//addpath//\0' + * On error returns Negative number or 0 + * On success returns bytes from snprintf + * and generated path will be placed in buf + * note: if supplied buffer is too small return will be + * the number of bytes that would have been written + */ + +/* TODO needs mapped back to debug_menu if root redirect ever becomes a reality */ +int get_redirect_dir(char* buf, int buffer_size, int volume, + const char* rootdir, const char* firmware); +#endif -- cgit v1.2.3