diff options
author | Nils Wallménius <nils@rockbox.org> | 2009-03-17 20:05:03 +0000 |
---|---|---|
committer | Nils Wallménius <nils@rockbox.org> | 2009-03-17 20:05:03 +0000 |
commit | 6ce98bda11c26f209c8319213677dd411a9713b7 (patch) | |
tree | b58c1068e4d5f26c0b6741fc15233eabda9b571a /bootloader | |
parent | 877efe1123d85ed60e54cd214ef044f64c06c735 (diff) | |
download | rockbox-6ce98bda11c26f209c8319213677dd411a9713b7.tar.gz 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.c | 55 |
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) | |||
543 | i, pinfo->type, pinfo->size / 2048); | 543 | i, pinfo->type, pinfo->size / 2048); |
544 | } | 544 | } |
545 | 545 | ||
546 | /* Try loading Rockbox, if that fails, fall back to the OF */ | ||
547 | if((btn & BOOTLOADER_BOOT_OF) == 0) | ||
548 | { | ||
549 | printf("Loading Rockbox..."); | ||
550 | rc = load_mi4(loadbuffer, BOOTFILE, MAX_LOADSIZE); | ||
551 | if (rc < EOK) | ||
552 | { | ||
553 | bool old_verbose = verbose; | ||
554 | verbose = true; | ||
555 | printf("Can't load " BOOTFILE ": "); | ||
556 | printf(strerror(rc)); | ||
557 | verbose = old_verbose; | ||
558 | btn |= BOOTLOADER_BOOT_OF; | ||
559 | sleep(5*HZ); | ||
560 | } | ||
561 | else | ||
562 | return (void*)loadbuffer; | ||
563 | } | ||
564 | |||
546 | if(btn & BOOTLOADER_BOOT_OF) | 565 | if(btn & BOOTLOADER_BOOT_OF) |
547 | { | 566 | { |
548 | /* Load original mi4 firmware in to a memory buffer called loadbuffer. | 567 | /* Load original mi4 firmware in to a memory buffer called loadbuffer. |
@@ -602,42 +621,6 @@ void* main(void) | |||
602 | } | 621 | } |
603 | 622 | ||
604 | error(0, 0); | 623 | error(0, 0); |
605 | |||
606 | } else { | ||
607 | #if 0 /* e200: enable to be able to dump the hidden partition */ | ||
608 | if(btn & BUTTON_UP) | ||
609 | { | ||
610 | int fd; | ||
611 | pinfo = disk_partinfo(1); | ||
612 | fd = open("/part.bin", O_CREAT|O_RDWR); | ||
613 | char sector[512]; | ||
614 | for(i=0; i<40960; i++){ | ||
615 | if (!(i%100)) | ||
616 | { | ||
617 | printf("dumping sector %d", i); | ||
618 | } | ||
619 | storage_read_sectors(IF_MV2(0,) pinfo->start + i, 1, sector); | ||
620 | write(fd,sector,512); | ||
621 | } | ||
622 | close(fd); | ||
623 | } | ||
624 | #endif | ||
625 | printf("Loading Rockbox..."); | ||
626 | rc=load_mi4(loadbuffer, BOOTFILE, MAX_LOADSIZE); | ||
627 | if (rc < EOK) { | ||
628 | printf("Can't load " BOOTFILE ": "); | ||
629 | printf(strerror(rc)); | ||
630 | |||
631 | #ifdef OLD_BOOTFILE | ||
632 | /* Try loading rockbox from old rockbox.e200/rockbox.h10 format */ | ||
633 | rc=load_firmware(loadbuffer, OLD_BOOTFILE, MAX_LOADSIZE); | ||
634 | if (rc < EOK) { | ||
635 | printf("Can't load " OLD_BOOTFILE" : "); | ||
636 | error(EBOOTFILE, rc); | ||
637 | } | ||
638 | #endif | ||
639 | } | ||
640 | } | 624 | } |
641 | |||
642 | return (void*)loadbuffer; | 625 | return (void*)loadbuffer; |
643 | } | 626 | } |