From e7a4b96f6eba8c6b3842d1768856f7b354b3d1dd Mon Sep 17 00:00:00 2001 From: Jonathan Gordon Date: Mon, 21 Jun 2010 10:51:39 +0000 Subject: [PATCH] change the D2 bootloader to boot rockbox by default. boot OF is hold is on or usb is connected git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27007 a1c6a512-1295-4272-9138-f99709370657 --- firmware/target/arm/tcc780x/crt0.S | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/firmware/target/arm/tcc780x/crt0.S b/firmware/target/arm/tcc780x/crt0.S index f6eb6afbe9..1612973866 100644 --- a/firmware/target/arm/tcc780x/crt0.S +++ b/firmware/target/arm/tcc780x/crt0.S @@ -74,14 +74,18 @@ start_loc: ldr r0, =0xf005a000 ldr r0, [r0, #0x20] /* Read GPIO A */ tst r0, #0x8 - ldrne pc, [pc, #-28] /* Jump to original firmware if HOLD not pressed */ + ldreq pc, [pc, #-28] /* Jump to original firmware if HOLD pressed */ + ldr r0, =0xf005a000 + ldr r0, [r0, #0x60] /* Read GPIO C */ + tst r0, #0x4000000 + ldreq pc, [pc, #-44] /* Jump to original firmware if usb connected */ #else #error No bootup key detection implemented for this target #endif /* Copy bootloader to safe area - 0x21F00000 (end of DRAM) */ /* TODO: Adjust this for other targets - DRAM + DRAMSIZE - 0x100000 */ - ldr r0, [pc, #-28] + ldr r0, [pc, #-44] mov r1, #0x22000000 sub r1, r1, #0x100000 ldr r2, =_dataend