diff options
author | Tobias Diedrich <ranma+coreboot@tdiedrich.de> | 2010-06-23 06:57:53 +0000 |
---|---|---|
committer | Tobias Diedrich <ranma+coreboot@tdiedrich.de> | 2010-06-23 06:57:53 +0000 |
commit | 470be759e666cee0011e7da0a4405318897aaef8 (patch) | |
tree | 946a03f3ba7fab1585c65a6682eb09b3543b5593 | |
parent | fc1fab477608379531ae0c1f09f9b375561d704f (diff) | |
download | rockbox-470be759e666cee0011e7da0a4405318897aaef8.tar.gz rockbox-470be759e666cee0011e7da0a4405318897aaef8.zip |
Use DBOP to check for left button on C200v2 like we are supposed to instead of right button
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27079 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | rbutil/mkamsboot/dualboot/dualboot.S | 59 |
1 files changed, 52 insertions, 7 deletions
diff --git a/rbutil/mkamsboot/dualboot/dualboot.S b/rbutil/mkamsboot/dualboot/dualboot.S index 4cbbc372e8..670f44750d 100644 --- a/rbutil/mkamsboot/dualboot/dualboot.S +++ b/rbutil/mkamsboot/dualboot/dualboot.S | |||
@@ -28,6 +28,8 @@ | |||
28 | .set GPIOD, 0xC80E0000 | 28 | .set GPIOD, 0xC80E0000 |
29 | .set CGU_PROC, 0xC80F0010 | 29 | .set CGU_PROC, 0xC80F0010 |
30 | .set CGU_PERI, 0xC80F0014 | 30 | .set CGU_PERI, 0xC80F0014 |
31 | .set CGU_DBOP, 0xC80F0038 | ||
32 | .set DBOP, 0xC8120000 | ||
31 | .set I2C_BASE, 0xC8070000 | 33 | .set I2C_BASE, 0xC8070000 |
32 | .set I2C_DATA, 0x00 | 34 | .set I2C_DATA, 0x00 |
33 | .set I2C_SLAD0, 0x04 | 35 | .set I2C_SLAD0, 0x04 |
@@ -247,14 +249,57 @@ uclcopy: | |||
247 | 249 | ||
248 | 250 | ||
249 | #elif defined(SANSA_C200V2) | 251 | #elif defined(SANSA_C200V2) |
250 | /* check for RIGHT on C6, should changed to LEFT as soon as it | 252 | .set BUTTON_LEFT, (1<< 2) |
251 | * known in which pin that is in order for consistency */ | 253 | .set BUTTON_DOWN, (1<< 3) |
252 | ldr r0, =GPIOC | 254 | .set BUTTON_SELECT, (1<< 4) |
253 | mov r1, #0 | 255 | .set BUTTON_UP, (1<< 5) |
254 | str r1, [r0, #0x400] /* set pin to output */ | 256 | .set BUTTON_RIGHT, (1<< 6) |
257 | .set BUTTON_HOLD, (1<<12) | ||
258 | .set ENRD0_USB_STATUS, (1<< 3) | ||
259 | |||
260 | ldr r0, =CGU_DBOP | ||
261 | mov r1, #(1<<3) @ DBOP freq = PCLK, clock enabled | ||
262 | str r1, [r0] | ||
255 | 263 | ||
256 | ldr r1, [r0, #256] /* 1<<(6+2) */ | 264 | @ AFSEL needs to be set for this to work |
257 | cmp r1, #0 /* C6 low means button pressed */ | 265 | ldr r2, =GPIOB |
266 | mov r1, #0xc | ||
267 | str r1, [r2, #0x420] @ GPIOB_AFSEL | ||
268 | ldr r2, =GPIOC | ||
269 | mov r1, #0xff | ||
270 | str r1, [r2, #0x420] @ GPIOC_AFSEL | ||
271 | |||
272 | ldr r0, =DBOP | ||
273 | @ TIMPOL doesn't matter here since we don't need | ||
274 | @ the control signals. | ||
275 | |||
276 | @ 16 bit data width | ||
277 | @ enable write | ||
278 | @ tri-state output | ||
279 | ldr r1, =0x00091000 | ||
280 | str r1, [r0, #8] @ DBOP_CTRL | ||
281 | |||
282 | ldr r1, =0xf0ff @ precharge | ||
283 | str r1, [r0, #0x10] @ DBOP_DOUT | ||
284 | |||
285 | 2: ldr r1, [r0, #0xc] @ DOBP_STAT | ||
286 | ands r1, r1, #(1<<10) | ||
287 | beq 2b @ make sure fifo is empty | ||
288 | |||
289 | @ 16 bit data width | ||
290 | @ start read | ||
291 | @ tri-state output | ||
292 | @ strobe time 31 | ||
293 | ldr r1, =0x0008901f | ||
294 | str r1, [r0, #8] @ DBOP_CTRL | ||
295 | |||
296 | 3: ldr r1, [r0, #0xc] @ DOBP_STAT | ||
297 | ands r1, r1, #(1<<16) | ||
298 | beq 3b @ wait for valid data | ||
299 | |||
300 | ldrh r1, [r0, #0x14] @ DBOP_DIN | ||
301 | |||
302 | tst r1, #BUTTON_LEFT @ boot of? | ||
258 | beq boot_of | 303 | beq boot_of |
259 | #elif defined(SANSA_M200V4) | 304 | #elif defined(SANSA_M200V4) |
260 | .set row, (1<<5) /* enable output on A5 */ | 305 | .set row, (1<<5) /* enable output on A5 */ |