<feed xmlns='http://www.w3.org/2005/Atom'>
<title>u-boot.git/drivers/usb/gadget, branch next</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.</subtitle>
<id>http://cgit.235523.xyz/u-boot.git/atom/drivers/usb/gadget?h=next</id>
<link rel='self' href='http://cgit.235523.xyz/u-boot.git/atom/drivers/usb/gadget?h=next'/>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/'/>
<updated>2026-07-22T07:16:16Z</updated>
<entry>
<title>usb: ci_udc: verify all dtds are inactive before completing request</title>
<updated>2026-07-22T07:16:16Z</updated>
<author>
<name>Jason He</name>
<email>jason.he_1@nxp.com</email>
</author>
<published>2026-05-22T07:55:12Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=b6056097247385c24c23ef39ebc04238336d11e2'/>
<id>urn:sha1:b6056097247385c24c23ef39ebc04238336d11e2</id>
<content type='text'>
According to device mode spec, the ACTIVE status field of dtds should
be check to determine whether the transfers completed successfully.
However, this is not implemented in handle_ep_complete.
When two EPs are enabled and transferring, EPa requests with multiple dtds
and EPb request with one dtd. Irq is triggred on EPb. The udc_irq handler
finds both EPb's and EPa's ENDPTCOMPLETE=1 while not all of EPa's dtds
have been completed. Because ACTIVE status is not checked, this case
causes crash in ci_udc driver.

Signed-off-by: Jason He &lt;jason.he_1@nxp.com&gt;
Signed-off-by: Ye Li &lt;ye.li@nxp.com&gt;
Link: https://patch.msgid.link/20260522075512.1291485-3-ye.li@nxp.com
Signed-off-by: Mattijs Korpershoek &lt;mkorpershoek@kernel.org&gt;
</content>
</entry>
<entry>
<title>usb: ci_udc: Update usb request status</title>
<updated>2026-07-22T07:16:16Z</updated>
<author>
<name>Ye Li</name>
<email>ye.li@nxp.com</email>
</author>
<published>2026-05-22T07:55:11Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=b79147bbd47cd2d50836dc0a57376f4820663637'/>
<id>urn:sha1:b79147bbd47cd2d50836dc0a57376f4820663637</id>
<content type='text'>
usb request status is not set in ci_udc driver. However
in ci_ep_dequeue, it checks the request status for executing
complete callback, so upper layer is not able to free these
enqueued requests when calling usb_ep_dequeue.

Signed-off-by: Ye Li &lt;ye.li@nxp.com&gt;
Fixes: 26cc5129ee64 ("USB: gadaget: add Marvell controller support")
Reviewed-by: Mattijs Korpershoek &lt;mkorpershoek@kernel.org&gt;
Link: https://patch.msgid.link/20260522075512.1291485-2-ye.li@nxp.com
Signed-off-by: Mattijs Korpershoek &lt;mkorpershoek@kernel.org&gt;
</content>
</entry>
<entry>
<title>usb: ci_udc: set correct ep type in ep_enable()</title>
<updated>2026-07-22T07:16:16Z</updated>
<author>
<name>Xu Yang</name>
<email>xu.yang_2@nxp.com</email>
</author>
<published>2026-05-22T07:55:10Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=eed2ed75883bdf029be9325fb9dd9263d921372e'/>
<id>urn:sha1:eed2ed75883bdf029be9325fb9dd9263d921372e</id>
<content type='text'>
The Endpoint Type in ENDPTCTRL register should be correctly set
according to endpoint descriptor, not fixed to bulk. Otherwise,
unexpected behaviors may happen.

