summaryrefslogtreecommitdiff
path: root/rbutil/mkamsboot/dualboot/dualboot.S
diff options
context:
space:
mode:
authorRafaël Carré <rafael.carre@gmail.com>2010-02-17 18:27:50 +0000
committerRafaël Carré <rafael.carre@gmail.com>2010-02-17 18:27:50 +0000
commit40e833af5f0551246c3fa7542bcf4db9c5be976d (patch)
treea73071b3b2398eac06a6e1b1e1cda65a0e8daf2d /rbutil/mkamsboot/dualboot/dualboot.S
parentb4e1cae3d617cb6cab27dca06df5d1cf5f4fe73f (diff)
downloadrockbox-40e833af5f0551246c3fa7542bcf4db9c5be976d.tar.gz
rockbox-40e833af5f0551246c3fa7542bcf4db9c5be976d.zip
Clip+ remove setting GPIOB PIN0, it seems needed only for power
Also only use 0x50000 bytes of memory since the files just fit in. TODO: make mkamsboot abort if the decompressed OF or bootloader doesn't fit in RAM / or overlap on compressed data or uclunpack function git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24727 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'rbutil/mkamsboot/dualboot/dualboot.S')
-rw-r--r--rbutil/mkamsboot/dualboot/dualboot.S24
1 files changed, 4 insertions, 20 deletions
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)