diff options
-rw-r--r-- | rbutil/mkamsboot/dualboot.c | 4 | ||||
-rw-r--r-- | rbutil/mkamsboot/dualboot/dualboot.S | 9 |
2 files changed, 6 insertions, 7 deletions
diff --git a/rbutil/mkamsboot/dualboot.c b/rbutil/mkamsboot/dualboot.c index 25c0c4e48f..015e580213 100644 --- a/rbutil/mkamsboot/dualboot.c +++ b/rbutil/mkamsboot/dualboot.c | |||
@@ -126,8 +126,8 @@ unsigned char dualboot_clipplus[256] = { | |||
126 | 0x00, 0x10, 0x90, 0xe5, 0x01, 0x18, 0x81, 0xe3, 0x00, 0x10, 0x80, 0xe5, 0x80, 0x00, 0x9f, 0xe5, | 126 | 0x00, 0x10, 0x90, 0xe5, 0x01, 0x18, 0x81, 0xe3, 0x00, 0x10, 0x80, 0xe5, 0x80, 0x00, 0x9f, 0xe5, |
127 | 0x01, 0x10, 0xa0, 0xe3, 0x00, 0x14, 0x80, 0xe5, 0x04, 0x10, 0x80, 0xe5, 0x7d, 0x1f, 0xa0, 0xe3, | 127 | 0x01, 0x10, 0xa0, 0xe3, 0x00, 0x14, 0x80, 0xe5, 0x04, 0x10, 0x80, 0xe5, 0x7d, 0x1f, 0xa0, 0xe3, |
128 | 0x01, 0x10, 0x51, 0xe2, 0xfd, 0xff, 0xff, 0x1a, 0x68, 0x00, 0x9f, 0xe5, 0x20, 0x10, 0x90, 0xe5, | 128 | 0x01, 0x10, 0x51, 0xe2, 0xfd, 0xff, 0xff, 0x1a, 0x68, 0x00, 0x9f, 0xe5, 0x20, 0x10, 0x90, 0xe5, |
129 | 0x64, 0x00, 0x9f, 0xe5, 0x08, 0x20, 0x90, 0xe5, 0x01, 0x20, 0x82, 0xe1, 0x00, 0x10, 0xa0, 0xe3, | 129 | 0x64, 0x00, 0x9f, 0xe5, 0x08, 0x20, 0x90, 0xe5, 0x01, 0x20, 0x82, 0xe1, 0x50, 0x00, 0x9f, 0xe5, |
130 | 0x04, 0x10, 0x80, 0xe5, 0x48, 0x00, 0x9f, 0xe5, 0x00, 0x14, 0x80, 0xe5, 0x00, 0x00, 0x52, 0xe3, | 130 | 0x00, 0x10, 0xa0, 0xe3, 0x04, 0x10, 0x80, 0xe5, 0x00, 0x14, 0x80, 0xe5, 0x00, 0x00, 0x52, 0xe3, |
131 | 0x02, 0x00, 0x00, 0x1a, 0x8c, 0x00, 0x1f, 0xe5, 0x8c, 0x10, 0x1f, 0xe5, 0x01, 0x00, 0x00, 0xea, | 131 | 0x02, 0x00, 0x00, 0x1a, 0x8c, 0x00, 0x1f, 0xe5, 0x8c, 0x10, 0x1f, 0xe5, 0x01, 0x00, 0x00, 0xea, |
132 | 0xa0, 0x00, 0x1f, 0xe5, 0xa0, 0x10, 0x1f, 0xe5, 0x01, 0x40, 0x43, 0xe0, 0x01, 0x20, 0x50, 0xe4, | 132 | 0xa0, 0x00, 0x1f, 0xe5, 0xa0, 0x10, 0x1f, 0xe5, 0x01, 0x40, 0x43, 0xe0, 0x01, 0x20, 0x50, 0xe4, |
133 | 0x01, 0x20, 0x43, 0xe4, 0x04, 0x00, 0x53, 0xe1, 0xfb, 0xff, 0xff, 0x1a, 0x01, 0x00, 0x83, 0xe2, | 133 | 0x01, 0x20, 0x43, 0xe4, 0x04, 0x00, 0x53, 0xe1, 0xfb, 0xff, 0xff, 0x1a, 0x01, 0x00, 0x83, 0xe2, |
diff --git a/rbutil/mkamsboot/dualboot/dualboot.S b/rbutil/mkamsboot/dualboot/dualboot.S index dfda5b3bf0..0189a5be78 100644 --- a/rbutil/mkamsboot/dualboot/dualboot.S +++ b/rbutil/mkamsboot/dualboot/dualboot.S | |||
@@ -157,7 +157,8 @@ uclcopy: | |||
157 | cmp r1, #0 /* C3 = #0 means button pressed */ | 157 | cmp r1, #0 /* C3 = #0 means button pressed */ |
158 | beq boot_of | 158 | beq boot_of |
159 | #elif defined(SANSA_CLIPPLUS) | 159 | #elif defined(SANSA_CLIPPLUS) |
160 | @ Assumes GPIOB_DIR is 0x00 on reset | 160 | @ All GPIO_DIR == 0x00 from reset |
161 | @ Set B0 | ||
161 | ldr r0, =GPIOB | 162 | ldr r0, =GPIOB |
162 | mov r1, #(1<<0) @ pin 0 | 163 | mov r1, #(1<<0) @ pin 0 |
163 | str r1, [r0, #0x400] @ GPIOB(0) = output | 164 | str r1, [r0, #0x400] @ GPIOB(0) = output |
@@ -176,12 +177,10 @@ uclcopy: | |||
176 | 177 | ||
177 | orr r2, r2, r1 @ c3 || A1 | 178 | orr r2, r2, r1 @ c3 || A1 |
178 | 179 | ||
179 | @ Unset GPIOB(0) | 180 | @ Unset GPIOB(0) & Restore GPIOB_DIR |
181 | ldr r0, =GPIOB | ||
180 | mov r1, #0 | 182 | mov r1, #0 |
181 | str r1, [r0, #4*(1<<0)] @ write 0 to GPIOB(0) B0 unset | 183 | str r1, [r0, #4*(1<<0)] @ write 0 to GPIOB(0) B0 unset |
182 | |||
183 | @ restore GPIOB_DIR to 0x00 | ||
184 | ldr r0, =GPIOB | ||
185 | str r1, [r0, #0x400] @ Restore GPIOB_DIR to 0x00 | 184 | str r1, [r0, #0x400] @ Restore GPIOB_DIR to 0x00 |
186 | 185 | ||
187 | cmp r2, #0 @ test input from pins | 186 | cmp r2, #0 @ test input from pins |