Hi Jules, On Wed, Jan 22, 2020 at 04:49:50PM +0100, Jules Maselbas wrote: > Signed-off-by: Jules Maselbas <jmaselbas@xxxxxxxxx> > --- > drivers/usb/dwc2/Makefile | 2 +- > drivers/usb/dwc2/core.h | 8 +- > drivers/usb/dwc2/dwc2.c | 2 + > drivers/usb/dwc2/dwc2.h | 2 + > drivers/usb/dwc2/gadget.c | 2668 +++++++++++++++++++++++++++++++++++++ > drivers/usb/dwc2/regs.h | 1 + > 6 files changed, 2681 insertions(+), 2 deletions(-) > create mode 100644 drivers/usb/dwc2/gadget.c > + > +int dwc2_gadget_init(struct dwc2 *dwc2) > +{ > + u32 dctl; > + int epnum; > + int ret; > + > + dwc2_core_init(dwc2); This is called once during probe here and once during host init, it should probably only be called once. I would expect both host and gadget support to be optional, but instead both is unconditionally compiled in. Does this link when USB host or gadget support is disabled? How does the driver select between host and gadget mode? Normally we do not have any real OTG support in barebox. With dr_mode = "otg" in the device tree we usually register some device which the user can use to specify the mode during runtime. How is this solved here? Sascha -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ barebox mailing list barebox@xxxxxxxxxxxxxxxxxxx http://lists.infradead.org/mailman/listinfo/barebox