mirror of
https://github.com/u-boot/u-boot.git
synced 2025-04-18 02:44:37 +00:00
usb: dwc3: gadget: Fix match_ep callback for NXP UUU tool
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: 1918b8010c
("usb: dwc3: gadget: Convert epautoconf workaround to match_ep callback")
Signed-off-by: Marek Vasut <marex@denx.de>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Link: https://lore.kernel.org/r/20250319220805.219001-1-marex@denx.de
Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
This commit is contained in:
parent
7ad5436194
commit
0916053ebc
1 changed files with 18 additions and 1 deletions
|
@ -1631,8 +1631,25 @@ usb_ep *dwc3_gadget_match_ep(struct usb_gadget *gadget,
|
||||||
return dwc3_find_ep(gadget, "ep1in");
|
return dwc3_find_ep(gadget, "ep1in");
|
||||||
if (usb_endpoint_is_bulk_out(desc))
|
if (usb_endpoint_is_bulk_out(desc))
|
||||||
return dwc3_find_ep(gadget, "ep2out");
|
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 dwc3_find_ep(gadget, "ep3in");
|
||||||
|
}
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue