From: Seung-Woo Kim Date: Mon, 31 Jul 2017 09:08:10 +0000 (+0900) Subject: usb: dwc2: Align size of invalidating dcache before starting DMA X-Git-Tag: v2017.11-rc1~33^2 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=a939af0c748e2ea1eeb8cf47fa9771a95786de70;p=oweals%2Fu-boot.git usb: dwc2: Align size of invalidating dcache before starting DMA During using dwc2 usb gadget, if usb message size is too small, following cache misaligned warning is shown: CACHE: Misaligned operation at range [bfdbcb00, bfdbcb04] Align size of invalidating dcache before starting DMA to remove the warning. Signed-off-by: Seung-Woo Kim --- diff --git a/drivers/usb/gadget/dwc2_udc_otg_xfer_dma.c b/drivers/usb/gadget/dwc2_udc_otg_xfer_dma.c index 0d6d2fba8a..b6164afa92 100644 --- a/drivers/usb/gadget/dwc2_udc_otg_xfer_dma.c +++ b/drivers/usb/gadget/dwc2_udc_otg_xfer_dma.c @@ -111,7 +111,8 @@ 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); + (unsigned long) ep->dma_buf + + ROUND(ep->len, CONFIG_SYS_CACHELINE_SIZE)); writel((unsigned int) ep->dma_buf, ®->out_endp[ep_num].doepdma); writel(DOEPT_SIZ_PKT_CNT(pktcnt) | DOEPT_SIZ_XFER_SIZE(length),