summaryrefslogtreecommitdiffstats
path: root/firmware/usb.c
diff options
context:
space:
mode:
authorJens Arnold <amiconn@rockbox.org>2012-05-20 10:49:02 +0200
committerJens Arnold <amiconn@rockbox.org>2012-05-20 10:56:40 +0200
commit449167b7a92090f889a3bf442e3782721cc6c796 (patch)
treecb5df3af3642dcbf1e823d779587b55de46dfe5d /firmware/usb.c
parentdd61978070a769b7bf6baee630be27f9f04bffc5 (diff)
downloadrockbox-449167b7a92090f889a3bf442e3782721cc6c796.tar.gz
rockbox-449167b7a92090f889a3bf442e3782721cc6c796.tar.bz2
rockbox-449167b7a92090f889a3bf442e3782721cc6c796.zip
Undo f695681 (r30433). USB hardware must be initialized first.
This fixes flash/ MMC access on the Ondios when booting from ROM. Add a comment what to pay attention for in the target specific usb_init_device().
Diffstat (limited to 'firmware/usb.c')
-rw-r--r--firmware/usb.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/firmware/usb.c b/firmware/usb.c
index 56f6fb7230..6823851e08 100644
--- a/firmware/usb.c
+++ b/firmware/usb.c
@@ -659,6 +659,11 @@ void usb_acknowledge(long id)
void usb_init(void)
{
+ /* Do required hardware inits first. For software USB the driver has
+ * to make sure this won't trigger a transfer completion before the
+ * queue and thread are created. */
+ usb_init_device();
+
#ifdef USB_FULL_INIT
usb_enable(false);
@@ -672,8 +677,6 @@ void usb_init(void)
tick_add_task(usb_tick);
#endif
#endif /* USB_FULL_INIT */
-
- usb_init_device();
}
void usb_wait_for_disconnect(struct event_queue *q)