From 0b29691324e5700f15ea653592bf29f8552d47d7 Mon Sep 17 00:00:00 2001 From: Marcin Bukat Date: Sun, 4 Mar 2012 15:34:29 +0100 Subject: 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 --- bootloader/mpio_hd200_hd300.c | 26 +++++++------------------- 1 file changed, 7 insertions(+), 19 deletions(-) (limited to 'bootloader/mpio_hd200_hd300.c') 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 @@ -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(); -- cgit v1.2.3