All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v9 00/26] usb: dwc3: part 2, make the resynced code work
@ 2026-09-16 12:38 Anders Roxell
  2026-09-16 12:38 ` [PATCH v9 01/26] x86: asm: io.h: add rmb() and wmb() Anders Roxell
                   ` (27 more replies)
  0 siblings, 28 replies; 35+ messages in thread
From: Anders Roxell @ 2026-09-16 12:38 UTC (permalink / raw)
  To: u-boot
  Cc: marek.vasut, trini, ilias.apalodimas, michal.simek, lukma,
	alchark, jerome.forissier, dlechner, anshuld, sjg, Thinh.Nguyen,
	mkorpershoek, love.kumar, Anders Roxell

Hi,

This is part two of two. It applies on top of part one [5], which resets
the DWC3 driver and imports it up to Linux v6.16. Part one alone breaks
the build for every board that enables DWC3. This part adds back the
U-Boot glue, the XHCI and UDC updates and the build fixes, so the tree
builds and the gadget works again. It builds on Jerome's work [2].

The two parts have to go in together.

Part one is unchanged since v7, so I did not resend it. All 63 patches
there have a Reviewed-by from Mattijs.

The resynced epautoconf matches endpoints on their caps field instead of
on their name. Five UDC drivers never filled that in, so each one gets a
patch next to its other fixup: at91_udc, atmel_usba_udc, ci_udc, musb-new
and mtu3. With those and dwc2, every UDC driver in the tree sets caps.

Build tested one board per driver: every DWC3 glue layer in the tree,
dwc2 with and without DM_USB_GADGET, at91_udc, atmel_usba_udc, ci_udc,
musb-new and mtu3. 17 boards in total.

DFU and ums are tested on hardware on BeagleBoard-X15. Anshul tested DFU
and ums on AM62p and BeaglePlay. ci_udc is tested on an i.MX93 board with
ums. Love tested v7 on AMD/Xilinx boards. The rest is build tested only.

One thing is still open. Anshul sees a single "unknown endpoint event 0"
line on AM62p during enumeration. It is there with and without the cache
patch, and the transfers work anyway. I do not see it on X15, and we do
not know yet if it is older than this series.

x86 builds again, but CI still fails on am335x_evm. The SPL does not fit
in SRAM anymore, it is 184 bytes too big. The resynced udc-core is bigger
and am335x_evm had almost no room left before this series. I would like
some input on how to handle it.

The branch has both parts [4].

[1] v5: https://lore.kernel.org/u-boot/20260716134305.614278-1-anders.roxell@linaro.org/
[2] Jerome's adaptation work: https://lore.kernel.org/all/20251121153812.2076440-1-jerome.forissier@linaro.org/
[3] dwc2 prep: https://lore.kernel.org/all/20260703-usb-prep-dwc3-sync-v1-0-1352bc238c9b@kernel.org/
[4] https://github.com/roxell/u-boot/tree/usb_dwc3_sync_v9
[5] part one: https://lore.kernel.org/u-boot/20260824152734.159794-1-anders.roxell@linaro.org/
    subject: [PATCH v7 00/63] usb: dwc3: part 1, reset and import from
    Linux v6.16
[6] v7 part two: https://lore.kernel.org/u-boot/20260824154133.217744-1-anders.roxell@linaro.org/
[7] v8 part two: https://lore.kernel.org/u-boot/20260909085015.2480097-1-anders.roxell@linaro.org/

v8 -> v9:
- New patch first in the series, "x86: asm: io.h: add rmb() and wmb()".
  v8 kept the two wmb() in dwc3 gadget.c, but x86 only had dmb() and
  mb(). So the x86 boards did not build and Marek's CI failed [7].
- "dm: add helpers needed by the resynced DWC3 code": picked up
  Reviewed-by from Mattijs.
- "usb: phy: add the usb_phy helpers needed by the resynced DWC3 code":
  picked up Reviewed-by from Mattijs. Added the blank line before the
  last return that he asked for.
