[U-Boot] [PATCH v2] usb: xhci-mem: Fix scratchpad array issue

Marek Vasut marex at denx.de
Mon Jan 7 06:22:45 UTC 2019


On 1/7/19 3:45 AM, Ye Li wrote:
> After updating the value of dev_context_ptrs[0], we should flush this
> from cache to memory. Otherwise the xhci controller won't use it.
> 
> Signed-off-by: Ye Li <ye.li at nxp.com>
> Reviewed-by: Marek Vasut <marex at denx.de>

Looks good to me, waiting for A-B/R-B from Bin.

> ---
> Changes for v2:
>    - Change to use sizeof(ctrl->dcbaa->dev_context_ptrs[0])
> 
>  drivers/usb/host/xhci-mem.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c
> index 04ab540..84c2c33 100644
> --- a/drivers/usb/host/xhci-mem.c
> +++ b/drivers/usb/host/xhci-mem.c
> @@ -369,6 +369,9 @@ static int xhci_scratchpad_alloc(struct xhci_ctrl *ctrl)
>  	ctrl->dcbaa->dev_context_ptrs[0] =
>  		cpu_to_le64((uintptr_t)scratchpad->sp_array);
>  
> +	xhci_flush_cache((uintptr_t)&ctrl->dcbaa->dev_context_ptrs[0],
> +		sizeof(ctrl->dcbaa->dev_context_ptrs[0]));
> +
>  	page_size = xhci_readl(&hcor->or_pagesize) & 0xffff;
>  	for (i = 0; i < 16; i++) {
>  		if ((0x1 & page_size) != 0)
> 


-- 
Best regards,
Marek Vasut


More information about the U-Boot mailing list