[U-Boot] [PATCH v3] usb: add support for generic EHCI devices
Alexey Brodkin
Alexey.Brodkin at synopsys.com
Mon Nov 30 19:13:30 CET 2015
Hi Marek,
On Mon, 2015-11-30 at 19:05 +0100, Marek Vasut wrote:
> On Monday, November 30, 2015 at 06:47:45 PM, Alexey Brodkin wrote:
> > From: Alexey Brodkin <Alexey.Brodkin at synopsys.com>
> > +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) ?
This symbol is in "if USB_EHCI_HCD" so if USB_EHCI_HCD is not enabled
EHCI_GENERIC won't be visible and hence USB_EHCI_HCD in defconfig.
Otherwise we'll need to add USB_EHCI_HCD dependency for other EHCI drivers
such as USB_EHCI_MARVELL, USB_EHCI_MX6 and USB_EHCI_UNIPHIER.
Do we want to do it? :)
Please check drivers/usb/host/Kconfig.
> [...]
>
> > +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.
Ok but then some other drivers should be fixed as well, right?
See:
----------------------->8------------------------
git grep U_BOOT_DRIVER drivers/usb/host/
drivers/usb/host/dwc2.c:U_BOOT_DRIVER(usb_dwc2) = {
drivers/usb/host/ehci-exynos.c:U_BOOT_DRIVER(usb_ehci) = {
drivers/usb/host/ehci-generic.c:U_BOOT_DRIVER(usb_ehci) = {
drivers/usb/host/ehci-marvell.c:U_BOOT_DRIVER(ehci_mvebu) = {
drivers/usb/host/ehci-pci.c:U_BOOT_DRIVER(ehci_pci) = {
drivers/usb/host/ehci-sunxi.c:U_BOOT_DRIVER(usb_ehci) = {
drivers/usb/host/ehci-tegra.c:U_BOOT_DRIVER(usb_ehci) = {
drivers/usb/host/ohci-sunxi.c:U_BOOT_DRIVER(usb_ohci) = {
drivers/usb/host/usb-sandbox.c:U_BOOT_DRIVER(usb_sandbox) = {
drivers/usb/host/usb-uclass.c:U_BOOT_DRIVER(usb_dev_generic_drv) = {
drivers/usb/host/xhci-exynos5.c:U_BOOT_DRIVER(usb_xhci) = {
----------------------->8------------------------
I believe it all works because we don't enable 2 drivers at a time
[usually] :)
And in that light I don't see a point in having different names here.
Or you think there's a chance to have more than one USB controller enabled
simultaneously [and if it is possible at all with current implementation]?
-Alexey
More information about the U-Boot
mailing list