summaryrefslogtreecommitdiffstats
path: root/rbutil/mkimxboot/dualboot
diff options
context:
space:
mode:
authorAmaury Pouly <amaury.pouly@gmail.com>2012-02-29 00:02:31 +0100
committerAmaury Pouly <amaury.pouly@gmail.com>2012-02-29 00:02:31 +0100
commit8c0c844b7bde042f711a4ecffaa03d38eb89bce7 (patch)
treef8709e122798f58188015523ffa1a9c8dbd6301d /rbutil/mkimxboot/dualboot
parent0d78dd170d459ca0cce6c1f107ea0a98066f3a62 (diff)
downloadrockbox-8c0c844b7bde042f711a4ecffaa03d38eb89bce7.tar.gz
rockbox-8c0c844b7bde042f711a4ecffaa03d38eb89bce7.zip
imx233: always boot when powered up from 5v
Change-Id: I3adb901d293c801f0a8493ae4f0b23af4fa535e8
Diffstat (limited to 'rbutil/mkimxboot/dualboot')
-rw-r--r--rbutil/mkimxboot/dualboot/dualboot.S11
1 files changed, 10 insertions, 1 deletions
diff --git a/rbutil/mkimxboot/dualboot/dualboot.S b/rbutil/mkimxboot/dualboot/dualboot.S
index 645a7889cb..4002167929 100644
--- a/rbutil/mkimxboot/dualboot/dualboot.S
+++ b/rbutil/mkimxboot/dualboot/dualboot.S
@@ -30,8 +30,16 @@ start:
tst r2, #0x40000000 @ bit 30, active low
moveq r0, #0 @ return 0, continue boot
bxeq lr
- /* otherwise monitor the power button for a short time */
+ /* save registers for the ROM */
stmfd sp!, {r4-r6,lr}
+ /* if the power source was 5v (ie usb), bypass the power button delay */
+ ldr r2, =0x800440c0 @ HW_POWER_STS
+ ldr r2, [r2]
+ mov r2, r2, lsl#2
+ mov r2, r2, lsr#26 @ extract PWRUP_SOURCE
+ tst r2, #0x20 @ bit 5: five volts
+ bne boot_rockbox
+ /* otherwise monitor the power button for a short time */
ldr r2, =550000 @ loop count
ldr r4, =0 @ number of times PSWITCH was 1
pswitch_monitor_loop:
@@ -48,6 +56,7 @@ pswitch_monitor_loop:
cmp r4, r2
bcc power_down
/* jump to section given as argument */
+boot_rockbox:
str r0, [r1]
mov r0, #1
ldmfd sp!, {r4-r6,pc}