- u-boot -> U-Boot in all commit messages. Mattijs pointed it out on two
  patches, and the same spelling was used in 8 more. Four subjects change
  because of this.
- Part one is untouched.

v7 -> v8:
- New patch, "usb: dwc3: gadget: flush and invalidate cache around
  transfers". The resync dropped the cache maintenance for the normal
  endpoints, so ums did not work. Anshul found it on AM62p and
  BeaglePlay, and we both tested the fix.
- "make gadget and ep0 build in u-boot" no longer comments out the two
  wmb() in dwc3 gadget.c. They come from the kernel import and the port
  had no reason to remove them.

Older changes are listed in v7 [6] and v5 [1].

Cheers,
Anders

Anders Roxell (26):
  x86: asm: io.h: add rmb() and wmb()
  dm: add helpers needed by the resynced DWC3 code
  usb: phy: add the usb_phy helpers needed by the resynced DWC3 code
  usb: gadget: adapt the gadget API after the resync
  usb: gadget: udc: make udc-core build in U-Boot
  usb: dwc3: make the core driver build in U-Boot
  usb: dwc3: bring back the samsung usb phy driver
  usb: dwc3: make gadget and ep0 build in U-Boot
  usb: gadget: udc: enable async callbacks on bind
  usb: dwc3: ep0: flush and invalidate cache around ep0 transfers
  usb: dwc3: gadget: flush and invalidate cache around transfers
  usb: dwc3: make the am62 glue build in U-Boot
  usb: gadget: ci_udc: move to the udc-core registration
  usb: gadget: ci_udc: set endpoint capabilities
  usb: gadget: dwc2_udc_otg: fix up after the resync
  usb: gadget: fix up the function drivers after the resync
  usb: gadget: fix up the last UDC drivers after the resync
  usb: gadget: atmel_usba_udc: set endpoint capabilities
  usb: gadget: at91_udc: register with udc-core
  usb: gadget: at91_udc: set endpoint capabilities
  usb: musb-new: fix up after the resync
  usb: musb-new: set endpoint capabilities
  usb: mtu3: fix up after the resync
  usb: mtu3: set endpoint capabilities
  usb: host: xhci: fix up after the resync
  usb: cdns3: fix up after the resync

 arch/x86/include/asm/io.h              |    2 +
 drivers/usb/cdns3/ep0.c                |    8 +-
 drivers/usb/dwc3/Makefile              |   16 +-
 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                 |  117 +-
 drivers/usb/dwc3/gadget.c              |  724 ++--------
 drivers/usb/dwc3/gadget.h              |    4 +-
 drivers/usb/dwc3/io.h                  |   36 +-
 drivers/usb/dwc3/samsung_usb_phy.c     |   77 ++
 drivers/usb/dwc3/ti_usb_phy.c          |    2 -
 drivers/usb/gadget/at91_udc.c          |   83 +-
 drivers/usb/gadget/atmel_usba_udc.c    |  114 +-
 drivers/usb/gadget/ci_udc.c            |   86 +-
 drivers/usb/gadget/composite.c         |    2 +-
 drivers/usb/gadget/dwc2_udc_otg.c      |   86 +-
 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      |  933 ++-----------
 drivers/usb/host/xhci-dwc3.c           |    4 +-
 drivers/usb/mtu3/mtu3_gadget.c         |   10 +
 drivers/usb/mtu3/mtu3_gadget_ep0.c     |   16 +-
 drivers/usb/musb-new/musb_gadget.c     |   21 +-
 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                      |   51 +
 include/linux/compat.h                 |   15 +
 include/linux/usb/ch9.h                |   25 +-
 include/linux/usb/gadget.h             |  529 ++-----
 include/linux/usb/phy.h                |   57 +
 40 files changed, 1416 insertions(+), 4005 deletions(-)
 create mode 100644 drivers/usb/dwc3/samsung_usb_phy.c

-- 
2.53.0


^ permalink raw reply	[flat|nested] 35+ messages in thread

end of thread, other threads:[~2026-10-13 14:24 UTC | newest]

