Permalink
Browse files

From funman: Add support to mkamsboot for FuzeV2

  • Loading branch information...
1 parent addbc61 commit 3dbfcf16c522c9edd88c854352ffb5dbef9811ca Steven Price committed May 31, 2009
Showing with 35 additions and 6 deletions.
  1. +8 −3 rbutil/mkamsboot/Makefile
  2. +18 −1 rbutil/mkamsboot/dualboot.S
  3. +9 −2 rbutil/mkamsboot/mkamsboot.c
View
@@ -8,8 +8,8 @@ LIBUCL=../../tools/ucl/src/libucl.a
# adding a new target. mkamsboot.c also needs to be edited to refer to these
# new images.
-BOOTIMAGES = dualboot_clip.o dualboot_e200v2.o dualboot_c200v2.o dualboot_m200v4.o dualboot_fuze.o dualboot_clipv2.o
-BOOTHEADERS = dualboot_clip.h dualboot_e200v2.h dualboot_c200v2.h dualboot_m200v4.h dualboot_fuze.h dualboot_clipv2.h
+BOOTIMAGES = dualboot_clip.o dualboot_e200v2.o dualboot_c200v2.o dualboot_m200v4.o dualboot_fuze.o dualboot_clipv2.o dualboot_fuzev2.o
+BOOTHEADERS = dualboot_clip.h dualboot_e200v2.h dualboot_c200v2.h dualboot_m200v4.h dualboot_fuze.h dualboot_clipv2.h dualboot_fuzev2.h
CLIPFILES = dualboot_clip.arm-o dualboot_clip.o dualboot_clip.c dualboot_clip.h
@@ -26,6 +26,8 @@ C200V2FILES = dualboot_c200v2.arm-o dualboot_c200v2.o dualboot_c200v2.c \
FUZEFILES = dualboot_fuze.arm-o dualboot_fuze.o dualboot_fuze.c dualboot_fuze.h
+FUZEV2FILES = dualboot_fuzev2.arm-o dualboot_fuzev2.o dualboot_fuzev2.c dualboot_fuzev2.h
+
all: mkamsboot
# Dualboot bootloaders
@@ -48,6 +50,9 @@ dualboot_m200v4.arm-o: dualboot.S
dualboot_c200v2.arm-o: dualboot.S
arm-elf-gcc -DSANSA_C200V2 -c -o dualboot_c200v2.arm-o dualboot.S
+dualboot_fuzev2.arm-o: dualboot.S
+ arm-elf-gcc -DSANSA_FUZEV2 -c -o dualboot_fuzev2.arm-o dualboot.S
+
# Rules for the ucl unpack function
nrv2e_d8.arm-o: nrv2e_d8.S
arm-elf-gcc -DPURE_THUMB -c -o nrv2e_d8.arm-o nrv2e_d8.S
@@ -92,4 +97,4 @@ clean:
rm -f mkamsboot mkamsboot.o nrv2e_d8.arm-o nrv2e_d8.arm-elf \
nrv2e_d8.arm-bin *~ bin2c nrv2e_d8.c nrv2e_d8.h nrv2e_d8.o md5.o \
$(BOOTIMAGES) $(CLIPFILES) $(E200V2FILES) $(M200V4FILES) $(FUZEFILES) \
- $(C200V2FILES) $(CLIPV2FILES)
+ $(C200V2FILES) $(CLIPV2FILES) $(FUZEV2FILES)
@@ -21,7 +21,7 @@
.text
- #if defined(SANSA_CLIPV2)
+ #if defined(SANSA_CLIPV2) || defined(SANSA_FUZEV2)
.set RAM_SIZE, 0x100000 /* Use 1MB of SDRAM on V2 models (bigger firmwares) */
#else
.set RAM_SIZE, 0x50000 /* Use full IRAM on V1 models */
@@ -136,6 +136,23 @@ uclcopy:
cmp r1, #0
beq boot_of
+#elif defined(SANSA_FUZEV2)
+ ldr r0, =GPIOA
+ @ldr r0, =GPIOB
+ @ldr r0, =GPIOC
+ @ldr r0, =GPIOD
+
+.set pin, 0 @ 1, 2, 3, 4, 5, 6, 7
+ ldr r0, [r0, #(4*(1<<pin))]
+ cmp r0, #0
+ beq boot_of @ if the pin is unset, boot immediately
+ @ else, boot after a noticeable delay
+
+delay: mov r0, #0x100000
+1: subs r0, r0, #1
+ bne 1b
+
+ b boot_of
#elif defined(SANSA_E200V2) || defined(SANSA_FUZE)
/* LEFT button */
ldr r0, =GPIOC
@@ -96,6 +96,7 @@ execution to the uncompressed firmware.
#include "dualboot_fuze.h"
#include "dualboot_m200v4.h"
#include "dualboot_c200v2.h"
+#include "dualboot_fuzev2.h"
/* Win32 compatibility */
#ifndef O_BINARY
@@ -115,6 +116,7 @@ enum
MODEL_E200V2,
MODEL_M200V4,
MODEL_C200V2,
+ MODEL_FUZEV2,
};
static const char* model_names[] =
@@ -124,7 +126,8 @@ static const char* model_names[] =
"Clip V2",
"e200 v2",
"m200 v4",
- "c200 v2"
+ "c200 v2",
+ "Fuze v2"
};
static const unsigned char* bootloaders[] =
@@ -135,6 +138,7 @@ static const unsigned char* bootloaders[] =
dualboot_e200v2,
dualboot_m200v4,
dualboot_c200v2,
+ dualboot_fuzev2,
};
static const int bootloader_sizes[] =
@@ -145,6 +149,7 @@ static const int bootloader_sizes[] =
sizeof(dualboot_e200v2),
sizeof(dualboot_m200v4),
sizeof(dualboot_c200v2),
+ sizeof(dualboot_fuzev2),
};
/* Model names used in the Rockbox header in ".sansa" files - these match the
@@ -157,6 +162,7 @@ static const char* rb_model_names[] =
"e2v2",
"m2v4",
"c2v2",
+ "fuz2",
};
/* Model numbers used to initialise the checksum in the Rockbox header in
@@ -168,7 +174,8 @@ static const int rb_model_num[] =
66,
41,
42,
- 44
+ 44,
+ 67
};
struct md5sums {

0 comments on commit 3dbfcf1

Please sign in to comment.