diff mbox series

[U-Boot,v1,04/16] spl: net: dm: usb: bind the gadget before attempting to load the image

Message ID 1542797478-5885-5-git-send-email-jjhiblot@ti.com
State Superseded
Delegated to: Marek Vasut
Headers show
Series Add support for DM_USB and DM_USB_DEV to TI's am335x and am43xx_evm platforms | expand

Commit Message

Jean-Jacques Hiblot Nov. 21, 2018, 10:51 a.m. UTC
If DM_USB_GADGET is used, the usb ethernet gadget driver must be bound to a
controller before the image can be downloaded over the network.
In u-boot this can be done with the bind command. In SPL it must be done
programmatically.

Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
---

 common/spl/spl_net.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Tom Rini Nov. 22, 2018, 1:28 p.m. UTC | #1
On Wed, Nov 21, 2018 at 11:51:06AM +0100, Jean-Jacques Hiblot wrote:

> If DM_USB_GADGET is used, the usb ethernet gadget driver must be bound to a
> controller before the image can be downloaded over the network.
> In u-boot this can be done with the bind command. In SPL it must be done
> programmatically.
> 
> Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>

Reviewed-by: Tom Rini <trini@konsulko.com>
diff mbox series

Patch

diff --git a/common/spl/spl_net.c b/common/spl/spl_net.c
index b6967ff..15d7915 100644
--- a/common/spl/spl_net.c
+++ b/common/spl/spl_net.c
@@ -85,7 +85,9 @@  int spl_net_load_image_usb(struct spl_image_info *spl_image,
 			   struct spl_boot_device *bootdev)
 {
 	bootdev->boot_device_name = "usb_ether";
-
+#ifdef CONFIG_DM_USB_GADGET
+	usb_ether_init();
+#endif
 	return spl_net_load_image(spl_image, bootdev);
 }
 SPL_LOAD_IMAGE_METHOD("USB eth", 0, BOOT_DEVICE_USBETH, spl_net_load_image_usb);