usb:udc:samsung: Allow burst transfers for non EP0 endpints 48/63848/1
authorLukasz Majewski <l.majewski@samsung.com>
Wed, 5 Feb 2014 09:10:43 +0000 (10:10 +0100)
committerjino.cho <jino.cho@samsung.com>
Mon, 28 Mar 2016 05:47:13 +0000 (14:47 +0900)
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

Change-Id: I4b70ba0c607e125f851bfec9965c77e8e6cd000f
Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
Cc: Marek Vasut <marex@denx.de>
drivers/usb/gadget/s3c_udc_otg_xfer_dma.c

index d65ac89bf1926bbf19be6335ae6c8362f803e340..aabf1f705e902a4136ecfd0f0b729e45b2e31ff0 100644 (file)
@@ -110,18 +110,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((unsigned int) ep->dma_buf, &reg->out_endp[ep_num].doepdma);