[U-Boot] [PATCH] usb: dwc2: Init desc_before_addr

Marek Vasut marex at denx.de
Tue Apr 26 03:08:24 CEST 2016


Initialize desc_before_addr, otherwise the USB core won't send the
first 64B Get Device Descriptor request in common/usb.c function
usb_setup_descriptor() . There are some USB devices which expect
this sequence and otherwise can misbehave.

Signed-off-by: Marek Vasut <marex at denx.de>
Cc: Dinh Nguyen <dinguyen at opensource.altera.com>
Cc: Tom Rini <trini at konsulko.com>
---
 drivers/usb/host/dwc2.c | 3 +++
 1 file changed, 3 insertions(+)
---
NOTE: I checked this with TotalPhase Beagle USB480 and it does what it is
      supposed to do now. It would be wonderful to get this into rc3.

diff --git a/drivers/usb/host/dwc2.c b/drivers/usb/host/dwc2.c
index b2f4bc6..559c43f 100644
--- a/drivers/usb/host/dwc2.c
+++ b/drivers/usb/host/dwc2.c
@@ -1182,6 +1182,9 @@ static int dwc2_usb_ofdata_to_platdata(struct udevice *dev)
 static int dwc2_usb_probe(struct udevice *dev)
 {
 	struct dwc2_priv *priv = dev_get_priv(dev);
+	struct usb_bus_priv *bus_priv = dev_get_uclass_priv(dev);
+
+	bus_priv->desc_before_addr = true;
 
 	return dwc2_init_common(priv);
 }
-- 
2.7.0



More information about the U-Boot mailing list