[U-Boot] [PATCH 2/4] usb: gadget: dwc2: Fix warning over 32bit vs 64bit targets

Marek Vasut marex at denx.de
Sat Jan 27 19:52:43 UTC 2018


On 01/27/2018 08:48 PM, Tom Rini wrote:
> When we have a driver that is used on both 32bit and 64bit targets and
> we are talking about address space we cannot use u64 nor u32 and instead
> need to use phys_addr_t.

Can someoneone pass in a pointer above 32bit address range ? That might
cause some mess ...

> Cc: Lukasz Majewski <lukma at denx.de>
> Cc: Marek Vasut <marex at denx.de>
> Signed-off-by: Tom Rini <trini at konsulko.com>
> ---
>  drivers/usb/gadget/dwc2_udc_otg_xfer_dma.c | 2 +-
>  1 file changed, 1 insertion(+), 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 b6164afa9245..ec4b1e219ed0 100644
> --- a/drivers/usb/gadget/dwc2_udc_otg_xfer_dma.c
> +++ b/drivers/usb/gadget/dwc2_udc_otg_xfer_dma.c
> @@ -114,7 +114,7 @@ static int setdma_rx(struct dwc2_ep *ep, struct dwc2_request *req)
>  				(unsigned long) ep->dma_buf +
>  				ROUND(ep->len, CONFIG_SYS_CACHELINE_SIZE));
>  
> -	writel((unsigned int) ep->dma_buf, &reg->out_endp[ep_num].doepdma);
> +	writel((phys_addr_t) ep->dma_buf, &reg->out_endp[ep_num].doepdma);
>  	writel(DOEPT_SIZ_PKT_CNT(pktcnt) | DOEPT_SIZ_XFER_SIZE(length),
>  	       &reg->out_endp[ep_num].doeptsiz);
>  	writel(DEPCTL_EPENA|DEPCTL_CNAK|ctrl, &reg->out_endp[ep_num].doepctl);
> 


-- 
Best regards,
Marek Vasut


More information about the U-Boot mailing list