From daf082ced48dd656dfd1aa6612fd553b0151e8d3 Mon Sep 17 00:00:00 2001 From: Vijayavardhan Vennapusa Date: Fri, 1 Mar 2013 13:08:59 +0530 Subject: [PATCH] USB: dwc: Reduce TxFIFO of non burst Bulk In endpoint to 1K from 3K Some portion of the DWC3 controller TxFIFOs memory(29K) is used for storing QDSS BAM data and descriptors (21K). When QDSS is present in the configuration, 8K is only left for TxFIFOs. QDSS data endpoint (burst capable Bulk In) requires 3K TxFIFO for higher throughputs. Reduce non-burst capable In endpoint TxFIFO from 3K to 1K which allows DIAG and ADB interfaces to co-exist with QDSS in a configuration. Change-Id: Id999b7253c0192013f937128cf2f0a2b61f2630b Signed-off-by: Pavankumar Kondeti Signed-off-by: Vijayavardhan Vennapusa --- drivers/usb/dwc3/gadget.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index 06643765c0e..56949998c23 100644 --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c @@ -191,7 +191,8 @@ int dwc3_gadget_resize_tx_fifos(struct dwc3 *dwc) * FIXME For now we will only allocate 1 wMaxPacketSize space * for each enabled endpoint, later patches will come to * improve this algorithm so that we better use the internal - * FIFO space + * FIFO space. Also consider the case where TxFIFO RAM space + * may change dynamically based on the USB configuration. */ for (num = 0; num < DWC3_ENDPOINTS_NUM; num++) { struct dwc3_ep *dep = dwc->eps[num]; @@ -205,7 +206,8 @@ int dwc3_gadget_resize_tx_fifos(struct dwc3 *dwc) if (!(dep->flags & DWC3_EP_ENABLED)) continue; - if (usb_endpoint_xfer_bulk(dep->endpoint.desc) + if (((dep->endpoint.maxburst > 1) && + usb_endpoint_xfer_bulk(dep->endpoint.desc)) || usb_endpoint_xfer_isoc(dep->endpoint.desc)) mult = 3; @@ -215,8 +217,8 @@ int dwc3_gadget_resize_tx_fifos(struct dwc3 *dwc) * Make sure that's true somehow and change FIFO allocation * accordingly. * - * If we have Bulk or Isochronous endpoints, we want - * them to be able to be very, very fast. So we're giving + * If we have Bulk (burst only) or Isochronous endpoints, we + * want them to be able to be very, very fast. So we're giving * those endpoints a fifo_size which is enough for 3 full * packets */