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

Jean-Jacques Hiblot jjhiblot at ti.com
Wed Dec 19 10:34:08 UTC 2018


On 19/12/2018 11:31, Jean-Jacques Hiblot wrote:
>
> On 18/12/2018 13:08, Jagan Teki 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
>
> Can you try with DM_USB_GADGET enabled ?

The reasoning is that UCLASS_DRIVER(usb_gadget_generic) is defined if 
and only if DM_USB_GADGET is enabled.

>
> JJ
>
>
>> 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 ###
>>
> _______________________________________________
> 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