1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-17 10:26:15 +00:00

Fix for DWC OTG device side isochronous transfers. The even or odd

isochronous frame bit needs to be flipped.

MFC after:	3 days
This commit is contained in:
Hans Petter Selasky 2015-05-19 09:22:06 +00:00
parent 5bae2b34a4
commit 68691fe0ce
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=283103

View File

@ -1557,6 +1557,22 @@ dwc_otg_data_rx(struct dwc_otg_softc *sc, struct dwc_otg_td *td)
/* release FIFO */
dwc_otg_common_rx_ack(sc);
temp = sc->sc_out_ctl[td->ep_no];
/* check for isochronous mode */
if ((temp & DIEPCTL_EPTYPE_MASK) ==
(DIEPCTL_EPTYPE_ISOC << DIEPCTL_EPTYPE_SHIFT)) {
/* toggle odd or even frame bit */
if (temp & DIEPCTL_SETD1PID) {
temp &= ~DIEPCTL_SETD1PID;
temp |= DIEPCTL_SETD0PID;
} else {
temp &= ~DIEPCTL_SETD0PID;
temp |= DIEPCTL_SETD1PID;
}
sc->sc_out_ctl[td->ep_no] = temp;
}
/* check if we are complete */
if ((td->remainder == 0) || got_short) {
if (td->short_pkt) {
@ -2132,10 +2148,23 @@ dwc_otg_data_tx(struct dwc_otg_softc *sc, struct dwc_otg_td *td)
temp = sc->sc_in_ctl[td->ep_no];
/* check for isochronous mode */
if ((temp & DIEPCTL_EPTYPE_MASK) ==
(DIEPCTL_EPTYPE_ISOC << DIEPCTL_EPTYPE_SHIFT)) {
/* toggle odd or even frame bit */
if (temp & DIEPCTL_SETD1PID) {
temp &= ~DIEPCTL_SETD1PID;
temp |= DIEPCTL_SETD0PID;
} else {
temp &= ~DIEPCTL_SETD0PID;
temp |= DIEPCTL_SETD1PID;
}
sc->sc_in_ctl[td->ep_no] = temp;
}
/* must enable before writing data to FIFO */
DWC_OTG_WRITE_4(sc, DOTG_DIEPCTL(td->ep_no), temp |
DIEPCTL_EPENA |
DIEPCTL_CNAK);
DIEPCTL_EPENA | DIEPCTL_CNAK);
td->tx_bytes = count;