summaryrefslogtreecommitdiffstats
path: root/bootloader
diff options
context:
space:
mode:
authorJohannes Rauh <johnbthetenth@gmail.com>2020-08-15 18:04:47 +0200
committerWilliam Wilgus <wilgus.william@gmail.com>2020-08-19 19:17:01 -0400
commitda190727e768dea9e647989b3e765f910e9d0fbc (patch)
treed7d6443c124666ac90e5baba2605a42edd10d0c1 /bootloader
parent8ee035b6c884142f936b03b7419d14e9102515d9 (diff)
downloadrockbox-da190727e768dea9e647989b3e765f910e9d0fbc.tar.gz
rockbox-da190727e768dea9e647989b3e765f910e9d0fbc.tar.bz2
rockbox-da190727e768dea9e647989b3e765f910e9d0fbc.zip
Enable boot from SD for Sansa e200
Change-Id: I0940f2cd5fc914d6d5061b5798b1a636009649b7
Diffstat (limited to 'bootloader')
-rw-r--r--bootloader/main-pp.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/bootloader/main-pp.c b/bootloader/main-pp.c
index 044c3fc9c0..ef766455b6 100644
--- a/bootloader/main-pp.c
+++ b/bootloader/main-pp.c
@@ -131,7 +131,7 @@ int load_mi4_part(unsigned char* buf, struct partinfo* pinfo,
unsigned long sum;
/* Read header to find out how long the mi4 file is. */
- storage_read_sectors(pinfo->start + PPMI_SECTOR_OFFSET,
+ storage_read_sectors(IF_MD(0,) pinfo->start + PPMI_SECTOR_OFFSET,
PPMI_SECTORS, &ppmi_header);
/* The first four characters at 0x80000 (sector 1024) should be PPMI*/
@@ -141,7 +141,7 @@ int load_mi4_part(unsigned char* buf, struct partinfo* pinfo,
printf("BL mi4 size: %x", ppmi_header.length);
/* Read mi4 header of the OF */
- storage_read_sectors(pinfo->start + PPMI_SECTOR_OFFSET + PPMI_SECTORS
+ storage_read_sectors(IF_MD(0,) pinfo->start + PPMI_SECTOR_OFFSET + PPMI_SECTORS
+ (ppmi_header.length/512), MI4_HEADER_SECTORS, &mi4header);
/* We don't support encrypted mi4 files yet */
@@ -164,7 +164,7 @@ int load_mi4_part(unsigned char* buf, struct partinfo* pinfo,
printf("Binary type: %.4s", mi4header.type);
/* Load firmware */
- storage_read_sectors(pinfo->start + PPMI_SECTOR_OFFSET + PPMI_SECTORS
+ storage_read_sectors(IF_MD(0,) pinfo->start + PPMI_SECTOR_OFFSET + PPMI_SECTORS
+ (ppmi_header.length/512) + MI4_HEADER_SECTORS,
(mi4header.mi4size-MI4_HEADER_SIZE)/512, buf);
@@ -183,9 +183,9 @@ int load_mi4_part(unsigned char* buf, struct partinfo* pinfo,
printf("Disabling database rebuild");
- storage_read_sectors(pinfo->start + 0x3c08, 1, block);
+ storage_read_sectors(IF_MD(0,) pinfo->start + 0x3c08, 1, block);
block[0xe1] = 0;
- storage_write_sectors(pinfo->start + 0x3c08, 1, block);
+ storage_write_sectors(IF_MD(0,) pinfo->start + 0x3c08, 1, block);
}
#else
(void) disable_rebuild;
@@ -287,7 +287,6 @@ static int handle_usb(int connect_timeout)
void* main(void)
{
- char filename[MAX_PATH];
int i;
int btn;
int rc;
@@ -400,9 +399,8 @@ void* main(void)
if((btn & BOOTLOADER_BOOT_OF) == 0)
{
printf("Loading Rockbox...");
- snprintf(filename,sizeof(filename), BOOTDIR "/%s", BOOTFILE);
- rc = load_mi4(loadbuffer, filename, MAX_LOADSIZE);
+ rc = load_mi4(loadbuffer, BOOTFILE, MAX_LOADSIZE);
if (rc <= EFILE_EMPTY)
{
bool old_verbose = verbose;