[U-Boot] [PATCH v3] usb: add support for generic EHCI devices

Marek Vasut marex at denx.de
Mon Nov 30 19:05:04 CET 2015


On Monday, November 30, 2015 at 06:47:45 PM, Alexey Brodkin wrote:
> From: Alexey Brodkin <Alexey.Brodkin at synopsys.com>
> 
> This driver is meant to be used with any EHCI-compatible host
> controller in case if there's no need for platform-specific
> glue such as setup of controller or PHY's power mode via
> GPIOs etc.
> 
> Signed-off-by: Alexey Brodkin <abrodkin at synopsys.com>
> Reviewed-by: Simon Glass <sjg at chromium.org>
> Reviewed-by: Marek Vasut <marex at denx.de>
> Cc: Stephen Warren <swarren at nvidia.com>
> ---
> 
> Changes compared to v2:
>  * Driver is disabled by default now
>  * Use uintptr_t instead of uint32_t for "struct ehci_hcor"
>    address calculation
> 
> Changes compared to v1:
>  * Updated commit message with removal of Synopsys board mention
>  * Cleaned-up ehci_usb_remove()
> 
>  drivers/usb/host/Kconfig        |  7 ++++++
>  drivers/usb/host/Makefile       |  1 +
>  drivers/usb/host/ehci-generic.c | 51
> +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 59
> insertions(+)
>  create mode 100644 drivers/usb/host/ehci-generic.c
> 
> diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig
> index 2a2bffe..6bb9caa 100644
> --- a/drivers/usb/host/Kconfig
> +++ b/drivers/usb/host/Kconfig
> @@ -73,4 +73,11 @@ config USB_EHCI_UNIPHIER
>  	---help---
>  	  Enables support for the on-chip EHCI controller on UniPhier SoCs.
> 
> +config USB_EHCI_GENERIC
> +	bool "Support for generic EHCI USB controller"
> +	depends on OF_CONTROL
> +	default n
> +	---help---
> +	  Enables support for generic EHCI controller.

This should depend on EHCI_HCD somehow, no (since it's using ehci_deregister and 
friends) ?

[...]

> +static const struct udevice_id ehci_usb_ids[] = {
> +	{ .compatible = "generic-ehci" },
> +	{ }
> +};
> +
> +U_BOOT_DRIVER(usb_ehci) = {

The driver name should be ehci_generic, not usb_ehci, otherwise this will 
collide with other drivers who do the same mistake.

> +	.name	= "ehci_generic",
> +	.id	= UCLASS_USB,
> +	.of_match = ehci_usb_ids,
> +	.probe = ehci_usb_probe,
> +	.remove = ehci_usb_remove,
> +	.ops	= &ehci_usb_ops,
> +	.priv_auto_alloc_size = sizeof(struct generic_ehci),
> +	.flags	= DM_FLAG_ALLOC_PRIV_DMA,
> +};
> +

Best regards,
Marek Vasut


More information about the U-Boot mailing list