[U-Boot] [PATCH 2/2] usb: gadget: fotg210: EP0 fifo empty indication is non-reliable

Kuo-Jung Su dantesu at gmail.com
Wed Dec 18 08:24:49 CET 2013


From: Kuo-Jung Su <dantesu at faraday-tech.com>

Because the EP0 fifo empty indication is non-reliable,
an extra delay is necessary to avoid data corruption while
handling packets with size greater than 64 bytes.

This workaround should be applied to all hardware revisions.

Signed-off-by: Kuo-Jung Su <dantesu at faraday-tech.com>
CC: Marek Vasut <marex at denx.de>
---
 drivers/usb/gadget/fotg210.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/usb/gadget/fotg210.c b/drivers/usb/gadget/fotg210.c
index e3a61cc..14bfec6 100644
--- a/drivers/usb/gadget/fotg210.c
+++ b/drivers/usb/gadget/fotg210.c
@@ -245,6 +245,7 @@ static int fotg210_dma(struct fotg210_ep *ep, struct fotg210_request *req)
 		if (ep->id == 0) {
 			/* Wait until cx/ep0 fifo empty */
 			fotg210_cxwait(chip, CXFIFO_CXFIFOE);
+			udelay_masked(1);
 			writel(DMAFIFO_CX, &regs->dma_fifo);
 		} else {
 			/* Wait until epx fifo empty */
-- 
1.7.9.5



More information about the U-Boot mailing list