]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
usb: ci_udc: Support larger packets
authorStephen Warren <swarren@nvidia.com>
Thu, 24 Apr 2014 23:52:36 +0000 (17:52 -0600)
committerMarek Vasut <marex@denx.de>
Wed, 30 Apr 2014 08:30:57 +0000 (10:30 +0200)
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

index 14b1e9b8bf1117037d4b21a41c0fd76a50f1a171..815ce7b262ca408cc337f683f097a8afa992d1e7 100644 (file)
@@ -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;