[PATCH v6 10/14] am33xx: Support upstream devicetree USB device

Markus Schneider-Pargmann (TI)
2026-04-15T16:05:27Z

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.

Reviewed-by: Kory Maincent <kory.maincent@bootlin.com>
Signed-off-by: Markus Schneider-Pargmann (TI) <msp@baylibre.com>
---
arch/arm/mach-omap2/am33xx/board.c | 16 +++++++++++-----
1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/arch/arm/mach-omap2/am33xx/board.c b/arch/arm/mach-omap2/am33xx/board.c
index c3931900622957a5499fe6483473c61e3a62fff0..20556b8fb5f1eb469469006b3483003f716146b8 100644
--- a/arch/arm/mach-omap2/am33xx/board.c
+++ b/arch/arm/mach-omap2/am33xx/board.c
@@ -266,11 +266,17 @@ int arch_misc_init(void)
struct udevice *dev;
int ret;

- /*
- * Trigger probe of the UCLASS_MISC device which is a USB wrapper driver
- * ti-musb-wrapper that handles all usb host and gadget devices.
- */
- ret = uclass_first_device_err(UCLASS_MISC, &dev);
+ if (IS_ENABLED(CONFIG_OF_UPSTREAM)) {
+ uclass_first_device_err(UCLASS_USB, &dev);
+ ret = uclass_first_device_err(UCLASS_USB_GADGET_GENERIC, &dev);
+ } else {
+ /*
+ * Trigger probe of the UCLASS_MISC device which is a USB
+ * wrapper driver ti-musb-wrapper that handles all usb host and
+ * gadget devices.
+ */
+ ret = uclass_first_device_err(UCLASS_MISC, &dev);
+ }
if (ret)
printf("Failed probing USB %d, continue without USB\n", ret);

--
2.53.0