From: Mattijs Korpershoek <mkorpershoek@kernel.org>
To: u-boot@lists.denx.de
Cc: Lukasz Majewski <lukma@denx.de>, Marek Vasut <marex@nabladev.com>,
Tom Rini <trini@konsulko.com>,
Ilias Apalodimas <ilias.apalodimas@linaro.org>,
Jonas Karlman <jonas@kwiboo.se>,
Mattijs Korpershoek <mkorpershoek@kernel.org>
Subject: [PATCH 1/2] usb: gadget: dwc2: Use usb_ep_set_maxpacket_limit() for fifo sizes
Date: Fri, 03 Jul 2026 15:29:36 +0200 [thread overview]
Message-ID: <20260703-usb-prep-dwc3-sync-v1-1-1352bc238c9b@kernel.org> (raw)
In-Reply-To: <20260703-usb-prep-dwc3-sync-v1-0-1352bc238c9b@kernel.org>
More recent versions of usb_ep_autoconfig() use the maxpacket_limit
field from struct usb_ep.
This field has been introduced in the linux kernel via commit
e117e742d310 ("usb: gadget: add "maxpacket_limit" field to struct usb_ep")
And has been ported to U-Boot via commit
747a0a5b387f ("usb: dwc3: gadget: make dwc3 gadget build in uboot")
However, the dwc2 gadget driver was not converted to use
usb_ep_set_maxpacket_limit().
This is harmless for now, but the driver will break once
usb_ep_autoconfig() is updated to a more recent version.
Set maxpacket_limit via the recommended helper function to prepare for
a core gadget update.
Signed-off-by: Mattijs Korpershoek <mkorpershoek@kernel.org>
---
drivers/usb/gadget/dwc2_udc_otg.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/drivers/usb/gadget/dwc2_udc_otg.c b/drivers/usb/gadget/dwc2_udc_otg.c
index e475b14b9ac3..9c85383fd62a 100644
--- a/drivers/usb/gadget/dwc2_udc_otg.c
+++ b/drivers/usb/gadget/dwc2_udc_otg.c
@@ -828,7 +828,6 @@ static struct dwc2_udc memory = {
.ep = {
.name = ep0name,
.ops = &dwc2_ep_ops,
- .maxpacket = EP0_FIFO_SIZE,
},
.dev = &memory,
@@ -843,7 +842,6 @@ static struct dwc2_udc memory = {
.ep = {
.name = "ep1in-bulk",
.ops = &dwc2_ep_ops,
- .maxpacket = EP_FIFO_SIZE,
},
.dev = &memory,
@@ -858,7 +856,6 @@ static struct dwc2_udc memory = {
.ep = {
.name = "ep2out-bulk",
.ops = &dwc2_ep_ops,
- .maxpacket = EP_FIFO_SIZE,
},
.dev = &memory,
@@ -873,7 +870,6 @@ static struct dwc2_udc memory = {
.ep = {
.name = "ep3in-int",
.ops = &dwc2_ep_ops,
- .maxpacket = EP_FIFO_SIZE,
},
.dev = &memory,
@@ -893,6 +889,7 @@ int dwc2_udc_probe(struct dwc2_plat_otg_data *pdata)
{
struct dwc2_udc *dev = &memory;
int retval = 0;
+ int i;
debug("%s: %p\n", __func__, pdata);
@@ -909,6 +906,10 @@ int dwc2_udc_probe(struct dwc2_plat_otg_data *pdata)
the_controller = dev;
+ usb_ep_set_maxpacket_limit(&dev->ep[0].ep, EP0_FIFO_SIZE);
+ for (i = 1; i < DWC2_MAX_ENDPOINTS; i++)
+ usb_ep_set_maxpacket_limit(&dev->ep[i].ep, EP_FIFO_SIZE);
+
usb_ctrl = memalign(CONFIG_SYS_CACHELINE_SIZE,
ROUND(sizeof(struct usb_ctrlrequest),
CONFIG_SYS_CACHELINE_SIZE));
--
2.54.0
next prev parent reply other threads:[~2026-07-03 13:30 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-03 13:29 [PATCH 0/2] usb: gadget: dwc2: Prepare for UDC core migration Mattijs Korpershoek
2026-07-03 13:29 ` Mattijs Korpershoek [this message]
2026-07-09 9:21 ` [PATCH 1/2] usb: gadget: dwc2: Use usb_ep_set_maxpacket_limit() for fifo sizes Ilias Apalodimas
2026-07-03 13:29 ` [PATCH 2/2] usb: gadget: dwc2: Set endpoint capabilities via .caps field Mattijs Korpershoek
2026-07-09 9:22 ` Ilias Apalodimas
2026-07-22 6:54 ` [PATCH 0/2] usb: gadget: dwc2: Prepare for UDC core migration Mattijs Korpershoek via U-Boot
2026-07-22 7:02 ` Mattijs Korpershoek via U-Boot
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=20260703-usb-prep-dwc3-sync-v1-1-1352bc238c9b@kernel.org \
--to=mkorpershoek@kernel.org \
--cc=ilias.apalodimas@linaro.org \
--cc=jonas@kwiboo.se \
--cc=lukma@denx.de \
--cc=marex@nabladev.com \
--cc=trini@konsulko.com \
--cc=u-boot@lists.denx.de \
/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.