summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--rbutil/mkamsboot/dualboot.c25
-rw-r--r--rbutil/mkamsboot/dualboot.h2
-rw-r--r--rbutil/mkamsboot/dualboot/dualboot.S24
3 files changed, 16 insertions, 35 deletions
diff --git a/rbutil/mkamsboot/dualboot.c b/rbutil/mkamsboot/dualboot.c
index 85d7210691..fbf2891107 100644
--- a/rbutil/mkamsboot/dualboot.c
+++ b/rbutil/mkamsboot/dualboot.c
@@ -118,21 +118,18 @@ unsigned char dualboot_clipv2[272] = {
118 0x01, 0x00, 0x83, 0xe2, 0x00, 0x20, 0xa0, 0xe3, 0x15, 0xff, 0x2f, 0xe1, 0x38, 0x00, 0x00, 0x00, 118 0x01, 0x00, 0x83, 0xe2, 0x00, 0x20, 0xa0, 0xe3, 0x15, 0xff, 0x2f, 0xe1, 0x38, 0x00, 0x00, 0x00,
119 0xff, 0xff, 0x0f, 0x00, 0x14, 0x00, 0x0f, 0xc8, 0x00, 0x00, 0x0b, 0xc8, 0x00, 0x00, 0x0e, 0xc8 119 0xff, 0xff, 0x0f, 0x00, 0x14, 0x00, 0x0f, 0xc8, 0x00, 0x00, 0x0b, 0xc8, 0x00, 0x00, 0x0e, 0xc8
120}; 120};
121unsigned char dualboot_clipplus[256] = { 121unsigned char dualboot_clipplus[208] = {
122 0xe0, 0xf0, 0x9f, 0xe5, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 122 0xb4, 0xf0, 0x9f, 0xe5, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
123 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 123 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
124 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 124 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
125 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x1f, 0xe5, 0x20, 0x10, 0x1f, 0xe5, 125 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x1f, 0xe5, 0x20, 0x10, 0x1f, 0xe5,
126 0x01, 0x20, 0x40, 0xe0, 0xa0, 0x30, 0x9f, 0xe5, 0x01, 0x40, 0x50, 0xe4, 0x01, 0x40, 0x43, 0xe4, 126 0x01, 0x20, 0x40, 0xe0, 0x74, 0x30, 0x9f, 0xe5, 0x01, 0x40, 0x50, 0xe4, 0x01, 0x40, 0x43, 0xe4,
127 0x00, 0x00, 0x52, 0xe1, 0xfb, 0xff, 0xff, 0x1a, 0x02, 0x50, 0x83, 0xe2, 0x8c, 0x00, 0x9f, 0xe5, 127 0x00, 0x00, 0x52, 0xe1, 0xfb, 0xff, 0xff, 0x1a, 0x02, 0x50, 0x83, 0xe2, 0x60, 0x00, 0x9f, 0xe5,
128 0x00, 0x10, 0x90, 0xe5, 0x01, 0x18, 0x81, 0xe3, 0x00, 0x10, 0x80, 0xe5, 0x80, 0x00, 0x9f, 0xe5, 128 0x00, 0x10, 0x90, 0xe5, 0x01, 0x18, 0x81, 0xe3, 0x00, 0x10, 0x80, 0xe5, 0x54, 0x00, 0x9f, 0xe5,
129 0x01, 0x10, 0xa0, 0xe3, 0x00, 0x14, 0x80, 0xe5, 0x04, 0x10, 0x80, 0xe5, 0x7d, 0x1f, 0xa0, 0xe3, 129 0x20, 0x10, 0x90, 0xe5, 0x50, 0x00, 0x9f, 0xe5, 0x08, 0x20, 0x90, 0xe5, 0x01, 0x20, 0x82, 0xe1,
130 0x01, 0x10, 0x51, 0xe2, 0xfd, 0xff, 0xff, 0x1a, 0x68, 0x00, 0x9f, 0xe5, 0x20, 0x10, 0x90, 0xe5, 130 0x00, 0x00, 0x52, 0xe3, 0x02, 0x00, 0x00, 0x1a, 0x60, 0x00, 0x1f, 0xe5, 0x60, 0x10, 0x1f, 0xe5,
131 0x64, 0x00, 0x9f, 0xe5, 0x08, 0x20, 0x90, 0xe5, 0x01, 0x20, 0x82, 0xe1, 0x50, 0x00, 0x9f, 0xe5, 131 0x01, 0x00, 0x00, 0xea, 0x74, 0x00, 0x1f, 0xe5, 0x74, 0x10, 0x1f, 0xe5, 0x01, 0x40, 0x43, 0xe0,
132 0x00, 0x10, 0xa0, 0xe3, 0x04, 0x10, 0x80, 0xe5, 0x00, 0x14, 0x80, 0xe5, 0x00, 0x00, 0x52, 0xe3, 132 0x01, 0x20, 0x50, 0xe4, 0x01, 0x20, 0x43, 0xe4, 0x04, 0x00, 0x53, 0xe1, 0xfb, 0xff, 0xff, 0x1a,
133 0x02, 0x00, 0x00, 0x1a, 0x8c, 0x00, 0x1f, 0xe5, 0x8c, 0x10, 0x1f, 0xe5, 0x01, 0x00, 0x00, 0xea, 133 0x01, 0x00, 0x83, 0xe2, 0x00, 0x20, 0xa0, 0xe3, 0x15, 0xff, 0x2f, 0xe1, 0x38, 0x00, 0x00, 0x00,
134 0xa0, 0x00, 0x1f, 0xe5, 0xa0, 0x10, 0x1f, 0xe5, 0x01, 0x40, 0x43, 0xe0, 0x01, 0x20, 0x50, 0xe4, 134 0xff, 0xff, 0x04, 0x00, 0x14, 0x00, 0x0f, 0xc8, 0x00, 0x00, 0x0d, 0xc8, 0x00, 0x00, 0x0b, 0xc8
135 0x01, 0x20, 0x43, 0xe4, 0x04, 0x00, 0x53, 0xe1, 0xfb, 0xff, 0xff, 0x1a, 0x01, 0x00, 0x83, 0xe2,
136 0x00, 0x20, 0xa0, 0xe3, 0x15, 0xff, 0x2f, 0xe1, 0x38, 0x00, 0x00, 0x00, 0xff, 0xff, 0x0f, 0x00,
137 0x14, 0x00, 0x0f, 0xc8, 0x00, 0x00, 0x0c, 0xc8, 0x00, 0x00, 0x0d, 0xc8, 0x00, 0x00, 0x0b, 0xc8
138}; 135};
diff --git a/rbutil/mkamsboot/dualboot.h b/rbutil/mkamsboot/dualboot.h
index 3dcb511d13..7d0b177ed7 100644
--- a/rbutil/mkamsboot/dualboot.h
+++ b/rbutil/mkamsboot/dualboot.h
@@ -7,4 +7,4 @@ extern unsigned char dualboot_c200v2[228];
7extern unsigned char dualboot_m200v4[204]; 7extern unsigned char dualboot_m200v4[204];
8extern unsigned char dualboot_fuze[228]; 8extern unsigned char dualboot_fuze[228];
9extern unsigned char dualboot_clipv2[272]; 9extern unsigned char dualboot_clipv2[272];
10extern unsigned char dualboot_clipplus[256]; 10extern unsigned char dualboot_clipplus[208];
diff --git a/rbutil/mkamsboot/dualboot/dualboot.S b/rbutil/mkamsboot/dualboot/dualboot.S
index 0189a5be78..cf11b66cfa 100644
--- a/rbutil/mkamsboot/dualboot/dualboot.S
+++ b/rbutil/mkamsboot/dualboot/dualboot.S
@@ -21,10 +21,11 @@
21 21
22.text 22.text
23 23
24#if defined(SANSA_CLIPV2) || defined(SANSA_CLIPPLUS) 24#if defined(SANSA_CLIPV2)
25.set RAM_SIZE, 0x100000 /* Use 1MB of SDRAM on v2 firmwares (bigger firmware) */ 25.set RAM_SIZE, 0x100000 /* Use 1MB of SDRAM (bigger firmware do not fit in
26 * 0x50000 bytes) */
26#else 27#else
27.set RAM_SIZE, 0x50000 /* Use full IRAM on v1 firmwares */ 28.set RAM_SIZE, 0x50000 /* Use full IRAM (or part of SDRAM on as3525v2) */
28#endif 29#endif
29 30
30/* AS3525 hardware registers */ 31/* AS3525 hardware registers */
@@ -157,17 +158,6 @@ uclcopy:
157 cmp r1, #0 /* C3 = #0 means button pressed */ 158 cmp r1, #0 /* C3 = #0 means button pressed */
158 beq boot_of 159 beq boot_of
159#elif defined(SANSA_CLIPPLUS) 160#elif defined(SANSA_CLIPPLUS)
160 @ All GPIO_DIR == 0x00 from reset
161 @ Set B0
162 ldr r0, =GPIOB
163 mov r1, #(1<<0) @ pin 0
164 str r1, [r0, #0x400] @ GPIOB(0) = output
165 str r1, [r0, #4*(1<<0)] @ write 1 to GPIOB(0) B0 set
166
167 mov r1, #500 @ small delay
1681: subs r1, r1, #1
169 bne 1b
170
171 @ read pins 161 @ read pins
172 ldr r0, =GPIOC 162 ldr r0, =GPIOC
173 ldr r1, [r0, #4*(1<<3)] @ read pin C3 "|<<" 163 ldr r1, [r0, #4*(1<<3)] @ read pin C3 "|<<"
@@ -177,12 +167,6 @@ uclcopy:
177 167
178 orr r2, r2, r1 @ c3 || A1 168 orr r2, r2, r1 @ c3 || A1
179 169
180 @ Unset GPIOB(0) & Restore GPIOB_DIR
181 ldr r0, =GPIOB
182 mov r1, #0
183 str r1, [r0, #4*(1<<0)] @ write 0 to GPIOB(0) B0 unset
184 str r1, [r0, #0x400] @ Restore GPIOB_DIR to 0x00
185
186 cmp r2, #0 @ test input from pins 170 cmp r2, #0 @ test input from pins
187 bne boot_of @ branch directly to OF if either pin high 171 bne boot_of @ branch directly to OF if either pin high
188#elif defined(SANSA_C200V2) 172#elif defined(SANSA_C200V2)