summaryrefslogtreecommitdiffstats
path: root/bootloader/mpio_hd200_hd300.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/mpio_hd200_hd300.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/mpio_hd200_hd300.c')
-rw-r--r--bootloader/mpio_hd200_hd300.c26
1 files changed, 7 insertions, 19 deletions
diff --git a/bootloader/mpio_hd200_hd300.c b/bootloader/mpio_hd200_hd300.c
index 3e4ba76c83..1828907ea7 100644
--- a/bootloader/mpio_hd200_hd300.c
+++ b/bootloader/mpio_hd200_hd300.c
@@ -43,6 +43,8 @@
#include "file.h"
#include "common.h"
+#include "rb-loader.h"
+#include "loader_strerror.h"
#include "version.h"
#include <stdarg.h>
@@ -199,35 +201,21 @@ static void rb_boot(void)
rc = storage_init();
if(rc)
- {
- printf("ATA error: %d", rc);
- sleep(HZ*5);
- return;
- }
+ error(EATA, rc, true);
disk_init();
rc = disk_mount_all();
- if (rc<=0)
- {
- printf("No partition found");
- sleep(HZ*5);
- return;
- }
+ if (rc <= 0)
+ error(EDISK, rc, true);
printf("Loading firmware");
rc = load_firmware((unsigned char *)DRAM_START,
BOOTFILE, MAX_LOADSIZE);
- if (rc < EOK)
- {
- printf("Error!");
- printf("Can't load " BOOTFILE ": ");
- printf("Result: %s", strerror(rc));
- sleep(HZ*5);
- return;
- }
+ if (rc <= EFILE_EMPTY)
+ error(EBOOTFILE, rc, true);
cpu_boost(false);
start_rockbox();