All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anders Roxell <anders.roxell@linaro.org>
To: u-boot@lists.u-boot-project.org
Cc: marek.vasut@mailbox.org, trini@konsulko.com,
	ilias.apalodimas@linaro.org, michal.simek@amd.com, lukma@denx.de,
	alchark@flipper.net, jerome.forissier@arm.com,
	dlechner@baylibre.com, anshuld@ti.com, sjg@chromium.org,
	Thinh.Nguyen@synopsys.com,
	Anders Roxell <anders.roxell@linaro.org>
Subject: [PATCH v8 00/25] usb: dwc3: part 2, make the resynced code work
Date: Wed,  9 Sep 2026 10:49:50 +0200	[thread overview]
Message-ID: <20260909085015.2480097-1-anders.roxell@linaro.org> (raw)

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. 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.

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_v8
[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/

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. u-boot has wmb() in asm/io.h.
- Part one is untouched.

v6 -> v7:
- Split the series in two. Tom asked for this, so review and iteration
  gets easier. Part one is the reset and the imports, part two makes it
  work.
- v6 never reached the list in full. My send died in the middle, so the
  cover letter and the last patches went missing.

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

Cheers,
Anders

Anders Roxell (25):
  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

 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                |   56 +
 39 files changed, 1413 insertions(+), 4005 deletions(-)
 create mode 100644 drivers/usb/dwc3/samsung_usb_phy.c

-- 
2.53.0


             reply	other threads:[~2026-09-09 12:45 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-09  8:49 Anders Roxell [this message]
2026-09-09  8:49 ` [PATCH v8 01/25] dm: add helpers needed by the resynced DWC3 code Anders Roxell
2026-09-09  8:49 ` [PATCH v8 02/25] usb: phy: add the usb_phy " Anders Roxell
2026-09-09  8:49 ` [PATCH v8 03/25] usb: gadget: adapt the gadget API after the resync Anders Roxell
2026-09-09  8:49 ` [PATCH v8 04/25] usb: gadget: udc: make udc-core build in u-boot Anders Roxell
2026-09-09  8:49 ` [PATCH v8 05/25] usb: dwc3: make the core driver " Anders Roxell
2026-09-09  8:49 ` [PATCH v8 06/25] usb: dwc3: bring back the samsung usb phy driver Anders Roxell
2026-09-09  8:49 ` [PATCH v8 07/25] usb: dwc3: make gadget and ep0 build in u-boot Anders Roxell
2026-09-09  8:49 ` [PATCH v8 08/25] usb: gadget: udc: enable async callbacks on bind Anders Roxell
2026-09-09  8:49 ` [PATCH v8 09/25] usb: dwc3: ep0: flush and invalidate cache around ep0 transfers Anders Roxell
2026-09-09  8:50 ` [PATCH v8 10/25] usb: dwc3: gadget: flush and invalidate cache around transfers Anders Roxell
2026-09-09  8:50 ` [PATCH v8 11/25] usb: dwc3: make the am62 glue build in u-boot Anders Roxell
2026-09-09  8:50 ` [PATCH v8 12/25] usb: gadget: ci_udc: move to the udc-core registration Anders Roxell
2026-09-09  8:50 ` [PATCH v8 13/25] usb: gadget: ci_udc: set endpoint capabilities Anders Roxell
2026-09-09  8:50 ` [PATCH v8 14/25] usb: gadget: dwc2_udc_otg: fix up after the resync Anders Roxell
2026-09-09  8:50 ` [PATCH v8 15/25] usb: gadget: fix up the function drivers " Anders Roxell
2026-09-09  8:50 ` [PATCH v8 16/25] usb: gadget: fix up the last UDC " Anders Roxell
2026-09-09  8:50 ` [PATCH v8 17/25] usb: gadget: atmel_usba_udc: set endpoint capabilities Anders Roxell
2026-09-09  8:50 ` [PATCH v8 18/25] usb: gadget: at91_udc: register with udc-core Anders Roxell
2026-09-09  8:50 ` [PATCH v8 19/25] usb: gadget: at91_udc: set endpoint capabilities Anders Roxell
2026-09-09  8:50 ` [PATCH v8 20/25] usb: musb-new: fix up after the resync Anders Roxell
2026-09-09  8:50 ` [PATCH v8 21/25] usb: musb-new: set endpoint capabilities Anders Roxell
2026-09-09  8:50 ` [PATCH v8 22/25] usb: mtu3: fix up after the resync Anders Roxell
2026-09-09  8:50 ` [PATCH v8 23/25] usb: mtu3: set endpoint capabilities Anders Roxell
2026-09-09  8:50 ` [PATCH v8 24/25] usb: host: xhci: fix up after the resync Anders Roxell
2026-09-09  8:50 ` [PATCH v8 25/25] usb: cdns3: " Anders Roxell
2026-09-09 17:53 ` [PATCH v8 00/25] usb: dwc3: part 2, make the resynced code work Marek Vasut

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260909085015.2480097-1-anders.roxell@linaro.org \
    --to=anders.roxell@linaro.org \
    --cc=Thinh.Nguyen@synopsys.com \
    --cc=alchark@flipper.net \
    --cc=anshuld@ti.com \
    --cc=dlechner@baylibre.com \
    --cc=ilias.apalodimas@linaro.org \
    --cc=jerome.forissier@arm.com \
    --cc=lukma@denx.de \
    --cc=marek.vasut@mailbox.org \
    --cc=michal.simek@amd.com \
    --cc=sjg@chromium.org \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.u-boot-project.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.