diff options
Diffstat (limited to 'bootloader/main-pp.c')
-rw-r--r-- | bootloader/main-pp.c | 14 |
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, | |||
131 | unsigned long sum; | 131 | unsigned long sum; |
132 | 132 | ||
133 | /* Read header to find out how long the mi4 file is. */ | 133 | /* Read header to find out how long the mi4 file is. */ |
134 | storage_read_sectors(pinfo->start + PPMI_SECTOR_OFFSET, | 134 | storage_read_sectors(IF_MD(0,) pinfo->start + PPMI_SECTOR_OFFSET, |
135 | PPMI_SECTORS, &ppmi_header); | 135 | PPMI_SECTORS, &ppmi_header); |
136 | 136 | ||
137 | /* The first four characters at 0x80000 (sector 1024) should be PPMI*/ | 137 | /* 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, | |||
141 | printf("BL mi4 size: %x", ppmi_header.length); | 141 | printf("BL mi4 size: %x", ppmi_header.length); |
142 | 142 | ||
143 | /* Read mi4 header of the OF */ | 143 | /* Read mi4 header of the OF */ |
144 | storage_read_sectors(pinfo->start + PPMI_SECTOR_OFFSET + PPMI_SECTORS | 144 | storage_read_sectors(IF_MD(0,) pinfo->start + PPMI_SECTOR_OFFSET + PPMI_SECTORS |
145 | + (ppmi_header.length/512), MI4_HEADER_SECTORS, &mi4header); | 145 | + (ppmi_header.length/512), MI4_HEADER_SECTORS, &mi4header); |
146 | 146 | ||
147 | /* We don't support encrypted mi4 files yet */ | 147 | /* We don't support encrypted mi4 files yet */ |
@@ -164,7 +164,7 @@ int load_mi4_part(unsigned char* buf, struct partinfo* pinfo, | |||
164 | printf("Binary type: %.4s", mi4header.type); | 164 | printf("Binary type: %.4s", mi4header.type); |
165 | 165 | ||
166 | /* Load firmware */ | 166 | /* Load firmware */ |
167 | storage_read_sectors(pinfo->start + PPMI_SECTOR_OFFSET + PPMI_SECTORS | 167 | storage_read_sectors(IF_MD(0,) pinfo->start + PPMI_SECTOR_OFFSET + PPMI_SECTORS |
168 | + (ppmi_header.length/512) + MI4_HEADER_SECTORS, | 168 | + (ppmi_header.length/512) + MI4_HEADER_SECTORS, |
169 | (mi4header.mi4size-MI4_HEADER_SIZE)/512, buf); | 169 | (mi4header.mi4size-MI4_HEADER_SIZE)/512, buf); |
170 | 170 | ||
@@ -183,9 +183,9 @@ int load_mi4_part(unsigned char* buf, struct partinfo* pinfo, | |||
183 | 183 | ||
184 | printf("Disabling database rebuild"); | 184 | printf("Disabling database rebuild"); |
185 | 185 | ||
186 | storage_read_sectors(pinfo->start + 0x3c08, 1, block); | 186 | storage_read_sectors(IF_MD(0,) pinfo->start + 0x3c08, 1, block); |
187 | block[0xe1] = 0; | 187 | block[0xe1] = 0; |
188 | storage_write_sectors(pinfo->start + 0x3c08, 1, block); | 188 | storage_write_sectors(IF_MD(0,) pinfo->start + 0x3c08, 1, block); |
189 | } | 189 | } |
190 | #else | 190 | #else |
191 | (void) disable_rebuild; | 191 | (void) disable_rebuild; |
@@ -287,7 +287,6 @@ static int handle_usb(int connect_timeout) | |||
287 | 287 | ||
288 | void* main(void) | 288 | void* main(void) |
289 | { | 289 | { |
290 | char filename[MAX_PATH]; | ||
291 | int i; | 290 | int i; |
292 | int btn; | 291 | int btn; |
293 | int rc; | 292 | int rc; |
@@ -400,9 +399,8 @@ void* main(void) | |||
400 | if((btn & BOOTLOADER_BOOT_OF) == 0) | 399 | if((btn & BOOTLOADER_BOOT_OF) == 0) |
401 | { | 400 | { |
402 | printf("Loading Rockbox..."); | 401 | printf("Loading Rockbox..."); |
403 | snprintf(filename,sizeof(filename), BOOTDIR "/%s", BOOTFILE); | ||
404 | 402 | ||
405 | rc = load_mi4(loadbuffer, filename, MAX_LOADSIZE); | 403 | rc = load_mi4(loadbuffer, BOOTFILE, MAX_LOADSIZE); |
406 | if (rc <= EFILE_EMPTY) | 404 | if (rc <= EFILE_EMPTY) |
407 | { | 405 | { |
408 | bool old_verbose = verbose; | 406 | bool old_verbose = verbose; |