diff options
Diffstat (limited to 'firmware')
-rw-r--r-- | firmware/target/arm/as3525/usb-drv-as3525v2.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/firmware/target/arm/as3525/usb-drv-as3525v2.c b/firmware/target/arm/as3525/usb-drv-as3525v2.c index 4b0293563a..69aadf481c 100644 --- a/firmware/target/arm/as3525/usb-drv-as3525v2.c +++ b/firmware/target/arm/as3525/usb-drv-as3525v2.c | |||
@@ -77,7 +77,6 @@ struct usb_endpoint | |||
77 | bool busy; /* true is a transfer is pending */ | 77 | bool busy; /* true is a transfer is pending */ |
78 | int status; /* completion status (0 for success) */ | 78 | int status; /* completion status (0 for success) */ |
79 | struct wakeup complete; /* wait object */ | 79 | struct wakeup complete; /* wait object */ |
80 | void *buffer; /* buffer address */ | ||
81 | }; | 80 | }; |
82 | 81 | ||
83 | /* state of EP0 (to correctly schedule setup packet enqueing) */ | 82 | /* state of EP0 (to correctly schedule setup packet enqueing) */ |
@@ -213,7 +212,6 @@ static void prepare_setup_ep0(void) | |||
213 | { | 212 | { |
214 | logf("usb-drv: prepare EP0"); | 213 | logf("usb-drv: prepare EP0"); |
215 | /* setup DMA */ | 214 | /* setup DMA */ |
216 | clean_dcache_range((void*)&ep0_setup_pkt, sizeof ep0_setup_pkt); /* force write back */ | ||
217 | DOEPDMA(0) = (unsigned long)AS3525_PHYSICAL_ADDR(&__ep0_setup_pkt); /* virtual address=physical address */ | 215 | DOEPDMA(0) = (unsigned long)AS3525_PHYSICAL_ADDR(&__ep0_setup_pkt); /* virtual address=physical address */ |
218 | 216 | ||
219 | /* Setup EP0 OUT with the following parameters: | 217 | /* Setup EP0 OUT with the following parameters: |
@@ -389,8 +387,8 @@ static void core_dev_init(void) | |||
389 | } | 387 | } |
390 | 388 | ||
391 | /* Setup FIFOs */ | 389 | /* Setup FIFOs */ |
392 | GRXFSIZ = 1024; | 390 | GRXFSIZ = 512; |
393 | GNPTXFSIZ = MAKE_FIFOSIZE_DATA(1024, 1024); | 391 | GNPTXFSIZ = MAKE_FIFOSIZE_DATA(512, 512); |
394 | 392 | ||
395 | /* Setup interrupt masks for endpoints */ | 393 | /* Setup interrupt masks for endpoints */ |
396 | /* Setup interrupt masks */ | 394 | /* Setup interrupt masks */ |
@@ -527,7 +525,6 @@ static void handle_ep_int(int ep, bool dir_in) | |||
527 | logf("len=%d reg=%ld xfer=%d", endpoint->len, | 525 | logf("len=%d reg=%ld xfer=%d", endpoint->len, |
528 | (DOEPTSIZ(ep) & DEPTSIZ_xfersize_bits), | 526 | (DOEPTSIZ(ep) & DEPTSIZ_xfersize_bits), |
529 | transfered); | 527 | transfered); |
530 | invalidate_dcache_range(endpoint->buffer, transfered); | ||
531 | /* handle EP0 state if necessary, | 528 | /* handle EP0 state if necessary, |
532 | * this is a ack if length is 0 */ | 529 | * this is a ack if length is 0 */ |
533 | if(ep == 0) | 530 | if(ep == 0) |
@@ -767,7 +764,10 @@ static int usb_drv_transfer(int ep, void *ptr, int len, bool dir_in, bool blocki | |||
767 | { | 764 | { |
768 | DEPDMA = (unsigned long)AS3525_PHYSICAL_ADDR(ptr); | 765 | DEPDMA = (unsigned long)AS3525_PHYSICAL_ADDR(ptr); |
769 | DEPTSIZ = (nb_packets << DEPTSIZ_pkcnt_bitp) | len; | 766 | DEPTSIZ = (nb_packets << DEPTSIZ_pkcnt_bitp) | len; |
770 | clean_dcache_range(ptr, len); | 767 | if(dir_in) |
768 | clean_dcache_range(ptr, len); | ||
769 | else | ||
770 | invalidate_dcache_range(ptr, len); | ||
771 | } | 771 | } |
772 | 772 | ||
773 | logf("pkt=%d dma=%lx", nb_packets, DEPDMA); | 773 | logf("pkt=%d dma=%lx", nb_packets, DEPDMA); |