Fixes: 26cc5129ee64 ("USB: gadaget: add Marvell controller support")
Signed-off-by: Xu Yang &lt;xu.yang_2@nxp.com&gt;
Signed-off-by: Ye Li &lt;ye.li@nxp.com&gt;
Reviewed-by: Mattijs Korpershoek &lt;mkorpershoek@kernel.org&gt;
Link: https://patch.msgid.link/20260522075512.1291485-1-ye.li@nxp.com
Signed-off-by: Mattijs Korpershoek &lt;mkorpershoek@kernel.org&gt;
</content>
</entry>
<entry>
<title>usb: gadget: dwc2: Set endpoint capabilities via .caps field</title>
<updated>2026-07-22T06:54:16Z</updated>
<author>
<name>Mattijs Korpershoek</name>
<email>mkorpershoek@kernel.org</email>
</author>
<published>2026-07-03T13:29:37Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=c5c4cc4c6b9887858e168d5106f8f1d3dfb6c3e8'/>
<id>urn:sha1:c5c4cc4c6b9887858e168d5106f8f1d3dfb6c3e8</id>
<content type='text'>
Endpoint capabilities can be described via the .caps field of
struct usb_ep since commit
77dcbdf3c1ce ("usb: gadget: Add match_ep() op to usb_gadget_ops")

In linux, the following commit introduces it:
b86f33a3a371 ("usb: gadget: epautoconf: add endpoint capabilities flags verification")

Linux's change also reworks the ep matching function by relying on
these new capabilities instead of guessing based on the endpoint name.

Prepare the dwc2 UDC driver for capability-based matching by adding the
required capabilities for each endpoint.

Acked-by: Ilias Apalodimas &lt;ilias.apalodimas@linaro.org&gt;
Link: https://patch.msgid.link/20260703-usb-prep-dwc3-sync-v1-2-1352bc238c9b@kernel.org
Signed-off-by: Mattijs Korpershoek &lt;mkorpershoek@kernel.org&gt;
</content>
</entry>
<entry>
<title>usb: gadget: dwc2: Use usb_ep_set_maxpacket_limit() for fifo sizes</title>
<updated>2026-07-22T06:54:16Z</updated>
<author>
<name>Mattijs Korpershoek</name>
<email>mkorpershoek@kernel.org</email>
</author>
<published>2026-07-03T13:29:36Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=6f9c431a20627db34e0c41ea865c611f0d2c2016'/>
<id>urn:sha1:6f9c431a20627db34e0c41ea865c611f0d2c2016</id>
<content type='text'>
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.

Acked-by: Ilias Apalodimas &lt;ilias.apalodimas@linaro.org&gt;
Link: https://patch.msgid.link/20260703-usb-prep-dwc3-sync-v1-1-1352bc238c9b@kernel.org
Signed-off-by: Mattijs Korpershoek &lt;mkorpershoek@kernel.org&gt;
</content>
</entry>
<entry>
<title>cmd: ums: Set Device Descriptor iSerial based on serial# env variable</title>
<updated>2026-07-22T06:53:37Z</updated>
<author>
<name>Marek Vasut</name>
<email>marex@nabladev.com</email>
</author>
<published>2026-06-26T14:28:17Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=3caa8f42e1f657177780be5a445502cbb9181e43'/>
<id>urn:sha1:3caa8f42e1f657177780be5a445502cbb9181e43</id>
<content type='text'>
The DFU code currently sets the content of "serial#" environment
variable into Device Descriptor iSerial field. This is useful when
there are multiple devices connected to the same host PC and they
have to be told apart. Replicate the same behavior in the UMS code.

Example without serial# set, which is the original behavior:
"
u-boot=&gt; ums 0 mmc 1
UMS: LUN 0, dev mmc 1, hwpart 0, sector 0x0, count 0x1d5a000

$ dmesg -w
...
usb 5-2.3.7: New USB device found, idVendor=0525, idProduct=a4a5, bcdDevice=7e.a7
usb 5-2.3.7: New USB device strings: Mfr=1, Product=2, SerialNumber=0
usb 5-2.3.7: Product: USB download gadget
usb 5-2.3.7: Manufacturer: Vendor
                            &lt;------------------------------- NOT HERE
usb-storage 5-2.3.7:1.0: USB Mass Storage device detected
...

