<feed xmlns='http://www.w3.org/2005/Atom'>
<title>u-boot.git/drivers/usb/dwc3/gadget.c, branch main</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.</subtitle>
<id>http://cgit.235523.xyz/u-boot.git/atom/drivers/usb/dwc3/gadget.c?h=main</id>
<link rel='self' href='http://cgit.235523.xyz/u-boot.git/atom/drivers/usb/dwc3/gadget.c?h=main'/>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/'/>
<updated>2026-01-30T07:59:21Z</updated>
<entry>
<title>usb: dwc3: gadget: Don't send unintended link state change</title>
<updated>2026-01-30T07:59:21Z</updated>
<author>
<name>Chris Morgan</name>
<email>macromorgan@hotmail.com</email>
</author>
<published>2026-01-15T23:01:34Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=de69f14a0991f3b9afe78dc0721a9184d297e303'/>
<id>urn:sha1:de69f14a0991f3b9afe78dc0721a9184d297e303</id>
<content type='text'>
DCTL.ULSTCHNGREQ is a write-only field. When doing a read-modify-write
to DCTL, the driver must make sure that there's no unintended link state
change request from whatever is read from DCTL.ULSTCHNGREQ. Set link
state change to no-action when the driver writes to DCTL.

Note that this patch was submitted upstream in Linux in 2020 [1],
and I've confirmed I need it in U-Boot to enable gadget mode.

