On Thu May 7, 2026 at 2:58 PM IST, Jens Wiklander wrote:
> From: Jerome Forissier <[email protected]>
>
> Fix build errors after the re-sync of the DWC3 driver with the kernel.
> U-Boot has different needs than the kernel: buses, interrupts, internal
> APIs (DMA, traces, DT...) so many adaptations are required. This commit
> re-introduces many of the changes that were done locally after the
> initial import of the DWC3 code from kernel 3.19-rc1 11 years ago, as
> well as other fixes. This is compile-tested only.
>
> Signed-off-by: Jerome Forissier <[email protected]>
> Signed-off-by: Jens Wiklander <[email protected]>
> ---
>  drivers/usb/cdns3/ep0.c                |    8 +-
>  drivers/usb/common/common.c            |   23 +
>  drivers/usb/dwc3/Makefile              |   57 +-
>  drivers/usb/dwc3/core.c                | 1761 ++++++------------------
>  drivers/usb/dwc3/core.h                |   39 +-
>  drivers/usb/dwc3/dwc3-am62.c           |  424 +-----
>  drivers/usb/dwc3/dwc3-omap.c           |    2 -
>  drivers/usb/dwc3/ep0.c                 |  110 +-
>  drivers/usb/dwc3/gadget.c              |  786 +++--------
>  drivers/usb/dwc3/gadget.h              |    4 +-
>  drivers/usb/dwc3/io.h                  |   28 +-
>  drivers/usb/dwc3/ti_usb_phy.c          |    2 -
>  drivers/usb/gadget/at91_udc.c          |   46 -
>  drivers/usb/gadget/atmel_usba_udc.c    |  102 +-
>  drivers/usb/gadget/ci_udc.c            |  419 ------
>  drivers/usb/gadget/composite.c         |    2 +-
>  drivers/usb/gadget/dwc2_udc_otg.c      |  174 +--
>  drivers/usb/gadget/epautoconf.c        |    2 -
>  drivers/usb/gadget/ether.c             |   21 +-
>  drivers/usb/gadget/f_acm.c             |   20 +-
>  drivers/usb/gadget/f_fastboot.c        |   10 +-
>  drivers/usb/gadget/f_mass_storage.c    |    5 +-
>  drivers/usb/gadget/f_rockusb.c         |   11 +-
>  drivers/usb/gadget/f_sdp.c             |   12 +-
>  drivers/usb/gadget/f_thor.c            |   19 +-
>  drivers/usb/gadget/udc/Makefile        |    1 +
>  drivers/usb/gadget/udc/udc-core.c      | 1021 +++-----------
>  drivers/usb/host/xhci-dwc3.c           |    4 +-
>  drivers/usb/host/xhci-exynos5.c        |    2 +-
>  drivers/usb/mtu3/mtu3_gadget_ep0.c     |   16 +-
>  drivers/usb/musb-new/musb_gadget_ep0.c |   24 +-
>  drivers/usb/musb-new/musb_uboot.c      |   39 -
>  include/dm/device_compat.h             |   13 +
>  include/dm/read.h                      |   46 +
>  include/linux/compat.h                 |   15 +
>  include/linux/usb/ch9.h                |   25 +-
>  include/linux/usb/gadget.h             |  520 ++-----
>  include/linux/usb/otg.h                |   10 +
>  include/linux/usb/phy.h                |   56 +
>  39 files changed, 1347 insertions(+), 4532 deletions(-)
>

[snip]

> diff --git a/drivers/usb/dwc3/Makefile b/drivers/usb/dwc3/Makefile
> index a619cd374fb4..ae1725756c0e 100644
> --- a/drivers/usb/dwc3/Makefile
> +++ b/drivers/usb/dwc3/Makefile
> @@ -1,18 +1,59 @@
> -# SPDX-License-Identifier: GPL-2.0+
> -
> +# SPDX-License-Identifier: GPL-2.0
>  obj-$(CONFIG_USB_DWC3)                       += dwc3.o
>  
>  dwc3-y                                       := core.o
>  
> -obj-$(CONFIG_USB_DWC3_GADGET)                += gadget.o ep0.o
> +ifneq ($(filter y,$(CONFIG_USB_DWC3_HOST) $(CONFIG_USB_DWC3_DUAL_ROLE)),)
> +     dwc3-y                          += host.o
> +endif
> +
> +ifneq ($(filter y,$(CONFIG_USB_DWC3_GADGET) $(CONFIG_USB_DWC3_DUAL_ROLE)),)
> +     dwc3-y                          += gadget.o ep0.o
> +endif
> +
> +ifneq ($(CONFIG_USB_DWC3_DUAL_ROLE),)
> +     dwc3-y                          += drd.o
> +endif
> +
> +ifneq ($(CONFIG_USB_DWC3_ULPI),)
> +     dwc3-y                          += ulpi.o
> +endif
> +
> +ifneq ($(CONFIG_DEBUG_FS),)
> +     dwc3-y                          += debugfs.o
> +endif
> +
> +##
> +# Platform-specific glue layers go here
> +#
> +# NOTICE: Make sure your glue layer doesn't depend on anything
> +# which is arch-specific and that it compiles on all situations.
> +#
> +# We want to keep this requirement in order to be able to compile
> +# the entire driver (with all its glue layers) on several architectures
> +# and make sure it compiles fine. This will also help with allmodconfig
> +# and allyesconfig builds.
> +##
>  
> -obj-$(CONFIG_$(PHASE_)USB_DWC3_AM62) += dwc3-am62.o
> +obj-$(CONFIG_USB_DWC3_AM62)          += dwc3-am62.o

Why is this change being made here? We need dwc3-am62 driver at SPL
stage for DFU boot on K3 devices. The Kconfig should have a
corresponding CONFIG_SPL_USB_DWC3_AM62 symbol as well.

Regards,
Anshul

Reply via email to