[U-Boot] [PATCH v4 06/10] dm: usb: create a new UCLASS ID for USB gadget devices

Adam Ford aford173 at gmail.com
Tue Dec 18 13:22:07 UTC 2018


On Tue, Dec 18, 2018 at 6:08 AM Jagan Teki <jagan at amarulasolutions.com> wrote:
>
> On Thu, Nov 29, 2018 at 3:30 PM Jean-Jacques Hiblot <jjhiblot at ti.com> wrote:
> >
> > UCLASS_USB_DEV_GENERIC was meant for USB devices connected to host
> > controllers, not gadget devices.
> > Adding a new UCLASS for gadget devices alone.
> >
> > Also move the generic DM code for USB gadgets in a separate file for
> > clarity.
> >
> > Signed-off-by: Jean-Jacques Hiblot <jjhiblot at ti.com>
> >
> > ---
> >
> > Changes in v4: None
> > Changes in v3: None
> > Changes in v2: None
> >
> >  board/sunxi/board.c                 |  2 +-
> >  drivers/usb/dwc3/dwc3-generic.c     |  2 +-
> >  drivers/usb/gadget/ether.c          |  2 +-
> >  drivers/usb/gadget/udc/Makefile     |  4 +++
> >  drivers/usb/gadget/udc/udc-core.c   | 41 --------------------------
> >  drivers/usb/gadget/udc/udc-uclass.c | 58 +++++++++++++++++++++++++++++++++++++
> >  drivers/usb/musb-new/omap2430.c     |  2 +-
> >  drivers/usb/musb-new/sunxi.c        |  2 +-
> >  include/dm/uclass-id.h              |  1 +
> >  9 files changed, 68 insertions(+), 46 deletions(-)
> >  create mode 100644 drivers/usb/gadget/udc/udc-uclass.c
> >
> > diff --git a/board/sunxi/board.c b/board/sunxi/board.c
> > index 64ccbc7..9b36cc7 100644
> > --- a/board/sunxi/board.c
> > +++ b/board/sunxi/board.c
> > @@ -663,7 +663,7 @@ int g_dnl_board_usb_cable_connected(void)
> >         struct phy phy;
> >         int ret;
> >
> > -       ret = uclass_get_device(UCLASS_USB_DEV_GENERIC, 0, &dev);
> > +       ret = uclass_get_device(UCLASS_USB_GADGET_GENERIC, 0, &dev);
>
> This is breaking sunxi boards which uses gadget mode.
>
> U-Boot 2019.01-rc2 (Dec 18 2018 - 17:31:53 +0530) Allwinner Technology
>
> CPU:   Allwinner H3 (SUN8I 1680)
> Model: Banana Pi BPI-M2-Plus
> DRAM:  1 GiB
> Error binding driver 'sunxi-musb': -96
> Some drivers failed to bind
> Error binding driver 'generic_simple_bus': -96
> Some drivers failed to bind
> initcall sequence 7dfd127c failed at call 4a00c3a3 (err=-96)
> ### ERROR ### Please RESET the board ###

I got a similar error when I tried to port the work done for the
gadget mode to the omap2420 glue.  I don't know if they're related,
but the messages are the same (-96). I ended up just ignoring the
generic device all together and used the #ifdef to load either host or
gadget in the patch I submitted for the omap2430 glue.  If this gets
resolved, I might re-evaluate how I did the patch.

adam
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> https://lists.denx.de/listinfo/u-boot


More information about the U-Boot mailing list