diff options
author | Thomas Martitz <kugel@rockbox.org> | 2010-02-26 13:55:17 +0000 |
---|---|---|
committer | Thomas Martitz <kugel@rockbox.org> | 2010-02-26 13:55:17 +0000 |
commit | f6540e800db616a783a13bc47b7f5710c004bf71 (patch) | |
tree | 95ea7ee56408cb778258d5816c1a69161047eef1 /rbutil | |
parent | 92f0aa85fcdffc83a0e06f50c0580d5932075c43 (diff) | |
download | rockbox-f6540e800db616a783a13bc47b7f5710c004bf71.tar.gz rockbox-f6540e800db616a783a13bc47b7f5710c004bf71.zip |
Sansa Fuzev2: Add mkamsboot and dualboot support. The bootloader doesn't work, but pressing |<< or inserting USB to boot the OF does.
It should be pretty safe to run test code on it now.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24924 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'rbutil')
-rw-r--r-- | rbutil/mkamsboot/dualboot.c | 17 | ||||
-rw-r--r-- | rbutil/mkamsboot/dualboot.h | 1 | ||||
-rw-r--r-- | rbutil/mkamsboot/dualboot/Makefile | 7 | ||||
-rw-r--r-- | rbutil/mkamsboot/dualboot/dualboot.S | 10 | ||||
-rw-r--r-- | rbutil/mkamsboot/mkamsboot.c | 12 | ||||
-rw-r--r-- | rbutil/mkamsboot/mkamsboot.h | 1 |
6 files changed, 44 insertions, 4 deletions
diff --git a/rbutil/mkamsboot/dualboot.c b/rbutil/mkamsboot/dualboot.c index 32dad00ff0..527850d452 100644 --- a/rbutil/mkamsboot/dualboot.c +++ b/rbutil/mkamsboot/dualboot.c @@ -136,3 +136,20 @@ unsigned char dualboot_clipplus[216] = { 0x00, 0x20, 0xa0, 0xe3, 0x15, 0xff, 0x2f, 0xe1, 0x3c, 0x00, 0x00, 0x00, 0x14, 0x00, 0x0f, 0xc8, 0x00, 0x00, 0x0d, 0xc8, 0x00, 0x00, 0x0b, 0xc8 }; +unsigned char dualboot_fuzev2[236] = { + 0xd4, 0xf0, 0x9f, 0xe5, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x24, 0x00, 0x1f, 0xe5, + 0x24, 0x10, 0x1f, 0xe5, 0x01, 0x20, 0x40, 0xe0, 0x18, 0x30, 0x1f, 0xe5, 0x01, 0x40, 0x50, 0xe4, + 0x01, 0x40, 0x43, 0xe4, 0x00, 0x00, 0x52, 0xe1, 0xfb, 0xff, 0xff, 0x1a, 0x2c, 0x30, 0x0f, 0xe5, + 0x78, 0x00, 0x9f, 0xe5, 0x00, 0x10, 0x90, 0xe5, 0x01, 0x18, 0x81, 0xe3, 0x00, 0x10, 0x80, 0xe5, + 0x6c, 0x00, 0x9f, 0xe5, 0x00, 0x10, 0xa0, 0xe3, 0x00, 0x14, 0x80, 0xe5, 0x20, 0x10, 0x90, 0xe5, + 0x00, 0x00, 0x51, 0xe3, 0x08, 0x00, 0x00, 0x1a, 0x58, 0x00, 0x9f, 0xe5, 0x00, 0x10, 0xa0, 0xe3, + 0x00, 0x14, 0x80, 0xe5, 0x20, 0x10, 0x90, 0xe5, 0x00, 0x00, 0x51, 0xe3, 0x02, 0x00, 0x00, 0x1a, + 0x78, 0x00, 0x1f, 0xe5, 0x78, 0x10, 0x1f, 0xe5, 0x01, 0x00, 0x00, 0xea, 0x8c, 0x00, 0x1f, 0xe5, + 0x8c, 0x10, 0x1f, 0xe5, 0x84, 0x30, 0x1f, 0xe5, 0x02, 0x50, 0x83, 0xe2, 0x01, 0x40, 0x43, 0xe0, + 0x01, 0x20, 0x50, 0xe4, 0x01, 0x20, 0x43, 0xe4, 0x04, 0x00, 0x53, 0xe1, 0xfb, 0xff, 0xff, 0x1a, + 0x01, 0x00, 0x83, 0xe2, 0x00, 0x20, 0xa0, 0xe3, 0x15, 0xff, 0x2f, 0xe1, 0x3c, 0x00, 0x00, 0x00, + 0x14, 0x00, 0x0f, 0xc8, 0x00, 0x00, 0x0b, 0xc8, 0x00, 0x00, 0x0d, 0xc8 +}; diff --git a/rbutil/mkamsboot/dualboot.h b/rbutil/mkamsboot/dualboot.h index 28139ae34f..d67ad2b6d1 100644 --- a/rbutil/mkamsboot/dualboot.h +++ b/rbutil/mkamsboot/dualboot.h @@ -8,3 +8,4 @@ extern unsigned char dualboot_m200v4[212]; extern unsigned char dualboot_fuze[236]; extern unsigned char dualboot_clipv2[280]; extern unsigned char dualboot_clipplus[216]; +extern unsigned char dualboot_fuzev2[236]; diff --git a/rbutil/mkamsboot/dualboot/Makefile b/rbutil/mkamsboot/dualboot/Makefile index 8a441c9237..cc788f1fe5 100644 --- a/rbutil/mkamsboot/dualboot/Makefile +++ b/rbutil/mkamsboot/dualboot/Makefile @@ -4,8 +4,8 @@ CC=gcc # adding a new target. mkamsboot.c also needs to be edited to refer to these # new images. -BOOTOBJS = nrv2e_d8.o dualboot_clip.o dualboot_e200v2.o dualboot_c200v2.o dualboot_m200v4.o dualboot_fuze.o dualboot_clipv2.o dualboot_clipplus.o -BOOTBINS = nrv2e_d8.arm-bin dualboot_clip.arm-bin dualboot_e200v2.arm-bin dualboot_c200v2.arm-bin dualboot_m200v4.arm-bin dualboot_fuze.arm-bin dualboot_clipv2.arm-bin dualboot_clipplus.arm-bin +BOOTOBJS = nrv2e_d8.o dualboot_clip.o dualboot_e200v2.o dualboot_c200v2.o dualboot_m200v4.o dualboot_fuze.o dualboot_clipv2.o dualboot_clipplus.o dualboot_fuzev2.o +BOOTBINS = nrv2e_d8.arm-bin dualboot_clip.arm-bin dualboot_e200v2.arm-bin dualboot_c200v2.arm-bin dualboot_m200v4.arm-bin dualboot_fuze.arm-bin dualboot_clipv2.arm-bin dualboot_clipplus.arm-bin dualboot_fuzev2.arm-bin all: ../dualboot.h ../dualboot.c @@ -32,6 +32,9 @@ dualboot_clipv2.o: dualboot.S dualboot_clipplus.o: dualboot.S arm-elf-gcc -DSANSA_CLIPPLUS -c -o dualboot_clipplus.o dualboot.S +dualboot_fuzev2.o: dualboot.S + arm-elf-gcc -DSANSA_FUZEV2 -c -o dualboot_fuzev2.o dualboot.S + # Rules for the ucl unpack function nrv2e_d8.o: nrv2e_d8.S arm-elf-gcc -DPURE_THUMB -c -o nrv2e_d8.o nrv2e_d8.S diff --git a/rbutil/mkamsboot/dualboot/dualboot.S b/rbutil/mkamsboot/dualboot/dualboot.S index a27ab34d85..84d2fcee4d 100644 --- a/rbutil/mkamsboot/dualboot/dualboot.S +++ b/rbutil/mkamsboot/dualboot/dualboot.S @@ -83,7 +83,7 @@ uclcopy: #define USB_PIN 1 /* FIXME: not correct on some c200v2s */ #elif defined(SANSA_CLIP) || defined(SANSA_CLIPV2) #define USB_PIN 6 -#elif defined(SANSA_FUZE) || defined(SANSA_E200V2) +#elif defined(SANSA_FUZE) || defined(SANSA_E200V2) || defined(SANSA_FUZEV2) #define USB_PIN 3 #endif @@ -143,14 +143,20 @@ uclcopy: cmp r1, #0 beq boot_of -#elif defined(SANSA_E200V2) || defined(SANSA_FUZE) +#elif defined(SANSA_E200V2) || defined(SANSA_FUZE) || defined(SANSA_FUZEV2) ldr r0, =GPIOC mov r1, #0 str r1, [r0, #0x400] ldr r1, [r0, #0x20] /* read pin C3 */ cmp r1, #0 /* C3 = #0 means button pressed */ +#ifdef SANSA_FUZEV2 + /* the logic is reversed on the fuzev2 */ + bne boot_of +#else beq boot_of +#endif /* SANSA_FUZEV2 */ + #elif defined(SANSA_CLIPPLUS) @ read pins ldr r0, =GPIOC diff --git a/rbutil/mkamsboot/mkamsboot.c b/rbutil/mkamsboot/mkamsboot.c index 9e0099d1b6..4cf1bcd317 100644 --- a/rbutil/mkamsboot/mkamsboot.c +++ b/rbutil/mkamsboot/mkamsboot.c @@ -118,6 +118,7 @@ const unsigned short hw_revisions[] = { [MODEL_M200V4] = 4, [MODEL_C200V2] = 2, [MODEL_CLIPPLUS]= 1, + [MODEL_FUZEV2] = 2, }; /* version 2 is used in Clipv2, Clip+ and Fuzev2 firmwares */ @@ -129,6 +130,7 @@ const unsigned short fw_revisions[] = { [MODEL_M200V4] = 1, [MODEL_C200V2] = 1, [MODEL_CLIPPLUS]= 2, + [MODEL_FUZEV2] = 2, }; /* Descriptive name of these models */ @@ -140,6 +142,7 @@ const char* model_names[] = { [MODEL_E200V2] = "e200", [MODEL_M200V4] = "m200", [MODEL_C200V2] = "c200", + [MODEL_FUZEV2] = "Fuze", }; /* Dualboot functions for these models */ @@ -151,6 +154,7 @@ static const unsigned char* bootloaders[] = { [MODEL_M200V4] = dualboot_m200v4, [MODEL_C200V2] = dualboot_c200v2, [MODEL_CLIPPLUS]= dualboot_clipplus, + [MODEL_FUZEV2] = dualboot_fuzev2, }; /* Size of dualboot functions for these models */ @@ -162,6 +166,7 @@ const int bootloader_sizes[] = { [MODEL_M200V4] = sizeof(dualboot_m200v4), [MODEL_C200V2] = sizeof(dualboot_c200v2), [MODEL_CLIPPLUS]= sizeof(dualboot_clipplus), + [MODEL_FUZEV2] = sizeof(dualboot_fuzev2), }; /* Model names used in the Rockbox header in ".sansa" files - these match the @@ -174,6 +179,7 @@ static const char* rb_model_names[] = { [MODEL_M200V4] = "m2v4", [MODEL_C200V2] = "c2v2", [MODEL_CLIPPLUS]= "cli+", + [MODEL_FUZEV2] = "fuz2", }; /* Model numbers used to initialise the checksum in the Rockbox header in @@ -186,6 +192,7 @@ static const int rb_model_num[] = { [MODEL_M200V4] = 42, [MODEL_C200V2] = 44, [MODEL_CLIPPLUS]= 66, + [MODEL_FUZEV2] = 68, }; /* Checksums of unmodified original firmwares - for safety, and device @@ -223,6 +230,9 @@ static struct md5sums sansasums[] = { { MODEL_CLIPV2, "2.01.32", "0ad3723e52022509089d938d0fbbf8c5" }, { MODEL_CLIPPLUS, "01.02.09", "656d38114774c2001dc18e6726df3c5d" }, + + { MODEL_FUZEV2, "2.01.17", "8b85fb05bf645d08a4c8c3e344ec9ebe" }, + { MODEL_FUZEV2, "2.02.26", "d4f6f85c3e4a8ea8f2e5acc421641801" }, }; #define NUM_MD5S (sizeof(sansasums)/sizeof(sansasums[0])) @@ -324,6 +334,8 @@ static int get_model(int model_id) return MODEL_CLIPV2; case 0x28: return MODEL_CLIPPLUS; + case 0x70: + return MODEL_FUZEV2; } return MODEL_UNKNOWN; diff --git a/rbutil/mkamsboot/mkamsboot.h b/rbutil/mkamsboot/mkamsboot.h index cf5628aa5d..835d024d98 100644 --- a/rbutil/mkamsboot/mkamsboot.h +++ b/rbutil/mkamsboot/mkamsboot.h @@ -42,6 +42,7 @@ enum { MODEL_M200V4, MODEL_C200V2, MODEL_CLIPPLUS, + MODEL_FUZEV2, }; |