summaryrefslogtreecommitdiff
path: root/firmware/target/mips/ingenic_jz47xx/usb-jz4740.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/mips/ingenic_jz47xx/usb-jz4740.c')
-rw-r--r--firmware/target/mips/ingenic_jz47xx/usb-jz4740.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/firmware/target/mips/ingenic_jz47xx/usb-jz4740.c b/firmware/target/mips/ingenic_jz47xx/usb-jz4740.c
index e8cd2033ff..fd38b2b1a4 100644
--- a/firmware/target/mips/ingenic_jz47xx/usb-jz4740.c
+++ b/firmware/target/mips/ingenic_jz47xx/usb-jz4740.c
@@ -274,7 +274,7 @@ static void EPIN_handler(unsigned int endpoint)
274 } 274 }
275 275
276 logf("EP%d: %d -> %d", endpoint, ep->sent, ep->length); 276 logf("EP%d: %d -> %d", endpoint, ep->sent, ep->length);
277 277
278 if(ep->sent == 0) 278 if(ep->sent == 0)
279 length = MIN(ep->length, ep->fifo_size); 279 length = MIN(ep->length, ep->fifo_size);
280 else 280 else
@@ -365,7 +365,7 @@ static void EPDMA_handler(int number)
365 /* Disable DMA */ 365 /* Disable DMA */
366 REG_USB_REG_CNTL2 = 0; 366 REG_USB_REG_CNTL2 = 0;
367 367
368 __dcache_invalidate_all(); 368 commit_discard_dcache(); // XXX range?
369 369
370 select_endpoint(endpoint); 370 select_endpoint(endpoint);
371 /* Read out last packet manually */ 371 /* Read out last packet manually */
@@ -707,8 +707,7 @@ static void usb_drv_send_internal(struct usb_endpoint* ep, void* ptr, int length
707 { 707 {
708 if(ep->use_dma) 708 if(ep->use_dma)
709 { 709 {
710 //dma_cache_wback_inv((unsigned long)ptr, length); 710 commit_discard_dcache_range(ptr, length);
711 __dcache_writeback_all();
712 REG_USB_REG_ADDR1 = PHYSADDR((unsigned long)ptr); 711 REG_USB_REG_ADDR1 = PHYSADDR((unsigned long)ptr);
713 REG_USB_REG_COUNT1 = length; 712 REG_USB_REG_COUNT1 = length;
714 REG_USB_REG_CNTL1 = (USB_CNTL_INTR_EN | USB_CNTL_MODE_1 | 713 REG_USB_REG_CNTL1 = (USB_CNTL_INTR_EN | USB_CNTL_MODE_1 |
@@ -767,8 +766,7 @@ int usb_drv_recv(int endpoint, void* ptr, int length)
767 ep->busy = true; 766 ep->busy = true;
768 if(ep->use_dma) 767 if(ep->use_dma)
769 { 768 {
770 //dma_cache_wback_inv((unsigned long)ptr, length); 769 discard_dcache_range(ptr, length);
771 __dcache_writeback_all();
772 REG_USB_REG_ADDR2 = PHYSADDR((unsigned long)ptr); 770 REG_USB_REG_ADDR2 = PHYSADDR((unsigned long)ptr);
773 REG_USB_REG_COUNT2 = length; 771 REG_USB_REG_COUNT2 = length;
774 REG_USB_REG_CNTL2 = (USB_CNTL_INTR_EN | USB_CNTL_MODE_1 | 772 REG_USB_REG_CNTL2 = (USB_CNTL_INTR_EN | USB_CNTL_MODE_1 |