diff mbox

[U-Boot,1/5] usb: ci_udc: Support larger packets

Message ID 1398383560-25603-1-git-send-email-swarren@wwwdotorg.org
State Accepted
Delegated to: Marek Vasut
Headers show

Commit Message

Stephen Warren April 24, 2014, 11:52 p.m. UTC
From: Stephen Warren <swarren@nvidia.com>

ci_ep_queue() currently only fills in the page0/page1 fields in the
queue item. If the buffer is larger than 4KiB (unaligned) or 8KiB
(page-aligned), then this prevents the HW from knowing where to write
the balance of the data.

Fix this by initializing all 5 pageN pointers, which allows up to
16KiB (potentially non-page-aligned) buffers.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
---
 drivers/usb/gadget/ci_udc.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Marek Vasut April 28, 2014, 5:34 a.m. UTC | #1
On Friday, April 25, 2014 at 01:52:36 AM, Stephen Warren wrote:
> From: Stephen Warren <swarren@nvidia.com>
> 
> ci_ep_queue() currently only fills in the page0/page1 fields in the
> queue item. If the buffer is larger than 4KiB (unaligned) or 8KiB
> (page-aligned), then this prevents the HW from knowing where to write
> the balance of the data.
> 
> Fix this by initializing all 5 pageN pointers, which allows up to
> 16KiB (potentially non-page-aligned) buffers.
> 
> Signed-off-by: Stephen Warren <swarren@nvidia.com>

Applied all, thanks. But can you please check if we can get the buffer 
allocation from 5/5 sorted please ? I'd really like that instead of such hacks.

Best regards,
Marek Vasut
diff mbox

Patch

diff --git a/drivers/usb/gadget/ci_udc.c b/drivers/usb/gadget/ci_udc.c
index 14b1e9b8bf11..815ce7b262ca 100644
--- a/drivers/usb/gadget/ci_udc.c
+++ b/drivers/usb/gadget/ci_udc.c
@@ -350,6 +350,9 @@  static int ci_ep_queue(struct usb_ep *ep,
 	item->info = INFO_BYTES(len) | INFO_IOC | INFO_ACTIVE;
 	item->page0 = (uint32_t)ci_ep->b_buf;
 	item->page1 = ((uint32_t)ci_ep->b_buf & 0xfffff000) + 0x1000;
+	item->page2 = ((uint32_t)ci_ep->b_buf & 0xfffff000) + 0x2000;
+	item->page3 = ((uint32_t)ci_ep->b_buf & 0xfffff000) + 0x3000;
+	item->page4 = ((uint32_t)ci_ep->b_buf & 0xfffff000) + 0x4000;
 	ci_flush_qtd(num);
 
 	head->next = (unsigned) item;