[PATCH v2 6/7] am33xx: Support upstream devicetree binding

Kory Maincent kory.maincent at bootlin.com
Tue Dec 2 17:19:40 CET 2025


On Tue, 02 Dec 2025 16:50:03 +0100
"Markus Schneider-Pargmann" <msp at baylibre.com> wrote:

> 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)" <msp at baylibre.com> 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) <msp at baylibre.com>
> >> ---
> >>  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.

Indeed I missed it from the last line of your commit message.
Maybe it should be in a separate patch as this change current boot behavior and
it is unrelated to you UCLASS USB change.
Also I have noticed that your patch subject is a bit vague, you don't talk
about USB at all. 

Regards,
-- 
Köry Maincent, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com


More information about the U-Boot mailing list