$ lsusb -vd 0525:a4a5

Bus 005 Device 051: ID 0525:a4a5 Netchip Technology, Inc. Linux-USB File-backed Storage Gadget
Negotiated speed: High Speed (480Mbps)
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            0 [unknown]
  bDeviceSubClass         0 [unknown]
  bDeviceProtocol         0
  bMaxPacketSize0        64
  idVendor           0x0525 Netchip Technology, Inc.
  idProduct          0xa4a5 Linux-USB File-backed Storage Gadget
  bcdDevice           7e.a7
  iManufacturer           1 Vendor
  iProduct                2 USB download gadget
  iSerial                 0 &lt;------------------------------- NOT HERE
...
"

Example with serial# set to 1234abcd, which is the optional new behavior:
"
u-boot=&gt; setenv serial# 1234abcd &lt;------------------------------ HERE
u-boot=&gt; ums 0 mmc 1
UMS: LUN 0, dev mmc 1, hwpart 0, sector 0x0, count 0x1d5a000

$ dmesg -w
...
usb 5-2.3.7: New USB device found, idVendor=0525, idProduct=a4a5, bcdDevice=7e.a7
usb 5-2.3.7: New USB device strings: Mfr=1, Product=2, SerialNumber=3
usb 5-2.3.7: Product: USB download gadget
usb 5-2.3.7: Manufacturer: Vendor
usb 5-2.3.7: SerialNumber: 1234abcd &lt;--------------------------- HERE
usb-storage 5-2.3.7:1.0: USB Mass Storage device detected
...

$ lsusb -vd 0525:a4a5

Bus 005 Device 052: ID 0525:a4a5 Netchip Technology, Inc. Linux-USB File-backed Storage Gadget
Negotiated speed: High Speed (480Mbps)
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            0 [unknown]
  bDeviceSubClass         0 [unknown]
  bDeviceProtocol         0
  bMaxPacketSize0        64
  idVendor           0x0525 Netchip Technology, Inc.
  idProduct          0xa4a5 Linux-USB File-backed Storage Gadget
  bcdDevice           7e.a7
  iManufacturer           1 Vendor
  iProduct                2 USB download gadget
  iSerial                 3 1234abcd &lt;-------------------------- HERE
...
"

Signed-off-by: Marek Vasut &lt;marex@nabladev.com&gt;
Reviewed-by: Mattijs Korpershoek &lt;mkorpershoek@kernel.org&gt;
Link: https://patch.msgid.link/20260626142840.305478-1-marex@nabladev.com
Signed-off-by: Mattijs Korpershoek &lt;mkorpershoek@kernel.org&gt;
</content>
</entry>
<entry>
<title>usb: gadget: f_mass_storage: Disable eps during disconnect</title>
<updated>2026-06-26T09:05:21Z</updated>
<author>
<name>Mattijs Korpershoek</name>
<email>mkorpershoek@kernel.org</email>
</author>
<published>2026-06-17T11:14:48Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=1c758ce38caa783c85129753c1ecc9d14a203d8e'/>
<id>urn:sha1:1c758ce38caa783c85129753c1ecc9d14a203d8e</id>
<content type='text'>
When trying two ums commands in a row, the second one no longer
enumerates properly from the host.

This happens since commit
59310d1ecb9f ("usb: gadget: introduce 'enabled' flag in struct usb_ep")
causing usb_ep_enable() to return early when ep-&gt;enabled is already set.

Gadget function drivers (such as f_fastboot or f_mass_storage) implement
a disable() function which is called whenever we are done using the
gadget.

Because f_mass_storage driver does not disable the endpoints,
ep-&gt;enabled will never be set to false again.

This can be reproduced on the STM32MP157C-DK2 or the Khadas VIM3 boards.

Add calls to usb_ep_disable() as done in linux [1] to fix this.