[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/patch/drivers/usb/dwc3?id=5b738211fb59e114727381d07c647a77c0010996

Signed-off-by: Thinh Nguyen &lt;thinhn@synopsys.com&gt;
Signed-off-by: Chris Morgan &lt;macromorgan@hotmail.com&gt;
Reviewed-by: Mattijs Korpershoek &lt;mkorpershoek@kernel.org&gt;
Link: https://lore.kernel.org/r/20260115230135.183158-4-macroalpha82@gmail.com
Signed-off-by: Mattijs Korpershoek &lt;mkorpershoek@kernel.org&gt;
</content>
</entry>
<entry>
<title>usb: dwc3: Increase DWC3 controller halt timeout</title>
<updated>2026-01-30T07:59:21Z</updated>
<author>
<name>Chris Morgan</name>
<email>macromorgan@hotmail.com</email>
</author>
<published>2026-01-15T23:01:33Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=7590f29e2cd72fb8ed50efde3cdb786d74dc1f10'/>
<id>urn:sha1:7590f29e2cd72fb8ed50efde3cdb786d74dc1f10</id>
<content type='text'>
Since EP0 transactions need to be completed before the controller halt
sequence is finished, this may take some time depending on the host and the
enabled functions.  Increase the controller halt timeout, so that we give
the controller sufficient time to handle EP0 transfers.

This patch was originally submitted to Linux in 2022, but is required to
use USB gadget mode on my device in U-Boot.

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

Signed-off-by: Wesley Cheng &lt;quic_wcheng@quicinc.com&gt;
Signed-off-by: Chris Morgan &lt;macromorgan@hotmail.com&gt;
Reviewed-by: Mattijs Korpershoek &lt;mkorpershoek@kernel.org&gt;
Link: https://lore.kernel.org/r/20260115230135.183158-3-macroalpha82@gmail.com
Signed-off-by: Mattijs Korpershoek &lt;mkorpershoek@kernel.org&gt;
</content>
</entry>
<entry>
<title>usb: dwc3: gadget: Fix excepts/expects typo</title>
<updated>2025-04-10T07:58:56Z</updated>
<author>
<name>Marek Vasut</name>
<email>marex@denx.de</email>
</author>
<published>2025-03-24T14:39:43Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=7cedd20ed384a9748bba3fee05d504674109087a'/>
<id>urn:sha1:7cedd20ed384a9748bba3fee05d504674109087a</id>
<content type='text'>
Fix the excepts typo to expects , no functional change.

Fixes: 0916053ebc56 ("usb: dwc3: gadget: Fix match_ep callback for NXP UUU tool")
Signed-off-by: Marek Vasut &lt;marex@denx.de&gt;
Reviewed-by: Neil Armstrong &lt;neil.armstrong@linaro.org&gt;
Reviewed-by: Mattijs Korpershoek &lt;mkorpershoek@baylibre.com&gt;
Link: https://lore.kernel.org/r/20250324143956.91791-1-marex@denx.de
Signed-off-by: Mattijs Korpershoek &lt;mkorpershoek@kernel.org&gt;
</content>
</entry>
<entry>
<title>usb: dwc3: gadget: Fix match_ep callback for NXP UUU tool</title>
<updated>2025-03-21T08:37:40Z</updated>
<author>
<name>Marek Vasut</name>
<email>marex@denx.de</email>
</author>
<published>2025-03-19T22:07:52Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=0916053ebc566245b06d0a179533f6622b6ad392'/>
<id>urn:sha1:0916053ebc566245b06d0a179533f6622b6ad392</id>
<content type='text'>
The UUU tool excepts the interrupt-in endpoint to be ep1in, otherwise
it crashes. This is a result of the previous hard-coded EP setup in
drivers/usb/gadget/epautoconf.c which did special-case EP allocation
for SPL builds, and which was since converted to this callback, but
without the special-case EP allocation in SPL part.

This reinstates the SPL part in an isolated manner, only for NXP iMX
SoCs, only for SPL builds, and only for the ep1in interrupt-in endpoint.

Fixes: 1918b8010c32 ("usb: dwc3: gadget: Convert epautoconf workaround to match_ep callback")
Signed-off-by: Marek Vasut &lt;marex@denx.de&gt;
Reviewed-by: Mattijs Korpershoek &lt;mkorpershoek@baylibre.com&gt;
Link: https://lore.kernel.org/r/20250319220805.219001-1-marex@denx.de
Signed-off-by: Mattijs Korpershoek &lt;mkorpershoek@baylibre.com&gt;
</content>
</entry>
<entry>
<title>usb: dwc3: invalidate dcache on buffer used in interrupt handling</title>
<updated>2024-10-15T09:03:57Z</updated>
<author>
<name>Neil Armstrong</name>
<email>neil.armstrong@linaro.org</email>
</author>
<published>2024-10-11T14:38:26Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=3e47302dd71267b85e5ec65c5b6d881c23cce6cb'/>
<id>urn:sha1:3e47302dd71267b85e5ec65c5b6d881c23cce6cb</id>
<content type='text'>
On Qualcomm systems, the setup buffer and even buffers are in
a bad state at interrupt handling, so invalidate the dcache lines
for the setup_buf and event buffer to make sure we read correct
data written by the hardware.

This fixes the following error:
dwc3-generic-peripheral usb@a600000: UNKNOWN IRQ type -1
dwc3-generic-peripheral usb@a600000: UNKNOWN IRQ type 4673109

and invalid situation in dwc3_gadget_giveback() because setup_buf content
is read at 0s and leads to fatal crash fixed by [1].

[1] https://lore.kernel.org/all/20240528-topic-sm8x50-dwc3-gadget-crash-fix-v1-1-58434ab4b3d3@linaro.org/

Reviewed-by: Mattijs Korpershoek &lt;mkorpershoek@baylibre.com&gt;
Signed-off-by: Neil Armstrong &lt;neil.armstrong@linaro.org&gt;
Reviewed-by: Marek Vasut &lt;marex@denx.de&gt;
Link: https://lore.kernel.org/r/20241011-u-boot-dwc3-gadget-dcache-fixup-v4-3-5f3498d8035b@linaro.org
Signed-off-by: Mattijs Korpershoek &lt;mkorpershoek@baylibre.com&gt;
</content>
</entry>
<entry>
<title>usb: dwc3: allocate setup_buf with dma_alloc_coherent()</title>
<updated>2024-10-15T09:03:56Z</updated>
<author>
<name>Neil Armstrong</name>
<email>neil.armstrong@linaro.org</email>
</author>
<published>2024-10-11T14:38:24Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=1f12fc7e3350b179d17efaf5ba00fc3683cf33ec'/>
<id>urn:sha1:1f12fc7e3350b179d17efaf5ba00fc3683cf33ec</id>
<content type='text'>
Since setup_buf is also consumed by hardware DMA, aligns it's
allocation like other hardware buffers by introduce setup_buf_addr
populated by dma_alloc_coherent(), and use it to pass the physical
address of the buffer to the hardware.

Reviewed-by: Mattijs Korpershoek &lt;mkorpershoek@baylibre.com&gt;
Reviewed-by: Marek Vasut &lt;marex@denx.de&gt;
Signed-off-by: Neil Armstrong &lt;neil.armstrong@linaro.org&gt;
Link: https://lore.kernel.org/r/20241011-u-boot-dwc3-gadget-dcache-fixup-v4-1-5f3498d8035b@linaro.org
Signed-off-by: Mattijs Korpershoek &lt;mkorpershoek@baylibre.com&gt;
</content>
</entry>
<entry>
<title>drivers: usb: Remove duplicate newlines</title>
<updated>2024-07-22T16:53:06Z</updated>
<author>
<name>Marek Vasut</name>
<email>marek.vasut+renesas@mailbox.org</email>
</author>
<published>2024-07-20T12:41:03Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=85168f15d1be3c6e0f36b864a78779660aa915bc'/>
<id>urn:sha1:85168f15d1be3c6e0f36b864a78779660aa915bc</id>
<content type='text'>
Drop all duplicate newlines. No functional change.

Signed-off-by: Marek Vasut &lt;marek.vasut+renesas@mailbox.org&gt;
</content>
</entry>
<entry>
<title>usb: dwc3: gadget: Convert epautoconf workaround to match_ep callback</title>
<updated>2024-07-05T12:01:22Z</updated>
<author>
<name>Marek Vasut</name>
<email>marek.vasut+renesas@mailbox.org</email>
</author>
<published>2024-06-09T21:32:19Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=1918b8010c321c939fdedd6e461ccac87e0d3415'/>
<id>urn:sha1:1918b8010c321c939fdedd6e461ccac87e0d3415</id>
<content type='text'>
Use the .match_ep() callback instead of workaround in core code.
Replace descriptor parsing with ch9 macros with the same effect.
Drop the SPL specific behavior, it is unclear why SPL should even
be special.

Signed-off-by: Marek Vasut &lt;marek.vasut+renesas@mailbox.org&gt;
Tested-by: Alexander Sverdlin &lt;alexander.sverdlin@siemens.com&gt;
Reviewed-by: Mattijs Korpershoek &lt;mkorpershoek@baylibre.com&gt;
Tested-by: Mattijs Korpershoek &lt;mkorpershoek@baylibre.com&gt; # on vim3
Link: https://lore.kernel.org/r/20240609213449.194762-6-marek.vasut+renesas@mailbox.org
Signed-off-by: Mattijs Korpershoek &lt;mkorpershoek@baylibre.com&gt;
</content>
</entry>
<entry>
<title>Merge tag 'v2024.07-rc5' into next</title>
<updated>2024-06-24T19:34:52Z</updated>
<author>
<name>Tom Rini</name>
<email>trini@konsulko.com</email>
</author>
<published>2024-06-24T19:34:52Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=a7eada24327a40f7ef6c55c220e119839c9d4227'/>
<id>urn:sha1:a7eada24327a40f7ef6c55c220e119839c9d4227</id>
<content type='text'>
Prepare v2024.07-rc5
</content>
</entry>
<entry>
<title>usb: dwc3: gadget: fix crash in dwc3_gadget_giveback()</title>
<updated>2024-06-04T06:30:05Z</updated>
<author>
<name>Neil Armstrong</name>
<email>neil.armstrong@linaro.org</email>
</author>
<published>2024-05-28T08:35:03Z</published>
<link rel='alternate' type='text/html' href='http://cgit.235523.xyz/u-boot.git/commit/?id=85ced6f4745f529098cae38a5bd3144035a1318c'/>
<id>urn:sha1:85ced6f4745f529098cae38a5bd3144035a1318c</id>
<content type='text'>
If the ep0 stalls or request are dequeued when gagdet is stopped,
the request dma may not be mapped yet and dwc3_flush_cache() may be
called with a NULL pointer.

Check req-&gt;request.dma before calling dwc3_flush_cache() and later
the usb_gadget_unmap_request() functions since it means that
usb_gadget_map_request() hasn't been called yet.

Fixes: fd15b58c1a9 ("dwc3: flush cache only if there is a buffer attached to a request")
Signed-off-by: Neil Armstrong &lt;neil.armstrong@linaro.org&gt;
Reviewed-by: Mattijs Korpershoek &lt;mkorpershoek@baylibre.com&gt;
Link: https://lore.kernel.org/r/20240528-topic-sm8x50-dwc3-gadget-crash-fix-v1-1-58434ab4b3d3@linaro.org
Signed-off-by: Mattijs Korpershoek &lt;mkorpershoek@baylibre.com&gt;
</content>
</entry>
</feed>
