summaryrefslogtreecommitdiffstats
path: root/firmware/target/arm/usb-drv-arc.c
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2008-04-20 03:30:57 +0000
committerMichael Sevakis <jethead71@rockbox.org>2008-04-20 03:30:57 +0000
commit9003dbe5b257990e8141f95b97520090444ef81a (patch)
tree289dc9c95bc5462bfdabf03858a09edc30deafc1 /firmware/target/arm/usb-drv-arc.c
parent38b8a236d4925db6b2f5d8db4d8c65a49c65953d (diff)
downloadrockbox-9003dbe5b257990e8141f95b97520090444ef81a.tar.gz
rockbox-9003dbe5b257990e8141f95b97520090444ef81a.zip
Make the inital connect problem go away on Gigabeat S. Would be nice if a better way were found but it works for me. Update the bootloader to have it work.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17181 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/arm/usb-drv-arc.c')
-rw-r--r--firmware/target/arm/usb-drv-arc.c34
1 files changed, 22 insertions, 12 deletions
diff --git a/firmware/target/arm/usb-drv-arc.c b/firmware/target/arm/usb-drv-arc.c
index 3bf53fa431..3093120c83 100644
--- a/firmware/target/arm/usb-drv-arc.c
+++ b/firmware/target/arm/usb-drv-arc.c
@@ -352,8 +352,6 @@ static const unsigned int pipe2mask[] = {
0x10, 0x100000,
};
-static bool first_init = true;
-
/*-------------------------------------------------------------------------*/
static void transfer_completed(void);
static void control_received(void);
@@ -373,22 +371,34 @@ bool usb_drv_powered(void)
return (REG_OTGSC & OTGSC_B_SESSION_VALID) ? true : false;
}
-/* manual: 32.14.1 Device Controller Initialization */
-void usb_drv_init(void)
+/* One-time driver startup init */
+void usb_drv_startup(void)
{
+#if CONFIG_CPU == IMX31L && defined(BOOTLOADER)
+ /* This is the bootloader - activate the OTG controller or cold
+ * connect later could/will fail */
REG_USBCMD &= ~USBCMD_RUN;
- if (first_init)
- {
- /* Initialize all the signal objects once */
- int i;
- for(i=0;i<NUM_ENDPOINTS*2;i++) {
- wakeup_init(&transfer_completion_signal[i]);
- }
+ sleep(HZ/20);
+ REG_USBCMD |= USBCMD_CTRL_RESET;
+ while (REG_USBCMD & USBCMD_CTRL_RESET);
+
+ /* Set to ULPI */
+ REG_PORTSC1 = (REG_PORTSC1 & ~PORTSCX_PHY_TYPE_SEL) | PORTSCX_PTS_ULPI;
+ sleep(HZ/10);
+#endif
- first_init = false;
+ /* Initialize all the signal objects once */
+ int i;
+ for(i=0;i<NUM_ENDPOINTS*2;i++) {
+ wakeup_init(&transfer_completion_signal[i]);
}
+}
+/* manual: 32.14.1 Device Controller Initialization */
+void usb_drv_init(void)
+{
+ REG_USBCMD &= ~USBCMD_RUN;
sleep(HZ/20);
REG_USBCMD |= USBCMD_CTRL_RESET;
while (REG_USBCMD & USBCMD_CTRL_RESET);