Re: [U-Boot] [PATCH] usb: dwc2: Align size of invalidating dcache before starting DMA

2017-08-31 Thread Seung-Woo Kim
Hello,

This patch was tested with Exynos4412 Odroid-U3 board for THOR usb gadget 
driver.

Best Regards,
- Seung-Woo Kim

> -Original Message-
> From: Seung-Woo Kim [mailto:sw0312@samsung.com]
> Sent: Monday, July 31, 2017 6:08 PM
> To: u-boot@lists.denx.de; lu...@denx.de; ma...@denx.de
> Cc: sw0312@samsung.com; xzy...@rock-chips.com; jh80.ch...@samsung.com
> Subject: [PATCH] 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 
> ---
>  drivers/usb/gadget/dwc2_udc_otg_xfer_dma.c |3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/gadget/dwc2_udc_otg_xfer_dma.c 
> b/drivers/usb/gadget/dwc2_udc_otg_xfer_dma.c
> index 0d6d2fb..b6164af 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),
> --
> 1.7.9.5


___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH] usb: dwc2: Align size of invalidating dcache before starting DMA

2017-08-06 Thread Jaehoon Chung
On 07/31/2017 06:33 PM, Łukasz Majewski wrote:
> Hi Seung-Woo,
> 
>> 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 
>> ---
>>  drivers/usb/gadget/dwc2_udc_otg_xfer_dma.c |3 ++-
>>  1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/usb/gadget/dwc2_udc_otg_xfer_dma.c 
>> b/drivers/usb/gadget/dwc2_udc_otg_xfer_dma.c
>> index 0d6d2fb..b6164af 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),
>>
> 
> Reviewed-by: Łukasz Majewski 

Acked-by: Jaehoon Chung 

Best Regards,
Jaehoon Chung

> 

___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot


Re: [U-Boot] [PATCH] usb: dwc2: Align size of invalidating dcache before starting DMA

2017-07-31 Thread Łukasz Majewski

Hi Seung-Woo,


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 
---
 drivers/usb/gadget/dwc2_udc_otg_xfer_dma.c |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/gadget/dwc2_udc_otg_xfer_dma.c 
b/drivers/usb/gadget/dwc2_udc_otg_xfer_dma.c
index 0d6d2fb..b6164af 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),



Reviewed-by: Łukasz Majewski 

--
Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
___
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot