[RFC PATCH 0/5] drivers: usb: dwc3: sync code with Linux v6.16-rc1
Jerome Forissier
jerome.forissier at linaro.org
Fri Nov 21 16:37:49 CET 2025
The DWC3 USB driver was forked from the Linux kernel v3.19-rc1 eleven
years ago by commit 85d5e7075f33 ("usb: dwc3: add dwc3 folder from linux
kernel to u-boot"). Since then, not many kernel changes have been ported
back into to U-Boot. This series is an attempt at synchronizing the code
with a somewhat current kernel (namely, v6.16.rc7 which was the latest
released when this effort was started).
- The first three commits ("usb: dwc3: re-import from kernel v6.16-rc7",
"usb: host: re-import xhci-ext-caps.h from kernel", usb: gadget:
re-import epautoconf.c from kernel v6.16-rc7" and "usb: udc: re-import
udc-core.c from kernel v6.16-rc7") replace files with their counterpart
from the kernel, unmodified.
- The last commit ("usb: fix build after resync of DWC3 with kernel
v6.16-rc7") makes the necessary changes to adapt to U-Boot and fix the
build.
Note that this is mostly compile-tested only. The CI pipeline on
source.denx.de was used as a OK/NOK indicator [0]. Only one config was
actually tested on real hardware: xilinx_zynqmp_kria_defconfig. With the
help of a custom build script [1] and with an additional patch [2], I
could boot the Kria KV260 board and make it detect a USB SSD plugged into
one of its USB 3.0 ports. It certainly doesn't mean all platforms using
the DWC3 driver are still OK, but at least there is some hope. If this
breaks your platform I'd like to know, and if you can send a fix it's
even better.
I realize this is a big change and I did it this way essentially to get
going and be able to post this RFC. But I am not saying this is the way
the re-sync has to be done. Feedback is welcome.
[0] https://source.denx.de/u-boot/custodians/u-boot-net/-/pipelines/28449
[1] https://source.denx.de/u-boot/u-boot-extras/-/raw/master/contrib/jforissier/zynqmp_kv260_build.sh
[2] https://gitlab.com/Linaro/trustedsubstrate/meta-ts/-/raw/master/meta-trustedsubstrate/recipes-bsp/u-boot/u-boot/zynqmp-kria-starter/0001-kv260-fix-usb.patch
Jerome Forissier (5):
usb: dwc3: re-import from kernel v6.16-rc7
usb: host: re-import xhci-ext-caps.h from kernel v6.16-rc7
usb: gadget: re-import epautoconf.c from kernel v6.16-rc7
usb: udc: re-import udc-core.c from kernel v6.16-rc7
usb: fix build after resync of DWC3 with kernel v6.16-rc7
drivers/usb/cdns3/ep0.c | 8 +-
drivers/usb/common/common.c | 23 +
drivers/usb/dwc3/Makefile | 57 +-
drivers/usb/dwc3/core.c | 1810 +++++++----
drivers/usb/dwc3/core.h | 1112 +++++--
drivers/usb/dwc3/debug.h | 432 +++
drivers/usb/dwc3/dwc3-omap.c | 2 -
drivers/usb/dwc3/ep0.c | 761 +++--
drivers/usb/dwc3/gadget.c | 4114 ++++++++++++++++--------
drivers/usb/dwc3/gadget.h | 124 +-
drivers/usb/dwc3/glue.h | 36 +
drivers/usb/dwc3/io.h | 29 +-
drivers/usb/dwc3/linux-compat.h | 16 -
drivers/usb/dwc3/samsung_usb_phy.c | 77 -
drivers/usb/dwc3/ti_usb_phy.c | 2 -
drivers/usb/gadget/at91_udc.c | 46 -
drivers/usb/gadget/atmel_usba_udc.c | 110 +-
drivers/usb/gadget/ci_udc.c | 419 ---
drivers/usb/gadget/composite.c | 2 +-
drivers/usb/gadget/dwc2_udc_otg.c | 186 +-
drivers/usb/gadget/epautoconf.c | 289 +-
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 | 1096 ++++++-
drivers/usb/host/xhci-dwc3.c | 4 +-
drivers/usb/host/xhci-ext-caps.h | 158 +
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 +
43 files changed, 7673 insertions(+), 4105 deletions(-)
create mode 100644 drivers/usb/dwc3/debug.h
create mode 100644 drivers/usb/dwc3/glue.h
delete mode 100644 drivers/usb/dwc3/linux-compat.h
delete mode 100644 drivers/usb/dwc3/samsung_usb_phy.c
create mode 100644 drivers/usb/host/xhci-ext-caps.h
--
2.48.1
base-commit: 0f865ab5d68484b4dc1724809de1be06edc85df1
branch: usb-dwc3-resync2
More information about the U-Boot
mailing list