diff -ur rockbox-bleeding-20070914.orig/firmware/boot.lds rockbox-bleeding-20070914/firmware/boot.lds --- rockbox-bleeding-20070914.orig/firmware/boot.lds 2007-09-09 13:20:43.000000000 +0200 +++ rockbox-bleeding-20070914/firmware/boot.lds 2007-09-14 10:41:44.000000000 +0200 @@ -35,8 +35,8 @@ #define DRAMORIG 0x31000000 #define IRAMORIG 0x10000000 #define IRAMSIZE 0x20000 -#define FLASHORIG 0x00010000 -#define FLASHSIZE 4M +#define FLASHORIG 0x00150000 +#define FLASHSIZE 4M - FLASHORIG #elif CONFIG_CPU == PP5020 #define DRAMORIG 0x10000000 #define IRAMORIG 0x40000000 diff -ur rockbox-bleeding-20070914.orig/firmware/target/coldfire/crt0.S rockbox-bleeding-20070914/firmware/target/coldfire/crt0.S --- rockbox-bleeding-20070914.orig/firmware/target/coldfire/crt0.S 2007-02-18 02:20:03.000000000 +0100 +++ rockbox-bleeding-20070914/firmware/target/coldfire/crt0.S 2007-09-14 11:12:26.000000000 +0200 @@ -24,6 +24,32 @@ .global start start: +#if (defined(IAUDIO_X5) || defined(IAUDIO_M5)) && defined(BOOTLOADER) + + tst.b 0x30000000 /* preloader sets this to 1 + if woke up due to RTC alarm */ + bne .loadoriginal + + /* Wait ~3 seconds for ON-button release. We need roughly 300ns per + iteration, so we check 10000000 times to reach the desired delay */ + move.l #10000000, %d0 +.on_button_test: + move.l (0x80000000), %d1 /* GPIO_READ */ + and.l #0x6000000, %d1 /* Check main (bit 25=0) and remote (bit 26=0) */ + cmp.l #0x6000000, %d1 /* ON buttons simultaneously */ + beq .loadrockbox + sub.l #1, %d0 + bne .on_button_test + +.loadoriginal: + jmp 0x10010 + +.loadrockbox: + jmp .actualcrt0 + +.actualcrt0: +#endif /* (IAUDIO_X5 || IAUDIO_M5) && BOOTLOADER */ + move.w #0x2700,%sr move.l #vectors,%d0