summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjörn Stenberg <bjorn@haxx.se>2007-11-23 09:58:47 +0000
committerBjörn Stenberg <bjorn@haxx.se>2007-11-23 09:58:47 +0000
commit482e839ea987e9aacec82389fc8a67c075800583 (patch)
tree8ca557013e334501bad343e9d43868dcee9cb791
parent73d514f1c106d54d75ac26ff3ff6cb07fd559548 (diff)
downloadrockbox-482e839ea987e9aacec82389fc8a67c075800583.tar.gz
rockbox-482e839ea987e9aacec82389fc8a67c075800583.zip
Enable usbstack on ipods.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15772 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--firmware/export/config-ipod4g.h6
-rw-r--r--firmware/export/config-ipodcolor.h6
-rw-r--r--firmware/export/config-ipodmini.h6
-rw-r--r--firmware/export/config-ipodmini2g.h7
-rw-r--r--firmware/export/config-ipodnano.h6
-rw-r--r--firmware/export/config-ipodvideo.h6
-rw-r--r--firmware/target/arm/usb-fw-pp502x.c37
-rw-r--r--firmware/usbstack/usb_core.c6
8 files changed, 24 insertions, 56 deletions
diff --git a/firmware/export/config-ipod4g.h b/firmware/export/config-ipod4g.h
index 7ed790185d..ff15d20c20 100644
--- a/firmware/export/config-ipod4g.h
+++ b/firmware/export/config-ipod4g.h
@@ -147,10 +147,10 @@
/* USB On-the-go */
#define CONFIG_USBOTG USBOTG_ARC
-/* enable these for the experimental usb stack
+/* enable these for the experimental usb stack */
#define HAVE_USBSTACK
-#define USBSTACK_CAPS CONTROLLER_DEVICE
-*/
+#define USB_VENDOR_ID 0x05ac
+#define USB_PRODUCT_ID 0x1203
/* Virtual LED (icon) */
#define CONFIG_LED LED_VIRTUAL
diff --git a/firmware/export/config-ipodcolor.h b/firmware/export/config-ipodcolor.h
index 25a7fb3098..3cd6d76685 100644
--- a/firmware/export/config-ipodcolor.h
+++ b/firmware/export/config-ipodcolor.h
@@ -134,10 +134,10 @@
/* USB On-the-go */
#define CONFIG_USBOTG USBOTG_ARC
-/* enable these for the experimental usb stack
+/* enable these for the experimental usb stack */
#define HAVE_USBSTACK
-#define USBSTACK_CAPS CONTROLLER_DEVICE
-*/
+#define USB_VENDOR_ID 0x05ac
+#define USB_PRODUCT_ID 0x1204
/* Virtual LED (icon) */
#define CONFIG_LED LED_VIRTUAL
diff --git a/firmware/export/config-ipodmini.h b/firmware/export/config-ipodmini.h
index ba2d6f812d..061b15a404 100644
--- a/firmware/export/config-ipodmini.h
+++ b/firmware/export/config-ipodmini.h
@@ -137,10 +137,10 @@
/* USB On-the-go */
#define CONFIG_USBOTG USBOTG_ARC
-/* enable these for the experimental usb stack
+/* enable these for the experimental usb stack */
#define HAVE_USBSTACK
-#define USBSTACK_CAPS CONTROLLER_DEVICE
-*/
+#define USB_VENDOR_ID 0x05ac
+#define USB_PRODUCT_ID 0x1205
/* Virtual LED (icon) */
#define CONFIG_LED LED_VIRTUAL
diff --git a/firmware/export/config-ipodmini2g.h b/firmware/export/config-ipodmini2g.h
index 0d3dceb73b..c3f4e97e7b 100644
--- a/firmware/export/config-ipodmini2g.h
+++ b/firmware/export/config-ipodmini2g.h
@@ -144,10 +144,11 @@
/* USB On-the-go */
#define CONFIG_USBOTG USBOTG_ARC
-/* enable these for the experimental usb stack
+/* enable these for the experimental usb stack */
#define HAVE_USBSTACK
-#define USBSTACK_CAPS CONTROLLER_DEVICE
-*/
+#define USB_VENDOR_ID 0x05ac
+#define USB_PRODUCT_ID 0x1205
+
/* Virtual LED (icon) */
#define CONFIG_LED LED_VIRTUAL
diff --git a/firmware/export/config-ipodnano.h b/firmware/export/config-ipodnano.h
index 27e159471e..149e04d8f2 100644
--- a/firmware/export/config-ipodnano.h
+++ b/firmware/export/config-ipodnano.h
@@ -143,10 +143,10 @@
/* USB On-the-go */
#define CONFIG_USBOTG USBOTG_ARC
-/* enable these for the experimental usb stack
+/* enable these for the experimental usb stack */
#define HAVE_USBSTACK
-#define USBSTACK_CAPS CONTROLLER_DEVICE
-*/
+#define USB_VENDOR_ID 0x05ac
+#define USB_PRODUCT_ID 0x120a
/* Virtual LED (icon) */
#define CONFIG_LED LED_VIRTUAL
diff --git a/firmware/export/config-ipodvideo.h b/firmware/export/config-ipodvideo.h
index c66f6d9aff..2013a8bb67 100644
--- a/firmware/export/config-ipodvideo.h
+++ b/firmware/export/config-ipodvideo.h
@@ -150,10 +150,10 @@
/* USB On-the-go */
#define CONFIG_USBOTG USBOTG_ARC
-/* enable these for the experimental usb stack
+/* enable these for the experimental usb stack */
#define HAVE_USBSTACK
-#define USBSTACK_CAPS CONTROLLER_DEVICE
-*/
+#define USB_VENDOR_ID 0x05ac
+#define USB_PRODUCT_ID 0x1209
/* Virtual LED (icon) */
#define CONFIG_LED LED_VIRTUAL
diff --git a/firmware/target/arm/usb-fw-pp502x.c b/firmware/target/arm/usb-fw-pp502x.c
index 7ee18287ca..cff3089ae0 100644
--- a/firmware/target/arm/usb-fw-pp502x.c
+++ b/firmware/target/arm/usb-fw-pp502x.c
@@ -27,10 +27,8 @@
#include "button.h"
#include "ata.h"
#include "string.h"
-#ifdef HAVE_USBSTACK
#include "usb_core.h"
#include "usb_drv.h"
-#endif
void usb_init_device(void)
{
@@ -58,43 +56,10 @@ void usb_init_device(void)
void usb_enable(bool on)
{
-#ifdef HAVE_USBSTACK
if (on)
usb_core_init();
else
usb_core_exit();
-#else
- /* This device specific code will eventually give way to proper USB
- handling, which should be the same for all PP502x targets. */
- if (on)
- {
-#if defined(IPOD_ARCH) || defined(IRIVER_H10) || defined (IRIVER_H10_5GB) ||\
- defined(SANSA_C200)
- /* For the H10 and iPod, we can only do one thing with USB mode - reboot
- into the flash-based disk-mode. This does not return. */
-
-#if defined(IRIVER_H10) || defined (IRIVER_H10_5GB)
- if(button_status()==BUTTON_RIGHT)
-#endif /* defined(IRIVER_H10) || defined (IRIVER_H10_5GB) */
- {
-#ifndef HAVE_FLASH_STORAGE
- ata_sleepnow(); /* Immediately spindown the disk. */
- sleep(HZ*2);
-#endif
-
-#ifdef IPOD_ARCH /* The following code is based on ipodlinux */
-#if CONFIG_CPU == PP5020
- memcpy((void *)0x40017f00, "diskmode\0\0hotstuff\0\0\1", 21);
-#elif CONFIG_CPU == PP5022
- memcpy((void *)0x4001ff00, "diskmode\0\0hotstuff\0\0\1", 21);
-#endif /* CONFIG_CPU */
-#endif /* IPOD_ARCH */
-
- system_reboot(); /* Reboot */
- }
-#endif /*defined(IPOD_ARCH) || defined(IRIVER_H10) || defined (IRIVER_H10_5GB)*/
- }
-#endif /* !HAVE_USBSTACK */
}
int usb_detect(void)
@@ -117,6 +82,8 @@ int usb_detect(void)
if (GPIOL_INPUT_VAL & 0x4)
return USB_INSERTED;
#endif
+ if (usb_drv_powered())
+ return USB_INSERTED;
return USB_EXTRACTED;
}
diff --git a/firmware/usbstack/usb_core.c b/firmware/usbstack/usb_core.c
index e0c4d91338..7f610ff83a 100644
--- a/firmware/usbstack/usb_core.c
+++ b/firmware/usbstack/usb_core.c
@@ -268,14 +268,14 @@ static const struct {
} usb_strings[] =
{
{
- 16,
+ 24,
USB_DT_STRING,
- {'R','o','c','k','b','o','x'}
+ {'R','o','c','k','b','o','x','.','o','r','g'}
},
{
42,
USB_DT_STRING,
- {'D','i','g','i','t','a','l',' ','a','u','d','i','o',' ','p','l','a','y','e','r'}
+ {'R','o','c','k','b','o','x',' ','m','e','d','i','a',' ','p','l','a','y','e','r'}
},
{
40,