summaryrefslogtreecommitdiffstats
path: root/bootloader
diff options
context:
space:
mode:
authorNils Wallménius <nils@rockbox.org>2009-03-17 20:05:03 +0000
committerNils Wallménius <nils@rockbox.org>2009-03-17 20:05:03 +0000
commit6ce98bda11c26f209c8319213677dd411a9713b7 (patch)
treeb58c1068e4d5f26c0b6741fc15233eabda9b571a /bootloader
parent877efe1123d85ed60e54cd214ef044f64c06c735 (diff)
downloadrockbox-6ce98bda11c26f209c8319213677dd411a9713b7.tar.gz
rockbox-6ce98bda11c26f209c8319213677dd411a9713b7.tar.bz2
rockbox-6ce98bda11c26f209c8319213677dd411a9713b7.zip
FS#10018 general pp bootloader: start the OF if loading rockbox fails. Resolves a bug where the c200 bootloader would loop flashing the logo if loading rockbox failed and drop support for loading old .e200 and .h10 rockbox main binaries for the e200 resp h10, affects e200, c200, h10 (both kinds) and mrobe 100.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20342 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'bootloader')
-rw-r--r--bootloader/main-pp.c55
1 files changed, 19 insertions, 36 deletions
diff --git a/bootloader/main-pp.c b/bootloader/main-pp.c
index 8381aa2d8a..b26807dd62 100644
--- a/bootloader/main-pp.c
+++ b/bootloader/main-pp.c
@@ -543,6 +543,25 @@ void* main(void)
i, pinfo->type, pinfo->size / 2048);
}
+ /* Try loading Rockbox, if that fails, fall back to the OF */
+ if((btn & BOOTLOADER_BOOT_OF) == 0)
+ {
+ printf("Loading Rockbox...");
+ rc = load_mi4(loadbuffer, BOOTFILE, MAX_LOADSIZE);
+ if (rc < EOK)
+ {
+ bool old_verbose = verbose;
+ verbose = true;
+ printf("Can't load " BOOTFILE ": ");
+ printf(strerror(rc));
+ verbose = old_verbose;
+ btn |= BOOTLOADER_BOOT_OF;
+ sleep(5*HZ);
+ }
+ else
+ return (void*)loadbuffer;
+ }
+
if(btn & BOOTLOADER_BOOT_OF)
{
/* Load original mi4 firmware in to a memory buffer called loadbuffer.
@@ -602,42 +621,6 @@ void* main(void)
}
error(0, 0);
-
- } else {
-#if 0 /* e200: enable to be able to dump the hidden partition */
- if(btn & BUTTON_UP)
- {
- int fd;
- pinfo = disk_partinfo(1);
- fd = open("/part.bin", O_CREAT|O_RDWR);
- char sector[512];
- for(i=0; i<40960; i++){
- if (!(i%100))
- {
- printf("dumping sector %d", i);
- }
- storage_read_sectors(IF_MV2(0,) pinfo->start + i, 1, sector);
- write(fd,sector,512);
- }
- close(fd);
- }
-#endif
- printf("Loading Rockbox...");
- rc=load_mi4(loadbuffer, BOOTFILE, MAX_LOADSIZE);
- if (rc < EOK) {
- printf("Can't load " BOOTFILE ": ");
- printf(strerror(rc));
-
-#ifdef OLD_BOOTFILE
- /* Try loading rockbox from old rockbox.e200/rockbox.h10 format */
- rc=load_firmware(loadbuffer, OLD_BOOTFILE, MAX_LOADSIZE);
- if (rc < EOK) {
- printf("Can't load " OLD_BOOTFILE" : ");
- error(EBOOTFILE, rc);
- }
-#endif
- }
}
-
return (void*)loadbuffer;
}