diff options
author | Marcin Bukat <marcin.bukat@gmail.com> | 2012-03-04 15:34:29 +0100 |
---|---|---|
committer | Marcin Bukat <marcin.bukat@gmail.com> | 2013-06-27 13:50:11 +0200 |
commit | 0b29691324e5700f15ea653592bf29f8552d47d7 (patch) | |
tree | 00e4f77f28c813a493cd8af22170f486f6e82903 /bootloader/mpio_hd200_hd300.c | |
parent | 46ea8bfe7c690c8db230fff3a582a69779f8e432 (diff) | |
download | rockbox-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.c | 26 |
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 @@ | |||
43 | #include "file.h" | 43 | #include "file.h" |
44 | 44 | ||
45 | #include "common.h" | 45 | #include "common.h" |
46 | #include "rb-loader.h" | ||
47 | #include "loader_strerror.h" | ||
46 | #include "version.h" | 48 | #include "version.h" |
47 | 49 | ||
48 | #include <stdarg.h> | 50 | #include <stdarg.h> |
@@ -199,35 +201,21 @@ static void rb_boot(void) | |||
199 | 201 | ||
200 | rc = storage_init(); | 202 | rc = storage_init(); |
201 | if(rc) | 203 | if(rc) |
202 | { | 204 | error(EATA, rc, true); |
203 | printf("ATA error: %d", rc); | ||
204 | sleep(HZ*5); | ||
205 | return; | ||
206 | } | ||
207 | 205 | ||
208 | disk_init(); | 206 | disk_init(); |
209 | 207 | ||
210 | rc = disk_mount_all(); | 208 | rc = disk_mount_all(); |
211 | if (rc<=0) | 209 | if (rc <= 0) |
212 | { | 210 | error(EDISK, rc, true); |
213 | printf("No partition found"); | ||
214 | sleep(HZ*5); | ||
215 | return; | ||
216 | } | ||
217 | 211 | ||
218 | printf("Loading firmware"); | 212 | printf("Loading firmware"); |
219 | 213 | ||
220 | rc = load_firmware((unsigned char *)DRAM_START, | 214 | rc = load_firmware((unsigned char *)DRAM_START, |
221 | BOOTFILE, MAX_LOADSIZE); | 215 | BOOTFILE, MAX_LOADSIZE); |
222 | 216 | ||
223 | if (rc < EOK) | 217 | if (rc <= EFILE_EMPTY) |
224 | { | 218 | error(EBOOTFILE, rc, true); |
225 | printf("Error!"); | ||
226 | printf("Can't load " BOOTFILE ": "); | ||
227 | printf("Result: %s", strerror(rc)); | ||
228 | sleep(HZ*5); | ||
229 | return; | ||
230 | } | ||
231 | 219 | ||
232 | cpu_boost(false); | 220 | cpu_boost(false); |
233 | start_rockbox(); | 221 | start_rockbox(); |