Thread overview: 35+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-16 12:38 [PATCH v9 00/26] usb: dwc3: part 2, make the resynced code work Anders Roxell
2026-09-16 12:38 ` [PATCH v9 01/26] x86: asm: io.h: add rmb() and wmb() Anders Roxell
2026-09-16 12:38 ` [PATCH v9 02/26] dm: add helpers needed by the resynced DWC3 code Anders Roxell
2026-09-16 12:38 ` [PATCH v9 03/26] usb: phy: add the usb_phy " Anders Roxell
2026-09-16 12:38 ` [PATCH v9 04/26] usb: gadget: adapt the gadget API after the resync Anders Roxell
2026-09-16 12:38 ` [PATCH v9 05/26] usb: gadget: udc: make udc-core build in U-Boot Anders Roxell
2026-09-16 12:38 ` [PATCH v9 06/26] usb: dwc3: make the core driver " Anders Roxell
2026-09-16 12:38 ` [PATCH v9 07/26] usb: dwc3: bring back the samsung usb phy driver Anders Roxell
2026-09-16 12:38 ` [PATCH v9 08/26] usb: dwc3: make gadget and ep0 build in U-Boot Anders Roxell
2026-09-16 12:38 ` [PATCH v9 09/26] usb: gadget: udc: enable async callbacks on bind Anders Roxell
2026-09-16 12:38 ` [PATCH v9 10/26] usb: dwc3: ep0: flush and invalidate cache around ep0 transfers Anders Roxell
2026-09-16 12:38 ` [PATCH v9 11/26] usb: dwc3: gadget: flush and invalidate cache around transfers Anders Roxell
2026-09-16 12:38 ` [PATCH v9 12/26] usb: dwc3: make the am62 glue build in U-Boot Anders Roxell
2026-09-16 12:38 ` [PATCH v9 13/26] usb: gadget: ci_udc: move to the udc-core registration Anders Roxell
2026-09-16 12:38 ` [PATCH v9 14/26] usb: gadget: ci_udc: set endpoint capabilities Anders Roxell
2026-09-16 12:38 ` [PATCH v9 15/26] usb: gadget: dwc2_udc_otg: fix up after the resync Anders Roxell
2026-09-16 12:38 ` [PATCH v9 16/26] usb: gadget: fix up the function drivers " Anders Roxell
2026-09-16 12:38 ` [PATCH v9 17/26] usb: gadget: fix up the last UDC " Anders Roxell
2026-09-16 12:38 ` [PATCH v9 18/26] usb: gadget: atmel_usba_udc: set endpoint capabilities Anders Roxell
2026-09-16 12:38 ` [PATCH v9 19/26] usb: gadget: at91_udc: register with udc-core Anders Roxell
2026-09-16 12:38 ` [PATCH v9 20/26] usb: gadget: at91_udc: set endpoint capabilities Anders Roxell
2026-09-16 12:38 ` [PATCH v9 21/26] usb: musb-new: fix up after the resync Anders Roxell
2026-09-16 12:38 ` [PATCH v9 22/26] usb: musb-new: set endpoint capabilities Anders Roxell
2026-09-16 12:38 ` [PATCH v9 23/26] usb: mtu3: fix up after the resync Anders Roxell
2026-09-16 12:38 ` [PATCH v9 24/26] usb: mtu3: set endpoint capabilities Anders Roxell
2026-09-16 12:38 ` [PATCH v9 25/26] usb: host: xhci: fix up after the resync Anders Roxell
2026-09-16 12:38 ` [PATCH v9 26/26] usb: cdns3: " Anders Roxell
2026-09-17 12:43 ` [PATCH v9 00/26] usb: dwc3: part 2, make the resynced code work Anshul Dalal
2026-09-25  9:59   ` Anders Roxell
2026-09-25 10:39     ` Siddharth Vadapalli
2026-09-29 10:07       ` Anders Roxell
2026-09-29 13:05         ` Siddharth Vadapalli
2026-09-30 12:10           ` Anders Roxell
2026-10-02 14:17 ` Quentin Schulz
2026-10-13 13:02   ` Anders Roxell

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.