From ec413f7692de3e33254d79a84c46bd036fd27d0a Mon Sep 17 00:00:00 2001 From: Solomon Peachy Date: Mon, 14 Sep 2020 20:36:24 -0400 Subject: jz4760: Heavily rework USB driver to add working DMA support * DMA Bulk IN (ie our TX) results in sequential transfers 33-68% faster. * DMA Bulk OUT (ie RX) is mostly stripped out due to complete brokenness. * Interrupt and control endpoints remain PIO-driven. Other improvements: 1) Use consistent endpoint references (no magic numbers) 2) Greatly enhanced logging 3) DMA support can be compiled out completely 4) Setting lockswitch will disable all DMA operations at runtime 5) Much more robust error checking and recovery Change-Id: I57b82e655e55ced0dfe289e379b0b61d8fe443b4 --- utils/hwstub/stub/jz4760b/jz4760b.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'utils/hwstub/stub/jz4760b') diff --git a/utils/hwstub/stub/jz4760b/jz4760b.h b/utils/hwstub/stub/jz4760b/jz4760b.h index 97ef74a56c..d07a039f70 100644 --- a/utils/hwstub/stub/jz4760b/jz4760b.h +++ b/utils/hwstub/stub/jz4760b/jz4760b.h @@ -6966,6 +6966,8 @@ do { \ #define USB_FIFO_EP(n) (USB_BASE + (n)*4 + 0x20) +#define USB_HWVERS (USB_BASE + 0x6c) + #define USB_EPINFO (USB_BASE + 0x78) /* Endpoint information */ #define USB_RAMINFO (USB_BASE + 0x79) /* RAM information */ @@ -7006,6 +7008,7 @@ do { \ #define USB_INCSRH_DMAREQENAB 0x10 #define USB_INCSRH_FRCDATATOG 0x08 #define USB_INCSRH_DMAREQMODE 0x04 +#define USB_INCSR_INCOMPTX 0x80 #define USB_INCSR_CDT 0x40 #define USB_INCSR_SENTSTALL 0x20 #define USB_INCSR_SENDSTALL 0x10 @@ -7083,6 +7086,8 @@ do { \ #define REG_USB_ADDR(n) REG32(USB_ADDR(n)) #define REG_USB_COUNT(n) REG32(USB_COUNT(n)) +#define REG_USB_HWVERS REG16(USB_HWVERS) + #define REG_USB_EPINFO REG8(USB_EPINFO) #define REG_USB_RAMINFO REG8(USB_RAMINFO) -- cgit v1.2.3