summaryrefslogtreecommitdiff
path: root/firmware/drivers/usb
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/drivers/usb')
-rw-r--r--firmware/drivers/usb/arcotg_dcd.c24
1 files changed, 3 insertions, 21 deletions
diff --git a/firmware/drivers/usb/arcotg_dcd.c b/firmware/drivers/usb/arcotg_dcd.c
index fe8ae803c0..c45a790c04 100644
--- a/firmware/drivers/usb/arcotg_dcd.c
+++ b/firmware/drivers/usb/arcotg_dcd.c
@@ -467,25 +467,17 @@ static void resume_int(void)
467 467
468static void reset_int(void) 468static void reset_int(void)
469{ 469{
470 struct timer t;
471
472 /* clear device address */ 470 /* clear device address */
473 UDC_DEVICEADDR = 0 << 25; 471 UDC_DEVICEADDR = 0 << 25;
474 472
475 /* update usb state */ 473 /* update usb state */
476 dcd_controller.usb_state = USB_STATE_DEFAULT; 474 dcd_controller.usb_state = USB_STATE_DEFAULT;
477 475
478 timer_set(&t, RESET_TIMER);
479
480 UDC_ENDPTSETUPSTAT = UDC_ENDPTSETUPSTAT; 476 UDC_ENDPTSETUPSTAT = UDC_ENDPTSETUPSTAT;
481 UDC_ENDPTCOMPLETE = UDC_ENDPTCOMPLETE; 477 UDC_ENDPTCOMPLETE = UDC_ENDPTCOMPLETE;
482 478
483 while (UDC_ENDPTPRIME) { /* prime and flush pending transfers */ 479 /* prime and flush pending transfers */
484 if (timer_expired(&t)) { 480 while (UDC_ENDPTPRIME);
485 logf("TIMEOUT->p&f");
486 }
487 }
488
489 UDC_ENDPTFLUSH = ~0; 481 UDC_ENDPTFLUSH = ~0;
490 482
491 if ((UDC_PORTSC1 & PORTSCX_PORT_RESET) == 0) { 483 if ((UDC_PORTSC1 & PORTSCX_PORT_RESET) == 0) {
@@ -493,19 +485,9 @@ static void reset_int(void)
493 } 485 }
494 486
495 /* clear USB Reset status bit */ 487 /* clear USB Reset status bit */
496 UDC_USBSTS = USB_STS_RESET; 488 UDC_USBSTS |= USB_STS_RESET;
497
498 /* wait for port change */
499 while ((UDC_USBSTS & USB_STS_PORT_CHANGE) == 0) {
500 if (timer_expired(&t)) {
501 logf("TIMEOUT->portchange");
502 }
503 }
504
505 UDC_USBSTS = (1 << 2);
506} 489}
507 490
508
509/*-------------------------------------------------------------------------*/ 491/*-------------------------------------------------------------------------*/
510/* usb controller ops */ 492/* usb controller ops */
511 493