summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Rini <[email protected]>2025-03-21 07:29:08 -0600
committerTom Rini <[email protected]>2025-03-21 07:29:08 -0600
commit244e61fbb7f5045e4e187024f7ae80434c952145 (patch)
treeaa59cc65ccb3db7315871258546756825c6baf2b
parent7ad543619463e8817b3044041ac74749a217bbe0 (diff)
parent0916053ebc566245b06d0a179533f6622b6ad392 (diff)
Merge tag 'u-boot-dfu-20250321' of https://source.denx.de/u-boot/custodians/u-boot-dfu
u-boot-dfu-20250321 Usb gadget: - Fix NXP UUU tool compatibility regression with dwc3 gadget
-rw-r--r--drivers/usb/dwc3/gadget.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
index e5a383407a2..477ecd02098 100644
--- a/drivers/usb/dwc3/gadget.c
+++ b/drivers/usb/dwc3/gadget.c
@@ -1631,8 +1631,25 @@ usb_ep *dwc3_gadget_match_ep(struct usb_gadget *gadget,
return dwc3_find_ep(gadget, "ep1in");
if (usb_endpoint_is_bulk_out(desc))
return dwc3_find_ep(gadget, "ep2out");
- if (usb_endpoint_is_int_in(desc))
+ if (usb_endpoint_is_int_in(desc)) {
+ /*
+ * Special workaround for NXP UUU tool in SPL.
+ *
+ * The 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.
+ */
+ if (IS_ENABLED(CONFIG_MACH_IMX) && IS_ENABLED(CONFIG_XPL_BUILD))
+ return dwc3_find_ep(gadget, "ep1in");
return dwc3_find_ep(gadget, "ep3in");
+ }
return NULL;
}