Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
HiFiPhile committed Apr 6, 2024
1 parent 2e8c4d4 commit ceebe23
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/portable/synopsys/dwc2/dcd_dwc2.c
Expand Up @@ -207,7 +207,7 @@ static void dma_ep0_start(uint8_t rhport)
dwc2->epout[0].doeptsiz = (3 << DOEPTSIZ_STUPCNT_Pos);
dwc2->epout[0].doeptsiz |= (3 * 8);
dwc2->epout[0].doeptsiz |= (1 << DOEPTSIZ_PKTCNT_Pos);
dwc2->epout[0].doepdma = (uint32_t)_setup_packet;
dwc2->epout[0].doepdma = (uintptr_t)_setup_packet;

dwc2->epout[0].doepctl |= DOEPCTL_EPENA | DOEPCTL_USBAEP;
}
Expand Down Expand Up @@ -417,7 +417,7 @@ static void edpt_schedule_packets(uint8_t rhport, uint8_t const epnum, uint8_t c
((total_bytes << DIEPTSIZ_XFRSIZ_Pos) & DIEPTSIZ_XFRSIZ_Msk);

if(dma_supported(rhport)) {
epin[epnum].diepdma = (uint32_t)xfer->buffer;
epin[epnum].diepdma = (uintptr_t)xfer->buffer;

// For ISO endpoint set correct odd/even bit for next frame.
if ((epin[epnum].diepctl & DIEPCTL_EPTYP) == DIEPCTL_EPTYP_0 && (XFER_CTL_BASE(epnum, dir))->interval == 1) {
Expand Down Expand Up @@ -458,7 +458,7 @@ static void edpt_schedule_packets(uint8_t rhport, uint8_t const epnum, uint8_t c
}

if(dma_supported(rhport)) {
epout[epnum].doepdma = (uint32_t)xfer->buffer;
epout[epnum].doepdma = (uintptr_t)xfer->buffer;
}

epout[epnum].doepctl |= DOEPCTL_EPENA | DOEPCTL_CNAK;
Expand Down Expand Up @@ -1063,12 +1063,13 @@ static void handle_epout_irq(uint8_t rhport) {
// STPKTRX is only available for version from 3_00a
if ((doepint & DOEPINT_STPKTRX) && (dwc2->gsnpsid >= DWC2_CORE_REV_3_00a)) {
clear_flag |= DOEPINT_STPKTRX;
if(dma_supported(rhport)) {
dma_ep0_start(rhport);
}
}

epout->doepint = clear_flag;

if(dma_supported(rhport) && (dwc2->gsnpsid >= DWC2_CORE_REV_3_00a)) {
dma_ep0_start(rhport);
}

dcd_event_setup_received(rhport, (uint8_t*) _setup_packet, true);
}

Expand Down

0 comments on commit ceebe23

Please sign in to comment.