]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
am33xx: don't assume we have a UCLASS_MISC device present
authorJeremy Kerr <jk@codeconstruct.com.au>
Fri, 8 May 2026 07:11:32 +0000 (15:11 +0800)
committerTom Rini <trini@konsulko.com>
Wed, 27 May 2026 23:59:19 +0000 (17:59 -0600)
Boot on am33xx without CONFIG_USB will currently fail, as we error-out
of arch_misc_init() if no UCLASS_MISC device is found. This requirement
was introduced in commit 3aec2648698d ("am33xx: board: probe misc
drivers to register musb devices").

Instead, only attempt the UCLASS_MISC init if we would expect the MUSB
TI device to be present. Add a comment to explain why we're doing the
device lookup (which we immediately discard).

Fixes: 3aec2648698d ("am33xx: board: probe misc drivers to register musb devices")
Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
Reviewed-by: Tom Rini <trini@konsulko.com>
arch/arm/mach-omap2/am33xx/board.c

index 4e9ad8935e3b5020c4ed1d022ae4846a2dc9486f..0261606089ea672baf7e05046de73ef9bf518f64 100644 (file)
@@ -266,9 +266,15 @@ int arch_misc_init(void)
        struct udevice *dev;
        int ret;
 
-       ret = uclass_first_device_err(UCLASS_MISC, &dev);
-       if (ret)
-               return ret;
+       /*
+        * The MUSB wrapper driver is bound as a MISC device, so probe here
+        * to register the musb device early.
+        */
+       if (IS_ENABLED(CONFIG_USB_MUSB_TI)) {
+               ret = uclass_first_device_err(UCLASS_MISC, &dev);
+               if (ret)
+                       return ret;
+       }
 
 #if defined(CONFIG_DM_ETH) && defined(CONFIG_USB_ETHER)
        usb_ether_init();