[PATCH 1/6] drivers/Makefile: Fix TPL build with dwc3 generic

Arnaud Patard arnaud.patard at collabora.com
Tue Feb 11 09:51:50 CET 2025


On Mon, 2025-02-10 at 09:51 -0600, Tom Rini wrote:
> On Mon, Feb 10, 2025 at 03:29:58PM +0000, Arnaud Patard wrote:
> > When building TPL with DWC3 generic enabled, the following error is
> > occuring:
> > aarch64-linux-gnu-ld.bfd: drivers/usb/dwc3/dwc3-generic.o: in
> > function `dwc3_glue_bind_common':
> > .../drivers/usb/dwc3/dwc3-generic.c:527: undefined reference to
> > `usb_get_dr_mode'
> > .../drivers/usb/dwc3/dwc3-
> > generic.c:527:(.text.dwc3_glue_bind_common+0x20): relocation
> > truncated to fit: R_AARCH64_CALL26 against undefined symbol
> > `usb_get_dr_mode'
> > aarch64-linux-gnu-ld.bfd: .../drivers/usb/dwc3/dwc3-generic.c:529:
> > undefined reference to `usb_get_dr_mode'
> > .../drivers/usb/dwc3/dwc3-
> > generic.c:529:(.text.dwc3_glue_bind_common+0x2c): relocation
> > truncated to fit: R_AARCH64_CALL26 against undefined symbol
> > `usb_get_dr_mode'
> > aarch64-linux-gnu-ld.bfd: drivers/usb/dwc3/dwc3-generic.o: in
> > function `dwc3_glue_probe':
> > .../drivers/usb/dwc3/dwc3-generic.c:683: undefined reference to
> > `usb_get_dr_mode'
> > .../drivers/usb/dwc3/dwc3-
> > generic.c:683:(.text.dwc3_glue_probe+0xb0): relocation truncated to
> > fit: R_AARCH64_CALL26 against undefined symbol `usb_get_dr_mode'
> > make[1]: *** [scripts/Makefile.xpl:544: tpl/u-boot-tpl] Error 1
> > make: *** [Makefile:2137: tpl/u-boot-tpl] Error 2
> > 
> > Enable building drivers/usb/common.c in TPL.
> > 
> > Signed-off-by: Arnaud Patard <arnaud.patard at collabora.com>
> > ---
> >  drivers/Makefile | 1 +
> >  1 file changed, 1 insertion(+)
> > 
> > diff --git a/drivers/Makefile b/drivers/Makefile
> > index 0e1f58c515b..7cee5750396 100644
> > --- a/drivers/Makefile
> > +++ b/drivers/Makefile
> > @@ -78,6 +78,7 @@ endif
> >  ifdef CONFIG_TPL_BUILD
> >  
> >  obj-$(CONFIG_TPL_MPC8XXX_INIT_DDR) += ddr/fsl/
> > +obj-$(CONFIG_USB_GADGET) += usb/common/
> >  
> >  endif
> 
> Do we really need DWC3 in TPL?
> 

No, not really but I failed at finding a way to not get DWC3 built for
TPL. I tried to modify the Kconfig files with no success. So, I took a
different approach.
For DFU over SPL, it's obviously only needed in SPL for DFU and in u-
boot proper.

Arnaud


More information about the U-Boot mailing list