diff options
Diffstat (limited to 'firmware/target/mips')
-rw-r--r-- | firmware/target/mips/ingenic_jz47xx/usb-jz4740.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/firmware/target/mips/ingenic_jz47xx/usb-jz4740.c b/firmware/target/mips/ingenic_jz47xx/usb-jz4740.c index 31b7098945..59f7ec825f 100644 --- a/firmware/target/mips/ingenic_jz47xx/usb-jz4740.c +++ b/firmware/target/mips/ingenic_jz47xx/usb-jz4740.c | |||
@@ -20,6 +20,7 @@ | |||
20 | ****************************************************************************/ | 20 | ****************************************************************************/ |
21 | 21 | ||
22 | #include "config.h" | 22 | #include "config.h" |
23 | #define LOGF_ENABLE | ||
23 | #include "logf.h" | 24 | #include "logf.h" |
24 | #include "system.h" | 25 | #include "system.h" |
25 | #include "usb_ch9.h" | 26 | #include "usb_ch9.h" |
@@ -76,9 +77,9 @@ static struct usb_endpoint endpoints[] = | |||
76 | {/* buf length sent busy type use_dma wait fifo_addr fifo_size */ | 77 | {/* buf length sent busy type use_dma wait fifo_addr fifo_size */ |
77 | {&ep0_rx_buf, 0, {0}, false, ep_control, false, false, USB_FIFO_EP0, 64 }, | 78 | {&ep0_rx_buf, 0, {0}, false, ep_control, false, false, USB_FIFO_EP0, 64 }, |
78 | {NULL, 0, {0}, false, ep_control, false, false, USB_FIFO_EP0, 64 }, | 79 | {NULL, 0, {0}, false, ep_control, false, false, USB_FIFO_EP0, 64 }, |
80 | {NULL, 0, {0}, false, ep_interrupt, false, false, USB_FIFO_EP1, 64 }, | ||
79 | {NULL, 0, {0}, false, ep_bulk, false, false, USB_FIFO_EP1, 512}, | 81 | {NULL, 0, {0}, false, ep_bulk, false, false, USB_FIFO_EP1, 512}, |
80 | {NULL, 0, {0}, false, ep_bulk, false, false, USB_FIFO_EP1, 512}, | 82 | {NULL, 0, {0}, false, ep_bulk, false, false, USB_FIFO_EP2, 512} |
81 | {NULL, 0, {0}, false, ep_interrupt, false, false, USB_FIFO_EP2, 64 } | ||
82 | }; | 83 | }; |
83 | static struct wakeup ep_wkup[TOTAL_EP()]; | 84 | static struct wakeup ep_wkup[TOTAL_EP()]; |
84 | 85 | ||
@@ -436,6 +437,9 @@ static void setup_endpoint(struct usb_endpoint *ep) | |||
436 | if(ep->use_dma) | 437 | if(ep->use_dma) |
437 | csrh |= (USB_INCSRH_DMAREQENAB | USB_INCSRH_AUTOSET | USB_INCSRH_DMAREQMODE); | 438 | csrh |= (USB_INCSRH_DMAREQENAB | USB_INCSRH_AUTOSET | USB_INCSRH_DMAREQMODE); |
438 | 439 | ||
440 | if(ep->type == ep_interrupt) | ||
441 | csrh |= USB_INCSRH_FRCDATATOG; | ||
442 | |||
439 | REG_USB_REG_INMAXP = ep->fifo_size; | 443 | REG_USB_REG_INMAXP = ep->fifo_size; |
440 | REG_USB_REG_INCSR = csr; | 444 | REG_USB_REG_INCSR = csr; |
441 | REG_USB_REG_INCSRH = csrh; | 445 | REG_USB_REG_INCSRH = csrh; |
@@ -860,14 +864,18 @@ int usb_drv_request_endpoint(int type, int dir) | |||
860 | type &= USB_ENDPOINT_XFERTYPE_MASK; | 864 | type &= USB_ENDPOINT_XFERTYPE_MASK; |
861 | 865 | ||
862 | /* There are only 3+2 endpoints, so hardcode this ... */ | 866 | /* There are only 3+2 endpoints, so hardcode this ... */ |
867 | /* Use the endpoint combinations from the Ingenic Linux USB driver */ | ||
863 | switch(type) | 868 | switch(type) |
864 | { | 869 | { |
865 | case USB_ENDPOINT_XFER_BULK: | 870 | case USB_ENDPOINT_XFER_BULK: |
866 | return (1 | dir); | 871 | if(dir == USB_DIR_IN) |
872 | return (2 | USB_DIR_IN); | ||
873 | else | ||
874 | return (1 | USB_DIR_OUT); | ||
867 | 875 | ||
868 | case USB_ENDPOINT_XFER_INT: | 876 | case USB_ENDPOINT_XFER_INT: |
869 | if(dir == USB_DIR_IN) | 877 | if(dir == USB_DIR_IN) |
870 | return (2 | USB_DIR_IN); | 878 | return (1 | USB_DIR_IN); |
871 | 879 | ||
872 | default: | 880 | default: |
873 | return -1; | 881 | return -1; |