summaryrefslogtreecommitdiff
path: root/rbutil/mkimxboot/dualboot/dualboot.S
diff options
context:
space:
mode:
Diffstat (limited to 'rbutil/mkimxboot/dualboot/dualboot.S')
-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:
30 tst r2, #0x40000000 @ bit 30, active low 30 tst r2, #0x40000000 @ bit 30, active low
31 moveq r0, #0 @ return 0, continue boot 31 moveq r0, #0 @ return 0, continue boot
32 bxeq lr 32 bxeq lr
33 /* otherwise monitor the power button for a short time */ 33 /* save registers for the ROM */
34 stmfd sp!, {r4-r6,lr} 34 stmfd sp!, {r4-r6,lr}
35 /* if the power source was 5v (ie usb), bypass the power button delay */
36 ldr r2, =0x800440c0 @ HW_POWER_STS
37 ldr r2, [r2]
38 mov r2, r2, lsl#2
39 mov r2, r2, lsr#26 @ extract PWRUP_SOURCE
40 tst r2, #0x20 @ bit 5: five volts
41 bne boot_rockbox
42 /* otherwise monitor the power button for a short time */
35 ldr r2, =550000 @ loop count 43 ldr r2, =550000 @ loop count
36 ldr r4, =0 @ number of times PSWITCH was 1 44 ldr r4, =0 @ number of times PSWITCH was 1
37pswitch_monitor_loop: 45pswitch_monitor_loop:
@@ -48,6 +56,7 @@ pswitch_monitor_loop:
48 cmp r4, r2 56 cmp r4, r2
49 bcc power_down 57 bcc power_down
50 /* jump to section given as argument */ 58 /* jump to section given as argument */
59boot_rockbox:
51 str r0, [r1] 60 str r0, [r1]
52 mov r0, #1 61 mov r0, #1
53 ldmfd sp!, {r4-r6,pc} 62 ldmfd sp!, {r4-r6,pc}