diff options
Diffstat (limited to 'bootloader/ipod.c')
-rw-r--r-- | bootloader/ipod.c | 32 |
1 files changed, 21 insertions, 11 deletions
diff --git a/bootloader/ipod.c b/bootloader/ipod.c index e5538b280c..ee555793d0 100644 --- a/bootloader/ipod.c +++ b/bootloader/ipod.c | |||
@@ -43,6 +43,7 @@ | |||
43 | #include "file.h" | 43 | #include "file.h" |
44 | #include "common.h" | 44 | #include "common.h" |
45 | #include "hwcompat.h" | 45 | #include "hwcompat.h" |
46 | #include "usb.h" | ||
46 | 47 | ||
47 | #define XSC(X) #X | 48 | #define XSC(X) #X |
48 | #define SC(X) XSC(X) | 49 | #define SC(X) XSC(X) |
@@ -58,12 +59,6 @@ unsigned char *loadbuffer = (unsigned char *)DRAM_START; | |||
58 | /* Bootloader version */ | 59 | /* Bootloader version */ |
59 | char version[] = APPSVERSION; | 60 | char version[] = APPSVERSION; |
60 | 61 | ||
61 | #define BUTTON_LEFT 1 | ||
62 | #define BUTTON_MENU 2 | ||
63 | #define BUTTON_RIGHT 3 | ||
64 | #define BUTTON_PLAY 4 | ||
65 | #define BUTTON_HOLD 5 | ||
66 | |||
67 | #if CONFIG_KEYPAD == IPOD_4G_PAD && !defined(IPOD_MINI) | 62 | #if CONFIG_KEYPAD == IPOD_4G_PAD && !defined(IPOD_MINI) |
68 | /* check if number of seconds has past */ | 63 | /* check if number of seconds has past */ |
69 | int timer_check(int clock_start, unsigned int usecs) | 64 | int timer_check(int clock_start, unsigned int usecs) |
@@ -193,19 +188,22 @@ void fatal_error(void) | |||
193 | 188 | ||
194 | /* System font is 6 pixels wide */ | 189 | /* System font is 6 pixels wide */ |
195 | #if defined(IPOD_1G2G) || defined(IPOD_3G) | 190 | #if defined(IPOD_1G2G) || defined(IPOD_3G) |
196 | printf("Hold MENU+PLAY to"); | 191 | printf("Insert Firewire cable, or"); |
197 | printf("reboot then REW+FF"); | 192 | printf("hold MENU+PLAY to reboot"); |
198 | printf("for disk mode"); | 193 | printf("then REW+FF for disk mode"); |
199 | #elif LCD_WIDTH >= (30*6) | 194 | #elif LCD_WIDTH >= (30*6) |
200 | printf("Hold MENU+SELECT to reboot"); | 195 | printf("Insert USB cable, or"); |
196 | printf("hold MENU+SELECT to reboot"); | ||
201 | printf("then SELECT+PLAY for disk mode"); | 197 | printf("then SELECT+PLAY for disk mode"); |
202 | #else | 198 | #else |
203 | printf("Hold MENU+SELECT to"); | 199 | printf("Insert USB cable, or"); |
200 | printf("hold MENU+SELECT to"); | ||
204 | printf("reboot then SELECT+PLAY"); | 201 | printf("reboot then SELECT+PLAY"); |
205 | printf("for disk mode"); | 202 | printf("for disk mode"); |
206 | #endif | 203 | #endif |
207 | lcd_update(); | 204 | lcd_update(); |
208 | 205 | ||
206 | usb_init(); | ||
209 | while (1) { | 207 | while (1) { |
210 | if (button_hold() != holdstatus) { | 208 | if (button_hold() != holdstatus) { |
211 | if (button_hold()) { | 209 | if (button_hold()) { |
@@ -217,6 +215,18 @@ void fatal_error(void) | |||
217 | } | 215 | } |
218 | lcd_update(); | 216 | lcd_update(); |
219 | } | 217 | } |
218 | if (usb_detect() == USB_INSERTED) { | ||
219 | ata_sleepnow(); /* Immediately spindown the disk. */ | ||
220 | sleep(HZ*2); | ||
221 | #if CONFIG_CPU == PP5020 | ||
222 | memcpy((void *)0x40017f00, "diskmode\0\0hotstuff\0\0\1", 21); | ||
223 | #elif CONFIG_CPU == PP5022 | ||
224 | memcpy((void *)0x4001ff00, "diskmode\0\0hotstuff\0\0\1", 21); | ||
225 | #elif CONFIG_CPU == PP5002 | ||
226 | memcpy((void *)0x40017f00, "diskmodehotstuff\1", 17); | ||
227 | #endif /* CONFIG_CPU */ | ||
228 | system_reboot(); /* Reboot */ | ||
229 | } | ||
220 | udelay(100000); /* 100ms */ | 230 | udelay(100000); /* 100ms */ |
221 | } | 231 | } |
222 | 232 | ||