mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-29 08:01:08 +00:00
usb: dwc2 : invalidate dcache before starting DMA
Invalidate dcache before starting the DMA to ensure coherency. In case there are any dirty lines from the DMA buffer in the cache, subsequent cache-line replacements may corrupt the buffer in memory while the DMA is still going on. Cache-line replacement can happen if the CPU tries to bring some other memory locations into the cache while the DMA is going on. Signed-off-by: Ziyuan Xu <xzy.xu@rock-chips.com> Acked-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
4711788267
commit
9424f14183
1 changed files with 3 additions and 0 deletions
|
@ -110,6 +110,9 @@ static int setdma_rx(struct dwc2_ep *ep, struct dwc2_request *req)
|
|||
|
||||
ctrl = readl(®->out_endp[ep_num].doepctl);
|
||||
|
||||
invalidate_dcache_range((unsigned long) ep->dma_buf,
|
||||
(unsigned long) ep->dma_buf + ep->len);
|
||||
|
||||
writel((unsigned int) ep->dma_buf, ®->out_endp[ep_num].doepdma);
|
||||
writel(DOEPT_SIZ_PKT_CNT(pktcnt) | DOEPT_SIZ_XFER_SIZE(length),
|
||||
®->out_endp[ep_num].doeptsiz);
|
||||
|
|
Loading…
Reference in a new issue