summaryrefslogtreecommitdiff
path: root/firmware
diff options
context:
space:
mode:
authorMaurus Cuelenaere <mcuelenaere@gmail.com>2009-05-17 15:41:05 +0000
committerMaurus Cuelenaere <mcuelenaere@gmail.com>2009-05-17 15:41:05 +0000
commit649671eae32eb7bb43a9ece0654a78336194b654 (patch)
tree79a3156c47aabc7ee755fa9822159fcdfc522acd /firmware
parent0023943439148f4c3bfdab2d437345bd87da5a60 (diff)
Get interrupt endpoints fully working on Ingenic Jz4740 targets
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20978 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware')
-rw-r--r--firmware/export/jz4740.h4
-rw-r--r--firmware/target/mips/ingenic_jz47xx/usb-jz4740.c16
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 @@
#define USB_INCSRH_ISO 0x40
#define USB_INCSRH_MODE 0x20
#define USB_INCSRH_DMAREQENAB 0x10
+#define USB_INCSRH_FRCDATATOG 0x08
#define USB_INCSRH_DMAREQMODE 0x04
#define USB_INCSR_CDT 0x40
#define USB_INCSR_SENTSTALL 0x20
@@ -5112,6 +5113,9 @@ struct Ration2m
#define IPU_DISABLE_IRQ() \
REG32(IPU_V_BASE + REG_CTRL) &= ~FM_IRQ_EN;
+#define IPU_ENABLE_IRQ() \
+ REG32(IPU_V_BASE + REG_CTRL) |= FM_IRQ_EN;
+
#define IPU_DISABLE_RSIZE() \
REG32(IPU_V_BASE + REG_CTRL) &= ~RSZ_EN;
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 @@
****************************************************************************/
#include "config.h"
+#define LOGF_ENABLE
#include "logf.h"
#include "system.h"
#include "usb_ch9.h"
@@ -76,9 +77,9 @@ static struct usb_endpoint endpoints[] =
{/* buf length sent busy type use_dma wait fifo_addr fifo_size */
{&ep0_rx_buf, 0, {0}, false, ep_control, false, false, USB_FIFO_EP0, 64 },
{NULL, 0, {0}, false, ep_control, false, false, USB_FIFO_EP0, 64 },
+ {NULL, 0, {0}, false, ep_interrupt, false, false, USB_FIFO_EP1, 64 },
{NULL, 0, {0}, false, ep_bulk, false, false, USB_FIFO_EP1, 512},
- {NULL, 0, {0}, false, ep_bulk, false, false, USB_FIFO_EP1, 512},
- {NULL, 0, {0}, false, ep_interrupt, false, false, USB_FIFO_EP2, 64 }
+ {NULL, 0, {0}, false, ep_bulk, false, false, USB_FIFO_EP2, 512}
};
static struct wakeup ep_wkup[TOTAL_EP()];
@@ -436,6 +437,9 @@ static void setup_endpoint(struct usb_endpoint *ep)
if(ep->use_dma)
csrh |= (USB_INCSRH_DMAREQENAB | USB_INCSRH_AUTOSET | USB_INCSRH_DMAREQMODE);
+ if(ep->type == ep_interrupt)
+ csrh |= USB_INCSRH_FRCDATATOG;
+
REG_USB_REG_INMAXP = ep->fifo_size;
REG_USB_REG_INCSR = csr;
REG_USB_REG_INCSRH = csrh;
@@ -860,14 +864,18 @@ int usb_drv_request_endpoint(int type, int dir)
type &= USB_ENDPOINT_XFERTYPE_MASK;
/* There are only 3+2 endpoints, so hardcode this ... */
+ /* Use the endpoint combinations from the Ingenic Linux USB driver */
switch(type)
{
case USB_ENDPOINT_XFER_BULK:
- return (1 | dir);
+ if(dir == USB_DIR_IN)
+ return (2 | USB_DIR_IN);
+ else
+ return (1 | USB_DIR_OUT);
case USB_ENDPOINT_XFER_INT:
if(dir == USB_DIR_IN)
- return (2 | USB_DIR_IN);
+ return (1 | USB_DIR_IN);
default:
return -1;