summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLukasz Majewski <l.majewski@samsung.com>2014-02-05 10:10:43 +0100
committerMarek Vasut <marex@denx.de>2014-02-06 02:22:45 +0100
commit9c9822188cf2d7eeee7ae4f64a231a2d013df690 (patch)
tree11d8af33572dc46f05ee9e878705ea1372aa7f73
parent716662bd194f72cdf9bf05e0f57d9f6944dc953a (diff)
downloadu-boot-imx-9c9822188cf2d7eeee7ae4f64a231a2d013df690.zip
u-boot-imx-9c9822188cf2d7eeee7ae4f64a231a2d013df690.tar.gz
u-boot-imx-9c9822188cf2d7eeee7ae4f64a231a2d013df690.tar.bz2
usb:udc:samsung: Allow burst transfers for non EP0 endpints
This patch removed obscure restriction on the HW setting of DMA transfers. Before this change each transaction sent up to 512 bytes (with packet count equal to 1) for non EP0 transfer. Now it is possible to setup DMA transaction up to DMA_BUFFER_SIZE. Test condition - test HW + measurement: Trats - Exynos4210 rev.1 - test HW Trats2 - Exynos4412 rev.1 400 MiB compressed rootfs image download with `thor 0 mmc 0` Measurement: Transmission speed: 20.74 MiB/s Signed-off-by: Lukasz Majewski <l.majewski@samsung.com> Cc: Marek Vasut <marex@denx.de>
-rw-r--r--drivers/usb/gadget/s3c_udc_otg_xfer_dma.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/usb/gadget/s3c_udc_otg_xfer_dma.c b/drivers/usb/gadget/s3c_udc_otg_xfer_dma.c
index cbc8734..7c7176b 100644
--- a/drivers/usb/gadget/s3c_udc_otg_xfer_dma.c
+++ b/drivers/usb/gadget/s3c_udc_otg_xfer_dma.c
@@ -97,18 +97,17 @@ static int setdma_rx(struct s3c_ep *ep, struct s3c_request *req)
u32 ep_num = ep_index(ep);
buf = req->req.buf + req->req.actual;
-
- length = min(req->req.length - req->req.actual, (int)ep->ep.maxpacket);
+ length = min(req->req.length - req->req.actual,
+ ep_num ? DMA_BUFFER_SIZE : ep->ep.maxpacket);
ep->len = length;
ep->dma_buf = buf;
- if (length == 0)
+ if (ep_num == EP0_CON || length == 0)
pktcnt = 1;
else
pktcnt = (length - 1)/(ep->ep.maxpacket) + 1;
- pktcnt = 1;
ctrl = readl(&reg->out_endp[ep_num].doepctl);
writel(the_controller->dma_addr[ep_index(ep)+1],