Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit eeebcdff authored by Vamsi Krishna Samavedam's avatar Vamsi Krishna Samavedam
Browse files

dwc3: gadget: Set TXFRAMNUM_N while resizing TXFIFO for ISOC eps



Set TXFRAMNUM_N per synopsys programming guide recommendation for isoc
endpoints.

Change-Id: I8a433e8e6198f0374e13c75619bfffc8238432ea
Signed-off-by: default avatarVamsi Krishna Samavedam <vskrishn@codeaurora.org>
parent f24738ce
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -660,6 +660,7 @@ static bool dwc3_core_is_valid(struct dwc3 *dwc)
		/* Detected DWC_usb31 IP */
		dwc->revision = dwc3_readl(dwc->regs, DWC3_VER_NUMBER);
		dwc->revision |= DWC3_REVISION_IS_DWC31;
		dwc->versiontype = dwc3_readl(dwc->regs, DWC3_VER_TYPE);
	} else {
		return false;
	}
+5 −0
Original line number Diff line number Diff line
@@ -1061,6 +1061,11 @@ struct dwc3 {
#define DWC3_REVISION_IS_DWC31		0x80000000
#define DWC3_USB31_REVISION_110A	(0x3131302a | DWC3_REVISION_IS_DWC31)
#define DWC3_USB31_REVISION_120A	(0x3132302a | DWC3_REVISION_IS_DWC31)
#define DWC3_USB31_REVISION_170A	(0x3137302a | DWC3_REVISION_IS_DWC31)

	/* valid only for dwc31 configuraitons */
	u32			versiontype;
#define DWC3_USB31_VER_TYPE_EA06	0x65613036

	enum dwc3_ep0_next	ep0_next_event;
	enum dwc3_ep0_state	ep0state;
+0 −6
Original line number Diff line number Diff line
@@ -682,12 +682,6 @@ static int dwc3_ep0_set_config(struct dwc3 *dwc, struct usb_ctrlrequest *ctrl)
						DWC3_ENDPOINTS_NUM); num += 2) {
				dep = dwc->eps[num];
				size = 0;
				/* Don't change TXFRAMNUM on usb31 version */
				if (dwc3_is_usb31(dwc))
					size = dwc3_readl(dwc->regs,
						DWC3_GTXFIFOSIZ(num >> 1)) &
						DWC31_GTXFIFOSIZ_TXFRAMNUM;

				dwc3_writel(dwc->regs,
					DWC3_GTXFIFOSIZ(num >> 1), size);
				dep->fifo_depth = 0;
+5 −0
Original line number Diff line number Diff line
@@ -270,6 +270,11 @@ int dwc3_gadget_resize_tx_fifos(struct dwc3 *dwc, struct dwc3_ep *dep)
		return -ENOMEM;
	}

	if ((dwc->revision == DWC3_USB31_REVISION_170A) &&
		(dwc->versiontype == DWC3_USB31_VER_TYPE_EA06) &&
		usb_endpoint_xfer_isoc(dep->endpoint.desc))
		fifo_size |= DWC31_GTXFIFOSIZ_TXFRAMNUM;

	dwc3_writel(dwc->regs, DWC3_GTXFIFOSIZ(dep->endpoint.ep_num),
							fifo_size);
	return 0;