diff options
-rw-r--r-- | firmware/export/jz4740.h | 4 | ||||
-rw-r--r-- | firmware/target/mips/ingenic_jz47xx/usb-jz4740.c | 16 |
2 files changed, 16 insertions, 4 deletions
diff --git a/firmware/export/jz4740.h b/firmware/export/jz4740.h index b0f3f538a3..7ddec364a6 100644 --- a/firmware/export/jz4740.h +++ b/firmware/export/jz4740.h | |||
@@ -2475,6 +2475,7 @@ | |||
2475 | #define USB_INCSRH_ISO 0x40 | 2475 | #define USB_INCSRH_ISO 0x40 |
2476 | #define USB_INCSRH_MODE 0x20 | 2476 | #define USB_INCSRH_MODE 0x20 |
2477 | #define USB_INCSRH_DMAREQENAB 0x10 | 2477 | #define USB_INCSRH_DMAREQENAB 0x10 |
2478 | #define USB_INCSRH_FRCDATATOG 0x08 | ||
2478 | #define USB_INCSRH_DMAREQMODE 0x04 | 2479 | #define USB_INCSRH_DMAREQMODE 0x04 |
2479 | #define USB_INCSR_CDT 0x40 | 2480 | #define USB_INCSR_CDT 0x40 |
2480 | #define USB_INCSR_SENTSTALL 0x20 | 2481 | #define USB_INCSR_SENTSTALL 0x20 |
@@ -5112,6 +5113,9 @@ struct Ration2m | |||
5112 | #define IPU_DISABLE_IRQ() \ | 5113 | #define IPU_DISABLE_IRQ() \ |
5113 | REG32(IPU_V_BASE + REG_CTRL) &= ~FM_IRQ_EN; | 5114 | REG32(IPU_V_BASE + REG_CTRL) &= ~FM_IRQ_EN; |
5114 | 5115 | ||
5116 | #define IPU_ENABLE_IRQ() \ | ||
5117 | REG32(IPU_V_BASE + REG_CTRL) |= FM_IRQ_EN; | ||
5118 | |||
5115 | #define IPU_DISABLE_RSIZE() \ | 5119 | #define IPU_DISABLE_RSIZE() \ |
5116 | REG32(IPU_V_BASE + REG_CTRL) &= ~RSZ_EN; | 5120 | REG32(IPU_V_BASE + REG_CTRL) &= ~RSZ_EN; |
5117 | 5121 | ||
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; |