[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=9fff139aeb11186fd8e75860c959c86cb43ab2f6

Fixes: 59310d1ecb9f ("usb: gadget: introduce 'enabled' flag in struct usb_ep")
Reported-by: Patrice Chotard &lt;patrice.chotard@foss.st.com&gt;
Reviewed-by: Patrice Chotard &lt;patrice.chotard@foss.st.com&gt;
Link: https://patch.msgid.link/20260617-ums-disconnect-v2-1-6e52d9de1d36@kernel.org
Signed-off-by: Mattijs Korpershoek &lt;mkorpershoek@kernel.org&gt;
</content>
</entry>
<entry>
<title>usb: f_sdp: handle the spl load function failure</title>
<updated>2026-06-26T09:01:42Z</updated>
<author>
<name>Ye Li</name>
<email>ye.li@nxp.com</email>
</author>
<published>2026-05-22T07:27:05Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=eec819b98439c50f8ea38ac078ff6a862ea03038'/>
<id>urn:sha1:eec819b98439c50f8ea38ac078ff6a862ea03038</id>
<content type='text'>
Current implementation does not check the return value of spl load
function. If the spl load is failed, SPL may meet crash due to
spl_image variable is not initialized. Add the failure check,
so SPL can print and stop with error.

Signed-off-by: Ye Li &lt;ye.li@nxp.com&gt;
Fixes: 2c72ead73874 ("usb: gadget: f_sdp: Allow SPL to load and boot FIT via SDP")
Reviewed-by: Mattijs Korpershoek &lt;mkorpershoek@kernel.org&gt;
Link: https://patch.msgid.link/20260522072705.1156220-1-ye.li@nxp.com
Signed-off-by: Mattijs Korpershoek &lt;mkorpershoek@kernel.org&gt;
</content>
</entry>
<entry>
<title>Kconfig: usb: restyle</title>
<updated>2026-06-25T20:58:13Z</updated>
<author>
<name>Johan Jonker</name>
<email>jbx6244@gmail.com</email>
</author>
<published>2026-06-10T14:40:27Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=8b09b702d488799ee42fbc7be3b8434e8a1c2fa0'/>
<id>urn:sha1:8b09b702d488799ee42fbc7be3b8434e8a1c2fa0</id>
<content type='text'>
Restyle all Kconfigs for "usb":
Menu entries   : no space left
Menu attributes: 1 TAB
Help text      : 1 TAB + 2 spaces
Replace '---help---' by 'help'

Signed-off-by: Johan Jonker &lt;jbx6244@gmail.com&gt;
</content>
</entry>
<entry>
<title>usb: gadget: atmel: use calloc() to allocate endpoint list</title>
<updated>2026-06-15T07:15:25Z</updated>
<author>
<name>Zixun LI</name>
<email>admin@hifiphile.com</email>
</author>
<published>2026-06-06T08:27:09Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=033eb908d0a8ed938bc652f34a2d702a29a8726f'/>
<id>urn:sha1:033eb908d0a8ed938bc652f34a2d702a29a8726f</id>
<content type='text'>
malloc() doesn't zero out memory, leaving ep-&gt;ep.enabled uninitiated,
which could make this flag falsely true.

In next usb_ep_enable() call since this flag is true, ep-&gt;ops-&gt;enable()
will be skipped. Then usb_ep_queue() will fail on uninitialized endpoint.

Fixes: 59310d1ecb9f ("usb: gadget: introduce 'enabled' flag in struct usb_ep")
Signed-off-by: Zixun LI &lt;admin@hifiphile.com&gt;
Reviewed-by: Marek Vasut &lt;marek.vasut+usb@mailbox.org&gt;
Reviewed-by: Mattijs Korpershoek &lt;mkorpershoek@kernel.org&gt;
Link: https://patch.msgid.link/20260606-udc_malloc-v2-1-1155326b182b@hifiphile.com
Signed-off-by: Mattijs Korpershoek &lt;mkorpershoek@kernel.org&gt;
</content>
</entry>
</feed>
