diff options
Diffstat (limited to 'rbutil/mkamsboot/dualboot.S')
-rw-r--r-- | rbutil/mkamsboot/dualboot.S | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/rbutil/mkamsboot/dualboot.S b/rbutil/mkamsboot/dualboot.S index 8a1caa6f63..1713017060 100644 --- a/rbutil/mkamsboot/dualboot.S +++ b/rbutil/mkamsboot/dualboot.S | |||
@@ -5,7 +5,7 @@ | |||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | 5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < |
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | 6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ |
7 | * \/ \/ \/ \/ \/ | 7 | * \/ \/ \/ \/ \/ |
8 | * $Id:$ | 8 | * $Id$ |
9 | * | 9 | * |
10 | * Copyright (C) 2008 Rafaël Carré | 10 | * Copyright (C) 2008 Rafaël Carré |
11 | * | 11 | * |
@@ -77,6 +77,8 @@ uclcopy: | |||
77 | orr r1, r1, #(1<<16) | 77 | orr r1, r1, #(1<<16) |
78 | str r1, [r0] | 78 | str r1, [r0] |
79 | 79 | ||
80 | |||
81 | #ifndef SANSA_M200V2 /* this doesnt work for m200 */ | ||
80 | /* we check A3 unconditionally of the model because it seems to be */ | 82 | /* we check A3 unconditionally of the model because it seems to be */ |
81 | /* either hold, either usb on every model */ | 83 | /* either hold, either usb on every model */ |
82 | 84 | ||
@@ -87,6 +89,7 @@ uclcopy: | |||
87 | 89 | ||
88 | cmp r1, #0 | 90 | cmp r1, #0 |
89 | bne boot_of | 91 | bne boot_of |
92 | #endif | ||
90 | 93 | ||
91 | /* here are model specific tests, for dual boot without a computer */ | 94 | /* here are model specific tests, for dual boot without a computer */ |
92 | 95 | ||
@@ -108,6 +111,22 @@ uclcopy: | |||
108 | 111 | ||
109 | cmp r1, #0 /* C6 = #0 means button pressed */ | 112 | cmp r1, #0 /* C6 = #0 means button pressed */ |
110 | beq boot_of | 113 | beq boot_of |
114 | #elif defined(SANSA_M200V2) | ||
115 | .set row, (1<<5) /* 4 or <<5 or <<6 */ | ||
116 | /* enable output on A3-A5 */ | ||
117 | /* set keyscan row A0-A3 */ | ||
118 | ldr r0, =GPIOA | ||
119 | mov r1, #row | ||
120 | str r1, [r0, #0x400] | ||
121 | str r1, [r0, #(4*row)] | ||
122 | |||
123 | .set col, (1<<0) /* 0 or 1, 2, 3 */ | ||
124 | /* read keyscan column A0-A3 */ | ||
125 | ldr r2, [r0, #(4*col)] | ||
126 | |||
127 | /* check value read (compare to 0!) */ | ||
128 | cmp r2, #0 | ||
129 | beq boot_of /* for beginning we jump if button select is not pressed */ | ||
111 | #else | 130 | #else |
112 | #error No target-specific key check defined! | 131 | #error No target-specific key check defined! |
113 | #endif | 132 | #endif |