From 7cc6b3a3596c64d7fb5aeff0f6a63783e929d510 Mon Sep 17 00:00:00 2001 From: Dave Chapman Date: Thu, 19 Jan 2006 03:01:34 +0000 Subject: Fix reboot-to-diskmode for the Nano and Video - the "diskmode" string is written to the end of IRAM, which is larger on the PP5022 devices. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8378 a1c6a512-1295-4272-9138-f99709370657 --- firmware/usb.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/firmware/usb.c b/firmware/usb.c index 2cbe0348e5..13006ab4ea 100644 --- a/firmware/usb.c +++ b/firmware/usb.c @@ -168,17 +168,14 @@ void usb_enable(bool on) into Apple's flash-based disk-mode. This does not return. */ if (on) { - /* The following code is copied from ipodlinux - it doesn't work on the - iPod Video */ + /* The following code is copied from ipodlinux */ +#ifdef APPLE_IPODCOLOR unsigned char* storage_ptr = (unsigned char *)0x40017F00; - char* diskmode = "diskmode\0"; - char* hotstuff = "hotstuff\0"; - - memcpy(storage_ptr, diskmode, 9); - storage_ptr = (unsigned char *)0x40017f08; - memcpy(storage_ptr, hotstuff, 9); - outl(1, 0x40017F10); - outl(inl(0x60006004) | 0x4, 0x60006004); +#elif defined(APPLE_IPODNANO) || defined(APPLE_IPODVIDEO) + unsigned char* storage_ptr = (unsigned char *)0x4001FF00; +#endif + memcpy(storage_ptr, "diskmode\0\0hotstuff\0\0\1", 21); + DEV_RS |= 4; /* Reboot */ } #elif defined(USB_ISP1582) /* TODO: Implement USB_ISP1582 */ -- cgit v1.2.3