[PATCH 1/3] rockchip: Fix TPL link error
Tom Rini
trini at konsulko.com
Wed Jan 29 16:29:26 CET 2025
On Wed, Jan 29, 2025 at 03:16:13PM +0100, Quentin Schulz wrote:
> Hi Naoki,
>
> On 1/29/25 2:25 PM, FUKAUMI Naoki wrote:
> > Rockchip RK3399 targets build TPL. If CONFIG_SPL_USB_DWC3_GENERIC and
> > CONFIG_SPL_USB_GADGET are enabled, linking u-boot-tpl will fail.
> >
> > LD tpl/u-boot-tpl
> > ld.bfd: drivers/usb/dwc3/dwc3-generic.o: in function `dwc3_glue_bind_common':
> > /home/radxa/u-boot/drivers/usb/dwc3/dwc3-generic.c:527:(.text.dwc3_glue_bind_common+0x20): undefined reference to `usb_get_dr_mode'
> > /home/radxa/u-boot/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'
> > ld.bfd: /home/radxa/u-boot/drivers/usb/dwc3/dwc3-generic.c:529:(.text.dwc3_glue_bind_common+0x2c): undefined reference to `usb_get_dr_mode'
> > /home/radxa/u-boot/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'
> > ld.bfd: drivers/usb/dwc3/dwc3-generic.o: in function `dwc3_glue_probe':
> > /home/radxa/u-boot/drivers/usb/dwc3/dwc3-generic.c:683:(.text.dwc3_glue_probe+0xb0): undefined reference to `usb_get_dr_mode'
> > /home/radxa/u-boot/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'
> >
> > Do not compile drivers/usb/ for TPL.
> >
> > Signed-off-by: FUKAUMI Naoki <naoki at radxa.com>
> > ---
> > scripts/Makefile.xpl | 4 ++--
> > 1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/scripts/Makefile.xpl b/scripts/Makefile.xpl
> > index abc49fbe6c9..e4ca4d395ac 100644
> > --- a/scripts/Makefile.xpl
> > +++ b/scripts/Makefile.xpl
> > @@ -125,8 +125,8 @@ endif
> > libs-y += drivers/
> > libs-$(CONFIG_SPL_MEMORY) += drivers/memory/
> > -libs-$(CONFIG_SPL_USB_GADGET) += drivers/usb/dwc3/
> > -libs-$(CONFIG_SPL_USB_GADGET) += drivers/usb/cdns3/
> > +libs-$(CONFIG_$(PHASE_)USB_GADGET) += drivers/usb/dwc3/
> > +libs-$(CONFIG_$(PHASE_)USB_GADGET) += drivers/usb/cdns3/
>
> I don't know what this is actually used for? Like why is it different from
> the typical Makefile we have for other subsystems and drivers?
>
> Can't we simply remove those and add them in drivers/Makefile, like:
>
> obj-$(CONFIG_$(PHASE_)USB_GADGET) += usb/dwc3/
> obj-$(CONFIG_$(PHASE_)USB_GADGET) += usb/cdns3/
>
> For example?
The likely answer is that we used to not have consistent CONFIG naming
here between SPL support and non-SPL support, and while that's since
been corrected, this part was never updated to take advantage of that.
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20250129/a145ca76/attachment.sig>
More information about the U-Boot
mailing list