[U-Boot] [PATCH v4 2/4] USB: host: Add the USB3 host driver

Marek Vasut marex at denx.de
Mon Aug 19 11:28:49 UTC 2019


On 8/19/19 8:10 AM, Sherry Sun wrote:
> Add the USB3 host driver for NXP imx8 platform, and the
> cadence IP is in it. The USB3 host driver support DM
> mode, it will probe USB3 host node in dts.
> 
> Signed-off-by: Sherry Sun <sherry.sun at nxp.com>

[...]

> +static void xhci_imx8_get_reg_addr(struct udevice *dev)
> +{
> +	imx8_data.usb3_ctrl_base =
> +			(void __iomem *)devfdt_get_addr_index(dev, 0);
> +	imx8_data.usb3_core_base =
> +			(void __iomem *)devfdt_get_addr_index(dev, 4);
> +}

Inline this.

Also, look at drivers/mtd/renesas_rpc_hf.c to handle both 32bit and
64bit DTs with multiple "reg" entries.

[...]

> +static const struct udevice_id xhci_usb_ids[] = {
> +	{ .compatible = "cdns,usb3-host", },

https://lore.kernel.org/patchwork/patch/1059917/ would suggest that
cdns,usb3-1.0.0 is the compatible. But I might be wrong.

> +	{ }
> +};
> +
> +U_BOOT_DRIVER(xhci_imx8) = {
> +	.name	= "xhci_imx8",
> +	.id	= UCLASS_USB,
> +	.of_match = xhci_usb_ids,
> +	.probe = xhci_imx8_probe,
> +	.remove = xhci_imx8_remove,
> +	.ops	= &xhci_usb_ops,
> +	.platdata_auto_alloc_size = sizeof(struct usb_platdata),
> +	.priv_auto_alloc_size = sizeof(struct xhci_ctrl),
> +	.flags	= DM_FLAG_ALLOC_PRIV_DMA,

I think you also need DM_FLAG_OS_PREPARE to trigger .remove before
booting Linux, but I might be wrong. Please check that.


More information about the U-Boot mailing list