Hi Kory,

On Mon Dec 1, 2025 at 2:14 PM CET, Kory Maincent wrote:
> On Fri, 28 Nov 2025 21:46:36 +0100
> "Markus Schneider-Pargmann (TI.com)" <[email protected]> wrote:
>
>> Support musb being probed by ti,musb-am33xx. The non-upstream DT probing
>> used a wrapper driver that probed ti-musb-peripheral and ti-musb-host.
>> This wrapper registered as UCLASS_MISC, which is why it is requested in
>> this board.c file.
>> 
>> With the new devicetree the wrapper that registers as UCLASS_MISC is
>> gone, instead the UCLASS_USB and UCLASS_USB_GADGET_GENERIC have to be
>> requested.
>> 
>> Also don't fail if the USB devices are not available.
>> 
>> Signed-off-by: Markus Schneider-Pargmann (TI.com) <[email protected]>
>> ---
>>  arch/arm/mach-omap2/am33xx/board.c | 12 ++++++++----
>>  1 file changed, 8 insertions(+), 4 deletions(-)
>> 
>> diff --git a/arch/arm/mach-omap2/am33xx/board.c
>> b/arch/arm/mach-omap2/am33xx/board.c index
>> d7db260513308257f142ea70d5d5c643afc920c9..4bfdb55b2dd5c66cd58bce360cf1c69fb7a00cd6
>> 100644 --- a/arch/arm/mach-omap2/am33xx/board.c +++
>> b/arch/arm/mach-omap2/am33xx/board.c @@ -266,12 +266,16 @@ int
>> arch_misc_init(void) struct udevice *dev;
>>      int ret;
>>  
>> -    ret = uclass_first_device_err(UCLASS_MISC, &dev);
>> -    if (ret)
>> -            return ret;
>> +    if (IS_ENABLED(CONFIG_OF_UPSTREAM)) {
>> +            uclass_first_device_err(UCLASS_USB, &dev);
>> +            ret = uclass_first_device_err(UCLASS_USB_GADGET_GENERIC,
>> &dev);
>> +    } else {
>> +            ret = uclass_first_device_err(UCLASS_MISC, &dev);
>> +    }
>>  
>>  #if defined(CONFIG_DM_ETH) && defined(CONFIG_USB_ETHER)
>> -    usb_ether_init();
>> +    if (!ret)
>> +            usb_ether_init();
>>  #endif
>>  
>>      return 0;
>
> You are losing the error return value here.

Yes, on purpose. During my work on using the upstream devicetree I
didn't have a working USB yet but u-boot wouldn't start because
arch_misc_init failed. I don't see why u-boot shouldn't start a console
if something USB related is broken. That's why I did not return the USB
error code here.

Also if you do need USB for booting you notice it really quick.

Thanks for all your reviews.

Best
Markus

Attachment: signature.asc
Description: PGP signature

Reply via email to