summaryrefslogtreecommitdiffstats
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.tar.bz2
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 @@
#include "power.h"
#include "file.h"
#include "common.h"
+#include "rb-loader.h"
+#include "loader_strerror.h"
#include "hwcompat.h"
#include "usb.h"
#include "version.h"
@@ -376,7 +378,7 @@ void* main(void)
rc=load_firmware(loadbuffer, "apple_os.ipod", MAX_LOADSIZE);
- if (rc == EOK) {
+ if (rc > 0) {
printf("apple_os.ipod loaded.");
return (void*)DRAM_START;
} else if (rc == EFILE_NOT_FOUND) {
@@ -387,10 +389,10 @@ void* main(void)
/* We have a copy of the retailos in RAM, lets just run it. */
return (void*)DRAM_START;
}
- } else if (rc < EFILE_NOT_FOUND) {
+ } else {
printf("Error!");
printf("Can't load apple_os.ipod:");
- printf(strerror(rc));
+ printf(loader_strerror(rc));
}
/* Everything failed - just loop forever */
@@ -399,17 +401,17 @@ void* main(void)
} else if (btn==BUTTON_PLAY) {
printf("Loading Linux...");
rc=load_raw_firmware(loadbuffer, "/linux.bin", MAX_LOADSIZE);
- if (rc < EOK) {
+ if (rc <= EFILE_EMPTY) {
printf("Error!");
printf("Can't load linux.bin:");
- printf(strerror(rc));
+ printf(loader_strerror(rc));
} else {
return (void*)DRAM_START;
}
} else {
printf("Loading Rockbox...");
rc=load_firmware(loadbuffer, BOOTFILE, MAX_LOADSIZE);
- if (rc == EOK) {
+ if (rc > 0) {
printf("Rockbox loaded.");
return (void*)DRAM_START;
} else if (rc == EFILE_NOT_FOUND) {
@@ -424,7 +426,7 @@ void* main(void)
printf("Error!");
printf("Can't load " BOOTFILE ": ");
- printf(strerror(rc));
+ printf(loader_strerror(rc));
}
/* If we get to here, then we haven't been able to load any firmware */