summaryrefslogtreecommitdiff
path: root/firmware/target/arm/usb-drv-arc.c
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2009-01-22 22:05:04 +0000
committerMichael Sevakis <jethead71@rockbox.org>2009-01-22 22:05:04 +0000
commitda76a3469437261bd8857c6eddeaafcc601f373e (patch)
tree33e6c461aeb03d28575166c5ed5002aaf8ea9741 /firmware/target/arm/usb-drv-arc.c
parent81df953da55e75632b5efbe676f2b348e11b2c4b (diff)
downloadrockbox-da76a3469437261bd8857c6eddeaafcc601f373e.tar.gz
rockbox-da76a3469437261bd8857c6eddeaafcc601f373e.zip
Use bus reset detection for all ARC OTG devices. Remove conflict from LV24020LP driver with some GPIO-by-number macros for PP502x. Start monitoring for USB stack once all core threads and queues are created otherwise queues will likely be registered after USB acks. Putting PP502x system_reboot in IRAM (unmapped, uncached) memory seems to help it work more consistently. Hopefully I got all the PP USB connect handlers in the right spot in irq_handler. If device seems unresponsive to cable, check there first.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19819 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/arm/usb-drv-arc.c')
-rw-r--r--firmware/target/arm/usb-drv-arc.c11
1 files changed, 1 insertions, 10 deletions
diff --git a/firmware/target/arm/usb-drv-arc.c b/firmware/target/arm/usb-drv-arc.c
index b6d6ff154d..15f3bf2c6c 100644
--- a/firmware/target/arm/usb-drv-arc.c
+++ b/firmware/target/arm/usb-drv-arc.c
@@ -419,13 +419,11 @@ static void _usb_drv_init(bool attach)
419 REG_ENDPOINTLISTADDR = (unsigned int)qh_array; 419 REG_ENDPOINTLISTADDR = (unsigned int)qh_array;
420 REG_DEVICEADDR = 0; 420 REG_DEVICEADDR = 0;
421 421
422#ifdef USB_DETECT_BY_DRV
423 if (!attach) { 422 if (!attach) {
424 /* enable RESET interrupt */ 423 /* enable RESET interrupt */
425 REG_USBINTR = USBINTR_RESET_EN; 424 REG_USBINTR = USBINTR_RESET_EN;
426 } 425 }
427 else 426 else
428#endif
429 { 427 {
430 /* enable USB interrupts */ 428 /* enable USB interrupts */
431 REG_USBINTR = 429 REG_USBINTR =
@@ -449,23 +447,17 @@ static void _usb_drv_init(bool attach)
449 (void)attach; 447 (void)attach;
450} 448}
451 449
452/** With USB_DETECT_BY_DRV, attach is distinct from init, otherwise eqivalent. **/
453
454/* USB_DETECT_BY_DRV - enable bus reset detection only
455 * else fully enable driver */
456void usb_drv_init(void) 450void usb_drv_init(void)
457{ 451{
458 _usb_drv_init(false); 452 _usb_drv_init(false);
459} 453}
460 454
461#ifdef USB_DETECT_BY_DRV
462/* fully enable driver */ 455/* fully enable driver */
463void usb_drv_attach(void) 456void usb_drv_attach(void)
464{ 457{
465 sleep(HZ/10); 458 sleep(HZ/10);
466 _usb_drv_init(true); 459 _usb_drv_init(true);
467} 460}
468#endif /* USB_DETECT_BY_DRV */
469 461
470void usb_drv_exit(void) 462void usb_drv_exit(void)
471{ 463{
@@ -513,7 +505,7 @@ void usb_drv_int(void)
513 /* reset interrupt */ 505 /* reset interrupt */
514 if (status & USBSTS_RESET) { 506 if (status & USBSTS_RESET) {
515 REG_USBSTS = USBSTS_RESET; 507 REG_USBSTS = USBSTS_RESET;
516#ifdef USB_DETECT_BY_DRV 508
517 if (UNLIKELY(usbintr == USBINTR_RESET_EN)) { 509 if (UNLIKELY(usbintr == USBINTR_RESET_EN)) {
518 /* USB detected - detach and inform */ 510 /* USB detected - detach and inform */
519 usb_drv_stop(); 511 usb_drv_stop();
@@ -523,7 +515,6 @@ void usb_drv_int(void)
523 usb_drv_usb_detect_event(); 515 usb_drv_usb_detect_event();
524 } 516 }
525 else 517 else
526#endif
527 { 518 {
528 bus_reset(); 519 bus_reset();
529 usb_core_bus_reset(); /* tell mom */ 520 usb_core_bus_reset(); /* tell mom */