summaryrefslogtreecommitdiff
path: root/bootloader/ipod.c
diff options
context:
space:
mode:
authorMarcin Bukat <marcin.bukat@gmail.com>2012-03-04 15:34:29 +0100
committerMarcin Bukat <marcin.bukat@gmail.com>2013-06-27 13:50:11 +0200
commit0b29691324e5700f15ea653592bf29f8552d47d7 (patch)
tree00e4f77f28c813a493cd8af22170f486f6e82903 /bootloader/ipod.c
parent46ea8bfe7c690c8db230fff3a582a69779f8e432 (diff)
downloadrockbox-0b29691324e5700f15ea653592bf29f8552d47d7.tar.gz
rockbox-0b29691324e5700f15ea653592bf29f8552d47d7.zip
Move load_firmware() to separate file
The idea is to share loading code between bootloaders and rolo(). Change-Id: I1656ed91946d7a05cb7c9fa7a16793c3c862a5cd Reviewed-on: http://gerrit.rockbox.org/190 Reviewed-by: Marcin Bukat <marcin.bukat@gmail.com>
Diffstat (limited to 'bootloader/ipod.c')
-rw-r--r--bootloader/ipod.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/bootloader/ipod.c b/bootloader/ipod.c
index af4c1576bb..3f9604ae4b 100644
--- a/bootloader/ipod.c
+++ b/bootloader/ipod.c
@@ -42,6 +42,8 @@
42#include "power.h" 42#include "power.h"
43#include "file.h" 43#include "file.h"
44#include "common.h" 44#include "common.h"
45#include "rb-loader.h"
46#include "loader_strerror.h"
45#include "hwcompat.h" 47#include "hwcompat.h"
46#include "usb.h" 48#include "usb.h"
47#include "version.h" 49#include "version.h"
@@ -376,7 +378,7 @@ void* main(void)
376 378
377 rc=load_firmware(loadbuffer, "apple_os.ipod", MAX_LOADSIZE); 379 rc=load_firmware(loadbuffer, "apple_os.ipod", MAX_LOADSIZE);
378 380
379 if (rc == EOK) { 381 if (rc > 0) {
380 printf("apple_os.ipod loaded."); 382 printf("apple_os.ipod loaded.");
381 return (void*)DRAM_START; 383 return (void*)DRAM_START;
382 } else if (rc == EFILE_NOT_FOUND) { 384 } else if (rc == EFILE_NOT_FOUND) {
@@ -387,10 +389,10 @@ void* main(void)
387 /* We have a copy of the retailos in RAM, lets just run it. */ 389 /* We have a copy of the retailos in RAM, lets just run it. */
388 return (void*)DRAM_START; 390 return (void*)DRAM_START;
389 } 391 }
390 } else if (rc < EFILE_NOT_FOUND) { 392 } else {
391 printf("Error!"); 393 printf("Error!");
392 printf("Can't load apple_os.ipod:"); 394 printf("Can't load apple_os.ipod:");
393 printf(strerror(rc)); 395 printf(loader_strerror(rc));
394 } 396 }
395 397
396 /* Everything failed - just loop forever */ 398 /* Everything failed - just loop forever */
@@ -399,17 +401,17 @@ void* main(void)
399 } else if (btn==BUTTON_PLAY) { 401 } else if (btn==BUTTON_PLAY) {
400 printf("Loading Linux..."); 402 printf("Loading Linux...");
401 rc=load_raw_firmware(loadbuffer, "/linux.bin", MAX_LOADSIZE); 403 rc=load_raw_firmware(loadbuffer, "/linux.bin", MAX_LOADSIZE);
402 if (rc < EOK) { 404 if (rc <= EFILE_EMPTY) {
403 printf("Error!"); 405 printf("Error!");
404 printf("Can't load linux.bin:"); 406 printf("Can't load linux.bin:");
405 printf(strerror(rc)); 407 printf(loader_strerror(rc));
406 } else { 408 } else {
407 return (void*)DRAM_START; 409 return (void*)DRAM_START;
408 } 410 }
409 } else { 411 } else {
410 printf("Loading Rockbox..."); 412 printf("Loading Rockbox...");
411 rc=load_firmware(loadbuffer, BOOTFILE, MAX_LOADSIZE); 413 rc=load_firmware(loadbuffer, BOOTFILE, MAX_LOADSIZE);
412 if (rc == EOK) { 414 if (rc > 0) {
413 printf("Rockbox loaded."); 415 printf("Rockbox loaded.");
414 return (void*)DRAM_START; 416 return (void*)DRAM_START;
415 } else if (rc == EFILE_NOT_FOUND) { 417 } else if (rc == EFILE_NOT_FOUND) {
@@ -424,7 +426,7 @@ void* main(void)
424 426
425 printf("Error!"); 427 printf("Error!");
426 printf("Can't load " BOOTFILE ": "); 428 printf("Can't load " BOOTFILE ": ");
427 printf(strerror(rc)); 429 printf(loader_strerror(rc));
428 } 430 }
429 431
430 /* If we get to here, then we haven't been able to load any firmware */ 432 /* If we get to here, then we haven't been able to load any firmware */