[PATCH] usb: gadget: renesas: add support for RZ/G2L SoC

Michele Bisogno micbis.openwrt at gmail.com
Thu Apr 16 16:14:33 CEST 2026


Hi Marek,

Thank you for the review and the link to the Linux implementation.

> Regulator change should be a separate patch please.

I agree. I will split the regulator changes into a separate patch
for the v2 series to keep the subsystem changes distinct.

> drivers/usb/gadget/rcar is pulled from Linux 1b4861e32e46...
> but none of these changes in this patch are even in Linux next.

The RZ/G2L support in Linux relies heavily on DMA for data transfers.
In U-Boot, we are primarily using the PIO path. The refactoring
in fifo.c (switching to ioread8/iowrite8) was found to be necessary
to handle trailing bytes and alignment specifically for the RZ/G2L
bus when DMA is not active.

Additionally, the usb_del_gadget_udc() change in common.c addresses
a re-entrancy bug unique to U-Boot's gadget lifecycle. Without
this, the UDC list becomes stale, causing the board to crash if
a command like 'ums' is executed more than once.

> The addition of RZ/G2L into USBHS driver in Linux was much simpler

I agree that moving the RZ/G2L specifics in common.c to a platform
dependent file (similar to Linux) would be the cleaner long-term
architecture. However, doing so would require a much more invasive
refactoring of the existing driver structure. I opted for these
minimal changes to maintain stability for existing R-Car Gen3
users while enabling RZ/G2L support.

I will prepare a v2 series with the patches split as requested.

Kind regards,
Michele


More information about the U-Boot mailing list