summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--rbutil/mkamsboot/dualboot.c24
-rw-r--r--rbutil/mkamsboot/dualboot.h2
-rw-r--r--rbutil/mkamsboot/dualboot/dualboot.S32
-rw-r--r--rbutil/mkamsboot/mkamsboot.c2
4 files changed, 43 insertions, 17 deletions
diff --git a/rbutil/mkamsboot/dualboot.c b/rbutil/mkamsboot/dualboot.c
index 01a3083..998d0ed 100644
--- a/rbutil/mkamsboot/dualboot.c
+++ b/rbutil/mkamsboot/dualboot.c
@@ -116,17 +116,21 @@ unsigned char dualboot_clipv2[272] = {
0x01, 0x00, 0x83, 0xe2, 0x00, 0x20, 0xa0, 0xe3, 0x15, 0xff, 0x2f, 0xe1, 0x38, 0x00, 0x00, 0x00,
0xff, 0xff, 0x0f, 0x00, 0x14, 0x00, 0x0f, 0xc8, 0x00, 0x00, 0x0b, 0xc8, 0x00, 0x00, 0x0e, 0xc8
};
-unsigned char dualboot_clipplus[188] = {
- 0xa8, 0xf0, 0x9f, 0xe5, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+unsigned char dualboot_clipplus[256] = {
+ 0xe0, 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, 0x20, 0x00, 0x1f, 0xe5, 0x20, 0x10, 0x1f, 0xe5,
- 0x01, 0x20, 0x40, 0xe0, 0x68, 0x30, 0x9f, 0xe5, 0x01, 0x40, 0x50, 0xe4, 0x01, 0x40, 0x43, 0xe4,
- 0x00, 0x00, 0x52, 0xe1, 0xfb, 0xff, 0xff, 0x1a, 0x02, 0x50, 0x83, 0xe2, 0x54, 0x00, 0x9f, 0xe5,
- 0x00, 0x10, 0x90, 0xe5, 0x01, 0x18, 0x81, 0xe3, 0x00, 0x10, 0x80, 0xe5, 0x05, 0x06, 0xa0, 0xe3,
- 0x01, 0x00, 0x50, 0xe2, 0xfd, 0xff, 0xff, 0x1a, 0x02, 0x00, 0x00, 0xea, 0x54, 0x00, 0x1f, 0xe5,
- 0x54, 0x10, 0x1f, 0xe5, 0x01, 0x00, 0x00, 0xea, 0x68, 0x00, 0x1f, 0xe5, 0x68, 0x10, 0x1f, 0xe5,
- 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,
- 0x38, 0x00, 0x00, 0x00, 0xff, 0xff, 0x0f, 0x00, 0x14, 0x00, 0x0f, 0xc8
+ 0x01, 0x20, 0x40, 0xe0, 0xa0, 0x30, 0x9f, 0xe5, 0x01, 0x40, 0x50, 0xe4, 0x01, 0x40, 0x43, 0xe4,
+ 0x00, 0x00, 0x52, 0xe1, 0xfb, 0xff, 0xff, 0x1a, 0x02, 0x50, 0x83, 0xe2, 0x8c, 0x00, 0x9f, 0xe5,
+ 0x00, 0x10, 0x90, 0xe5, 0x01, 0x18, 0x81, 0xe3, 0x00, 0x10, 0x80, 0xe5, 0x80, 0x00, 0x9f, 0xe5,
+ 0x01, 0x10, 0xa0, 0xe3, 0x00, 0x14, 0x80, 0xe5, 0x04, 0x10, 0x80, 0xe5, 0x7d, 0x1f, 0xa0, 0xe3,
+ 0x01, 0x10, 0x51, 0xe2, 0xfd, 0xff, 0xff, 0x1a, 0x68, 0x00, 0x9f, 0xe5, 0x20, 0x10, 0x90, 0xe5,
+ 0x64, 0x00, 0x9f, 0xe5, 0x08, 0x20, 0x90, 0xe5, 0x01, 0x20, 0x82, 0xe1, 0x50, 0x00, 0x9f, 0xe5,
+ 0x00, 0x10, 0xa0, 0xe3, 0x00, 0x14, 0x80, 0xe5, 0x00, 0x10, 0x80, 0xe5, 0x00, 0x00, 0x52, 0xe3,
+ 0x02, 0x00, 0x00, 0x1a, 0x8c, 0x00, 0x1f, 0xe5, 0x8c, 0x10, 0x1f, 0xe5, 0x01, 0x00, 0x00, 0xea,
+ 0xa0, 0x00, 0x1f, 0xe5, 0xa0, 0x10, 0x1f, 0xe5, 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, 0x38, 0x00, 0x00, 0x00, 0xff, 0xff, 0x0f, 0x00,
+ 0x14, 0x00, 0x0f, 0xc8, 0x00, 0x00, 0x0c, 0xc8, 0x00, 0x00, 0x0d, 0xc8, 0x00, 0x00, 0x0b, 0xc8
};
diff --git a/rbutil/mkamsboot/dualboot.h b/rbutil/mkamsboot/dualboot.h
index f3f1fc7..3dcb511 100644
--- a/rbutil/mkamsboot/dualboot.h
+++ b/rbutil/mkamsboot/dualboot.h
@@ -7,4 +7,4 @@ extern unsigned char dualboot_c200v2[228];
extern unsigned char dualboot_m200v4[204];
extern unsigned char dualboot_fuze[228];
extern unsigned char dualboot_clipv2[272];
-extern unsigned char dualboot_clipplus[188];
+extern unsigned char dualboot_clipplus[256];
diff --git a/rbutil/mkamsboot/dualboot/dualboot.S b/rbutil/mkamsboot/dualboot/dualboot.S
index fe1a64b..10f943f 100644
--- a/rbutil/mkamsboot/dualboot/dualboot.S
+++ b/rbutil/mkamsboot/dualboot/dualboot.S
@@ -157,11 +157,35 @@ uclcopy:
cmp r1, #0 /* C3 = #0 means button pressed */
beq boot_of
#elif defined(SANSA_CLIPPLUS)
- /* TODO */
- mov r0, #0x500000 /* Approximately 5 seconds */
-1: subs r0, r0, #1 /* just to prove we are running */
+ @ Assumes GPIOB_DIR is 0x00 on reset
+ ldr r0, =GPIOB
+ mov r1, #(1<<0) @ pin 0
+ str r1, [r0, #0x400] @ GPIOB(0) = output
+ str r1, [r0, #4*(1<<0)] @ write 1 to GPIOB(0)
+
+ mov r1, #500 @ small delay
+1: subs r1, r1, #1
bne 1b
- b boot_of /* branch to OF */
+
+ @ read pins
+ ldr r0, =GPIOC
+ ldr r1, [r0, #4*(1<<3)] @ read pin C3 "|<<"
+
+ ldr r0, =GPIOA
+ ldr r2, [r0, #4*(1<<1)] @ read pin A1 "Home"
+
+ orr r2, r2, r1 @ c3 || A1
+
+ @ restore GPIOB_DIR(0)
+ ldr r0, =GPIOB
+ mov r1, #0
+ str r1, [r0, #0x400] @ Restore GPIOB_DIR to 0x00
+
+ @ Unset GPIOB(0)
+ str r1, [r0, #4*(0<<0)] @ write 0 to GPIOB(0)
+
+ cmp r2, #0 @ test input from pins
+ bne boot_of @ branch directly to OF if either pin high
#elif defined(SANSA_C200V2)
/* check for RIGHT on C6, should changed to LEFT as soon as it
* known in which pin that is in order for consistency */
diff --git a/rbutil/mkamsboot/mkamsboot.c b/rbutil/mkamsboot/mkamsboot.c
index 18fbcb4..5b00060 100644
--- a/rbutil/mkamsboot/mkamsboot.c
+++ b/rbutil/mkamsboot/mkamsboot.c
@@ -222,9 +222,7 @@ static struct md5sums sansasums[] = {
{ MODEL_CLIPV2, "2.01.16", "c57fb3fcbe07c2c9b360f060938f80cb" },
{ MODEL_CLIPV2, "2.01.32", "0ad3723e52022509089d938d0fbbf8c5" },
-#if 0 /* uncomment when Clip+ support is tested */
{ MODEL_CLIPPLUS, "01.02.09", "656d38114774c2001dc18e6726df3c5d" },
-#endif
};
#define NUM_MD5S (sizeof(sansasums)/sizeof(sansasums[0]))